/* ═══════════════════════════════════════════════════════
   应用墓园 · 官网样式
   配色与排版令牌来自 App 的 Theme.kt / MuyuanType，保持同一套视觉。
   固定暗色，不跟随系统 —— 墓园在白天也应该是暗的。
   ═══════════════════════════════════════════════════════ */

@font-face {
  font-family: "StoneSerif";
  src: url("../fonts/stone_serif.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* MuyuanColors */
  --bg: #1A1A1C;
  --stone: #2A2A2C;
  --stone-top: #323236;
  --stone-edge: #3C3C40;
  --text: #E8E4DC;
  --text-dim: #9A968C;
  --text-faint: #8C8779;
  --gold: #8A7A5C;
  --gold-bright: #B8A57C;
  --gold-faint: #4A4234;
  --divider: #2E2E31;

  /* App 标题用打包的思源宋体子集；网页回落到系统衬线 */
  --serif: "StoneSerif", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", STSong, SimSun, serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  --page-pad: clamp(20px, 6vw, 72px);
}

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

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

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(120% 50% at 50% 0%, #1F1F21 0%, rgba(31,31,33,0) 60%),
    linear-gradient(180deg, #1A1A1C 0%, #17171A 100%);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--bg); }

a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--gold-bright); }
.gold-text { color: var(--gold-bright); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.86em; }

/* 细分隔线（HairLine） */
.hairline { height: 1px; background: var(--divider); border: 0; }

/* ── 入场：与 App 同节奏（700ms 淡入上浮，逐块延迟 40ms，封顶 12 块） ── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ═══════════ 导航 ═══════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(26, 26, 28, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-icon { width: 22px; height: 22px; align-self: center; }
.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.18em;
}
.brand-en {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--text-faint);
}
.nav-links { display: flex; gap: clamp(14px, 3vw, 30px); }
.nav-links a {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.nav-links a:hover { color: var(--gold-bright); border-bottom-color: var(--gold-faint); }
.nav-right { display: flex; align-items: center; gap: clamp(16px, 3vw, 34px); }
.nav-donate {
  appearance: none;
  background: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-indent: 0.18em; /* 视觉上抵消最后一个字的字距 */
  color: var(--gold-bright);
  border: 1px solid var(--gold-faint);
  border-radius: 2px;
  padding: 8px 18px;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.nav-donate:hover { background: rgba(138, 122, 92, 0.14); border-color: var(--gold); }
.nav-donate:focus-visible { outline: 1px solid var(--gold-bright); outline-offset: 3px; }

/* ═══════════ 首屏 ═══════════ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--page-pad) 0;
  overflow: hidden;
}
.hero-inner { max-width: 880px; margin: 0 auto; width: 100%; }
.hero-meta {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--text-faint);
  margin-bottom: 26px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: normal;
  font-size: clamp(26px, 5.6vw, 52px);
  line-height: 1.45;
  letter-spacing: 0.08em;
}
.hero-sub {
  margin-top: 28px;
  max-width: 640px;
  font-size: 15px;
  line-height: 2;
  color: var(--text-dim);
}
.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-stats {
  margin-top: 64px;
  display: flex;
  gap: clamp(28px, 6vw, 72px);
  flex-wrap: wrap;
}
.hero-stats div { min-width: 72px; }
.hero-stats dt {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.hero-stats dd {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

/* 首屏远景墓碑 */
.hero-scene {
  position: relative;
  margin-top: clamp(24px, 6vh, 64px);
  pointer-events: none;
}
.hero-row {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(4px, 3vw, 28px);
}
.hero-ground {
  display: block;
  width: 100%;
  height: 24px;
  margin-top: -2px;
}

/* ═══════════ 区块 ═══════════ */
.section {
  padding: clamp(80px, 12vh, 140px) var(--page-pad);
  border-top: 1px solid var(--divider);
}
.section-inner { max-width: 880px; margin: 0 auto; }
.section-label {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--serif);
  font-weight: normal;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.6;
  letter-spacing: 0.1em;
}
.section-sub {
  margin-top: 16px;
  font-size: 14px;
  line-height: 2;
  color: var(--text-dim);
  max-width: 620px;
}
.prose { margin-top: 26px; max-width: 620px; }
.prose p { margin-top: 14px; font-size: 15px; line-height: 2.1; color: var(--text-dim); }
.prose p:first-child { margin-top: 0; }

/* 卡片 */
.cards { display: grid; gap: 16px; margin-top: 44px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.five  { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--stone);
  border: 1px solid var(--stone-edge);
  border-radius: 2px;
  padding: 24px 22px 26px;
}
.card h3 {
  font-family: var(--serif);
  font-weight: normal;
  font-size: 17px;
  letter-spacing: 0.22em;
  margin-bottom: 10px;
}
.card p { font-size: 13px; line-height: 1.95; color: var(--text-dim); }
.card-no {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ═══════════ 墓碑墙（示意） ═══════════ */
.grave-wall {
  margin: 48px auto 0;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 14px;
}
.tomb {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  aspect-ratio: 0.77;
  color: inherit;
  transition: transform 0.35s ease;
}
.tomb:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
.tomb:hover .tomb-name { color: var(--text); }
.tomb:hover svg .t-stone { filter: brightness(1.12); }
.tomb svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tomb-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26% 14% 12%;
  text-align: center;
}
.tomb-motif { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 12px; }
.tomb-motif i { display: block; height: 1.5px; background: var(--gold); opacity: 0.85; }
.tomb-name {
  font-family: var(--serif);
  font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.1em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color 0.3s ease;
}
.tomb-sub {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ═══════════ 隐私表 ═══════════ */
.perm-table {
  margin-top: 44px;
  border: 1px solid var(--divider);
  border-radius: 2px;
  overflow: hidden;
}
.perm-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 96px 1fr;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--divider);
  align-items: baseline;
}
.perm-row.head {
  border-top: 0;
  background: rgba(42, 42, 44, 0.5);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
}
.perm-row span[role="cell"] { font-size: 13px; line-height: 1.9; color: var(--text-dim); }
.perm-row .mono { color: var(--text); }
.perm-row.head .mono { color: inherit; font-size: 12px; }

.quiet-list {
  margin-top: 30px;
  list-style: none;
}
.quiet-list li {
  font-size: 14px;
  line-height: 2.1;
  color: var(--text-dim);
  padding-left: 20px;
  position: relative;
}
.quiet-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.95em;
  width: 7px;
  height: 1.5px;
  background: var(--gold);
}

/* ═══════════ 已知误差 ═══════════ */
.limits { margin-top: 36px; list-style: none; counter-reset: limit; }
.limits li {
  counter-increment: limit;
  display: flex;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--divider);
  font-size: 14px;
  line-height: 2;
  color: var(--text-dim);
}
.limits li:last-child { border-bottom: 1px solid var(--divider); }
.limits li::before {
  content: counter(limit, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.1em;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ═══════════ 刻意不做 ═══════════ */
.not-list {
  margin-top: 30px;
  list-style: none;
  columns: 2;
  column-gap: 48px;
}
.not-list li {
  break-inside: avoid;
  font-size: 14px;
  line-height: 2.1;
  color: var(--text-dim);
  padding: 6px 0 6px 20px;
  position: relative;
}
.not-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.15em;
  width: 7px;
  height: 1.5px;
  background: var(--gold-faint);
}

/* ═══════════ FAQ ═══════════ */
.faq { margin-top: 36px; }
.faq details { border-top: 1px solid var(--divider); }
.faq details:last-child { border-bottom: 1px solid var(--divider); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 0;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.08em;
  transition: color 0.25s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--gold);
  font-size: 18px;
  line-height: 1.4;
  transition: transform 0.3s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--gold-bright); }
.faq details p {
  padding: 0 0 22px;
  font-size: 14px;
  line-height: 2.1;
  color: var(--text-dim);
  max-width: 640px;
}

/* ═══════════ 下载 ═══════════ */
.dl-card {
  margin-top: 40px;
  background: var(--stone);
  border: 1px solid var(--stone-edge);
  border-radius: 2px;
  padding: clamp(24px, 4vw, 40px);
}
.dl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.dl-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.12em;
}
.dl-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.dl-sign {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}
.dl-sign code {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-dim);
  word-break: break-all;
}
.dl-changelog { margin-top: 22px; border-top: 1px solid var(--divider); padding-top: 16px; }
.dl-changelog summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}
.dl-changelog summary::-webkit-details-marker { display: none; }
.dl-changelog summary::after {
  content: "+";
  float: right;
  color: var(--gold);
  transition: transform 0.3s ease;
}
.dl-changelog[open] summary::after { transform: rotate(45deg); }
.dl-changelog summary:hover { color: var(--gold-bright); }
.dl-changelog p {
  margin-top: 12px;
  font-size: 13px;
  line-height: 2;
  color: var(--text-dim);
}

/* ═══════════ 按钮（GoldButton / GhostButton） ═══════════ */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: rgba(138, 122, 92, 0.10);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.28em;
  text-indent: 0.28em; /* 视觉上抵消最后一个字的字距 */
  color: var(--gold-bright);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.btn-gold:hover { background: rgba(138, 122, 92, 0.22); border-color: var(--gold-bright); }
.btn-gold:focus-visible { outline: 1px solid var(--gold-bright); outline-offset: 4px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--gold-faint);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.btn-ghost:hover { color: var(--gold-bright); border-bottom-color: var(--gold); }

/* ═══════════ 详情覆盖层 ═══════════ */
.overlay { position: fixed; inset: 0; z-index: 60; }
.overlay[hidden] { display: none; }
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 16, 0.72);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.overlay.show .overlay-backdrop { opacity: 1; }
.overlay-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%);
  width: min(480px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  overflow-y: auto;
  background: var(--stone);
  border: 1px solid var(--stone-edge);
  border-radius: 2px;
  padding: 30px 30px 26px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.overlay.show .overlay-panel {
  opacity: 1;
  transform: translate(-50%, -50%);
}
.ov-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--divider);
}
.ov-status {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 8px;
}
.ov-name {
  font-family: var(--serif);
  font-weight: normal;
  font-size: 24px;
  letter-spacing: 0.14em;
}
.ov-close {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.ov-close:hover { color: var(--gold-bright); border-bottom-color: var(--gold-faint); }
.ov-rows { margin-top: 6px; }
.ov-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--divider);
}
.ov-row dt { font-size: 13px; letter-spacing: 0.1em; color: var(--text-faint); flex-shrink: 0; }
.ov-row dd { font-size: 14px; color: var(--text); text-align: right; }
.ov-row dd.dim { color: var(--text-dim); }
.ov-epitaph {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.05em;
  white-space: pre-line;
}
.ov-note {
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-faint);
}

/* ═══════════ 页脚 ═══════════ */
.footer {
  border-top: 1px solid var(--divider);
  padding: 56px var(--page-pad) 72px;
}
.footer-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.footer-title {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}
.footer-meta {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.footnote {
  margin-top: 26px;
  font-size: 12px;
  line-height: 2;
  color: var(--text-faint);
  text-align: center;
}

/* ═══════════ 赞赏 ═══════════ */
.donate-panel { width: min(360px, calc(100vw - 32px)); text-align: center; }
.donate-title {
  font-family: var(--serif);
  font-weight: normal;
  font-size: 22px;
  letter-spacing: 0.14em;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--divider);
}
.donate-close {
  appearance: none;
  background: none;
  cursor: pointer;
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-indent: 0.18em; /* 视觉上抵消最后一个字的字距 */
  color: var(--text-dim);
  border: 1px solid var(--stone-edge);
  border-radius: 2px;
  padding: 9px 34px;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.donate-close:hover { color: var(--gold-bright); border-color: var(--gold-faint); background: rgba(138, 122, 92, 0.08); }
.donate-close:focus-visible { outline: 1px solid var(--gold-bright); outline-offset: 3px; }
.donate-note {
  margin-top: 18px;
  font-size: 13px;
  line-height: 2;
  color: var(--text-dim);
}
.donate-qr {
  display: block;
  margin: 20px auto 4px;
  width: min(264px, 100%);
  aspect-ratio: 630 / 629;
  background: #fff;
  border: 1px solid var(--stone-edge);
  border-radius: 2px;
  padding: 10px;
  box-sizing: border-box;
}

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 900px) {
  .cards.five { grid-template-columns: repeat(2, 1fr); }
  .grave-wall { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .cards.three { grid-template-columns: 1fr; }
  .cards.five  { grid-template-columns: 1fr; }
  .grave-wall { grid-template-columns: repeat(2, 1fr); }
  .not-list { columns: 1; }
  .perm-row { grid-template-columns: 1fr; gap: 4px; }
  .perm-row.head { display: none; }
  .hero { min-height: 0; padding-top: 104px; }
  .hero-row svg { width: 44px; }
}

/* ═══════════ 动效弱化：动画不是氛围，是等待 ═══════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tomb, .tomb-name, .tomb svg .t-stone { transition: none; }
  .overlay-backdrop, .overlay-panel { transition: none; }
}
