/* ============================================================
   虾青素 · 专题站
   深色单主题：深海 / 藻液 / 荧光
   ============================================================ */

:root {
  /* 与 /index/ 文献站共用同一套底色与中性色 */
  --bg:      #0A0A0B;
  --bg-2:    #0E0E0F;
  --bg-3:    #141413;
  --ink:     #E9E5DC;
  --ink-2:   #C9C3B7;
  --muted:   #9C968B;
  --faint:   #67625A;
  --line:    rgba(255, 255, 255, .062);
  --line-2:  rgba(255, 255, 255, .115);

  /* 哑金接管原来的青色位置（链接、编号、化学式、箭头） */
  --gold:    #C2A574;
  /* 虾青素本身的红与橙，压低饱和度以进入同一色域 */
  --red:     #B44A31;
  --red-lt:  #CE7256;
  --orange:  #BF9160;
  --cyan:    #C2A574;

  --maxw: 1080px;
  --serif: "Times New Roman", "Songti SC", "SimSun", "Source Han Serif SC",
           "Noto Serif CJK SC", "STSong", Georgia, serif;
  --sans: "Microsoft YaHei", "Heiti SC", "SimHei", "PingFang SC",
          "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --mono: "Consolas", "SF Mono", "Cascadia Mono", Menlo, ui-monospace, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.9;
  letter-spacing: .008em;
  -webkit-font-smoothing: antialiased;
  /* clip 不创建滚动容器，sticky 才能相对视口生效；
     hidden 会让 overflow-y 变成 auto，直接杀死 sticky */
  overflow-x: hidden;
  overflow-x: clip;
}

::selection { background: var(--red); color: #fff; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 48px);
  font-size: 13px;
  transition: background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: rgba(10, 10, 11, .82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: .18em;
  font-size: 12px;
}
.nav-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px 2px rgba(180, 74, 49, .6);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .55; transform: scale(.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 2px;
}
.nav-links a {
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 999px;
  transition: color .25s, background .25s;
}
.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .05);
  text-decoration: none;
}

/* ---------------- HERO ---------------- */
/* 外层提供滚动行程，内层 sticky 固定在视口 —— 
   分子才会“停在屏幕上”随滚动变色，而不是直接滚走 */
.hero-track {
  position: relative;
  height: 180vh;
}

.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 40%, #16150f 0%, #0A0A0B 62%);
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* 极淡噪点：打断深色大面积渐变的 8bit 色带（banding），
   否则在接近黑的色阶上会出现肉眼可见的横向色条 */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(75% 55% at 50% 46%, transparent 40%, rgba(10, 10, 11, .6) 100%),
    linear-gradient(to bottom, rgba(10, 10, 11, .55) 0%, transparent 22%, transparent 76%, rgba(10, 10, 11, .92) 100%);
}
.hero-copy {
  position: absolute;
  left: clamp(18px, 6vw, 96px);
  bottom: clamp(64px, 13vh, 150px);
  z-index: 4;
  max-width: 620px;
  pointer-events: none;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 11.5px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--cyan);
}
.hero-eyebrow::before {
  content: "";
  width: 32px; height: 1px;
  background: currentColor;
  opacity: .6;
}
.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 6.8vw, 90px);
  line-height: 1.02;
  letter-spacing: .04em;
  text-shadow: 0 0 70px rgba(180, 74, 49, .2);
}
.hero-title em {
  font-style: normal;
  color: var(--red-lt);
  font-size: .88em;
  letter-spacing: .01em;
}
.hero-sub {
  margin: 20px 0 0;
  font-size: clamp(13px, 1.5vw, 15px);
  letter-spacing: .34em;
  color: var(--faint);
  text-transform: uppercase;
  font-family: var(--mono);
}
.hero-desc {
  margin: 26px 0 0;
  max-width: 30em;
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.9;
  color: var(--ink-2);
}

/* 化学状态读数 */
.hero-readout {
  position: absolute;
  right: clamp(18px, 5vw, 64px);
  bottom: clamp(64px, 13vh, 150px);
  z-index: 4;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2.1;
  color: var(--faint);
  pointer-events: none;
}
.hero-readout .name {
  display: block;
  font-size: clamp(15px, 1.6vw, 19px);
  letter-spacing: .06em;
  color: var(--ink);
  transition: color .5s var(--ease);
}
.hero-readout .formula {
  color: var(--cyan);
  letter-spacing: .18em;
  font-family: var(--sans);
  font-size: 1.05em;
}
.hero-readout .step {
  display: block;
  margin-top: 6px;
  color: var(--faint);
}
.readout-bar {
  display: block;
  width: 128px;
  height: 2px;
  margin: 12px 0 0 auto;
  background: var(--line-2);
  position: relative;
  overflow: hidden;
}
.readout-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--red));
  transition: width .18s linear;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--faint);
  text-transform: uppercase;
}
.hero-scroll span {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, transparent, var(--red));
  animation: drop 2.2s var(--ease) infinite;
  transform-origin: top;
}
@keyframes drop {
  0%   { transform: scaleY(0); opacity: 0; }
  35%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------------- 章节通用 ---------------- */
main { position: relative; z-index: 2; }

.chapter {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 130px) clamp(18px, 5vw, 48px);
  scroll-margin-top: 84px;
}
.chapter + .chapter { border-top: 1px solid var(--line); }

.chapter-head { margin-bottom: 52px; }
.chapter-no {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .3em;
  color: var(--red);
  margin-bottom: 16px;
}
.chapter-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.24;
  letter-spacing: .03em;
}
.chapter-head h2 em {
  font-style: normal;
  color: var(--orange);
}
.chapter-lead {
  margin: 20px 0 0;
  max-width: 44em;
  font-size: clamp(15px, 1.7vw, 16.5px);
  line-height: 1.95;
  color: var(--muted);
}

.prose { max-width: 48em; }
.prose p {
  margin: 0 0 20px;
  font-size: 15.6px;
  line-height: 1.95;
  color: var(--ink-2);
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose code {
  font-family: var(--mono);
  font-size: .9em;
  color: var(--cyan);
  background: rgba(194, 165, 116, .1);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---------------- 事实卡 ---------------- */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 44px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.fact {
  padding: 22px 20px;
  background: var(--bg);
}
.fact dt {
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.fact dd {
  margin: 0;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: .04em;
}
.fact dd small {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0;
}

/* ---------------- 跨膜示意 ---------------- */
.membrane {
  margin: 52px 0 0;
  padding: 34px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg));
}
.membrane svg { width: 100%; height: auto; display: block; }
.membrane-cap {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
  letter-spacing: .04em;
}

/* ---------------- 通路 ---------------- */
.pathway {
  display: grid;
  grid-template-columns: 1fr 80px 1fr 80px 1fr;
  align-items: stretch;
  gap: 0;
  margin: 48px 0 0;
}
.pnode {
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.pnode:hover { transform: translateY(-3px); border-color: var(--line-2); }
.pnode .step-no {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--faint);
}
.pnode h4 {
  margin: 10px 0 6px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .02em;
}
.pnode .chem {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: .14em;
}
.pnode p {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--muted);
}
.pnode.is-final { border-color: rgba(180, 74, 49, .4); }
.pnode.is-final h4 { color: var(--red-lt); }

.parrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .12em;
  font-family: var(--mono);
}
.parrow i {
  display: block;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, var(--line-2), var(--red));
  position: relative;
}
.parrow i::after {
  content: "";
  position: absolute;
  right: -1px; top: -2.5px;
  width: 6px; height: 6px;
  border-right: 1px solid var(--red);
  border-top: 1px solid var(--red);
  transform: rotate(45deg);
}
.parrow b { color: var(--cyan); font-weight: 500; letter-spacing: .06em; }

.bypass {
  margin: 22px 0 0;
  padding: 14px 18px;
  border-left: 2px solid var(--line-2);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.8;
}

/* ---------------- 表格 ---------------- */
.table-wrap {
  margin: 44px 0 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 620px;
}
th, td {
  text-align: left;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  background: var(--bg-3);
}
td { color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
td .mono { font-family: var(--mono); font-size: 13px; color: var(--ink); }
td .tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
td .tag.hot { border-color: rgba(194, 165, 116, .42); color: var(--gold); }

/* ---------------- 定性排序条 ---------------- */
.rank {
  margin: 44px 0 0;
  display: grid;
  gap: 16px;
}
.rank-row {
  display: grid;
  grid-template-columns: 168px 1fr 60px;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.rank-row .label { color: var(--ink-2); }
.rank-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.rank-bar i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 4px;
  animation: grow 1.3s var(--ease) both;
}
@keyframes grow {
  from { width: 0; }
  to   { width: var(--w); }
}
.rank-row .val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  text-align: right;
}

/* ---------------- 应用卡片 ---------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 44px;
}
.tile {
  background: var(--bg);
  padding: 26px 22px 30px;
  transition: background .3s var(--ease);
}
.tile:hover { background: var(--bg-2); }
.tile .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--faint);
}
.tile h4 {
  margin: 12px 0 10px;
  font-size: 16.5px;
  font-weight: 500;
}
.tile p {
  margin: 0;
  font-size: 13.6px;
  line-height: 1.8;
  color: var(--muted);
}
.tile p + p { margin-top: 10px; }

/* ---------------- 误区对照 ---------------- */
.myths {
  display: grid;
  gap: 14px;
  margin-top: 44px;
}
.myth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.myth > div { padding: 20px 22px; background: var(--bg); }
.myth .claim {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.myth .claim::before {
  content: "常见说法";
  display: block;
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--faint);
  margin-bottom: 8px;
}
.myth .truth {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.8;
  border-left: 1px solid var(--line);
}
.myth .truth::before {
  content: "实际如此";
  display: block;
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--red);
  margin-bottom: 8px;
}

/* ---------------- 列表 ---------------- */
.steps {
  counter-reset: s;
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.steps li {
  counter-increment: s;
  position: relative;
  padding: 20px 0 20px 52px;
  border-bottom: 1px solid var(--line);
  font-size: 14.6px;
  color: var(--ink-2);
  line-height: 1.85;
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0; top: 21px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--red);
}
.steps li b {
  display: block;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: 15.2px;
}

/* ---------------- 引文 ---------------- */
.pull {
  margin: 56px 0 0;
  padding: 34px 0 34px 34px;
  border-left: 2px solid var(--red);
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 25px);
  line-height: 1.75;
  color: var(--ink);
  max-width: 34em;
}
.pull cite {
  display: block;
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 12px;
  font-style: normal;
  letter-spacing: .1em;
  color: var(--muted);
}

/* ---------------- 检索 ---------------- */
.search-box {
  margin: 40px 0 0;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
  color: var(--ink-2);
  overflow-x: auto;
}
.search-box span { color: var(--faint); }
.search-box em { color: var(--cyan); font-style: normal; }

/* ---------------- 页脚 ---------------- */
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px clamp(18px, 5vw, 48px) 64px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--faint);
  letter-spacing: .04em;
}
.foot a { color: var(--muted); }
.foot .sep { opacity: .4; }
.foot .spacer { flex: 1; }

/* 备案号：占满一行强制换行（flex-basis 100%），工信部要求号码可点 */
.foot .legal {
  flex: 0 0 100%;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: .06em;
}
.foot .legal a { color: var(--faint); }
.foot .legal a:hover { color: var(--muted); }

/* ---------------- 入场动画 ---------------- */
.rise {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.rise.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .nav-dot, .hero-scroll span { animation: none; }
  .rank-bar i { transition: none; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .pathway { grid-template-columns: 1fr; gap: 0; }
  .parrow { height: 56px; flex-direction: row; gap: 10px; }
  .parrow i { width: 56px; flex: none; }
  .parrow i::after { right: auto; left: 50px; transform: rotate(135deg); top: -2px; }
  .myth { grid-template-columns: 1fr; }
  .myth .truth { border-left: 0; border-top: 1px solid var(--line); }
  .hero-readout { display: none; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero-track { height: 160vh; }
  .hero-copy { bottom: 84px; left: 20px; right: 20px; }
  .hero-desc { font-size: 14.5px; }
  .rank-row { grid-template-columns: 1fr; gap: 8px; }
  .rank-row .val { text-align: left; }
  .facts { grid-template-columns: 1fr; }
  .fact { padding: 18px 18px; }
  .chapter { padding-left: 20px; padding-right: 20px; }
}

/* ============================================================
   界面层用黑体：导航、读表、表头、标签、代码框
   正文（宋体）由 body 继承，这里只列出需要切换的
   ============================================================ */
.nav, .nav-mark, .nav-links,
.hero-readout, .hero-readout .name, .hero-readout .step,
.hero-sub, .hero-scroll,
.fact dt, .fact dd, .fact dd small,
.chapter-no, th, .tag,
.pnode .step-no, .pnode h4, .pnode .chem,
.tile h4, .tile .k,
.steps li b, .myth .claim,
.search-box, .foot,
table { font-family: var(--sans); }

/* ---------------- 语言切换 ---------------- */
.nav-lang {
  flex: 0 0 auto;
  margin-left: 10px;
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: .08em;
  line-height: 1.4;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.nav-lang:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: rgba(194, 165, 116, .08);
  text-decoration: none;
}
