/* 商城样式。字体自托管，无外部资源；浅色 / 深色跟随系统。
 * 主按钮固定用 --ink；品牌色只进 --accent（/static/brand.css 覆盖），不直接改按钮。 */
/* 自托管字体（SIL OFL 1.1，许可文本在 fonts/OFL-*.txt）。只含拉丁子集；中文走系统字体。
 * 文件名带上游版本号，/static/fonts/ 按不可变资源长期缓存，换版本时改文件名。 */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/static/fonts/space-grotesk-latin-v22.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-v24.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light dark;
  --ground: #f3f4f5; --surface: #ffffff; --surface-2: #f8f9fa;
  --ink: #0d0f12; --ink-2: #3a3f47; --muted: #5b616b;
  --line: #d9dce0; --line-strong: #c4c8ce;
  --on-ink: #ffffff;
  --accent: #c8f03c; --on-accent: #0d0f12;
  --shop-focus: var(--ink);
  --info: #1f5fe0; --info-bg: #e3ecff; --info-fg: #123e9c;
  --warn: #c2410c; --warn-bg: #fff1dc; --warn-fg: #5a3300;
  --bad: #9a1c10; --bad-bg: #fde8e6;
  --ok: #17663a; --ok-bg: #e3f4ea;
  --cover-lime: #e8f6b4; --cover-blue: #dfe8ff; --cover-mint: #d6f0e2;
  --cover-sand: #f2e8d8; --cover-lilac: #e9e1fa; --cover-slate: #22262c; --cover-slate-fg: #f3f4f5;
  --ticket-bg: #0d0f12; --ticket-fg: #ffffff; --ticket-muted: #a9afb8;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-btn: 12px;
  --gap: 16px;
  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* 跟随系统：只有买家没有手动选浅色时才用深色 token（data-theme="light" 覆盖系统偏好）。 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d0f12; --surface: #1a1d22; --surface-2: #22262c;
    --ink: #f3f4f5; --ink-2: #c9ced6; --muted: #a9afb8;
    --line: #2f343b; --line-strong: #454b54;
    --on-ink: #0d0f12;
    --shop-focus: var(--accent);
    --info: #7ea6ff; --info-bg: #17264a; --info-fg: #c3d5ff;
    --warn: #ff9d5c; --warn-bg: #3a2408; --warn-fg: #ffd9a8;
    --bad: #ff8a7d; --bad-bg: #3d1512;
    --ok: #5fd08f; --ok-bg: #12301f;
    --cover-lime: #2a3310; --cover-blue: #1a2945; --cover-mint: #163326;
    --cover-sand: #352818; --cover-lilac: #302344; --cover-slate: #22262c; --cover-slate-fg: var(--ink);
    --ticket-bg: #000000;
  }
}
/* 手动选深色：token 必须与上面系统深色块逐字一致（CSS 不能复用，theme_test.go 断言两处相同）。 */
:root[data-theme="dark"] {
  --ground: #0d0f12; --surface: #1a1d22; --surface-2: #22262c;
  --ink: #f3f4f5; --ink-2: #c9ced6; --muted: #a9afb8;
  --line: #2f343b; --line-strong: #454b54;
  --on-ink: #0d0f12;
  --shop-focus: var(--accent);
  --info: #7ea6ff; --info-bg: #17264a; --info-fg: #c3d5ff;
  --warn: #ff9d5c; --warn-bg: #3a2408; --warn-fg: #ffd9a8;
  --bad: #ff8a7d; --bad-bg: #3d1512;
  --ok: #5fd08f; --ok-bg: #12301f;
  --cover-lime: #2a3310; --cover-blue: #1a2945; --cover-mint: #163326;
  --cover-sand: #352818; --cover-lilac: #302344; --cover-slate: #22262c; --cover-slate-fg: var(--ink);
  --ticket-bg: #000000;
}
/* 手动选择时固定 color-scheme：表单控件、滚动条与系统配色跟随所选主题。 */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  * { animation: none !important; transition: none !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.55;
}
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--info); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1 { font-size: 2rem; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 12px; }
h2 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 10px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
main.container { padding-top: 28px; padding-bottom: 72px; min-height: 60vh; }
/* 跳到主内容：平时移出视口，键盘聚焦时显示在左上角 */
.skip-link { position: absolute; left: 8px; top: 8px; z-index: 100; transform: translateY(-200%); padding: 8px 14px; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus-visible { transform: none; }
/* 仅供读屏的隐藏文本：统一用 .visually-hidden；.sr-only 是其别名，只留给尚未迁移的购物车 / 结算模板。 */
.visually-hidden, .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 页头 / 页脚 */
.market-closed { background: var(--warn-bg); color: var(--warn-fg); border-bottom: 1px solid var(--line); font-weight: 600; padding: 10px 0; text-align: center; }
.site-header { border-bottom: 1px solid var(--line); background: var(--ground); }
.store-preferences { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.store-preferences button { min-height: 36px; padding: 3px 8px; font: inherit; cursor: pointer; }
.store-market { white-space: nowrap; font-variant-numeric: tabular-nums; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; max-width: 100%; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.brand:hover { color: var(--ink); }
.brand img { height: 28px; max-width: 128px; width: auto; object-fit: contain; border-radius: var(--r-sm); }
.brand-mark { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--ticket-bg); display: inline-flex; align-items: center; justify-content: center; }
.brand-mark::after { content: ""; width: 12px; height: 12px; border-radius: 2px; background: var(--accent); }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md); color: var(--ink); font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.nav-cta { border: 1px solid var(--ink); }
.header-search { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.header-search input[type=search] { width: 220px; max-width: 100%; min-height: 40px; padding: 6px 12px; }
.header-search button { flex: none; min-height: 40px; padding: 0 14px; }
.badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-family: var(--font-mono); font-size: .75rem; text-align: center; line-height: 22px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; padding: 28px 0 36px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.footer-row > div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.footer-brand { color: var(--ink); font-weight: 700; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }
/* 页脚外观切换：三个整页提交的按钮，不抢页脚导航的位置；每个都保留 44px 触控高度。 */
.theme-switch { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; max-width: 100%; }
.theme-switch button {
  min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-md);
  background: none; color: var(--muted); font: inherit; font-size: .8125rem; font-weight: 400;
}
.theme-switch button:hover { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
.theme-switch button[aria-pressed="true"] { border-color: var(--line-strong); color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .theme-switch { width: 100%; }
}
.legal { margin-top: 6px; max-width: 40em; white-space: pre-wrap; overflow-wrap: anywhere; }

/* 通用块 */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; margin-bottom: var(--gap); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.row { display: flex; gap: var(--gap); flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.pre, .prose { white-space: pre-wrap; color: var(--ink-2); max-width: 44em; }
.strike { text-decoration: line-through; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.tag { display: inline-block; padding: 1px 9px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); font-size: .8125rem; color: var(--ink-2); text-decoration: none; }
.tag--accent { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 700; }
.tag--info { background: var(--info-bg); color: var(--info-fg); border-color: transparent; font-weight: 700; }

/* 搜索页 */
.search-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.search-form input[type=search] { flex: 1 1 260px; max-width: 440px; }
.search-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.search-empty p { margin: 0; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .8125rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.table-wrap { overflow-x: auto; }

/* 表单 */
form.inline { display: inline; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { color: var(--muted); font-size: .8125rem; }
.field .error, .error-text { color: var(--bad); font-size: .875rem; font-weight: 600; }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; max-width: 440px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-btn);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem;
}
input.qty { width: 112px; font-family: var(--font-mono); font-weight: 700; }
input[type=checkbox], input[type=radio], input.check { width: 18px; height: 18px; accent-color: var(--ink); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0 4px; }
.choice { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 0; min-height: 44px; }

/* 按钮：默认是次级；.primary 是唯一的主操作，固定墨色 */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-btn); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { border-color: var(--ink); color: var(--ink); }
button.primary, .button.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 700; }
.button-secondary { border-color: var(--ink); }
button.danger, .button.danger { color: var(--bad); border-color: var(--bad); }
button.link { min-height: 44px; border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
button:disabled, button.primary:disabled { background: var(--line-strong); border-color: var(--line-strong); color: var(--ink); cursor: not-allowed; }
.button.is-disabled { background: var(--line-strong); border-color: var(--line-strong); color: var(--muted); cursor: not-allowed; pointer-events: none; }
.button-lg { min-height: 56px; padding: 0 26px; border-radius: 14px; font-size: 1.125rem; }
.button-block { display: flex; width: 100%; }

/* 提示条与状态 */
.notice { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: var(--gap); border: 1px solid var(--line-strong); background: var(--surface); }
.notice-info { background: var(--info-bg); color: var(--info-fg); border-color: transparent; }
.notice-success { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.notice-warning { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.notice-error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); font-weight: 600; }
.notice a { color: inherit; font-weight: 700; }
.status { display: inline-block; padding: 2px 10px; border-radius: var(--r-sm); font-size: .8125rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--ink-2); }
.status-pending { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.status-paid, .status-completed { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.status-cancelled, .status-failed { border-style: dashed; color: var(--muted); }
.status-abnormal { color: var(--bad); border: 2px solid var(--bad); }

/* 交付内容与金额摘要 */
.mono { font-family: var(--font-mono); word-break: break-all; }
.secret { background: var(--ground); border-radius: var(--r-md); padding: 12px 16px; font-size: 1.0625rem; letter-spacing: .03em; }
.qr { display: block; width: 176px; height: 176px; border-radius: var(--r-md); background: #ffffff; }
.summary { max-width: 440px; margin-left: auto; }
.summary .spread { padding: 4px 0; }
.summary .total { border-top: 2px dashed var(--line-strong); margin-top: 8px; padding-top: 12px; font-size: 1.25rem; font-weight: 700; }
/* 键值摘要（钱包 / 提现 / 推广的金额区块）：左对齐、按宽度自动分列；.summary 只给购物车合计与订单付款明细用 */
dl.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 14px 24px; margin: 0 0 12px; }
.kv > div { min-width: 0; }
.kv dt { color: var(--muted); font-size: .8125rem; }
.kv dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* 票据：只用于订单 / 交付内容 / 订单摘要 */
.ticket { display: flex; flex-direction: column; }
.ticket-head { background: var(--ticket-bg); color: var(--ticket-fg); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 22px 26px; }
.ticket-head .muted { color: var(--ticket-muted); }
.ticket-title { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.ticket-tear { border-top: 2px dashed var(--ticket-bg); margin: 0 14px; }
.ticket-body { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); padding: 22px 26px; display: flex; flex-direction: column; gap: 10px; }
.ticket-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ground); border-radius: var(--r-md); padding: 12px 14px; font-family: var(--font-mono); }

/* 首页 */
.home :focus-visible, .home-header :focus-visible, .card :focus-visible { outline-color: var(--shop-focus); }
.home-info { background: var(--ticket-bg); color: var(--ticket-fg); font-size: .875rem; }
.home-info .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding-block: 8px; }
.home-info a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.home-info strong { font-family: var(--font-mono); }
.home-header { background: var(--surface); }
.home-header .header-row { display: grid; grid-template-columns: minmax(0, auto) minmax(220px, 1fr) auto; gap: 12px 24px; padding-block: 12px; }
.home-header .brand { max-width: 15em; }
.home-header .brand-mark, .home-header .brand img { flex: none; }
.home-header .nav a:hover { background: var(--ground); }
.home-header .nav .badge { background: var(--accent); color: var(--on-accent); }
.home-search { min-width: 0; align-self: center; }
.home-search .header-search { border: 2px solid var(--ink); border-radius: var(--r-btn); gap: 0; margin: 0; }
.home-search .header-search input[type=search] { flex: 1 1 0; min-width: 0; max-width: none; min-height: 44px; border: 0; background: none; }
.home-search .header-search input[type=search]:focus-visible { outline-offset: -2px; }
.home-search .header-search button { min-height: 44px; background: var(--ink); color: var(--on-ink); border-color: var(--ink); border-radius: 0 calc(var(--r-btn) - 2px) calc(var(--r-btn) - 2px) 0; }
.home-search-terms { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; color: var(--muted); font-size: .8125rem; }
.home-search-terms a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding-inline: 2px; overflow-wrap: anywhere; }
.home-category-nav .chips { border-top: 1px solid var(--line); padding: 8px 0; }
.home-category-nav .chip:not([aria-current]) { border-color: transparent; }
.home-category-nav .chip:hover { border-color: var(--line-strong); }

.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.home-hero-grid:not(:has(.home-hero-side)) { grid-template-columns: minmax(0, 1fr); }
.home-hero {
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-width: 0;
  padding: clamp(24px, 4vw, 44px); background: var(--ticket-bg); color: var(--ticket-fg);
  border-radius: var(--r-xl); border: 1px solid var(--ticket-bg);
  background-image: radial-gradient(circle at right top, transparent 112px, #2f343b 113px 114px, transparent 115px 174px, #2f343b 175px 176px, transparent 177px);
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; min-width: 0; }
.hero-kicker { margin: 0; padding: 4px 10px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font: 600 .8125rem var(--font-mono); }
.hero-title { margin: 0; font-size: clamp(2rem, 4vw, 3.625rem); line-height: 1.08; letter-spacing: -.04em; max-width: 16em; text-wrap: balance; }
.hero-title:lang(zh) { word-break: keep-all; }
.hero-lead { margin: 0; max-width: 40em; color: var(--ticket-muted); font-size: 1.0625rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .button { min-height: 52px; border-radius: var(--r-btn); }
.button.home-accent-button, button.home-accent-button { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.button.home-on-dark { color: var(--ticket-fg); background: transparent; border-color: var(--ticket-muted); }
.button.home-on-dark:hover { border-color: var(--ticket-fg); }
.home-info :focus-visible, .home-hero :focus-visible, .home-account--dark :focus-visible, .home .lookup-band :focus-visible { outline-color: var(--accent); }
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr)); gap: 12px; border-top: 1px solid #2f343b; padding-top: 20px; margin: 4px 0 0; width: 100%; }
.home-stats dt { color: var(--ticket-muted); font-size: .8125rem; }
.home-stats dd { margin: 4px 0 0; color: var(--ticket-fg); font: 600 clamp(1rem, 2.2vw, 1.625rem) / 1.25 var(--font-mono); overflow-wrap: anywhere; }
.home-hero-side { display: flex; flex-direction: column; min-width: 0; gap: 16px; }
.home-featured, .home-ticker { min-width: 0; padding: 20px 24px; border-radius: var(--r-xl); }
.home-featured { background: var(--accent); color: var(--on-accent); }
.home-featured h2, .home-ticker h2 { font-size: 1.125rem; margin: 0; }
.home-featured p, .home-featured small { color: inherit; }
.home-featured p { margin: 0; }
.home-featured :focus-visible { outline-color: var(--on-accent); }
.home-featured .home-coupon-value { font-size: 2.5rem; }
.home-ticker { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.home-ticker h2 { display: flex; gap: 10px; align-items: center; }
.home-ticker h2::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.home-ticker ul { display: flex; flex-direction: column; list-style: none; padding: 0; margin: 8px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .home-ticker ul { animation: home-ticker-enter .45s ease-out; }
  @keyframes home-ticker-enter { from { transform: translateY(6px); } }
}
.home-ticker li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .875rem; }
.home-ticker li > * { min-width: 0; overflow-wrap: anywhere; }
.home-ticker li > span:not(.mono) { flex: 1 1 120px; }
.home-ticker li time, .home-ticker li .mono { color: var(--muted); font-size: .75rem; }

.home-section { margin-top: clamp(32px, 4.5vw, 56px); }
.home-section .section-head { align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.home-section .section-head h2 { font-size: clamp(1.375rem, 2vw, 1.75rem); }
.home-section .section-head p { margin: 4px 0 0; color: var(--muted); }
.home-section .section-head > a { display: inline-flex; align-items: center; min-height: 44px; }
.home-icon { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-btn); background: var(--ground); font-size: 1.25rem; font-weight: 700; }
.home-benefits, .home-categories, .home-delivery { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0; }
.home-benefits { grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); margin-top: 16px; }
.home-benefits li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.home-benefits strong { display: block; }
.home-benefits p { margin: 0; font-size: .8125rem; }
.home-benefits p, .home-category small { color: var(--muted); }
.home-categories { grid-template-columns: repeat(auto-fit, minmax(min(165px, 100%), 1fr)); }
.home-category { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; min-width: 0; min-height: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.home-category:hover { color: var(--ink); border-color: var(--ink); }
.home-category .home-icon { margin-bottom: 4px; }
.home-category .tag { max-width: 100%; }
.home-merchandising { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; }
.home-merchandising > :only-child { grid-column: 1 / -1; }
.home-merchandising > :not(:only-child) .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-hot-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.home-hot-list { list-style: none; margin: 0; padding: 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
.home-hot-list li + li { border-top: 1px solid var(--line); }
.home-hot-list a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 54px; padding: 8px 0; text-decoration: none; }
.home-hot-list a > div { flex: 1 1 90px; min-width: 0; overflow-wrap: anywhere; }
.home-hot-list a strong, .home-hot-list a small { display: block; }
.home-hot-list a small, .home-hot-sold { color: var(--muted); font-size: .8125rem; }
.home-hot-rank { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--ground); color: var(--ink); font-family: var(--font-mono); font-weight: 700; }
.home-hot-list li:first-child .home-hot-rank { background: var(--accent); color: var(--on-accent); }
.home-coupons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.home-coupon { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--r-lg); }
.home-coupon h3, .home-coupon p { margin: 0; }
.home-coupon p, .home-coupon small { color: var(--muted); }
.home-coupon-value { display: block; margin: 6px 0; font: 600 1.75rem / 1.1 var(--font-mono); }
.home-coupon-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: 100%; padding: 6px 10px; border: 1px dashed currentColor; border-radius: var(--r-btn); overflow-wrap: anywhere; }
.home-coupon-code code { font: 600 1rem var(--font-mono); }
.home-coupon-code button[hidden] { display: none; }
.home-featured .home-coupon-code { margin: 8px 0; }
.home-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.home-filters label { display: inline-flex; align-items: center; gap: 6px; margin: 0; min-height: 44px; }
.home-filters label:has(input) { padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; }
.home-filters select { width: auto; min-height: 44px; max-width: 100%; }

.home-delivery { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.home-delivery > * { padding: 20px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.home-delivery h3 { margin: 10px 0 4px; }
.home-delivery p { color: var(--muted); margin: 0; }
.steps { list-style: none; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; gap: 10px; min-width: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-sm); font: 600 .8125rem var(--font-mono); background: var(--ground); color: var(--ink); }
.steps strong { display: block; font-size: 1.0625rem; }
.home-account { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr)); gap: 16px; }
.home-account > * { display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.home-account ul { padding-left: 20px; }
.home-account p { margin: 6px 0 14px; }
.home-account .home-icon { margin-bottom: 10px; }
.home-account .home-account--dark { background: var(--ticket-bg); color: var(--ticket-fg); border-color: var(--ticket-bg); }
.home-account--dark p { color: var(--ticket-muted); }
.home-account--dark .home-icon { background: var(--accent); color: var(--on-accent); }
.home-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px 32px; }
.home-faq details { border-bottom: 1px solid var(--line); }
.home-faq details:first-of-type { border-top: 1px solid var(--line); }
.home-faq summary { display: flex; gap: 10px; justify-content: space-between; align-items: center; min-height: 52px; padding: 6px 4px; font-weight: 600; cursor: pointer; list-style: none; }
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq summary::after { content: ""; flex: none; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 6px 5px; }
.home-faq details[open] > summary::after { transform: rotate(225deg); margin-block: 5px 0; }
.home-faq details p { margin: 0 4px 14px; color: var(--ink-2); overflow-wrap: anywhere; }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h1, .section-head h2 { margin: 0; font-size: 2.25rem; letter-spacing: -0.03em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 500; text-decoration: none; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-current] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 600; }

/* 商品卡片与封面 */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
@media (hover: hover) {
  .card:hover { border-color: var(--ink); box-shadow: 0 10px 28px rgba(13, 15, 18, .08); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translateY(-2px); }
}
.card-link { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.card-link:hover { color: var(--ink); }
.card-link:focus-visible { border-radius: calc(var(--r-lg) - 1px); }
.card-body { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.card-title { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-trust { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .8125rem; }
.card-trust li { min-width: 0; overflow-wrap: anywhere; }
.card-trust li + li::before { content: "·"; padding-right: 6px; color: var(--muted); }
.card-stock--ample, .card-stock--low { font-weight: 600; }
.card-stock--ample { color: var(--ok); }
.card-stock--low { color: var(--warn-fg); }
.card-foot { margin-top: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.price-lg { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card .price-lg { font-family: var(--font-mono); font-size: clamp(1rem, 2vw, 1.375rem); overflow-wrap: anywhere; }
.card-member { color: var(--ink-2); font-size: .8125rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.card-actions .button:not(.card-cart) { flex: 1 1 0; min-width: 44px; padding: 0 10px; text-align: center; }
.card-cart { flex: none; width: 44px; padding: 0; }
.card-cart span { font-size: 1.25rem; line-height: 1; }
.cover { height: 168px; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.cover-meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: .75rem; }
.cover-glyph { font-size: 4rem; font-weight: 700; letter-spacing: -0.05em; line-height: .9; white-space: nowrap; }
.cover--lime { background: var(--cover-lime); color: var(--ink); }
.cover--blue { background: var(--cover-blue); color: var(--ink); }
.cover--mint { background: var(--cover-mint); color: var(--ink); }
.cover--sand { background: var(--cover-sand); color: var(--ink); }
.cover--lilac { background: var(--cover-lilac); color: var(--ink); }
.cover--slate { background: var(--cover-slate); color: var(--cover-slate-fg); }
.cover--lg { height: auto; min-height: 320px; border-radius: var(--r-xl); padding: 28px 32px; }
.cover--lg .cover-glyph { font-size: clamp(5rem, 16vw, 11rem); line-height: .82; }
/* 商品图片：用固定比例框预留高度，避免图片加载引起布局位移（CLS）。 */
.card-cover { position: relative; aspect-ratio: 16 / 10; border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; overflow: hidden; }
.card-cover .cover, .card-media { height: 100%; width: 100%; }
.card-cover .cover { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 8px; padding: 12px; }
.card-cover .cover-glyph { margin-inline-start: auto; font-size: clamp(2.25rem, 5vw, 4.5rem); line-height: 1; }
.card-media { background: var(--surface-2); overflow: hidden; }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-badges { display: flex; flex-wrap: wrap; gap: 4px; position: absolute; inset: 10px 10px auto; }
.card-badges .tag { background: var(--surface); color: var(--ink); }
.card-badges .tag--accent { background: var(--accent); color: var(--on-accent); }
.card-badges .tag--info { background: var(--info-bg); color: var(--info-fg); }
.product-media { display: flex; flex-direction: column; gap: 12px; }
.media { display: block; aspect-ratio: 3 / 2; border-radius: var(--r-xl); background: var(--surface-2); overflow: hidden; }
.media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.media--lg { min-height: 320px; }
.media-thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.media-thumbs li { width: 88px; height: 88px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.media-thumbs .media-thumb { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.media-thumbs .media-thumb[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: -2px; }
.media-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lookup-band { background: var(--ticket-bg); color: var(--ticket-fg); border-radius: var(--r-xl); padding: 36px; margin-top: 56px; display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; }
.lookup-band h2 { margin: 0 0 6px; font-size: 1.875rem; }
.lookup-band p { margin: 0; color: #c9ced6; max-width: 30em; }
.lookup-band .button { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 700; }
/* 查单区在浅色主题下也是深底，焦点环使用票据前景色。 */
.lookup-band :focus-visible { outline-color: var(--ticket-fg); }
.home .lookup-band { gap: 16px 24px; margin-top: clamp(32px, 4.5vw, 56px); padding: clamp(20px, 3vw, 32px); }
.home .lookup-band > div { flex: 1 1 260px; min-width: 0; }
.home .lookup-band h2 { font-size: clamp(1.375rem, 2.5vw, 1.625rem); }
.home-lookup-form { display: flex; align-items: end; flex-wrap: wrap; flex: 2 1 440px; gap: 10px; min-width: 0; }
.home-lookup-form .field, .home-lookup-form > input:not([type=hidden]) { flex: 1 1 145px; min-width: 0; margin: 0; }
.home-lookup-form input:not([type=hidden]) { max-width: none; background: #1a1d22; color: var(--ticket-fg); border-color: #777e89; }
.home-lookup-form input::placeholder { color: var(--ticket-muted); }
.home-lookup-form input[name=order_no] { font-family: var(--font-mono); }
.home-lookup-form button { min-height: 48px; }

/* 商品详情 */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .875rem; color: var(--muted); margin-bottom: 20px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); }
.product { display: flex; flex-wrap: wrap; gap: 44px; align-items: flex-start; }
.product-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.product-main section > h2 { font-size: 1.5rem; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 28px; }
.buybox { flex: 1 1 380px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.buybox h1 { margin: 0; font-size: 2rem; }
.sku { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.sku[open] { border: 2px solid var(--ink); }
.sku > summary, .sku-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; min-height: 56px; padding: 10px 16px; cursor: pointer; list-style: none; }
.sku > summary::-webkit-details-marker { display: none; }
.sku-spec { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 600; }
.sku-price { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sku-body { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.sku-list { display: flex; flex-direction: column; gap: 10px; }
.sku-list > .sku-body { padding: 0; }
.sku-block { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.buy-actions { display: flex; flex-direction: column; gap: 10px; }
.buy-actions button { min-height: 52px; border-radius: 14px; font-size: 1.0625rem; }
.assure { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .9375rem; color: var(--ink-2); }
.assure li { display: flex; gap: 10px; }
.assure li::before { content: "✓"; font-weight: 700; color: var(--ink); }

@media (max-width: 1050px) {
  .home-header .header-row { grid-template-columns: minmax(0, auto) minmax(0, 1fr); }
  .home-header .nav { justify-self: end; }
  .home-search { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 850px) {
  .home-hero-grid, .home-merchandising { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  main.container { padding-top: 20px; }
  .header-row { gap: 4px; }
  .header-search { width: 100%; margin-left: 0; }
  .header-search input[type=search] { flex: 1 1 auto; min-width: 0; width: auto; }
  /* 窄屏导航换行而不是横向滚动：滚动会把最后一项（购物车）截成半个而没有任何提示（A-747） */
  .nav { width: calc(100% + 12px); flex-wrap: wrap; gap: 0; margin: 0 -6px; padding: 0; }
  .nav a { white-space: nowrap; padding: 0 6px; }
  h1 { font-size: 1.625rem; }
  .panel, .info-card, .buybox { padding: 18px; }
  .lookup-band { padding: 24px; }
  .section-head h1, .section-head h2 { font-size: 1.75rem; }
  input[type=text], input[type=email], input[type=number], input[type=password], input[type=search], select, textarea { max-width: none; }
  .home-header .header-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .home-header .nav { justify-self: start; }
  .home-header .brand { max-width: none; font-size: 1.125rem; }
  .home-search { grid-column: auto; grid-row: auto; }
  .home-search .header-search button { padding: 0 12px; }
  .home-search-terms { gap: 0 8px; }
  .home-category-nav .chip { padding: 0 10px; }
  .home-category-nav .chips { padding: 4px 0; gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
  .home-category-nav .chip { flex: none; }
  .home-category-nav .chip:focus-visible { outline-offset: -3px; }
  .home-hero { padding: 20px; gap: 18px; }
  .hero-copy { gap: 14px; }
  .hero-title { font-size: clamp(1.75rem, 7.5vw, 2.375rem); }
  .hero-lead { font-size: .9375rem; }
  .hero-actions { gap: 8px; width: 100%; }
  .hero-actions .button { flex: 1 1 auto; min-height: 44px; padding: 0 8px; font-size: .875rem; }
  .home-stats { grid-template-columns: repeat(auto-fit, minmax(min(70px, 100%), 1fr)); gap: 8px; padding-top: 14px; }
  .home-stats dt { font-size: .75rem; }
  .home-hero-grid, .home-hero-side { gap: 12px; }
  .home-merchandising { gap: 0; }
  .home-featured, .home-ticker { padding: 16px; }
  .home-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-benefits li { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; }
  .home-benefits .home-icon { width: 36px; height: 36px; }
  .home-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .home-category { align-items: center; text-align: center; font-size: .8125rem; padding: 4px 2px; gap: 3px; border-color: transparent; }
  .home-category .tag { font-size: .6875rem; padding: 1px 3px; }
  .home-coupons { grid-template-columns: 1fr; }
  .home .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home .card-body { padding: 10px 8px 6px; gap: 4px; }
  .home .card-title { font-size: .9375rem; }
  .home .card-foot { padding: 0 8px 8px; gap: 6px; }
  .home .card-trust { gap: 0 4px; font-size: .75rem; }
  .home .card-trust li + li::before { padding-right: 3px; }
  .home .card-badges { inset: 6px 5px auto; gap: 3px; }
  .home .card-badges .tag { padding: 1px 4px; font-size: .6875rem; }
  .home .card-cover { min-height: 112px; }
  .home .card-cover .cover-meta { display: none; }
  .home .card-cover .cover-glyph { font-size: 2rem; }
  .home .card-actions { gap: 4px; }
  .home .card-actions .button:not(.card-cart) { padding: 0 2px; font-size: .875rem; }
  .home-faq { grid-template-columns: minmax(0, 1fr); }
  .home-account > * { flex-direction: column; gap: 0; }
  .home-lookup-form > .field, .home-lookup-form > input:not([type=hidden]), .home-lookup-form > button { flex-basis: 100%; }
}

/* 订单页与支付页 */
.order-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.order-kicker { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); margin: 0 0 6px; }
.order-title { margin: 0; font-size: clamp(1.875rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; }
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 28px; }
.lane { padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.lane-label { font-size: .8125rem; color: var(--muted); }
.lane-state { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.lane-note { font-size: .875rem; color: var(--ink-2); }
.lane-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box; border: 2px dashed var(--line-strong); }
.lane-dot--done { border: 0; background: var(--ink); }
.lane-dot--busy { border: 3px solid var(--info); border-right-color: var(--line-strong); }
.lane-dot--warn { border: 0; background: var(--warn); }
.lane-dot--bad { border: 3px solid var(--bad); }
.order-cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.order-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.order-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.order-side .summary { max-width: none; margin: 0; }
.item-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.item-head h3 { margin: 0; font-size: 1.375rem; letter-spacing: -0.02em; }
.item-kicker { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.ticket-head .item-kicker { color: var(--ticket-muted); }
.ticket-head .status { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.ticket-body { gap: 16px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 4px 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.codes { display: flex; flex-direction: column; gap: 10px; }
.codes-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.codes-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--ground); border-radius: var(--r-md); padding: 8px 12px 8px 16px; }
.code-row .secret { flex: 1 1 220px; background: transparent; padding: 6px 0; font-size: 1.125rem; }
.code-row > p { flex-basis: 100%; margin: 0; }
.code-no { font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); }
.codes:has(.codes-reveal:not(:checked)) .secret:not(.strike) { filter: blur(7px); user-select: none; }
button.accent, .button.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 700; }
button.is-done { background: var(--accent); color: var(--on-accent); border-color: var(--ink); }
.steps-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.steps-bar li { display: flex; flex-direction: column; gap: 6px; font-size: .9375rem; color: var(--muted); }
.steps-bar li::before { content: ""; height: 6px; border-radius: 3px; background: var(--line); }
.steps-bar li[data-state=done] { color: var(--ink); font-weight: 600; }
.steps-bar li[data-state=done]::before { background: var(--ink); }
.steps-bar li[data-state=current] { color: var(--ink); font-weight: 600; }
.steps-bar li[data-state=current]::before { background: var(--info); }
.steps-bar small { font-weight: 400; color: var(--muted); }

.purchase-steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  list-style: none; margin: 0 0 20px; padding: 0;
}
.purchase-steps li {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--surface); color: var(--muted);
}
.purchase-steps [aria-current=step] { border-color: var(--ink); background: var(--ink); color: var(--on-ink); font-weight: 700; }
.purchase-step-number {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px;
  border-radius: 50%; background: var(--ground); color: var(--ink); font: 700 .8125rem var(--font-mono);
}
.purchase-step-done .purchase-step-number { background: var(--ok-bg); color: var(--ok); }
.purchase-steps [aria-current=step] .purchase-step-number { background: var(--accent); color: var(--on-accent); }
@media (max-width: 640px) {
  .purchase-steps { gap: 4px; }
  .purchase-steps li { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 2px; font-size: .8125rem; text-align: center; overflow-wrap: anywhere; }
}

.pay { display: flex; flex-direction: column; gap: 14px; width: min(100%, 880px); margin: 0 auto 28px; overflow-wrap: anywhere; }
.order-detail :focus-visible, .pay :focus-visible { outline-color: var(--shop-focus); }
[data-js-show][hidden] { display: none; }
.pay-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.pay-head h2 { margin: 0; font-size: 1.75rem; }
.pay-time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--muted); font-size: .875rem; }
.countdown { color: var(--ink); font-family: var(--font-mono); font-size: clamp(1rem, 4vw, 1.375rem); font-weight: 700; }
.pay-card { display: grid; justify-items: start; gap: 14px; min-width: 0; padding: clamp(14px, 4vw, 28px); border-radius: var(--r-xl); }
.pay-card > * { min-width: 0; max-width: 100%; }
.pay-card > p { margin: 0; }
.pay-card--epay { background: var(--surface); border: 1px solid var(--line); }
.pay-card--epay .pay-value { font-size: clamp(2rem, 8vw, 2.75rem); line-height: 1.15; }
.pay-amount-due { display: grid; gap: 4px; }
.pay-card--usdt { background: var(--ticket-bg); color: var(--ticket-fg); }
.pay-card--usdt .pay-block {
  justify-self: stretch; background: var(--cover-slate); color: var(--ticket-fg); border-color: transparent;
  padding: clamp(12px, 3vw, 18px);
}
.pay-card--usdt .pay-label, .pay-card--usdt .pay-note, .pay-card--usdt .pay-value small { color: var(--ticket-muted); }
.pay-card--usdt button:not(.accent, .is-done) { background: var(--ticket-bg); color: var(--ticket-fg); border-color: var(--ticket-muted); }
.pay-card--usdt :focus-visible { outline-color: var(--accent); }
.pay-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.pay-label { font-size: .8125rem; color: var(--muted); }
.pay-note { font-size: .875rem; color: var(--ink-2); margin: 0; }
.pay-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.pay-network { font-family: var(--font-mono); font-size: clamp(1.125rem, 5vw, 1.5rem); font-weight: 700; }
.pay-value { font-family: var(--font-mono); font-size: clamp(1.5rem, 6vw, 2.125rem); font-weight: 700; letter-spacing: -0.02em; word-break: break-all; }
.pay-value small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.pay-address { font-family: var(--font-mono); font-size: 1rem; line-height: 1.45; word-break: break-all; flex: 1 1 240px; }
.pay-qr-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.pay-qr-row .qr { flex: none; max-width: 100%; height: auto; }
.pay-qr-side { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pay-qr-side .pay-address { flex: none; }
.pay-entry { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.pay-entry .pay-note, .pay-entry .pay-qr-row { flex-basis: 100%; }
.pay-entry-link { max-width: 100%; overflow-wrap: anywhere; }
.payment-mismatch a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.pay-status { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: var(--r-lg); background: var(--info-bg); color: var(--info-fg); font-weight: 600; }
.spinner { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--info); border-right-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-exits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pay .button.primary { min-height: 56px; padding: 0 26px; border-radius: 14px; font-size: 1.125rem; }
.refund-box > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.refund-box > summary::-webkit-details-marker { display: none; }
.refund-box[open] > summary { text-decoration: none; }

@media (max-width: 640px) {
  .item-card, .ticket-head, .ticket-body { padding-left: 18px; padding-right: 18px; }
  .steps-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 购物车与结算。局部更新见 web/live.go 与 shop.js */
html.js .js-hide { display: none; }
/* 只在脚本可用时显示（与 .js-hide 相反），如「填满 6 位自动验证」提示 */
.js-only { display: none; }
html.js .js-only { display: revert; }
/* 请求超过 0.2 秒才变淡，避免快速响应时闪一下 */
#main.htmx-request { opacity: .55; pointer-events: none; transition: opacity .15s linear .2s; }

.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); }
.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.split-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split-side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 1000px) {
  .split-side { position: sticky; top: 20px; }
}
.split-main > .notice { margin: 0; }

/* 结算分段：.step--current 是当前要处理的一段 */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px 28px; display: flex; flex-direction: column; gap: 16px; }
.step--current { border: 2px solid var(--ink); padding: 25px 27px; }
.step form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.step p, .step .notice, .step .field, .step fieldset { margin: 0; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.step-title { margin: 0; font-size: 1.375rem; display: flex; align-items: center; gap: 12px; }
.step-no { font-family: var(--font-mono); font-size: .8125rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.step-foot { font-size: .875rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

.seg { display: inline-flex; background: var(--ground); border-radius: 10px; padding: 3px; }
.seg > a, .seg > span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 600; text-decoration: none; color: var(--ink); }
.seg > [aria-current="true"] { background: var(--ink); color: var(--on-ink); }

.field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field-row > .field { flex: 1 1 280px; min-width: 0; }
.field-row > .field input { max-width: none; }
.field-row > button { min-height: 52px; }
input.input-lg { min-height: 52px; font-size: 1.0625rem; }
.otp-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
input.otp { width: 240px; max-width: 100%; min-height: 60px; padding: 0 18px; border: 2px solid var(--ink); font-family: var(--font-mono); font-size: 1.75rem; font-weight: 700; letter-spacing: .35em; }
.otp-hint { flex: 1 1 200px; color: var(--muted); font-size: .875rem; }
.verified-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--ground); }
.inline-forms { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.inline-forms form { display: block; }

fieldset.pay-options { border: 0; border-radius: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.pay-options > legend { padding: 0; margin-bottom: 10px; }
.pay-option { display: flex; align-items: center; gap: 14px; min-height: 64px; margin: 0; padding: 8px 18px; border-radius: 14px; border: 1px solid var(--line-strong); font-weight: 400; cursor: pointer; }
.pay-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--ground); }
.pay-option input { flex: none; width: 20px; height: 20px; }
.pay-option-name { display: block; font-weight: 700; font-size: 1.0625rem; }
.pay-option-note { display: block; font-size: .8125rem; color: var(--muted); }
.dashed-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 10px 18px; border-radius: 14px; border: 1px dashed var(--line-strong); color: var(--muted); }
.dashed-row a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.wallet-box { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line-strong); }
.coupon-chip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 8px 16px; border-radius: var(--r-md); background: var(--ground); }
.coupon-code { font-family: var(--font-mono); font-weight: 700; margin-right: 10px; }

/* 订单摘要票据（购物车与结算页右栏） */
.sum { display: flex; flex-direction: column; }
.sum-top { background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.sum-top h2 { margin: 0; font-size: 1.125rem; }
.sum-tear { border-top: 2px dashed var(--line-strong); margin: 0 12px; }
.sum-bottom { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 16px; }
.sum-bottom p, .sum-bottom form, .sum-bottom .notice { margin: 0; }
.sum-bottom .notice { font-size: .875rem; }
.sum-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.sum-line { display: flex; gap: 14px; }
.sum-line-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sum-line-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.sum-line-top .num { font-family: var(--font-mono); white-space: nowrap; }
.thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: .9375rem; font-weight: 700; letter-spacing: -0.04em; }
.sum-rows { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sum-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum-rows dt { color: var(--muted); }
.sum-rows dd { margin: 0; font-family: var(--font-mono); text-align: right; }
.sum-rows > .sum-total { border-top: 1px solid var(--line); padding-top: 14px; }
.sum-total dt { color: var(--ink); font-weight: 700; font-size: 1.0625rem; }
.sum-total dd { font-family: var(--font-sans); font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.submit-hint { text-align: center; font-size: .875rem; font-weight: 600; }
.fineprint { font-size: .8125rem; color: var(--muted); text-align: center; }

/* 购物车行 */
.cart-group { display: flex; flex-direction: column; gap: 12px; }
.cart-group + .cart-group { margin-top: 12px; }
.cart-group > h2 { margin: 0; font-size: 1.125rem; display: flex; align-items: center; gap: 10px; }
.cart-line { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.cart-line--off { background: transparent; border-style: dashed; }
.cart-line-top { display: flex; gap: 14px; align-items: flex-start; }
.cart-line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-line-name { font-weight: 700; font-size: 1.0625rem; text-decoration: none; }
.cart-line-name:hover { text-decoration: underline; }
.cart-line-price { display: flex; flex-direction: column; gap: 2px; text-align: right; white-space: nowrap; }
.cart-line-price .price { font-family: var(--font-mono); font-size: 1.125rem; }
.cart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; border-top: 1px solid var(--line); padding-top: 10px; }
.cart-controls form { display: flex; align-items: center; gap: 8px; margin: 0; }
.cart-controls label { margin: 0; }
.cart-controls-end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }

@media (max-width: 640px) {
  .split { gap: 20px; }
  .step, .step--current, .sum-top, .sum-bottom, .cart-line { padding-left: 18px; padding-right: 18px; }
  .cart-controls-end { margin-left: 0; }
}

/* 退款时间线（订单页）：只强调当前 / 失败节点，已完成节点用弱化颜色。 */
.refund-entry { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.refund-entry:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.timeline { list-style: none; margin: 8px 0; padding: 0 0 0 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline-step { position: relative; padding: 2px 0; }
.timeline-step::before { content: ""; position: absolute; left: -18px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.timeline-current::before { background: var(--accent); }
.timeline-failed::before { background: var(--bad); }
.timeline-current { font-weight: 600; }
.timeline-failed { color: var(--bad); }
.legal-doc { line-height: 1.75; }
.legal-doc h2 { margin-top: 1.4em; }
.legal-doc ul { padding-left: 1.2em; }

/* 游标分页：局部追加的新网格与上一页之间保留间距，「加载更多」居中。 */
.grid + .grid { margin-top: 18px; }
.pager { display: flex; justify-content: center; margin-top: 22px; }

/* 第 6 波 S1（A-515 / A-520）：购物车行内库存提示与操作；「加载更多」失败提示在按钮下方原位显示。 */
.cart-stock--short { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.cart-stock--short form { margin: 0; }
.pager { flex-wrap: wrap; align-items: center; flex-direction: column; gap: 10px; }
.pager .js-pager-error { margin: 0; }

/* 结算页 */
#checkout { overflow-wrap: anywhere; }
#checkout :focus-visible { outline-color: var(--shop-focus); }
#checkout a, #checkout button { min-width: 44px; }
#checkout a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
#checkout .checkout-layout {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start;
}
#checkout .step { border-radius: var(--r-lg); }
#checkout .step-title { gap: 10px; font-size: 1.125rem; }
#checkout .step-no {
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font-weight: 600;
}
#checkout .verified-row .tag { border-color: transparent; color: var(--ok); background: var(--ok-bg); }
#checkout .seg { max-width: 100%; flex-wrap: wrap; }
#checkout .seg > a { min-height: 44px; }
#checkout #coupon_code { font-family: var(--font-mono); }
#checkout .sum-lines { gap: 12px; }
#checkout .sum-line + .sum-line { border-top: 1px solid var(--line); padding-top: 12px; }
#checkout .sum-line-top {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, auto);
  align-items: center; gap: 4px 12px;
}
#checkout .sum-line-top .num { text-align: right; white-space: normal; }
.checkout-line-qty { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); }
.checkout-line-fields {
  display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--r-btn);
}
#checkout .pay-options { grid-template-columns: minmax(0, 1fr); }
#checkout .pay-option:has(input:disabled), .checkout-single-option { cursor: default; }
#checkout .pay-option:has(:focus-visible) { outline: 2px solid var(--shop-focus); outline-offset: 2px; }
.checkout-guest-wallet input { flex: none; }
#checkout .checkout-amount {
  border: 1px solid var(--line); border-radius: var(--r-xl);
}
.checkout-amount h2 { margin: 0; font-size: 1.125rem; }
.checkout-amount .sum-rows > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
.checkout-amount .sum-rows dd { white-space: normal; }
.checkout-amount .sum-total {
  border-top: 1px dashed var(--line-strong);
  align-items: center;
}
.checkout-amount .sum-total dd { font-family: var(--font-mono); font-size: clamp(1.25rem, 3.5vw, 2rem); }
.checkout-amount .fineprint { text-align: start; }
.checkout-payment-terms {
  display: grid; gap: 6px; font-size: .875rem; color: var(--muted);
}
@media (min-width: 960px) {
  #checkout .checkout-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
  #checkout .split-side { position: sticky; top: 20px; }
}
@media (max-width: 480px) {
  #checkout .sum-line { gap: 10px; }
  #checkout .thumb { width: 40px; height: 40px; }
  #checkout .sum-line-top { grid-template-columns: auto minmax(0, 1fr); }
  .checkout-line-name { grid-column: 1 / -1; }
  #checkout .checkout-amount .sum-rows > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  #main.htmx-request:has(#checkout) { transition: none; }
}

/* 订单进度和取货 */
.order-detail { min-width: 0; overflow-wrap: anywhere; }
.order-detail button, .order-detail .button { min-width: 44px; max-width: 100%; }
.order-detail a:not(.button) { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; max-width: 100%; }
.pickup-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center;
  gap: 24px; margin-bottom: 24px; padding: clamp(16px, 3vw, 32px);
  border: 1px solid var(--ticket-bg); border-radius: var(--r-xl);
  background: var(--ticket-bg); color: var(--ticket-fg);
}
.pickup-head .order-kicker, .pickup-head .lane-label, .pickup-head .lane-note, .pickup-step-time { color: var(--ticket-muted); }
.pickup-head .order-title { font-size: clamp(1.625rem, 4vw, 2.25rem); }
.pickup-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0; list-style: none; }
.pickup-step { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 10px; border-top: 4px solid var(--ticket-muted); }
.pickup-step[data-tone="done"], .pickup-step[aria-current="step"] { border-color: var(--accent); }
.pickup-step .lane-state { font-size: .9375rem; line-height: 1.4; }
.pickup-step .lane-dot { display: none; }
.pickup-step-time { font: .75rem/1.5 var(--font-mono); }
.order-detail .order-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.order-detail .order-main, .order-detail .order-side { gap: 16px; }
.order-detail .item-card, .order-detail .ticket-head, .order-detail .ticket-body { padding: clamp(14px, 2.5vw, 24px); }
.order-detail .item-card > *, .order-detail .ticket-body > * { min-width: 0; }
.order-detail .item-card p, .order-detail .ticket-body p { margin-block: 0; }
.order-detail .item-card > h2, .order-detail .pickup-info > h3 { margin: 0; }
.order-detail .item-head { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 12px; }
.order-detail .item-head > div { min-width: 0; }
.order-detail .item-head h3 { margin: 0; font-size: 1.125rem; }
.pickup-item-badges { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.pickup-glyph { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: var(--r-btn); font: 700 .875rem/1 var(--font-mono); }
.pickup-item-badges .status-completed { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.order-detail .ticket-head { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom: 0; }
.order-detail .ticket-head :is(.item-kicker, .muted) { color: var(--muted); }
.order-detail .ticket-tear { display: none; }
.order-detail .ticket-body { padding-top: 0; }
.order-detail .codes { gap: 8px; padding: 12px; border-radius: var(--r-lg); background: var(--ticket-bg); color: var(--ticket-fg); }
.order-detail .codes :focus-visible { outline-color: var(--accent); }
.order-detail .codes input { accent-color: var(--accent); }
.order-detail .codes-tools button { padding-inline: 12px; }
.order-detail .code-row { gap: 6px 12px; padding: 8px; background: var(--cover-slate); border: 1px solid transparent; color: var(--ticket-fg); }
.order-detail .code-row :is(.code-no, .strike, .tag) { color: var(--ticket-muted); }
.order-detail .code-row .secret { flex: 1 1 130px; min-width: 0; font-size: 1rem; white-space: pre-wrap; }
.pickup-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--surface-2); }
.pickup-download time, .pickup-sla time { display: block; margin-top: 2px; }
.pickup-sla { padding: 12px 14px; border-radius: var(--r-btn); background: var(--info-bg); color: var(--info-fg); }
.pickup-sla progress { display: block; width: 100%; height: 12px; margin-top: 10px; accent-color: var(--info); }
.pickup-sla .spread { gap: 6px 12px; }
.order-detail .pickup-account { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.pickup-account .field .hint { color: var(--on-accent); margin-top: 4px; }
.pickup-account :focus-visible { outline-color: var(--on-accent); }
.pickup-account button { width: 100%; }
.pickup-meta { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: baseline; gap: 6px 12px; margin: 0; }
.pickup-meta dt { color: var(--muted); }
.pickup-meta dd { min-width: 0; margin: 0; }
.pickup-meta .lane-state { gap: 6px; font-size: .9375rem; }
.pickup-meta .lane-dot { width: 12px; height: 12px; }
.pickup-meta .lane-note { display: block; margin-top: 2px; }
.pickup-info .actions { margin: 0; }
.pickup-info .pickup-payment-breakdown { padding-top: 12px; border-top: 1px solid var(--line); }
.pickup-again ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pickup-again li { min-width: 0; }
.order-detail .pickup-again a { display: flex; gap: 12px; text-decoration: none; }
.pickup-again a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.pickup-again .pickup-glyph { flex-basis: 44px; width: 44px; height: 44px; }
@media (max-width: 860px) {
  .pickup-head, .order-detail .order-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .pickup-head { gap: 16px; }
  .pickup-step .lane-state, .pickup-step .lane-note { font-size: .8125rem; }
  .order-detail .codes { padding: 8px; }
}

/* 商品详情 */
.product-crumbs [aria-current] { min-width: 0; overflow-wrap: anywhere; }
.product-crumbs a { min-width: 44px; }
.product-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 24px; align-items: start; }
.product-detail > .product-media { grid-area: 1 / 1; min-width: 0; }
.product-detail > .product-main { grid-area: 2 / 1; gap: 16px; }
.product-detail .media, .product-detail .media-thumbs li { background: var(--surface-2); }
.product-detail .cover--lg { min-height: clamp(260px, 31vw, 440px); }
.product-detail .cover-meta { overflow-wrap: anywhere; }
.product-detail > .buybox {
  grid-area: 1 / 2 / span 2;
  position: sticky; top: 16px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overflow-wrap: anywhere;
  gap: 16px;
  padding: clamp(18px, 2.2vw, 24px);
}
.product-detail > .buybox h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.2; }

.product-sku-selector { border: 0; min-width: 0; margin: 0; padding: 0; }
.product-sku-selector legend { padding: 0; margin-bottom: 8px; }
.product-sku-options { display: flex; flex-wrap: wrap; gap: 10px; }
.product-sku-option { display: contents; }
.product-sku-option > label {
  display: flex; flex: 1 1 min(120px, 100%); min-width: 0; min-height: 44px;
  align-items: center; gap: 8px; margin: 0; padding: 6px 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-btn);
  cursor: pointer;
}
.product-sku-option > label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.product-sku-option > label:has(input:focus-visible) { outline: 2px solid var(--shop-focus); outline-offset: 2px; }
.product-sku-option input[type=radio] { margin: 0; flex: none; }
.product-sku-option-copy { display: grid; gap: 4px; min-width: 0; }
.product-sku-option-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.product-sku-options .product-sku-panel { order: 1; flex: 1 0 100%; }
.product-sku-panel { padding: 0; min-width: 0; }
.product-sku-option:not(:has(> label input:checked)) > .product-sku-panel { display: none; }

.product-trust { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .875rem; }
.product-trust:empty { display: none; }
.product-trust .tag--ok { color: var(--ok); background: var(--ok-bg); }
.product-price-card { padding: 14px; background: var(--surface-2); border-radius: var(--r-lg); }
.product-price-card .sku-price { font-family: var(--font-mono); font-size: clamp(1.5rem, 3vw, 2rem); }
.product-price-tiers { margin-top: 12px; width: 100%; table-layout: fixed; font-size: .875rem; }
.product-price-tiers caption { text-align: start; color: var(--ink-2); }
.product-price-tiers :is(th, td) { padding: 5px 0; text-align: start; }
.product-price-tiers .num { text-align: end; }
.product-form .field, .product-form fieldset, .product-form p, .product-sku-panel > p { min-width: 0; margin: 0; }
.product-form .choice > input { flex: none; }
.product-quantity { display: grid; gap: 6px 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 112px); align-items: center; }
.product-quantity label { margin: 0; }
.product-quantity .qty { width: 100%; }
.product-quantity p { grid-column: 1 / -1; }
.product-form .buy-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-form .buy-actions button { width: 100%; min-width: 44px; padding: 4px 10px; }
.product-mobile-price, .product-unavailable { display: none; }

.product-coupon {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px;
  padding: 10px 12px; border-radius: var(--r-btn); background: var(--accent); color: var(--on-accent);
}
.product-coupon > div { min-width: 0; max-width: 100%; }
.product-coupon strong { margin-inline-end: 8px; }
.product-coupon-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.product-coupon-tools button[hidden] { display: none; }

.product-timeline { background: var(--ticket-bg); color: var(--ticket-fg); border-radius: var(--r-xl); padding: clamp(16px, 2vw, 24px); overflow-wrap: anywhere; }
.product-main .product-timeline h2 { margin: 0 0 12px; font-size: 1.125rem; }
.product-timeline ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding-left: 1.25em; }
.product-timeline li { min-width: 0; padding-inline-start: 2px; }
.product-timeline li::marker { color: var(--ticket-fg); font-family: var(--font-mono); }
.product-timeline li span { display: block; color: var(--ticket-muted); font-size: .875rem; margin-top: 2px; }
.product-detail:has([data-product-delivery="CARD"]:checked) [data-product-timeline]:not([data-product-timeline="CARD"]),
.product-detail:has([data-product-delivery="FILE"]:checked) [data-product-timeline]:not([data-product-timeline="FILE"]),
.product-detail:has([data-product-delivery="MANUAL"]:checked) [data-product-timeline]:not([data-product-timeline="MANUAL"]) { display: none; }
.product-info { overflow-wrap: anywhere; }
.product-info section + section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.product-main .product-info h2 { margin: 0 0 8px; font-size: 1.125rem; }
.product-recommendations { margin-top: 40px; }
.product-recommendations h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); }
.product-detail :focus-visible, .product-crumbs :focus-visible { outline-color: var(--shop-focus); }
.product-coupon :focus-visible { outline-color: var(--on-accent); }

@media (max-width: 850px) {
  html:has(.product-detail) { scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body:has(.product-detail) .site-footer { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .product-detail { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .product-detail > .product-media, .product-detail > .product-main, .product-detail > .buybox { grid-area: auto; }
  .product-detail > .buybox { position: static; max-height: none; overflow: visible; }
  .product-form .buy-actions { display: block; }
  .product-buy-now {
    position: fixed; z-index: 4; inset: auto 0 0;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center;
    padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-top: 1px solid var(--line-strong); background: var(--surface);
  }
  .product-mobile-price { display: flex; flex-direction: column; line-height: 1.25; }
  .product-mobile-price strong { font-size: 1.25rem; }
}
@media (max-width: 480px) {
  .product-timeline ol { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .product-detail .media--lg { min-height: 0; }
}

/* 表单增强（forms.js）：显示密码按钮与邮箱拼写提示。没有脚本时按钮不出现。 */
.pw-field { position: relative; width: 100%; max-width: 440px; }
.pw-field input.pw-input { max-width: none; padding-right: 5.25rem; }
.pw-toggle { display: none; }
html.forms-js .pw-toggle {
  display: inline-flex; position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: auto; margin: 0; /* 卡片里的 `button { width: 100% }`（如订单页转账户）不能把它撑满 */
  min-height: 40px; min-width: 44px; padding: 0 12px; border: 0; background: none; color: var(--ink);
  font-size: .9375rem; text-decoration: underline; text-underline-offset: 3px;
}
html.forms-js .pw-toggle:hover { border: 0; }
.email-suggest { font-size: .875rem; }
.email-suggest:not(:empty) { margin-top: 6px; }
.email-suggest button.link { display: inline; min-height: 0; padding: 0; font: inherit; font-weight: 700; overflow-wrap: anywhere; }
.mail-hint { margin: 0; }
.home-lookup-form .email-suggest { flex: 1 1 100%; margin: 0; color: var(--ticket-fg); }
.home-lookup-form .email-suggest button.link { color: inherit; }
/* 客服页问题分流（D87）：一行摘要 + 展开的做法，纯 <details>，无脚本 */
.support-faq details { border-bottom: 1px solid var(--line); }
.support-faq details:first-child { border-top: 1px solid var(--line); }
.support-faq summary { display: flex; gap: 10px; justify-content: space-between; align-items: center; min-height: 52px; padding: 6px 4px; font-weight: 600; cursor: pointer; list-style: none; overflow-wrap: anywhere; }
.support-faq summary::-webkit-details-marker { display: none; }
.support-faq summary::after { content: ""; flex: none; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 6px 5px; }
.support-faq details[open] > summary::after { transform: rotate(225deg); margin-block: 5px 0; }
.support-faq details > .stack { margin: 0 4px 14px; overflow-wrap: anywhere; }

/* 全站公告条（D88）：沿用 notice 的配色 token，浅色 / 深色主题都可读。 */
.site-announcement { border-bottom: 1px solid var(--line); padding: 10px 0; text-align: center; font-weight: 600; overflow-wrap: anywhere; }
.announcement-info { background: var(--info-bg); color: var(--info-fg); }
.announcement-warning { background: var(--warn-bg); color: var(--warn-fg); }
.site-announcement a { color: inherit; font-weight: 700; text-decoration: underline; }
