/* ═══════════════════════════════════════════════════════════════
   风花雪月 · 大理四日
   视觉基因：宣纸 × 苍山墨 × 洱海青 × 朱砂印 × 鎏金
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper:      #f3ecdd;
  --paper-2:    #fbf6ea;
  --paper-3:    #e9dec9;
  --paper-4:    #dfd2b8;
  --ink:        #20302b;
  --ink-2:      #3b4d46;
  --ink-soft:   #5c6c63;
  --ink-faint:  #849087;
  --jade:       #3f6259;
  --jade-2:     #557b6f;
  --lake:       #527f8c;
  --lake-2:     #7aa3ac;
  --cinnabar:   #b2472f;
  --cinnabar-2: #c9603f;
  --gold:       #b58f4d;
  --gold-2:     #d8b878;
  --line:       rgba(32, 48, 43, .14);
  --line-soft:  rgba(32, 48, 43, .08);
  --white:      #fffdf7;

  --font-display: "STKaiti", "KaiTi", "Kaiti SC", "FangSong", "STFangsong", serif;
  --font-serif:   "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --font-ui:      "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 0 rgba(255,255,255,.7) inset, 0 2px 8px rgba(32,48,43,.05);
  --shadow:    0 1px 0 rgba(255,255,255,.75) inset, 0 18px 38px -24px rgba(32,48,43,.32), 0 3px 10px rgba(32,48,43,.05);
  --shadow-lg: 0 30px 70px -30px rgba(25,40,35,.45), 0 8px 24px rgba(25,40,35,.10);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 66px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .02em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(216,184,120,.12), transparent 55%),
    radial-gradient(1000px 700px at 50% 110%, rgba(82,127,140,.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.backdrop svg { width: 100%; height: 100%; display: block; }

.app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px calc(var(--nav-h) + var(--safe-bottom) + 26px);
  min-height: 100svh;
}
@media (min-width: 900px) {
  .app { padding-left: 34px; padding-right: 34px; }
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: rgba(178,71,47,.18); }

:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── 通用文字 ── */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .14em;
  line-height: 1.28;
}
.serif { font-family: var(--font-serif); }
.ui { font-family: var(--font-ui); letter-spacing: .01em; }
.eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.tiny { font-size: 12px; }
.small { font-size: 13.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.cinnabar { color: var(--cinnabar); }
.jade { color: var(--jade); }
.lake { color: var(--lake); }

/* ── 按钮 ── */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: .08em;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: 0 8px 18px -12px rgba(32,48,43,.65);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--cinnabar { --btn-bg: var(--cinnabar); --btn-fg: #fff8ed; }
.btn--jade { --btn-bg: var(--jade); --btn-fg: #f6f1e3; }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-2);
  border-color: var(--line);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(32,48,43,.045); }
.btn--gold {
  --btn-bg: linear-gradient(135deg, var(--gold-2), var(--gold));
  --btn-fg: #2b2417;
  border-color: rgba(181,143,77,.5);
}
.btn--sm { min-height: 34px; padding: 6px 13px; font-size: 12.5px; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon {
  width: 20px; height: 20px;
  display: inline-block;
  vertical-align: -4px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }

/* ── 纸卡 ── */
.paper-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 34%),
    var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.paper-card::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(181,143,77,.16);
  border-radius: calc(var(--radius) - 5px);
  pointer-events: none;
}

/* ── 印章 ── */
.seal {
  --seal: var(--cinnabar);
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1.5px solid var(--seal);
  border-radius: 7px;
  color: var(--seal);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0;
  transform: rotate(-3deg);
  background: rgba(178,71,47,.035);
  box-shadow: inset 0 0 0 2px rgba(178,71,47,.10);
  flex: none;
}
.seal--lg { width: 54px; height: 54px; font-size: 27px; border-radius: 10px; border-width: 2px; }
.seal--sm { width: 26px; height: 26px; font-size: 13px; border-radius: 5px; }
.seal--jade { --seal: var(--jade); background: rgba(63,98,89,.04); box-shadow: inset 0 0 0 2px rgba(63,98,89,.10); }
.seal--gold { --seal: var(--gold); background: rgba(181,143,77,.05); box-shadow: inset 0 0 0 2px rgba(181,143,77,.12); }
.seal--lake { --seal: var(--lake); background: rgba(82,127,140,.05); box-shadow: inset 0 0 0 2px rgba(82,127,140,.12); }

/* ── 标签 ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,253,247,.55);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: .04em;
  white-space: nowrap;
}
.tag--cinnabar { color: var(--cinnabar); border-color: rgba(178,71,47,.3); background: rgba(178,71,47,.06); }
.tag--jade { color: var(--jade); border-color: rgba(63,98,89,.3); background: rgba(63,98,89,.06); }
.tag--gold { color: #8b6a2f; border-color: rgba(181,143,77,.35); background: rgba(181,143,77,.08); }
.tag--lake { color: var(--lake); border-color: rgba(82,127,140,.3); background: rgba(82,127,140,.06); }

/* ── 分隔 ── */
.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .32em;
  text-transform: uppercase;
}
.rule::before, .rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(181,143,77,.45), transparent);
}

/* ── 动效 ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes inkIn {
  from { opacity: 0; filter: blur(5px); transform: translateY(8px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes drift { 0%,100% { transform: translateX(0); } 50% { transform: translateX(12px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(178,71,47,.25); } 50% { box-shadow: 0 0 0 9px rgba(178,71,47,0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.anim-up { animation: fadeUp .6s cubic-bezier(.2,.7,.2,1) both; }
.anim-in { animation: fadeIn .5s ease both; }
.stagger > * { animation: fadeUp .55s cubic-bezier(.2,.7,.2,1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .17s; }
.stagger > *:nth-child(5) { animation-delay: .22s; }
.stagger > *:nth-child(6) { animation-delay: .27s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(32,48,43,.18); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
