/* ==========================================================================
   3e大学助手 · 官网
   色板与网页端完全一致（同一套 --primary/--surface/--border），
   免得"官网和产品看起来不像一家人"。
   ========================================================================== */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f4f4f1;
  --text: #1f2023;
  --muted: #6b6c70;
  --border: #e2e2de;
  --primary: #185fa5;
  --primary-fg: #ffffff;
  --primary-soft: #e6f1fb;
  --teal: #0f6e56;
  --warn: #8a5a00;
  --warn-soft: #fdf3e0;
  --radius: 8px;
  --radius-lg: 14px;
  --wrap: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1e1f23;
    --surface-2: #26272c;
    --text: #ececee;
    --muted: #a0a1a6;
    --border: #33343a;
    --primary: #85b7eb;
    --primary-fg: #042c53;
    --primary-soft: #0c447c;
    --teal: #5dcaa5;
    --warn: #e6c07b;
    --warn-soft: #3a2f16;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.3; margin: 0; }

/* ---------- 顶栏 ---------- */

.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 58px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--primary); display: inline-flex; }
.brand-name { font-weight: 600; letter-spacing: .2px; }
.nav-links { display: flex; gap: 20px; font-size: 14px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 { font-size: 42px; letter-spacing: -.5px; }
.hero .tagline {
  margin: 10px 0 0; font-size: 19px; color: var(--primary); font-weight: 500;
}
.hero .lede {
  max-width: 640px; margin: 18px auto 0;
  color: var(--muted); font-size: 16px;
}
.hero .lede strong { color: var(--text); }
.hero-actions {
  margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.hero-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); min-height: 20px; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border-radius: 10px;
  font-size: 15px; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: opacity .15s, background .15s;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; border-radius: 8px; }
.btn[aria-disabled="true"], .btn:disabled {
  opacity: .5; cursor: not-allowed; pointer-events: none;
}

/* ---------- 分区 ---------- */

.section { padding: 56px 0; }
.section-alt { background: var(--surface-2); }
.section h2 { font-size: 26px; }
.section-lede { margin: 8px 0 26px; color: var(--muted); max-width: 640px; }
.fine { margin: 18px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 下载卡片 ---------- */

.dl-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
}
.dl-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
}
.dl-head { display: flex; align-items: flex-start; gap: 11px; }
.dl-icon { font-size: 22px; line-height: 1.2; }
.dl-head h3 { font-size: 17px; }
.dl-note { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.dl-body { flex: 1; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.dl-body .file { color: var(--text); word-break: break-all; }
.dl-foot { margin-top: 14px; }
.dl-foot .btn { width: 100%; }

/* 「暂未上架」不要做成灰色死块 —— 用户会以为按钮点不动是坏了。
   做成一条说明 + 一个仍然可点的次要按钮（去应用商店 / 联系管理员）。 */
.pending {
  background: var(--warn-soft); color: var(--warn);
  border-radius: var(--radius); padding: 8px 10px; font-size: 12.5px;
}

.notice {
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 20px;
  font-size: 14px;
}

/* ---------- 特性 ---------- */

.feat-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.feat h3 { font-size: 16px; margin-bottom: 8px; color: var(--primary); }
.feat p { margin: 0; font-size: 14px; color: var(--muted); }
.feat b { color: var(--text); font-weight: 600; }

/* ---------- 开源 ---------- */

.repo-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; color: var(--text);
}
.repo-card:hover { text-decoration: none; border-color: var(--primary); }
.repo-icon { color: var(--primary); display: inline-flex; flex: none; }
.repo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.repo-text b { font-weight: 600; word-break: break-all; }
.repo-text span { font-size: 13px; color: var(--muted); }
.repo-arrow { margin-left: auto; color: var(--muted); font-size: 18px; flex: none; }

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
}
.footer-inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.footer-name { margin: 0; font-weight: 600; }
.footer-dim { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.footer-links { display: flex; gap: 18px; font-size: 13px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-ver { margin-top: 14px; }

/* 备案号 + 举报邮箱。
   备案号指向工信部备案系统（https://beian.miit.gov.cn/），这是备案规则要求的
   可点击跳转；rel="noopener" 不能省（新窗口 + 外部站点）。
   两段之间用 · 分隔，窄屏换行时靠 flex-wrap 自动折行。 */
.footer-legal {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; color: var(--muted); font-size: 13px;
}
.footer-legal a { color: var(--muted); }
.footer-legal .icp-link { text-decoration: none; }
.footer-legal .icp-link:hover { text-decoration: underline; }
.footer-sep { color: var(--border); }

/* ---------- 隐私政策（privacy.html）---------- */

.doc { padding: 40px 0 64px; }
.doc h1 { font-size: 28px; margin-bottom: 6px; }
.doc .doc-meta { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.doc h2 { font-size: 18px; margin: 30px 0 10px; }
.doc p, .doc li { color: var(--muted); font-size: 15px; }
.doc ul { padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc b { color: var(--text); }
.doc .back { display: inline-block; margin-bottom: 22px; font-size: 14px; }

/* ---------- 窄屏 ----------
   900px 与网页端同一个断点（那边 JS 的 narrowUI() 也是 900），
   三个页面的"窄"必须是同一个定义，否则会出现半套状态。 */

@media (max-width: 900px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 32px; }
  .hero .tagline { font-size: 17px; }
  .section { padding: 40px 0; }
  .section h2 { font-size: 22px; }

  .nav-links { gap: 14px; font-size: 13px; }
  .brand-name { font-size: 15px; }

  /* 触控目标够大：44px 是 iOS/Android 都推荐的最小可点尺寸 */
  .btn { min-height: 46px; }
  .btn-sm { min-height: 42px; }
  .footer-links { gap: 14px; }

  .dl-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .repo-card { padding: 16px; }
}
