/* ============================================================
   夜间主题：在 <html data-theme="dark"> 时生效，须在其他样式表之后加载。
   所有规则都限定在 html[data-theme="dark"] 之下，日间样式不受影响。
   ============================================================ */

/* ============ 设计变量 ============ */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-2: #0e1628;
  --surface: #111b30;
  --surface-2: #152039;
  --surface-3: #1b2844;
  --ink: #e6edf7;
  --ink-2: #c6d2e3;
  --muted: #9fb0c8;
  --faint: #8193ae;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .11);
  --blue: #60a5fa;
  --blue-d: #93c5fd;
  --sky: #38bdf8;
  --teal: #2dd4bf;
  --emerald: #34d399;
  --amber: #fbbf24;
  --coral: #fb923c;
  --red: #f87171;
  --cinnabar: #e8553a;
  --grad: linear-gradient(118deg, #2563eb 0%, #0ea5e9 52%, #14b8a6 100%);
  --grad-soft: linear-gradient(118deg, rgba(59, 130, 246, .16), rgba(14, 165, 233, .1) 52%, rgba(20, 184, 166, .14));
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 1px rgba(0, 0, 0, .2);
  --shadow-2: 0 14px 34px -16px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-3: 0 34px 70px -26px rgba(0, 0, 0, .8), 0 8px 22px rgba(0, 0, 0, .35);
  --ring: 0 0 0 3px rgba(56, 189, 248, .26);
  /* 夜间专用 */
  --dk-input: #0c1527;
  --dk-input-2: #0e192e;
  --dk-raise: #1f2d4a;
  --dk-glass: rgba(13, 21, 38, .78);
  --dk-hover-line: rgba(255, 255, 255, .17);
  --dk-accent-line: rgba(96, 165, 250, .45);
}

html[data-theme="dark"] body { color: var(--ink); background: var(--bg); }
html[data-theme="dark"] ::selection { background: rgba(56, 189, 248, .32); color: #fff; }

/* 滚动条 */
html[data-theme="dark"] * { scrollbar-color: #2b3b59 transparent; }
html[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #26354f; background-clip: padding-box; border: 2px solid transparent; }
html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover { background: #36496c; background-clip: padding-box; border: 2px solid transparent; }
html[data-theme="dark"] *::-webkit-scrollbar-corner { background: transparent; }

/* ============ 按钮 ============ */
html[data-theme="dark"] .btn-primary { box-shadow: 0 8px 22px -10px rgba(14, 140, 233, .75), inset 0 1px 0 rgba(255, 255, 255, .2); }
html[data-theme="dark"] .btn-primary:hover { box-shadow: 0 12px 28px -10px rgba(14, 165, 233, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
html[data-theme="dark"] .btn-primary::after { background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .28) 50%, transparent 80%); }
html[data-theme="dark"] .btn-ghost { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .btn-ghost:hover { border-color: var(--dk-hover-line); background: var(--surface-3); color: var(--ink); box-shadow: var(--shadow-1); }
html[data-theme="dark"] .btn-soft { background: rgba(96, 165, 250, .13); color: #8ec0fc; }
html[data-theme="dark"] .btn-soft:hover { background: rgba(96, 165, 250, .22); color: #b5d6ff; }
html[data-theme="dark"] .btn-danger { background: rgba(248, 113, 113, .1); color: #fca5a5; border-color: rgba(248, 113, 113, .28); }
html[data-theme="dark"] .btn-danger:hover { background: rgba(248, 113, 113, .18); color: #fecaca; }
html[data-theme="dark"] .btn-dark { background: var(--dk-raise); color: var(--ink); border-color: var(--line-2); }
html[data-theme="dark"] .btn-dark:hover { background: #283a5c; }
html[data-theme="dark"] .icon-btn { color: var(--muted); }
html[data-theme="dark"] .icon-btn:hover { background: var(--surface-3); color: var(--ink); }

/* ============ 表单 ============ */
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea { background-color: var(--dk-input); border-color: var(--line-2); color: var(--ink); }
html[data-theme="dark"] .input:hover,
html[data-theme="dark"] .select:hover,
html[data-theme="dark"] .textarea:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .input:focus,
html[data-theme="dark"] .select:focus,
html[data-theme="dark"] .textarea:focus { border-color: var(--sky); box-shadow: var(--ring); background-color: var(--dk-input-2); }
html[data-theme="dark"] .input::placeholder,
html[data-theme="dark"] .textarea::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #6f819c; }
html[data-theme="dark"] .input[disabled], html[data-theme="dark"] .select[disabled], html[data-theme="dark"] .textarea[disabled],
html[data-theme="dark"] .input[readonly], html[data-theme="dark"] .textarea[readonly] { background-color: #0f1a2f; color: var(--muted); }
html[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239fb0c8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup { background: #111b30; color: var(--ink); }
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); caret-color: var(--ink); -webkit-box-shadow: 0 0 0 1000px var(--dk-input-2) inset; box-shadow: 0 0 0 1000px var(--dk-input-2) inset; transition: background-color 9999s; }
html[data-theme="dark"] .switch .track { background: #2a3a57; }
html[data-theme="dark"] .switch input:checked + .track { background: linear-gradient(120deg, #2563eb, #14b8a6); box-shadow: 0 0 0 1px rgba(56, 189, 248, .25), 0 4px 12px -4px rgba(14, 140, 233, .6); }
html[data-theme="dark"] .switch .track::after { background: #eef3fa; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }

/* ============ 标签与徽章 ============ */
html[data-theme="dark"] .chip { background: var(--surface-3); color: var(--ink-2); }
html[data-theme="dark"] .chip-blue { background: rgba(96, 165, 250, .15); color: #93c5fd; }
html[data-theme="dark"] .chip-teal { background: rgba(45, 212, 191, .14); color: #5eead4; }
html[data-theme="dark"] .chip-amber { background: rgba(251, 191, 36, .14); color: #fcd34d; }
html[data-theme="dark"] .chip-coral { background: rgba(251, 146, 60, .15); color: #fdba74; }
html[data-theme="dark"] .chip-red { background: rgba(248, 113, 113, .15); color: #fca5a5; }
html[data-theme="dark"] .chip-green { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
html[data-theme="dark"] .chip-gray { background: rgba(148, 163, 184, .14); color: #b4c1d3; }

/* ============ 卡片、提示、弹窗 ============ */
html[data-theme="dark"] .card { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-1); }
html[data-theme="dark"] .toast { background: rgba(30, 43, 68, .96); color: var(--ink); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 18px 44px -12px rgba(0, 0, 0, .75); }
html[data-theme="dark"] .toast-ic { background: rgba(255, 255, 255, .1); color: var(--ink); }
html[data-theme="dark"] .toast-success .toast-ic { background: linear-gradient(120deg, #10b981, #14b8a6); color: #fff; }
html[data-theme="dark"] .toast-error .toast-ic { background: linear-gradient(120deg, #ef4444, #f97316); color: #fff; }
html[data-theme="dark"] .modal-mask { background: rgba(3, 7, 16, .62); }
html[data-theme="dark"] .modal { background: #121d33; border-color: rgba(255, 255, 255, .08); box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, .04); }
html[data-theme="dark"] .modal-foot { border-top-color: var(--line); }

/* 日夜切换按钮 */
html[data-theme="dark"] .theme-tog { background: rgba(17, 27, 48, .82); border-color: var(--line-2); color: #fcd34d; box-shadow: var(--shadow-1); }
html[data-theme="dark"] .theme-tog:hover { color: #fde68a; border-color: var(--dk-hover-line); background: var(--surface-3); }

/* ============ 表格 ============ */
html[data-theme="dark"] .table th { background: var(--surface-2); color: var(--muted); border-bottom-color: var(--line); }
html[data-theme="dark"] .table td { border-bottom-color: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .table tr:hover td { background: rgba(255, 255, 255, .028); }
html[data-theme="dark"] .empty .ico { color: #3a4c6b; }

/* ============ 加载 ============ */
html[data-theme="dark"] .spinner { border-color: rgba(96, 165, 250, .2); border-top-color: var(--blue); }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #162139 25%, #1d2a46 50%, #162139 75%); background-size: 200% 100%; }

/* 水印：原水印为深色字，夜间反相为浅色字 */
html[data-theme="dark"] .watermark-layer { filter: invert(1) hue-rotate(180deg); opacity: .6; }

/* ============ 动态背景：夜色版 ============ */
html[data-theme="dark"] .scene-bg {
  background: radial-gradient(120% 80% at 50% -10%, #14223f 0%, rgba(20, 34, 63, 0) 60%), linear-gradient(180deg, #0b1324 0%, #0a1120 100%);
}
html[data-theme="dark"] .sb-aurora { opacity: .5; filter: blur(70px); }
html[data-theme="dark"] .sb-aurora i { mix-blend-mode: screen; }
html[data-theme="dark"] .sb-aurora i:nth-child(1) { background: radial-gradient(circle, rgba(37, 99, 235, .34), transparent 68%); }
html[data-theme="dark"] .sb-aurora i:nth-child(2) { background: radial-gradient(circle, rgba(20, 184, 166, .26), transparent 68%); }
html[data-theme="dark"] .sb-aurora i:nth-child(3) { background: radial-gradient(circle, rgba(14, 165, 233, .2), transparent 70%); }
html[data-theme="dark"] .sb-aurora i:nth-child(4) { background: radial-gradient(circle, rgba(245, 158, 11, .07), transparent 70%); }
html[data-theme="dark"] .sb-wave { opacity: .055;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Ccircle cx='0' cy='0' r='40' fill='%230a1222'/%3E%3Ccircle cx='0' cy='0' r='40' fill='none' stroke='%237dd3fc' stroke-width='1.1'/%3E%3Ccircle cx='0' cy='0' r='31' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='22' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='13' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='4' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='0' r='40' fill='%230a1222'/%3E%3Ccircle cx='80' cy='0' r='40' fill='none' stroke='%237dd3fc' stroke-width='1.1'/%3E%3Ccircle cx='80' cy='0' r='31' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='0' r='22' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='0' r='13' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='0' r='4' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='20' r='40' fill='%230a1222'/%3E%3Ccircle cx='40' cy='20' r='40' fill='none' stroke='%237dd3fc' stroke-width='1.1'/%3E%3Ccircle cx='40' cy='20' r='31' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='20' r='22' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='20' r='13' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='20' r='4' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='40' r='40' fill='%230a1222'/%3E%3Ccircle cx='0' cy='40' r='40' fill='none' stroke='%237dd3fc' stroke-width='1.1'/%3E%3Ccircle cx='0' cy='40' r='31' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='40' r='22' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='40' r='13' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='40' r='4' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='40' r='40' fill='%230a1222'/%3E%3Ccircle cx='80' cy='40' r='40' fill='none' stroke='%237dd3fc' stroke-width='1.1'/%3E%3Ccircle cx='80' cy='40' r='31' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='40' r='22' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='40' r='13' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='80' cy='40' r='4' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='60' r='40' fill='%230a1222'/%3E%3Ccircle cx='40' cy='60' r='40' fill='none' stroke='%237dd3fc' stroke-width='1.1'/%3E%3Ccircle cx='40' cy='60' r='31' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='60' r='22' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='60' r='13' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='60' r='4' fill='none' stroke='%237dd3fc' stroke-width='0.8'/%3E%3C/svg%3E") repeat; background-size: 80px 40px; }
html[data-theme="dark"] .sb-hills svg:nth-child(1) { opacity: .55; }
html[data-theme="dark"] .sb-hills svg:nth-child(2) { opacity: .6; }
html[data-theme="dark"] .sb-hills svg:nth-child(3) { opacity: .7; }
html[data-theme="dark"] #sbh1 stop:first-child { stop-color: #1b2d4f; }
html[data-theme="dark"] #sbh2 stop:first-child { stop-color: #172846; }
html[data-theme="dark"] #sbh3 stop:first-child { stop-color: #13223d; }
html[data-theme="dark"] .sb-hills stop:last-child { stop-color: #0a1120; }
/* 太阳换成柔和的月光 */
html[data-theme="dark"] .sb-sun {
  background: radial-gradient(circle at 50% 50%, rgba(238, 244, 255, .95) 0%, rgba(214, 228, 250, .9) 24%, rgba(170, 200, 245, .32) 33%, rgba(120, 165, 235, .1) 50%, transparent 68%);
  filter: blur(1px); opacity: .3; animation-name: sbMoon; }
@keyframes sbMoon { to { transform: translateY(-14px); opacity: .38; } }
html[data-theme="dark"] .sb-dots b { background: #d6ecff; box-shadow: 0 0 8px 1px rgba(56, 189, 248, .45); }

/* ============================================================
   用户端（app.css）
   ============================================================ */
html[data-theme="dark"] .app-body { background: var(--bg); }

/* 顶栏 */
html[data-theme="dark"] .topbar { background: rgba(11, 18, 32, .74); border-bottom-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .tb-nav { background: rgba(255, 255, 255, .035); border-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .tb-nav a.on { background: var(--dk-raise); color: var(--ink); box-shadow: 0 2px 10px -2px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05); }
html[data-theme="dark"] .quota-chip { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .quota-chip:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .user-menu { background: #131f37; border-color: var(--line-2); }
html[data-theme="dark"] .um-item:hover { background: var(--surface-3); }
html[data-theme="dark"] .um-item.danger, html[data-theme="dark"] .um-item.danger .ico { color: #fca5a5; }

/* 首页 */
html[data-theme="dark"] .hh-left { background: linear-gradient(135deg, #13203a 0%, #101c34 58%, #0f202f 100%); border-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .hh-left::before { background: conic-gradient(from 120deg, rgba(37, 99, 235, 0), rgba(59, 130, 246, .2), rgba(20, 184, 166, .18), rgba(14, 165, 233, 0)); }
html[data-theme="dark"] .hh-left::after { background-image: radial-gradient(rgba(125, 180, 255, .13) 1px, transparent 1.4px); }
html[data-theme="dark"] .hh-greet { background: rgba(255, 255, 255, .04); border-color: var(--line); }
html[data-theme="dark"] .notice-bar { background: rgba(255, 255, 255, .035); border-color: var(--line); }
html[data-theme="dark"] .nb-tag { background: rgba(251, 191, 36, .14); color: #fcd34d; }
html[data-theme="dark"] .member-card { box-shadow: 0 26px 50px -26px rgba(14, 116, 220, .55), inset 0 1px 0 rgba(255, 255, 255, .22); }
html[data-theme="dark"] .member-card.q-none { background: radial-gradient(120% 140% at 100% 0%, #64748b 0%, transparent 46%), linear-gradient(135deg, #1e293b, #334155 55%, #475569); box-shadow: 0 26px 50px -26px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .12); }
html[data-theme="dark"] .member-card.q-count { box-shadow: 0 26px 50px -26px rgba(194, 65, 12, .55), inset 0 1px 0 rgba(255, 255, 255, .22); }
html[data-theme="dark"] .sec-head h2 .ico { color: var(--blue); }

html[data-theme="dark"] .agent-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .agent-card:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .agent-card::after { background: radial-gradient(420px circle at var(--mx) var(--my), rgba(56, 189, 248, .1), transparent 45%); }

/* 封面（无图时按主题生成）：夜色版 */
html[data-theme="dark"] .cover.t-teal { background: radial-gradient(80% 120% at 85% 10%, rgba(45, 212, 191, .3) 0%, transparent 55%), radial-gradient(70% 90% at 0% 100%, rgba(34, 211, 238, .22) 0%, transparent 60%), linear-gradient(135deg, #0b2629, #0c2f31 45%, #0b2734); }
html[data-theme="dark"] .cover.t-coral { background: radial-gradient(80% 120% at 90% 0%, rgba(251, 191, 36, .26) 0%, transparent 52%), radial-gradient(70% 100% at 0% 100%, rgba(251, 146, 60, .26) 0%, transparent 60%), linear-gradient(135deg, #261910, #2e1f10 50%, #2a2310); }
html[data-theme="dark"] .cover.t-ink { background: radial-gradient(80% 120% at 88% 0%, rgba(148, 163, 184, .22) 0%, transparent 55%), linear-gradient(160deg, #141b29, #182031 55%, #1d2637); }
html[data-theme="dark"] .cover.t-blue { background: radial-gradient(80% 120% at 85% 10%, rgba(96, 165, 250, .28) 0%, transparent 55%), radial-gradient(70% 90% at 0% 100%, rgba(56, 189, 248, .22) 0%, transparent 60%), linear-gradient(135deg, #0d1b37, #0f2246 45%, #0c233d); }
html[data-theme="dark"] .cover.t-amber { background: radial-gradient(80% 120% at 90% 0%, rgba(251, 191, 36, .28) 0%, transparent 52%), linear-gradient(135deg, #251c0c, #2d240e 50%, #34290d); }
html[data-theme="dark"] .cover.t-red { background: radial-gradient(80% 120% at 90% 0%, rgba(248, 113, 113, .26) 0%, transparent 52%), linear-gradient(135deg, #271315, #2e1718 50%, #2f1d10); }
html[data-theme="dark"] .cover-ink path { fill: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .cover-ink path.l2 { fill: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .t-teal .cover-ink path { fill: rgba(45, 212, 191, .14); }
html[data-theme="dark"] .t-coral .cover-ink path { fill: rgba(251, 146, 60, .14); }
html[data-theme="dark"] .t-ink .cover-ink path { fill: rgba(148, 163, 184, .12); }
html[data-theme="dark"] .t-blue .cover-ink path, html[data-theme="dark"] .t-amber .cover-ink path, html[data-theme="dark"] .t-red .cover-ink path { fill: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .t-teal .cover-ink path.l2, html[data-theme="dark"] .t-coral .cover-ink path.l2, html[data-theme="dark"] .t-ink .cover-ink path.l2,
html[data-theme="dark"] .t-blue .cover-ink path.l2, html[data-theme="dark"] .t-amber .cover-ink path.l2, html[data-theme="dark"] .t-red .cover-ink path.l2 { fill: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .t-teal .cover-glyph { background: linear-gradient(160deg, #5eead4, #22d3ee); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 8px 16px rgba(20, 184, 166, .3)); }
html[data-theme="dark"] .t-coral .cover-glyph { background: linear-gradient(160deg, #fdba74, #fcd34d); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 8px 16px rgba(234, 88, 12, .3)); }
html[data-theme="dark"] .t-ink .cover-glyph { color: #e2e8f0; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .5)); }
html[data-theme="dark"] .t-blue .cover-glyph { background: linear-gradient(160deg, #93c5fd, #67e8f9); -webkit-background-clip: text; background-clip: text; }
html[data-theme="dark"] .t-amber .cover-glyph { background: linear-gradient(160deg, #fde68a, #fbbf24); -webkit-background-clip: text; background-clip: text; }
html[data-theme="dark"] .t-red .cover-glyph { background: linear-gradient(160deg, #fca5a5, #fdba74); -webkit-background-clip: text; background-clip: text; }
html[data-theme="dark"] .spark { background: #e0f2fe; box-shadow: 0 0 10px 2px rgba(186, 230, 253, .55); }

/* 墨色主题在夜间提亮，避免与背景糊在一起 */
html[data-theme="dark"] .t-ink { --tg1: #334155; --tg2: #64748b; }
html[data-theme="dark"] .cr-glyph.t-ink,
html[data-theme="dark"] .ma-avatar.t-ink,
html[data-theme="dark"] .ch-glyph.t-ink,
html[data-theme="dark"] .hot-group.t-ink .hg-name b { background: linear-gradient(135deg, #334155, #5b6b84); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
html[data-theme="dark"] .t-ink .sc-no { background: linear-gradient(135deg, #334155, #5b6b84); box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .1); }
html[data-theme="dark"] .work-card.t-ink::before { background: linear-gradient(90deg, #64748b, #e8553a); }

/* 热门方向 */
html[data-theme="dark"] .hg-tags button { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"] .hot-group.t-teal .hg-tags button:hover { border-color: rgba(45, 212, 191, .5); color: #5eead4; background: rgba(45, 212, 191, .1); }
html[data-theme="dark"] .hot-group.t-coral .hg-tags button:hover { border-color: rgba(251, 146, 60, .5); color: #fdba74; background: rgba(251, 146, 60, .1); }
html[data-theme="dark"] .hot-group.t-ink .hg-tags button:hover { border-color: rgba(148, 163, 184, .5); color: #e2e8f0; background: rgba(148, 163, 184, .1); }
html[data-theme="dark"] .hot-agents button { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .hot-agents button.on { background: #e6edf7; color: #0b1220; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .8); }
html[data-theme="dark"] .hot-tags button { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"] .hot-tags button:hover { color: var(--ink); background: color-mix(in srgb, var(--tg2, #0ea5e9) 14%, transparent); border-color: color-mix(in srgb, var(--tg2, #0ea5e9) 60%, transparent); }
html[data-theme="dark"] .fs-n { box-shadow: 0 6px 14px -6px rgba(14, 140, 233, .6); }

/* 作品、账户 */
html[data-theme="dark"] .works-tabs { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .work-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .work-card:hover { border-color: var(--dk-hover-line); }

/* 激活卡密与教程弹窗 */
html[data-theme="dark"] .redeem-reason { background: rgba(251, 191, 36, .1); color: #fcd34d; border: 1px solid rgba(251, 191, 36, .2); }
html[data-theme="dark"] .redeem-plans div { border-color: rgba(96, 165, 250, .18); }
html[data-theme="dark"] .redeem-input { background-color: var(--dk-input); }
html[data-theme="dark"] .ro-ring { box-shadow: 0 0 0 10px rgba(52, 211, 153, .12), 0 18px 30px -12px rgba(16, 185, 129, .5); }
html[data-theme="dark"] .tut-video { background: #060b16; }
html[data-theme="dark"] .tut-placeholder.t-teal span { color: #5eead4; }
html[data-theme="dark"] .tut-placeholder.t-coral span { color: #fdba74; }
html[data-theme="dark"] .tut-placeholder.t-ink span { color: #e2e8f0; }

/* 创作页：侧栏 */
html[data-theme="dark"] .chat-side { background: rgba(12, 20, 36, .74); border-right-color: var(--line); }
html[data-theme="dark"] .cs-agents { background: var(--surface-2); }
html[data-theme="dark"] .cs-agent:hover { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .cs-agent.on { background: var(--dk-raise); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .cs-agent.on.t-teal b { color: #2dd4bf; }
html[data-theme="dark"] .cs-agent.on.t-coral b { color: #fb923c; }
html[data-theme="dark"] .cs-agent.on.t-ink b { color: #e2e8f0; }
html[data-theme="dark"] .cs-search { background: var(--dk-input); border-color: var(--line-2); }
html[data-theme="dark"] .cs-item:hover { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .cs-item.on { background: var(--surface-2); box-shadow: 0 3px 12px -4px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .05); }
html[data-theme="dark"] .cs-switch { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .cs-switch:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .cs-sw-act { background: rgba(96, 165, 250, .14); color: #93c5fd; }
html[data-theme="dark"] .cs-quick a { background: var(--surface-2); }
html[data-theme="dark"] .cs-quick a:hover { background: var(--surface-3); }

/* 创作页：标题栏与进度 */
html[data-theme="dark"] .chat-head { background: rgba(12, 19, 35, .8); border-bottom-color: var(--line); }
html[data-theme="dark"] .st i { background: var(--surface-3); color: var(--muted); border-color: var(--line-2); }
html[data-theme="dark"] .st.on i { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px rgba(56, 189, 248, .16); }
html[data-theme="dark"] .st.done i { background: rgba(52, 211, 153, .14); color: #6ee7b7; border-color: rgba(52, 211, 153, .32); }
html[data-theme="dark"] .ch-prog { color: #93c5fd; background: rgba(96, 165, 250, .14); }
html[data-theme="dark"] .ch-prog.done { color: #6ee7b7; background: rgba(52, 211, 153, .14); }
html[data-theme="dark"] .cp-wrap { border-bottom-color: rgba(96, 165, 250, .16); }
html[data-theme="dark"] .cpg-ic { background: var(--surface-3); color: var(--blue); }
html[data-theme="dark"] .cpg-bar { background: rgba(255, 255, 255, .08); }

/* 欢迎页 */
html[data-theme="dark"] .wl-hero { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .wl-cat { color: var(--blue); }
html[data-theme="dark"] .wl-tile { background: rgba(17, 27, 48, .86); border-color: var(--line); }
html[data-theme="dark"] .wt-ic { color: #93c5fd; }
html[data-theme="dark"] .wl-btn { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .wl-btn:hover { border-color: var(--dk-accent-line); color: var(--ink); }
html[data-theme="dark"] .wl-btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -10px rgba(14, 140, 233, .7); }

/* 消息 */
html[data-theme="dark"] .mu-bubble { background: linear-gradient(120deg, #2563eb, #0e8fd0); box-shadow: 0 10px 24px -12px rgba(14, 116, 220, .7); }
html[data-theme="dark"] .ma-avatar { box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .ma-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .msg-ai.streaming .ma-card { border-color: rgba(96, 165, 250, .35); box-shadow: 0 0 0 4px rgba(56, 189, 248, .07), var(--shadow-1); }
html[data-theme="dark"] .msg-ai.is-notice .ma-card { background: linear-gradient(135deg, #111b30, #12213b); }
html[data-theme="dark"] .msg-ai.is-error .ma-card { border-color: rgba(248, 113, 113, .32); background: linear-gradient(rgba(248, 113, 113, .06), rgba(248, 113, 113, .06)), var(--surface); }
html[data-theme="dark"] .ma-warn { color: #fbbf24; }
html[data-theme="dark"] .ma-error { color: #fca5a5; }
html[data-theme="dark"] .mu-think { color: #fbbf24; }

/* 正文排版 */
html[data-theme="dark"] .md { color: var(--ink-2); }
html[data-theme="dark"] .md strong { color: var(--ink); }
html[data-theme="dark"] .md-label { color: #93c5fd; background: rgba(96, 165, 250, .14); }
html[data-theme="dark"] .md-pill { color: #5eead4; background: rgba(45, 212, 191, .1); border-color: rgba(45, 212, 191, .28); }
html[data-theme="dark"] .md code.ic { background: var(--surface-3); color: #c7d7ee; }
html[data-theme="dark"] .code-plain { background: var(--dk-input); border-color: var(--line); color: var(--ink-2); }

/* 故事卡 */
html[data-theme="dark"] .story-card { background: linear-gradient(180deg, #14213b, #111b30); border-color: var(--line); }
html[data-theme="dark"] .story-card:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .story-card.live { border-color: rgba(96, 165, 250, .42); }
html[data-theme="dark"] .sc-no { box-shadow: 0 8px 16px -8px rgba(14, 116, 220, .7); }
html[data-theme="dark"] .sc-foot { background: rgba(9, 15, 28, .45); border-top-color: var(--line); }
html[data-theme="dark"] .cf-label { color: #93c5fd; }
html[data-theme="dark"] .cf-ref { color: #fcd34d; background: rgba(251, 191, 36, .14); }

/* 提示词卡 */
html[data-theme="dark"] .prompt-card { background: #0f182c; border-color: var(--line); }
html[data-theme="dark"] .pc-direction { background: var(--grad-soft), #0f182c; border-color: rgba(96, 165, 250, .2); }
html[data-theme="dark"] .pc-ic { background: rgba(96, 165, 250, .15); color: #93c5fd; }
html[data-theme="dark"] .pc-ref .pc-ic { background: rgba(251, 191, 36, .15); color: #fbbf24; }
html[data-theme="dark"] .pc-plan .pc-ic { background: rgba(45, 212, 191, .15); color: #5eead4; }
html[data-theme="dark"] .pc-cover .pc-ic { background: rgba(251, 113, 133, .14); color: #fb7185; }
html[data-theme="dark"] .pc-alt .pc-ic { background: rgba(45, 212, 191, .14); color: #5eead4; }
html[data-theme="dark"] .pc-body, html[data-theme="dark"] .sc-body { color: var(--ink-2); }
html[data-theme="dark"] .pc-copy.copied,
html[data-theme="dark"] .btn.copied { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
html[data-theme="dark"] .pc-more { background: rgba(9, 15, 28, .45); border-top-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .pc-more:hover { color: var(--blue); }
html[data-theme="dark"] .prompt-card.live, html[data-theme="dark"] .story-card.live { animation-name: liveGlowDark; }
@keyframes liveGlowDark { 50% { box-shadow: 0 0 0 4px rgba(56, 189, 248, .14); } }

/* 思考中、待续写 */
html[data-theme="dark"] .th-text { background-image: linear-gradient(90deg, var(--ink) 0%, var(--ink) 40%, #38bdf8 50%, var(--ink) 60%, var(--ink) 100%); }
html[data-theme="dark"] .thinking.is-deep .th-text { background-image: linear-gradient(90deg, var(--ink) 0%, var(--ink) 40%, #fbbf24 50%, var(--ink) 60%, var(--ink) 100%); }
html[data-theme="dark"] .thinking.is-deep .th-time { color: #fbbf24; }
html[data-theme="dark"] .pending-card { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: 0 16px 30px -18px rgba(14, 116, 220, .6); }

/* 输入区 */
html[data-theme="dark"] .composer { background: linear-gradient(180deg, rgba(11, 18, 32, 0), var(--bg) 26%); }
html[data-theme="dark"] .chip-btn { background: rgba(17, 27, 48, .92); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .chip-btn:hover { border-color: var(--dk-accent-line); color: #93c5fd; }
html[data-theme="dark"] .chip-btn.hot { background: var(--grad); color: #fff; border-color: transparent; }
html[data-theme="dark"] .cp-box { background: var(--surface); border-color: var(--line-2); box-shadow: 0 18px 44px -22px rgba(0, 0, 0, .8); }
html[data-theme="dark"] .cp-box:focus-within { border-color: rgba(56, 189, 248, .55); box-shadow: 0 0 0 4px rgba(56, 189, 248, .12), 0 18px 44px -22px rgba(0, 0, 0, .8); }
html[data-theme="dark"] .cp-box textarea { color: var(--ink); }
html[data-theme="dark"] .cp-box textarea::placeholder { color: #6f819c; }
html[data-theme="dark"] .send-btn { box-shadow: 0 8px 20px -8px rgba(14, 140, 233, .8); }
html[data-theme="dark"] .send-btn.stop { background: linear-gradient(135deg, #3a4a66, #56677f); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .7); animation-name: stopPulseDark; }
@keyframes stopPulseDark { 50% { box-shadow: 0 0 0 6px rgba(148, 163, 184, .12), 0 8px 18px -8px rgba(0, 0, 0, .7); } }
html[data-theme="dark"] .think-tog { background: var(--surface); border-color: var(--line-2); color: var(--muted); }
html[data-theme="dark"] .think-tog:hover { border-color: rgba(251, 191, 36, .5); color: #fbbf24; }
html[data-theme="dark"] .think-tog.on { color: #fff; border-color: transparent; background: linear-gradient(118deg, #e8920b, #ea6a14); box-shadow: 0 8px 18px -8px rgba(234, 88, 12, .65); }
html[data-theme="dark"] .think-tog.on em { background: rgba(255, 255, 255, .22); color: #fff; }

/* 智能体目录 */
html[data-theme="dark"] .sec-more:hover { color: #93c5fd; }
html[data-theme="dark"] .cat-chips button { background: rgba(17, 27, 48, .9); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .cat-chips button:hover { border-color: var(--dk-accent-line); color: #93c5fd; }
html[data-theme="dark"] .cat-chips button.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px rgba(14, 140, 233, .7); }
html[data-theme="dark"] .cat-search { background: var(--dk-input); border-color: var(--line-2); }
html[data-theme="dark"] .cat-search:focus-within { border-color: var(--sky); }
html[data-theme="dark"] .agent-tile { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .agent-tile:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .agent-tile::after { background: radial-gradient(380px circle at var(--mx) var(--my), rgba(56, 189, 248, .1), transparent 45%); }
html[data-theme="dark"] .at-cover img { filter: brightness(.94) saturate(.98); }
html[data-theme="dark"] .agent-tile.soon { background: linear-gradient(160deg, rgba(17, 27, 48, .55), rgba(12, 20, 36, .55)); border-color: var(--line-2); }
html[data-theme="dark"] .ph-stats div { background: var(--surface); border-color: var(--line); }

/* 选择智能体弹窗 */
html[data-theme="dark"] .ap-item { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .ap-item:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .ap-item.on { border-color: var(--blue); }

/* 图标图片、手机端智能体列表、点数消耗 */
html[data-theme="dark"] .cr-glyph:has(img),
html[data-theme="dark"] .ch-glyph:has(img),
html[data-theme="dark"] .ma-avatar:has(img),
html[data-theme="dark"] .at-glyph:has(img) { background: var(--surface-3); }
html[data-theme="dark"] .agent-grid.as-list { background: rgba(17, 27, 48, .92); border-color: var(--line); }
html[data-theme="dark"] .al-ic { box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .7); }
html[data-theme="dark"] .al-fav.on { color: #fbbf24; }
html[data-theme="dark"] .agent-li:active { background: var(--surface-3); }
html[data-theme="dark"] .ma-cost { color: #5eead4; background: rgba(45, 212, 191, .12); }
html[data-theme="dark"] .ma-cost em { color: #fbbf24; }
html[data-theme="dark"] .ma-cost.admin { color: var(--muted); background: var(--surface-3); }

/* 移动端 */
@media (max-width: 860px) {
  html[data-theme="dark"] .tabbar { background: rgba(11, 18, 32, .92); border-top-color: var(--line); }
  html[data-theme="dark"] .tabbar a.on .ico { filter: drop-shadow(0 4px 8px rgba(56, 189, 248, .45)); }
  html[data-theme="dark"] .chat-side { background: #0f1829; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
  html[data-theme="dark"] .side-mask { background: rgba(3, 7, 16, .55); }
}

/* ============================================================
   管理后台（admin.css）
   ============================================================ */
html[data-theme="dark"] .admin-body { background: var(--bg); }
html[data-theme="dark"] .ad-side { background: rgba(12, 20, 36, .84); border-right-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .ad-nav a:hover { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .ad-nav a.on { color: #fff; box-shadow: 0 10px 22px -12px rgba(14, 140, 233, .8); }
html[data-theme="dark"] .ad-userlink { background: rgba(96, 165, 250, .12); color: #93c5fd; }
html[data-theme="dark"] .ad-avatar { background: linear-gradient(135deg, #2a3a57, #46597b); }
html[data-theme="dark"] .ad-top { background: rgba(11, 18, 32, .8); border-bottom-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .live-pill { background: var(--surface); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .live-pill.on { color: #6ee7b7; border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .08); }
html[data-theme="dark"] .live-pill.off { color: #fbbf24; }
@media (max-width: 900px) {
  html[data-theme="dark"] .ad-side { background: #0f1829; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
  html[data-theme="dark"] .ad-mask { background: rgba(3, 7, 16, .55); }
}

/* 总览 */
html[data-theme="dark"] .kpi { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .kpi.t-blue { --tone: #60a5fa; }
html[data-theme="dark"] .kpi.t-teal { --tone: #2dd4bf; }
html[data-theme="dark"] .kpi.t-green { --tone: #34d399; }
html[data-theme="dark"] .kpi.t-sky { --tone: #38bdf8; }
html[data-theme="dark"] .kpi.t-amber { --tone: #fbbf24; }
html[data-theme="dark"] .kpi.t-coral { --tone: #fb923c; }
html[data-theme="dark"] .kpi-ic { background: color-mix(in srgb, var(--tone) 16%, transparent); }
html[data-theme="dark"] .kpi-spark .sp-area { fill: color-mix(in srgb, var(--tone) 18%, transparent); }
html[data-theme="dark"] .legend .lg { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .legend .lg.on { background: var(--surface-3); color: var(--ink); }
html[data-theme="dark"] .chart .gl { stroke: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .chart .gt { fill: #8193ae; }
html[data-theme="dark"] .chart .line-blue { stroke: #4f8ff7; }
html[data-theme="dark"] .chart .line-teal { stroke: #2dd4bf; }
html[data-theme="dark"] .chart .pt-blue { fill: var(--surface); stroke: #4f8ff7; }
html[data-theme="dark"] .chart .pt-teal { fill: var(--surface); stroke: #2dd4bf; }
html[data-theme="dark"] .chart .bar-amber { fill: rgba(251, 191, 36, .5); }
html[data-theme="dark"] .chart .cursor { stroke: #64748b; }
html[data-theme="dark"] .ch-tip { background: rgba(30, 43, 68, .97); color: var(--ink); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .7); }
html[data-theme="dark"] .feed-it + .feed-it { border-top-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .ev-blue .fi-ic { background: rgba(96, 165, 250, .15); color: #93c5fd; }
html[data-theme="dark"] .ev-teal .fi-ic { background: rgba(45, 212, 191, .14); color: #5eead4; }
html[data-theme="dark"] .ev-green .fi-ic { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
html[data-theme="dark"] .ev-amber .fi-ic { background: rgba(251, 191, 36, .14); color: #fcd34d; }
html[data-theme="dark"] .ev-red .fi-ic { background: rgba(248, 113, 113, .15); color: #fca5a5; }
html[data-theme="dark"] .ev-gray .fi-ic { background: rgba(148, 163, 184, .14); color: #b4c1d3; }
html[data-theme="dark"] .sw-ink, html[data-theme="dark"] .bf-ink { background: linear-gradient(90deg, #475569, #94a3b8); }
html[data-theme="dark"] .donut svg > circle:first-child { stroke: #1d2a45; }
html[data-theme="dark"] .err-head { color: #fca5a5; }

/* 卡密 */
html[data-theme="dark"] .chip-q { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .chip-q:hover { border-color: var(--sky); color: #93c5fd; }
html[data-theme="dark"] .gen-preview { border-color: rgba(96, 165, 250, .18); }
html[data-theme="dark"] .gen-preview code { color: #93c5fd; }
html[data-theme="dark"] .plan-it { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .plan-it:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .k-hour, html[data-theme="dark"] .k-day { background: rgba(45, 212, 191, .14); color: #5eead4; }
html[data-theme="dark"] .k-month { background: rgba(96, 165, 250, .15); color: #93c5fd; }
html[data-theme="dark"] .k-count { background: rgba(251, 191, 36, .14); color: #fcd34d; }
html[data-theme="dark"] .seg { background: var(--dk-input); box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="dark"] .seg button.on { background: var(--dk-raise); color: var(--ink); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .seg button.on b { color: #93c5fd; }
html[data-theme="dark"] .search-box { background: var(--dk-input); border-color: var(--line-2); }
html[data-theme="dark"] .bulk-bar { background: rgba(96, 165, 250, .1); border-bottom-color: rgba(96, 165, 250, .18); }
html[data-theme="dark"] .bulk-bar span { color: #93c5fd; }
html[data-theme="dark"] .codes-area { background-color: var(--dk-input); }

/* 用户 */
html[data-theme="dark"] .u-av { background: linear-gradient(135deg, #3b4b66, #5b6c88); }
html[data-theme="dark"] .u-av.on { background: var(--grad); }
html[data-theme="dark"] .u-av.on::after { border-color: var(--surface); }
html[data-theme="dark"] .adj-quick button { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .adj-quick button:hover { border-color: var(--sky); color: #93c5fd; background: rgba(56, 189, 248, .1); }
html[data-theme="dark"] .ud-card { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .cv-msg { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .cv-msg.user { background: rgba(96, 165, 250, .08); border-color: rgba(96, 165, 250, .2); }

/* 智能体管理 */
html[data-theme="dark"] .ag-item { background: var(--surface); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .ag-item:hover { border-color: var(--dk-hover-line); }
html[data-theme="dark"] .ag-item.on { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border-color: transparent; }
html[data-theme="dark"] .t-ink .ag-glyph, html[data-theme="dark"] .ag-glyph.t-ink { background: linear-gradient(135deg, #334155, #5b6b84); }
html[data-theme="dark"] .ag-head { background: linear-gradient(180deg, #14213b, #111b30); border-bottom-color: var(--line); }
html[data-theme="dark"] .tabs-line { border-bottom-color: var(--line); }
html[data-theme="dark"] .tut-prev { background: #060b16; }
html[data-theme="dark"] .img-it { border-color: var(--line); }
html[data-theme="dark"] .img-add { border-color: var(--line-2); }
html[data-theme="dark"] .img-add:hover { border-color: var(--sky); color: #93c5fd; }
html[data-theme="dark"] .cfg-help { background: var(--surface-2); }
html[data-theme="dark"] .img-pick { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme="dark"] .ip-icon .ip-prev:has(img[src$="logo.svg"]) { background: var(--surface-3); }
html[data-theme="dark"] .ag-glyph:has(img) { background: var(--surface-3); }

/* 模型 */
html[data-theme="dark"] .mc-ic { box-shadow: 0 8px 18px -8px rgba(14, 140, 233, .7); }
html[data-theme="dark"] .model-card dd.key-ok { color: #6ee7b7; }
html[data-theme="dark"] .model-card dd.key-bad { color: #fca5a5; }
html[data-theme="dark"] .mc-test { background: var(--surface-2); }
html[data-theme="dark"] .mc-test.ok { background: rgba(52, 211, 153, .1); color: #6ee7b7; }
html[data-theme="dark"] .mc-test.bad { background: rgba(248, 113, 113, .1); color: #fca5a5; }

/* 设置 */
html[data-theme="dark"] .save-bar { background: rgba(17, 27, 48, .94); border-color: var(--line-2); }

/* 接口余额 */
html[data-theme="dark"] .bal-card { border-color: rgba(56, 189, 248, .2); background: radial-gradient(120% 160% at 100% 0%, rgba(56, 189, 248, .14), transparent 55%), linear-gradient(118deg, #13213b, #111b30 60%); }
html[data-theme="dark"] .bal-card.skeleton { background: linear-gradient(90deg, #162139 25%, #1d2a46 50%, #162139 75%); background-size: 200% 100%; }
html[data-theme="dark"] .bal-ic { box-shadow: 0 10px 20px -10px rgba(14, 140, 233, .7); }
html[data-theme="dark"] .bal-card.low { border-color: rgba(248, 113, 113, .32); background: radial-gradient(120% 160% at 100% 0%, rgba(248, 113, 113, .15), transparent 55%), linear-gradient(118deg, #241a1c, #111b30 60%); }
html[data-theme="dark"] .bal-card.low .bal-main b { color: #fca5a5; }
html[data-theme="dark"] .mc-bal b.bal-ok { color: #6ee7b7; }
html[data-theme="dark"] .mc-bal b.bal-low { color: #fca5a5; }

/* 次数规则与会员调整 */
html[data-theme="dark"] .pl-rule { color: #5eead4; }
html[data-theme="dark"] .pl-rule-preview { border-color: rgba(96, 165, 250, .18); }
html[data-theme="dark"] .pl-rule-preview b { color: #93c5fd; }
html[data-theme="dark"] .pl-sync { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme="dark"] .adj-rule,
html[data-theme="dark"] .adj-sum { border-color: rgba(96, 165, 250, .2); background: linear-gradient(180deg, #14223d, #121d33); }
html[data-theme="dark"] .adj-rule-head b, html[data-theme="dark"] .adj-sum b, html[data-theme="dark"] .adj-out b { color: #93c5fd; }
html[data-theme="dark"] .adj-modal .adj-now { background: var(--surface-2); }
html[data-theme="dark"] .adj-sec { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .adj-sec .seg { background: var(--dk-input); }
html[data-theme="dark"] .adj-out { border-top-color: var(--line); }
html[data-theme="dark"] .adj-out em.warn { color: #fbbf24; }

/* 安全提醒 */
html[data-theme="dark"] .sec-alert.danger { border-color: rgba(248, 113, 113, .32); background: linear-gradient(180deg, rgba(248, 113, 113, .1), rgba(248, 113, 113, .04)); color: #fecaca; }
html[data-theme="dark"] .sec-alert.danger span { color: #fca5a5; }
html[data-theme="dark"] .sec-alert.warn { border-color: rgba(251, 191, 36, .3); background: linear-gradient(180deg, rgba(251, 191, 36, .09), rgba(251, 191, 36, .03)); color: #fde68a; }
html[data-theme="dark"] .sec-alert.warn span { color: #fcd34d; }

/* ============================================================
   登录页（login.css）
   ============================================================ */
html[data-theme="dark"] .login-body {
  background: radial-gradient(1200px 700px at 78% 30%, #0f2548 0%, rgba(15, 37, 72, 0) 60%),
              radial-gradient(900px 600px at 10% 90%, #0b2a2d 0%, rgba(11, 42, 45, 0) 60%),
              linear-gradient(180deg, #0b1220 0%, #0a1020 100%);
}
html[data-theme="dark"] #globe { filter: brightness(1.35) saturate(1.1); opacity: .85; }
html[data-theme="dark"] .aurora { opacity: .42; }
html[data-theme="dark"] .aurora i { mix-blend-mode: screen; }
html[data-theme="dark"] .aurora .a3 { background: radial-gradient(circle, rgba(251, 191, 36, .16), transparent 65%); }
html[data-theme="dark"] .mesh { opacity: .5; background-image: linear-gradient(rgba(96, 165, 250, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(96, 165, 250, .07) 1px, transparent 1px); }
html[data-theme="dark"] .brand-mark { box-shadow: 0 10px 24px -10px rgba(14, 140, 220, .8); }
html[data-theme="dark"] .lg-status { background: rgba(17, 27, 48, .72); border-color: rgba(255, 255, 255, .08); color: var(--ink-2); }
html[data-theme="dark"] .eyebrow { color: #93c5fd; background: rgba(17, 27, 48, .7); border-color: rgba(96, 165, 250, .22); }
html[data-theme="dark"] .demo { background: rgba(15, 24, 43, .76); border-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .demo-bar,
html[data-theme="dark"] .demo-steps { border-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .demo-dots i:nth-child(1) { background: #f87171; }
html[data-theme="dark"] .demo-dots i:nth-child(2) { background: #fbbf24; }
html[data-theme="dark"] .demo-dots i:nth-child(3) { background: #34d399; }
/* 演示角标颜色由脚本写在行内，这里按颜色值改成夜间可读的配色 */
html[data-theme="dark"] .demo-agent { color: #5eead4 !important; background: rgba(45, 212, 191, .14) !important; }
html[data-theme="dark"] .demo-agent[style*="194, 65, 12"] { color: #fdba74 !important; background: rgba(251, 146, 60, .15) !important; }
html[data-theme="dark"] .demo-agent[style*="30, 41, 59"] { color: #e2e8f0 !important; background: rgba(148, 163, 184, .16) !important; }
html[data-theme="dark"] .demo-body::after { background: linear-gradient(rgba(15, 24, 43, 0), rgba(15, 24, 43, .96)); }
html[data-theme="dark"] .orb::after { background: #0f182b; }
html[data-theme="dark"] .think-text { background-image: linear-gradient(90deg, #c6d2e3 30%, #38bdf8 50%, #c6d2e3 70%); }
html[data-theme="dark"] .demo-out { background: var(--dk-input); border-color: rgba(255, 255, 255, .07); color: var(--ink-2); }
html[data-theme="dark"] .demo-out .k { color: #5eead4; }
html[data-theme="dark"] .demo-steps .step { background: rgba(255, 255, 255, .04); color: var(--faint); }
html[data-theme="dark"] .demo-steps .step.on { color: #fff; background: var(--grad); }
html[data-theme="dark"] .mini-agent { background: rgba(15, 24, 43, .72); border-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .login-body .t-ink b { background: linear-gradient(135deg, #334155, #5b6b84); box-shadow: inset -6px -6px 0 -3px rgba(232, 85, 58, .9); }
html[data-theme="dark"] .auth-card {
  background: rgba(15, 24, 43, .84); border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .75), 0 0 0 1px rgba(96, 165, 250, .06);
}
html[data-theme="dark"] .auth-tabs { background: var(--dk-input); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
html[data-theme="dark"] .tab-ink { background: var(--dk-raise); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); }
html[data-theme="dark"] .auth-notice { background: rgba(251, 146, 60, .1); color: #fdba74; border-color: rgba(251, 146, 60, .3); }
html[data-theme="dark"] .fl-input { background: var(--dk-input); border-color: var(--line-2); color: var(--ink); }
html[data-theme="dark"] .fl-input:focus,
html[data-theme="dark"] .fl-input:not(:placeholder-shown) { background: var(--dk-input-2); }
html[data-theme="dark"] .fl-input:focus { border-color: var(--sky); box-shadow: var(--ring); }
html[data-theme="dark"] .fl-input:focus + label,
html[data-theme="dark"] .fl-input:not(:placeholder-shown) + label { color: #7cc4fa; }
html[data-theme="dark"] .fl-eye:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .auth-err { color: #fca5a5; }

/* ============ 首页智能体页与管理员说明卡 ============ */
html[data-theme="dark"] .admin-note p { color: var(--ink-2); }
html[data-theme="dark"] .works-grid.as-list { background: rgba(17, 27, 48, .92); border-color: var(--line); }

html[data-theme="dark"] .am-links a { background: rgba(255, 255, 255, .03); border-color: rgba(148, 163, 184, .16); color: #e2e8f0; }
html[data-theme="dark"] .am-links a .ico { color: #38bdf8; }
html[data-theme="dark"] .am-links a:hover { border-color: rgba(56, 189, 248, .45); }
html[data-theme="dark"] .btn-polish { color: #67e8f9; background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .3); }
html[data-theme="dark"] .btn-polish .ico { color: #67e8f9; }
html[data-theme="dark"] .ma-polished { color: #6ee7b7; background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .3); }
