/* ============================================================
   晨报特刊 · 《时间的朋友》— 深色研究页样式
   设计语言对标交互式研究报告：深底、细线、编号章节、金色点缀
   ============================================================ */

:root {
  --bg: #0e100d;
  --surface: #151813;
  --surface-2: #1b1f19;
  --line: rgba(232, 226, 212, .1);
  --line-strong: rgba(232, 226, 212, .22);
  --text: #e8e2d4;
  --body: #c9c3b4;
  --dim: #8f8a7c;
  --gold: #c9a24b;
  --gold-soft: rgba(201, 162, 75, .14);
  --vermilion: #c2452d;
  --green: #6fa87f;
  --blue: #6f9fae;
  --serif-cn: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --serif-en: "Playfair Display", "Noto Serif SC", Georgia, serif;
  --shadow: 0 24px 64px rgba(0, 0, 0, .5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif-cn);
  font-size: 1rem;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--gold); color: var(--bg); }

/* 阅读进度 */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--gold); z-index: 300; transition: width .1s linear;
}

/* ================= 封面 ================= */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-strong);
}
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-content {
  position: relative; z-index: 2; text-align: center;
  max-width: 900px; padding: 7vh 1.4rem 6vh;
}
.hero-kicker {
  font-size: .72rem; letter-spacing: .42em; text-indent: .42em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 1.6rem;
}
.hero-title {
  font-size: clamp(3.4rem, 11vw, 7rem);
  font-weight: 700; line-height: 1.05; letter-spacing: .08em;
  font-family: var(--serif-cn);
  text-shadow: 0 2px 40px rgba(201, 162, 75, .18);
}
.hero-sub {
  margin: 1.3rem auto 2.2rem; font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--body); letter-spacing: .06em; max-width: 640px;
}
.hero-btns {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem;
  margin-bottom: 2.2rem;
}
.hero-btn {
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--body); font-family: var(--serif-cn); font-size: .8rem;
  letter-spacing: .14em; padding: .5rem 1.15rem; cursor: pointer;
  transition: all .25s;
}
.hero-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }
.hero-mode {
  display: flex; justify-content: center; align-items: center; gap: .4rem;
  margin-bottom: 2rem;
}
.mode-label { font-size: .68rem; letter-spacing: .3em; color: var(--dim); margin-right: .6rem; }
.mode-btn {
  background: transparent; border: 1px solid var(--line);
  color: var(--dim); font-family: var(--serif-cn); font-size: .72rem;
  letter-spacing: .12em; padding: .3rem .8rem; cursor: pointer; transition: all .25s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.hero-note { font-size: .72rem; color: var(--dim); letter-spacing: .05em; max-width: 640px; margin: 0 auto; line-height: 1.9; }

/* ================= 章节快捷条 ================= */
.chapter-bar {
  position: sticky; top: 0; z-index: 250;
  background: rgba(14, 16, 13, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.chapter-bar-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; gap: .2rem; overflow-x: auto; padding: .55rem 1rem;
  scrollbar-width: none;
}
.chapter-bar-inner::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; background: transparent; border: none;
  color: var(--dim); font-family: var(--serif-cn); font-size: .78rem;
  letter-spacing: .12em; padding: .35rem .8rem; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s; white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ================= 布局 ================= */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 0 1.4rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem;
}
.content { min-width: 0; padding: 2rem 0 0; }

/* ================= 章节通用 ================= */
.chapter { padding: 3.2rem 0 1.2rem; scroll-margin-top: 70px; }
.chapter + .chapter { border-top: 1px solid var(--line); }
.sec-label {
  font-size: .7rem; letter-spacing: .36em; text-indent: .36em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 1rem;
}
.sec-title {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem); font-weight: 700;
  line-height: 1.4; letter-spacing: .03em; margin-bottom: .9rem;
}
.sec-answer { font-size: 1.1rem; color: var(--gold); letter-spacing: .05em; margin-bottom: 1.2rem; }
.lead { color: var(--body); margin-bottom: 1.4rem; max-width: 760px; }
.body { max-width: 760px; }
.body p { margin-bottom: 1.1rem; color: var(--body); text-align: justify; }
.body strong { color: var(--text); font-weight: 600; }
.analyst-note {
  max-width: 760px; margin-top: 1.6rem; padding: 1rem 1.2rem;
  border-left: 2px solid var(--gold); background: var(--gold-soft);
  font-size: .85rem; color: var(--body); letter-spacing: .03em;
}
.analyst-note::before {
  content: "编辑注"; display: block; font-size: .62rem; letter-spacing: .34em;
  color: var(--gold); margin-bottom: .4rem; text-transform: uppercase;
}

/* ================= 图表 ================= */
.fig { margin: 2rem 0; border: 1px solid var(--line); background: var(--surface); padding: 1.4rem 1.4rem 1rem; }
.fig figcaption { font-size: .78rem; color: var(--dim); letter-spacing: .06em; margin-bottom: 1rem; }
.fig-src { font-size: .7rem; color: var(--dim); margin-top: 1rem; letter-spacing: .04em; }
.chart-box { width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-ctrl { margin-top: 1.2rem; border-top: 1px dashed var(--line); padding-top: 1rem; }
.chart-ctrl label { font-size: .8rem; color: var(--dim); letter-spacing: .1em; display: flex; justify-content: space-between; align-items: center; }
.ctrl-val { color: var(--gold); font-size: .95rem; font-weight: 600; }
.chart-ctrl input[type="range"] { width: 100%; margin: .8rem 0; accent-color: var(--gold); cursor: pointer; }
.ctrl-out { font-size: .95rem; color: var(--text); }
.ctrl-out strong { color: var(--gold); font-size: 1.25rem; font-family: var(--serif-en); }
.ctrl-sub { font-size: .78rem; color: var(--dim); margin-top: .5rem; }
.ctrl-sub span { color: var(--vermilion); }

/* 曲线图例 */
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .4rem; }
.legend span { font-size: .72rem; color: var(--dim); letter-spacing: .1em; display: flex; align-items: center; gap: .4rem; }
.legend i { width: 18px; height: 2px; display: inline-block; }

/* ================= 时间线墙 ================= */
.wall-box { overflow-x: auto; }
.wall-box svg { min-width: 900px; width: 100%; height: auto; display: block; }
.wall-window { opacity: .35; transition: opacity .3s; }
.wall-window:hover { opacity: .7; }
.wall-line { stroke: rgba(232, 226, 212, .25); stroke-width: 1.5; }
.wall-axis { stroke: rgba(232, 226, 212, .15); stroke-width: 1; }
.wall-plaque-line { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 3; opacity: .8; }
.wall-plaque { cursor: pointer; transition: opacity .2s; }
.wall-plaque:hover { opacity: 1; }
.wall-plaque circle { fill: var(--surface); stroke: var(--gold); stroke-width: 1.5; }
.wall-plaque text { fill: var(--body); font-size: 10.5px; font-family: var(--serif-cn); }
.wall-plaque text.year { fill: var(--gold); font-size: 10px; letter-spacing: .08em; }
.wall-label { fill: var(--dim); font-size: 11px; font-family: var(--serif-cn); letter-spacing: .1em; }
.wall-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .8rem; }
.wall-legend span { font-size: .7rem; color: var(--dim); letter-spacing: .06em; display: flex; align-items: center; gap: .4rem; }
.wall-legend i { width: 14px; height: 8px; display: inline-block; }

/* ================= 窗口章节 ================= */
.window-chapter { padding: 3rem 0 1.2rem; scroll-margin-top: 70px; }
.window-chapter + .window-chapter { border-top: 1px solid var(--line); }
.window-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.window-badge {
  font-size: .68rem; letter-spacing: .2em; color: var(--bg); font-weight: 700;
  padding: .18rem .6rem; text-transform: uppercase;
}
.window-title { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 700; line-height: 1.4; }
.window-summary { color: var(--body); max-width: 760px; margin-bottom: 1.6rem; }
.facts { display: grid; gap: .8rem; max-width: 760px; }
.fact {
  border: 1px solid var(--line); background: var(--surface); padding: 1rem 1.1rem;
}
.fact-top { display: flex; align-items: baseline; gap: .7rem; }
.fact-title { font-weight: 600; color: var(--text); font-size: .95rem; }
.fact-btn {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--gold); font-size: .68rem; letter-spacing: .1em; white-space: nowrap;
  font-family: var(--serif-cn);
}
.fact-btn:hover { text-decoration: underline; }
.fact-desc { font-size: .86rem; color: var(--body); margin-top: .4rem; }
.fact-src {
  display: none; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line);
  font-size: .72rem; color: var(--dim);
}
.fact-src.open { display: block; }
.window-lesson {
  margin-top: 1.6rem; max-width: 760px; padding: 1.1rem 1.3rem;
  border-left: 2px solid var(--gold); background: var(--gold-soft);
  font-size: .98rem; color: var(--text); letter-spacing: .04em;
}
.window-lesson b { color: var(--gold); font-weight: 600; }

/* ================= 三种判定 ================= */
.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1rem; }
.verdict {
  border: 1px solid var(--line); background: var(--surface);
  padding: 1.4rem 1.3rem; display: flex; flex-direction: column; gap: .8rem;
  transition: transform .25s, border-color .25s;
}
.verdict:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.verdict-id { font-family: var(--serif-en); font-size: .72rem; letter-spacing: .24em; color: var(--dim); }
.verdict-title { font-size: 1.02rem; font-weight: 700; line-height: 1.55; }
.verdict-badge {
  align-self: flex-start; font-size: .76rem; letter-spacing: .2em; padding: .22rem .7rem;
  border: 1px solid;
}
.verdict-badge.partial { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.verdict-badge.reject { color: #e08a74; border-color: var(--vermilion); background: rgba(194, 69, 45, .12); }
.verdict-badge.defer { color: #8fc0d0; border-color: var(--blue); background: rgba(111, 159, 174, .12); }
.verdict-body { font-size: .88rem; color: var(--body); text-align: justify; }
.verdict-rule { font-size: .74rem; color: var(--dim); border-top: 1px dashed var(--line); padding-top: .7rem; }
.verdict-src { font-size: .68rem; color: var(--dim); opacity: .85; }

/* ================= 八个触发器 ================= */
.triggers { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-top: 1rem; }
.trigger {
  border: 1px solid var(--line); background: var(--surface);
  padding: 1rem 1rem .9rem; position: relative;
  transition: border-color .2s;
}
.trigger:hover { border-color: var(--line-strong); }
.trigger-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.trigger-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.trigger-dot.watch { background: var(--gold); }
.trigger-name { font-size: .92rem; font-weight: 700; letter-spacing: .08em; }
.trigger-v { font-size: .76rem; color: var(--gold); margin-bottom: .4rem; line-height: 1.6; }
.trigger-note { font-size: .74rem; color: var(--dim); line-height: 1.7; }

/* ================= 行情 ================= */
.tabs { display: flex; gap: .4rem; margin: 1.2rem 0; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--dim); font-family: var(--serif-cn); font-size: .8rem;
  letter-spacing: .16em; padding: .42rem 1.3rem; cursor: pointer; transition: all .25s;
}
.tab:hover { color: var(--text); border-color: var(--text); }
.tab.active { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; }
.table-wrap { border: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.market-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.market-table th {
  font-size: .66rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--dim); font-weight: 500; text-align: left;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-strong);
}
.market-table td { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.market-table tbody tr:last-child td { border-bottom: none; }
.market-table tbody tr:hover { background: var(--surface-2); }
.mt-name { font-weight: 600; }
.mt-code { font-size: .66rem; color: var(--dim); margin-left: .4rem; }
.mt-price, .mt-chg, .mt-pct { text-align: right; font-variant-numeric: tabular-nums; }
.mt-pct { font-weight: 600; }
.up { color: #e08a74; }
.down { color: #7fc09a; }
.flat { color: var(--dim); }
.footnote { font-size: .72rem; color: var(--dim); margin-top: .9rem; }

/* ================= 右侧数据面板 ================= */
.panel {
  position: sticky; top: 64px; align-self: start; height: calc(100vh - 80px);
  border-left: 1px solid var(--line); padding-left: 1.4rem;
  display: flex; flex-direction: column; min-height: 0;
}
.panel-head { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.panel-kicker { font-size: .62rem; letter-spacing: .34em; color: var(--gold); text-transform: uppercase; }
.panel-section { display: block; font-size: .9rem; font-weight: 600; margin-top: .4rem; }
.panel-body { overflow-y: auto; padding: 1.1rem 0; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.p-metric { border-bottom: 1px dashed var(--line); padding: .9rem 0; }
.p-metric:last-child { border-bottom: none; }
.p-metric .pm-label { font-size: .7rem; letter-spacing: .18em; color: var(--dim); text-transform: uppercase; }
.p-metric .pm-val { font-family: var(--serif-en); font-size: 1.9rem; font-weight: 600; color: var(--text); line-height: 1.25; margin: .15rem 0 .05rem; }
.p-metric .pm-sub { font-size: .74rem; color: var(--body); }
.p-metric .pm-val.gold { color: var(--gold); }
.p-metric .pm-val.red { color: #e08a74; }
.p-metric .pm-val.green { color: #7fc09a; }
.panel-foot { border-top: 1px solid var(--line); padding-top: .8rem; font-size: .66rem; color: var(--dim); line-height: 1.7; }

/* ================= 资料卡弹层 ================= */
.card-modal { position: fixed; inset: 0; z-index: 400; display: none; }
.card-modal.open { display: block; }
.card-backdrop {
  position: absolute; inset: 0; background: rgba(5, 6, 5, .7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .25s ease;
}
.card-paper {
  position: relative; max-width: 34rem; margin: 16vh auto;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-top: 3px solid var(--gold);
  padding: 2rem 2.2rem; box-shadow: var(--shadow);
  animation: rise .3s cubic-bezier(.2,.8,.3,1);
}
.card-close {
  position: absolute; top: .8rem; right: 1rem; background: none; border: none;
  color: var(--dim); font-size: 1rem; cursor: pointer; padding: .4rem; transition: all .2s;
}
.card-close:hover { color: var(--gold); transform: rotate(90deg); }
.card-kicker { font-size: .66rem; letter-spacing: .3em; color: var(--gold); text-transform: uppercase; }
.card-title { font-size: 1.4rem; font-weight: 700; margin: .6rem 0 .3rem; line-height: 1.4; }
.card-date { font-size: .78rem; color: var(--dim); margin-bottom: 1rem; letter-spacing: .1em; }
.card-body { font-size: .95rem; color: var(--body); text-align: justify; }
.card-src { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px dashed var(--line); font-size: .72rem; color: var(--dim); }

/* ================= 页脚 ================= */
.colophon { text-align: center; padding: 3.4rem 0; }
.colophon-rule { border-top: 1px solid var(--line-strong); max-width: 420px; margin: 0 auto 1.8rem; }
.colophon-title { font-size: 1.4rem; font-weight: 700; letter-spacing: .3em; margin-right: -.3em; }
.colophon-title span { display: block; font-family: var(--serif-en); font-size: .62rem; font-weight: 500; letter-spacing: .5em; margin-right: -.5em; color: var(--dim); margin-top: .5rem; }
.colophon p { font-size: .78rem; color: var(--dim); margin-top: 1rem; max-width: 640px; margin-left: auto; margin-right: auto; line-height: 2; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.99); } to { opacity: 1; transform: none; } }

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel { display: none; }
}
@media (max-width: 900px) {
  .verdicts { grid-template-columns: 1fr; }
  .triggers { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: auto; }
  .hero-content { padding: 6rem 1.2rem 4rem; }
}
@media (max-width: 560px) {
  .triggers { grid-template-columns: 1fr; }
  .chapter { padding: 2.4rem 0 1rem; }
  .window-chapter { padding: 2.4rem 0 1rem; }
  .hero-btns { gap: .4rem; }
  .hero-btn { padding: .42rem .8rem; font-size: .74rem; }
  .card-paper { margin: 8vh auto; padding: 1.6rem 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
