/* ---------- 页脚 ---------- */
/* 底部多留一档白：右下角有固定的反馈入口（#suggest-fab，right/bottom 28px），
 * 滚到页底时它会压住页脚的右侧内容（语言切换）。留白是最便宜的避让方式。 */
footer.site {
  padding: 32px 0 calc(84px + var(--safe-bottom)); margin-top: 30px;
  font-family: var(--sans); font-size: 12px; color: var(--faint);
}
footer.site .wrap { 
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; 
  position: relative;
  padding-top: 32px;
}
footer.site .wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: var(--rule-dark);
}
footer.site .site-foot-note { opacity: .72; }
/* 页脚右侧：「隐私政策」与语言切换归为一组（之前隐私链接被 space-between 甩到
 * 页面正中间，前后都没有归属）。 */
footer.site .site-foot-side {
  display: inline-flex; align-items: center; gap: 16px; flex: none;
}
/* 页脚可点链接（隐私政策）：去浏览器默认蓝链，回到纸墨体系——淡墨字 + 发丝下划线 */
footer.site a.site-foot-note {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
footer.site a.site-foot-note:hover,
footer.site a.site-foot-note:active { opacity: 1; }

@media (max-width: 860px) {
  :root { --subbar-h: 76px; }
  .hero-grid, .report-body { grid-template-columns: 1fr; }
  .fw-grid, .wiki-grid, #learn-quickref-root, .qr-cols, .case-grid { grid-template-columns: 1fr; }
  .learn-map-stages { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--rule-dark); }
  .step:last-child { border-bottom: none; }
  .report-left { border-right: none; border-bottom: 1px solid var(--rule); }
  .exam-sheet { padding: 26px 20px; }
  .report-head { flex-direction: column; align-items: flex-start; }
  .grade { text-align: left; }
  .hero::after { background-position: 80% -20%; opacity: .06; }

  /* 下留白做在带 2px 底边线的外层：内部 .wrap 有 overflow-x:auto，
     WebKit 会把 flex 容器的 padding-bottom 裁掉/让子项撑进 padding，按钮仍贴线 */
  .learn-tabbar,
  .fw-sticky {
    padding-bottom: 20px;
  }
  /* 框架学习：吸顶只留小节导航，与标题底边线贴合 */
  .fw-sticky-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    padding-bottom: 0;
  }
  .fw-sticky-row #fw-nav-slot { flex: 1; min-width: 0; }
  .fw-sticky-row .fw-mini-title { display: none; }
  .fw-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-right: 20px;
  }
  /* WebKit 横向 flex 滚动不计 padding-end，末项会贴裁切边；用占位把「⑤ 练一」完整露出来 */
  .fw-nav::after {
    content: "";
    flex: none;
    width: 20px;
    height: 1px;
    pointer-events: none;
  }
  .fw-nav::-webkit-scrollbar { display: none; }
  .fw-nav button {
    flex: none;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--ink);
    -webkit-text-fill-color: var(--ink);
  }
  .learn-tab-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: 8px;
    padding-bottom: 0;
  }
  .learn-tab-row::-webkit-scrollbar { display: none; }
  .learn-tab {
    min-height: 44px;
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
    padding: 8px 10px;
    color: var(--ink);
    -webkit-text-fill-color: var(--ink);
  }
  .learn-tab.active,
  .learn-tab:hover {
    -webkit-text-fill-color: var(--paper);
  }
}

/* 手机报告 / 错题封印 / 分享弹窗 / 历史列表（不改桌面宽度与间距） */
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .handbook-wrap { padding: 28px 0 64px; }
  .hb-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 16px;
  }
  /* 学习中心 / 框架学习：返回按钮与标题左右并排，不挤到下一行 */
  #view-learn .hb-head,
  #view-learn-fw .fw-big-head {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
  }
  #view-learn .hb-head > div,
  #view-learn-fw .fw-big-head > #fw-head {
    flex: 1;
    min-width: 0;
  }
  #view-learn .hb-head .quiz-home-btn,
  #view-learn-fw .fw-big-head .quiz-home-btn {
    flex: none;
    white-space: nowrap;
    min-height: 44px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    color: var(--faint);
    -webkit-text-fill-color: var(--faint);
  }
  .hb-head h2 { font-size: 28px; }
  .qr-panel { padding: 22px 16px 18px; box-shadow: 4px 4px 0 var(--paper-deep); }
  .report-wrap { padding: 28px 0 56px; }
  .report-head { padding: 22px 18px 16px; gap: 12px; }
  .report-body { grid-template-columns: 1fr; }
  .report-left, .report-right { padding: 22px 18px; }
  svg.radar { max-width: 300px; width: 92%; height: auto; overflow: visible; }
  .radar-axis { font-size: 15px; }
  .wrong-review { padding: 16px 12px 22px; }
  .wr-seal-btn {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 12px;
    padding: 14px 14px 12px;
  }
  .wr-seal { width: 40px; height: 40px; font-size: 18px; }
  .wr-seal-text {
    flex: 1 1 0;
    min-width: 0;
  }
  .wr-seal-text b {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .wr-seal-text small { display: block; font-size: 12px; line-height: 1.45; }
  .wr-seal-action {
    margin-left: 0;
    flex: 1 0 100%;
    text-align: right;
  }
  .wr-card { padding: 14px 14px 12px; }
  .wr-head { flex-wrap: wrap; gap: 6px 10px; }
  .wr-score { margin-left: 0; }
  .report-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .report-actions-main {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .report-actions-main .btn { width: 100%; }
  .report-more { gap: 10px 16px; }
  .skill-strip { flex-direction: column; align-items: flex-start; }
  .share-layer { padding: 8px; align-items: center; justify-content: center; }
  .resume-layer {
    padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
  }
  .share-modal {
    max-width: none;
    width: 100%;
    max-height: 96vh;
    padding: 16px 14px 14px;
    margin: 0;
  }
  .share-preview { max-height: 48vh; max-height: 48dvh; -webkit-overflow-scrolling: touch; }
  .share-actions { flex-direction: column; }
  .share-actions .btn { width: 100%; flex: none; }
  .hist-row {
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 14px 4px;
  }
  .hist-date { width: auto; flex: 1 1 auto; min-width: 0; }
  .hist-meta { flex: 1 1 100%; min-width: 0; }
  .hist-score, .hist-open { flex: none; }
  .wiki-dim-head { flex-wrap: wrap; gap: 8px; }

  .brand .en { display: none; }
  /* 首页滚动吸附：每片撑满可视高度（顶栏之下），避免露出下一片内容；hero 内容垂直居中 */
  .hero {
    padding: 36px 0 40px;
    min-height: calc(100dvh - var(--topbar-h) - var(--safe-top));
    display: flex; flex-direction: column; justify-content: center;
  }
  .hero > .wrap { width: 100%; }
  section.home-sec:not(.home-learn-sec) { min-height: calc(100dvh - var(--topbar-h) - var(--safe-top)); }
  .hero h1 { font-size: 32px; }
  .hero .sub { font-size: 15px; }
  .hero-meta {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 24px;
  }
  .hero-meta div { flex: none; white-space: nowrap; }
  .hero-meta b { font-size: 15px; }
  .hero-meta b small { font-size: 12px; }
  .hero-meta div:first-child b { color: var(--faint); }
  /* 移动端隐藏八维模型图（2026-08-26）：首屏信息让位于金句/CTA，省出空间 */
  .spec-card { display: none; }
  .hero-grid.has-history .spec-card { display: none; }
  /* 移动端 CTA 一行排布（2026-08-26）：不再每按钮一整行，三枚并排、收窄等宽 */
  .cta-row { flex-direction: row; align-items: stretch; gap: 8px; }
  .cta-row .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 13.5px; line-height: 1.3; white-space: normal; word-break: keep-all; }
  .cta-row .btn.primary { flex: 1.3 1 0; }
  .exam-scene { margin-top: 18px; }
  .exam-scene-option { min-height: 44px; flex: 1 1 0; }
  #learn-map-root { padding: 20px 16px; box-shadow: 4px 4px 0 var(--paper-deep); margin-bottom: 32px; }
  .learn-map-route-tabs { grid-template-columns: 1fr; }
  .learn-map-route { min-height: 56px; }
  .learn-map-complete { align-items: stretch; }
  .learn-map-complete .mini-btn { width: 100%; min-height: 44px; }
  .sec-head { gap: 10px; margin-bottom: 24px; }
  .sec-head .label { display: none; }
  .sec-head h2 { font-size: 22px; }
  section.home-sec { padding: 18px 0; }

  .quiz-wrap { padding: 24px 0 calc(92px + var(--safe-bottom)); }
  /* 移动端答题页：顶栏隐藏态（JS 切题时加 body.topbar-collapsed）。
     body padding-top 保持恒定，改为内容与顶栏同步 transform 平移（同 0.22s 刚体运动），
     消除“padding 瞬间跳变 + 顶栏慢滑”不同步导致的上下抖动；保留 safe-top 不顶进状态栏 */
  body.topbar-collapsed .topbar { transform: translateY(-100%); }
  body.topbar-collapsed .quiz-wrap { transform: translateY(calc(var(--topbar-h) * -1)); }
  /* 移动端底部操作改由吸底栏承载，footer 隐藏 */
  .quiz-footer { display: none; }
  .quiz-home-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  /* 答题页吸底操作栏：下一题常驻拇指区，⋯ 收起低频反馈。
     底部主导航占 56px 常驻，吸底栏必须落在它上方，否则“下一题”被完全遮住。 */
  .quiz-dock.show {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0; right: 0; bottom: var(--mobile-nav-h, 0px); z-index: 45;
    padding: 10px 16px calc(10px + var(--safe-bottom));
    background: var(--card);
    border-top: 1px solid var(--rule-dark);
    box-shadow: 0 -4px 16px rgba(23,35,45,.08);
  }
  /* 答题页已有吸底栏的“⋯ 题目反馈”，全局反馈入口在此重复且会压住下一题 */
  body:has(#view-quiz.show) #suggest-fab { display: none; }
  .quiz-dock-more {
    flex: none; width: 44px; height: 44px;
    font-size: 20px; line-height: 1; color: var(--faint);
    background: none; border: 1px solid var(--rule); cursor: pointer;
    transition: color .15s, border-color .15s;
  }
  .quiz-dock-more:hover { color: var(--ink); border-color: var(--ink); }
  .quiz-dock-more.on { color: var(--ink); border-color: var(--ink); background: var(--paper-deep); }
  .quiz-dock-prev { flex: none; min-height: 48px; padding: 10px 14px; font-size: 14px; }
  .quiz-dock-next { flex: 1; min-height: 48px; padding: 10px 18px; font-size: 14px; }
  .top-back { padding: 5px 12px 5px 8px; margin-left: 0; min-height: 38px; }
  .exam-top {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
  }
  .exam-top .tags { flex-wrap: wrap; }
  .exam-top .label { flex: 1 0 100%; }
  .fwp-top { flex-wrap: wrap; }
  .fwp-top .label { margin-left: 0; flex: 1 0 100%; }
  .fwp-footer { display: block; }
  .fwp-footer .btn { width: 100%; min-height: 48px; }
  .diagnosis { padding: 16px 14px; }
  .scenario { padding: 14px; }
  .opts.bw .opt {
    padding-right: 16px;
    flex-wrap: wrap;
  }
  .opt .bw-badge {
    position: static;
    transform: none;
    animation: none;
    margin-top: 8px;
    margin-left: auto;
  }

  .mini-btn,
  .wiki-chip,
  .hist-toolbar button {
    min-height: 44px;
  }
  .hist-del {
    min-height: 44px;
    min-width: 44px;
    margin-left: auto;
  }
  .rx-actions { flex-direction: column; align-items: stretch; }
  .rx-actions .btn,
  .rx-actions .mini-btn { width: 100%; min-height: 44px; }
  .strip-btns { width: 100%; flex-direction: column; }
  .skill-strip .mini-btn { width: 100%; min-height: 44px; }

  .example-box { padding: 16px 14px 14px; }
  .pit-card { padding: 16px 14px 14px; }
  .case-card { padding: 0; }
  .case-hook { padding: 14px 16px 12px; }
  .case-body { padding: 14px 16px 16px; }
  .tl li { padding-left: 36px; }
  .tl li::before { width: 24px; height: 24px; font-size: 12px; }
  .tl li::after { left: 11px; }
  .cmp-table td:first-child { white-space: normal; }
  .report-left, .report-right { overflow: visible; }
  .share-close { width: 44px; height: 44px; min-width: 44px; }
  .share-modal { max-height: 96dvh; }
  .resume-card { padding: 22px 16px 18px; }
  .resume-actions { flex-direction: column; }
  .resume-actions .btn { width: 100%; min-height: 44px; }
  .learn-tabbar,
  .fw-sticky {
    padding-bottom: 20px;
  }
  .wrap.learn-tab-row,
  .wrap.fw-sticky-row {
    padding-top: 8px;
    padding-bottom: 0;
  }
}

