/* 2026-10 统一工作台视觉。保留原有功能样式，本文件只覆盖布局与主题。 */
:root {
  --bg: #0c0e12;
  --card: #12151a;
  --card-hover: #181c22;
  --border: #292d34;
  --text: #ece9e1;
  --muted: #9297a0;
  --primary: #d2b476;
  --up: #df7b73;
  --down: #68b99a;
  --surface-inset: #101318;
  --surface-nav: #0f1116;
  --accent-soft: #29251d;
  --warning: #d2a562;
  --sidebar-width: 220px;
  --topbar-height: 64px;
}
html { scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a, button, select, input, summary { transition: color .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease, transform .18s ease; }
a { color: var(--primary); }
button:active, .btn:active { transform: translateY(1px); }
:where(button, a, input, select, summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
::selection { background: #d2b47644; color: var(--text); }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 200; top: 10px; left: 10px; padding: 10px 14px; border-radius: 6px; background: var(--primary); color: #17140f; text-decoration: none; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* 全局导航 */
.app-sidebar {
  position: fixed; z-index: 80; inset: 0 auto 0 0; width: var(--sidebar-width);
  display: flex; flex-direction: column; padding: 22px 15px 17px; overflow-y: auto;
  background: var(--surface-nav); border-right: 1px solid var(--border);
}
.sidebar-brand-row { display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); text-decoration: none; }
.brand-mark { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #6c6047; border-radius: 9px; background: #191711; color: var(--primary); }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.brand strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.brand small { display: block; margin-top: 3px; color: #656b75; font-size: 9px; letter-spacing: .16em; }
.sidebar-close { display: none; margin-left: auto; padding: 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.game-sigil { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #4b412e; border-radius: 6px; background: var(--accent-soft); color: var(--primary); font-size: 10px; font-weight: 700; }
.sidebar-nav { display: grid; gap: 20px; margin-top: 28px; }
.nav-label { margin: 0 11px 7px; color: #60666f; font-size: 10px; letter-spacing: .14em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; margin: 2px 0; padding: 0 11px; border-radius: 6px; color: #a0a5ae; text-decoration: none; font-size: 13px; }
.nav-item:hover { background: var(--card-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #e3c989; }
.nav-item.active::before { content: ""; position: absolute; left: -15px; top: 10px; bottom: 10px; width: 2px; background: var(--primary); }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item .site-alert-badge { margin-left: auto; }
.sidebar-source { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 17px 7px 0; border-top: 1px solid var(--border); }
.sidebar-source div { min-width: 0; }
.sidebar-source small { display: block; color: #656b74; font-size: 9px; }
.sidebar-source strong { display: block; margin-top: 3px; font-size: 11px; font-weight: 550; }
.sidebar-source a { margin-left: auto; font-size: 10px; text-decoration: none; }
.source-indicator { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 3px #d2a56214; }
.app-frame { min-height: 100dvh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 50; top: 0; display: flex; align-items: center; gap: 18px; height: var(--topbar-height); min-height: var(--topbar-height); padding: 0 28px; flex-wrap: nowrap; overflow: visible; background: rgb(14 16 20 / 94%); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
.topbar-crumb { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.topbar-crumb span { color: var(--muted); }
.topbar-crumb span::after { content: "／"; margin-left: 10px; color: #515761; }
.topbar-crumb b { font-weight: 550; }
.topbar-source { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); text-decoration: none; font-size: 11px; }
.topbar-source:hover { color: var(--text); }
.clock { color: #707680; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mobile-nav-toggle { display: none; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); cursor: pointer; }
.nav-backdrop { position: fixed; z-index: 70; inset: 0; border: 0; background: rgb(4 6 9 / 68%); backdrop-filter: blur(2px); }
.nav-backdrop[hidden] { display: none; }

/* 基础组件 */
.container { max-width: 1480px; margin: 0 auto; padding: 27px 28px 46px; }
.container:has(.wiki-shell) { max-width: none; padding: 0; }
.page-title { margin-bottom: 8px; font-size: 28px; line-height: 1.25; font-weight: 650; letter-spacing: -.03em; text-wrap: balance; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 17px; margin-bottom: 17px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.toolbar { gap: 11px; }
.toolbar label { color: var(--muted); font-size: 12px; }
select, input[type="number"], input[type="text"], input[type="password"], input[type="date"], input[type="url"] {
  min-height: 34px; background: var(--surface-inset); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 6px 10px; outline: none;
}
select:focus, input:focus { border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 7px 14px; border: 1px solid var(--primary); border-radius: 6px; background: var(--primary); color: #1a1711; text-decoration: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn:hover { opacity: 1; background: #e0c487; }
.btn.ghost { background: transparent; border-color: var(--border); color: #b0b5bd; font-weight: 500; }
.btn.ghost:hover { background: var(--card-hover); border-color: #4a4f58; color: var(--text); }
.btn.danger { background: #b95750; border-color: #b95750; color: #fff; }
.seg { border-color: var(--border); border-radius: 6px; }
.seg button { padding: 6px 13px; color: var(--muted); font-size: 12px; }
.seg button:hover { color: var(--text); background: var(--card-hover); }
.seg button.active { background: var(--accent-soft); color: #e3c989; }
.price-source-bar { gap: 13px; margin-bottom: 22px; padding: 11px 14px; background: var(--card); border-color: var(--border); border-radius: 8px; }
.price-source-bar > a { white-space: nowrap; font-size: 11px; text-decoration: none; }
.price-source-bar [role="status"] { color: var(--muted); }
table { font-size: 12px; }
th, td { padding: 10px 11px; border-color: var(--border); font-variant-numeric: tabular-nums; }
th { color: #7d838d; font-size: 11px; font-weight: 500; }
tbody tr:hover { background: #ffffff03; }
.up { color: var(--up); }
.down { color: var(--down); }
.empty { padding: 34px 12px; color: var(--muted); line-height: 1.7; }
.chart-box { height: 420px; }
.chart-empty-state { display: grid; justify-items: center; align-content: center; min-height: 210px; padding: 32px 20px; border: 1px dashed #383d46; border-radius: 8px; background: #101318; text-align: center; }
.chart-empty-state[hidden] { display: none; }
.chart-empty-state h3 { margin: 0 0 8px; font-size: 16px; }
.chart-empty-state p { max-width: 580px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.chart-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
#main-chart[hidden] { display: none; }
.toast { top: 78px; background: #1b1d21; border-color: #6b5c3e; box-shadow: 0 12px 34px #05070a66; }
.site-alert-card { background: #1c1a18; }

/* BD、视频与详情页：统一表面和暖金状态。 */
.content-shell { max-width: 1320px; padding: 0 0 44px; }
.content-page-title { margin-bottom: 18px; font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.bd-back { margin-bottom: 13px; padding: 0; border: 0; color: var(--muted); text-decoration: none; }
.bd-back:hover { background: transparent; color: var(--primary); }
.content-toolbar, .creator-strip, .video-monitor, .bd-card, .bd-hero, .bd-section, .bd-side-card, .job-detail-card, .video-job, .video-pipeline, .video-upload, .bd-empty {
  background: var(--card); border-color: var(--border); border-radius: 8px;
}
.content-control, .bd-button, .variant-tab, .video-upload-form input, .pipeline-token-form input { background: var(--surface-inset); border-color: var(--border); color: var(--text); }
.content-muted, .bd-meta, .creator-meta, .sync-note, .video-job-meta, .pipeline-sub, .video-upload-note { color: var(--muted); }
.creator-avatar { border-radius: 12px; background: var(--accent-soft); border-color: #51452f; color: var(--primary); }
.bd-card::after { background: linear-gradient(90deg, rgb(14 16 20 / 97%) 0%, rgb(14 16 20 / 84%) 48%, rgb(14 16 20 / 42%) 100%); }
.bd-hero::after { background: linear-gradient(90deg, rgb(14 16 20 / 98%) 0%, rgb(14 16 20 / 82%) 48%, rgb(14 16 20 / 36%) 100%); }
.bd-button { text-decoration: none; }
.bd-button:hover { border-color: #6a5b3d; color: var(--primary); }
.bd-button.primary { background: var(--accent-soft); border-color: #6b5938; color: var(--primary); }
.bd-status.pending, .video-job-state, .push-badge.pending { color: #a7aeb9; background: #a7aeb912; }
.video-state-note { border-color: #4a402d; background: #d2b4760b; color: #c5b28d; }
.progress { background: #282c32; }
.progress span { background: var(--primary); }
.progress.complete span { background: var(--down); }
.video-library-head { display: flex; align-items: center; gap: 12px; margin: 24px 0 13px; }
.video-library-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.video-library-head p { margin: 0; color: var(--muted); font-size: 11px; }
.video-library-head .video-sync-action { margin-left: auto; }
.video-admin { margin-top: 24px; border: 1px solid var(--border); border-radius: 8px; background: #0f1216; }
.video-admin > summary { display: flex; align-items: center; gap: 9px; padding: 15px 16px; color: #b9bdc4; cursor: pointer; font-size: 12px; font-weight: 550; list-style-position: inside; }
.video-admin > summary small { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.video-admin-body { padding: 0 15px 15px; border-top: 1px solid var(--border); }
.video-pipeline { background: var(--card); }
.video-thumb { background: #20242a; }
.video-job-title a { text-decoration: none; }
.video-job-title a:hover { color: var(--primary); }
.video-job-side { min-width: 76px; }

/* 百科保留阅读布局，统一导航、链接与表面。 */
.wiki-shell { --wiki-panel: var(--card); --wiki-panel-2: var(--card-hover); --wiki-border: var(--border); --wiki-blue: var(--primary); --wiki-text: var(--text); --wiki-muted: var(--muted); min-height: calc(100dvh - var(--topbar-height)); background: var(--bg); color: var(--wiki-text); }
.wiki-layout { grid-template-columns: 250px minmax(0, 1fr) 200px; }
.wiki-search-row, .wiki-sidebar, .wiki-toc { background: var(--surface-nav); border-color: var(--border); }
.wiki-search input, .wiki-search-suggestions, .wiki-season-card, .wiki-sync-panel { background: var(--surface-inset); border-color: var(--border); color: var(--text); }
.wiki-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #d2b47618; }
.wiki-side-link.is-active, .wiki-side-link:hover, .wiki-article-card:hover, .wiki-related-list a:hover, .wiki-search-suggestions a:hover, .wiki-search-suggestions li:hover, .wiki-search-suggestions li.is-active { background: var(--accent-soft); color: var(--text); }
.wiki-side-link.is-active { border-left-color: var(--primary); }
.wiki-side-link { border-radius: 5px; }
.wiki-eyebrow, .wiki-kicker, .wiki-card-type, .wiki-match, .wiki-feature-copy small, .wiki-section-heading > a, .wiki-breadcrumb a, .wiki-prose a, .wiki-update-actions a, .wiki-source-link, .wiki-inline-toc a { color: var(--primary); }
.wiki-feature-card, .wiki-article-card, .wiki-related-list a, .wiki-result-card, .wiki-update-feature { border-color: var(--border); }
.wiki-feature-card:hover { border-color: #6b5b3d; }
.wiki-season-badge, .wiki-language-switch button.is-active { background: var(--accent-soft); border-color: #5a4d33; color: #e3c989; }
.wiki-update-filters a { background: var(--card); border-color: var(--border); }
.wiki-update-filters a:hover, .wiki-update-filters a.is-active { background: var(--accent-soft); border-color: #5a4d33; color: #e3c989; }
.wiki-update-actions .wiki-primary-link { background: var(--primary); border-color: var(--primary); color: #1a1711; }

/* 回本分析：不改计算与布局，只收敛旧蓝色表面。 */
.earnings-analysis button:focus-visible, .earnings-analysis a:focus-visible, .earnings-analysis summary:focus-visible { outline-color: var(--primary); }
.earnings-analysis .ghost, .earnings-analysis .text-button { background: var(--accent-soft); border-color: #5b4e35; color: #dfc68f; }
.earnings-analysis .text-button { background: transparent; }
.earnings-analysis .notice, .earnings-analysis .status { background: #14171c; border-color: #675637; color: #b9b4a7; }
.earnings-analysis .pill { background: #1c1a15; border-color: #554a35; color: #d3bd90; }
.earnings-analysis input, .earnings-analysis select, .earnings-analysis .unit-input, .earnings-analysis .price-settings, .earnings-analysis .season-alignment, .earnings-analysis #ea-additional-fields, .earnings-analysis .ledger div, .earnings-analysis .timing button { background: var(--surface-inset); border-color: var(--border); color: var(--text); }
.earnings-analysis label, .earnings-analysis legend, .earnings-analysis .section-head p, .earnings-analysis .context-note, .earnings-analysis .inline-note, .earnings-analysis .save-note, .earnings-analysis .price-summary span, .earnings-analysis .ledger span, .earnings-analysis .decision-grid span, .earnings-analysis .additional-result span, .earnings-analysis .additional-result p, .earnings-analysis .additional-result small, .earnings-analysis .table-note, .earnings-analysis .cash-strip { color: var(--muted); }
.earnings-analysis .eyebrow, .earnings-analysis legend b, .earnings-analysis .endpoint-summary { color: var(--primary); }
.earnings-analysis .season-alignment { border-left-color: #806a42; }
.earnings-analysis .tabs button { color: var(--muted); }
.earnings-analysis .tabs button[aria-selected=true], .earnings-analysis .timing button[aria-pressed=true] { border-color: #806a42; background: var(--accent-soft); color: #e3c989; }
.earnings-analysis th { background: #171a20; color: #a6abb3; }
.earnings-analysis .payback { border-left-color: var(--border); }
.earnings-analysis .planning-tradeoff { background: #191914; border-left-color: #977b49; color: #c8bea8; }
.earnings-analysis .ai, .earnings-analysis .entry-planning { background: #1b1914; border-color: #625238; }
.earnings-analysis .ai h4, .earnings-analysis .entry-planning h4, .earnings-analysis .advice-questions button { color: #e0d4b9; }
.earnings-analysis .ai>p, .earnings-analysis .ai .ai-foot { color: #b2aa99; }
.earnings-analysis .ai-badge { background: #493d28; color: #e3c989; }
.earnings-analysis .advice-questions button { background: #242017; border-color: #5b4d34; }
.earnings-analysis .request-advice .ghost { background: var(--accent-soft); border-color: #806a42; }
.earnings-analysis .ea-date-dialog { background: #171a20; border-color: #675637; color: var(--text); }
.earnings-analysis .ea-date-dialog button, .earnings-analysis .ea-date-days button, .earnings-analysis .ea-date-open { background: #242017; border-color: #5b4d34; color: #e0d4b9; }

@media (max-width: 1000px) {
  .topbar { height: var(--topbar-height); min-height: var(--topbar-height); flex-wrap: nowrap; gap: 16px; padding: 0 22px; }
}
@media (max-width: 960px) {
  .app-sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 18px 0 50px #0008; }
  .app-sidebar.is-open { transform: translateX(0); }
  .sidebar-close, .mobile-nav-toggle { display: inline-flex; }
  .app-frame { margin-left: 0; }
  body.nav-open { overflow: hidden; }
  .settings-nav { top: 82px; }
}
@media (max-width: 700px) {
  .container { padding: 21px 14px 36px; }
  .topbar { padding: 0 14px; gap: 12px; }
  .topbar-crumb span { display: none; }
  .topbar-source { font-size: 10px; }
  .clock { display: none; }
  .page-title, .content-page-title { font-size: 24px; }
  .price-source-bar { align-items: flex-start; padding: 12px; }
  .price-source-bar [role="status"] { min-width: 150px; }
  .price-source-bar > a { margin-left: auto; }
  .chart-box { height: 340px; }
  .video-library-head { flex-wrap: wrap; }
  .video-library-head .video-sync-action { margin-left: 0; }
  .video-job { grid-template-columns: 100px minmax(0, 1fr); align-items: start; }
  .video-thumb { width: 100px; }
  .video-job-side { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-items: start; }
  .video-job-state { text-align: left; }
  .video-admin > summary small { display: none; }
  .wiki-layout { min-height: calc(100dvh - 122px); }
  .wiki-search-row { padding: 10px 14px; }
  .wiki-sidebar { z-index: 60; }
}
@media (max-width: 420px) {
  .topbar-source { display: none; }
  .topbar-crumb { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .app-sidebar { transition: none; }
}

.page-back-nav { position: sticky; top: var(--topbar-height, 64px); z-index: 15; padding: 10px 0; margin-bottom: 14px; background: var(--bg); border-bottom: 1px solid var(--border); }
.page-back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); text-decoration: none; font-size: 13px; }
.page-back-link:hover { border-color: var(--primary); color: var(--primary); background: var(--card-hover); }
.page-back-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
