/* ============================================================
   CoEditor / 校书郎 — 官网首页样式
   设计语言：纸墨质感 + 朱砂强调（编辑批注隐喻）
   字体分工：标题类（品牌名 / Hero 主标题 / 区块与卡片标题 / 下载页标题）
   统一「瘦高仿宋」——优先自托管不寐仿宋（Insomnia FangSong，
   字形清劲、仿宋_GB2312 风骨），缺字形时回退系统仿宋 / 宋体类；
   正文、说明与 UI 一律用系统默认无衬线（苹方 / 微软雅黑等）；
   拉丁字符与数字走系统字体保证清晰。
   ============================================================ */

/* 自托管不寐仿宋（子集化 woff2，墨豹堂出品，X11 许可含字体嵌入例外，
   许可文本见 assets/fonts/InsomniaFangSong-LICENSE.txt）：
   unicode-range 限定 CJK/中文标点；Book=400 与 Bold=600/700 均用于标题字重，
   正文不使用仿宋。字形覆盖外的汉字回退系统仿宋（华文仿宋/仿宋），再退宋体类兜底 */
@font-face {
  font-family: "Insomnia FangSong";
  src: url("assets/fonts/InsomniaFangSong-Book.woff2?v=7d0d75041e") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+00B7, U+2014-2015, U+2018-201F, U+2190-21FF, U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: "Insomnia FangSong";
  src: url("assets/fonts/InsomniaFangSong-Bold.woff2?v=7d0d75041e") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+00B7, U+2014-2015, U+2018-201F, U+2190-21FF, U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: "Insomnia FangSong";
  src: url("assets/fonts/InsomniaFangSong-Bold.woff2?v=7d0d75041e") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+00B7, U+2014-2015, U+2018-201F, U+2190-21FF, U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}

:root {
  --paper: #faf7f1;
  --paper-deep: #f3eee4;
  --ink: #221f1a;
  --ink-soft: #4d463c;
  --muted: #7d7468;
  --line: #e6ddd0;
  --accent: #a63d2f;
  --accent-soft: #c96a55;
  --dark: #1b1915;
  --dark-line: #332f27;
  --card: #fffdf8;
  /* 标题用瘦高仿宋：自托管不寐仿宋 → 系统华文仿宋 → 仿宋 → 仿宋_GB2312 */
  --fangsong: "Insomnia FangSong", "STFangsong", "FangSong", "仿宋", "仿宋_GB2312";
  --serif: var(--fangsong), "Songti SC", "STSong", "SimSun", "宋体", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --biao: var(--fangsong), "Songti SC", "STSong", "SimSun", "宋体", "STZhongsong", Georgia, serif;
  --radius: 10px;
  --shadow: 0 12px 32px rgba(34, 31, 26, 0.08);
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- 顶部导航 ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 20px rgba(34, 31, 26, 0.05);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  height: 30px;
  width: auto;
  opacity: 0.92;
}

.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

/* 语言切换按钮（显示目标语言：中文界面 → EN，英文界面 → 中文） */
.lang-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1.7;
  transition: color 0.2s, border-color 0.2s;
}
.lang-toggle:hover { color: var(--accent); border-color: var(--accent-soft); }

/* GitHub 链接（导航内，语言切换按钮旁） */
.nav-gh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  margin: 0 -14px;
  transition: color 0.2s, transform 0.2s;
}
.nav-gh svg { width: 18px; height: 18px; display: block; }
.nav-gh:hover { color: var(--accent); transform: translateY(-1px); }

.nav-links a:not(.btn):hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(166, 61, 47, 0.28);
}
.btn-primary:hover { background: #93362a; box-shadow: 0 10px 26px rgba(166, 61, 47, 0.34); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--card); }

.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { box-shadow: var(--shadow); }

.btn-outline-light { background: transparent; color: #e8e1d4; border-color: var(--dark-line); }
.btn-outline-light:hover { border-color: #e8e1d4; }

.btn-sm { padding: 9px 20px; font-size: 13.5px; }

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

.hero {
  padding: 176px 0 96px;
  text-align: center;
  background:
    radial-gradient(1200px 420px at 50% -10%, rgba(166, 61, 47, 0.07), transparent 65%),
    var(--paper);
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

.hero-title {
  /* 主标题用瘦高仿宋 Bold 面（公文大标题观感） */
  font-family: var(--biao);
  font-weight: 700;
  font-size: clamp(40px, 6.4vw, 68px);
  line-height: 1.28;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
}

.hero-title span { display: block; }
.hero-title .accent { color: var(--accent); }

.hero-sub {
  max-width: 620px;
  margin: 0 auto 40px;
  font-size: 17px;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* Hero 数据承诺：紧贴 CTA 按钮下方。
   负外边距用于抵消 .hero-actions 的 36px 下边距（36 - 14 = 22px 间距），
   使「按钮 + 承诺」在视觉上成组。 */
.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 680px;
  margin: -14px auto 22px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.hero-trust-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--accent);
}

.hero-trust-link {
  color: var(--accent);
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(166, 61, 47, 0.35);
}

.hero-trust-link:hover { text-decoration-color: var(--accent); }

/* ---------- 通用区块 ---------- */

.section { padding: 104px 0; }
.section-alt { background: var(--paper-deep); }
.section-alt .card { background: var(--paper); }

.section h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 18px;
}

.section-lead {
  max-width: 640px;
  color: var(--muted);
  font-size: 16.5px;
  margin-bottom: 56px;
}

/* ---------- 卡片 ---------- */

.cards {
  display: grid;
  gap: 22px;
}

.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #d8cbb8;
}

.card h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.card p { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- 独立版与托管版 ---------- */

.editions { align-items: stretch; }
.editions .card {
  display: flex;
  flex-direction: column;
}
.editions .card h3 { font-size: 23px; margin-bottom: 10px; }

.ed-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 20px;
}

.ed-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.ed-list li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.ed-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

.ed-fit {
  margin: 20px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.editions .card .btn { margin-top: 34px; align-self: flex-start; }

/* ---------- 工作流 ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  counter-reset: step;
}

.steps li {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px 30px;
}

.step-no {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.14em;
  display: block;
  margin-bottom: 18px;
}

.steps h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.steps p { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- 深色区 / 页脚 ---------- */

.section.dark {
  background: var(--dark);
  color: #ece5d8;
}

.section.dark .eyebrow { color: var(--accent-soft); }
.section.dark .section-lead { color: #b7ad9c; }
.section.dark .section-lead strong { color: #ece5d8; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  background: var(--paper);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .brand-mark { height: 24px; }
.footer-brand .brand-name { font-size: 17px; }

.footer-note { font-size: 13px; color: var(--muted); }

.footer-links { display: flex; gap: 24px; font-size: 13.5px; color: var(--ink-soft); }
.footer-links a:hover { color: var(--accent); }

.footer-icp {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-icp a:hover { color: var(--accent); }

/* ---------- 滚动渐入 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */

/* 矮屏（视口高 ≤ 780px，如 1366×768 / 1280×800 笔记本）：
   收紧 hero 顶部留白，保证 CTA 按钮与数据承诺行都落在首屏内。
   1440×900 及以上视口高 > 780px，本条不生效，原有留白一个像素不动。
   注意：必须排在下方的 max-width:680px 之前，窄屏仍由那条的 140px 生效。 */
@media (max-height: 780px) {
  .hero { padding-top: 132px; }
}

@media (max-width: 1040px) {
  .nav-links { gap: 20px; }
  .nav .btn-sm { padding: 9px 15px; }
}

@media (max-width: 920px) {
  .cards.three { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:last-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 28px 22px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(34, 31, 26, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-links a { padding: 10px 0; font-size: 16px; }
  .nav-links .lang-toggle { align-self: flex-start; margin-top: 8px; padding: 6px 18px; font-size: 14px; }
  .nav-links .btn { margin-top: 10px; width: 100%; }
  .hero { padding: 140px 0 72px; }
  .section { padding: 72px 0; }
  .cards.three { grid-template-columns: 1fr; }
  .cards.two { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps li:last-child { grid-column: auto; }
  .nav-links .nav-gh { margin: 2px 0 0; padding: 8px 0; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ---------- 无障碍：尊重减少动效偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   下载页（download.html）
   ============================================================ */

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.dl-hero {
  padding: 176px 0 72px;
  text-align: center;
  background:
    radial-gradient(1200px 420px at 50% -10%, rgba(166, 61, 47, 0.07), transparent 65%),
    var(--paper);
}

.dl-title {
  font-family: var(--biao);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
}

.dl-lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto;
}

.dl-section-top { padding: 40px 0 104px; }

.dl-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-top: 26px;
  max-width: 780px;
}

.dl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dl-card h3 { font-family: var(--serif); font-size: 21px; margin-bottom: 4px; }
.dl-card-note { font-size: 13.5px; color: var(--muted); }

.dl-hint {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
}

.dl-alt-links a { color: var(--accent); text-decoration: underline; }
.dl-alt-links a:hover { opacity: 0.85; }

/* 全部下载：分组列表 */
.dl-groups { margin-top: 30px; }
.dl-group { margin-bottom: 40px; }
.dl-group h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.dl-row-main { flex: 1; min-width: 0; }
.dl-row-title { font-size: 15.5px; font-weight: 600; }
.dl-format {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  padding: 1px 10px;
  margin-right: 6px;
  vertical-align: 1px;
}
.dl-row-note { font-size: 13px; color: var(--muted); margin-top: 3px; }
.dl-row-side { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.dl-size { font-size: 13px; color: var(--muted); white-space: nowrap; }

.dl-empty { color: var(--muted); font-size: 14px; padding: 10px 0; }

/* 安装提示 */
.dl-notes { padding: 40px 0 100px; }
.dl-note-list {
  margin-top: 20px;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 14.5px;
}
.dl-note-list li { margin-bottom: 10px; }

/* 隐私承诺强调块（数据只存本机） */
.dl-note-privacy {
  margin-top: 26px;
  padding: 16px 20px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.8;
}

@media (max-width: 720px) {
  .dl-hero { padding: 140px 0 56px; }
  .dl-title { font-size: 34px; }
  .dl-card-head { flex-direction: column; }
  .dl-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dl-row-side { width: 100%; justify-content: space-between; }
}

/* ---------- 协议/隐私政策静态页 ---------- */

.legal { max-width: 820px; }
.legal h1 {
  font-family: var(--biao);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
}
.legal .legal-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 34px;
}
.legal h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  margin: 34px 0 10px;
}
.legal h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 22px 0 8px;
}
.legal p {
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-soft);
  margin: 12px 0;
}
.legal strong { color: var(--ink); font-weight: 600; }
.legal ul { margin: 10px 0; padding-left: 22px; }
.legal li { font-size: 15px; line-height: 1.9; color: var(--ink-soft); margin: 6px 0; }
.legal blockquote {
  border-left: 3px solid var(--accent-soft);
  background: var(--paper-deep);
  padding: 10px 16px;
  margin: 14px 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  border-radius: 0 8px 8px 0;
}

/* 备案号分隔 */
.footer-icp-sep { margin: 0 8px; opacity: 0.6; }
