/* =====================================================
   积分通行证 - 全站样式（暗色玻璃拟态 · 渐变光效）
   ===================================================== */
:root {
  --bg0: #070b16;
  --bg1: #0b1020;
  --card: rgba(255,255,255,.045);
  --card2: rgba(255,255,255,.07);
  --bd: rgba(255,255,255,.09);
  --bd2: rgba(255,255,255,.16);
  --tx: #e8ecf4;
  --tx2: #aeb6ca;
  --tx3: #7c86a0;
  --p1: #6366f1;
  --p2: #22d3ee;
  --p3: #8b5cf6;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6 50%, #22d3ee);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --info: #60a5fa;
  --r: 16px;
  --shadow: 0 18px 50px rgba(0,0,0,.4);
  --orb1: #4338ca55;
  --orb2: #0e749055;
  --orb3: #7c3aed40;
  --head-bd: var(--bd);
  --lnk: #8fa0f5;
  --lnkh: #b3c0ff;
}

/* ============ 主题切换（html[data-theme]） ============ */
html[data-theme="ocean"]  { --p1:#0ea5e9; --p2:#22d3ee; --p3:#3b82f6; --grad:linear-gradient(135deg,#0ea5e9,#3b82f6 50%,#22d3ee); --orb1:#0e749055; --orb2:#1d4ed855; --orb3:#0891b245; }
html[data-theme="emerald"]{ --p1:#10b981; --p2:#84cc16; --p3:#14b8a6; --grad:linear-gradient(135deg,#10b981,#14b8a6 50%,#84cc16); --orb1:#04785755; --orb2:#16653455; --orb3:#65a30d45; }
html[data-theme="sunset"] { --p1:#f59e0b; --p2:#ef4444; --p3:#ec4899; --grad:linear-gradient(135deg,#f59e0b,#ef4444 50%,#ec4899); --orb1:#c2410c55; --orb2:#be123c55; --orb3:#ea580c45; }
html[data-theme="rose"]   { --p1:#ec4899; --p2:#f43f5e; --p3:#a855f7; --grad:linear-gradient(135deg,#ec4899,#f43f5e 50%,#a855f7); --orb1:#be185d55; --orb2:#9d174d55; --orb3:#7e22ce45; }
html[data-theme="light"]  {
  --bg0: #eef1f8; --bg1: #ffffff; --card: rgba(15,23,42,.045); --card2: rgba(15,23,42,.07);
  --bd: rgba(15,23,42,.10); --bd2: rgba(15,23,42,.18);
  --tx: #1f2430; --tx2: #4b5563; --tx3: #7c86a0;
  --p1:#6366f1; --p2:#0ea5e9; --p3:#8b5cf6; --grad:linear-gradient(135deg,#6366f1,#8b5cf6 50%,#0ea5e9);
  --lnk:#4f46e5; --lnkh:#7c3aed;
  --shadow: 0 14px 40px rgba(15,23,42,.10);
  --orb1:#6366f13a; --orb2:#0ea5e942; --orb3:#8b5cf638;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg0);
  color: var(--tx);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--lnk); text-decoration: none; transition: .2s; }
a:hover { color: var(--lnkh); }

/* ---------- 背景光斑 ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-orbs span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  animation: orbFloat 18s ease-in-out infinite alternate;
}
.bg-orbs span:nth-child(1) { width: 480px; height: 480px; background: var(--orb1); top: -140px; left: -120px; }
.bg-orbs span:nth-child(2) { width: 420px; height: 420px; background: var(--orb2); bottom: -120px; right: -100px; animation-delay: -6s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; background: var(--orb3); top: 40%; left: 55%; animation-delay: -12s; }
@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -40px) scale(1.12); }
  100% { transform: translate(-40px, 50px) scale(.94); }
}

/* =====================================================
   顶部导航
   ===================================================== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 14, 26, .72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bd);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(99,102,241,.55);
  position: relative;
}
.brand-logo::after {
  content: "◈"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
}
.brand-name {
  font-weight: 800; font-size: 17px; letter-spacing: .5px;
  background: linear-gradient(120deg, #c7d2fe, #a5f3fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 7px 13px; border-radius: 9px; font-size: 13.5px; color: var(--tx2);
  white-space: nowrap; transition: .2s; position: relative;
}
.nav-link:hover { color: var(--tx); background: rgba(255,255,255,.06); }
.nav-link.on { color: #fff; background: rgba(99,102,241,.18); box-shadow: inset 0 0 0 1px rgba(129,140,248,.4); }
.nav-link.on::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 16px; height: 2px; border-radius: 2px; background: var(--grad);
}
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }

/* 通知铃铛 */
.bell { position: relative; }
.bell-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--bd);
  background: rgba(255,255,255,.04); color: var(--tx2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; position: relative; transition: .2s;
}
.bell-btn:hover { color: var(--tx); border-color: var(--bd2); }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  background: linear-gradient(135deg, #f43f5e, #f97316); color: #fff; font-size: 10px; font-style: normal;
  border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700;
  box-shadow: 0 0 10px rgba(244,63,94,.6);
}
.bell-drop {
  position: fixed; left: 0; top: 0; width: 300px; max-width: calc(100vw - 24px); z-index: 120;
  background: rgba(15, 20, 36, .96); border: 1px solid var(--bd2); border-radius: 14px;
  box-shadow: var(--shadow); display: none; overflow: hidden;
  backdrop-filter: blur(20px);
}
.bell-drop.show { display: block; animation: dropIn .18s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.bell-head { padding: 11px 14px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--bd); color: var(--tx); }
.bell-item { display: block; padding: 10px 14px; font-size: 13px; color: var(--tx2); border-bottom: 1px solid rgba(255,255,255,.05); }
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: rgba(99,102,241,.08); color: var(--tx); }
.bell-item time { display: block; font-size: 11px; color: var(--tx3); margin-top: 2px; }
.bell-empty { padding: 24px; text-align: center; color: var(--tx3); font-size: 12.5px; }

/* 用户信息 */
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(99,102,241,.45);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-meta b { font-size: 13px; }
.user-meta i { font-style: normal; font-size: 11px; color: var(--p2); }
.btn-logout {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--bd); color: var(--tx3); transition: .2s;
}
.btn-logout:hover { color: var(--err); border-color: rgba(248,113,113,.4); }

.nav-toggle { display: none; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--bd); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-toggle span { width: 16px; height: 2px; background: var(--tx); border-radius: 2px; transition: .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* =====================================================
   主容器 / 卡片
   ===================================================== */
.container {
  flex: 1; width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 24px 20px 96px; position: relative; z-index: 1;
}
.card {
  background: var(--card); border: 1px solid var(--bd); border-radius: var(--r);
  padding: 22px; margin-bottom: 18px; position: relative;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: .25s;
}
.card.hoverable:hover { border-color: var(--bd2); transform: translateY(-3px); box-shadow: var(--shadow); }
.card-title {
  font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.card-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--grad); }
.card-title .sub { font-size: 12px; color: var(--tx3); font-weight: 400; }
.card-title .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 网格/表单分栏子项允许收窄，避免长域名/长编号把 1fr 轨道撑破导致横向溢出 */
.grid-2 > *, .grid-3 > *, .grid-4 > *, .form-grid > *, .stat { min-width: 0; }

/* 统计卡 */
.stat {
  border-radius: var(--r); padding: 18px 20px; border: 1px solid var(--bd);
  background: linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  position: relative; overflow: hidden; cursor: pointer; transition: .25s; display: block; color: var(--tx);
}
.stat:hover { transform: translateY(-3px); border-color: var(--bd2); box-shadow: var(--shadow); color: var(--tx); }
.stat::after {
  content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%;
  right: -50px; top: -50px; filter: blur(40px); opacity: .35;
}
.stat.s1::after { background: #6366f1; }
.stat.s2::after { background: #22d3ee; }
.stat.s3::after { background: #f59e0b; }
.stat.s4::after { background: #34d399; }
.stat .st-label { font-size: 12.5px; color: var(--tx2); display: flex; align-items: center; gap: 6px; }
.stat .st-value { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .st-value.income { color: var(--ok); }
.stat .st-value.expense { color: var(--err); }
.stat .st-foot { font-size: 11px; color: var(--tx3); margin-top: 4px; }

/* =====================================================
   表单
   ===================================================== */
.f-row { margin-bottom: 14px; }
.f-label { display: block; font-size: 13px; color: var(--tx2); margin-bottom: 7px; }
.f-label b.req { color: var(--err); margin-left: 2px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--bd); background: rgba(255,255,255,.045);
  color: var(--tx); font-size: 14px; outline: none; transition: .2s;
  font-family: inherit; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aeb6ca' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
select option { background: #131a2e; color: var(--tx); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.16);
  background: rgba(255,255,255,.06);
}
input::placeholder, textarea::placeholder { color: #5a6480; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.f-hint { font-size: 12px; color: var(--tx3); margin-top: 5px; line-height: 1.5; }
.f-inline { display: flex; gap: 10px; align-items: center; }
.f-inline > * { flex: 1; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; background: none; color: var(--tx3); cursor: pointer; border-radius: 7px;
}
.pw-eye:hover { color: var(--tx); }

/* 复选框美化 */
.check-line { display: flex; align-items: center; gap: 10px; padding: 9px 4px; cursor: pointer; }
.check-line input[type=checkbox] { width: 17px; height: 17px; accent-color: #6366f1; cursor: pointer; }
.check-line span { font-size: 13.5px; color: var(--tx2); }

/* =====================================================
   按钮
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: 11px; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 14px; font-weight: 700;
  font-family: inherit; transition: .22s; position: relative; overflow: hidden;
  box-shadow: 0 6px 20px rgba(99,102,241,.3); text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(99,102,241,.45); color: #fff; }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 14px 30px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-ghost { background: rgba(255,255,255,.06); border: 1px solid var(--bd2); box-shadow: none; color: var(--tx2); }
.btn-ghost:hover { background: rgba(255,255,255,.1); box-shadow: none; color: var(--tx); }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #f97316); box-shadow: 0 6px 20px rgba(244,63,94,.3); }
.btn-ok { background: linear-gradient(135deg, #10b981, #22d3ee); box-shadow: 0 6px 20px rgba(16,185,129,.3); }
.btn-warn { background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 6px 20px rgba(245,158,11,.3); }

/* =====================================================
   表格（移动端卡片化）
   ===================================================== */
.table-wrap { overflow: hidden; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb th {
  text-align: left; padding: 10px 12px; color: var(--tx3); font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--bd2); white-space: nowrap; letter-spacing: .4px;
}
.tb td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.tb tr:last-child td { border-bottom: none; }
.tb tbody tr { transition: .15s; }
.tb tbody tr:hover { background: rgba(99,102,241,.06); }
.tb .num { font-variant-numeric: tabular-nums; }
.tb .mono { font-family: "SF Mono", Consolas, monospace; font-size: 12px; }

/* 徽章 */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-green { background: rgba(52,211,153,.14); color: #6ee7b7; box-shadow: inset 0 0 0 1px rgba(52,211,153,.3); }
.b-blue  { background: rgba(96,165,250,.14); color: #93c5fd; box-shadow: inset 0 0 0 1px rgba(96,165,250,.3); }
.b-yellow{ background: rgba(251,191,36,.14); color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(251,191,36,.3); }
.b-red   { background: rgba(248,113,113,.14); color: #fca5a5; box-shadow: inset 0 0 0 1px rgba(248,113,113,.3); }
.b-gray  { background: rgba(148,163,184,.12); color: #aeb6ca; box-shadow: inset 0 0 0 1px rgba(148,163,184,.25); }
.b-violet{ background: rgba(139,92,246,.14); color: #c4b5fd; box-shadow: inset 0 0 0 1px rgba(139,92,246,.3); }
.amount-plus { color: var(--ok); font-weight: 700; }
.amount-minus { color: var(--err); font-weight: 700; }

/* =====================================================
   提示条 / 分页 / 标签页
   ===================================================== */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; position: relative; animation: dropIn .25s ease; }
.flash-ok { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.35); color: #6ee7b7; }
.flash-err { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.35); color: #fca5a5; }
.flash-warn { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.35); color: #fcd34d; }
.flash-x { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; opacity: .6; }
.flash-x:hover { opacity: 1; }

.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.pg {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--bd); color: var(--tx2); font-size: 13px;
}
.pg:hover { color: var(--tx); border-color: var(--bd2); }
.pg.on { background: var(--grad); border: none; color: #fff; font-weight: 700; }
.pg.dots { border: none; background: none; }
.pg-info { font-size: 12px; color: var(--tx3); margin-left: 6px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  padding: 8px 16px; border-radius: 10px; font-size: 13px; color: var(--tx2);
  background: rgba(255,255,255,.04); border: 1px solid var(--bd); transition: .2s;
}
.tab:hover { color: var(--tx); }
.tab.on { background: linear-gradient(135deg, rgba(99,102,241,.3), rgba(34,211,238,.2)); border-color: rgba(129,140,248,.5); color: #fff; }

/* 搜索栏 */
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.searchbar .field { flex: 1; min-width: 150px; }

/* =====================================================
   登陆 / 注册页
   ===================================================== */
.auth-wrap { max-width: 960px; margin: 30px auto 0; }
.auth-card {
  display: grid; grid-template-columns: 1.1fr 1fr; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--bd); background: var(--card); backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.auth-side {
  padding: 40px 34px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(99,102,241,.22), rgba(34,211,238,.1) 60%, transparent);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-side::before {
  content: "◈"; position: absolute; font-size: 210px; opacity: .05; right: -30px; bottom: -60px; color: #fff;
}
.auth-side h1 { font-size: 25px; font-weight: 800; margin-bottom: 14px; line-height: 1.4; }
.auth-side h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-side p { color: var(--tx2); font-size: 13.5px; line-height: 1.9; }
.auth-side .feat { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.auth-side .feat span { font-size: 13px; color: var(--tx2); display: flex; gap: 9px; align-items: center; }
.auth-side .feat span::before { content: "✦"; color: var(--p2); }
.auth-form { padding: 40px 36px; }
.auth-form h2 { font-size: 19px; margin-bottom: 4px; }
.auth-form .auth-sub { font-size: 12.5px; color: var(--tx3); margin-bottom: 22px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12.5px; }

/* =====================================================
   代码块 / APIKEY
   ===================================================== */
.code-box {
  background: rgba(2, 6, 18, .8); border: 1px solid var(--bd2); border-radius: 13px;
  overflow: hidden; margin: 12px 0;
}
.code-box pre {
  margin: 0; padding: 16px; overflow-x: auto; font-size: 12px; line-height: 1.7;
  font-family: "SF Mono", Consolas, "Courier New", monospace; color: #a5f3fc;
  max-height: 460px;
}
.code-head {
  display: flex; align-items: center; padding: 9px 14px; gap: 8px;
  border-bottom: 1px solid var(--bd); background: rgba(255,255,255,.03);
}
.code-head .dots { display: flex; gap: 5px; }
.code-head .dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.code-head .dots i:nth-child(1) { background: #f87171; }
.code-head .dots i:nth-child(2) { background: #fbbf24; }
.code-head .dots i:nth-child(3) { background: #34d399; }
.code-head .fname { font-size: 12px; color: var(--tx3); font-family: monospace; }
.copy-btn {
  margin-left: auto; padding: 4px 12px; font-size: 11.5px; border-radius: 7px;
  background: rgba(99,102,241,.16); border: 1px solid rgba(129,140,248,.35); color: #b7c1ff;
  cursor: pointer; transition: .2s; font-family: inherit;
}
.copy-btn:hover { background: rgba(99,102,241,.3); color: #fff; }
.apikey-box {
  display: flex; gap: 10px; align-items: center; background: rgba(2,6,18,.6);
  border: 1px dashed rgba(129,140,248,.4); border-radius: 12px; padding: 12px 14px; flex-wrap: wrap;
}
.apikey-box .key {
  font-family: "SF Mono", Consolas, monospace; font-size: 13px; color: #a5f3fc; flex: 1;
  word-break: break-all; min-width: 200px;
}
.apikey-box .key.masked { filter: blur(5px); user-select: none; }

/* =====================================================
   站点卡片 / 关键词标签
   ===================================================== */
.site-card { display: flex; flex-direction: column; gap: 10px; }
.site-card .site-name { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-card .site-dom { font-size: 12.5px; color: var(--p2); font-family: monospace; }
.site-card .site-desc { font-size: 12.5px; color: var(--tx2); line-height: 1.6; word-break: break-all; }
.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.kw-tag {
  display: inline-block;
  font-size: 11px; padding: 2px 9px; border-radius: 20px;
  background: rgba(139,92,246,.13); color: #c4b5fd; box-shadow: inset 0 0 0 1px rgba(139,92,246,.25);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}

/* =====================================================
   可折叠区块
   =====================================================
   使用原生 <details>/<summary> 实现，完全脱离 JS 依赖，默认折叠、
   点击标题展开/收起必然生效。用法：
     <details class="card co">
       <summary class="card-title co-head">标题 <span class="co-arrow"></span></summary>
       <div class="co-body">…内容…</div>
     </details>
*/
details.co { }
details.co > summary.co-head {
  cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none;
}
details.co > summary.co-head::-webkit-details-marker { display: none; }
details.co > summary.co-head::marker { content: ''; display: none; }
details.co > summary.co-head:focus { outline: none; }
details.co > summary.co-head:hover .co-arrow { color: var(--ac); border-color: var(--ac); opacity: 1; }
.co-arrow {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--tx3);
  background: rgba(128,128,160,.10); border: 1px solid var(--bd2);
  border-radius: 6px; padding: 1px 8px; opacity: .8; transition: opacity .15s ease;
}
.co-arrow::before { content: '展开 ▾'; }
details.co[open] > summary.co-head .co-arrow::before { content: '收起 ▴'; }
details.co[open] > summary.co-head .co-arrow { color: var(--ac); border-color: var(--ac); }
details.co > .co-body { animation: coFade .18s ease; }
@keyframes coFade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* 单条说明折叠为单行省略（悬停显示完整内容） */
.txt-ellipsis { display: inline-block; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* =====================================================
   单条记录小卡片（每条带可见折叠按钮）
   =====================================================
   用法：把原来撑得很高的列表记录改为“紧凑摘要一行 + 详情”，
   每条记录自带一个醒目的「详情/收起」折叠按钮，默认只显示摘要，
   点击展开完整字段，从而一屏看更多信息、节省大量纵向空间。
     <details class="co-item">
       <summary>
         <span class="badge b-green">收入</span>
         <span class="i-kv"><b>来源</b></span>
         <span class="i-v num">+100</span>
         <span class="i-arrow"></span>
       </summary>
       <div class="i-body">
         <div class="cell"><span class="k">时间</span><span class="v">…</span></div>
         …
       </div>
     </details>
*/
.co-item {
  border: 1px solid var(--bd); border-radius: 11px; background: var(--card);
  margin-bottom: 8px; overflow: hidden;
}
.co-item > summary {
  cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px;
  padding: 9px 12px; font-size: 13px;
}
.co-item > summary::-webkit-details-marker { display: none; }
.co-item > summary::marker { content: ''; display: none; }
.co-item > summary:focus { outline: none; }
.co-item > summary:hover { background: rgba(128,128,160,.05); }
.co-item > summary .i-kv { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; min-width: 0; }
.co-item > summary .i-kv .k { color: var(--tx3); font-size: 12px; }
.co-item > summary .i-kv b { color: var(--tx); font-weight: 600; }
.co-item > summary .i-time { color: var(--tx3); font-size: 12px; white-space: nowrap; }
.co-item > summary .i-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-item > summary .i-arrow {
  margin-left: auto; display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--tx3);
  background: rgba(128,128,160,.12); border: 1px solid var(--bd2);
  border-radius: 7px; padding: 2px 9px; opacity: .95; transition: all .15s ease; flex: 0 0 auto;
}
.co-item > summary .i-arrow::before { content: '详情 ▾'; }
.co-item > summary:hover .i-arrow { color: var(--ac); border-color: var(--ac); opacity: 1; }
.co-item[open] > summary .i-arrow::before { content: '收起 ▴'; }
.co-item[open] > summary .i-arrow { color: var(--ac); border-color: var(--ac); }
.co-item > .i-body {
  padding: 11px 12px 13px; border-top: 1px solid var(--bd);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 9px 18px;
  font-size: 13px; animation: coFade .18s ease;
}
.co-item > .i-body .cell { min-width: 0; word-break: break-all; }
.co-item > .i-body .cell > .k { display: block; font-size: 11.5px; color: var(--tx3); margin-bottom: 2px; }
.co-item > .i-body .cell > .v { color: var(--tx); }
.co-item > .i-body .cell.full { grid-column: 1 / -1; }
html[data-theme="light"] .co-item > summary:hover { background: rgba(15,23,42,.03); }
html[data-theme="light"] .co-item > summary .i-arrow { color: #6b7280; }

/* =====================================================
   应用中心（应用宝式图标宫格）
   ===================================================== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.app-card {
  min-width: 0; /* 关键：允许网格项收窄，修复长名称把列撑破导致水平溢出 */
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px 10px; border-radius: 14px; text-align: center;
  background: transparent; border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.app-card:hover { background: rgba(255,255,255,.05); border-color: var(--bd2); transform: translateY(-2px); }
/* 精选推荐：按分类分组的分组标题 */
.rec-cat { margin-bottom: 16px; }
.rec-cat:last-child { margin-bottom: 4px; }
.rec-cat-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--tx2); margin: 2px 0 8px;
}
.rec-cat-title::before {
  content: ''; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--ac), var(--ac2));
}
.rec-cat .app-grid { margin-top: 0; }
.app-ico-wrap { position: relative; line-height: 0; flex-shrink: 0; }
.app-ico {
  width: 46px; height: 46px; border-radius: 12px; object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,.28); background: rgba(255,255,255,.06);
}
.app-feat { background: rgba(255,255,255,.05); }
.app-name {
  min-width: 0; max-width: 100%; width: 100%;
  font-size: 12px; font-weight: 600; color: var(--tx); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-meta {
  min-width: 0; max-width: 100%; width: 100%;
  font-size: 10px; color: var(--tx3); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-rank {
  position: absolute; top: -7px; left: -6px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; font-style: normal; color: #fff; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); border: 2px solid var(--bg0);
}
.app-rank.r1 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.app-rank.r2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.app-rank.r3 { background: linear-gradient(135deg, #b45309, #d97706); }

/* 应用中心：站点图标选择器（创建/编辑站点） */
.icon-opt {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 6px; border-radius: 12px; border: 2px solid transparent;
  transition: border-color .15s ease, background .15s ease;
}
.icon-opt:hover { background: rgba(255,255,255,.05); }
.icon-opt input { display: none; }
.icon-opt:has(input:checked) { border-color: rgba(129,140,248,.7); background: rgba(99,102,241,.12); }
.icon-thumb {
  width: 46px; height: 46px; border-radius: 11px; object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,.35); background: rgba(255,255,255,.07);
  display: block; pointer-events: none;
}
.icon-opt-name { font-size: 10.5px; color: var(--tx3); }
@media (max-width: 640px) { .icon-thumb { width: 42px; height: 42px; border-radius: 10px; } }

@media (max-width: 1024px) { .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* ============ 移动端：应用宝式紧凑宫格（4 列、图标更小） ============ */
@media (max-width: 640px) {
  .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .app-card { padding: 10px 4px 8px; gap: 5px; border-radius: 13px; }
  .app-ico { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 3px 9px rgba(0,0,0,.25); }
  .app-name { font-size: 11px; }
  .app-meta { font-size: 9.5px; }
  .app-rank { width: 17px; height: 17px; font-size: 10px; top: -6px; left: -4px; border-width: 1.5px; }
}
@media (max-width: 380px) {
  .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .app-ico { width: 34px; height: 34px; border-radius: 9px; }
  .app-name { font-size: 10.5px; }
}

/* =====================================================
   站内信中心（公告 + 站内信融合收件箱）
   ===================================================== */
.mail-list { display: flex; flex-direction: column; }
.mail-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 10px;
  border-radius: 12px; color: var(--tx); transition: background .15s ease;
}
.mail-item:hover { background: rgba(255,255,255,.05); }
.mail-av { flex-shrink: 0; line-height: 0; }
.mail-ic { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; box-shadow: 0 3px 10px rgba(0,0,0,.28); }
.av-dot {
  width: 40px; height: 40px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
}
.av-user { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 15px; }
.av-ann { background: rgba(99,102,241,.15); font-style: normal; }
.mail-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mail-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mail-t b { color: #a5b4fc; font-size: 12px; flex-shrink: 0; }
.mail-t b.tg-site { color: #5eead4; }
.mail-t em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail-meta { font-size: 11px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-new {
  flex-shrink: 0; font-style: normal; font-size: 10px; font-weight: 700; color: #fff;
  background: #f43f5e; padding: 1px 6px; border-radius: 8px;
}
.msg-bubble {
  border: 1px solid var(--bd); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px; background: rgba(255,255,255,.03);
}
.msg-bubble.me { border-color: rgba(99,102,241,.5); background: rgba(99,102,241,.08); }
.msg-hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-hd b { color: #a5b4fc; font-size: 13px; }
.msg-hd .n-time { font-size: 11px; }
.msg-title { font-size: 13px; font-weight: 700; color: var(--tx); margin-bottom: 4px; }
.msg-body { font-size: 13.5px; color: var(--tx); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* 铃铛：融合公告 + 站内信 */
.bell-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.bell-all { color: #8fa0f5; font-size: 11.5px; font-weight: 500; }
.bell-tag {
  flex-shrink: 0; font-size: 10px; font-weight: 700; color: #fff;
  padding: 1px 6px; border-radius: 8px; margin-right: 8px; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bell-tag.t-ann { background: #6366f1; }
.bell-tag.t-user { background: #0ea5e9; }
.bell-tag.t-site { background: #10b981; }
.bell-tag.t-system { background: #64748b; }

/* 进度条 */
.progress { height: 7px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--grad); transition: width .4s; }

/* 步骤 */
.steps-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.step-chip {
  flex: 1; min-width: 130px; padding: 12px 16px; border-radius: 13px;
  background: rgba(255,255,255,.04); border: 1px solid var(--bd); text-align: center;
}
.step-chip .sc-t { font-size: 12px; color: var(--tx3); }
.step-chip .sc-n { font-size: 15px; font-weight: 700; margin-top: 3px; }
.step-chip.on { border-color: rgba(52,211,153,.5); background: rgba(52,211,153,.07); }
.step-chip.off { opacity: .55; }

/* =====================================================
   底部版权栏（悬浮）
   ===================================================== */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(8, 12, 24, .85); backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--bd);
}
.bottombar-inner {
  max-width: 1280px; margin: 0 auto; padding: 9px 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11.5px; color: var(--tx3); flex-wrap: wrap; text-align: center;
}
.bottombar a { color: var(--tx3); }
.bottombar a:hover { color: var(--tx2); }
.bottombar .sep { opacity: .4; }
.police-ico {
  display: inline-block; width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px;
  background: linear-gradient(135deg, #4f8ef7, #a0c3ff); border-radius: 2px;
}

/* =====================================================
   模态框
   ===================================================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(2, 5, 14, .7); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-mask.show { display: flex; animation: dropIn .2s ease; }
.modal {
  width: 100%; max-width: 640px; max-height: 86vh; overflow-y: auto;
  background: #0f1527; border: 1px solid var(--bd2); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal-head {
  padding: 16px 22px; border-bottom: 1px solid var(--bd); display: flex; align-items: center;
  font-size: 15px; font-weight: 700; position: sticky; top: 0; background: #0f1527; z-index: 2;
}
.modal-head .modal-x { margin-left: auto; cursor: pointer; color: var(--tx3); font-size: 20px; }
.modal-head .modal-x:hover { color: var(--err); }
.modal-body { padding: 20px 22px; }

/* 空状态 */
.empty { text-align: center; padding: 42px 16px; color: var(--tx3); font-size: 13px; }
.empty::before { content: "⌘"; display: block; font-size: 30px; margin-bottom: 10px; opacity: .5; }

/* 注意事项列表 */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-item { padding: 14px 16px; border-radius: 13px; background: rgba(255,255,255,.03); border: 1px solid var(--bd); transition: .2s; }
.notice-item:hover { border-color: var(--bd2); background: rgba(255,255,255,.05); }
.notice-item h4 { font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice-item .n-time { font-size: 11.5px; color: var(--tx3); font-weight: 400; }
.notice-item .n-body { font-size: 13px; color: var(--tx2); line-height: 1.8; white-space: pre-wrap; word-break: break-all; }

/* 告警等级 */
.lvl { display: inline-flex; align-items: center; gap: 6px; }
.lvl i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lvl-0 i { background: #34d399; box-shadow: 0 0 8px #34d399; }
.lvl-1 i { background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }
.lvl-2 i { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.lvl-3 i { background: #f87171; box-shadow: 0 0 8px #f87171; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* 信息展示行 */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--tx3); }
.kv dd { word-break: break-all; }

/* =====================================================
   响应式
   ===================================================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 26px; }
  .auth-side .feat { display: none; }
  .auth-form { padding: 28px 26px; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 10px 14px 16px; gap: 4px;
    background: rgba(10, 14, 26, .97); border-bottom: 1px solid var(--bd);
    backdrop-filter: blur(20px); max-height: 70vh; overflow-y: auto;
  }
  .nav.show { display: flex; animation: dropIn .2s ease; }
  .nav-link { padding: 11px 14px; }
  .nav-link.on::after { display: none; }
  .user-meta i { display: none; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .container { padding: 16px 14px 110px; }
  .card { padding: 16px; border-radius: 14px; }
  .kv { grid-template-columns: 92px 1fr; }

  /* 表格转卡片 */
  .table-wrap { overflow: visible; }
  table.tb.res thead { display: none; }
  table.tb.res, table.tb.res tbody { display: block; }
  table.tb.res tr {
    display: block; border: 1px solid var(--bd); border-radius: 13px;
    padding: 8px 6px; margin-bottom: 10px; background: rgba(255,255,255,.025);
  }
  table.tb.res td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    border-bottom: 1px dashed rgba(255,255,255,.07); padding: 8px 10px; text-align: right;
  }
  table.tb.res td::before {
    content: attr(data-l); color: var(--tx3); font-size: 11.5px; flex-shrink: 0; text-align: left;
  }
  table.tb.res td:last-child { border-bottom: none; }
  table.tb.res td.t-actions { justify-content: flex-end; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .stat .st-value { font-size: 22px; }
  .auth-side h1 { font-size: 21px; }
  .searchbar .field { min-width: 100%; }
}

/* =====================================================
   主题切换器（顶栏）
   ===================================================== */
.theme-wrap { position: relative; }
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--bd); border-radius: 12px;
  background: rgba(255,255,255,.04); color: var(--tx2); cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.theme-btn:hover { background: rgba(255,255,255,.09); transform: translateY(-1px); }
.theme-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  min-width: 150px; padding: 10px; border-radius: 14px;
  background: rgba(12,16,30,.96); border: 1px solid var(--bd2);
  box-shadow: var(--shadow); backdrop-filter: blur(16px);
  display: none;
}
.theme-panel.show { display: block; animation: dropIn .18s ease; }
.theme-panel .tp-label { font-size: 11px; color: var(--tx3); margin: 2px 2px 8px; }
.theme-rows { display: flex; flex-direction: column; gap: 2px; }
.theme-opt {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px;
  cursor: pointer; color: var(--tx2); font-size: 12.5px; transition: background .12s;
}
.theme-opt:hover { background: rgba(255,255,255,.06); }
.theme-opt.on { color: var(--tx); background: rgba(255,255,255,.08); }
.theme-opt .tick { width: 12px; text-align: center; color: var(--ok); opacity: 0; }
.theme-opt.on .tick { opacity: 1; }
.theme-dots { display: flex; gap: 6px; }
.theme-dots i {
  width: 15px; height: 15px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
html[data-theme="light"] .theme-panel, html[data-theme="light"] .nav { background: #ffffffcc; }
html[data-theme="light"] .nav { border-color: var(--bd); }
/* 浅色主题兼容：顶栏/输入/表格/次级表面 */
html[data-theme="light"] .topbar { background: rgba(255,255,255,.78); }
html[data-theme="light"] .theme-btn { background: rgba(15,23,42,.05); }
html[data-theme="light"] .field input, html[data-theme="light"] select,
html[data-theme="light"] textarea { background: #f4f6fb; border-color: var(--bd); color: var(--tx); }
html[data-theme="light"] table.tb th { background: rgba(15,23,42,.05); }
html[data-theme="light"] table.tb tr:nth-child(even), html[data-theme="light"] table.tb.res tr { background: rgba(15,23,42,.03); }
html[data-theme="light"] .kw-tag { background: rgba(15,23,42,.08); color: var(--tx2); box-shadow: inset 0 0 0 1px rgba(15,23,42,.12); }

/* =====================================================
   应用中心美化（改名卡片 · 使用量角标 · 悬浮光效）
   ===================================================== */
.app-card {
  position: relative;
}
.app-card .app-ico-wrap { position: relative; }
.app-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120% 100% at 50% 0%, var(--p1)22, transparent 60%);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.app-card:hover::before { opacity: 1; }
.app-card .app-name {
  display: block; width: 100%; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--tx);
}
.app-card .app-use {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--tx3);
  background: rgba(255,255,255,.06); border-radius: 20px; padding: 2px 9px;
}
html[data-theme="light"] .app-card .app-use { background: rgba(15,23,42,.06); }
.app-card:hover .app-ico { transform: translateY(-2px) scale(1.05); }
.app-ico { transition: transform .18s ease; }
/* 应用中心分组标题微调 */
.card-title .sub { font-size: 12px; color: var(--tx3); font-weight: 400; }

/* =====================================================
   仪表盘 · 统计圆饼（上：切维按钮；下左：圆饼；下右：维度明细文字）
   ===================================================== */
.dash-btns { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-bottom: 14px; }
.dash-main { display: grid; grid-template-columns: 216px 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .dash-main { grid-template-columns: 1fr; justify-items: center; } }
.dash-left { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.donut-wrap {
  width: 216px; height: 216px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--card2), var(--card));
  box-shadow: inset 0 0 0 1px var(--bd), 0 14px 34px rgba(0,0,0,.25);
}
.donut-wrap svg { color: var(--tx); }
.dash-note { font-size: 12px; color: var(--tx3); margin-top: 4px; }
.dash-cmp-switch { display: inline-flex; gap: 6px; margin-top: 9px; padding: 3px; background: var(--card); border: 1px solid var(--bd); border-radius: 9px; }
.dash-cmp-btn {
  font: inherit; font-size: 12px; color: var(--tx3); cursor: pointer;
  background: transparent; border: 0; border-radius: 7px; padding: 4px 10px;
  transition: all .15s ease;
}
.dash-cmp-btn:hover { color: var(--tx); }
.dash-cmp-btn.on {
  background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(34,211,238,.18));
  color: var(--tx); font-weight: 600;
}
html[data-theme="light"] .dash-cmp-btn { color: #4b5563; }
.dash-cmp { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.cmp-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--tx3);
  background: rgba(127,127,127,.08); border: 1px solid var(--bd);
  padding: 5px 10px; border-radius: 9px;
}
.cmp-lb { font-weight: 600; }
.cmp-item b { color: var(--tx); font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp-item em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp-item em.up { color: #34d399; }
.cmp-item em.down { color: #f87171; }
.cmp-item em.flat { color: var(--tx3); }
.dash-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12.5px; color: var(--tx2); cursor: pointer;
  background: var(--card); border: 1px solid var(--bd); border-radius: 9px;
  padding: 6px 10px; transition: all .15s ease;
}
.dash-btn:hover { border-color: var(--bd2); color: var(--tx); }
.dash-btn.on {
  background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(34,211,238,.18));
  border-color: rgba(99,102,241,.55); color: var(--tx); font-weight: 600;
}
.dash-bic { font-size: 14px; }
.dash-bv { color: var(--tx3); font-weight: 400; }
.dash-btn.on .dash-bv { color: var(--tx2); }
.dash-right { min-width: 0; }
.dash-detail { display: flex; flex-direction: column; gap: 8px; }
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--bd); margin-bottom: 4px;
}
.dash-ic { font-size: 16px; margin-right: 6px; }
.dash-lb { font-weight: 700; font-size: 15px; }
.dash-tot { font-size: 13px; color: var(--tx3); }
.dash-tot b { color: var(--tx); font-size: 17px; font-variant-numeric: tabular-nums; }
.dash-row {
  display: grid; grid-template-columns: 14px 1fr auto 46px minmax(60px,120px);
  align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 9px;
  background: var(--card); border: 1px solid var(--bd);
}
.d-dot { width: 10px; height: 10px; border-radius: 50%; }
.d-n { font-size: 13.5px; font-weight: 500; }
.d-v { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.d-p { font-size: 12px; color: var(--tx3); text-align: right; }
.d-bar { height: 6px; border-radius: 6px; background: rgba(128,128,160,.12); overflow: hidden; }
.d-bar i { display: block; height: 100%; border-radius: 6px; transition: width .3s ease; }
.dash-extra { margin-top: 16px; border-top: 1px dashed var(--bd); }
.dash-extra > summary { padding-top: 12px; user-select: none; }
.dash-extra.dash-alert > summary { color: var(--err); font-weight: 600; }
.dash-extra .right { margin-left: 8px; }
.dash-foot {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--bd);
  font-size: 12.5px; color: var(--tx3);
}
.dash-foot b { color: var(--tx); font-size: 15px; font-variant-numeric: tabular-nums; margin-left: 4px; }
html[data-theme="light"] .dash-btn { color: #4b5563; }
html[data-theme="light"] .donut-wrap { box-shadow: inset 0 0 0 1px var(--bd), 0 10px 26px rgba(15,23,42,.10); }
