/* ==========================================================================
   时光邮局 · 设计系统
   暖白信纸 / 岁月暖棕 / 宋体书写感
   ========================================================================== */

:root {
  /* 色彩 */
  --bg: #faf8f5;
  --bg-card: #fffdf9;
  --bg-elev: #f5f0e8;
  --bg-overlay: rgba(139, 107, 74, 0.06);
  --primary: #8B6B4A;
  --primary-light: #A07D5A;
  --primary-dark: #6B4F35;
  --primary-soft: rgba(139, 107, 74, 0.08);
  --primary-rgb: 139, 107, 74;
  --accent: #c9a96e;
  --secondary: #7A8B6E;
  --secondary-dark: #5E6D54;
  --danger: #b86b6b;
  --success: #6b8f6b;
  --info: #5a7d9a;
  --text: #2c2c2c;
  --text-2: #6b6b6b;
  --text-3: #a0a0a0;
  --text-placeholder: #b8b8b8;
  --border: #e8e4df;
  --border-light: #f0ece6;
  --input-bg: #fffdf9;
  --input-border: #ddd8d1;

  /* 字体 */
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "SimSun", serif;
  --font-body: "Noto Serif SC", "Songti SC", "KaiTi", STKaiti, "STSong", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-num: "DIN Alternate", "SF Pro Display", "Segoe UI", Consolas, monospace;

  /* 圆角 / 阴影 */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px rgba(43, 33, 22, 0.04);
  --shadow-card: 0 1px 3px rgba(43, 33, 22, 0.04), 0 4px 16px rgba(43, 33, 22, 0.03);
  --shadow-md: 0 4px 12px rgba(43, 33, 22, 0.05);
  --shadow-lg: 0 8px 32px rgba(43, 33, 22, 0.06);
  --shadow-hover: 0 6px 18px rgba(43, 33, 22, 0.07), 0 16px 48px rgba(43, 33, 22, 0.05);
  --shadow-focus: 0 0 0 3px rgba(139, 107, 74, 0.13);

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 80px;

  --header-h: 64px;
  --maxw: 720px;
}

[data-theme="dark"] {
  --bg: #171614;
  --bg-card: #201e1b;
  --bg-elev: #292622;
  --bg-overlay: rgba(201, 169, 110, 0.08);
  --primary: #c8a97e;
  --primary-light: #d8bd95;
  --primary-dark: #a98a60;
  --primary-soft: rgba(200, 169, 126, 0.12);
  --primary-rgb: 200, 169, 126;
  --accent: #c9a96e;
  --text: #ece7df;
  --text-2: #b0a99f;
  --text-3: #837c72;
  --text-placeholder: #6b655d;
  --border: #34302b;
  --border-light: #2b2723;
  --input-bg: #262320;
  --input-border: #3d3833;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.35), 0 16px 48px rgba(0, 0, 0, 0.25);
  --shadow-focus: 0 0 0 3px rgba(200, 169, 126, 0.2);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* 纸面噪点 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* 信封水印 */
body::after {
  content: "✉";
  position: fixed;
  top: -50px;
  right: -30px;
  font-size: 210px;
  line-height: 1;
  color: var(--primary);
  opacity: 0.03;
  transform: rotate(18deg);
  pointer-events: none;
  z-index: 0;
}

.page-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { margin: 0; color: var(--text); font-family: var(--font-display); font-weight: 600; line-height: 1.45; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

::selection { background: rgba(var(--primary-rgb), 0.2); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stack-8 > * + * { margin-top: 8px; }
.stack-16 > * + * { margin-top: 16px; }
.divider { height: 1px; background: var(--border-light); border: 0; margin: 24px 0; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 248, 245, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
[data-theme="dark"] .site-header { background: rgba(23, 22, 20, 0.82); }
.site-header.is-scrolled { border-bottom-color: var(--border-light); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03); }

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.brand:hover { color: var(--primary); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.25);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
}

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  position: relative;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); }
.nav-link.is-active { color: var(--primary); font-weight: 600; }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px;
  margin-left: -2px; border-radius: 50%; background: var(--primary);
}
.nav-link-quiet { color: var(--text-3); }
.nav-cta { margin-left: 6px; }

.theme-toggle {
  width: 30px; height: 30px; margin-left: 4px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: var(--primary-soft); color: var(--primary); }

.nav-toggle { display: none; }

.announcement-bar {
  background: var(--primary-soft);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--primary-dark);
}
.announcement-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px 20px; text-align: center; letter-spacing: 0.3px; }
[data-theme="dark"] .announcement-bar { color: var(--primary-light); }

/* ---------- 主区 ---------- */
.site-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 20px 70px;
  flex: 1;
  animation: pageEnter 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.site-main.is-wide { max-width: 960px; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.985); }
.btn[disabled], .btn.is-disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.24);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3); }

.btn-outline { background: transparent; border-color: var(--input-border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }

.btn-danger { background: rgba(184, 107, 107, 0.1); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 40px; font-size: 15px; letter-spacing: 1px; }
.btn-block { display: flex; width: 100%; }

/* ---------- 卡片 / 区块 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px;
}

.section { margin-top: 48px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-title { font-size: 19px; letter-spacing: 1px; }
.section-sub { font-size: 13px; color: var(--text-3); }
.section-more { font-size: 13px; color: var(--text-3); }
.section-more:hover { color: var(--primary); }

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 26px 0 10px; }
.hero-icon {
  width: 56px; height: 56px; margin: 0 auto 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
}
.hero-icon svg { width: 26px; height: 26px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 7vw, 44px);
  font-weight: 600;
  letter-spacing: 8px;
  line-height: 1.35;
  margin: 0 0 14px;
  text-indent: 8px;
}
.hero-sub {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}
.hero-text {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-2);
  letter-spacing: 1px;
  margin: 0 auto 28px;
  max-width: 380px;
}
.hero-actions { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-link { margin-top: 18px; font-size: 13px; color: var(--text-3); }
.hero-link a { color: var(--text-3); border-bottom: 1px dashed var(--border); padding-bottom: 2px; }
.hero-link a:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 数据卡 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 38px;
}
.stat-card {
  text-align: center;
  padding: 20px 8px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border-light);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
[data-theme="dark"] .stat-card { background: rgba(255, 255, 255, 0.02); }
.stat-card:hover { transform: translateY(-3px); background: var(--bg-card); box-shadow: 0 8px 24px rgba(43, 33, 22, 0.06); }
.stat-icon { font-size: 18px; color: var(--primary); opacity: 0.65; margin-bottom: 8px; line-height: 1; }
.stat-value {
  font-family: var(--font-num);
  font-size: 27px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 7px;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 11.5px; color: var(--text-2); line-height: 1.5; letter-spacing: 0.3px; }

.home-note { text-align: center; font-size: 12.5px; color: var(--text-3); letter-spacing: 1px; margin-top: 26px; }

/* ---------- 今日一封信 ---------- */
.teaser { margin-top: 42px; }
.teaser-inner {
  position: relative;
  text-align: center;
  padding: 30px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
}
.teaser-inner::before {
  content: "✉";
  position: absolute;
  right: -10px; bottom: -26px;
  font-size: 92px; line-height: 1;
  color: var(--primary); opacity: 0.05;
  transform: rotate(-12deg);
}
.teaser-label { font-size: 10.5px; letter-spacing: 3px; color: var(--text-3); text-transform: uppercase; margin-bottom: 12px; }
.teaser-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}
.teaser-link { font-size: 13px; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.teaser-link:hover { gap: 10px; }

/* ---------- 步骤 ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step {
  padding: 22px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.35);
  text-align: center;
}
[data-theme="dark"] .step { background: rgba(255, 255, 255, 0.02); }
.step-num {
  width: 30px; height: 30px; margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-num);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85;
}
.step-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.step-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.7; }

/* ---------- 套餐 ---------- */
.packages-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.package-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(var(--primary-rgb), 0.3); }
.package-card.is-featured { border-color: rgba(var(--primary-rgb), 0.4); box-shadow: 0 8px 28px rgba(var(--primary-rgb), 0.1); }
.package-badge {
  position: absolute; top: -9px; right: 16px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 1px;
}
.package-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.package-price { font-family: var(--font-num); color: var(--primary); font-size: 30px; font-weight: 600; line-height: 1; }
.package-price small { font-size: 13px; font-weight: 400; color: var(--text-3); }
.package-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.75; margin: 12px 0 18px; flex: 1; }
.package-meta { font-size: 12px; color: var(--text-2); margin-bottom: 14px; }
.package-meta span + span::before { content: "·"; margin: 0 6px; color: var(--border); }

/* ---------- 表单 ---------- */
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 30px; }
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.field-label .req { color: var(--danger); margin-left: 3px; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.7; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; }

.input, .textarea, .select {
  width: 100%;
  padding: 12px 15px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.7;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}
.textarea { resize: vertical; min-height: 160px; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23a0a0a0' stroke-width='1.4' d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .field-full { grid-column: 1 / -1; }

.counter-row { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 12px; color: var(--text-3); }
.counter-row .is-warn { color: var(--danger); }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-img {
  height: 44px; width: 112px;
  border-radius: var(--radius-md);
  border: 1px solid var(--input-border);
  cursor: pointer; background: var(--bg-elev);
  object-fit: cover;
}

.switch-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
}
.switch-row .switch-text { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.switch-row strong { color: var(--text); font-weight: 600; }
.switch { position: relative; flex: none; width: 42px; height: 24px; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--input-border); transition: background 0.2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

.topic-row { display: flex; gap: 8px; flex-wrap: wrap; }
.topic-chip {
  padding: 5px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: transparent;
  font-size: 12px; color: var(--text-2); cursor: pointer;
  transition: all 0.2s;
}
.topic-chip:hover { border-color: var(--primary); color: var(--primary); }
.topic-chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.quota-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 20px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  font-size: 13px; color: var(--primary-dark);
}
[data-theme="dark"] .quota-banner { color: var(--primary-light); }
.quota-banner strong { font-family: var(--font-num); font-size: 16px; }

/* ---------- 公开信列表 ---------- */
.page-head { text-align: center; padding: 12px 0 26px; }
.page-title { font-size: clamp(26px, 5vw, 34px); letter-spacing: 4px; margin-bottom: 10px; }
.page-sub { font-family: var(--font-body); font-size: 14px; color: var(--text-3); letter-spacing: 1px; }

.sort-tabs { display: flex; justify-content: center; gap: 4px; margin: 0 0 26px; }
.sort-tab {
  padding: 6px 16px; border-radius: var(--radius-pill);
  font-size: 13px; color: var(--text-3); border: 1px solid transparent;
  transition: all 0.2s;
}
.sort-tab:hover { color: var(--primary); }
.sort-tab.is-active { color: var(--primary); background: var(--primary-soft); border-color: rgba(var(--primary-rgb), 0.15); }

.letter-list { display: flex; flex-direction: column; gap: 14px; }

.letter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.letter-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--border); }
.letter-card-main { display: block; padding: 22px 24px 18px; color: inherit; }
.letter-card-main:hover { color: inherit; }
.letter-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.letter-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.5px;
}
.letter-no { font-family: var(--font-num); font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.letter-card-excerpt {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.95;
  color: var(--text-2);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.letter-card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.meta-name { color: var(--text-2); }
.dot { color: var(--border); }
.meta-spacer { flex: 1; }
.meta-stat { font-size: 11.5px; color: var(--text-3); }

.status-pill {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-sent { color: var(--info); background: rgba(90, 125, 154, 0.1); }
.status-waiting { color: #a88b4a; background: rgba(201, 169, 110, 0.14); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: 600; color: #fff;
  background: hsl(var(--avatar-hue, 30), 30%, 55%);
  flex: none;
  font-family: var(--font-ui);
}
.avatar-sm { width: 26px; height: 26px; font-size: 12px; }
.avatar-lg { width: 42px; height: 42px; font-size: 17px; }

/* 分页 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 32px; flex-wrap: wrap; }
.page-item {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.page-item:hover { background: var(--primary-soft); color: var(--primary); }
.page-item.active { background: var(--primary); color: #fff; }
.page-item.disabled { opacity: 0.35; pointer-events: none; }
.page-dots { color: var(--text-3); padding: 0 4px; }

/* ---------- 信件详情 ---------- */
.letter-page { max-width: 720px; margin: 0 auto; }
.letter-paper {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 44px 48px 40px;
  overflow: hidden;
}
.letter-paper::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.35), transparent);
}
.letter-head { text-align: center; padding-bottom: 26px; border-bottom: 1px solid var(--border-light); margin-bottom: 30px; }
.letter-title { font-size: clamp(24px, 5vw, 30px); line-height: 1.5; letter-spacing: 2px; margin: 14px 0 16px; }
.letter-head-meta { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.letter-body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 2.15;
  color: var(--text);
  letter-spacing: 0.4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.letter-sign { margin-top: 36px; text-align: right; font-family: var(--font-body); font-size: 15px; color: var(--text-2); }
.letter-sign .sign-name { display: block; margin-top: 4px; font-size: 16px; color: var(--text); }
.letter-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-light); font-size: 12.5px; color: var(--text-3); }

.like-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.like-btn:hover { border-color: var(--danger); color: var(--danger); }
.like-btn.is-liked { border-color: rgba(184, 107, 107, 0.35); background: rgba(184, 107, 107, 0.08); color: var(--danger); }
.like-btn .heart { font-size: 14px; }

.comments { margin-top: 32px; }
.comment-form textarea { min-height: 84px; }
.comment-list { margin-top: 22px; display: flex; flex-direction: column; gap: 18px; }
.comment-item { display: flex; gap: 12px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.comment-name { font-size: 13px; color: var(--text); font-weight: 500; }
.comment-text { font-size: 13.5px; line-height: 1.85; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.related-card {
  display: block;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  transition: all 0.2s;
}
.related-card:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.related-card .related-meta { display: block; margin-top: 8px; font-size: 11.5px; color: var(--text-3); }

/* ---------- 认证页 ---------- */
.auth-wrap { max-width: 430px; margin: 10px auto 0; }
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 34px 30px;
}
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-icon {
  width: 46px; height: 46px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.auth-title { font-size: 24px; letter-spacing: 2px; margin-bottom: 8px; }
.auth-sub { font-size: 13px; color: var(--text-3); letter-spacing: 0.5px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-3); }
.auth-alt a { color: var(--primary); }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-3); }

.split-line { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-3); font-size: 12px; }
.split-line::before, .split-line::after { content: ""; height: 1px; flex: 1; background: var(--border-light); }

.oauth-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.oauth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  transition: all 0.2s;
}
.oauth-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.oauth-btn svg { width: 15px; height: 15px; }

.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-btn { flex: none; padding: 0 16px; font-size: 12.5px; border-radius: var(--radius-md); }

/* ---------- 用户中心 ---------- */
.dash-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
}
.dash-hero .avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.dash-hello { flex: 1; min-width: 0; }
.dash-hello h2 { font-size: 20px; letter-spacing: 1px; margin-bottom: 4px; }
.dash-hello p { font-size: 12.5px; color: var(--text-3); margin: 0; }

.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 22px; }
.dash-card {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
}
.dash-card-label { font-size: 12px; color: var(--text-3); letter-spacing: 1px; margin-bottom: 8px; }
.dash-card-value { font-family: var(--font-num); font-size: 26px; font-weight: 600; line-height: 1.2; }
.dash-card-value small { font-size: 12px; font-weight: 400; color: var(--text-3); font-family: var(--font-ui); }
.dash-card-note { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

.quota-bar { height: 6px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; margin-top: 12px; }
.quota-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-light), var(--primary)); }

.list-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
}
.list-row:last-child { border-bottom: 0; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { color: var(--text); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-title:hover { color: var(--primary); }
.list-row-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.list-row-side { flex: none; font-size: 12px; color: var(--text-3); text-align: right; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--border-light); }
.tab-item-link {
  padding: 9px 16px; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-item-link:hover { color: var(--primary); }
.tab-item-link.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- 订单 / 广告 ---------- */
.order-card {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  margin-bottom: 12px;
}
.order-main { flex: 1; min-width: 200px; }
.order-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.order-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }
.order-amount { font-family: var(--font-num); font-size: 18px; color: var(--primary); font-weight: 600; }

.pay-wrap { max-width: 480px; margin: 0 auto; }
.pay-amount { text-align: center; padding: 26px 0 22px; }
.pay-amount .amount { font-family: var(--font-num); font-size: 40px; font-weight: 600; color: var(--text); line-height: 1; }
.pay-amount .amount small { font-size: 18px; margin-right: 2px; vertical-align: 8px; }
.pay-ways { display: grid; gap: 10px; margin: 20px 0; }
.pay-way {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.pay-way:hover { border-color: var(--primary); }
.pay-way input { accent-color: var(--primary); }
.pay-way .way-name { flex: 1; font-size: 14px; }
.pay-way .way-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-size: 13px; }

/* ---------- 广告位 ---------- */
.ad-card {
  position: relative;
  display: block;
  margin: 26px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--bg-elev);
  color: var(--text-2);
  min-height: 64px;
}
.ad-card img { width: 100%; max-height: 140px; object-fit: cover; }
.ad-card .ad-caption {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 12.5px;
}
.ad-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 1px;
}
.ad-card:hover { border-color: var(--primary); color: var(--primary); }

.ad-preview { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 10px; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 52px 20px; }
.empty-icon {
  width: 62px; height: 62px; margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  opacity: 0.8;
}
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }

/* ---------- 提示 / 标签 ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid transparent;
  margin-bottom: 16px;
}
.alert-info { background: rgba(90, 125, 154, 0.08); color: var(--info); border-color: rgba(90, 125, 154, 0.15); }
.alert-warn { background: rgba(201, 169, 110, 0.12); color: #8a6d2f; border-color: rgba(201, 169, 110, 0.25); }
.alert-error { background: rgba(184, 107, 107, 0.09); color: var(--danger); border-color: rgba(184, 107, 107, 0.18); }
.alert-success { background: rgba(107, 143, 107, 0.1); color: var(--success); border-color: rgba(107, 143, 107, 0.2); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  background: var(--bg-elev);
  color: var(--text-2);
  letter-spacing: 0.3px;
}
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-success { background: rgba(107, 143, 107, 0.12); color: var(--success); }
.tag-warn { background: rgba(201, 169, 110, 0.16); color: #8a6d2f; }
.tag-danger { background: rgba(184, 107, 107, 0.12); color: var(--danger); }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  top: 76px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(43, 33, 22, 0.12);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.3s;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--accent); }
.toast-info { border-left-color: var(--info); }
.toast-icon { flex: none; font-size: 14px; line-height: 1.5; }
.toast-body { flex: 1; word-break: break-word; }
.toast-close { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 24px; bottom: 28px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 253, 249, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: all 0.25s;
  z-index: 50;
}
[data-theme="dark"] .back-to-top { background: rgba(32, 30, 27, 0.9); }
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 欢迎弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(30, 24, 18, 0.36);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask.is-open { display: flex; animation: fadeIn 0.25s ease; }
.modal-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 34px 30px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(30, 24, 18, 0.22);
  animation: modalIn 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal-icon { font-size: 36px; color: var(--primary); margin-bottom: 14px; opacity: 0.85; }
.modal-title { font-size: 20px; margin-bottom: 10px; letter-spacing: 1px; }
.modal-desc { font-size: 13px; color: var(--text-2); line-height: 1.8; margin-bottom: 20px; }
.modal-steps { text-align: left; display: inline-block; margin-bottom: 24px; }
.modal-step { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 13px; color: var(--text-2); }
.modal-step:last-child { margin-bottom: 0; }
.modal-step .num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-family: var(--font-num);
  flex: none;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 34px 20px 38px;
  text-align: center;
  background: rgba(255, 253, 249, 0.35);
}
[data-theme="dark"] .site-footer { background: rgba(255, 255, 255, 0.01); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-quote {
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--text-2);
  letter-spacing: 2px;
  margin-bottom: 18px;
  transition: opacity 0.3s, transform 0.3s;
}
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 16px; }
.footer-links a { font-size: 12px; color: var(--text-3); }
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: 11.5px; color: var(--text-3); line-height: 1.9; letter-spacing: 0.3px; }
.footer-copy a { color: var(--text-3); }

/* ---------- 移动端底部导航 ---------- */
.mobile-tabbar { display: none; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); border: 1px solid var(--border-light); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table th { font-weight: 500; color: var(--text-3); font-size: 12px; background: var(--bg-elev); white-space: nowrap; letter-spacing: 0.5px; }
.data-table tbody tr:hover { background: var(--primary-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 管理后台 ---------- */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; flex: none;
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  padding: 22px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 70;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; border-bottom: 1px solid var(--border-light); margin-bottom: 16px; }
.admin-brand strong { display: block; font-family: var(--font-display); font-size: 15px; letter-spacing: 2px; }
.admin-brand small { display: block; font-size: 10.5px; color: var(--text-3); letter-spacing: 2px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-link {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-2);
  transition: all 0.18s;
}
.admin-link:hover { background: var(--primary-soft); color: var(--primary); }
.admin-link.is-active { background: var(--primary); color: #fff; font-weight: 500; }
.admin-side-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.admin-side-foot a { font-size: 12px; color: var(--text-3); padding: 4px 8px; }
.admin-side-foot a:hover { color: var(--primary); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 62px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: rgba(255, 253, 249, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 40;
}
[data-theme="dark"] .admin-topbar { background: rgba(32, 30, 27, 0.75); }
.admin-page-title { font-size: 16px; font-weight: 600; letter-spacing: 1px; font-family: var(--font-ui); }
.admin-user { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.admin-content { padding: 24px; max-width: 1200px; width: 100%; }
.admin-menu-btn { display: none; border: 0; background: transparent; font-size: 18px; color: var(--text-2); cursor: pointer; }

.admin-section { margin-bottom: 26px; }
.admin-section-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--text); font-family: var(--font-ui); letter-spacing: 0.5px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-box { padding: 18px 20px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border-light); }
.stat-box .label { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-box .value { font-family: var(--font-num); font-size: 24px; font-weight: 600; line-height: 1.1; }
.stat-box .value small { font-size: 11px; font-weight: 400; color: var(--text-3); font-family: var(--font-ui); margin-left: 4px; }
.stat-box .hint { font-size: 11px; color: var(--text-3); margin-top: 6px; }

.panel { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title { font-size: 14px; font-weight: 600; font-family: var(--font-ui); letter-spacing: 0.5px; }

.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.admin-form-grid .field-full { grid-column: 1 / -1; }

.settings-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.settings-tab { padding: 9px 15px; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tab:hover { color: var(--primary); }
.settings-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 10px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 34px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--primary-light), rgba(var(--primary-rgb), 0.35)); min-height: 3px; transition: height 0.5s; }
.chart-label { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

.search-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-bar .input { flex: 1; min-width: 180px; }
.search-bar .select { width: auto; min-width: 120px; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .brand-name { font-size: 16px; letter-spacing: 2px; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    padding: 10px 16px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(43, 33, 22, 0.08);
    display: none;
    margin-left: 0;
  }
  .main-nav.is-open { display: flex; }
  .nav-link { padding: 10px 12px; border-radius: var(--radius-sm); }
  .nav-link.is-active::after { display: none; }
  .nav-cta { margin: 4px 0 0; }
  .theme-toggle { align-self: flex-start; margin: 2px 0 0; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    margin-left: auto; width: 34px; height: 34px;
    border: 0; background: transparent; cursor: pointer; padding: 0 6px;
  }
  .nav-toggle span { display: block; height: 1.5px; background: var(--text-2); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

  .site-main { padding: 20px 16px 96px; }
  .hero { padding-top: 12px; }
  .hero-title { letter-spacing: 5px; font-size: 32px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); margin-top: 30px; }
  .stat-value { font-size: 24px; }
  .steps { grid-template-columns: 1fr; }
  .step { display: flex; text-align: left; gap: 12px; padding: 16px; }
  .step-num { margin: 0; flex: none; }
  .step-title { margin-bottom: 2px; }
  .packages-grid { grid-template-columns: 1fr; }
  .package-card { padding: 20px; }
  .form-card { padding: 22px 18px; border-radius: var(--radius-md); }
  .form-grid { grid-template-columns: 1fr; }
  .letter-paper { padding: 28px 20px 26px; border-radius: var(--radius-md); }
  .letter-body { font-size: 16px; line-height: 2.05; }
  .letter-card-main { padding: 18px 16px 15px; }
  .letter-card-title { font-size: 16.5px; }
  .letter-card-excerpt { font-size: 13.5px; -webkit-line-clamp: 3; }
  .letter-card-meta { gap: 6px; flex-wrap: wrap; font-size: 11px; }
  .meta-stat { font-size: 10.5px; }
  .meta-spacer { display: none; }
  .letter-card-meta .meta-stat:nth-last-child(1) { margin-left: 0; }
  .related-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px 24px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-hero { padding: 20px; flex-wrap: wrap; }
  .toast-stack { top: auto; bottom: 84px; left: 14px; right: 14px; max-width: none; }
  .toast { transform: translateY(120%); }
  .toast.show { transform: translateY(0); }
  .toast.hide { transform: translateY(120%); }
  .back-to-top { display: none; }

  .mobile-tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 80;
    background: rgba(255, 253, 249, 0.95);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-light);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  [data-theme="dark"] .mobile-tabbar { background: rgba(32, 30, 27, 0.95); }
  .tab-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10px; color: var(--text-3);
    padding: 4px 0;
  }
  .tab-item.is-active { color: var(--primary); }
  .tab-item svg { width: 19px; height: 19px; }
  .tab-compose { position: relative; }
  .tab-compose-btn {
    width: 40px; height: 40px; margin-top: -18px;
    border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
  }
  .tab-compose span:last-child { margin-top: 1px; }

  .admin-side {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  }
  .admin-side.is-open { transform: translateX(0); }
  .admin-menu-btn { display: block; }
  .admin-content { padding: 16px 16px 40px; }
  .admin-topbar { padding: 0 16px; }
  .admin-user span { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-form-grid { grid-template-columns: 1fr; }

  .site-footer { padding-bottom: 92px; }
  .letter-paper { overflow-wrap: anywhere; }
}

@media (max-width: 400px) {
  .hero-title { font-size: 28px; letter-spacing: 3px; }
  .stat-value { font-size: 22px; }
  .btn-lg { width: 100%; }
  .letter-paper { padding: 24px 16px; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 打印 ---------- */
@media print {
  .site-header, .site-footer, .mobile-tabbar, .back-to-top, .toast-stack, .letter-foot, .comments, .related-grid, .ad-card { display: none !important; }
  body { background: #fff; }
  .letter-paper { border: 0; box-shadow: none; padding: 0; }
}

/* ---------- 补充组件 ---------- */
.link-danger {
  border: 0; background: transparent; padding: 0;
  color: var(--danger); font-size: 12px; cursor: pointer;
  font-family: var(--font-ui);
}
.link-danger:hover { text-decoration: underline; }
.topic-chip { position: relative; }
.topic-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.has-error { border-color: var(--danger) !important; }
.ad-price-line { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--text-2); }
.ad-price-line .total { font-family: var(--font-num); font-size: 24px; color: var(--primary); font-weight: 600; }
.preview-box {
  margin-top: 10px; padding: 10px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); background: var(--bg-elev);
  font-size: 12px; color: var(--text-3);
}
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-inline { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-inline .item { font-size: 12px; color: var(--text-3); }
.stat-inline .item strong { display: block; font-family: var(--font-num); font-size: 20px; color: var(--text); font-weight: 600; }
