/* ==========================================================================
   《读懂达尔文》全站样式表
   设计基调：教材的清晰 + Apple 官网的留白。大字号、高对比、克制用色。
   断点：>=1000 宽屏双栏 / 640-999 单栏两列 / <640 全单栏
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --brand:       #3B5BDB;   /* 主色 靛蓝 */
  --brand-dark:  #2F49AF;
  --brand-soft:  #EDF1FD;
  --brand-line:  #C7D2FE;
  --accent:      #F59F00;   /* 强调 琥珀 */
  --accent-soft: #FFF8E9;
  --accent-line: #F2D675;
  --green:       #0CA678;
  --green-soft:  #E6FCF5;
  --purple:      #7048E8;
  --purple-soft: #F1EBFF;
  --orange:      #E8590C;
  --orange-soft: #FFF0E8;

  --bg:      #F7F9FC;
  --bg-alt:  #EDF1F7;
  --card:    #FFFFFF;
  --line:    #E3E8EF;
  --line-2:  #D4DBE5;
  --ink:     #1B2530;
  --ink-2:   #56617A;
  --ink-3:   #8B96AA;


  /* --- 设计系统 v1 扩充令牌（同值收敛，v1.0） --- */
  --accent-deep    : #854F0B;
  --accent-ink     : #A16207;
  --accent-ink-2   : #B26A00;
  --accent-ink-deep: #412402;
  --accent-wash    : #FFF6E5;
  --accent-wash-2  : #FFF4E0;
  --bg-elev        : #FBFCFE;
  --brand-a11      : rgba(59,91,219,.11);
  --brand-a13      : rgba(59,91,219,.13);
  --brand-a26      : rgba(59,91,219,.26);
  --brand-a30      : rgba(59,91,219,.3);
  --brand-a32      : rgba(59,91,219,.32);
  --brand-a40      : rgba(59,91,219,.4);
  --brand-hover    : #DDE5FC;
  --brand-ink      : #2C3E7A;
  --brand-light    : #6E8BFF;
  --brand-wash     : #EEF2FE;
  --foot-dim       : #7B8798;
  --foot-fg        : #A9B4C4;
  --foot-line      : #2C3846;
  --foot-link      : #CBD5E1;
  --green-ink      : #087F5B;
  --green-line     : #B2F0DC;
  --highlight-bg   : #FFF3BF;
  --highlight-fg   : #6B4E12;
  --img-bg         : #F4F6FA;
  --ink-a18        : rgba(27,37,48,.18);
  --ink-body       : #2B3644;
  --ink-soft       : #5C6B82;
  --ink-strong     : #14202B;
  --nav-bg         : rgba(255,255,255,.86);
  --orange-ink     : #C2410C;
  --overlay        : rgba(20,30,45,.42);
  --purple-ink     : #5B30C4;
  --swatch-gray    : #CCCCCC;
  --white          : #FFFFFF;
  --hero-bg        : #0E1219;   /* 深色首屏底（门户首页 · 图标桌面） */
  --hero-bg-2      : #171E2B;   /* 深色首屏顶部渐亮端 */

  --print-ink      : #000000;

  --radius:   16px;
  --radius-s: 10px;
  --shadow-s: 0 1px 2px rgba(27,37,48,.05);
  --shadow-m: 0 4px 16px rgba(27,37,48,.07);
  --shadow-l: 0 18px 50px rgba(27,37,48,.16);
  --shadow-hero    : 0 12px 28px rgba(0, 0, 0, .5);   /* 深底图标浮起投影 */

  --nav-h:   62px;
  --max-w:   1160px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 800; letter-spacing: -.01em; margin: 0; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.5em; }
li { margin-bottom: .4em; }
strong { font-weight: 700; color: var(--ink-strong); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ---------- 3. 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s;
}
.nav.scrolled { box-shadow: var(--shadow-m); }
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  height: var(--nav-h); display: flex; align-items: center; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 17.5px; color: var(--ink); letter-spacing: -.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .apple {
  width: 27px; height: 27px; flex: none;
  background: linear-gradient(140deg, var(--brand), var(--brand-light));
  border-radius: 8px; display: grid; place-items: center;
  font-size: 15px; color: var(--white); box-shadow: 0 3px 8px var(--brand-a32);
}
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  padding: 7px 13px; border-radius: 9px; font-size: 15px; font-weight: 600;
  color: var(--ink-2); transition: background .18s, color .18s;
}
.nav-links a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); }

.nav-toggle {
  display: none; margin-left: auto; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.nav-toggle i { width: 17px; height: 2px; background: var(--ink); border-radius: 2px; display: block; transition: .25s; }
.nav.open .nav-toggle i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-toggle i:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

#progress {
  position: absolute; left: 0; bottom: -1px; height: 2.5px; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width .1s linear; border-radius: 0 2px 2px 0;
}

/* ---------- 4. 通用排版组件 ---------- */
section { padding: 60px 0; }
section.tight { padding: 34px 0; }
.sec-head { margin-bottom: 30px; }
.sec-kicker {
  display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: 1.4px;
  color: var(--brand); background: var(--brand-soft);
  padding: 4px 11px; border-radius: 7px; margin-bottom: 12px;
}
.sec-head h2 { font-size: 30px; }
.sec-head p { color: var(--ink-2); font-size: 16px; margin: 10px 0 0; max-width: 62ch; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-s);
}
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 20px; border-radius: 11px; font-size: 15px; font-weight: 700;
  background: var(--brand); color: var(--white); border: none;
  box-shadow: 0 3px 10px var(--brand-a26); transition: transform .16s, box-shadow .16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px var(--brand-a30); text-decoration: none; color:var(--white); }
.btn.ghost { background: var(--white); color: var(--brand); border: 1.5px solid var(--brand-line); box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 7px 14px; font-size: 14px; border-radius: 9px; }

/* ---------- 5. 可点击术语 ---------- */
.term {
  color: var(--brand); font-weight: 600; cursor: pointer;
  border-bottom: 1.5px dotted var(--brand);
  padding: 0 1px; border-radius: 2px;
  transition: background .15s, border-color .15s;
}
.term:hover { background: var(--brand-soft); border-bottom-style: solid; }
.term:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 6. 术语弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: var(--overlay);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .22s;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  width: min(560px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--white); border-radius: 20px; box-shadow: var(--shadow-l);
  transform: translateY(14px) scale(.98); transition: transform .24s cubic-bezier(.2,.9,.3,1.2);
  -webkit-overflow-scrolling: touch;
}
.modal-mask.show .modal { transform: none; }
.modal-head {
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line);
  position: relative;
}
.modal-cat {
  display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .8px;
  color: var(--ink-3); background: var(--bg-alt);
  padding: 3px 9px; border-radius: 6px; margin-bottom: 9px;
}
.modal-head h3 { font-size: 24px; padding-right: 44px; }
.modal-head .short {
  margin: 10px 0 0; font-size: 16px; color: var(--brand);
  font-weight: 700; line-height: 1.6;
}
.modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink-2);
  font-size: 19px; line-height: 1; display: grid; place-items: center;
  transition: background .16s;
}
.modal-close:hover { background: var(--bg-alt); color: var(--ink); }
.modal-body { padding: 20px 24px 8px; }
.mb { margin-bottom: 16px; }
.mb:last-child { margin-bottom: 4px; }
.mb .mt {
  font-size: 12px; font-weight: 800; letter-spacing: .6px;
  color: var(--ink-3); margin-bottom: 5px; display: block;
}
.mb p { margin: 0; font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }
.mb.analogy {
  background: var(--accent-soft); border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--accent-line);
}
.mb.analogy .mt { color: var(--accent-ink); }
.mb.analogy p { color: var(--highlight-fg); }
.mb.extra {
  background: var(--brand-soft); border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--brand-line);
}
.mb.extra p { color: var(--brand-ink); }
.hl { background: var(--highlight-bg); padding: 0 4px; border-radius: 4px; font-weight: 600; color: var(--highlight-fg); }
.modal-related {
  padding: 14px 24px 4px; border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
}
.modal-related .mt { font-size: 12px; font-weight: 800; color: var(--ink-3); margin-right: 2px; }
.chip {
  font-size: 13px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  padding: 4px 11px; border-radius: 999px; cursor: pointer; transition: background .15s;
}
.chip:hover { background: var(--brand-hover); }
.modal-foot {
  padding: 16px 24px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.modal-foot .tip { font-size: 13px; color: var(--ink-3); }
.modal-foot .go {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: var(--white); font-size: 14.5px; font-weight: 700;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 3px 10px var(--brand-a26);
}
.modal-foot .go:hover { text-decoration: none; filter: brightness(1.06); }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--brand-wash) 0%, var(--bg) 55%, var(--accent-wash) 100%);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -80px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-a13), transparent 68%);
}
.hero-inner {
  position: relative; z-index: 1; max-width: var(--max-w); margin: 0 auto;
  padding: 66px 24px 60px; display: grid;
  grid-template-columns: 1.15fr .85fr; gap: 46px; align-items: center;
}
.hero h1 { font-size: 46px; letter-spacing: -.03em; margin-bottom: 6px; }
.hero .sub {
  font-size: 19px; color: var(--ink-2); font-weight: 600; margin: 0 0 20px;
  line-height: 1.7;
}
.hero .lead { font-size: 16.5px; color: var(--ink-2); max-width: 52ch; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; }
.hero-portrait {
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-m);
  border: 5px solid var(--white); background: var(--white); max-width: 300px;
}
.hero-portrait img { width: 100%; }
.hero-portrait figcaption {
  font-size: 12.5px; color: var(--ink-3); padding: 9px 6px 3px; text-align: center;
  line-height: 1.5;
}
.hero-stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.stat .n { font-size: 27px; font-weight: 800; color: var(--brand); line-height: 1.2; font-family: var(--mono); }
.stat .l { font-size: 13px; color: var(--ink-2); }

/* ---------- 8. 成就卡片 ---------- */
.ach-card {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-s);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.ach-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-m);
  border-color: var(--brand-line); text-decoration: none;
}
.ach-card .thumb {
  height: 132px; display: grid; place-items: center;
  background: var(--brand-soft); border-bottom: 1px solid var(--line);
  padding: 14px;
}
.ach-card .thumb img { max-height: 104px; width: auto; }
.ach-card .body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.ach-card .year {
  font-size: 12px; font-weight: 800; color: var(--ink-3);
  font-family: var(--mono); letter-spacing: .5px;
}
.ach-card h3 { font-size: 19px; margin: 4px 0 8px; }
.ach-card p { font-size: 14.5px; color: var(--ink-2); margin: 0 0 14px; flex: 1; line-height: 1.75; }
.ach-card .more { font-size: 14px; font-weight: 700; color: var(--brand); }

/* ---------- 9. 时间轴 ---------- */
.timeline { position: relative; padding-left: 8px; }
.tl-item {
  display: grid; grid-template-columns: 92px 30px 1fr; gap: 0;
  align-items: start; position: relative; padding-bottom: 8px;
}
.tl-rail { position: relative; display: flex; justify-content: center; height: 100%; }
.tl-rail::before {
  content: ""; position: absolute; top: 0; bottom: -8px; left: 50%;
  width: 2px; transform: translateX(-50%); background: var(--line-2);
}
.tl-item:last-child .tl-rail::before { bottom: 40%; }
.tl-dot {
  position: relative; z-index: 2; width: 15px; height: 15px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--brand-line); margin-top: 20px;
  transition: border-color .2s, transform .2s;
}
.tl-item.open .tl-dot, .tl-item.highlight .tl-dot { border-color: var(--brand); transform: scale(1.15); }
.tl-item.highlight .tl-dot { background: var(--brand); }
.tl-year {
  font-family: var(--mono); font-size: 15.5px; font-weight: 700;
  color: var(--brand); padding-top: 15px; text-align: right; padding-right: 18px;
}
.tl-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  margin: 8px 0; overflow: hidden; box-shadow: var(--shadow-s);
  transition: box-shadow .2s, border-color .2s;
}
.tl-item.open .tl-card { border-color: var(--brand-line); box-shadow: var(--shadow-m); }
.tl-head { padding: 15px 18px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.tl-head:hover { background: var(--bg-elev); }
.tl-head .t { font-size: 17.5px; font-weight: 700; margin: 0; flex: 1; }
.tl-head .s { font-size: 14.5px; color: var(--ink-2); margin: 4px 0 0; }
.tl-arrow {
  flex: none; width: 22px; height: 22px; color: var(--ink-3);
  transition: transform .24s; margin-top: 4px;
}
.tl-item.open .tl-arrow { transform: rotate(180deg); color: var(--brand); }
.tl-panel { display: none; padding: 0 18px 18px; border-top: 1px dashed var(--line); }
.tl-item.open .tl-panel { display: block; animation: fadeDown .26s ease; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tl-panel p { font-size: 15.5px; color: var(--ink-2); margin: 14px 0; }
.tl-panel figure { margin: 0 0 14px; }
.tl-panel figure img {
  border-radius: 12px; border: 1px solid var(--line);
  display: block; width: auto; max-width: 100%; height: auto; max-height: 360px; object-fit: contain;
  background: var(--img-bg); margin: 0 auto;
}
.tl-panel figure img[src$=".svg"] { width: 100%; max-width: 100%; }  /* 矢量图放大无损，保持满宽 */
.tl-panel figcaption { font-size: 13px; color: var(--ink-3); margin-top: 7px; line-height: 1.6; text-align: center; }  /* 图片按比例居中后，图注随之居中，保持同一条中轴 */
.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tag {
  font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 7px;
  background: var(--bg-alt); color: var(--ink-2);
}
.tag.b { background: var(--brand-soft); color: var(--brand); }
.tag.g { background: var(--green-soft); color: var(--green-ink); }
.tag.o { background: var(--orange-soft); color: var(--orange-ink); }
.tag.p { background: var(--purple-soft); color: var(--purple-ink); }
.tag.a { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- 10. 详解页布局 ---------- */
.detail-wrap {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 268px; gap: 42px; align-items: start;
}
.page-head {
  background: linear-gradient(150deg, var(--brand-wash), var(--bg) 70%);
  border-bottom: 1px solid var(--line); padding: 44px 0 40px;
}
.page-head .wrap { max-width: var(--max-w); }
.crumb { font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; }
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--brand); }
.page-head h1 { font-size: 38px; letter-spacing: -.025em; }
.page-head .big-claim {
  font-size: 20px; font-weight: 700; color: var(--brand);
  margin: 14px 0 0; line-height: 1.65; max-width: 46ch;
}
.page-head .meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.article { padding-top: 40px; padding-bottom: 30px; min-width: 0; }
.article h2 {
  font-size: 25px; margin: 44px 0 16px; padding-top: 8px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.article h2:first-child { margin-top: 0; }

/* 任何可能作为锚点的元素，跳转时都让开吸顶导航。
   .article h2 那条只覆盖了 h2，而术语锚点还有挂在 <p>/<li>/<div> 上的，
   它们会正好停在 y=0 被导航栏压住，跳过去等于没跳到位。 */
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }
.article h3 { font-size: 19px; margin: 28px 0 10px; }
.article p { font-size: 16.5px; color: var(--ink-body); }
.article ul li, .article ol li { font-size: 16.5px; color: var(--ink-body); }
.article > p:last-child { margin-bottom: 0; }

figure.fig { margin: 26px 0; }
figure.fig img {
  width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--white);
}
figure.fig figcaption {
  font-size: 13.5px; color: var(--ink-3); margin-top: 9px;
  line-height: 1.7; padding-left: 2px;
}
figure.fig figcaption b { color: var(--ink-2); }

.callout {
  border-radius: 14px; padding: 18px 20px; margin: 24px 0;
  border: 1px solid var(--brand-line); background: var(--brand-soft);
}
.callout.amber { border-color: var(--accent-line); background: var(--accent-soft); }
.callout.green { border-color: var(--green-line); background: var(--green-soft); }
.callout .ct { font-size: 14px; font-weight: 800; margin-bottom: 6px; display: block; }
.callout p { margin: 0; font-size: 15.5px; }
.callout p + p { margin-top: 8px; }

/* 公式卡 */
.formula {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 22px; margin: 26px 0; text-align: center; box-shadow: var(--shadow-s);
}
.formula .eq {
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  color: var(--ink); letter-spacing: .5px; margin-bottom: 4px;
  display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 2px;
}
.formula .eq .sym {
  cursor: pointer; padding: 0 3px; border-radius: 6px;
  border-bottom: 2px dotted var(--brand); color: var(--brand); transition: background .15s;
}
.formula .eq .sym:hover, .formula .eq .sym.on { background: var(--brand-soft); }
.formula .eq-note { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.sym-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.sym-notes { margin-top: 16px; text-align: left; }
.sym-note {
  display: none; background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: 12px; padding: 13px 16px; font-size: 15px; color: var(--brand-ink); line-height: 1.75;
}
.sym-note.show { display: block; animation: fadeDown .2s; }
.sym-note b { font-family: var(--mono); font-size: 16px; }

/* 侧边栏 */
.side { position: sticky; top: calc(var(--nav-h) + 20px); padding-top: 40px; }
.side-box {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-s);
}
.side-box h4 {
  font-size: 12.5px; font-weight: 800; letter-spacing: 1px;
  color: var(--ink-3); margin-bottom: 12px;
}
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 6px 10px; border-radius: 8px; font-size: 14.5px;
  color: var(--ink-2); border-left: 2.5px solid transparent; transition: .15s;
}
.toc a:hover { background: var(--bg-alt); text-decoration: none; color: var(--ink); }
.toc a.active { color: var(--brand); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 700; }
.side-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.side-box .fact { font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.side-box .fact b { color: var(--ink); }

.page-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 46px 0 0; padding-top: 26px; border-top: 1px solid var(--line);
}
.pn {
  border: 1px solid var(--line); border-radius: 13px; padding: 15px 18px;
  background: var(--white); transition: border-color .18s, background .18s;
}
.pn:hover { border-color: var(--brand-line); background: var(--brand-soft); text-decoration: none; }
.pn .lab { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.pn .tt { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 3px; }
.pn.next { text-align: right; }

/* ---------- 11. 交互演示 ---------- */
.lab {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; margin: 26px 0; box-shadow: var(--shadow-s);
}
.lab-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.lab-head h4 { font-size: 17px; }
.lab-head .badge {
  font-size: 11.5px; font-weight: 800; background: var(--green-soft); color: var(--green-ink);
  padding: 3px 9px; border-radius: 6px;
}
.lab-desc { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.lab canvas {
  width: 100%; height: auto; display: block; border-radius: 12px;
  background: var(--bg-elev); border: 1px solid var(--line); touch-action: none;
}
.lab-controls { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.ctrl { flex: 1; min-width: 190px; }
.ctrl label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px;
}
.ctrl label .v { font-family: var(--mono); color: var(--brand); font-size: 14px; }
.ctrl input[type=range] {
  width: 100%; height: 5px; border-radius: 3px; appearance: none;
  background: var(--line-2); outline: none;
}
.ctrl input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); border: 3px solid var(--white); cursor: pointer;
  box-shadow: 0 2px 6px var(--brand-a40);
}
.ctrl input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--brand);
  border: 3px solid var(--white); cursor: pointer;
}
.lab-readout {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-alt); font-size: 14.5px; color: var(--ink-2);
  font-family: var(--mono); text-align: center; line-height: 1.7;
}

/* ---------- 12. 词典页 ---------- */
.search-bar { position: relative; margin-bottom: 22px; }
.search-bar input {
  width: 100%; padding: 14px 18px 14px 46px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 13px; background: var(--white);
  color: var(--ink); font-family: inherit; outline: none; transition: border-color .18s;
}
.search-bar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-a11); }
.search-bar .ico { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.cat-btn {
  padding: 7px 15px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--white); font-size: 14px; font-weight: 700; color: var(--ink-2); transition: .16s;
}
.cat-btn:hover { border-color: var(--brand-line); color: var(--brand); }
.cat-btn.on { background: var(--brand); border-color: var(--brand); color: var(--white); }
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.term-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 13px;
  padding: 16px 18px; cursor: pointer; transition: .18s; text-align: left; width: 100%;
}
.term-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-m); transform: translateY(-2px); }
.term-card .tc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.term-card .tc-cat { font-size: 11px; font-weight: 800; color: var(--ink-3); background: var(--bg-alt); padding: 2px 7px; border-radius: 5px; }
.term-card h3 { font-size: 17px; margin: 0; }
.term-card p { font-size: 14.5px; color: var(--ink-2); margin: 0; line-height: 1.7; }
.term-card .go { font-size: 12.5px; font-weight: 700; color: var(--brand); margin-top: 9px; display: block; }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }

/* ---------- 13. 页脚 ---------- */
.foot {
  background: var(--ink); color: var(--foot-fg); padding: 42px 0 30px; margin-top: 0;
  font-size: 14px;
}
.foot a { color: var(--foot-link); }
.foot a:hover { color: var(--white); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.foot h5 { color: var(--white); font-size: 14px; margin-bottom: 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot .brand-f { color: var(--white); font-weight: 800; font-size: 16px; display: flex; gap: 9px; align-items: center; margin-bottom: 10px; }
.foot-bottom {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--foot-line);
  font-size: 13px; color: var(--foot-dim); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- 14. 返回顶部 ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-m);
  display: grid; place-items: center; color: var(--ink-2); font-size: 18px;
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: .24s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--brand); border-color: var(--brand-line); }

/* ---------- 15. 响应式 ---------- */
@media (max-width: 1000px) {
  .detail-wrap { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; padding-top: 0; }
  .side-box:first-child { margin-top: 24px; }
  .side-main { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .side-main .side-box { margin-bottom: 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; padding: 46px 24px 44px; }
  .hero h1 { font-size: 36px; }
  .hero-art { order: -1; justify-content: flex-start; }
  .hero-portrait { max-width: 220px; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap, .nav-inner, .hero-inner, .detail-wrap { padding-left: 16px; padding-right: 16px; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px;
    box-shadow: var(--shadow-m); gap: 2px;
  }
  .nav.open .nav-links { display: flex; animation: fadeDown .2s; }
  .nav-links a { padding: 12px 14px; font-size: 16px; }
  .nav-toggle { display: flex; }
  .hero h1 { font-size: 29px; }
  .hero .sub { font-size: 17px; }
  .hero-stats { gap: 18px; }
  .stat .n { font-size: 23px; }
  .sec-head h2 { font-size: 24px; }
  section { padding: 42px 0; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .term-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 29px; }
  .page-head .big-claim { font-size: 17.5px; }
  .article h2 { font-size: 21.5px; }
  .formula .eq { font-size: 22px; }
  .foot-grid { grid-template-columns: 1fr; gap: 22px; }
  .tl-item { grid-template-columns: 62px 26px 1fr; }
  .tl-year { font-size: 13.5px; padding-right: 10px; padding-top: 13px; }
  .tl-head { padding: 13px 14px; }
  .tl-head .t { font-size: 16px; }
  .tl-panel { padding: 0 14px 16px; }
  .side-main { grid-template-columns: 1fr; }
  .page-nav { grid-template-columns: 1fr; }
  .pn.next { text-align: left; }
  .lab-controls { gap: 12px; }

  /* 弹窗 → 底部抽屉 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0;
    transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.9,.3,1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-mask.show .modal { transform: none; }
  .modal::before {
    content: ""; display: block; width: 38px; height: 4px; border-radius: 3px;
    background: var(--line-2); margin: 10px auto 0;
  }
  .modal-head { padding: 16px 20px 14px; }
  .modal-head h3 { font-size: 21px; }
  .modal-body { padding: 16px 20px 6px; }
  .modal-related, .modal-foot { padding-left: 20px; padding-right: 20px; }
}

/* ---------- 16. 无障碍 / 打印 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

@media print {
  .nav, .to-top, .modal-mask, .lab-controls, .hero-art { display: none !important; }
  body { background: var(--white); font-size: 11pt; }
  .card, .ach-card, .tl-card { break-inside: avoid; box-shadow: none; }
  .tl-panel { display: block !important; }
  a { color: var(--print-ink); }
}

/* ===== 通用补丁：时间轴 .tl-body / 首页 bio / labs 画布上限（引擎统一） ===== */
.bio { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; margin-top: 8px; }
.bio-photo { width: 240px; max-width: 100%; border-radius: 14px; border: 1px solid var(--line); }
@media (max-width: 720px) { .bio { grid-template-columns: 1fr; } .bio-photo { width: 100%; } }
.lab canvas { width: 100%; height: auto; display: block; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line); touch-action: none;  /* P0修复(2026-09-14)：删除 max-height —— 它会覆盖 setupCanvas 写入的等比行内高度、导致画布纵向压扁；详见 tools/labs-anim-review.html */ }
.tl-body figure { margin: 0 0 14px; }
.tl-body figure img { border-radius: 12px; border: 1px solid var(--line); display: block; width: auto; max-width: 100%; height: auto; max-height: 280px; object-fit: contain; background: var(--img-bg); margin: 0 auto; }
.tl-body figure img[src$=".svg"] { width: 100%; max-width: 100%; }  /* 矢量图放大无损，保持满宽 */
.tl-body figcaption { font-size: 13px; color: var(--ink-3); margin-top: 7px; line-height: 1.6; text-align: center; }  /* 图片按比例居中后，图注随之居中，保持同一条中轴 */

/* ===== 通用补丁：首页 hero 网格与插画上限（与 .hero-inner 等价） ===== */
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 46px; align-items: center; padding: 66px 24px 60px; }
.hero-art img { width: 100%; max-width: 480px; height: auto; display: block; border-radius: 16px; }
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; padding: 46px 24px 44px; }
  .hero-grid .hero-art { order: -1; justify-content: flex-start; }
  .hero-grid .hero-art img { max-width: 420px; }
}

/* ===== 通用补丁：时间轴静态结构适配（.tl-rail / .tl-head / .tl-body） ===== */
.tl-item { grid-template-columns: 26px 1fr; gap: 0; padding-bottom: 26px; }
.tl-item > .tl-rail { grid-column: 1; grid-row: 1 / -1; position: relative; display: flex; justify-content: center; }
.tl-item > .tl-rail::before { top: 7px; bottom: -26px; }
.tl-item:last-child > .tl-rail::before { display: none; }
.tl-rail .dot {
  flex: none; position: relative; z-index: 2; box-sizing: border-box;
  width: 14px; height: 14px; border-radius: 50%; margin-top: 5px;
  background: var(--white); border: 3px solid var(--brand-line);
}
.tl-item > .tl-head {
  grid-column: 2; grid-row: 1; display: flex; align-items: baseline;
  gap: 12px; flex-wrap: wrap; padding: 2px 0 0; cursor: default; background: none;
}
.tl-item > .tl-head .tl-year {
  font-family: var(--mono); font-size: 16px; font-weight: 800;
  color: var(--brand); flex: none; padding: 0; text-align: left;
}
.tl-item > .tl-head .tl-title { font-size: 17.5px; font-weight: 700; color: var(--ink); }
.tl-item > .tl-body { grid-column: 2; grid-row: 2; margin-top: 10px; }
@media (max-width: 640px) {
  .tl-item > .tl-head { gap: 8px; }
  .tl-item > .tl-head .tl-title { font-size: 16px; }
}

/* ===== 通用补丁：返回系列门户入口 ===== */
.portal-link {
  display: inline-flex; align-items: center; flex: none; margin-right: 14px;
  height: 30px; padding: 0 13px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-alt); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 13.5px; font-weight: 700;
  transition: background .18s, color .18s, border-color .18s;
}
.portal-link:hover { background: var(--white); color: var(--brand); border-color: var(--brand-line); text-decoration: none; }
.nav-portal { display: none; }
@media (max-width: 640px) {
  .nav-inner { gap: 10px; }
  .portal-link { display: none; }
  .nav-portal { display: block; font-weight: 700; color: var(--brand); }
}

/* ===== 动画闸门：暂停 / 单步（把动画的控制权交还使用者） ===== */
.lab-anim-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 12px 0 2px; font-size: 13px; color: var(--ink-2);
}
.lab-anim-btn {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--bg-alt); border: 1px solid var(--line); color: var(--ink-2);
  font-family: inherit; line-height: 1.4;
  transition: background .16s, color .16s, border-color .16s;
}
.lab-anim-btn:hover { background: var(--white); color: var(--brand); border-color: var(--brand-line); }
.lab-anim-btn.on { background: var(--brand); border-color: var(--brand); color: var(--white); }
.lab-anim-tip { opacity: .75; }
.lab-anim-tools.paused .lab-anim-tip { opacity: 1; color: var(--brand); font-weight: 700; }

/* ===== P2-1：先猜一猜（POE 教学法的 Predict 环节，2026-09-14） =====
   45 个实验原本只有指令式引导语，学生不知道自己要验证什么假设。
   在每个实验的一句话说明后补一句可验证的猜想：先猜 -> 再拖 -> 后解释。 */
.lab-guess {
  font-size: 14px; line-height: 1.62; color: var(--accent-ink-deep);
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 13px; margin: 0 0 14px;
}
.lab-guess b { color: var(--accent-deep); font-weight: 700; margin-right: 2px; }

/* ===== P2-2：画布就地图例（颜色语义，2026-09-14） =====
   报告指出：45 个实验内部配色各自自洽，但没有跨实验的"视觉词汇表"——
   同一个暖橙在整套里至少表示光子/光线/磁极/被淘汰个体/物体B/火星/导线 7 种东西。
   做法不改各实验配好的颜色（改色要重调 45 张图、风险高），而是在每张画布下方
   就地标出颜色含义；实验自己在画面上写明过的，就照它的说法标注。 */
.lab-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
}
.lab-legend .lg-head {
  font-weight: 700; color: var(--ink); letter-spacing: .02em;
  padding-right: 2px; border-right: 1px solid var(--line); margin-right: 4px;
}
.lab-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lab-legend .lg-item i {
  width: 15px; height: 11px; border-radius: 3px; flex: 0 0 auto;
  border: 1px solid var(--ink-a18);
  background: var(--swatch-gray);
}
.lab-legend .lg-item.series i { border-style: dashed; }
.lab-legend .lg-note { color: var(--ink-3); font-size: 12px; }

/* 详解页引用区块（P3 新增） */
.refblock{margin:40px 0 8px;padding:22px 24px;background:var(--bg-alt,#F5F7FA);border:1px solid var(--line,#E6EAF0);border-left:4px solid var(--brand,#3B5BDB);border-radius:14px}
.refblock h3{font-size:17px;margin:0 0 12px;color:var(--ink,#1B2530);display:flex;align-items:center;gap:8px}
.refblock ol{margin:0;padding-left:22px}
.refblock li{font-size:15px;color:var(--ink-2,#5c6b82);line-height:1.75;margin:8px 0}
.refblock li b{color:var(--ink,#1B2530)}
.refblock .ref-note{margin:14px 0 0;font-size:13px;color:var(--ink-3,#8B96AA);line-height:1.7}
.refblock a{color:var(--brand,#3B5BDB);text-decoration:none}
.refblock a:hover{text-decoration:underline}

/* ═══ 历史肖像 · 影调统一（B 方案：去色 + 暖灰） ═════════════════════════════
   只做展示层：原件不动，把 --hist-tone 改成 none 即整体关闭；
   单张跳过可加 class="portrait-raw"。
   目标曲线 = 灰度 → #161310 → #F2EEE8 单色斜坡（对应 shots/tone 的 B 档），
   纯 CSS 链拟合误差 < 1/255，实测见 tools/check_hist_tone.js。 */
:root { --hist-tone: grayscale(1) sepia(.07) saturate(1.87) brightness(.99) contrast(.85); }
img[src*="-portrait"] { filter: var(--hist-tone); }
img[src*="-portrait"].portrait-raw { filter: none; }

/* ===== 通用补丁：详解页下拉（由 tools/nav_more_menu.py 注入，幂等） ===== */
.nav-more { position: relative; display: flex; align-items: center; }
.nav-more-cb { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-more-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 13px; border-radius: 9px; font-size: 15px; font-weight: 600;
  color: var(--ink-2); transition: background .18s, color .18s;
  -webkit-user-select: none; user-select: none;
}
.nav-more-btn::after {
  content: ""; width: 0; height: 0; margin-top: 3px;
  border: 4px solid transparent; border-top-color: currentColor; transition: transform .2s;
}
.nav-more:hover > .nav-more-btn,
.nav-more-cb:checked + .nav-more-btn { background: var(--brand-soft); color: var(--brand); }
.nav-more-cb:checked + .nav-more-btn::after { transform: rotate(180deg); }
.nav-more-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 80;
  min-width: 300px; max-width: 380px; padding: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
  display: none; flex-direction: column; gap: 2px;
}
.nav-more:hover .nav-more-menu,
.nav-more-cb:checked ~ .nav-more-menu { display: flex; }
.nav-more-menu a {
  padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
  line-height: 1.45; color: var(--ink-2); white-space: normal;
}
.nav-more-menu a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.nav-more-menu a.active { color: var(--brand); background: var(--brand-soft); }
/* 当前页就在详解菜单里时，让「详解」按钮保持高亮（不支持 :has 的浏览器静默降级） */
.nav-more:has(.nav-more-menu a.active) > .nav-more-btn { color: var(--brand); background: var(--brand-soft); }
@media (max-width: 1000px) {
  .nav-more { flex-direction: column; align-items: stretch; }
  .nav-more-btn { padding: 12px 14px; font-size: 16px; }
  .nav-more-menu {
    position: static; display: none; margin: 2px 0 6px 14px; padding: 0 0 0 12px;
    background: transparent; border: 0; border-left: 2px solid var(--line);
    box-shadow: none; min-width: 0; max-width: none; border-radius: 0;
  }
  /* 触屏上 hover 会「粘住」，小屏只认点击 */
  .nav-more:hover .nav-more-menu { display: none; }
  .nav-more-cb:checked ~ .nav-more-menu { display: flex; }
  .nav-more-menu a { padding: 9px 10px; font-size: 15px; }
}

/* ===== 通用补丁：同期中国对照（tools/build_china_era.py 注入，幂等） ===== */
.cn-note {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-alt); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.65;
  grid-column: 3 / -1;  /* 万一直接落在 .tl-item 的 grid 里，跨到正文列，避免被压成竖排 */
}
.cn-note .cn-head { font-weight: 700; color: var(--ink); font-size: 13.5px; margin-bottom: 4px; }
.cn-note .cn-head b { color: var(--brand); }
.cn-note ul { list-style: none; margin: 0; padding: 0; }
.cn-note li { margin: 3px 0; color: var(--ink-2); }
.cn-note .cn-row { display: flex; gap: 8px; align-items: baseline; margin-top: 6px; }
.cn-k {
  flex: none; font-weight: 700; font-size: 12px; color: var(--ink);
  padding: 2px 9px; background: var(--white); border: 1px solid var(--line); border-radius: 999px;
}
.cn-fig b { color: var(--ink); }
.cn-fig i { font-style: normal; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 640px) { .cn-note { font-size: 13.5px; padding: 10px 12px; } }

/* 同期中国卡片里的名词：下划线调淡（tools/build_china_era.py 注入，幂等） */
.cn-note .term { border-bottom-color: var(--brand-line); }

/* ===== align:home-modules 首页模块对齐补丁（自动生成，勿手工改）===== */

/* 首页时间轴预览要的是**折叠版**（年 / 轴 / 卡片 三列，点标题展开），而各站 CSS 的状态不一：
   · 13 个 spec 站：有折叠版样式，但后面又被一条「静态时间轴适配」补丁
     （.tl-item{grid-template-columns:26px 1fr} + .tl-item > .tl-rail{grid-column:1}）覆盖了两列；
   · 伽利略：只保留了静态版，折叠版的 .tl-panel/.tl-arrow/.tl-card 整段都不在。
   所以这里用 .tl-preview 作用域把折叠版**整套**写全（布局 + 显隐 + 箭头 + 卡片态），
   特异性高于那条补丁，且只作用于首页预览，不动 timeline.html 的静态版。 */
.tl-preview { position: relative; padding-left: 8px; }
.tl-preview .tl-item {
  display: grid; grid-template-columns: 92px 30px 1fr; gap: 0;
  align-items: start; position: relative; padding-bottom: 8px;
}
.tl-preview .tl-item > .tl-rail { grid-column: 2; grid-row: 1; position: relative; display: flex; justify-content: center; height: 100%; }
.tl-preview .tl-item > .tl-rail::before {
  content: ""; position: absolute; top: 0; bottom: -8px; left: 50%;
  width: 2px; transform: translateX(-50%); background: var(--line-2);
}
.tl-preview .tl-item:last-child > .tl-rail::before { display: block; bottom: 40%; }
.tl-preview .tl-year {
  grid-column: 1; grid-row: 1; font-family: var(--mono); font-size: 15.5px;
  font-weight: 700; color: var(--brand); padding-top: 15px; text-align: right; padding-right: 18px;
}
.tl-preview .tl-card {
  grid-column: 3; grid-row: 1; background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; margin: 8px 0; overflow: hidden;
  box-shadow: var(--shadow-s); transition: box-shadow .2s, border-color .2s;
}
.tl-preview .tl-dot {
  position: relative; z-index: 2; width: 15px; height: 15px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--brand-line); margin-top: 20px;
  transition: border-color .2s, transform .2s;
}
.tl-preview .tl-head { padding: 15px 18px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.tl-preview .tl-head:hover { background: var(--bg-elev); }
.tl-preview .tl-head .t { font-size: 17.5px; font-weight: 700; margin: 0; color: var(--ink); }
.tl-preview .tl-arrow { flex: none; width: 22px; height: 22px; color: var(--ink-3); transition: transform .24s; margin-top: 4px; }
.tl-preview .tl-panel { display: none; padding: 0 18px 18px; border-top: 1px dashed var(--line); }
.tl-preview .tl-panel p { font-size: 15.5px; color: var(--ink-2); margin: 14px 0; }
.tl-preview .tl-panel figure { margin: 0 0 14px; }
/* 配图必须 width:auto + max-width:100% + margin:0 auto（SVG 例外）——伽利略的 CSS 里
   连 .tl-panel figure img 都没有，不写这条它的预览图会撑满整张卡片。
   max-height 取 360px，与牛顿 .tl-panel figure img 的实际值一致（原先写 280px 是自定的，
   「以牛顿为准」就不该自定）；改这里必须同步改 check_align.js 的配图高度断言。 */
.tl-preview .tl-panel figure img {
  border-radius: 12px; border: 1px solid var(--line); display: block;
  width: auto; max-width: 100%; height: auto; max-height: 360px;
  object-fit: contain; background: var(--img-bg); margin: 0 auto;
}
.tl-preview .tl-panel figure img[src$=".svg"] { width: 100%; max-width: 100%; }
.tl-preview .tl-panel figcaption { font-size: 13px; color: var(--ink-3); margin-top: 7px; line-height: 1.6; text-align: center; }
.tl-preview .tl-item.open .tl-panel { display: block; animation: fadeDown .26s ease; }
.tl-preview .tl-item.open .tl-card { border-color: var(--brand-line); box-shadow: var(--shadow-m); }
.tl-preview .tl-item.open .tl-arrow { transform: rotate(180deg); color: var(--brand); }
.tl-preview .tl-item.open .tl-dot { border-color: var(--brand); transform: scale(1.15); }
@media (max-width: 640px) {
  .tl-preview .tl-item { grid-template-columns: 58px 24px 1fr; }
  .tl-preview .tl-year { font-size: 14px; padding-right: 10px; }
}
/* ===== /align:home-modules ===== */
