/* ============================================================
   数学训练营官网 · 样式表
   设计语言：暖色纸张 + 蓝紫强调色，简洁自适应
   ============================================================ */

:root {
  --gold: #4f6bff;
  --gold-dark: #3454d1;
  --gold-soft: #eaf0ff;
  --ink: #1f2430;
  --ink-soft: #6b7280;
  --paper: #ffffff;
  --paper-2: #f4f7fc;
  --line: #e5e9f2;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.10);
  --maxw: 1120px;
  color-scheme: light dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--gold);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(79, 107, 255, .35);
}
.btn--primary:hover { background: var(--gold-dark); color: #ffffff; box-shadow: 0 10px 26px rgba(52, 84, 209, .4); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-dark); background: var(--gold-soft); }
.btn--sm { padding: 9px 18px; font-size: 14px; }
.btn--block { width: 100%; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .5px;
  position: relative;
  z-index: 5;
}
.nav__logo { width: 32px; height: 32px; border-radius: 9px; }
.nav__links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
}
.nav__links a { color: var(--ink-soft); transition: color .18s; }
.nav__links a:hover { color: var(--gold-dark); }
.nav__cta { margin-left: 4px; }
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
}
.nav__toggle span {
  width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px;
  transition: transform .25s, opacity .25s;
  pointer-events: none;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- 首屏 ---------- */
.hero {
  padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 40px) clamp(40px, 6vw, 72px);
  background:
    radial-gradient(900px 500px at 85% -10%, var(--gold-soft), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}
.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}
.hero__badge {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero__title {
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -1px;
}
.hero__title .hl {
  background: linear-gradient(120deg, var(--gold-dark), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__desc {
  margin: 22px 0 30px;
  font-size: clamp(15px, 2vw, 18px);
  color: var(--ink-soft);
  max-width: 520px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__stats {
  display: flex;
  gap: 36px;
  list-style: none;
  margin-top: 38px;
}
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 28px; font-weight: 800; color: var(--ink); }
.hero__stats strong.stat--text { font-size: 23px; letter-spacing: 1px; }
.hero__stats span { font-size: 13px; color: var(--ink-soft); }

/* 手机样机 */
.hero__art { display: flex; justify-content: center; }
.phone {
  width: 260px;
  height: 545px;
  background: #141a2e;
  border-radius: 38px;
  padding: 30px 12px 12px; /* 顶部留白让屏幕内容避开刘海，避免遮挡进度 */
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: rotate(-3deg);
}
.phone__notch {
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 18px; background: #141a2e; border-radius: 0 0 12px 12px; z-index: 2;
}
.phone__screen {
  width: 100%; height: 100%;
  border: 0;
  border-radius: 28px;
  background: var(--paper);
  overflow: hidden;
  position: relative;
}
/* ---------- 手机样机：嵌入真实答题页（iframe） ---------- */
.quiz { display:flex; flex-direction:column; gap:9px; padding:2px; }
.quiz__bar { display:flex; align-items:center; gap:8px; }
.quiz__chip { font-size:10px; font-weight:700; padding:2px 9px; border-radius:999px; background:var(--gold-soft); color:var(--gold-dark); }
.quiz__lv { font-size:11px; color:var(--ink-soft); }
.quiz__timer { margin-left:auto; display:inline-flex; align-items:center; gap:3px; font-size:11px; color:#e0533b; font-weight:700; }
.quiz__q { font-size:21px; font-weight:800; color:var(--ink); letter-spacing:.5px; }
.quiz__opts { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.quiz__opt { font-size:15px; font-weight:700; color:var(--ink); padding:11px 0; border:1.5px solid var(--line); border-radius:12px; background:#fff; }
.quiz__opt:first-child { background:var(--gold); color:#fff; border-color:var(--gold); }
.quiz__ring { display:flex; justify-content:center; padding:2px 0; }
.quiz__foot { display:flex; justify-content:center; gap:6px; font-size:11px; color:var(--ink-soft); }
.quiz__progress { height:6px; border-radius:999px; background:#eef1f6; overflow:hidden; }
.quiz__progress i { display:block; height:100%; background:var(--gold); }

/* ---------- 品牌图标 ---------- */
.brand__icon { width:30px; height:30px; border-radius:8px; display:block; }

/* ---------- 版本更新提示条 ---------- */
.update-banner { position:fixed; top:0; left:0; right:0; z-index:60; display:flex; align-items:center; gap:10px; padding:10px 16px; background:#4f6bff; color:#fff; font-size:14px; box-shadow:0 4px 16px rgba(52,84,209,.3); }
.update-banner[hidden] { display:none; }
.update-banner__dot { width:8px; height:8px; border-radius:50%; background:#fff; flex-shrink:0; }
.update-banner__text { flex:1; }
.update-banner__link { color:#fff; font-weight:700; text-decoration:underline; }
.update-banner__close { background:transparent; border:none; color:#fff; font-size:18px; line-height:1; cursor:pointer; padding:0 4px; }

/* ---------- 通用区块 ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 40px);
}
.section--alt {
  max-width: none;
  background: var(--paper-2);
}
.section--alt > * { width: 100%; max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section__head { text-align: center; margin-bottom: 48px; }
.section__head h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -.5px;
}
.section__head p { color: var(--ink-soft); margin-top: 12px; font-size: 16px; }

/* ---------- 功能卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  width: 100%;
  justify-items: stretch;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border-radius: 14px;
  margin-bottom: 16px;
}
.card__icon svg, .dl__icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 14.5px; }

/* ---------- 下载卡片 ---------- */
.downloads {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  width: 100%;
  justify-items: stretch;
}
.dl {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.dl__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.dl__icon {
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark); background: var(--gold-soft); border-radius: 14px;
  flex-shrink: 0;
}
.dl__head h3 { font-size: 20px; }
.dl__meta { font-size: 13px; color: var(--ink-soft); }
.dl__desc { color: var(--ink-soft); font-size: 14.5px; flex: 1; margin-bottom: 18px; }
.dl__row { display: flex; gap: 12px; }
.dl__row .btn { flex: 1; }
.downloads__hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 28px;
}
.downloads__hint code {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}

/* ---------- 网页版 ---------- */
.web {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.web__text h2 { font-size: clamp(24px, 3.5vw, 34px); font-weight: 800; }
.web__text p { color: var(--ink-soft); margin: 16px 0 20px; font-size: 16px; }
.web__list { list-style: none; margin-bottom: 26px; display: flex; flex-direction: column; gap: 10px; }
.web__list li { color: var(--ink); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.web__list .check { color: var(--gold-dark); display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.web__list .check svg { width: 100%; height: 100%; }
.web__card { display: flex; justify-content: center; }
.web__window {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.web__bar {
  height: 38px;
  background: var(--paper-2);
  display: flex; align-items: center; gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.web__bar span { width: 11px; height: 11px; border-radius: 50%; background: #d5dcef; }
.web__bar span:nth-child(1) { background: #ffb3a1; }
.web__bar span:nth-child(2) { background: #ffe08a; }
.web__bar span:nth-child(3) { background: #a8e6a3; }
/* 网页版界面预览（纯 CSS 绘制，避免内嵌 iframe 的布局错位） */
.web__shot { padding: 16px 18px 20px; background: var(--paper); font-family: inherit; }
.web__shot .shot__hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.web__shot .shot__type { font-size: 12px; color: var(--gold); font-weight: 700; }
.web__shot .shot__stat { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.web__shot .shot__timer { font-size: 11px; color: var(--ink-soft); margin-bottom: 14px; }
.web__shot .shot__q { font-size: 34px; font-weight: 800; color: var(--ink); text-align: center; letter-spacing: 1px; margin: 8px 0 16px; }
.web__shot .shot__ans { height: 42px; border: 2px solid var(--gold); border-radius: 12px; display: flex; align-items: center; padding: 0 14px; color: #aab2c0; font-size: 15px; margin-bottom: 14px; background: #fff; }
.web__shot .shot__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.web__shot .shot__pad i { display: flex; align-items: center; justify-content: center; height: 40px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-style: normal; font-size: 17px; font-weight: 700; color: var(--ink); }
.web__shot .shot__pad i.sm { color: var(--gold); font-size: 15px; }
.web__shot .shot__btn { height: 44px; border-radius: 12px; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; box-shadow: 0 6px 14px rgba(79,107,255,.28); }

/* ---------- 常见问题 ---------- */
.faq { display: flex; flex-direction: column; gap: 14px; }
.faq__item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 22px;
  box-shadow: var(--shadow);
}
.faq__item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  outline: none;
}
.faq__item summary:focus-visible {
  border-radius: 8px;
  box-shadow: 0 0 0 2px var(--gold);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--gold-dark);
  transition: transform .2s;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { color: var(--ink-soft); padding: 0 0 18px; font-size: 14.5px; }
.faq__a {
  overflow: hidden;
  height: 0;
  transition: height .3s ease;
}
.faq__item[open] .faq__a { height: auto; }

/* ---------- 页脚 ---------- */
.footer {
  background: #141a2e;
  color: #ffffff;
  padding: 48px clamp(16px, 4vw, 40px) 28px;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand img { width: 40px; height: 40px; border-radius: 10px; }
.footer__brand strong { color: #fff; font-size: 18px; display: block; }
.footer__brand p { font-size: 13px; }
.footer__nav { display: flex; gap: 22px; font-size: 14px; }
.footer__nav a { color: #ffffff; transition: color .18s; }
.footer__nav a:hover { color: var(--gold); }
.footer__copy {
  max-width: var(--maxw);
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  text-align: center;
  color: #ffffff;
}

/* ---------- 软件介绍 导航下拉 ---------- */
.nav__dropdown { position: relative; }
.nav__dropdown-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  color: var(--ink-soft); font-weight: 500; font-size: 15px;
  display: flex; align-items: center; gap: 4px; padding: 0;
  transition: color .18s;
}
.nav__dropdown-btn:hover,
.nav__dropdown:hover .nav__dropdown-btn { color: var(--gold-dark); }
.nav__dropdown-btn .caret { font-size: 11px; transition: transform .35s cubic-bezier(.4,0,.2,1); }
.nav__dropdown.open .nav__dropdown-btn .caret { transform: rotate(180deg); }
.nav__dropdown-panel {
  position: absolute; top: calc(100% + 14px); left: 50%;
  transform: translateX(-50%) translateY(10px) scale(.96);
  transform-origin: top center;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 8px; display: flex; flex-direction: column;
  min-width: 184px; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .26s cubic-bezier(.22,1,.36,1), transform .26s cubic-bezier(.22,1,.36,1), visibility 0s linear .26s;
  z-index: 120;
}
.nav__dropdown.open .nav__dropdown-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity .26s cubic-bezier(.22,1,.36,1), transform .26s cubic-bezier(.22,1,.36,1), visibility 0s;
}
.nav__dropdown-panel a {
  padding: 10px 14px; border-radius: 9px; color: var(--ink);
  font-size: 14.5px; white-space: nowrap; transition: background .2s ease, color .2s ease;
}
.nav__dropdown-panel a:hover { background: var(--gold-soft); color: var(--gold-dark); }

/* ---------- 软件介绍 区块 ---------- */
.intro { display: grid; grid-template-columns: 232px 1fr; gap: 40px; align-items: start; }
.intro__menu {
  position: sticky; top: 90px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.intro__menu a {
  padding: 12px 14px; border-radius: 10px; color: var(--ink);
  font-weight: 600; font-size: 15px; transition: background .15s, color .15s;
}
.intro__menu a.active { background: var(--gold-soft); color: var(--gold-dark); }
/* 仅在支持悬停的设备（鼠标）上应用 hover，避免触屏点按后高亮残留与 active 混淆 */
@media (hover: hover) {
  .intro__menu a:hover { background: var(--gold-soft); color: var(--gold-dark); }
}
.intro__body { display: flex; flex-direction: column; gap: 22px; }
.intro__chapter {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px;
  box-shadow: var(--shadow); scroll-margin-top: 92px;
}
.intro__chapter h3 {
  font-size: 22px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.intro__chapter h3 .num {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px;
  background: var(--gold-soft); color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.intro__chapter p { color: var(--ink-soft); font-size: 15px; margin-bottom: 10px; }
.intro__chapter p:last-child { margin-bottom: 0; }

/* ============================================================
   响应式：平板与手机
   断点 600px（窄屏 / 手机），601–1024px（平板）
   ============================================================ */

/* 平板：单列或两列自适应收缩 */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 36px; }
  .hero__art { order: -1; }
  .phone { transform: rotate(0); width: 230px; height: 478px; padding: 30px 10px 10px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .web { grid-template-columns: 1fr; gap: 32px; }
  .web__card { order: -1; }
}

/* 手机：纯窄屏布局 */
@media (max-width: 600px) {
  .nav__links {
    position: absolute;
    top: calc(100% + 1px); left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, .99);
    backdrop-filter: blur(12px);
    border-radius: 0 0 16px 16px;
    border-bottom: 1px solid var(--line);
    padding: 6px 0 12px;
    margin-left: 0;
    margin-right: 0;
    transform: translateY(-150%);
    transition: transform .28s ease, opacity .28s ease;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    z-index: 4;
    opacity: 0;
  }
  .nav__links.open { transform: translateY(0); opacity: 1; }
  .nav__links a { padding: 14px clamp(16px, 4vw, 40px); }
  .nav__links a:hover { background: var(--gold-soft); }
  .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  /* 移动端：三条线弹窗作为顶部栏正下方的一级下拉面板 */
  .nav__dropdown { width: 100%; }
  .nav__dropdown-btn {
    width: 100%; justify-content: space-between;
    padding: 14px clamp(16px, 4vw, 40px); color: var(--ink-soft);
    border-radius: 0;
  }
  .nav__dropdown-panel {
    position: static; transform: none; left: auto; min-width: auto;
    box-shadow: none; border: none; background: var(--paper-2);
    border-radius: 0; opacity: 0; visibility: visible; pointer-events: auto;
    display: flex; max-height: 0; padding: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.4,0,.2,1), opacity .35s cubic-bezier(.4,0,.2,1);
  }
  .nav__dropdown.open .nav__dropdown-panel { max-height: 260px; opacity: 1; transform: none; }
  .nav__dropdown-panel a { padding: 12px clamp(16px, 4vw, 40px) 12px 48px; }

  .intro { grid-template-columns: 1fr; gap: 22px; }
  .intro__menu { position: static; flex-direction: row; flex-wrap: wrap; }
  .intro__menu a { flex: 1 1 auto; text-align: center; }

  .hero__stats { gap: 24px; }
  .hero__stats strong { font-size: 22px; }

  .grid { grid-template-columns: 1fr; }
  .downloads { grid-template-columns: 1fr; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__nav { flex-wrap: wrap; }
}

/* 减少动画偏好：关闭过渡和动画 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 桌面大屏时隐藏移动菜单按钮 */
@media (min-width: 601px) {
  .nav__toggle { display: none; }
  .nav__cta { display: inline-flex; }
}

/* ============================================================
   暗色模式：跟随系统配色（prefers-color-scheme: dark）
   覆盖色彩变量；导航栏等少量硬编码浅色背景单独修正，
   避免浏览器强制反色造成颜色错乱。
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --gold: #4f6bff;
    --gold-dark: #8fa2ff;
    --gold-soft: #1a2244;
    --ink: #e8ecf8;
    --ink-soft: #9aa3c7;
    --paper: #0e1322;
    --paper-2: #141a2e;
    --line: #243049;
    --white: #161d33;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  }
  html { color-scheme: dark; }
  .nav { background: rgba(22, 20, 15, .82); border-bottom-color: var(--line); }
}
@media (prefers-color-scheme: dark) and (max-width: 600px) {
  .nav__links { background: rgba(22, 20, 15, .99); }
}

/* ============================================================
   Windows 下载前置弹窗
   ============================================================ */
.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dl-modal.is-open { display: flex; }
.dl-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 26, 46, .5);
  backdrop-filter: blur(3px);
}
.dl-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px 24px;
  animation: dlPop .24s cubic-bezier(.22, 1, .36, 1);
}
@keyframes dlPop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.dl-modal__title { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.dl-modal__hint {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.dl-modal__hint b { color: var(--ink); }
.dl-modal__webview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid var(--line);
  margin-bottom: 22px;
  transition: background .18s, color .18s;
}
.dl-modal__webview:hover { background: var(--gold); color: #ffffff; }
/* 下半部分：取消占 1/3，下载占 2/3 */
.dl-modal__actions { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.dl-modal__btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 18px;
  border-radius: 12px;
  text-align: center;
  transition: transform .15s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.dl-modal__btn:active { transform: translateY(1px); }
.dl-modal__btn--cancel {
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.dl-modal__btn--cancel:hover { color: var(--ink); border-color: var(--ink-soft); }
.dl-modal__btn--download {
  background: var(--gold);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(79, 107, 255, .35);
}
.dl-modal__btn--download:hover:not(:disabled) {
  background: var(--gold-dark);
  box-shadow: 0 10px 26px rgba(52, 84, 209, .4);
}
.dl-modal__btn--download:disabled { opacity: .55; cursor: not-allowed; }
.dl-modal__btn--done {
  width: 100%;
  background: var(--gold);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(79, 107, 255, .35);
  font-size: 16px;
  padding: 15px 18px;
}
.dl-modal__btn--done:hover { background: var(--gold-dark); }
.dl-modal__btn[hidden], .dl-modal__actions[hidden] { display: none !important; }
