/* MCJF 主站深色主题「夜航」：只覆盖颜色与光影，不动布局。
   浅色为默认；html[data-theme="dark"] 时切到深色。
    palette：墨蓝底 + 余烬橙主 accent + 冷钢蓝辅助光；分层表面、顶部微光、环境晕。 */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e14;
  --bg-card: #141926;
  --bg-soft: #1b2231;
  --bg-sunken: #0d1119;
  --bg-tint: #251710;
  --line: #242e3e;
  --line-soft: #1a2230;
  --line-strong: #3a4763;
  --ink: #eef3fa;
  --ink-2: #c6d0dd;
  --muted: #97a2b6;
  --accent: #ff7a33;
  --accent-strong: #ff9a63;
  --accent-soft: rgba(255, 122, 51, .14);
  --accent-ink: #ffb08a;
  --accent-line: rgba(255, 122, 51, .32);
  --steel: #7fb4ff;
  --steel-soft: rgba(127, 180, 255, .12);
  --ok: #3fdc97;
  --warn: #ffc53d;
  --danger: #ff6b6b;
  --info: #7fb4ff;
  --shadow-sm: 0 8px 22px -12px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .045) inset;
  --shadow-md: 0 18px 42px -18px rgba(0, 0, 0, .8), 0 0 24px -10px rgba(255, 122, 51, .16);
  scrollbar-color: #33405a #0d1119;
}

html[data-theme="dark"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 82% -12%, rgba(255, 122, 51, .07), transparent 62%),
    radial-gradient(900px 480px at -10% 30%, rgba(127, 180, 255, .05), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
}
html[data-theme="dark"] ::selection { background: var(--accent); color: #1a0d05; }
html[data-theme="dark"] img { filter: none; }

/* 滚动条：夜航配色 */
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0d1119; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a3444; border-radius: 8px; border: 2px solid #0d1119; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3a4763; }
html[data-theme="dark"] ::-webkit-scrollbar-corner { background: #0d1119; }

/* 焦点环提亮 */
html[data-theme="dark"] :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible { outline-color: #ff9a63; }

/* 顶栏 */
html[data-theme="dark"] .top { background: rgba(11, 14, 20, .92); border-bottom-color: var(--line); }
html[data-theme="dark"] .nav a:hover { color: var(--ink); background: var(--accent-soft); }
html[data-theme="dark"] .nav a.on { color: #1a0d05; }
html[data-theme="dark"] .nav .loginbtn { background: var(--ink); color: #0b0e14; }
html[data-theme="dark"] .nav .loginbtn:hover { background: var(--accent-strong); color: #1a0d05; }
html[data-theme="dark"] .brand em { color: var(--muted); }

/* 首屏 */
html[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse at 75% 32%, rgba(255, 122, 51, .08), transparent 55%),
    linear-gradient(180deg, #0e1320, #0b0e14);
  border-bottom-color: var(--line);
}
html[data-theme="dark"] .hero .veil {
  background: linear-gradient(180deg, rgba(11, 14, 20, .3), rgba(24, 15, 9, .5) 52%, rgba(11, 14, 20, .94));
}
html[data-theme="dark"] .hero .bg { filter: saturate(.5) brightness(.6) contrast(1.05); }
html[data-theme="dark"] .hero-window {
  background: #0d1119;
  border-color: rgba(238, 243, 250, .16);
  box-shadow: 0 24px 60px -28px #000, 0 0 44px -14px rgba(255, 122, 51, .22), 0 0 0 1px #242e3e;
}
html[data-theme="dark"] .hero-scene::after { background: #251710; border-color: #ff9a63; }
html[data-theme="dark"] .eyebrow { color: #ff9a63; }
html[data-theme="dark"] .scene-caption,
html[data-theme="dark"] .scene-coordinate { color: #8b96ab; }
html[data-theme="dark"] .scene-caption span:first-child { color: #b0876a; }

/* 按钮 */
html[data-theme="dark"] .btn.ghost { background: rgba(20, 25, 38, .72); border-color: #3a4763; color: var(--ink-2); }
html[data-theme="dark"] .btn.ghost:hover { background: #1b2231; border-color: var(--accent-line); color: var(--accent-ink); }
html[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0d05; box-shadow: 0 8px 24px -8px rgba(255, 122, 51, .45); }
html[data-theme="dark"] .btn.primary:hover { background: var(--accent-strong); }

/* 内容卡片 */
html[data-theme="dark"] .post:hover { border-color: rgba(255, 122, 51, .4); }
html[data-theme="dark"] .post .ph {
  background: radial-gradient(ellipse at 70% 20%, rgba(255, 122, 51, .07), transparent 65%), linear-gradient(135deg, #141926, #0d1119);
  color: #5b6880;
}
html[data-theme="dark"] .post .ph::before { border-color: #2a3444; }
html[data-theme="dark"] .post .ph::after { background: #ff9a63; }
html[data-theme="dark"] .post .bdg { background: rgba(11, 14, 20, .7); color: var(--ink); }
html[data-theme="dark"] .post .bdg.pin { background: var(--accent); color: #1a0d05; }
html[data-theme="dark"] .post .bdg.feat { background: #1b2231; color: var(--ink-2); }
html[data-theme="dark"] .sk .a,
html[data-theme="dark"] .sk .l { background: linear-gradient(90deg, #141926 25%, #1b2231 50%, #141926 75%); }
html[data-theme="dark"] .entry .ic { background: rgba(255, 122, 51, .12); border-color: var(--accent-line); }
html[data-theme="dark"] .entry:hover .ic { background: var(--accent); border-color: var(--accent); color: #1a0d05; }
html[data-theme="dark"] .about { background: linear-gradient(115deg, #141926, #131a26); }
html[data-theme="dark"] .about::after { border-color: #242e3e; }
html[data-theme="dark"] .about code { color: var(--accent-ink); }
html[data-theme="dark"] #latest .sec-head::after { background: linear-gradient(90deg, transparent, #3a2d21); }

/* 弹出菜单与账号面板 */
html[data-theme="dark"] .mega { background: rgba(16, 21, 32, .97); border-color: #242e3e; box-shadow: 0 30px 70px -24px #000; }
html[data-theme="dark"] .mega a.mi:hover { background: #1b2231; }
html[data-theme="dark"] .mega a.mi .ico { background: rgba(255, 122, 51, .12); border-color: rgba(255, 122, 51, .25); color: var(--accent); }
html[data-theme="dark"] .mega-mask { background: rgba(4, 7, 12, .62); }
html[data-theme="dark"] .acct { background: #141926; border-color: #3a4763; }
html[data-theme="dark"] .acct-mask { background: rgba(4, 7, 12, .62); }
html[data-theme="dark"] .acct-tabs button.on { background: rgba(255, 122, 51, .12); color: var(--accent-ink); }
html[data-theme="dark"] #mcjfCookieBar {
  --ck-ink: #eef3fa; --ck-body: #c6d0dd; --ck-muted: #97a2b6; --ck-accent: #ff7a33;
  background: rgba(16, 21, 32, .96); border-color: #242e3e; color: var(--ink);
}
html[data-theme="dark"] #mcjfCookieBar::before { background: linear-gradient(90deg, transparent, #5a3a22, transparent); }
html[data-theme="dark"] .ck-btn.primary { background: var(--accent); color: #1a0d05; }
html[data-theme="dark"] .ck-btn.primary:hover { background: var(--accent-strong); }
html[data-theme="dark"] #mcjfCookieModal .cm-mask { background: rgba(4, 7, 12, .66); }
html[data-theme="dark"] #mcjfCookieModal .cm-box { background: #141926; border-color: #242e3e; }

/* 数字街区 */
html[data-theme="dark"] #mcjf-district {
  --paper: #0b0e14;
  --ink: #eef3fa;
  --muted: #97a2b6;
  --orange: #ff7a33;
  --line: #242e3e;
  color-scheme: dark;
  background: transparent;
}
html[data-theme="dark"] #mcjf-district .site-header { background: rgba(11, 14, 20, .9); border-color: #242e3e; backdrop-filter: blur(14px); }
html[data-theme="dark"] #mcjf-district .brand-dot { background: #5b6880; }
html[data-theme="dark"] #mcjf-district .site-nav a { color: #97a2b6; }
html[data-theme="dark"] #mcjf-district .site-nav a.current { color: #eef3fa; }
html[data-theme="dark"] #mcjf-district .nav-ai { background: linear-gradient(135deg, #ff7a33, #ff8f52); color: #1a0d05; box-shadow: 0 4px 18px -6px rgba(255, 122, 51, .45); }
html[data-theme="dark"] #mcjf-district .eyebrow { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .section-number { color: #ff9a63; }
html[data-theme="dark"] #mcjf-district .subtitle { color: #97a2b6; }
html[data-theme="dark"] #mcjf-district .heading-note { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .heading-note .mono { color: #6d7a92; }
html[data-theme="dark"] #mcjf-district .title-mark::before { background: rgba(255, 122, 51, .16); border-color: #ff9a63; }
html[data-theme="dark"] #mcjf-district .title-mark::after { background: #ff7a33; border-color: #ff7a33; }
/* 软光晕，绝不落成硬边矩形 */
html[data-theme="dark"] #mcjf-district .spatial-field::before {
  background: radial-gradient(ellipse, rgba(255, 122, 51, .09) 0, rgba(127, 180, 255, .05) 38%, transparent 70%);
}
html[data-theme="dark"] #mcjf-district .ambient-orbit { border-color: rgba(127, 180, 255, .13); }
html[data-theme="dark"] #mcjf-district .ambient-orbit.orbit-two { border-color: rgba(127, 180, 255, .09); }
html[data-theme="dark"] #mcjf-district .ambient-orbit::before { border-top-color: rgba(255, 154, 99, .35); }
html[data-theme="dark"] #mcjf-district .ambient-particle { background: #ff9a63; }
html[data-theme="dark"] #mcjf-district .ambient-particle.two { background: #7fb4ff; }
html[data-theme="dark"] #mcjf-district .connection-base { stroke: #2a3444; }
html[data-theme="dark"] #mcjf-district .connection-light { stroke: #ff9a63; }
html[data-theme="dark"] #mcjf-district .junction { fill: #0d1119; stroke: #3a4763; }
html[data-theme="dark"] #mcjf-district .district-grid:focus-within .junction,
html[data-theme="dark"] #mcjf-district .district-grid:has(.portal:hover) .junction { fill: #ff9a63; stroke: #ff7a33; }
html[data-theme="dark"] #mcjf-district .portal {
  border-color: #242e3e;
  background: #141926;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .045) inset;
}
html[data-theme="dark"] #mcjf-district .portal::after { border-top-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] #mcjf-district .portal:hover,
html[data-theme="dark"] #mcjf-district .portal:focus-visible,
html[data-theme="dark"] #mcjf-district .portal:focus-within {
  border-color: rgba(255, 122, 51, .35);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .85), 0 0 24px -8px rgba(255, 122, 51, .18), 0 1px 0 rgba(255, 255, 255, .06) inset;
}
html[data-theme="dark"] #mcjf-district .ai-portal {
  background: radial-gradient(ellipse at 85% 34%, rgba(255, 122, 51, .1), transparent 48%), linear-gradient(120deg, #151b29 15%, #141826 68%, #121620 100%);
}
html[data-theme="dark"] #mcjf-district .forum-portal { background: linear-gradient(113deg, #141926 28%, #1a1712 100%); }
html[data-theme="dark"] #mcjf-district .game-portal { background: linear-gradient(113deg, #141926 26%, #121a28 100%); }
html[data-theme="dark"] #mcjf-district .portal-label { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .ai-badge { background: rgba(255, 122, 51, .12); border-color: var(--accent-line); color: #ffb08a; }
html[data-theme="dark"] #mcjf-district .ai-title .icon { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .ai-description,
html[data-theme="dark"] #mcjf-district .feature-description { color: #a6b1c4; }
html[data-theme="dark"] #mcjf-district .ai-scene { filter: drop-shadow(0 0 26px rgba(255, 122, 51, .14)); }
html[data-theme="dark"] #mcjf-district .game-portal .feature-scene { filter: drop-shadow(0 0 26px rgba(127, 180, 255, .14)); }
html[data-theme="dark"] #mcjf-district .feature-action { color: #a6b1c4; }
html[data-theme="dark"] #mcjf-district .input-label { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .input-label .mono { color: #6d7a92; }
html[data-theme="dark"] #mcjf-district .prompt-form { background: rgba(13, 17, 25, .85); border-color: #2a3444; }
html[data-theme="dark"] #mcjf-district .prompt-form:focus-within { border-color: #ff9a63; box-shadow: 0 0 0 4px rgba(255, 122, 51, .12), 0 6px 24px -8px rgba(255, 122, 51, .15); }
html[data-theme="dark"] #mcjf-district .prompt-spark { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .prompt-input { color: #eef3fa; }
html[data-theme="dark"] #mcjf-district .prompt-input::placeholder { color: #6d7a92; }
html[data-theme="dark"] #mcjf-district .prompt-input:focus-visible { outline-color: #ff9a63; }
html[data-theme="dark"] #mcjf-district .send-button { background: #ff7a33; color: #1a0d05; box-shadow: 0 4px 14px -4px rgba(255, 122, 51, .5); }
html[data-theme="dark"] #mcjf-district .send-button:hover { background: #ff9a63; }
html[data-theme="dark"] #mcjf-district .suggestions button { color: #97a2b6; }
html[data-theme="dark"] #mcjf-district .suggestions button::before { color: #6d7a92; }
html[data-theme="dark"] #mcjf-district .suggestions button:hover { background: #1b2231; border-color: rgba(255, 122, 51, .25); color: #ffb08a; }
html[data-theme="dark"] #mcjf-district .tools-heading h2 { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .tools-heading::after { background: linear-gradient(90deg, #242e3e, rgba(36, 46, 62, .2)); }
html[data-theme="dark"] #mcjf-district .tools-heading .mono { color: #6d7a92; }
html[data-theme="dark"] #mcjf-district .tool-dock {
  border-color: #242e3e;
  background: linear-gradient(110deg, rgba(20, 25, 38, .92), rgba(13, 17, 25, .88));
  box-shadow: 0 10px 26px -18px rgba(0, 0, 0, .8);
}
html[data-theme="dark"] #mcjf-district .tool-entry + .tool-entry::before { background: #242e3e; }
html[data-theme="dark"] #mcjf-district .tool-entry:hover,
html[data-theme="dark"] #mcjf-district .tool-entry:focus-visible { background: #1b2231; border-color: rgba(255, 122, 51, .25); }
html[data-theme="dark"] #mcjf-district .tool-icon {
  color: #a6b1c4;
  background: linear-gradient(140deg, #1b2231, #141926);
  border-color: #2a3444;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
}
html[data-theme="dark"] #mcjf-district .tool-description { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .tool-arrow { color: #6d7a92; }
html[data-theme="dark"] #mcjf-district .district-bottom { color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .bottom-caption .icon { color: #6d7a92; }
html[data-theme="dark"] #mcjf-district .legacy-search { color: #97a2b6; }
html[data-theme="dark"] #mcjf-district .legacy-search:hover { color: #ffb08a; }
html[data-theme="dark"] #mcjf-district .legacy-tag { border-color: #2a3444; color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .section-footer { border-color: #242e3e; color: #8b96ab; }
html[data-theme="dark"] #mcjf-district .footer-signature strong { color: #c6d0dd; }
html[data-theme="dark"] #mcjf-district .footer-signature .separator { background: #3a4763; }
html[data-theme="dark"] #mcjf-district .motion-toggle { color: #97a2b6; }
html[data-theme="dark"] #mcjf-district .motion-symbol i { background: #5b6880; }
html[data-theme="dark"] #mcjf-district .motion-symbol i:nth-child(2) { background: #ff9a63; }
html[data-theme="dark"] #mcjf-district .motion-state { color: #ffb08a; }
html[data-theme="dark"] #mcjf-district .entry-dialog { border-color: #3a4763; background: #141926; color: #eef3fa; box-shadow: 0 30px 90px -30px #000; }
html[data-theme="dark"] #mcjf-district .entry-dialog::backdrop { background: rgba(5, 8, 13, .72); }
html[data-theme="dark"] #mcjf-district .close-dialog { border-color: #2a3444; background: #1b2231; }
html[data-theme="dark"] #mcjf-district .dialog-eyebrow { color: #ffb08a; }
html[data-theme="dark"] #mcjf-district .dialog-description { color: #a6b1c4; }
html[data-theme="dark"] #mcjf-district .question-bubble { border-color: rgba(255, 122, 51, .3); background: #251710; }
html[data-theme="dark"] #mcjf-district .preview-explanation { border-color: #242e3e; color: #97a2b6; }
html[data-theme="dark"] #mcjf-district .dialog-back { background: #ff7a33; color: #1a0d05; }
html[data-theme="dark"] #mcjf-district button:focus-visible,
html[data-theme="dark"] #mcjf-district a:focus-visible,
html[data-theme="dark"] #mcjf-district input:focus-visible { outline-color: #ff9a63; }

/* 切换按钮 */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-btn[aria-pressed="true"] svg { transform: rotate(-18deg) scale(.96); }
.theme-btn .theme-sun { display: block; }
.theme-btn .theme-moon { display: none; }
html[data-theme="dark"] .theme-btn .theme-sun { display: none; }
html[data-theme="dark"] .theme-btn .theme-moon { display: block; }

/* 切换时的过渡（只在切换瞬间挂上，避免影响其它动画） */
html.theme-fading,
html.theme-fading * {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease !important;
}

/* ============================================================
   子页面：AI 系列 / 搜索 / 论坛 / 404 / 游戏列表
   它们各自有一套同名变量，这里统一给出深色值
   ============================================================ */
html[data-theme="dark"] {
  --sub: #a9b3c0;
  --glass: rgba(20, 25, 38, .86);
  --glass-strong: rgba(13, 17, 25, .97);
  --accent-hover: #ff9a63;
  --accent-soft: #251710;
  --accent-line: rgba(255, 122, 51, .3);
  --accent-ink: #ffb08a;
  --c-text: #eef3fa;
  --c-hint: #97a2b6;
  --amber: #ff7a33;
  --blue: #ff7a33;
  --shadow: 0 10px 28px -16px rgba(0, 0, 0, .7);
}

/* ---- AI 主页与 AI 工具页 ---- */
html[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 122, 51, .09), transparent 60%),
    radial-gradient(ellipse at 88% 112%, rgba(127, 180, 255, .05), transparent 55%) !important;
}
html[data-theme="dark"] .sidebar { background: #10151f; border-color: #242e3e; }
html[data-theme="dark"] .menu { background: #141926; border-color: #2a3444; box-shadow: 0 18px 40px -18px #000; }
html[data-theme="dark"] .session-row:hover,
html[data-theme="dark"] .histbar button:hover { background: #1b2231; }
html[data-theme="dark"] .histbar button { background: #1b2231; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .msg.user .bubble { background: #251710; color: #ffd9c2; }
html[data-theme="dark"] .msg.user .bubble code { background: rgba(255, 255, 255, .08); color: #ffd9c2; }
html[data-theme="dark"] .msg.ai .bubble.work-bubble { background: #1b2231; border-color: #2a3444; }
html[data-theme="dark"] .bubble .tbl { background: #0d1119; border-color: #2a3444; }
html[data-theme="dark"] .bubble tbody tr:hover { background: #1b2231; }
html[data-theme="dark"] .bubble .acts button,
html[data-theme="dark"] .bubble .acts button:hover { background: #1b2231; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .sitemenu { background: #141926; border-color: #2a3444; box-shadow: 0 18px 40px -18px #000; }
html[data-theme="dark"] .work-toggle[aria-pressed="true"],
html[data-theme="dark"] .work-toggle[aria-pressed="true"][aria-disabled="true"] { background: #251710; color: #ffb08a; }
html[data-theme="dark"] .mode-tag { background: #251710; color: #ff9a63; }
html[data-theme="dark"] .work-file-card,
html[data-theme="dark"] .work-file-icon,
html[data-theme="dark"] .ufile,
html[data-theme="dark"] .thumbs .fchip,
html[data-theme="dark"] .thumbs .t b { background: #1b2231; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .ufile:hover { background: #202a3c; }
html[data-theme="dark"] #saveModal .smbox,
html[data-theme="dark"] #switchModal .smbox { background: #141926; border-color: #2a3444; box-shadow: 0 30px 60px -20px #000; }
html[data-theme="dark"] #saveModal button,
html[data-theme="dark"] #switchModal button { background: #1b2231; border-color: #3a4763; color: var(--ink); }
html[data-theme="dark"] #toast { background: #1b2231; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .fb-open { background: #1b2231; border-color: #2a3444; color: var(--ink); }

/* ---- 聚合搜索 ---- */
html[data-theme="dark"] .bg::after { background: linear-gradient(180deg, rgba(11, 14, 20, .55), #0b0e14) !important; }
html[data-theme="dark"] .searchbar { background: #141926; border-color: #2a3444; box-shadow: 0 18px 40px -22px #000; }
html[data-theme="dark"] .go { background: #1b2231; color: var(--ink); }
html[data-theme="dark"] .cands { background: #141926; border-color: #2a3444; box-shadow: 0 18px 40px -18px #000; }
html[data-theme="dark"] .cand.on { background: #1b2231; }
html[data-theme="dark"] .mode.sel { background: #251710; color: #ff9a63; }
html[data-theme="dark"] .qk { background: #1b2231; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .qk:hover { background: #202a3c; }
html[data-theme="dark"] .chip { background: #1b2231; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .scrollhint,
html[data-theme="dark"] #wallTag { color: #8b96ab; }
html[data-theme="dark"] .peek::before,
html[data-theme="dark"] .peek-b { background: #141926; border-color: #2a3444; }
html[data-theme="dark"] .cargo-blocked-inner,
html[data-theme="dark"] #jtOpen,
html[data-theme="dark"] #shellBar,
html[data-theme="dark"] #shell iframe { background: #141926; border-color: #2a3444; }
html[data-theme="dark"] #backBtn:hover { background: #1b2231; }

/* ---- 论坛（含发帖、帖子页、上传页、游戏列表） ---- */
html[data-theme="dark"] .btn { background: #141926; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0d05; }
html[data-theme="dark"] input[type=text], html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: #0d1119; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] select option { background: #141926; color: var(--ink); }
html[data-theme="dark"] .seg button.on { background: #251710; color: #ff9a63; }
html[data-theme="dark"] .imgs button { background: #1b2231; border-color: #2a3444; }
html[data-theme="dark"] .post.pinned { background: #141926; }
html[data-theme="dark"] .badge.pin,
html[data-theme="dark"] .badge.feat,
html[data-theme="dark"] .badge.art { background: #251710; color: #ff9a63; }
html[data-theme="dark"] .act.liked { background: #251710; color: #ff9a63; }
html[data-theme="dark"] .toast { background: #1b2231; border-color: #2a3444; color: var(--ink); }
html[data-theme="dark"] .sk-line,
html[data-theme="dark"] .sk-dot,
html[data-theme="dark"] .skel-card .cover { background: linear-gradient(90deg, #141926 25%, #1b2231 50%, #141926 75%); }
html[data-theme="dark"] .forum-heading {
  background: radial-gradient(ellipse at 78% 30%, rgba(255, 122, 51, .07), transparent 58%);
  border-color: #242e3e;
}

/* ---- 404 ---- */
html[data-theme="dark"] .illustration { background: #0d1119; border-color: #242e3e; }

/* ---- 通用悬浮切换按钮（页面自身没有按钮时由脚本注入） ---- */
.theme-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line, #e3e6ea);
  border-radius: 999px;
  background: var(--bg-card, #fff);
  color: var(--muted, #6b7480);
  cursor: pointer;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .45);
  opacity: .82;
  transition: opacity .2s, color .2s, border-color .2s, background .2s;
}
.theme-fab:hover { opacity: 1; color: var(--accent, #ff6a1f); border-color: var(--accent, #ff6a1f); }
.theme-fab svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-fab .theme-sun { display: block; }
.theme-fab .theme-moon { display: none; }
html[data-theme="dark"] .theme-fab .theme-sun { display: none; }
html[data-theme="dark"] .theme-fab .theme-moon { display: block; }

/* ============================================================
   补全：各页面内联样式里写死的浅色（论坛卡片 / AI 对话工作台 /
   游戏列表 / Hydrogen / 媒体生成页），逐一对齐夜航配色
   ============================================================ */

/* ---- 论坛：列表卡片、分享框 ---- */
html[data-theme="dark"] .layout .post { background: linear-gradient(120deg, #141926, #121826); }
html[data-theme="dark"] .layout .post.pinned { background: #161b28; border-color: var(--line-strong); }
html[data-theme="dark"] #post .share {
  border-color: #3a2d21;
  background:
    radial-gradient(ellipse at 96% 0%, rgba(255, 122, 51, .12), transparent 58%),
    linear-gradient(120deg, #161b28, #12161f);
  box-shadow: 0 12px 30px -26px #000;
}
html[data-theme="dark"] #post .share input { background: #0d1119; border-color: #2a3444; color: var(--ink); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
html[data-theme="dark"] #post .share input:focus { border-color: #ff9a63; box-shadow: 0 0 0 3px rgba(255, 122, 51, .14); }
html[data-theme="dark"] #post .share .act,
html[data-theme="dark"] #post .share .act:hover { color: #1a0d05; }
html[data-theme="dark"] #post .share .act:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

/* ---- AI 对话工作台（仅 chat 页，媒体页 header 保持透明） ---- */
html[data-theme="dark"][data-mcjf-motion="chat"] {
  --run: #ff7a33;
  --run-ink: #ff9a63;
  --run-soft: rgba(255, 122, 51, .12);
  --run-line: rgba(255, 122, 51, .3);
  --done: #6d7a92;
}
html[data-theme="dark"][data-mcjf-motion="chat"] header { background: #0d1119; border-bottom-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="chat"] footer { background: linear-gradient(transparent, #0b0e14 30%); }
html[data-theme="dark"][data-mcjf-motion="chat"] .session-row.active { background: #202a3c; box-shadow: none; }
html[data-theme="dark"][data-mcjf-motion="chat"] .work-switch { background: #1b2231; }
html[data-theme="dark"][data-mcjf-motion="chat"] .work-switch::before {
  background: #33405a;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .06) inset;
}
html[data-theme="dark"][data-mcjf-motion="chat"] .work-toggle[aria-pressed="true"][aria-disabled="true"] { background: transparent; color: var(--muted); box-shadow: none; }
html[data-theme="dark"][data-mcjf-motion="chat"] .mode-tag { border-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="chat"] .bubble th { background: #1b2231; color: var(--muted); }
html[data-theme="dark"][data-mcjf-motion="chat"] .trace-body { background: #0d1119; border-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="chat"] .wt-row.wt-thought > .trace-body { background: transparent; border: 0; border-inline-start: 1px solid var(--line); }
html[data-theme="dark"][data-mcjf-motion="chat"] .wt-row > summary:hover { background: #1b2231; }
html[data-theme="dark"][data-mcjf-motion="chat"] :is(details.think, .work-trace-fold) > summary:hover { background: #1b2231; color: var(--ink); }
html[data-theme="dark"][data-mcjf-motion="chat"] .work-trace { border-left-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="chat"] .wt-dot { background: #5b6880; }
html[data-theme="dark"][data-mcjf-motion="chat"] .wt-label { color: var(--ink-2); }
html[data-theme="dark"][data-mcjf-motion="chat"] .wt-text { color: var(--muted); }
html[data-theme="dark"][data-mcjf-motion="chat"] .wt-row.fail .wt-dot { background: var(--danger); }
html[data-theme="dark"][data-mcjf-motion="chat"] .wt-row.fail .wt-icon { color: #ff8a8a; }
html[data-theme="dark"][data-mcjf-motion="chat"] .work-progress { color: var(--ink-2); }
html[data-theme="dark"][data-mcjf-motion="chat"] .ic-size,
html[data-theme="dark"][data-mcjf-motion="chat"] .ic-cancel { background: #1b2231; border-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="chat"] .ic-go,
html[data-theme="dark"][data-mcjf-motion="chat"] .ic-go:hover { color: #1a0d05; }
html[data-theme="dark"][data-mcjf-motion="chat"] .mode-info-detail:hover { background: rgba(255, 122, 51, .22); }

/* ---- 游戏列表：主视觉封面、标签、成就卡 ---- */
html[data-theme="dark"] .game-hero .visual { background: linear-gradient(145deg, #141926, #0d1119); }
html[data-theme="dark"] .game-hero .visual::after { border-color: rgba(238, 243, 250, .14); }
html[data-theme="dark"] .game-hero .visual-bg {
  background:
    linear-gradient(180deg, rgba(11, 14, 20, .15) 10%, rgba(11, 14, 20, .92) 94%),
    url("/games/8964-sim/assets/images/photo_01.png") center / cover no-repeat;
  filter: grayscale(45%) brightness(.62);
  opacity: .8;
}
html[data-theme="dark"] .game-hero .game-tag { background: rgba(255, 122, 51, .12); color: #ffb08a; border-color: var(--accent-line); }
html[data-theme="dark"] .game-hero .visual p { color: #8b96ab; }
html[data-theme="dark"] .achv-progress { background: #141926; }
html[data-theme="dark"] .achv-bar-fill { background: #ff9a63; }
html[data-theme="dark"] .achv-card { background: #141926; border-color: var(--line); }
html[data-theme="dark"] .achv-card:not(.locked) { background: #161b28; border-color: #3a2d21; }

/* ---- Hydrogen 模型说明页 ---- */
html[data-theme="dark"] section.intro {
  border-color: var(--accent-line);
  background:
    radial-gradient(ellipse at 82% 18%, rgba(255, 122, 51, .1), transparent 55%),
    linear-gradient(130deg, #161b28, #12161f);
}
html[data-theme="dark"] .benchmark-chart { background: #141926; border-color: var(--line); }
html[data-theme="dark"] .tasks li { background: #141926; border-color: var(--line); }
html[data-theme="dark"] .hydrogen .bar-track::before { background: #ff7a33; }
html[data-theme="dark"] .sonnet .bar-track::before { background: #7fb4ff; }

/* ---- 媒体生成页（图片 / 视频）：面板、灵感卡、标签、生成按钮 ---- */
html[data-theme="dark"][data-mcjf-motion="media"] .iconbtn { background: #141926; border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"][data-mcjf-motion="media"] .tab { background: #141926; border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"][data-mcjf-motion="media"] .tab:hover { background: #1b2231; color: var(--ink); }
html[data-theme="dark"][data-mcjf-motion="media"] .tab.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
html[data-theme="dark"][data-mcjf-motion="media"] .panel { background: var(--glass); border-color: var(--line); box-shadow: 0 8px 24px -16px rgba(0, 0, 0, .7); }
html[data-theme="dark"][data-mcjf-motion="media"] .chip.on { color: var(--accent-ink); }
html[data-theme="dark"][data-mcjf-motion="media"] .go { background: var(--accent); border-color: var(--accent); color: #1a0d05; }
html[data-theme="dark"][data-mcjf-motion="media"] .go:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
html[data-theme="dark"][data-mcjf-motion="media"] .card { background: #141926; border-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="media"] .card img { background: #0d1119; }
html[data-theme="dark"][data-mcjf-motion="media"] .card .foot a,
html[data-theme="dark"][data-mcjf-motion="media"] .card .foot button { background: #1b2231; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"][data-mcjf-motion="media"] .card .ph { background: #0d1119; }
html[data-theme="dark"][data-mcjf-motion="media"] .card .ph.err { color: #ff8a8a; background: rgba(255, 107, 107, .1); }
html[data-theme="dark"][data-mcjf-motion="media"] .idea { background: #141926; border-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="media"] .idea:hover { background: var(--accent-soft); border-color: var(--accent); }
html[data-theme="dark"][data-mcjf-motion="media"] .err { color: #ff8a8a; }
html[data-theme="dark"][data-mcjf-motion="media"] .histbar button:hover { color: #ff8a8a; border-color: rgba(255, 107, 107, .35); }

/* ---- 文件预览页 ---- */
html[data-theme="dark"][data-mcjf-motion="file"] .card { background: #141926; border-color: var(--line); }
html[data-theme="dark"][data-mcjf-motion="file"] .card .head { background: #0d1119; border-color: var(--line); }