/* =====================================================================
   免疫学 · 学习App  —  设计系统
   仿 Apple App Store / iOS 视觉语言（自研复刻，非照搬源码）
   ===================================================================== */

/* ---------- 设计令牌 ---------- */
:root{
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  --font-round: ui-rounded, -apple-system, "SF Pro Rounded", "PingFang SC", var(--font);

  /* 明亮模式 */
  --label:#1d1d1f;
  --label-2:#6e6e73;
  --label-3:#86868b;
  --label-4:#aeaeb2;
  --page:#f5f5f7;
  --page-2:#ffffff;
  --card:#ffffff;
  --card-2:#f2f2f7;
  --surface:rgba(255,255,255,.74);
  --surface-strong:rgba(255,255,255,.92);
  --surface-tint:rgba(0,113,227,.055);
  --divider:rgba(0,0,0,.10);
  --hairline:rgba(0,0,0,.14);
  --tile-border:transparent;
  --nav-bg:rgba(250,250,252,.72);
  --blur-bg:rgba(255,255,255,.6);
  --accent:#0071e3;
  --accent-press:#0058b8;
  --on-accent:#ffffff;
  --get-bg:#e8e8ed;
  --get-fg:#0071e3;

  /* iOS 系统色 */
  --blue:#007aff; --green:#34c759; --indigo:#5856d6; --orange:#ff9500;
  --pink:#ff2d55; --purple:#af52de; --red:#ff3b30; --teal:#5ac8fa;
  --yellow:#ffcc00; --mint:#00c7be; --brown:#a2845e;

  --shadow-1:0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.07);
  --shadow-2:0 8px 24px rgba(0,0,0,.10), 0 20px 48px rgba(0,0,0,.12);
  --shadow-card:0 4px 24px rgba(0,0,0,.10);
  --shadow-soft:0 1px 2px rgba(0,0,0,.04), 0 14px 44px rgba(0,0,0,.075);

  --r-card:22px;
  --r-lg:28px;
  --r-xl:34px;
  --r-chip:980px;
  --r-sm:14px;
  --r-tile:20px;

  --nav-h:52px;
  --tab-h:56px;
  --maxw:1180px;
  --gutter:22px;

  --ease:cubic-bezier(.32,.72,0,1);
  --ease-out:cubic-bezier(.16,1,.3,1);
  color-scheme: light;
}

:root[data-theme="dark"]{
  --label:#f5f5f7;
  --label-2:#aeaeb2;
  --label-3:#8e8e93;
  --label-4:#636366;
  --page:#000000;
  --page-2:#0c0c0e;
  --card:#1c1c1e;
  --card-2:#2c2c2e;
  --surface:rgba(28,28,30,.74);
  --surface-strong:rgba(36,36,38,.92);
  --surface-tint:rgba(41,151,255,.12);
  --divider:rgba(255,255,255,.12);
  --hairline:rgba(255,255,255,.16);
  --tile-border:transparent;
  --nav-bg:rgba(22,22,24,.66);
  --blur-bg:rgba(28,28,30,.6);
  --accent:#2997ff;
  --accent-press:#1a7fe0;
  --get-bg:rgba(120,120,128,.32);
  --get-fg:#2997ff;
  --shadow-1:0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5);
  --shadow-2:0 10px 30px rgba(0,0,0,.55);
  --shadow-card:0 6px 28px rgba(0,0,0,.5);
  --shadow-soft:0 1px 2px rgba(0,0,0,.34), 0 18px 52px rgba(0,0,0,.38);
  color-scheme: dark;
}

/* 跟随系统（未手动切换时） */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --label:#f5f5f7; --label-2:#aeaeb2; --label-3:#8e8e93; --label-4:#636366;
    --page:#000; --page-2:#0c0c0e; --card:#1c1c1e; --card-2:#2c2c2e;
    --divider:rgba(255,255,255,.12); --hairline:rgba(255,255,255,.16);
    --nav-bg:rgba(22,22,24,.66); --blur-bg:rgba(28,28,30,.6);
    --surface:rgba(28,28,30,.74); --surface-strong:rgba(36,36,38,.92); --surface-tint:rgba(41,151,255,.12);
    --tile-border:transparent;
    --accent:#2997ff; --accent-press:#1a7fe0; --get-bg:rgba(120,120,128,.32); --get-fg:#2997ff;
    --shadow-1:0 1px 3px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.5);
    --shadow-2:0 10px 30px rgba(0,0,0,.55); --shadow-card:0 6px 28px rgba(0,0,0,.5); --shadow-soft:0 1px 2px rgba(0,0,0,.34), 0 18px 52px rgba(0,0,0,.38);
    color-scheme: dark;
  }
}

/* ---------- 字号调节（设置里可调） ---------- */
:root[data-fontscale="s"]{ --fs:0.92; }
:root[data-fontscale="m"]{ --fs:1; }
:root[data-fontscale="l"]{ --fs:1.12; }
:root{ --fs:1; }

/* ---------- 重置 ---------- */
*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:var(--font);
  background:
    linear-gradient(180deg, var(--surface-tint) 0, transparent 310px),
    linear-gradient(180deg, var(--page-2) 0, var(--page) 520px);
  color:var(--label);
  font-size:calc(17px * var(--fs));
  line-height:1.47;
  letter-spacing:-.01em;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
  transition:background .4s var(--ease), color .4s var(--ease);
}
a{ color:var(--accent); text-decoration:none; }
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
img{ display:block; max-width:100%; }
::selection{ background:rgba(0,113,227,.2); }

/* 滚动条 */
*::-webkit-scrollbar{ width:10px; height:10px; }
*::-webkit-scrollbar-thumb{ background:var(--label-4); border-radius:8px; border:3px solid transparent; background-clip:padding-box; }
*::-webkit-scrollbar-track{ background:transparent; }

/* ---------- 章节图标：iOS squircle + 自绘 glyph ---------- */
.appicon{
  position:relative; flex:none; display:grid; place-items:center;
  border-radius:22.5%;
  background:linear-gradient(150deg, var(--g0), var(--g1));
  box-shadow:
    0 6px 18px -4px color-mix(in srgb, var(--g1) 55%, transparent),
    0 2px 6px rgba(0,0,0,.18),
    inset 0 0 0 .5px rgba(255,255,255,.22),
    inset 0 1.5px 1.5px rgba(255,255,255,.4),
    inset 0 -10px 22px rgba(0,0,0,.12);
  overflow:hidden;
}
.appicon::after{ /* 顶部高光 */
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(125% 80% at 50% -12%, rgba(255,255,255,.5), rgba(255,255,255,0) 52%);
}
.appicon__glyph{ width:56%; height:56%; position:relative; z-index:1; }
.appicon--image{ background:transparent; overflow:hidden; }
.appicon--image::after{ display:none; }
.appicon--image img{ width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block; }

/* ---------- SF Symbol mask 基类 ---------- */
.sym{
  display:inline-block; width:1em; height:1em; vertical-align:-.12em;
  background-color:currentColor;
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  -webkit-mask-position:center; mask-position:center;
  -webkit-mask-size:contain; mask-size:contain;
  flex:none;
}

/* =====================================================================
   导航栏（磨砂）
   ===================================================================== */
.nav{
  position:sticky; top:0; z-index:9900;
  height:var(--nav-h);
  display:flex; align-items:center; gap:18px;
  padding:0 var(--gutter);
  background:var(--nav-bg);
  -webkit-backdrop-filter:saturate(180%) blur(24px);
  backdrop-filter:saturate(180%) blur(24px);
  border-bottom:.5px solid var(--hairline);
  box-shadow:0 10px 34px rgba(0,0,0,.045);
  transition:background .4s var(--ease), box-shadow .4s var(--ease);
}
.nav__brand{
  display:flex; align-items:center; gap:9px;
  font-weight:600; font-size:calc(19px*var(--fs)); letter-spacing:-.02em;
  cursor:pointer; white-space:nowrap;
}
.nav__brand .logo{
  width:30px; height:30px; border-radius:8px;
  display:block; flex:none; overflow:hidden;
  background:url("assets/chapter-icons/brand.png") center/cover no-repeat;
  color:transparent; font-size:0; line-height:0;
  box-shadow:0 2px 8px rgba(0,0,0,.14);
}
.nav__links{ display:flex; gap:4px; margin-left:6px; }
.nav__links a{
  color:var(--label-2); font-size:calc(14px*var(--fs)); font-weight:500;
  padding:7px 12px; border-radius:var(--r-chip); transition:.2s var(--ease);
}
.nav__links a:hover{ color:var(--label); background:var(--card-2); }
.nav__links a.active{ color:var(--label); font-weight:600; }
.nav__spacer{ flex:1; }
.nav__btn{
  width:34px;height:34px;border-radius:50%;
  display:grid;place-items:center;color:var(--label-2);font-size:16px;
  transition:.2s var(--ease);
}
.nav__btn:hover{ background:var(--card-2); color:var(--label); }

/* =====================================================================
   布局
   ===================================================================== */
.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 var(--gutter); }
.view{ min-height:60vh; padding-bottom:120px; animation:viewIn .5s var(--ease-out); }
@media (max-width:560px){ :root{ --gutter:16px; } }
@keyframes viewIn{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

.section{ margin-top:52px; }
.section--tight{ margin-top:34px; }

/* 区块头 shelf header */
.shelf-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; margin-bottom:18px;
}
.shelf-head .eyebrow{
  font-size:calc(12px*var(--fs)); font-weight:600; letter-spacing:.02em;
  color:var(--accent); text-transform:none; margin-bottom:3px;
}
.shelf-head h2{ font-size:calc(26px*var(--fs)); font-weight:700; letter-spacing:-.02em; }
.shelf-head .more{
  font-size:calc(15px*var(--fs)); color:var(--accent); font-weight:500;
  white-space:nowrap; display:inline-flex; align-items:center; gap:3px;
}
.shelf-head .more:hover{ text-decoration:underline; }

/* =====================================================================
   今日页 — Hero
   ===================================================================== */
.hero{
  position:relative;
  padding:58px 0 14px;
}
.hero::after{
  content:""; display:block; width:72px; height:4px; border-radius:4px;
  margin-top:22px; background:linear-gradient(90deg,var(--accent),var(--teal));
  opacity:.55;
}
.hero .eyebrow{
  font-size:calc(13px*var(--fs)); font-weight:600; letter-spacing:.06em;
  color:var(--accent); text-transform:uppercase;
}
.hero .date{ color:var(--label-2); font-size:calc(13px*var(--fs)); font-weight:600; letter-spacing:.04em; text-transform:uppercase; }
.hero h1{
  font-size:clamp(34px,6vw,64px); font-weight:700; letter-spacing:-.03em;
  line-height:1.05; margin-top:8px; max-width:18ch;
}
.hero h1 .grad{
  background:linear-gradient(120deg,#ff2d55,#bf5af2 50%,#0a84ff);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero p{ color:var(--label-2); font-size:calc(19px*var(--fs)); margin-top:14px; max-width:48ch; line-height:1.55; }

/* =====================================================================
   Today 大卡（编辑卡）
   ===================================================================== */
.today-grid{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
@media (max-width:820px){ .today-grid{ grid-template-columns:1fr; } }

.tcard{
  position:relative; border-radius:var(--r-xl); overflow:hidden;
  min-height:440px; display:flex; flex-direction:column;
  color:#fff; cursor:pointer; isolation:isolate;
  box-shadow:var(--shadow-card);
  transition:transform .5s var(--ease-out), box-shadow .5s var(--ease-out), filter .5s var(--ease-out);
  background:#222;
}
.tcard--wide{ grid-column:1 / -1; min-height:380px; }
.tcard:hover{ transform:translateY(-6px) scale(1.006); box-shadow:var(--shadow-2); filter:saturate(1.04); }
.tcard:active{ transform:scale(.99); }
.tcard__bg{ position:absolute; inset:0; z-index:-2; }
.tcard__bg::after{ content:""; position:absolute; inset:0;
  background:radial-gradient(120% 80% at 80% 0%, rgba(255,255,255,.25), transparent 60%); }
.tcard__scrim{ position:absolute; inset:0; z-index:-1;
  background:linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 100%); }
.tcard__top{ padding:26px 28px 0; }
.tcard__eyebrow{ font-size:calc(12px*var(--fs)); font-weight:700; letter-spacing:.08em; text-transform:uppercase; opacity:.9; }
.tcard__title{ font-size:calc(34px*var(--fs)); font-weight:700; letter-spacing:-.02em; line-height:1.08; margin-top:6px; max-width:14ch; }
.tcard__sub{ font-size:calc(15px*var(--fs)); opacity:.92; margin-top:10px; max-width:30ch; font-weight:500; }
.tcard__glyph{ position:absolute; right:-14px; bottom:-22px; width:230px; height:230px; z-index:-1;
  opacity:.16; transform:rotate(-8deg); }
.tcard__glyph *{ stroke:#fff !important; }
.tcard__foot{
  margin-top:auto; padding:20px 24px; display:flex; align-items:center; gap:14px;
  background:linear-gradient(0deg, rgba(0,0,0,.18), transparent);
}
.tcard__appicon{
  width:60px; height:60px; border-radius:14px; flex:none;
  display:grid; place-items:center; overflow:hidden;
  background:transparent;
  box-shadow:0 6px 18px rgba(0,0,0,.22);
}
.tcard__appicon .appicon{ width:100% !important; height:100% !important; border-radius:inherit; box-shadow:none; }
.tcard__appicon .glyph-w{ width:60%; height:60%; }
.glyph-w *{ stroke:#fff !important; }
.tcard__meta{ flex:1; min-width:0; }
.tcard__meta .n{ font-weight:600; font-size:calc(16px*var(--fs)); }
.tcard__meta .d{ font-size:calc(13px*var(--fs)); opacity:.85; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.get-btn{
  background:rgba(255,255,255,.92); color:#000; font-weight:700;
  font-size:calc(15px*var(--fs)); padding:7px 20px; border-radius:var(--r-chip);
  letter-spacing:.01em; transition:.2s var(--ease); white-space:nowrap;
}
.get-btn:hover{ transform:scale(1.04); }
.get-btn:active{ transform:scale(.96); }

/* =====================================================================
   章节库 grid（应用磁贴）
   ===================================================================== */
.tiles{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 268px), 1fr));
  gap:16px;
  align-items:stretch;
}

.tile{
  display:grid;
  grid-template-columns:64px minmax(0,1fr) max-content;
  align-items:center;
  gap:14px;
  min-width:0;
  min-height:96px;
  padding:15px 16px;
  cursor:pointer;
  border-radius:var(--r-tile);
  border:1px solid transparent;
  background:var(--surface);
  box-shadow:var(--shadow-soft);
  transition:transform .22s var(--ease-out), background .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
  position:relative;
  overflow:hidden;
}
.tile::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(135deg, rgba(255,255,255,.16), transparent 44%);
  opacity:.55;
}
.tile:hover{ background:var(--surface-strong); box-shadow:var(--shadow-1); border-color:transparent; transform:translateY(-2px); }
.tile--soon{ opacity:.68; }
.tile--soon:hover{ background:var(--surface); box-shadow:var(--shadow-soft); transform:none; border-color:transparent; }
.tile + .tile::before{} /* spacing handled by gap */
.tile > .appicon{
  position:relative; z-index:1;
  width:64px !important; height:64px !important;
}
.tile__icon{
  width:64px; height:64px; border-radius:15px; flex:none;
  display:grid; place-items:center; font-size:30px; color:#fff;
  box-shadow:var(--shadow-1); position:relative; overflow:hidden;
}
.tile__icon::after{ content:""; position:absolute; inset:0; background:radial-gradient(120% 90% at 75% 5%, rgba(255,255,255,.35), transparent 55%); }
.tile__body{ position:relative; z-index:1; min-width:0; }
.tile__body .num{ font-size:calc(11px*var(--fs)); color:var(--label-3); font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.tile__body .nm{
  font-size:calc(16px*var(--fs)); font-weight:700; letter-spacing:0;
  line-height:1.25; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.tile__body .tg{ font-size:calc(13px*var(--fs)); color:var(--label-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; }
.tile__get{
  position:relative; z-index:1; justify-self:end; align-self:center;
  background:var(--get-bg); color:var(--get-fg); font-weight:700;
  font-size:calc(13px*var(--fs)); padding:6px 14px; border-radius:var(--r-chip); transition:.2s;
  white-space:nowrap; max-width:100%; text-align:center;
}
.tile__get:hover{ filter:brightness(.96); transform:scale(1.04); }
@media (max-width:640px){
  .tiles{ grid-template-columns:1fr; gap:12px; }
  .tile{ grid-template-columns:56px minmax(0,1fr); min-height:88px; padding:14px; gap:12px; }
  .tile > .appicon{ width:56px !important; height:56px !important; }
  .tile__get{ grid-column:2; justify-self:start; margin-top:4px; }
}

/* 横向 shelf 滚动 */
.hscroll{
  display:grid; grid-auto-flow:column; gap:18px;
  grid-auto-columns:min(78%,300px);
  overflow-x:auto; scroll-snap-type:x mandatory;
  padding:4px 2px 16px; margin:0 calc(-1*var(--gutter)); padding-left:var(--gutter); padding-right:var(--gutter);
  scrollbar-width:none;
}
.hscroll::-webkit-scrollbar{ display:none; }
.hscroll > *{ scroll-snap-align:start; }

/* 看点 card (highlight) */
.hl-card{
  background:var(--surface); border-radius:var(--r-card); padding:22px;
  border:1px solid transparent; box-shadow:var(--shadow-soft); display:flex; flex-direction:column; gap:10px;
  min-height:150px; transition:transform .3s var(--ease-out), background .3s var(--ease), box-shadow .3s var(--ease);
}
.hl-card:hover{ transform:translateY(-4px); background:var(--surface-strong); box-shadow:var(--shadow-1); }
.hl-card .ic{ width:42px;height:42px;border-radius:11px; display:grid;place-items:center; color:#fff; font-size:20px; box-shadow:var(--shadow-1); }
.hl-card h3{ font-size:calc(18px*var(--fs)); font-weight:700; letter-spacing:-.01em; }
.hl-card p{ font-size:calc(14px*var(--fs)); color:var(--label-2); line-height:1.45; }

/* =====================================================================
   章节详情 — 产品页
   ===================================================================== */
.ph-hero{ position:relative; border-radius:0 0 var(--r-xl) var(--r-xl); overflow:hidden; color:#fff; padding:64px 0 34px; margin-bottom:8px; }
.ph-hero__bg{ position:absolute; inset:0; z-index:-1; }
.ph-hero__bg::after{ content:""; position:absolute; inset:0; background:radial-gradient(100% 120% at 85% -10%, rgba(255,255,255,.28), transparent 55%); }
.ph-hero .eyebrow{ font-size:calc(13px*var(--fs)); font-weight:700; letter-spacing:.08em; text-transform:uppercase; opacity:.92; }
.ph-hero h1{ font-size:clamp(34px,6vw,60px); font-weight:700; letter-spacing:-.03em; line-height:1.04; margin-top:8px; }
.ph-hero .en{ font-size:calc(18px*var(--fs)); opacity:.85; font-weight:500; margin-top:8px; letter-spacing:.01em; }
.ph-hero .lead{ font-size:calc(18px*var(--fs)); opacity:.95; margin-top:16px; max-width:48ch; font-weight:500; }

/* 产品页头部信息条（图标 + 名称 + 获取）—— 永不挤压标题 */
.ph-id{ display:flex; align-items:center; gap:20px; padding:26px 0; border-bottom:.5px solid var(--divider); }
.ph-id .appicon{ width:104px; height:104px; }
.ph-id__info{ flex:1 1 auto; min-width:0; }
.ph-id__info h2{ font-size:calc(26px*var(--fs)); font-weight:700; letter-spacing:-.02em; line-height:1.15; }
.ph-id__info .sub{ color:var(--label-2); font-size:calc(14px*var(--fs)); margin-top:4px; }
.ph-id__row{ display:flex; align-items:center; gap:14px; margin-top:14px; }
.ph-id__row .get-btn{ background:var(--accent); color:var(--on-accent); box-shadow:0 4px 14px rgba(0,113,227,.32); padding:9px 30px; }
.ph-id__row .share{ color:var(--accent); font-size:calc(20px*var(--fs)); width:40px; height:40px; border-radius:50%; display:grid; place-items:center; }
.ph-id__row .share:hover{ background:var(--card-2); }
@media (max-width:560px){
  .ph-id{ gap:16px; }
  .ph-id .appicon{ width:84px; height:84px; align-self:flex-start; }
  .ph-id__info h2{ font-size:calc(22px*var(--fs)); }
  .ph-id__row .get-btn{ flex:1; text-align:center; }
}

/* 信息小条（像 App Store 的 4 项指标） */
.ph-stats{ display:grid; grid-auto-flow:column; justify-content:space-between; gap:8px; overflow-x:auto; padding:20px 0; border-bottom:.5px solid var(--divider); scrollbar-width:none; }
.ph-stats::-webkit-scrollbar{ display:none; }
.ph-stat{ text-align:center; padding:0 22px; border-right:.5px solid var(--divider); min-width:90px; }
.ph-stat:last-child{ border-right:none; }
.ph-stat .k{ font-size:calc(11px*var(--fs)); color:var(--label-3); font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
.ph-stat .v{ font-size:calc(19px*var(--fs)); font-weight:700; color:var(--label-2); margin-top:6px; display:flex; align-items:center; justify-content:center; gap:5px; }
.ph-stat .v .sym{ font-size:calc(16px*var(--fs)); }

/* 关键词 chips */
.chips{ display:flex; flex-wrap:wrap; gap:9px; }
.chip{
  background:var(--surface); border:1px solid transparent;
  color:var(--label); font-size:calc(13px*var(--fs)); font-weight:600;
  padding:8px 14px; border-radius:var(--r-chip); box-shadow:0 1px 2px rgba(0,0,0,.035);
}
.chip--accent{ background:color-mix(in srgb, var(--accent) 12%, transparent); color:var(--accent); border-color:transparent; font-weight:600; }

/* =====================================================================
   文章排版（渲染后的 markdown）
   ===================================================================== */
.article{ font-size:calc(17px*var(--fs)); line-height:1.62; color:var(--label); max-width:760px; }
.article > *{ margin-top:1.1em; }
.article > *:first-child{ margin-top:0; }
.article h1{ display:none; } /* 标题已在 hero 呈现 */
.article h2{ font-size:calc(28px*var(--fs)); font-weight:700; letter-spacing:-.02em; margin-top:1.7em; line-height:1.2; scroll-margin-top:80px; }
.article h3{ font-size:calc(21px*var(--fs)); font-weight:700; letter-spacing:-.01em; margin-top:1.4em; }
.article h4{ font-size:calc(18px*var(--fs)); font-weight:600; margin-top:1.2em; color:var(--label); }
.article p{ color:var(--label); }
.article strong{ font-weight:700; color:var(--label); }
.article em{ color:var(--label-2); font-style:normal; }
.article a{ color:var(--accent); }
.article ul, .article ol{ padding-left:1.3em; }
.article li{ margin-top:.45em; }
.article li::marker{ color:var(--label-3); }
.article blockquote{
  border-left:3px solid var(--accent); padding:6px 0 6px 18px;
  color:var(--label-2); background:linear-gradient(90deg, color-mix(in srgb,var(--accent) 7%,transparent), transparent);
  border-radius:6px;
}
.article hr{ border:none; border-top:.5px solid var(--divider); margin:1.8em 0; }
.article code{
  font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size:.88em; background:var(--card-2); padding:.15em .45em; border-radius:6px;
}
.article pre{ background:var(--card-2); border-radius:14px; padding:16px 18px; overflow-x:auto; border:.5px solid var(--divider); }
.article pre code{ background:none; padding:0; font-size:.86em; line-height:1.7; color:var(--label); white-space:pre; }

/* 表格 — Apple 卡片表 */
.article .table-wrap{ overflow-x:auto; border-radius:16px; box-shadow:var(--shadow-1); border:.5px solid var(--divider); background:var(--card); -webkit-overflow-scrolling:touch; }
.article table{ border-collapse:collapse; width:100%; font-size:calc(14.5px*var(--fs)); min-width:440px; }
.article thead th{ background:var(--card-2); font-weight:700; color:var(--label); text-align:left; }
.article th, .article td{ padding:11px 15px; border-bottom:.5px solid var(--divider); vertical-align:top; line-height:1.45; }
.article tbody tr:last-child td{ border-bottom:none; }
.article tbody tr:hover{ background:color-mix(in srgb,var(--accent) 5%,transparent); }
.article td:first-child{ font-weight:600; color:var(--label); }

/* 折叠区（全文很长时） */
.collapse{ position:relative; }
.collapse.is-collapsed{ max-height:560px; overflow:hidden; -webkit-mask-image:linear-gradient(180deg,#000 70%,transparent); mask-image:linear-gradient(180deg,#000 70%,transparent); }
.collapse__toggle{ display:flex; justify-content:center; margin-top:18px; }
.collapse__toggle button{ color:var(--accent); font-weight:600; font-size:calc(15px*var(--fs)); display:inline-flex; align-items:center; gap:5px; padding:8px 18px; border-radius:var(--r-chip); background:var(--card); box-shadow:var(--shadow-1); transition:.2s; }
.collapse__toggle button:hover{ background:var(--card-2); }

/* =====================================================================
   术语表（lockup 列表）
   ===================================================================== */
.terms{ display:grid; grid-template-columns:1fr; gap:0; background:var(--surface); border:1px solid transparent; border-radius:var(--r-card); box-shadow:var(--shadow-soft); overflow:hidden; }
@media (min-width:760px){ .terms{ grid-template-columns:1fr 1fr; } }
.term{ padding:16px 20px; border-bottom:.5px solid var(--divider); }
@media (min-width:760px){ .term:nth-child(odd){ border-right:.5px solid var(--divider); } }
.term .t{ font-weight:700; font-size:calc(16px*var(--fs)); letter-spacing:-.01em; }
.term .e{ color:var(--label-3); font-size:calc(13px*var(--fs)); font-weight:500; margin-left:6px; }
.term .d{ color:var(--label-2); font-size:calc(14.5px*var(--fs)); margin-top:5px; line-height:1.5; }

/* =====================================================================
   测验
   ===================================================================== */
.quiz{ background:var(--surface-strong); border:1px solid transparent; border-radius:var(--r-lg); box-shadow:var(--shadow-soft); padding:28px; max-width:760px; }
.quiz__bar{ height:6px; border-radius:6px; background:var(--card-2); overflow:hidden; margin-bottom:22px; }
.quiz__bar i{ display:block; height:100%; background:linear-gradient(90deg,var(--accent),var(--teal)); border-radius:6px; transition:width .4s var(--ease); }
.quiz__meta{ display:flex; justify-content:space-between; color:var(--label-2); font-size:calc(13px*var(--fs)); font-weight:600; margin-bottom:14px; }
.quiz__q{ font-size:calc(21px*var(--fs)); font-weight:700; letter-spacing:-.01em; line-height:1.35; }
.quiz__type{ display:inline-block; font-size:calc(11px*var(--fs)); font-weight:700; color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,transparent); padding:3px 10px; border-radius:var(--r-chip); margin-bottom:12px; }
.quiz__opts{ display:flex; flex-direction:column; gap:11px; margin-top:20px; }
.opt{
  display:flex; align-items:center; gap:13px; padding:15px 17px;
  border-radius:16px; border:1.5px solid var(--divider); background:var(--page-2);
  font-size:calc(16px*var(--fs)); transition:.18s var(--ease); text-align:left; width:100%;
}
.opt:hover:not(:disabled){ border-color:var(--accent); background:color-mix(in srgb,var(--accent) 5%,transparent); }
.opt__k{ width:28px;height:28px;border-radius:50%;flex:none;display:grid;place-items:center;background:var(--card-2);font-weight:700;font-size:calc(14px*var(--fs)); color:var(--label-2); }
.opt.correct{ border-color:var(--green); background:color-mix(in srgb,var(--green) 14%,transparent); }
.opt.correct .opt__k{ background:var(--green); color:#fff; }
.opt.wrong{ border-color:var(--red); background:color-mix(in srgb,var(--red) 12%,transparent); }
.opt.wrong .opt__k{ background:var(--red); color:#fff; }
.quiz__explain{ margin-top:18px; padding:16px; border-radius:14px; background:var(--card-2); font-size:calc(14.5px*var(--fs)); color:var(--label-2); line-height:1.55; display:none; }
.quiz__explain.show{ display:block; animation:viewIn .35s var(--ease-out); }
.quiz__explain b{ color:var(--label); }
.quiz__actions{ display:flex; justify-content:flex-end; gap:12px; margin-top:22px; }
.btn-pill{ background:var(--accent); color:var(--on-accent); font-weight:600; font-size:calc(15px*var(--fs)); padding:11px 26px; border-radius:var(--r-chip); transition:.2s var(--ease); box-shadow:0 4px 14px rgba(0,113,227,.3); }
.btn-pill:hover{ transform:scale(1.03); }
.btn-pill:active{ transform:scale(.97); }
.btn-pill.ghost{ background:var(--card-2); color:var(--label); box-shadow:none; }
.btn-pill:disabled{ opacity:.4; cursor:default; transform:none; }
.quiz__result{ text-align:center; padding:30px 10px; }
.quiz__result .score{ font-size:calc(72px*var(--fs)); font-weight:800; letter-spacing:-.03em; background:linear-gradient(120deg,var(--accent),var(--teal)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.quiz__result p{ color:var(--label-2); font-size:calc(17px*var(--fs)); margin-top:6px; }

/* =====================================================================
   搜索
   ===================================================================== */
.search-field{ position:relative; margin:8px 0 24px; }
.search-field .sym{ position:absolute; left:18px; top:50%; transform:translateY(-50%); color:var(--label-3); font-size:18px; }
.search-field input{
  width:100%; height:54px; border-radius:16px; border:1px solid transparent; outline:none;
  background:var(--surface-strong); color:var(--label); font-size:calc(17px*var(--fs));
  padding:0 18px 0 48px; box-shadow:var(--shadow-soft); font-family:inherit;
}
.search-field input::placeholder{ color:var(--label-3); }
.search-res{ display:flex; flex-direction:column; }
.sres{ display:flex; align-items:center; gap:14px; padding:14px 10px; border-bottom:.5px solid var(--divider); cursor:pointer; border-radius:14px; transition:.18s var(--ease); }
.sres:hover{ background:var(--surface); padding-left:14px; padding-right:14px; box-shadow:0 1px 2px rgba(0,0,0,.035); }
.sres__ic{ width:48px;height:48px;border-radius:12px;flex:none;display:grid;place-items:center;color:#fff;font-size:22px; }
.sres__b{ flex:1; min-width:0; }
.sres__b .t{ font-weight:600; font-size:calc(16px*var(--fs)); }
.sres__b .t mark{ background:color-mix(in srgb,var(--accent) 22%,transparent); color:inherit; border-radius:3px; padding:0 1px; }
.sres__b .s{ color:var(--label-2); font-size:calc(13px*var(--fs)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sres__tag{ font-size:calc(11px*var(--fs)); color:var(--label-3); font-weight:600; }
.search-empty{ text-align:center; color:var(--label-3); padding:60px 0; }
.search-empty .sym{ font-size:46px; opacity:.5; }

/* =====================================================================
   底部 Tab 栏（iOS）
   ===================================================================== */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:9800;
  height:calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom:env(safe-area-inset-bottom, 0px);
  display:flex; align-items:stretch;
  background:var(--nav-bg);
  -webkit-backdrop-filter:saturate(180%) blur(24px); backdrop-filter:saturate(180%) blur(24px);
  border-top:.5px solid var(--hairline);
}
.tabbar__item{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  color:var(--label-3); font-size:calc(10.5px*var(--fs)); font-weight:600; transition:color .2s var(--ease);
}
.tabbar__item .sym{ font-size:22px; }
.tabbar__item.active{ color:var(--accent); }
.tabbar__item:active{ transform:scale(.92); }

/* 桌面端隐藏底栏，移动端隐藏顶部链接 */
@media (min-width:760px){ .tabbar{ display:none; } body{ --tab-pad:0; } .view{ padding-bottom:80px; } }
@media (max-width:759px){ .nav__links{ display:none; } }

/* =====================================================================
   设置弹层 / 杂项
   ===================================================================== */
.sheet-mask{ position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,.4); backdrop-filter:blur(3px); display:none; opacity:0; transition:opacity .3s var(--ease); }
.sheet-mask.show{ display:block; opacity:1; }
.sheet{
  position:fixed; z-index:10001; right:18px; top:60px; width:300px; max-width:calc(100vw - 36px);
  background:var(--blur-bg); -webkit-backdrop-filter:saturate(180%) blur(30px); backdrop-filter:saturate(180%) blur(30px);
  border:.5px solid var(--hairline); border-radius:20px; box-shadow:var(--shadow-2);
  padding:8px; transform-origin:top right; transform:scale(.9); opacity:0; pointer-events:none; transition:.3s var(--ease-out);
}
.sheet.show{ transform:scale(1); opacity:1; pointer-events:auto; }
.sheet__row{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-radius:12px; }
.sheet__row:hover{ background:var(--card-2); }
.sheet__row .lbl{ font-size:calc(15px*var(--fs)); font-weight:500; display:flex; align-items:center; gap:10px; }
.seg{ display:inline-flex; background:var(--card-2); border-radius:9px; padding:2px; }
.seg button{ padding:5px 12px; border-radius:7px; font-size:calc(13px*var(--fs)); font-weight:600; color:var(--label-2); transition:.2s; }
.seg button.on{ background:var(--card); color:var(--label); box-shadow:var(--shadow-1); }

/* 进度环 */
.ring{ --p:0; width:46px;height:46px;border-radius:50%; display:grid; place-items:center; flex:none;
  background:conic-gradient(var(--accent) calc(var(--p)*1%), var(--card-2) 0); }
.ring i{ width:38px;height:38px;border-radius:50%; background:var(--card); display:grid; place-items:center; font-size:calc(12px*var(--fs)); font-weight:700; color:var(--label-2); }

/* breadcrumb / back */
.back{ display:inline-flex; align-items:center; gap:5px; color:var(--accent); font-size:calc(15px*var(--fs)); font-weight:500; margin:18px 0 6px; }
.back:hover{ text-decoration:underline; }

/* footer */
.footer{ border-top:.5px solid var(--divider); margin-top:64px; padding:28px 0 40px; color:var(--label-3); font-size:calc(12px*var(--fs)); line-height:1.7; }
.footer a{ color:var(--label-2); }

/* 入场动画 */
.reveal{ opacity:0; transform:translateY(20px); }
.reveal.in{ opacity:1; transform:none; transition:opacity .7s var(--ease-out), transform .7s var(--ease-out); }

/* 工具 */
.center{ text-align:center; }
.muted{ color:var(--label-2); }
.nowrap{ white-space:nowrap; }
.hidden{ display:none !important; }
