:root {
  --bg: #f6f3ec;
  --panel: #fbf9f4;
  --panel-2: #f1ece2;
  --ink: #1c1917;
  --ink-2: #443e37;
  --muted: #7d7469;
  --line: #e2dbcf;
  --line-strong: #d3cabb;
  --accent: #b4452f;
  --accent-ink: #9c3a26;
  --accent-soft: #f2e4dc;
  --shadow: 0 1px 2px rgba(60, 46, 32, .05), 0 12px 30px -22px rgba(60, 46, 32, .35);
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

html[data-theme="dark"], html.dark {
  --bg: #121110;
  --panel: #191614;
  --panel-2: #201c19;
  --ink: #ece5da;
  --ink-2: #c9c0b3;
  --muted: #8b8276;
  --line: #2a2521;
  --line-strong: #3a332d;
  --accent: #e0674a;
  --accent-ink: #e88267;
  --accent-soft: #2b1d18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -30px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ---------- 顶栏 ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 32px;
  height: 58px; display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-family: var(--serif); font-size: 17px; letter-spacing: .2px; }
.brand-meta { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn, .ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .18s ease;
}
.icon-btn:hover, .ghost-btn:hover { border-color: var(--line-strong); color: var(--ink); background: var(--panel); }
.ghost-btn.is-on { border-color: var(--accent); color: var(--accent); }

/* ---------- 首页 ---------- */
.hero { padding: 46px 0 10px; }
.eyebrow {
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
h1.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.1;
  letter-spacing: -.5px;
  margin: 0 0 18px;
}
.lede {
  max-width: 760px; color: var(--muted); font-size: 13.5px; line-height: 2;
  margin: 0 0 30px;
}
.lede b { color: var(--ink-2); font-weight: 500; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-num { font-family: var(--serif); font-size: 27px; line-height: 1.2; }
.stat-label { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; margin-top: 2px; }

/* 筛选 */
.filters { padding: 20px 0 8px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-box {
  position: relative; width: 290px; max-width: 100%;
}
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 7px 10px 7px 30px;
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); opacity: .45; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  line-height: 1.5;
  transition: .16s ease;
  white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
html[data-theme="dark"] .chip.active { color: #1a1412; }
.month-row { margin-top: 8px; }
.month-chip {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  transition: .16s ease;
}
.month-chip:hover { color: var(--ink); }
.month-chip.active { border-color: var(--line-strong); color: var(--ink); background: var(--panel); }
.filter-tail { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 11px; padding: 0; }

/* 精选 */
.featured {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 40px;
  padding: 26px 0 34px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.thumb-frame { position: relative; display: block; border-radius: 3px; overflow: hidden; background: var(--panel-2); }
.thumb-frame img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .5s ease; }
.thumb-frame:hover img { transform: scale(1.02); }
.badge-new {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  background: var(--accent); color: #fff;
  font-size: 10px; letter-spacing: .1em; padding: 2px 7px; border-radius: 2px;
}
.dur-badge {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  background: rgba(0, 0, 0, .78); color: #f4efe6;
  font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 2px;
}
.featured-body .kicker { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.featured-body h2 {
  font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 1.3;
  margin: 10px 0 8px; letter-spacing: -.2px;
}
.featured-body h2 a:hover { color: var(--accent); }
.featured-sub { color: var(--accent-ink); font-size: 13.5px; margin-bottom: 10px; }
.featured-desc { color: var(--muted); font-size: 12.5px; line-height: 1.85; margin-bottom: 12px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--muted); align-items: center; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { border: 1px solid var(--line); color: var(--muted); border-radius: 3px; padding: 1px 7px; font-size: 10.5px; }

/* 卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px 22px;
  padding: 34px 0 60px;
}
.card { display: flex; flex-direction: column; gap: 9px; }
.card .thumb-frame { border-radius: 2px; }
.card h3 {
  font-family: var(--serif); font-weight: 400; font-size: 15px; line-height: 1.45;
  margin: 0; letter-spacing: .1px;
}
.card:hover h3 { color: var(--accent); }
.card-sub { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 视频页 ---------- */
.v-head { padding: 34px 0 22px; border-bottom: 1px solid var(--line); }
.back-link { font-size: 11.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 16px; }
.back-link:hover { color: var(--accent); }
.v-title {
  font-family: var(--serif); font-weight: 400; font-size: 31px; line-height: 1.35;
  margin: 0 0 12px; color: var(--accent-ink); letter-spacing: -.2px;
}
.v-title.long { font-size: 25px; }
.v-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted); }
.v-meta a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.v-sub { margin-top: 14px; font-size: 13.5px; color: var(--ink-2); line-height: 1.9; max-width: 820px; }

.v-body { display: grid; grid-template-columns: 356px minmax(0, 1fr); gap: 46px; padding: 28px 0 80px; align-items: start; }
.v-side { position: sticky; top: 82px; }
.v-main { min-width: 0; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 3px; overflow: hidden; }
.player iframe, .player #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-cover {
  position: absolute; inset: 0; z-index: 3; cursor: pointer;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.player-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55));
}
.play-btn {
  position: relative; z-index: 2; width: 56px; height: 56px; border-radius: 50%;
  border: 0; background: #e02d1b; color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.35); transition: transform .2s ease;
}
.play-btn:hover { transform: scale(1.06); }
.player-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.time-code { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.time-code b { color: var(--ink-2); font-weight: 500; }
.player-bar .ghost-btn { padding: 3px 9px; font-size: 11px; }
.player-bar .right { margin-left: auto; display: flex; gap: 6px; }

.chapters { margin-top: 18px; }
.side-title { font-size: 11px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; display: flex; justify-content: space-between; }
.chapter {
  display: grid; grid-template-columns: 48px 1fr; gap: 8px;
  padding: 5px 6px; border-radius: 3px; cursor: pointer;
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
  transition: background .16s ease;
  border: 0; background: none; text-align: left; width: 100%;
}
.chapter:hover { background: var(--panel-2); }
.chapter.active { background: var(--accent-soft); color: var(--accent-ink); }
.chapter .t { font-family: var(--mono); font-size: 10.5px; color: var(--accent); padding-top: 1px; }
.desc-box { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.desc-toggle { border: 0; background: none; color: var(--muted); font-size: 11.5px; padding: 0; }
.desc-body { display: none; margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.8; max-height: 220px; overflow: auto; white-space: pre-wrap; }
.desc-body.open { display: block; }

/* 右侧 tabs */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tab {
  border: 0; background: none; padding: 0 0 10px; font-size: 12.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .16s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab .cnt { font-size: 10px; color: var(--muted); font-family: var(--mono); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 图文总结 */
.sec { margin-bottom: 44px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.sec-num { font-family: var(--serif); font-size: 15px; color: var(--accent); letter-spacing: .06em; }
.sec-head h2 { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 0; letter-spacing: .2px; }
.sec-note { font-size: 11.5px; color: var(--muted); margin: -6px 0 16px 34px; }
.thesis { font-family: var(--serif); font-size: 20px; line-height: 1.75; margin: 0 0 12px; letter-spacing: .2px; }
.thesis-body { font-size: 13px; color: var(--ink-2); line-height: 2; margin: 0; }

.threads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.thread { padding: 16px 18px 6px; border-left: 1px solid var(--line); }
.thread:first-child { border-left: 2px solid var(--accent); }
.thread h4 { font-size: 13px; margin: 0 0 8px; line-height: 1.6; font-weight: 600; }
.thread p { font-size: 11.8px; color: var(--muted); line-height: 1.85; margin: 0; }

.knowledge-list { display: grid; gap: 16px; }
.know-card {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.know-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.know-shot {
  position: relative; background: var(--panel-2); min-height: 128px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 6px; padding: 18px 16px; border: 0; border-right: 1px solid var(--line); text-align: left;
  font-family: inherit;
}
.know-stamp-wrap { font-family: var(--mono); font-size: 21px; color: var(--accent); letter-spacing: -.02em; }
.know-stamp { font-size: 10px; color: var(--muted); }
.know-shot:hover .know-stamp-wrap { color: var(--accent-ink); }
.know-body { padding: 14px 16px 14px 0; }
.know-body h4 { margin: 0 0 6px; font-size: 13px; }
.know-body p { margin: 0; font-size: 11.8px; color: var(--muted); line-height: 1.85; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 2px; }
.timeline li {
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2);
  cursor: pointer;
}
.timeline li:hover { color: var(--accent); }
.timeline .t { font-family: var(--mono); font-size: 11px; color: var(--accent); padding-top: 2px; }

.quotes { display: grid; gap: 14px; }
.quote {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; cursor: pointer;
}
.quote .en { font-family: var(--serif); font-size: 15.5px; line-height: 1.75; margin: 0 0 5px; color: var(--ink); }
.quote .zh { font-size: 12.5px; color: var(--muted); margin: 0 0 7px; line-height: 1.8; }
.quote .stamp-btn {
  border: 1px solid var(--line); background: none; color: var(--accent);
  font-family: var(--mono); font-size: 10px; padding: 1px 6px; border-radius: 2px;
}
.quote:hover .en { color: var(--accent-ink); }

.actions { margin: 0; padding: 0; list-style: none; counter-reset: act; }
.actions li {
  position: relative; padding: 8px 0 8px 30px; font-size: 12.5px; color: var(--ink-2);
  border-bottom: 1px solid var(--line); line-height: 1.8;
}
.actions li::before {
  counter-increment: act; content: counter(act, decimal-leading-zero);
  position: absolute; left: 0; top: 9px; font-family: var(--mono); font-size: 10px; color: var(--accent);
}

/* 中英对照 */
.bi-toolbar { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.bi-list { display: flex; flex-direction: column; max-height: 74vh; overflow-y: auto; padding-right: 8px; }
.bi-list::-webkit-scrollbar { width: 6px; }
.bi-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.bi-row {
  display: grid; grid-template-columns: 46px 1fr 1fr; gap: 16px;
  padding: 7px 8px 7px 0; border-radius: 3px; cursor: pointer;
  border-bottom: 1px solid transparent;
}
.bi-row:hover { background: var(--panel-2); }
.bi-row.active { background: var(--accent-soft); }
.bi-row.active .bi-en { color: var(--ink); }
.bi-row.active .bi-zh { color: var(--accent-ink); }
.bi-t { font-family: var(--mono); font-size: 10px; color: var(--muted); padding-top: 4px; }
.bi-en { font-size: 12.6px; line-height: 1.75; color: var(--ink-2); }
.bi-zh { font-size: 12.6px; line-height: 1.75; color: var(--muted); }
.bi-row.active .bi-t { color: var(--accent); }

/* 原稿 / 译稿 */
.reading { max-width: 720px; }
.reading p {
  font-family: var(--serif); font-size: 15.5px; line-height: 2.05; color: var(--ink-2);
  margin: 0 0 20px;
}
.reading p .stamp-link {
  font-family: var(--mono); font-size: 10px; color: var(--accent);
  vertical-align: super; margin-right: 6px; letter-spacing: -.02em;
}
.reading.zh p { font-family: var(--sans); font-size: 14px; line-height: 2.15; }
.reading p:hover { color: var(--ink); }

.note-missing {
  border: 1px dashed var(--line-strong); border-radius: 4px; padding: 22px;
  font-size: 12px; color: var(--muted); line-height: 1.9; background: var(--panel);
}
.note-missing b { color: var(--ink-2); }

/* 页脚 */
.footer { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 11px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.footer .right { margin-left: auto; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 7px 14px; border-radius: 4px;
  font-size: 12px; opacity: 0; pointer-events: none; transition: .25s ease; z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-body { grid-template-columns: 1fr; gap: 28px; }
  .v-side { position: static; }
  .featured { grid-template-columns: 1fr; gap: 20px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .threads { grid-template-columns: 1fr; }
  .thread { border-left: 0; border-top: 1px solid var(--line); }
  .thread:first-child { border-left: 0; border-top: 2px solid var(--accent); }
  .know-card { grid-template-columns: 1fr; }
  .know-shot {
    min-height: 0; flex-direction: row; align-items: baseline; gap: 10px;
    padding: 13px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .know-stamp-wrap { font-size: 17px; }
  .know-body { padding: 0 16px 14px; }
  .bi-row { grid-template-columns: 40px 1fr; }
  .bi-zh { grid-column: 2; }
}
@media (max-width: 640px) {
  .wrap, .topbar-inner { padding: 0 18px; }
  h1.display { font-size: 34px; }
  .grid { grid-template-columns: 1fr; }
  .v-title { font-size: 24px; }
  .brand-meta { display: none; }
}

.bi-row:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

/* ---------- 频道 tabs ---------- */
.chan-tabs { display: flex; gap: 4px; margin-left: 22px; }
.chan-tab {
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
  color: var(--muted); border: 1px solid transparent; transition: .16s ease;
  white-space: nowrap;
}
.chan-tab:hover { color: var(--ink); background: var(--panel-2); }
.chan-tab.active { color: var(--accent); border-color: var(--line); background: var(--panel); }

/* Naval 配色：深蓝替代砖红 */
html[data-channel="naval"] { --accent: #2f5d7c; --accent-ink: #27506b; --accent-soft: #e3ecf2; }
html[data-channel="naval"].dark, html[data-channel="naval"][data-theme="dark"] {
  --accent: #79a8c6; --accent-ink: #8db8d3; --accent-soft: #1b2831;
}

/* ---------- 播放器兜底 ---------- */
.player-fallback {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column;
  gap: 10px; align-items: center; justify-content: center; text-align: center; padding: 18px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.player-fallback[hidden] { display: none; }
.player-fallback p { margin: 0; font-size: 12px; color: var(--muted); }
.player-fallback a { font-size: 12.5px; color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding-bottom: 1px; }

/* ---------- 章节滚动 ---------- */
.chapter-scroll { max-height: 300px; overflow-y: auto; padding-right: 4px; }
.chapter-scroll::-webkit-scrollbar { width: 6px; }
.chapter-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

@media (max-width: 760px) {
  .chan-tabs { margin-left: 10px; gap: 2px; }
  .chan-tab { padding: 4px 8px; font-size: 11.5px; }
}
