/* =====================================================================
   红集市 · 设计系统 v2
   ---------------------------------------------------------------------
   原则：简约、大气、直观、舒适。
     · 一套字号阶梯（14 / 15 / 17 / 20 / 28 / 40 / 56）
     · 只用一个强调色（品牌红），其余全是中性灰阶
     · 内容优先：正文宽度受控，卡片留白充足
     · 每个可点元素都有明确的视觉层级，不猜
   20 套主题的 CSS 变量由服务端注入（server/themes.js），此处只消费。
   ===================================================================== */

:root {
  --ff-serif: 'HJSerif', 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --ff-sans: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --ff-mono: 'SF Mono', 'DejaVu Sans Mono', Menlo, Consolas, monospace;

  /* 中性灰阶 */
  --ink:        #16110f;
  --ink-2:      #3d322e;
  --ink-3:      #6b5c56;
  --ink-4:      #97877f;
  --line:       #e8e0db;
  --line-2:     #f1ebe7;
  --bg:         #ffffff;
  --bg-2:       #fbf8f6;
  --bg-3:       #f6f1ed;

  --ok:         #1f7a4d;
  --ok-bg:      #eef7f2;
  --warn:       #a86a12;
  --warn-bg:    #fdf6e7;
  --err:        #b3352c;
  --err-bg:     #fdf0ef;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --sh-1: 0 1px 2px rgba(28, 16, 12, .05);
  --sh-2: 0 2px 10px rgba(28, 16, 12, .06), 0 1px 3px rgba(28, 16, 12, .04);
  --sh-3: 0 12px 36px rgba(28, 16, 12, .10), 0 3px 10px rgba(28, 16, 12, .05);

  --wrap: 1160px;
  --wrap-narrow: 780px;
  --wrap-mid: 940px;
  --topbar-h: 66px;

  /* 默认品牌色（服务端会覆盖） */
  --brand: hsl(354 68% 46%);
  --brand-deep: hsl(354 64% 36%);
  --brand-soft: hsl(354 38% 97%);
  --brand-tint: hsl(354 44% 94.5%);
  --brand-line: hsl(354 48% 89%);
  --brand-ink: hsl(354 62% 30%);
  --grad: linear-gradient(135deg, hsl(8 74% 52%) 0%, hsl(354 68% 46%) 48%, hsl(346 70% 38%) 100%);
}

@font-face {
  font-family: 'HJSerif';
  src: url('/fonts/NotoSerifSC-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'HJSerif';
  src: url('/fonts/NotoSerifSC-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--ff-sans); font-size: 15px; line-height: 1.72;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.28; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
pre { margin: 0; font-family: var(--ff-mono); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); }
.wrap-mid { max-width: var(--wrap-mid); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

/* ===================== 顶栏 ===================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.topbar-inner {
  display: flex; align-items: center; gap: 28px;
  min-height: var(--topbar-h);
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; color: var(--brand); flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b {
  font-family: var(--ff-serif); font-size: 18px; font-weight: 700; letter-spacing: .02em; color: var(--ink);
}
.brand-text i {
  font-style: normal; font-size: 10.5px; color: var(--ink-4); letter-spacing: .04em; margin-top: 2px;
}

.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
  position: relative; padding: 8px 13px; border-radius: var(--r-sm);
  font-size: 14.5px; color: var(--ink-2); white-space: nowrap; transition: background .16s, color .16s;
}
.nav-link:hover { background: var(--brand-soft); color: var(--brand-ink); }
.nav-link.is-active { color: var(--brand-ink); font-weight: 600; background: var(--brand-tint); }

.top-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.top-sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.top-link {
  padding: 7px 14px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2);
  white-space: nowrap; transition: background .16s, color .16s;
}
.top-link:hover { background: var(--bg-3); color: var(--ink); }
.top-primary { background: var(--brand); color: #fff !important; font-weight: 600; }
.top-primary:hover { background: var(--brand-deep); }
.top-account { display: inline-flex; align-items: center; gap: 6px; }
.top-account svg { width: 17px; height: 17px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm);
  color: var(--ink-3); transition: background .16s, color .16s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--bg-3); color: var(--brand); }

.theme-pop { position: relative; }
.theme-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: 268px; padding: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3);
}
.tp-title { font-size: 12px; color: var(--ink-4); letter-spacing: .08em; margin-bottom: 10px; }
.tp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tp-grid .sw {
  width: 100%; aspect-ratio: 1; border-radius: 7px;
  background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07);
  transition: transform .14s, box-shadow .14s;
}
.tp-grid .sw:hover { transform: scale(1.1); }
.tp-grid .sw.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sw); }

.burger { display: none; width: 42px; height: 42px; flex: none; flex-direction: column; justify-content: center; gap: 5px; align-items: center; border-radius: var(--r-sm); }
.burger span { display: block; width: 19px; height: 1.8px; background: var(--ink-2); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.8px) rotate(-45deg); }

.m-nav { display: none; border-top: 1px solid var(--line-2); padding: 8px 16px 16px; background: #fff; }
.m-link { display: block; padding: 11px 6px; font-size: 15.5px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.m-link.is-active { color: var(--brand-ink); font-weight: 600; }
.m-account { padding-top: 8px; }
.m-account .m-link { border-bottom: 0; padding: 9px 6px; color: var(--brand-ink); }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 600; line-height: 1.3;
  transition: background .16s, color .16s, border-color .16s, transform .12s, box-shadow .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px var(--brand-glow); }
.btn-primary:hover { background: var(--brand-deep); color: #fff; box-shadow: 0 4px 14px var(--brand-glow); }
.btn-primary:disabled { background: var(--ink-4); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-line); background: var(--brand-soft); }
.btn-block { display: flex; width: 100%; }

/* ===================== Hero ===================== */
.hero { padding: 84px 0 72px; background: var(--grad-soft, linear-gradient(180deg, var(--brand-soft), #fff)); position: relative; overflow: hidden; }
.hero-inner { max-width: 820px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .1em; color: var(--brand-ink); font-weight: 600;
  background: #fff; padding: 6px 14px; border-radius: 100px;
  box-shadow: inset 0 0 0 1px var(--brand-line); margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.hero-title {
  font-family: var(--ff-serif); font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.2; letter-spacing: -.02em; margin-bottom: 20px; color: var(--ink);
}
.hero-title em { font-style: normal; color: var(--brand); }
.hero-sub { font-size: 17px; color: var(--ink-3); max-width: 620px; margin-bottom: 30px; line-height: 1.7; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 46px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 44px; margin: 0; }
.hero-stats > div { display: flex; flex-direction: column-reverse; gap: 2px; }
.hero-stats dt { font-size: 12.5px; color: var(--ink-4); letter-spacing: .02em; }
.hero-stats dd { margin: 0; font-family: var(--ff-serif); font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; }

.notice-bar { background: var(--brand-tint); border-top: 1px solid var(--brand-line); border-bottom: 1px solid var(--brand-line); }
.notice-bar .wrap { padding: 11px 24px; }
.notice-bar p { font-size: 13.5px; color: var(--brand-ink); text-align: center; }

/* ===================== 区块 ===================== */
.section { padding: 68px 0; }
.section-alt { background: var(--bg-2); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.sec-head.center { justify-content: center; text-align: center; }
.sec-eyebrow { font-size: 11.5px; letter-spacing: .14em; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.sec-title { font-family: var(--ff-serif); font-size: clamp(25px, 3.2vw, 33px); letter-spacing: -.01em; }
.sec-desc { font-size: 15px; color: var(--ink-3); max-width: 560px; margin-top: 10px; }
.sec-more { font-size: 14px; color: var(--brand-ink); white-space: nowrap; padding-bottom: 4px; }

.page-title { font-family: var(--ff-serif); font-size: clamp(27px, 3.6vw, 38px); letter-spacing: -.01em; }
.page-sub { font-size: 15px; color: var(--ink-3); margin-top: 8px; }

.center-more { text-align: center; margin-top: 34px; }
.center-block { text-align: center; }
.center-block .res-actions { justify-content: center; }
.err-code { font-family: var(--ff-serif); font-size: 60px; color: var(--brand); line-height: 1; margin-bottom: 10px; }

/* ===================== 商品网格 ===================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 22px; }

.p-card {
  background: #fff; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s, transform .2s;
}
.p-card:hover { box-shadow: inset 0 0 0 1px var(--brand-line), var(--sh-3); transform: translateY(-3px); }
.p-card.is-out { opacity: .68; }
.p-link { display: block; color: inherit; }
.p-cover {
  position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center;
  background: var(--grad-soft, linear-gradient(160deg, var(--brand-soft), #fffdfc));
  overflow: hidden;
}
.p-cover img { width: 100%; height: 100%; object-fit: cover; }
.p-initial {
  font-family: var(--ff-serif); font-size: 58px; font-weight: 700; color: var(--brand);
  opacity: .3; user-select: none;
}
.p-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 100px; letter-spacing: .02em;
}
.p-badge.inline { position: static; display: inline-block; margin-left: 6px; vertical-align: 1px; }
.p-out {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(22, 17, 15, .42); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .06em;
}
.p-body { padding: 16px 18px 18px; }
.p-cat { font-size: 11.5px; color: var(--ink-4); letter-spacing: .04em; margin-bottom: 5px; }
.p-title { font-size: 16.5px; font-weight: 700; line-height: 1.38; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-sub {
  font-size: 13px; color: var(--ink-3); line-height: 1.55; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px;
}
.p-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.p-price { font-family: var(--ff-serif); font-size: 20px; font-weight: 700; color: var(--brand); }
.p-origin { font-family: var(--ff-sans); font-size: 12.5px; color: var(--ink-4); font-weight: 400; margin-left: 6px; text-decoration: line-through; }
.p-stock { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }

.empty { padding: 60px 0; text-align: center; color: var(--ink-4); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  padding: 6px 15px; border-radius: 100px; font-size: 13.5px; color: var(--ink-2);
  background: #fff; box-shadow: inset 0 0 0 1px var(--line); transition: all .16s;
}
.chip:hover { color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-line); }
.chip.is-on { background: var(--brand); color: #fff; box-shadow: none; font-weight: 600; }

.search { display: flex; gap: 0; flex: none; }
.search input {
  width: 200px; padding: 9px 14px; border: 1px solid var(--line); border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm); font-size: 14px; background: #fff;
}
.search input:focus { outline: none; border-color: var(--brand-line); }
.search button {
  padding: 9px 16px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.search button:hover { background: var(--brand-deep); }

/* ===================== 流程 / 信任 ===================== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.steps li { background: #fff; padding: 26px 24px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.step-no { display: block; font-family: var(--ff-serif); font-size: 27px; font-weight: 700; color: var(--brand); opacity: .32; margin-bottom: 12px; }
.steps h3 { font-size: 17px; margin-bottom: 7px; }
.steps p { font-size: 14px; color: var(--ink-3); line-height: 1.65; }

.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 30px; }
.trust-item h4 { font-size: 15.5px; margin-bottom: 7px; padding-left: 16px; position: relative; }
.trust-item h4::before {
  content: ''; position: absolute; left: 0; top: .55em; width: 7px; height: 7px;
  border-radius: 2px; background: var(--brand);
}
.trust-item p { font-size: 13.5px; color: var(--ink-3); line-height: 1.65; }

/* ===================== FAQ ===================== */
.faq-list { display: flex; flex-direction: column; gap: 0; background: #fff; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.qa { border-bottom: 1px solid var(--line-2); }
.qa:last-child { border-bottom: 0; }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 22px; font-size: 15.5px; font-weight: 600; cursor: pointer; list-style: none;
  transition: background .16s, color .16s;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: '+'; flex: none; font-size: 19px; font-weight: 400; color: var(--brand);
  line-height: 1; transition: transform .2s;
}
.qa[open] summary::after { content: '−'; }
.qa summary:hover { background: var(--brand-soft); color: var(--brand-ink); }
.qa-a { padding: 0 22px 18px; }
.qa-a p { font-size: 14.5px; color: var(--ink-3); line-height: 1.75; }
.faq-group { margin-bottom: 34px; }
.faq-group > h2 { font-family: var(--ff-serif); font-size: 20px; margin-bottom: 12px; }

/* ===================== 面包屑 ===================== */
.crumbs { padding: 18px 0 0; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-4); }
.crumbs li { display: inline; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brand); }
.crumbs li[aria-current] { color: var(--ink-4); }
.crumbs .sep { color: var(--line); }

/* ===================== 商品详情 ===================== */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.d-main { min-width: 0; }
.d-cat { font-size: 12.5px; color: var(--ink-4); letter-spacing: .04em; margin-bottom: 8px; }
.d-title { font-family: var(--ff-serif); font-size: clamp(26px, 3.4vw, 36px); line-height: 1.28; margin-bottom: 9px; }
.d-sub { font-size: 15.5px; color: var(--ink-3); line-height: 1.65; }
.d-price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 24px 0; margin: 22px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.d-price { font-family: var(--ff-serif); font-size: 38px; font-weight: 700; color: var(--brand); line-height: 1; }
.d-origin { font-size: 15px; color: var(--ink-4); text-decoration: line-through; }
.d-stock { margin-left: auto; font-size: 13px; color: var(--ink-3); background: var(--bg-3); padding: 5px 12px; border-radius: 100px; }
.d-stock.is-out { background: var(--err-bg); color: var(--err); }

.d-buy { background: var(--bg-2); border-radius: var(--r-lg); padding: 24px; margin-bottom: 34px; }
.d-buy-note { font-size: 13.5px; color: var(--ink-3); margin-bottom: 18px; }
.d-buy-note b { color: var(--ink); }
.d-field { margin-bottom: 16px; }
.d-field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.d-field label span { font-weight: 400; color: var(--ink-4); margin-left: 6px; font-size: 12.5px; }
.d-field input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 15px; background: #fff; transition: border-color .16s, box-shadow .16s;
}
.d-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.field-err { font-size: 13px; color: var(--err); margin-top: 6px; }

.d-pay { margin-bottom: 18px; }
.d-pay-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 9px; }
.pm-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pm {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  background: #fff; border-radius: var(--r-sm); cursor: pointer; font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--line); transition: all .16s;
}
.pm input { position: absolute; opacity: 0; width: 0; height: 0; }
.pm:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--brand); background: var(--brand-soft); }
.pm-ico {
  width: 19px; height: 19px; display: grid; place-items: center; border-radius: 4px;
  color: #fff; font-size: 11px; font-weight: 700;
}
.pm-ico.alipay { background: #1677ff; }
.pm-ico.wechat { background: #07c160; }
.d-tip { font-size: 12.5px; color: var(--ink-4); margin-top: 12px; text-align: center; }

.d-block { margin-bottom: 34px; }
.d-block h2 { font-family: var(--ff-serif); font-size: 20px; margin-bottom: 14px; }
.d-list { display: flex; flex-direction: column; gap: 9px; }
.d-list li { position: relative; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.d-list li::before { content: ''; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-line); }

.d-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.side-card { background: #fff; border-radius: var(--r); padding: 20px; box-shadow: inset 0 0 0 1px var(--line); }
.side-card h3 { font-size: 14.5px; margin-bottom: 9px; }
.side-card p { font-size: 13.5px; color: var(--ink-3); line-height: 1.65; }
.side-muted { color: var(--ink-4) !important; font-size: 12.5px !important; margin-top: 6px; }
.side-list { display: flex; flex-direction: column; gap: 10px; }
.side-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.side-list a { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list a:hover { color: var(--brand); }
.side-list span { color: var(--brand); font-weight: 600; flex: none; }

/* ===================== 弹层（购买结果） ===================== */
.ovl { position: fixed; inset: 0; z-index: 80; background: rgba(22, 17, 15, .45); backdrop-filter: blur(3px); }
.modal {
  position: fixed; z-index: 90; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: 34px 30px 28px; text-align: center;
}
.modal-x { position: absolute; right: 14px; top: 12px; width: 32px; height: 32px; border-radius: 50%; color: var(--ink-4); font-size: 15px; display: grid; place-items: center; }
.modal-x:hover { background: var(--bg-3); color: var(--ink); }
.modal-body h3 { font-family: var(--ff-serif); font-size: 22px; margin-bottom: 8px; }
.modal-body > p { font-size: 14px; color: var(--ink-3); }
.spin {
  width: 34px; height: 34px; margin: 0 auto 18px; border-radius: 50%;
  border: 2.5px solid var(--brand-line); border-top-color: var(--brand); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.res-ico {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-bg); color: var(--ok);
}
.res-ico svg { width: 26px; height: 26px; }
.is-wait .res-ico { background: var(--warn-bg); color: var(--warn); }
.modal .res-deliver, .result-card .res-deliver {
  margin: 20px 0; padding: 16px; background: var(--bg-2); border-radius: var(--r); text-align: left;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.res-deliver pre {
  font-size: 13px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; word-break: break-word;
  max-height: 190px; overflow-y: auto; margin-bottom: 10px;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; background: var(--brand); color: #fff;
}
.copy-btn:hover { background: var(--brand-deep); }
.copy-btn.is-done { background: var(--ok); }
.res-meta { display: flex; flex-direction: column; gap: 7px; margin: 18px 0; text-align: left; }
.res-meta > div { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.res-meta dt { color: var(--ink-4); }
.res-meta dd { margin: 0; font-weight: 600; color: var(--ink); word-break: break-all; text-align: right; }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ===================== 内容页 ===================== */
.how-list { display: flex; flex-direction: column; gap: 0; margin: 34px 0; }
.how-list li { display: flex; gap: 22px; padding: 26px 0; border-bottom: 1px solid var(--line-2); }
.how-list li:last-child { border-bottom: 0; }
.how-n { font-family: var(--ff-serif); font-size: 26px; font-weight: 700; color: var(--brand); opacity: .35; flex: none; width: 46px; line-height: 1.2; }
.how-list h2 { font-size: 18px; margin-bottom: 8px; }
.how-list p { font-size: 14.5px; color: var(--ink-3); line-height: 1.75; }

.callout { background: var(--bg-2); border-radius: var(--r); padding: 22px 24px; margin-bottom: 18px; border-left: 3px solid var(--brand-line); }
.callout h3 { font-size: 15.5px; margin-bottom: 8px; }
.callout p { font-size: 14px; color: var(--ink-3); line-height: 1.75; }

.prose { margin-top: 30px; }
.prose h2 { font-family: var(--ff-serif); font-size: 23px; margin: 42px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 15px; color: var(--ink-2); line-height: 1.85; margin-bottom: 14px; }
.prose ul { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 18px; }
.prose li { position: relative; padding-left: 20px; font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }
.prose li::before { content: ''; position: absolute; left: 3px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .45; }
.prose b { color: var(--ink); }

/* ===================== 表单 / 账户 ===================== */
.auth { padding: 60px 0 80px; background: var(--bg-2); min-height: 62vh; }
.auth-wrap { max-width: 440px; }
.auth-card { background: #fff; border-radius: var(--r-lg); padding: 38px 34px; box-shadow: var(--sh-2); }
.auth-card h1 { font-family: var(--ff-serif); font-size: 27px; margin-bottom: 8px; }
.auth-sub { font-size: 13.5px; color: var(--ink-3); line-height: 1.65; margin-bottom: 26px; }
.f-field { margin-bottom: 17px; }
.f-field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.f-field label .opt { font-weight: 400; color: var(--ink-4); font-size: 12px; margin-left: 6px; }
.f-field input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 15px; background: #fff; transition: border-color .16s, box-shadow .16s;
}
.f-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.f-hint { display: block; font-size: 12px; color: var(--ink-4); margin-top: 6px; }
.form-err { background: var(--err-bg); color: var(--err); font-size: 13.5px; padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 18px; }
.flash { background: var(--ok-bg); color: var(--ok); font-size: 14px; padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 22px; }
.auth-alt { font-size: 13.5px; color: var(--ink-3); margin-top: 16px; text-align: center; }
.auth-alt a { font-weight: 600; }
.auth-fine { font-size: 11.5px; color: var(--ink-4); margin-top: 18px; text-align: center; line-height: 1.6; }
.auth-fine a { color: var(--ink-3); text-decoration: underline; }

.acct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.acct-out { flex: none; }
.acct-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 34px; }
.acct-stats > div { background: var(--bg-2); border-radius: var(--r); padding: 16px 24px; min-width: 130px; }
.acct-stats dt { font-size: 12.5px; color: var(--ink-4); margin-bottom: 3px; }
.acct-stats dd { margin: 0; font-family: var(--ff-serif); font-size: 24px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.acct-sec { margin-bottom: 40px; }
.acct-sec > h2 { font-family: var(--ff-serif); font-size: 20px; margin-bottom: 16px; }
.claim-form { display: flex; gap: 10px; max-width: 460px; margin-top: 12px; }
.claim-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; }
.claim-form input:focus { outline: none; border-color: var(--brand); }

.ord-list { display: flex; flex-direction: column; gap: 14px; }
.ord { background: #fff; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); padding: 20px 22px; }
.ord-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ord-title { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; }
.ord-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-4); }
.ord-st { flex: none; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 100px; }
.ord-st.ok { background: var(--ok-bg); color: var(--ok); }
.ord-st.wait { background: var(--warn-bg); color: var(--warn); }
.ord-st.mute { background: var(--bg-3); color: var(--ink-4); }
.ord-deliver { margin-top: 14px; padding: 14px 16px; background: var(--bg-2); border-radius: var(--r-sm); }
.ord-deliver pre { font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow-y: auto; margin-bottom: 9px; }
.muted { font-size: 13.5px; color: var(--ink-4); }
.empty-state { text-align: center; padding: 46px 20px; background: var(--bg-2); border-radius: var(--r-lg); }
.empty-state p { font-size: 15px; margin-bottom: 8px; }
.empty-state .btn { margin-top: 16px; }

.result-card { background: #fff; border-radius: var(--r-xl); padding: 40px 34px; box-shadow: var(--sh-2); text-align: center; margin-top: 20px; }
.result-card h1 { font-family: var(--ff-serif); font-size: 28px; margin-bottom: 8px; }
.res-sub { font-size: 14.5px; color: var(--ink-3); }
.result-card .res-deliver { text-align: left; }

/* ===================== 页脚 ===================== */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-top: 52px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; padding-bottom: 40px; }
.f-brand b { font-family: var(--ff-serif); font-size: 19px; display: block; margin-bottom: 7px; }
.f-brand p { font-size: 13px; color: var(--ink-4); line-height: 1.7; }
.f-contact { margin-top: 8px; color: var(--ink-3) !important; }
.f-col { display: flex; flex-direction: column; gap: 9px; }
.f-col h4 { font-size: 13px; color: var(--ink); font-weight: 700; margin-bottom: 3px; letter-spacing: .02em; }
.f-col a { font-size: 13px; color: var(--ink-3); }
.f-col a:hover { color: var(--brand); }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 22px; padding-bottom: 30px; border-top: 1px solid var(--line);
}
.f-note { font-size: 12px; color: var(--ink-4); }
.f-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-4); }
.f-legal a { color: var(--ink-4); }
.f-legal a:hover { color: var(--brand); }

/* ===================== 响应式 ===================== */
@media (max-width: 1080px) {
  .detail { grid-template-columns: minmax(0, 1fr) 260px; gap: 34px; }
  .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
}

@media (max-width: 900px) {
  .topbar-inner { gap: 14px; }
  .nav { display: none; }
  .burger { display: flex; margin-left: auto; }
  .top-actions { margin-left: 0; }
  .m-nav[hidden] { display: none; }
  .m-nav:not([hidden]) { display: block; }
  .detail { grid-template-columns: 1fr; gap: 30px; }
  .d-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-card { flex: 1 1 240px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .f-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .section { padding: 46px 0; }
  .hero { padding: 52px 0 44px; }
  .hero-stats { gap: 26px; }
  .hero-stats dd { font-size: 22px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .search { width: 100%; }
  .search input { flex: 1; width: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .p-body { padding: 13px 14px 15px; }
  .p-title { font-size: 14.5px; }
  .p-sub { font-size: 12px; min-height: 2.4em; margin-bottom: 10px; }
  .p-price { font-size: 17px; }
  .p-initial { font-size: 42px; }
  .steps { gap: 14px; }
  .steps li { padding: 20px 18px; }
  .d-price { font-size: 30px; }
  .d-buy { padding: 20px 18px; }
  .modal { padding: 30px 22px 24px; }
  .auth-card { padding: 30px 22px; }
  .acct-stats > div { padding: 13px 18px; min-width: 104px; }
  .acct-stats dd { font-size: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 20px; }
  .ord-top { flex-direction: column; gap: 10px; }
  .ord-meta { gap: 4px 12px; }
  .how-list li { gap: 14px; padding: 20px 0; }
  .how-n { width: 34px; font-size: 21px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 30px; }
  .hero-sub { font-size: 15px; }
  .hero-cta .btn { flex: 1 1 140px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .p-cover { aspect-ratio: 4 / 3; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .claim-form { flex-direction: column; }
  .brand-text i { display: none; }
  .top-primary { padding: 7px 12px; }
  .top-link { padding: 7px 10px; font-size: 13.5px; }
  .theme-panel { width: 236px; }
}

@media (max-width: 360px) {
  .theme-panel { width: 210px; padding: 12px; }
  .tp-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .brand-text b { font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; }
  .top-link { padding: 7px 9px; font-size: 13px; }
  .hero-title { font-size: 27px; }
  .grid { gap: 9px; }
  .p-body { padding: 11px 12px 13px; }
  .acct-stats > div { min-width: 92px; padding: 11px 14px; }
}
