/* ============================================================
   Andy 学习乐园 · 官网样式
   设计基调：与 Andy 学习乐园系统风格一致
   配色：app 真实色板（#FF7A33→#FF9A4D 主渐变 / 米色背景 / 暖橙辅色 / 紫蓝绿点缀）
   参考：app colors.xml + parent.html 内联样式
   ============================================================ */

:root {
  /* ---- Andy 真实色板 ---- */
  --brand-coral: #FF7A33;          /* 主品牌 红粉 */
  --brand-orange: #FF9A4D;         /* 主品牌 暖橙（同 app launcher bg） */
  --brand-grad: linear-gradient(135deg, #FF9A4D 0%, #FF7A33 55%, #FF5C8A 100%);
  --brand-grad-hover: linear-gradient(135deg, #FFB36B 0%, #FF8A4D 100%);

  --ink: #3A2E3A;                  /* 系统正文色 */
  --muted: #8A7B8A;                /* 系统副文字色 */
  --bg-cream: #FFF9F0;             /* 系统暖米背景 */
  --bg-soft: #FFF3E0;              /* 略深的米色（斑马纹 section） */
  --card: #ffffff;
  --line: #F3E8DE;                 /* 系统描边色 */

  --accent-blue: #4DABF7;          /* 蓝 */
  --accent-purple: #B197FC;        /* 紫 */
  --accent-green: #51CF66;         /* 绿 */
  --accent-green-2: #8CE99A;
  --accent-yellow: #FFE066;        /* 黄（与 app icon 黄点同色） */
  --accent-gold: #FFD43B;          /* 金黄（数据条） */
  --accent-pink: #FFF3BF;          /* 米黄（hover 高亮） */

  /* 顶部标题彩虹（同 parent.html .hd h1） */
  --title-rainbow: linear-gradient(90deg, #FFC83D, #FF9A4D, #FF7A33, #FF5C8A);
  /* 图标彩虹（图标底色由黄改彩虹，活泼统一） */
  --rainbow: linear-gradient(135deg, #FFC83D 0%, #FF9A4D 28%, #FF7A33 55%, #FF5C8A 80%, #635BFF 100%);
  --data-bar: linear-gradient(90deg, #FF7A33, #FFC83D, #51CF66);

  /* 阴影（与 parent.html box-shadow 同方向同色温） */
  --shadow: 0 6px 20px rgba(180, 120, 80, 0.10);
  --shadow-lg: 0 18px 48px rgba(180, 120, 80, 0.18);

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Hiragino Sans GB", "Segoe UI", Roboto, system-ui, sans-serif;

  --hero-z: 10;  /* 让 hero 区域浮在所有 section 之上，避免 app-pop 被遮挡 */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 800; color: var(--ink); }
p { margin: 0 0 1em; }
small { color: var(--muted); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.container.narrow { max-width: 860px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hl { background: var(--title-rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; border: 1.5px solid transparent;
  font-size: 16px; font-weight: 800; cursor: pointer; font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
  letter-spacing: .3px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 10px 22px rgba(255,122,51,.30); }
.btn-primary:hover { background: var(--brand-grad-hover); }
.btn-gold { background: linear-gradient(135deg, #FFD43B, #FF9A4D); color: #5a3500; box-shadow: 0 10px 22px rgba(255,176,32,.30); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: var(--brand-orange); color: var(--brand-coral); }
.btn-ghost.light { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.12); }
.btn-mini { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--brand-coral); font-weight: 800; cursor: pointer; font-family: inherit; font-size: 15px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 249, 240, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-orange); color: #fff; font-weight: 900; font-size: 0;
  background-image: url("../assets/logo-192.png");
  background-size: 38px 38px; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 4px 10px rgba(255,154,77,.35);
  flex-shrink: 0;
}
.brand-name {
  font-size: 17px; letter-spacing: .3px;
  background: var(--title-rainbow); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 700; color: var(--ink); padding: 9px 16px; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255, 169, 77, .14); color: var(--brand-coral); }
.nav-support { background: linear-gradient(135deg, #FFF3BF, #FFE066); color: #8a5a00; }
.nav-support:hover { background: linear-gradient(135deg, #FFE066, #FFD43B); color: #6b4500; }

/* ---------- Hero ---------- */
.hero { position: relative; z-index: var(--hero-z); overflow: visible; padding: 76px 0 102px; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(900px 460px at 78% -8%, rgba(255, 169, 77, .35), transparent 60%),
    radial-gradient(700px 380px at 6% 14%, rgba(255, 107, 107, .22), transparent 55%),
    radial-gradient(900px 500px at 50% 100%, rgba(77, 171, 247, .10), transparent 60%),
    linear-gradient(180deg, #FFFBF3 0%, var(--bg-cream) 100%);
}
.hero-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 800;
  background: linear-gradient(135deg, #FFF3BF, #FFE066);
  color: #8a5a00; margin-bottom: 22px;
  box-shadow: 0 4px 12px rgba(255,212,59,.30);
}
.pill::before { content: "🎁"; }
.hero-title { font-size: clamp(40px, 7.5vw, 72px); letter-spacing: -1.2px; margin: 0 0 18px; }
.hero-title .hl { background: var(--title-rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(16px, 2.4vw, 20px); color: var(--muted); margin: 0 auto 34px; max-width: 720px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* App 下载：套上更高 z-index + 调整弹层定位（解决被下面 section 遮挡） */
.app-popwrap { position: relative; display: inline-block; z-index: 70; }
.app-icon { display: inline-flex; align-items: center; gap: 8px; }
.app-glyph {
  width: 18px; height: 18px; display: inline-block;
  background-image: url("../assets/logo-192.png");
  background-size: 18px 18px; background-position: center; background-repeat: no-repeat;
  vertical-align: middle;
}
.app-btn-text { display: inline-flex; flex-direction: column; line-height: 1.15; text-align: left; gap: 1px; }
.app-btn-text strong { font-size: 14px; font-weight: 800; color: inherit; }
.app-btn-text small { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.2px; }
.app-pop {
  position: absolute; top: calc(100% + 14px); right: 0; width: 560px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px; text-align: center; z-index: 80;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease;
}
.app-popwrap.open .app-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.app-pop::before { content: ""; position: absolute; top: -8px; right: 30px; width: 14px; height: 14px; background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }

.app-pop-head { font-weight: 800; margin-bottom: 10px; color: var(--ink); }
.app-pop-qr { width: 168px; height: 168px; margin: 0 auto 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.app-pop-dev { font-size: 13px; color: var(--muted); margin: 0 0 8px; line-height: 1.55; }
.app-pop-friendly { font-size: 12px; color: var(--brand-coral); margin: 0 0 12px; font-weight: 600; }
.hero-app-note { text-align: center; font-size: 13px; color: var(--brand-coral); font-weight: 600; margin: 16px auto 0; max-width: 520px; line-height: 1.6; }
.app-pop-tip { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* 安卓 / 鸿蒙 双卡片横排、等高 */
.app-pop-cards { display: flex; gap: 12px; margin-top: 14px; align-items: stretch; }
.os-card {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  border-radius: var(--radius); padding: 16px 14px; text-align: center;
}
.os-card-head { font-weight: 800; font-size: 15px; margin-bottom: 10px; color: var(--ink); }
.os-card .app-pop-dev { margin: 0 0 8px; }
.os-card .app-pop-soon { margin: 0 0 8px; text-align: center; }
.os-card .app-pop-code { margin: 0 0 4px; }
.os-card .btn-mini { margin-top: 0; }
.os-card .card-spacer { flex: 1 1 auto; min-height: 0; } /* 弹性间距：吸收两卡内容高度差，保证按钮在同一条水平线上 */
.os-card .app-pop-tip { margin-top: 10px; }

/* 安卓卡：浅底 + 细边 */
.android-card { background: #fbfbfd; border: 1px solid var(--line); }
.android-card .os-card-head { color: var(--ink); }
.android-card .app-pop-dev { color: var(--muted); }
.android-card .app-pop-code { color: var(--muted); }
.android-card .code-hint { color: #adb5bd; }
.android-card .btn-mini { background: var(--brand-coral); color: #fff; border-color: transparent; box-shadow: none; }
.android-card .btn-mini:hover { background: #FFB36B; transform: translateY(-2px); }

/* 鸿蒙卡：青色底以区分 */
.harmony-card { background: linear-gradient(135deg,#e9f7f9,#d2eef2); border: 1px solid #93d6df; }
.harmony-card .os-card-head { color: #0a6b78; }
.harmony-card .app-pop-dev { color: #356b72; }
.harmony-card .app-pop-code { color: #2f5b61; }
.harmony-card .code-hint { color: #6b8a8f; }
.harmony-card .soon-tag { display:inline-block; margin-top:5px; font-size:12px; font-weight:700; color:#0a6b78; background:#bfeaf0; border-radius:999px; padding:2px 10px; }
.harmony-card .btn-mini { background:#0a8a99; color:#fff; border-color:transparent; box-shadow:none; }
.harmony-card .btn-mini:hover { background:#0a6b78; transform:translateY(-2px); }

/* 窄屏：双卡竖排，弹层收窄避免溢出 */
@media (max-width: 620px) {
  .app-pop { width: 300px; }
  .app-pop-cards { flex-direction: column; }
}

/* ---------- 区块通用 ---------- */
.section { position: relative; z-index: 1; padding: 72px 0; overflow: hidden; }
.section-soft { background: var(--bg-soft); }

/* ---------- 形状水印（星星 / 圆 / 六边形 / 三角 / 四角星 / 圆环，活泼点缀） ---------- */
.wm { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.section > .container, .cta-section > .container { position: relative; z-index: 1; }
.hero .wm { z-index: 1; }
.hero-inner { z-index: 2; }
.login-wrap { position: relative; }
.login-card { position: relative; z-index: 1; }

.wm-shape {
  position: absolute; transform: translate(-50%, -50%);
  animation: wmFloat linear infinite; will-change: transform;
}
@keyframes wmFloat {
  0%   { transform: translate(-50%, -50%); }
  50%  { transform: translate(-50%, calc(-50% - 16px)); }
  100% { transform: translate(-50%, -50%); }
}
.wm-star  { background: var(--c); clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%); }
.wm-circle{ background: var(--c); border-radius: 50%; }
.wm-ring  { background: transparent; border: 3px solid var(--c); border-radius: 50%; }
.wm-hex   { background: var(--c); clip-path: polygon(25% 5%,75% 5%,100% 50%,75% 95%,25% 95%,0% 50%); }
.wm-tri   { background: var(--c); clip-path: polygon(50% 0%,100% 100%,0% 100%); }
.wm-spark { background: var(--c); clip-path: polygon(50% 0%,58% 42%,100% 50%,58% 58%,50% 100%,42% 58%,0% 50%,42% 42%); }
@media (prefers-reduced-motion: reduce) { .wm-shape { animation: none !important; } }
@media (max-width: 540px) { .wm-shape { animation: none !important; } }
.section-title { font-size: clamp(26px, 4vw, 38px); text-align: center; margin-bottom: 12px; letter-spacing: -.5px; }
.section-kicker { display: block; text-align: center; color: var(--brand-coral); font-size: 13px; font-weight: 800; letter-spacing: 1.5px; margin-bottom: 8px; }
.lead { font-size: 18px; line-height: 1.9; }
.lead.center { text-align: center; }

/* 信 / 故事卡 */
.letter-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 44px 40px; box-shadow: var(--shadow); position: relative;
}
.quote-mark { position: absolute; top: 12px; left: 28px; font-size: 86px; color: var(--brand-coral); opacity: .14; font-family: Georgia, serif; line-height: 1; }
.letter-card p { color: var(--ink); }

/* ===== 信纸样式（横线笔记本 + 红色左边竖线 + 米色纸底） ===== */
.paper-style {
  position: relative;
  background-color: #FFFCF5;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 30px,
      rgba(170, 120, 80, .18) 30px,
      rgba(170, 120, 80, .18) 31px
    );
  border: 1px solid rgba(170, 120, 80, .22);
  box-shadow:
    0 8px 22px rgba(170, 120, 80, .12),
    inset 0 0 0 1px rgba(255, 255, 255, .55);
}
/* 红色左边竖线：用 ::before 绝对定位，不依赖 gradient 层级 */
.paper-style::before {
  content: "";
  position: absolute;
  top: 14px; bottom: 14px; left: 22px;
  width: 0;
  border-left: 3px solid rgba(210, 70, 70, .55);
  pointer-events: none;
}
.paper-style > * { position: relative; }   /* 内容浮在竖线之上 */

.paper-style p {
  line-height: 31px;
  margin: 0;
  color: var(--ink);
}
.paper-style p + p {
  margin-top: 31px;
}
.paper-style p:last-child { margin-bottom: 0; }

/* section 的 letter-card 加信纸样式 */
.letter-card.paper-style {
  padding: 36px 40px 40px 64px;
  border-radius: var(--radius-lg);
}
.letter-card.paper-style .quote-mark { display: none; }
.letter-card.paper-style .section-title {
  text-align: left;
  margin: 0 0 18px;
  font-size: 26px;
}

/* modal 里的 letter 区域加信纸样式 */
.modal-box .letter.paper-style {
  padding: 26px 22px 28px 44px;
  border-radius: 16px;
  margin-top: 6px;
  font-size: 15px;
}
.modal-box .letter.paper-style p { line-height: 32px; }
.modal-box .letter.paper-style p + p { margin-top: 32px; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-orange); }
.card.tall { min-height: 100%; }
.card-ico {
  display: block; text-align: center; line-height: 1;
  font-size: 46px; margin-bottom: 12px;
}
.h-ico {
  display: block; text-align: center; line-height: 1;
  font-size: 44px; margin: 0 0 8px;
}
.card h3 { font-size: 19px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }

/* 对比 */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 860px; margin: 0 auto; }
.compare-col { border-radius: var(--radius); padding: 28px; }
.compare-old { background: #fff; border: 1.5px dashed var(--line); }
.compare-new {
  background: linear-gradient(135deg, rgba(255,122,51,.08), rgba(255,154,77,.10));
  border: 1.5px solid var(--brand-orange);
  box-shadow: 0 10px 24px rgba(255,154,77,.15);
}
.compare-col h3 { text-align: center; }
.compare-col ul { margin: 0; padding-left: 20px; }
.compare-col li { margin: 12px 0; color: var(--ink); }
.compare-new li::marker { color: var(--brand-coral); }

/* 理念 / 安全 立柱 */
.pillar {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 28px 22px; text-align: center; box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.pillar:hover { transform: translateY(-4px); border-color: var(--brand-orange); }
.pillar-ico {
  display: block; text-align: center; line-height: 1;
  font-size: 44px; margin: 0 0 10px;
}
.pillar h3 { font-size: 18px; margin-bottom: 6px; }
.pillar p { color: var(--muted); font-size: 14px; margin: 0; }

/* 学习闭环 steps */
.steps { list-style: none; margin: 0 auto 22px; padding: 0; max-width: 920px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.steps li {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; box-shadow: var(--shadow); position: relative;
}
.steps li::after { content: "→"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--brand-coral); font-weight: 900; }
.steps li:last-child::after { content: ""; }
.step-n {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--brand-grad); color: #fff; font-weight: 900; margin-bottom: 10px;
  box-shadow: 0 6px 14px rgba(255,122,51,.30);
}
.steps h4 { font-size: 16px; margin: 4px 0; }
.steps p { font-size: 13px; color: var(--muted); margin: 0; }

/* 学科总览（8 张：4 × 2，桌面端用 auto-fit 让两行对齐） */
.subjects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
}
.subject {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 24px 18px; text-align: center; box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.subject:hover { transform: translateY(-3px); border-color: var(--brand-orange); }
.s-ico {
  display: block; text-align: center; line-height: 1;
  font-size: 42px; margin: 0 0 10px;
}
.subject b { display: block; font-size: 17px; margin-bottom: 4px; }
.subject small { display: block; margin-top: 4px; line-height: 1.5; }

/* 星星挑战（6 张 → 3×2 整齐） */
.challenge h3 { font-size: 17px; }
.challenge p { font-size: 13px; }
.challenge .card-ico { display: block; text-align: center; line-height: 1; font-size: 44px; margin-bottom: 12px; }

/* 星星银行 */
.reward { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.r-emoji {
  display: block; text-align: center; line-height: 1;
  font-size: 44px; margin-bottom: 4px;
}
.reward b { font-size: 16px; margin-top: 4px; }
.r-cost {
  color: #5a3500; font-weight: 800;
  background: linear-gradient(135deg, #FFF3BF, #FFE066);
  padding: 4px 14px; border-radius: 999px; font-size: 14px;
}

/* 清单 */
.checklist { list-style: none; padding: 0; margin: 0 auto; max-width: 580px; }
.checklist li { padding: 14px 0 14px 40px; border-bottom: 1px dashed var(--line); position: relative; color: var(--ink); }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  color: #fff; background: var(--brand-grad);
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 900;
  box-shadow: 0 4px 10px rgba(255,122,51,.30);
}
.checklist b { color: var(--brand-coral); }

/* ---------- 收尾 CTA ---------- */
.cta-section {
  background: var(--brand-grad); color: #fff;
}
.cta-card {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-lg); padding: 48px 36px; backdrop-filter: blur(6px);
}
.cta-card .section-title, .cta-card .lead { color: #fff; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 26px 0 30px; }

/* 二维码组 */
.qr-row { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.qr-fig { margin: 0; text-align: center; }
.qr-fig img {
  width: 156px; height: 156px; border-radius: 16px;
  background: #fff; border: 5px solid #fff;
  box-shadow: 0 10px 28px rgba(180, 80, 0, .18);
  object-fit: contain;
}
.qr-fig figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.cta-card .qr-fig figcaption { color: rgba(255,255,255,.92); }

/* 咖啡 / 打赏块 */
.coffee { margin-top: 22px; text-align: center; }
.coffee-line { font-weight: 800; font-size: 17px; margin-bottom: 16px; color: var(--brand-coral); }
.cta-card .coffee-line { color: #fff; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(58, 46, 58, .55); backdrop-filter: blur(4px); }
.modal-box {
  position: relative; z-index: 1; background: #fff; border-radius: var(--radius-lg);
  padding: 34px 30px; max-width: 720px; width: 100%; max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.modal-x {
  position: absolute; top: 14px; right: 16px; width: 36px; height: 36px;
  border: none; background: var(--bg-soft); border-radius: 50%;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
  font-weight: 800;
}
.modal-x:hover { background: var(--line); color: var(--brand-coral); }
.modal-title { text-align: center; font-size: 24px; }
.modal-sub { text-align: center; color: var(--muted); margin: -6px 0 18px; font-size: 14px; }
.letter { font-size: 15px; color: var(--ink); line-height: 1.85; }
.letter p { margin: 0 0 12px; }

/* App 下载弹窗按钮 */
.btn-apk {
  width: 100%; justify-content: center;
  background: linear-gradient(135deg, #ff6b6b, #ff5e7a);
  color: #fff; box-shadow: 0 8px 20px rgba(255,94,122,.25);
}
.btn-apk:hover { box-shadow: 0 12px 26px rgba(255,94,122,.35); }
.btn-harmony {
  width: 100%; justify-content: center;
  background: #0a9bad; color: #fff;
  opacity: .55; cursor: not-allowed;
}

/* App 下载双栏 */
.app-box { max-width: 720px; padding: 28px; }
.app-download {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.app-col {
  border-radius: var(--radius); padding: 22px 18px; text-align: center;
  border: 1.5px solid var(--line); background: #fff;
}
.app-col.android { background: linear-gradient(160deg, #fff, #fff8f5); border-color: #ffd9d2; }
.app-col.harmony { background: linear-gradient(160deg, #e8f8f9, #f2fdfe); border-color: #c2ebed; }
.app-col-head {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; margin-bottom: 14px;
}
.os-icon { font-size: 22px; }
.app-qr {
  width: 150px; height: 150px; margin: 0 auto 14px; border-radius: 14px;
  background: #fff; padding: 6px; border: 1px solid var(--line);
}
.app-version,
.app-status {
  font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.55;
}
.app-version b { color: var(--brand-coral); }
.app-status { display: inline-block; background: rgba(10,155,173,.12); color: #0a9bad; padding: 4px 10px; border-radius: 999px; }
.app-hint { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

.harmony-badge {
  width: 150px; height: 150px; margin: 0 auto 14px; border-radius: 18px;
  background: rgba(255,255,255,.65); border: 1px solid rgba(10,155,173,.18);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
}
.harmony-badge svg { width: 64px; height: 64px; }
.harmony-badge span { font-weight: 800; color: #0a9bad; font-size: 16px; }
.harmony-badge small { color: #0a9bad; opacity: .75; font-size: 13px; }

@media (max-width: 640px) {
  .app-download { grid-template-columns: 1fr; }
  .app-box { padding: 22px 18px; }
}

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; font-weight: 700; color: var(--ink); }
.field input {
  padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 16px;
  font-family: inherit; background: #fffbef; transition: border .15s ease, box-shadow .15s ease;
}
.field input:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(255,154,77,.18); background: #fff; }
.form-err { color: #c92a2a; background: #ffe3e3; border: 1px solid #ffc9c9; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }

/* ---------- 登录页 ---------- */
.page-login {
  background:
    radial-gradient(800px 400px at 80% -10%, rgba(255,154,77,.20), transparent 60%),
    radial-gradient(700px 380px at 0% 14%, rgba(255,122,51,.14), transparent 55%),
    var(--bg-cream);
  min-height: 100dvh; display: flex; flex-direction: column;
}
.login-wrap { flex: 1; display: grid; place-items: center; padding: 40px 18px; }
.login-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 40px 34px; width: 100%; max-width: 420px;
}
.login-title {
  text-align: center; font-size: 28px; margin-bottom: 6px;
  background: var(--title-rainbow); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-hint {
  text-align: center; color: #8a5a00; font-weight: 700;
  background: linear-gradient(135deg, #FFF3BF, #FFE066);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 22px;
  box-shadow: 0 4px 10px rgba(255,212,59,.18);
}
.login-foot { text-align: center; margin-top: 20px; font-size: 15px; color: var(--muted); }
.ok-badge {
  font-size: 60px; text-align: center; margin-bottom: 8px;
  filter: drop-shadow(0 6px 14px rgba(255,122,51,.30));
}

/* ---------- 页脚 ---------- */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.footer .muted { color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li::after { content: ""; }
}
@media (max-width: 820px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .compare { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .subjects { grid-template-columns: repeat(2, 1fr); }  /* 学科 8 张 → 2 列小屏自动成 4+4 */
}
@media (max-width: 540px) {
  .subjects { grid-template-columns: 1fr; }              /* 更窄就竖排 */
}
@media (max-width: 620px) {
  .section { padding: 54px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .brand-name { display: none; }
  .nav-link { padding: 8px 12px; font-size: 14px; }
  .hero { padding: 54px 0 72px; }
  .letter-card { padding: 32px 22px; }
  .qr-fig img { width: 132px; height: 132px; }
  .app-pop { right: auto; left: 50%; transform: translateX(-50%) translateY(-6px); }
  .app-popwrap.open .app-pop { transform: translateX(-50%) translateY(0); }
  .app-pop::before { right: auto; left: 50%; margin-left: -7px; }
}
@media (max-width: 380px) {
  .qr-row { gap: 14px; }
}

/* 焦点可见性（无障碍） */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(255, 169, 77, .5); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; transition: none !important; } }

/* ===== 滑动验证 ===== */
.slider {
  position: relative; height: 44px; border-radius: 12px;
  background: #f1e9e0; border: 1.5px solid var(--line, #F3E8DE);
  overflow: hidden; user-select: none; touch-action: none; margin: 4px 0 2px;
}
.slider-bar {
  position: absolute; top: 0; left: 0; height: 100%; width: 0;
  background: linear-gradient(135deg, #FF9A4D, #FF7A33); opacity: .35;
}
.slider-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #8A7B8A; pointer-events: none;
}
.slider-btn {
  position: absolute; top: 2px; left: 2px; width: 40px; height: 36px;
  background: #fff; border-radius: 10px; display: grid; place-items: center;
  font-size: 20px; color: var(--brand-coral, #FF7A33); cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); touch-action: none;
}
.slider-btn:active { cursor: grabbing; }
.ok-validity {
  text-align: center; font-size: 14px; color: #2B8A3E; font-weight: 700; margin: 2px 0 12px;
}
