/* ==========================================================
   WorkBuddy API 积分控制台 —— 设计系统
   暗色 / 品牌渐变 / 玻璃质感
   ========================================================== */

:root {
  /* 底色 */
  --bg: #0a0d13;
  --bg-2: #0e131b;
  --panel: #121822;
  --panel-2: #172030;
  --panel-3: #1c2736;
  --line: #1f2937;
  --line-2: #2b3a4f;

  /* 文字 */
  --text: #e8eef7;
  --text-2: #94a3b8;
  --text-3: #64748b;

  /* 品牌 */
  --brand: #5b8cff;
  --brand-2: #8b5cf6;
  --accent: #22d3ee;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --pink: #f472b6;

  --grad: linear-gradient(135deg, #5b8cff 0%, #8b5cf6 100%);
  --grad-soft: linear-gradient(135deg, rgba(91, 140, 255, .16), rgba(139, 92, 246, .16));
  --grad-panel: linear-gradient(160deg, rgba(91, 140, 255, .07), rgba(139, 92, 246, .03) 45%, transparent 70%);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 45px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .28);

  --sidebar-w: 226px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* 背景光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(680px 420px at 12% -6%, rgba(91, 140, 255, .16), transparent 62%),
    radial-gradient(720px 480px at 96% 4%, rgba(139, 92, 246, .14), transparent 60%),
    radial-gradient(900px 600px at 50% 108%, rgba(34, 211, 238, .05), transparent 65%);
}

/* 细网格纹理 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  background-image:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

svg { display: block; }

/* ==========================================================
   登录
   ========================================================== */

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

.login-shell {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  width: 100%;
  max-width: 880px;
  background: rgba(18, 24, 34, .82);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-brand {
  padding: 44px 40px;
  background: var(--grad-soft);
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand::after {
  content: "";
  position: absolute;
  width: 320px; height: 320px;
  right: -130px; bottom: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .35), transparent 68%);
  filter: blur(6px);
}

.login-brand h1 {
  margin: 26px 0 10px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: .2px;
  background: linear-gradient(120deg, #fff 20%, #a5c0ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-brand p {
  margin: 0 0 26px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.75;
}

.login-points { display: flex; flex-direction: column; gap: 13px; position: relative; z-index: 1; }

.login-points .pt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.login-points .pt i {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(91, 140, 255, .14);
  border: 1px solid rgba(91, 140, 255, .26);
  color: #a5c0ff;
  font-style: normal;
}

.login-form-side {
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-side h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.login-form-side .sub { color: var(--text-3); font-size: 12.5px; margin-bottom: 24px; }

.login-tip {
  margin-top: 20px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .22);
  color: #fcd34d;
  font-size: 11.5px;
  line-height: 1.7;
}

/* 品牌标记 */
.wb-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wb-glyph {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(91, 140, 255, .35);
  flex: 0 0 auto;
}

.wb-glyph svg { width: 20px; height: 20px; }

.wb-name {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: .2px;
  line-height: 1.25;
}

.wb-name em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-3);
  font-size: 11px;
  display: block;
  letter-spacing: .3px;
}

/* ==========================================================
   布局
   ========================================================== */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: rgba(11, 15, 22, .78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .wb-mark { padding: 4px 8px 20px; }

.nav-group { margin-bottom: 16px; }

.nav-group-title {
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 10px 7px;
  font-weight: 600;
}

.nav-item {
  position: relative;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: background .14s, color .14s;
  margin-bottom: 2px;
}

.nav-item .ni {
  width: 17px; height: 17px;
  flex: 0 0 17px;
  opacity: .72;
  transition: opacity .14s;
}

.nav-item:hover { background: rgba(148, 163, 184, .07); color: var(--text); }
.nav-item:hover .ni { opacity: 1; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(91, 140, 255, .18), rgba(139, 92, 246, .08));
  color: #dbe6ff;
  font-weight: 500;
}

.nav-item.active .ni { opacity: 1; color: #a5c0ff; }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 17px;
  border-radius: 0 3px 3px 0;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(91, 140, 255, .8);
}

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 0 6px;
  border-radius: 20px;
  background: rgba(91, 140, 255, .18);
  color: #a5c0ff;
  line-height: 16px;
}

/* 侧栏底部用户卡 */
.user-chip {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, .06);
  border: 1px solid var(--line);
}

.avatar {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 650;
  color: #fff;
  text-transform: uppercase;
}

.user-chip .u-name {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.user-chip .u-role { font-size: 10.5px; color: var(--text-3); line-height: 1.3; }

.icon-btn {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .14s, color .14s;
}
.icon-btn:hover { background: rgba(251, 113, 133, .12); color: var(--red); }

/* 主区 */
.main {
  flex: 1;
  min-width: 0;
  padding: 0 26px 60px;
  max-width: 1500px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0 13px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 13, 19, .95) 60%, rgba(10, 13, 19, 0));
  backdrop-filter: blur(10px);
}

.crumb {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .4px;
  margin-bottom: 2px;
}
.crumb b { color: var(--brand); font-weight: 500; }

.topbar h2 { margin: 0; font-size: 18px; font-weight: 620; letter-spacing: .2px; }

.topbar .right { display: flex; align-items: center; gap: 12px; }

/* 额度胶囊 */
.quota-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 11px;
  border-radius: 30px;
  background: rgba(148, 163, 184, .07);
  border: 1px solid var(--line-2);
  font-size: 12px;
  white-space: nowrap;
}

.quota-pill .qp-label { color: var(--text-3); font-size: 11px; }
.quota-pill .qp-val { font-weight: 650; color: #a5c0ff; font-variant-numeric: tabular-nums; }

.qp-bar {
  width: 54px; height: 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, .18);
  overflow: hidden;
}
.qp-bar i { display: block; height: 100%; border-radius: 4px; background: var(--grad); }

/* ==========================================================
   Hero
   ========================================================== */

.hero {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(700px 200px at 8% -30%, rgba(91, 140, 255, .2), transparent 60%),
    radial-gradient(600px 220px at 92% -20%, rgba(139, 92, 246, .18), transparent 62%),
    rgba(18, 24, 34, .8);
  padding: 22px 24px;
  margin-bottom: 18px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, .05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148, 163, 184, .05) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(120deg, #000, transparent 65%);
  -webkit-mask-image: linear-gradient(120deg, #000, transparent 65%);
  pointer-events: none;
}

.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; position: relative; z-index: 1; }

.hero h3 { margin: 0 0 6px; font-size: 19px; font-weight: 620; letter-spacing: .2px; }
.hero h3 span { background: linear-gradient(120deg, #a5c0ff, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .hero-date { color: var(--text-3); font-size: 11.5px; letter-spacing: .4px; }

.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.insight {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 13, 19, .5);
  border: 1px solid rgba(91, 140, 255, .2);
}

.insight .ai-dot {
  width: 24px; height: 24px;
  flex: 0 0 24px;
  border-radius: 8px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 140, 255, .4);
}

.insight .ai-txt { font-size: 12.5px; line-height: 1.75; color: #c7d5ec; }
.insight .ai-txt b { color: #fff; font-weight: 600; }
.insight .ai-tag {
  font-size: 10px;
  letter-spacing: .8px;
  color: #a5c0ff;
  border: 1px solid rgba(91, 140, 255, .35);
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 7px;
  vertical-align: 1px;
  white-space: nowrap;
}

/* ==========================================================
   KPI 卡片
   ========================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  position: relative;
  background: linear-gradient(165deg, rgba(23, 32, 48, .9), rgba(18, 24, 34, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 13px;
  overflow: hidden;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}

.kpi:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--kpi-glow, rgba(91, 140, 255, .16)), transparent 68%);
  pointer-events: none;
}

.kpi .kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.kpi .label { color: var(--text-2); font-size: 12px; }

.kpi .kpi-ico {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, .09);
  border: 1px solid var(--line-2);
  color: var(--text-2);
}

.kpi .value {
  font-size: 25px;
  font-weight: 660;
  letter-spacing: .2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  position: relative;
  z-index: 1;
}

.kpi .hint {
  color: var(--text-3);
  font-size: 11.5px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.kpi.brand { --kpi-glow: rgba(91, 140, 255, .22); }
.kpi.brand .value { color: #a5c0ff; }
.kpi.brand .kpi-ico { color: #a5c0ff; background: rgba(91, 140, 255, .14); border-color: rgba(91, 140, 255, .3); }

.kpi.green { --kpi-glow: rgba(52, 211, 153, .2); }
.kpi.green .value { color: var(--green); }
.kpi.green .kpi-ico { color: var(--green); background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .28); }

.kpi.purple { --kpi-glow: rgba(139, 92, 246, .22); }
.kpi.purple .value { color: #c4b5fd; }
.kpi.purple .kpi-ico { color: #c4b5fd; background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .3); }

.kpi.amber { --kpi-glow: rgba(251, 191, 36, .2); }
.kpi.amber .value { color: var(--amber); }
.kpi.amber .kpi-ico { color: var(--amber); background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .28); }

/* 迷你走势线 */
.spark { margin-top: 10px; height: 26px; position: relative; z-index: 1; }
.spark svg { width: 100%; height: 26px; overflow: visible; }

/* ==========================================================
   面板
   ========================================================== */

.panel {
  background: rgba(18, 24, 34, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel.grad { background: var(--grad-panel), rgba(18, 24, 34, .85); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}

.panel-head .ph-title { display: flex; align-items: center; gap: 8px; }
.panel-head .ph-title .ni { color: var(--brand); opacity: .9; }
.panel-head .tiny.muted { font-weight: 400; }

.panel-body { padding: 16px 17px; }
.panel-body.tight { padding: 6px 0; }
.panel-body.zero { padding: 0; }

/* ==========================================================
   面积图
   ========================================================== */

.chart-wrap { position: relative; padding: 4px 2px 0; }

.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.chart-svg { width: 100%; height: 190px; overflow: visible; }

.chart-x { display: flex; justify-content: space-between; margin-top: 6px; padding: 0 2px; }
.chart-x span { font-size: 10.5px; color: var(--text-3); }

/* ==========================================================
   环形进度
   ========================================================== */

.ring-wrap { display: flex; align-items: center; gap: 18px; }

.ring { position: relative; width: 104px; height: 104px; flex: 0 0 104px; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring .ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.ring .ring-val { font-size: 19px; font-weight: 660; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ring .ring-lbl { font-size: 10px; color: var(--text-3); margin-top: -2px; }

.ring-legend { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ring-legend .rl-row { display: flex; justify-content: space-between; font-size: 12px; gap: 8px; }
.ring-legend .rl-row span:first-child { color: var(--text-2); }
.ring-legend .rl-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ==========================================================
   Top 模型条
   ========================================================== */

.rank-list { display: flex; flex-direction: column; gap: 13px; }

.rank-item .rk-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  margin-bottom: 5px;
  gap: 8px;
}
.rank-item .rk-name { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: #cbd5e1; }
.rank-item .rk-val { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11.5px; white-space: nowrap; }

.rank-bar { height: 6px; border-radius: 4px; background: rgba(148, 163, 184, .12); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 4px; background: var(--grad); }

/* ==========================================================
   活动流
   ========================================================== */

.feed { display: flex; flex-direction: column; }

.feed-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 17px;
  border-bottom: 1px solid rgba(31, 41, 55, .6);
  transition: background .14s;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: rgba(91, 140, 255, .04); }

.feed-dot {
  width: 7px; height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .14);
}
.feed-dot.refunded { background: var(--text-3); box-shadow: 0 0 0 3px rgba(100, 116, 139, .14); }
.feed-dot.pending { background: var(--amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, .16); }

.feed-main { flex: 1; min-width: 0; }
.feed-main .fm-t { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-main .fm-s { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.feed-cost { font-variant-numeric: tabular-nums; font-size: 12.5px; color: #a5c0ff; white-space: nowrap; }
.feed-cost.neg { color: var(--text-3); text-decoration: line-through; }

/* ==========================================================
   表格
   ========================================================== */

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

th {
  text-align: left;
  color: var(--text-3);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .3px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(148, 163, 184, .03);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(31, 41, 55, .62);
  color: var(--text);
  vertical-align: middle;
}

tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(91, 140, 255, .05); }
tbody tr:last-child td { border-bottom: none; }

.num { font-variant-numeric: tabular-nums; text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; }
.muted { color: var(--text-2); }
.tiny { font-size: 11.5px; }

.err-line {
  color: var(--red);
  font-size: 11px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================
   标签
   ========================================================== */

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 17px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag.green { color: var(--green); background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .32); }
.tag.red { color: var(--red); background: rgba(251, 113, 133, .14); border-color: rgba(251, 113, 133, .32); }
.tag.amber { color: var(--amber); background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .3); }
.tag.gray { color: var(--text-2); background: rgba(148, 163, 184, .12); border-color: rgba(148, 163, 184, .24); }
.tag.blue { color: #a5c0ff; background: rgba(91, 140, 255, .14); border-color: rgba(91, 140, 255, .32); }
.tag.purple { color: #c4b5fd; background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .32); }

/* ==========================================================
   表单
   ========================================================== */

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; letter-spacing: .2px; }
.field .fh { font-size: 11px; color: var(--text-3); margin-top: 5px; }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  background: rgba(10, 13, 19, .7);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
  transition: border-color .14s, box-shadow .14s, background .14s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background: rgba(10, 13, 19, .95);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .16);
}

input::placeholder { color: var(--text-3); }
select { cursor: pointer; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: rgba(28, 39, 54, .8);
  color: var(--text);
  cursor: pointer;
  font-size: 12.5px;
  white-space: nowrap;
  transition: background .14s, border-color .14s, opacity .14s, transform .1s;
}
.btn:hover { background: #24303f; border-color: #38495e; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 5px 16px rgba(91, 140, 255, .28);
}
.btn.primary:hover { filter: brightness(1.08); }

.btn.ghost { background: rgba(91, 140, 255, .1); border-color: rgba(91, 140, 255, .3); color: #a5c0ff; }
.btn.ghost:hover { background: rgba(91, 140, 255, .18); }

.btn.danger { color: var(--red); border-color: rgba(251, 113, 133, .32); background: rgba(251, 113, 133, .08); }
.btn.danger:hover { background: rgba(251, 113, 133, .16); }

.btn.sm { padding: 4px 10px; font-size: 11.5px; border-radius: 7px; }
.btn.block { width: 100%; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 130px; }
.row .shrink { flex: 0 0 auto; min-width: 0; }

/* ==========================================================
   模态框
   ========================================================== */

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
  animation: fadein .16s ease;
}

@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: rgba(18, 24, 34, .98);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  width: 100%; max-width: 470px;
  max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  animation: popin .18s cubic-bezier(.2, .9, .3, 1);
}

@keyframes popin { from { opacity: 0; transform: translateY(10px) scale(.985) } to { opacity: 1; transform: none } }

.modal.wide { max-width: 780px; }

.modal-head {
  padding: 15px 19px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 13.5px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 17px 19px; overflow: auto; }
.modal-foot {
  padding: 13px 19px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}
.close-x { cursor: pointer; color: var(--text-3); font-size: 19px; line-height: 1; padding: 0 4px; }
.close-x:hover { color: var(--text); }

/* ==========================================================
   提示
   ========================================================== */

.toast-wrap {
  position: fixed; top: 18px; right: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px;
}

.toast {
  background: rgba(23, 32, 48, .97);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  max-width: 390px;
  animation: slidein .2s ease;
  backdrop-filter: blur(8px);
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }

@keyframes slidein { from { opacity: 0; transform: translateX(14px) } to { opacity: 1; transform: none } }

/* ==========================================================
   空状态 / 分页
   ========================================================== */

.empty {
  text-align: center;
  color: var(--text-3);
  padding: 40px 16px;
  font-size: 12.5px;
  line-height: 1.8;
}
.empty.err { color: var(--red); }
.empty svg { margin: 0 auto 10px; opacity: .45; }

/* 空状态插画（所有 .empty 自动带，无需各处写 SVG） */
.empty::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  opacity: .5;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='M3 10h18'/%3E%3Cline x1='8' y1='15' x2='12' y2='15'/%3E%3C/svg%3E");
}
.empty.err::before { display: none; }
.empty.tight { padding: 24px 12px; }

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3);
  background: rgba(148, 163, 184, .02);
}
.pager .pg-btns { display: flex; gap: 6px; }

/* 键盘/密钥展示 */
.keybox {
  background: #070a0f;
  border: 1px dashed rgba(91, 140, 255, .4);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  word-break: break-all;
  color: #a5c0ff;
  margin: 10px 0;
}

.hr { height: 1px; background: var(--line); margin: 14px 0; }

.code-pre {
  background: #070a0f;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px;
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.8;
  color: #b8c4d0;
  max-height: 320px;
  white-space: pre-wrap;
  word-break: break-all;
}
.code-pre .c-key { color: #c4b5fd; }
.code-pre .c-str { color: #86efac; }
.code-pre .c-cmd { color: #a5c0ff; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 3px 10px; border-radius: 20px; font-size: 11.5px;
  background: rgba(148, 163, 184, .08); border: 1px solid var(--line-2); color: var(--text-2);
  cursor: pointer; transition: all .14s;
}
.chip:hover { color: var(--text); }
.chip.on { background: rgba(91, 140, 255, .16); border-color: rgba(91, 140, 255, .4); color: #a5c0ff; }

.sub-list { display: flex; flex-direction: column; gap: 9px; }
.sub-item {
  background: rgba(28, 39, 54, .55);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  transition: border-color .14s;
}
.sub-item:hover { border-color: var(--line-2); }

.sub-right { flex: 0 0 170px; width: 170px; }
.sub-right .num { font-size: 11.5px; }
.sub-right .mini-bar { margin-top: 6px; }

/* 进度条（套餐消耗） */
.mini-bar { height: 4px; border-radius: 3px; background: rgba(148, 163, 184, .16); overflow: hidden; margin-top: 8px; }
.mini-bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }

/* 两列布局 */
.two-col { display: grid; grid-template-columns: 1.62fr 1fr; gap: 16px; align-items: start; }

/* 键值信息表 */
.kv { width: 100%; font-size: 12.5px; }
.kv td { padding: 8px 0; border-bottom: 1px solid rgba(31, 41, 55, .55); }
.kv tr:last-child td { border-bottom: none; }
.kv td:first-child { color: var(--text-2); width: 118px; }

.kv-box {
  background: rgba(28, 39, 54, .45);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 14px;
  margin-top: 4px;
}
.kv-box .kv td { padding: 9px 0; }

/* 提醒列表（额度不足 / 即将到期） */
.alert-list { display: flex; flex-direction: column; }
.alert-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 17px;
  font-size: 12.5px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(31, 41, 55, .6);
}
.alert-item:last-child { border-bottom: none; }
.alert-item b { color: var(--text); font-weight: 600; }

/* ==========================================================
   响应式
   ========================================================== */

@media (max-width: 1080px) {
  .login-shell { grid-template-columns: 1fr; max-width: 420px; }
  .login-brand { display: none; }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar-w: 62px; }
  .sidebar { padding: 14px 7px; }
  .sidebar .wb-mark { justify-content: center; padding: 4px 0 18px; }
  .sidebar .wb-name, .nav-group-title, .nav-item .lbl, .nav-badge,
  .user-chip .u-name, .user-chip .u-role, .user-chip .icon-btn { display: none; }
  .nav-item { justify-content: center; padding: 9px 0; }
  .user-chip { justify-content: center; padding: 8px 0; }
  .main { padding: 0 13px 50px; }
  .topbar h2 { font-size: 16px; }
  .quota-pill .qp-bar, .quota-pill .qp-label { display: none; }
  .hero { padding: 18px 16px; }
  .hero-top { flex-direction: column; }
  .chart-svg { height: 150px; }
  .crumb { display: none; }
}

/* 入场动画 */
.fade-up { animation: fadeUp .3s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px) } to { opacity: 1; transform: none } }

/* ==========================================================
   SVG 尺寸约束（必须显式给，否则 flex 里会撑满把文字挤成竖排）
   ========================================================== */

svg.ni { width: 17px; height: 17px; flex: 0 0 17px; }
.kpi-ico svg { width: 15px; height: 15px; }
.icon-btn svg { width: 15px; height: 15px; }
.ai-dot svg { width: 13px; height: 13px; }
.btn svg { width: 14px; height: 14px; }
.login-points .pt i svg { width: 14px; height: 14px; }
.empty svg { width: 34px; height: 34px; max-width: 34px; }

.panel-head .ph-title { min-width: 0; flex: 0 1 auto; }
.panel-head .ph-title .ni { flex: 0 0 17px; }

/* 双段比例条 */
.split-bar {
  display: flex;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(148, 163, 184, .12);
  margin-top: 10px;
  position: relative;
  z-index: 1;
}
.split-bar i { display: block; height: 100%; }
