/* =========================================================
   pages-admin：运营后台（admin，只有管理员能看）页面样式
   约定：类名统一 ad- 前缀；颜色只用 style.css 里的 CSS 变量，自动适配深色模式
   ========================================================= */

/* 重新加载时保留上一次的内容，只是变淡，不闪烁、不跳动 */
.ad-body { transition: opacity .2s var(--ease); }
.ad-busy .ad-body { opacity: .6; }
.ad-controls { align-items: center; flex-wrap: wrap; }

/* ---------- 走势图 ---------- */
.ad-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 10px; font-size: 12px; color: var(--text-2); }
.ad-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ad-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ad-trend-table { max-height: 260px; overflow: auto; }

/* ---------- 账号池额度 ---------- */
.ad-quota { display: flex; flex-direction: column; }
.ad-meter + .ad-meter { margin-top: 18px; }
.ad-meter-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ad-meter-top b { font-weight: 500; }
.ad-meter-val { margin-left: auto; font-size: 13px; color: var(--text-3); }
.ad-meter-val .num { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--text); font-variant-numeric: normal; }
/* 用量条：轨道是填充色的浅色版；70% 以上变橙、90% 以上变红 */
.ad-bar { height: 8px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.ad-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .4s var(--ease); }
.ad-bar.warn { background: var(--warn-bg); }
.ad-bar.warn > i { background: var(--warn); }
.ad-bar.bad { background: var(--bad-bg); }
.ad-bar.bad > i { background: var(--bad); }
.ad-meter-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.ad-meter-foot b { font-weight: 500; color: var(--text-2); }
.ad-kvs { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ad-kv { display: flex; gap: 12px; align-items: baseline; }
.ad-kv > span { color: var(--text-3); flex: none; }
.ad-kv > b { margin-left: auto; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.ad-note { font-size: 12px; color: var(--text-3); padding-top: 8px; border-top: 1px solid var(--border); }
.ad-quota-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 12px 4px; }
.ad-quota-empty b { color: var(--text); }
.ad-quota-empty .muted { font-size: 13px; line-height: 1.6; }

/* ---------- 表格 ---------- */
.ad-search { width: 200px; height: 30px; border-radius: 9px; }    /* 字号不改：手机上输入框必须 ≥16px（style.css），否则 iOS 会放大页面 */
.ad-user { display: flex; align-items: center; gap: 6px; }
.ad-user b { font-weight: 500; }
.ad-user .tag { font-size: 11px; padding: 0 6px; }
.ad-email { font-size: 12px; color: var(--text-3); }
.ad-err { font-size: 11px; color: var(--bad); }
.ad-idle td, .ad-idle .ad-user b { color: var(--text-3); }
.ad-table td { vertical-align: middle; }

/* ---------- 无权访问 ---------- */
.ad-denied { max-width: 520px; margin: 48px auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 36px 28px; }
.ad-denied h3 { font-size: 17px; }
.ad-denied .muted { line-height: 1.7; margin-bottom: 8px; }
.ad-denied-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--fill); color: var(--text-2); }
.ad-denied-icon svg.icon { width: 24px; height: 24px; }

/* ---------- 手机 ---------- */
@media (max-width: 560px) {
  .ad-controls { width: 100%; }
  .ad-controls .segmented { flex: 1; }
  .ad-controls .segmented button { flex: 1; }
  .ad-search { width: 100%; flex: 1 1 100%; }
  .ad-denied { margin: 24px auto; padding: 28px 18px; }
}
