:root {
  --paper: #f7f1e6;
  --paper-2: #efe5d3;
  --ink: #2b2118;
  --ink-2: #5a4a3a;
  --gold: #9a6b1f;
  --gold-2: #7a5214;
  --red: #8c2f22;
  --line: #d9c9ad;
  --radius: 14px;
  --max: 1080px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1611;
    --paper-2: #251e17;
    --ink: #f1e7d6;
    --ink-2: #c9b89e;
    --gold: #d9a54a;
    --gold-2: #e8b862;
    --red: #e07b69;
    --line: #3d3226;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

h1, h2, h3 {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  line-height: 1.35;
  margin: 0 0 .6em;
}

a { color: var(--gold-2); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.top {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.top nav a { color: var(--ink-2); text-decoration: none; margin-left: 18px; font-size: 15px; }
.top nav a:hover { color: var(--gold-2); }

/* 首屏 */
.hero { padding: 64px 0 40px; text-align: center; }
.hero .icon { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 8px 30px rgb(0 0 0 / .15); }
.hero h1 { font-size: clamp(34px, 6vw, 52px); margin-top: 20px; letter-spacing: .08em; }
.hero .lead { font-size: 19px; color: var(--ink-2); margin: 0 auto 28px; max-width: 34em; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  color: var(--gold-2);
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.primary:hover { background: var(--gold-2); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.meta { color: var(--ink-2); font-size: 14px; margin-top: 14px; }

/* 通用区块 */
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--line); }
.center { text-align: center; }
.sub { color: var(--ink-2); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { font-size: 20px; color: var(--gold-2); }
.card p { margin: 0; color: var(--ink-2); }

.shots { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.shots figure { margin: 0; flex: 0 0 220px; scroll-snap-align: start; }
.shots img { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line); }
.shots figcaption { text-align: center; font-size: 14px; color: var(--ink-2); margin-top: 6px; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 18px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  text-align: center;
  line-height: 32px;
  font-weight: 700;
}

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p, details ul { color: var(--ink-2); margin: 10px 0 0; }

.notice {
  border-left: 4px solid var(--red);
  background: var(--paper-2);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
}
.notice[hidden] { display: none; }

.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; font-size: 24px; }
.prose h3 { margin-top: 1.2em; font-size: 19px; }

code, .code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  word-break: break-all;
}
.code {
  display: block;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  user-select: all;
}

/* 微信等内置浏览器提示 */
dialog {
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  max-width: min(420px, 92vw);
  padding: 26px;
}
dialog::backdrop { background: rgb(0 0 0 / .6); }
.arrow { position: fixed; top: 8px; right: 18px; font-size: 42px; color: #fff; pointer-events: none; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-2); font-size: 14px; }
footer a { color: var(--ink-2); margin-right: 16px; }

@media (max-width: 560px) {
  .top nav a { margin-left: 12px; font-size: 14px; }
  .top nav .opt { display: none; }
  .hero { padding-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
