/* IDSHOP — 编辑式数字货架 · v2.1 */
:root {
  --paper: #f4f1ea;
  --paper-2: #ece7db;
  --ink: #141413;
  --ink-2: #4a4741;
  --muted: #7b7568;
  --line: #d8d1c2;
  --line-2: #c9c1af;
  --signal: #d93a20;
  --amber: #b07a18;
  --ok: #2e7d32;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", SimSun, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --maxw: 1180px;
  --pad: clamp(16px, 4vw, 40px);
  --header-h: 62px;
  --shadow-sheet: 0 30px 80px rgba(20, 20, 19, .28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  -webkit-tap-highlight-color: transparent;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 18% 0%, rgba(217, 58, 32, .035) 0, transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(20, 20, 19, .03) 0, transparent 30%),
    linear-gradient(180deg, var(--paper) 0%, #f6f3ed 55%, var(--paper) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--signal); color: var(--paper); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--paper); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.mono { font-family: var(--mono); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(244, 241, 234, .9);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 26px;
  padding: 0 var(--pad);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: .2em; text-decoration: none; white-space: nowrap;
}
.brand i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal); flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.brand small { font-family: var(--sans); font-weight: 500; letter-spacing: .02em; color: var(--muted); font-size: 11px; }
.masthead nav { display: flex; gap: 22px; margin-left: 8px; }
.masthead nav a {
  font-size: 13px; color: var(--ink-2); text-decoration: none;
  padding: 4px 0; border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.masthead nav a:hover { color: var(--ink); border-color: var(--ink); }
.live {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.live b { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 2s ease-in-out infinite; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid; grid-template-columns: 1.4fr 1fr;
  align-items: center; gap: 40px;
  padding: clamp(56px, 9vw, 110px) var(--pad);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
  opacity: .16;
  mask-image: radial-gradient(circle at 30% 40%, #000 0, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 0, transparent 72%);
}
.hero > * { position: relative; }
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--signal);
}
.kicker::before { content: ""; width: 20px; height: 2px; background: var(--signal); display: block; }
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(44px, 7.4vw, 96px);
  line-height: 1.0; letter-spacing: -.025em;
  margin: 22px 0 24px; max-width: 11em;
}
.hero h1 em { font-style: normal; color: var(--signal); position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em;
  height: .14em; background: var(--signal); opacity: .14; transform: rotate(-1.2deg);
}
.lead { max-width: 36ch; color: var(--ink-2); font-size: 15px; }
.hero-actions { display: flex; align-items: center; gap: 20px; margin-top: 32px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 24px; text-decoration: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.btn-primary span { transition: transform .2s; }
.btn-primary:hover { background: var(--signal); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(217, 58, 32, .25); }
.btn-primary:hover span { transform: translateX(4px); }
.hero-note { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.hero-meta {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(20, 20, 19, .06);
}
.hero-meta > div {
  background: var(--paper); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.hero-meta span { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.hero-meta b { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 42px); font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }

/* ---------- ticker ---------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 12px 0; background: var(--paper);
}
.ticker-track {
  display: flex; width: max-content;
  animation: slide 42s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  flex: none; padding: 0 24px;
  display: inline-flex; align-items: center; gap: 24px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--ink-2);
}
.ticker-track span::after { content: "·"; color: var(--signal); }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- shelf ---------- */
.shelf { padding: clamp(44px, 6vw, 76px) var(--pad); max-width: var(--maxw); margin: 0 auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.01em; }
.eyebrow {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--signal); margin-bottom: 8px;
}
.count { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }

.toolbar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 12px 0; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 14px; border: 1px solid var(--line); color: var(--ink-2);
  transition: background .16s, color .16s, border-color .16s, transform .16s;
}
.chip sup { font-size: 9px; opacity: .55; letter-spacing: 0; font-weight: 700; }
.chip:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] sup { opacity: .7; }

.search {
  display: inline-flex; align-items: center; gap: 10px;
  border-bottom: 1.5px solid var(--ink); padding-bottom: 6px; min-width: 210px;
  transition: border-color .18s;
}
.search:focus-within { border-color: var(--signal); }
.search > span { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.search input {
  border: 0; background: none; outline: none;
  font: inherit; font-size: 14px; width: 170px; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }

.grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  column-gap: 34px; row-gap: 0; margin-top: 10px;
}
.item {
  position: relative; padding: 22px 12px 24px; margin: 0 -12px;
  border-top: 1px solid var(--line);
  transition: background .18s, color .18s;
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: var(--d, 0ms);
  cursor: pointer;
}
.item:hover, .item:focus-within { background: var(--ink); color: var(--paper); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.item-top > span:first-child { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.item:hover .item-top > span:first-child { color: #a8a196; }
.item-cat {
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--signal); border: 1px solid currentColor; padding: 1px 6px; opacity: .85;
}
.item:hover .item-cat { color: var(--paper); opacity: 1; }
.item h3 {
  font-size: 15px; font-weight: 500; line-height: 1.45;
  margin: 10px 0 7px; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .18s;
}
.item-meta { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.item:hover .item-meta { color: #a8a196; }
.item-meta.low { color: var(--amber); }
.item-meta.sold { color: var(--muted); }
.item-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 16px; }
.price { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1; letter-spacing: -.015em; transition: color .18s; }
.price small { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .1em; opacity: .55; margin-right: 3px; }
.buy {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  border-bottom: 1px solid currentColor; padding-bottom: 3px; opacity: .85;
  transition: opacity .16s, gap .16s, border-color .16s;
}
.buy:hover { opacity: 1; gap: 10px; border-color: var(--signal); }
.buy:disabled { opacity: .4; cursor: not-allowed; border-color: transparent; }
.buy .arrow { font-size: 12px; }
.item.sold-out { opacity: .55; cursor: default; }
.item.sold-out h3 { color: var(--muted); }
.empty {
  grid-column: 1 / -1; padding: 64px 0; text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.step { padding: 34px 30px 30px 0; }
.step + .step { padding-left: 30px; border-left: 1px solid var(--line); }
.step > span {
  display: block; font-family: var(--serif); font-size: 44px; font-weight: 600;
  line-height: 1; color: var(--signal);
}
.step h3 { font-size: 16px; font-weight: 600; margin: 16px 0 9px; }
.step p { font-size: 13px; color: var(--ink-2); max-width: 30ch; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px var(--pad) 46px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .2em; }
.footer-brand i { font-style: normal; color: var(--signal); }
.footer-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; line-height: 1.9; color: var(--muted); text-align: right; }

.footer-policy {
  max-width: var(--maxw); margin: 30px auto 0;
  padding-top: 26px; border-top: 1px dashed var(--line-2);
  color: var(--muted); font-size: 12px; line-height: 1.85;
}
.policy-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.policy-head h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.policy-head span { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--signal); }
.footer-policy p { max-width: 78ch; margin-top: 8px; }
.footer-policy ol { margin: 8px 0 0 1.4em; }
.footer-policy li { margin-top: 4px; }
.footer-policy a { color: var(--signal); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.footer-policy a:hover { color: var(--ink); border-color: var(--ink); }

.policy-note { margin-top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--muted); line-height: 1.6; }
.policy-link { color: var(--signal); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.policy-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- overlay / sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(20, 20, 19, .55); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: min(500px, 100%);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-sheet);
  padding: 26px 28px 28px;
  transform: translateY(18px) scale(.98);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1), opacity .22s ease;
  max-height: 90svh; overflow: auto;
}
.overlay.open .sheet { transform: none; opacity: 1; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-top > span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--signal);
}
.sheet-close {
  width: 34px; height: 34px; display: grid; place-items: center;
  font-size: 20px; line-height: 1; color: var(--ink-2);
  transition: color .16s, transform .16s;
}
.sheet-close:hover { color: var(--signal); transform: rotate(90deg); }
.sheet h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.3; }
.sheet-sub { margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.sheet-summary {
  margin: 18px 0 20px; padding: 14px 16px;
  background: var(--paper-2); border-left: 3px solid var(--signal);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.sheet-summary b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.sheet-summary .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.qty { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.qty-label { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.stepper { display: inline-flex; border: 1px solid var(--ink); align-items: stretch; }
.stepper button {
  width: 42px; height: 42px; font-size: 18px; line-height: 1; display: grid; place-items: center;
  transition: background .16s, color .16s;
}
.stepper button:hover { background: var(--ink); color: var(--paper); }
.stepper input {
  width: 74px; border: 0; border-left: 1px solid var(--ink); border-right: 1px solid var(--ink);
  background: none; text-align: center; font-family: var(--mono); font-size: 14px;
  outline: none; color: var(--ink); -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%; border: 1px solid var(--ink); background: transparent;
  padding: 12px 14px; font-size: 14px; font-family: var(--sans); outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.field input:focus { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.field.error input { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.field .field-msg { display: none; font-size: 11px; color: var(--signal); margin-top: 6px; font-family: var(--mono); }
.field.error .field-msg { display: block; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 15px; margin: 4px 0 16px; }
.total-row > span { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.total-row b { font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -.015em; }
.submit {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  padding: 15px; font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  transition: background .18s, opacity .18s;
}
.submit:hover { background: var(--signal); }
.submit:disabled { opacity: .55; cursor: not-allowed; }
.submit.loading span:first-child::after { content: "…"; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.sheet-hint { min-height: 18px; margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--signal); }
.sheet-hint.ok { color: var(--ok); }
.sheet-security {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--muted); text-align: center;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  z-index: 200; background: var(--ink); color: var(--paper);
  padding: 12px 20px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
  max-width: min(88vw, 420px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--signal); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 34px; min-height: auto; padding-top: 56px; }
  .hero-meta { grid-template-columns: repeat(3, 1fr); }
  .hero::before { background-size: 64px 64px; }
  .grid { grid-template-columns: repeat(2, 1fr); column-gap: 26px; }
  .steps { grid-template-columns: 1fr; }
  .step { padding: 22px 0; }
  .step + .step { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .masthead { gap: 12px; padding: 0 16px; }
  .masthead nav { display: none; }
  .brand small { display: none; }
  .live { font-size: 9px; }
  .hero { padding: 44px 16px 50px; }
  .hero h1 { font-size: clamp(40px, 12vw, 64px); }
  .hero-meta { grid-template-columns: repeat(3, 1fr); }
  .hero-meta > div { padding: 14px 12px; }
  .shelf { padding: 40px 16px 56px; }
  .grid { grid-template-columns: 1fr; column-gap: 0; }
  .item { padding: 18px 10px; margin: 0 -10px; }
  .item h3 { min-height: 0; }
  .toolbar { gap: 12px; top: var(--header-h); }
  .search { width: 100%; min-width: 0; }
  .search input { width: 100%; }
  .filters { gap: 6px; }
  .chip { padding: 7px 11px; font-size: 10px; }
  .overlay {
    padding: 0;
    align-items: end; justify-items: stretch;
    overscroll-behavior: contain;
  }
  .sheet {
    width: 100%; min-height: 0; max-height: 92svh;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    border: 0; border-top: 1px solid var(--ink); border-radius: 16px 16px 0 0;
    padding: 4px 20px calc(30px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .sheet-top {
    position: sticky; top: -4px; z-index: 5;
    background: var(--paper);
    margin: 0 0 12px; padding: 18px 0 12px;
  }
  .sheet-top::before {
    content: ""; position: absolute; top: 6px; left: 50%;
    width: 38px; height: 4px; border-radius: 2px;
    background: var(--line-2); transform: translateX(-50%);
  }
  .sheet-close { width: 44px; height: 44px; font-size: 22px; }
  .stepper button { width: 52px; height: 52px; }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
}
@media (max-width: 380px) {
  .hero-meta { grid-template-columns: 1fr; }
}

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

/* ================= 账号区（masthead） ================= */
.account {
  display: flex; align-items: center; gap: 8px;
  margin-left: 16px; white-space: nowrap;
}
.who-user {
  font-size: 12px; color: var(--ink-2);
  max-width: 20ch; overflow: hidden; text-overflow: ellipsis;
}
.btn-ghost {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  padding: 7px 12px; border: 1px solid var(--line-2); color: var(--ink-2);
  transition: color .16s, border-color .16s, background .16s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn-ghost-solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ghost-solid:hover { background: var(--signal); border-color: var(--signal); }

/* ================= 模块 Tab ================= */
.module-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 0 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.mod-tab {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 16px; border: 1px solid var(--line); color: var(--ink-2);
  transition: background .16s, color .16s, border-color .16s, transform .16s;
}
.mod-tab:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.mod-tab[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: var(--paper); }

.item-cat-wrap { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.item-tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
  color: var(--amber); border: 1px solid currentColor; padding: 1px 5px;
}
.item:hover .item-tag { color: var(--paper); }
.item.wholesale { box-shadow: inset 3px 0 0 var(--amber); }

.gate {
  grid-column: 1 / -1; border: 1px dashed var(--line-2); background: var(--paper-2);
  padding: 48px 32px; text-align: center;
}
.gate h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin-bottom: 10px; }
.gate p { color: var(--ink-2); font-size: 14px; max-width: 46ch; margin: 0 auto 22px; }

/* ================= 批发专区 ================= */
.wholesale-zone { border-top: 1px solid var(--line); background: var(--paper-2); }
.wholesale-box { min-height: 60px; }
.wb-note { color: var(--ink-2); font-size: 14px; max-width: 62ch; margin: 4px 0 16px; }
.wb-apply { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wb-tiers { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.wb-tiers span {
  font-family: var(--mono); font-size: 10px; color: var(--paper);
  background: var(--ink); padding: 4px 9px;
}
.grid-slim { row-gap: 12px; margin-top: 6px; }
.chip-act { border-color: var(--ink); color: var(--ink); }
.chip-act:hover { background: var(--ink); color: var(--paper); }
.chip-act:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ================= 认证弹层 ================= */
.sheet-auth { width: min(440px, 100%); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.auth-tab {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 11px; border: 1px solid var(--line); color: var(--ink-2);
}
.auth-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ================= 阶梯价提示 ================= */
.tier-hint {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  margin: -6px 0 16px; padding: 9px 12px;
  background: rgba(176, 122, 24, .08); border-left: 3px solid var(--amber);
  font-size: 12px; color: var(--ink-2);
}
.tier-lbl {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber);
}

/* ================= 我的订单 ================= */
.sheet-wide { width: min(640px, 100%); }
.orders-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 56svh; overflow: auto; }
.order { border: 1px solid var(--line); padding: 12px 14px; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-head b { font-size: 14px; font-weight: 600; }
.order-meta {
  margin-top: 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.order-total { color: var(--ink); font-weight: 700; }
.order-tip { margin-top: 8px; font-size: 11px; color: var(--amber); }
.st {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  padding: 3px 9px; border: 1px solid currentColor;
}
.st[s="pending"] { color: var(--amber); }
.st[s="paid"] { color: var(--signal); }
.st[s="completed"] { color: var(--ok); }
.st[s="failed"] { color: var(--muted); }
.s-unknown { color: var(--muted); }

/* ================= 代理中心 ================= */
.agent-box { margin-top: 6px; display: flex; flex-direction: column; gap: 16px; }
.agent-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.agent-status > span { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.agent-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.astat { background: var(--paper); padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.astat > span { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.astat b { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.astat b.ok { color: var(--ok); }
.agent-key { display: flex; flex-direction: column; gap: 8px; }
.key-row { display: flex; gap: 8px; }
.key-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--ink); background: var(--paper-2);
  padding: 10px 12px; font-family: var(--mono); font-size: 12px; color: var(--ink);
}
.agent-docs { display: flex; flex-direction: column; gap: 8px; }
.agent-docs p { font-size: 12px; color: var(--ink-2); }
.code {
  background: var(--ink); color: #d8d8d4;
  padding: 14px 16px; font-family: var(--mono); font-size: 11px;
  line-height: 1.7; overflow-x: auto; white-space: pre;
}
.agent-box h4 { font-family: var(--serif); font-size: 19px; font-weight: 600; }

/* ================= 支付方式 / USDT ================= */
.pay-methods { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.pay-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pay-opt {
  border: 1px solid var(--line-2); padding: 11px 13px;
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  transition: border-color .18s ease, background .18s ease;
}
.pay-opt b { font-size: 13px; letter-spacing: .02em; }
.pay-opt small { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.pay-opt.on { border-color: var(--ink); background: var(--paper-2); }

.usdt-panel {
  margin-top: 18px; padding: 16px;
  border: 1px solid var(--ink); background: var(--paper-2);
  display: flex; flex-direction: column; gap: 12px;
}
.usdt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.usdt-head b { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.usdt-head span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  border: 1px solid var(--ink); padding: 2px 7px; text-transform: uppercase;
}
.usdt-amount { display: flex; align-items: baseline; gap: 7px; }
.usdt-amount > span { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.usdt-amount b { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.usdt-amount small { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.usdt-row { display: flex; flex-direction: column; gap: 6px; }
.usdt-tip { font-size: 11.5px; line-height: 1.65; color: var(--ink-2); border-top: 1px dashed var(--line-2); padding-top: 10px; }
.usdt-tip a { color: var(--signal); }

/* 收款码 */
.qr-panel {
  margin-top: 18px; padding: 16px;
  border: 1px solid var(--ink); background: var(--paper-2);
  display: flex; flex-direction: column; gap: 12px;
}
.qr-img {
  display: block; width: 100%; max-width: 240px; margin: 0 auto;
  border: 1px solid var(--line-2); background: #fff;
}

/* 订单查询结果 */
.query-result { margin-top: 14px; }
.query-card { border: 1px solid var(--line); background: var(--paper-2); padding: 14px; display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 640px) {
  .pay-opts { grid-template-columns: 1fr; }
  .agent-stats { grid-template-columns: repeat(2, 1fr); }
  .usdt-amount b { font-size: 26px; }
}

/* ================= 移动端适配补充 ================= */
@media (max-width: 640px) {
  .account { margin-left: 0; }
  .btn-ghost { padding: 6px 9px; font-size: 10px; }
  .who-user { max-width: 8ch; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .gate { padding: 34px 18px; }
}

/* ================= 移动端体验升级 ================= */
@media (max-width: 640px) {
  /* 输入框 >=16px，避免 iOS 聚焦自动放大破坏弹层布局 */
  .field input, .key-input, .stepper input, .search input { font-size: 16px; }

  /* 触控目标加大 */
  .buy { padding: 12px 2px; min-height: 44px; align-items: center; }
  .chip { padding: 10px 13px; }
  .mod-tab { padding: 11px 16px; }
  .btn-ghost { padding: 10px 12px; }
  .pay-opt { padding: 14px 15px; }
  .submit { padding: 17px; }
  .stepper input { height: 52px; }

  /* 模块 tab / 分类筛选：单行横滑，不再挤成多行 */
  .module-tabs {
    flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 0 -16px; padding: 0 16px 12px;
  }
  .module-tabs::-webkit-scrollbar { display: none; }
  .mod-tab { flex: none; }
  .filters {
    flex-wrap: nowrap; overflow-x: auto; width: 100%;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 0 -16px; padding: 2px 16px 6px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip { flex: none; }

  /* toast 避开底部安全区 */
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* 触摸设备：去掉点击后残留的 hover/focus 反色，换成即时按压反馈 */
@media (hover: none) {
  .item:hover, .item:focus-within { background: none; color: var(--ink); }
  .item:hover .item-top > span:first-child, .item:focus-within .item-top > span:first-child { color: var(--muted); }
  .item:hover .item-cat, .item:focus-within .item-cat { color: var(--signal); opacity: .85; }
  .item:hover .item-tag, .item:focus-within .item-tag { color: var(--amber); }
  .item:hover .item-meta, .item:focus-within .item-meta { color: var(--muted); }
  .item:active { background: var(--paper-2); }
  .buy:active { opacity: .55; }
  .chip:active, .mod-tab:active { transform: scale(.96); }
  .submit:active { background: var(--signal); }
  .btn-ghost:active { background: var(--paper-2); }
}

/* ==========================================================================
   v3 · 视觉精修层（纯增量，不改动上面的既有规则语义）
   方向：把「网页」再往「印刷品 / 目录册」推一档 —— 纸张颗粒、铅字对齐、
   货架行的信号条、扫码式单选项、可钉住的结算栏。
   ========================================================================== */

/* ---------- 纸面质感 ---------- */
/* 只在有精细指针的桌面端铺颗粒，手机端省电省性能 */
@media (hover: hover) and (pointer: fine) {
  body::after {
    content: "";
    position: fixed; inset: 0; z-index: 8;
    pointer-events: none;
    opacity: .13;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
    background-size: 150px 150px;
  }
}

/* ---------- 铅字对齐 ---------- */
.hero-meta b, .price, .total-row b, .usdt-amount b, .astat b, .order-total {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.hero h1, .section-head h2, .sheet h3, .gate h3 { text-wrap: balance; }
.lead, .wb-note, .footer-policy p { text-wrap: pretty; }

/* 锚点跳转不被吸顶导航挡住 */
#shelf, #wholesale, #how, #contact { scroll-margin-top: calc(var(--header-h) + 10px); }

/* ---------- 货架条目：信号条 + 微位移 ---------- */
.item { isolation: isolate; }
.item::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 2px; height: 100%;
  background: var(--signal);
  transform: scaleY(0); transform-origin: 50% 0;
  transition: transform .34s cubic-bezier(.2, .7, .3, 1);
  z-index: 0;
}
.item:hover::before, .item:focus-within::before { transform: scaleY(1); }

.item h3 { transition: color .18s, transform .2s cubic-bezier(.2, .7, .3, 1); }
.item:hover h3 { transform: translateX(3px); }

/* 库存状态：一颗小圆点，比纯文字先被眼睛看到 */
.item-meta::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-right: 8px; vertical-align: 1px;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, .12);
}
.item-meta.low::before { background: var(--amber); box-shadow: 0 0 0 3px rgba(176, 122, 24, .14); }
.item-meta.sold::before { background: var(--line-2); box-shadow: none; }
.item:hover .item-meta::before { box-shadow: none; }

.price { transition: color .18s, letter-spacing .18s; }
.item:hover .price { letter-spacing: -.005em; }

/* ---------- 骨架屏 ---------- */
.item.sk { pointer-events: none; }
.item.sk:hover { background: none; color: var(--ink); }
.sk-bar {
  background: linear-gradient(100deg, var(--paper-2) 0%, #f3efe5 45%, var(--paper-2) 90%);
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 2px;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sk-line-a { width: 38px; height: 7px; margin-bottom: 16px; }
.sk-line-b { width: 86%; height: 14px; margin-bottom: 9px; }
.sk-line-c { width: 62%; height: 14px; margin-bottom: 20px; }
.sk-line-d { width: 26%; height: 9px; margin-bottom: 20px; }
.sk-line-e { width: 104px; height: 24px; }

/* 空态：一圈细描边 + 静态说明 */
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty::before {
  content: ""; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line-2); border-top-color: var(--signal);
}

/* ---------- 结算清单：更像小票 ---------- */
.sheet-summary {
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--signal);
  background:
    linear-gradient(180deg, rgba(20, 20, 19, .035), transparent 45%),
    var(--paper-2);
}
.sheet-summary > div { min-width: 0; }
.sheet-summary b { display: inline-block; max-width: 26ch; overflow-wrap: anywhere; }
.total-row { border-top: 1px dashed var(--line-2); }

/* 支付方式：单选圆环 */
.pay-opt {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 13px; row-gap: 2px;
  padding: 13px 15px;
  border-radius: 3px;
  cursor: pointer;
}
.pay-opt::before {
  content: ""; grid-column: 1; grid-row: 1 / span 2;
  justify-self: center; align-self: center;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  transition: border-color .18s, transform .18s;
}
.pay-opt.on::before { border-color: var(--signal); }
.pay-opt.on::after {
  content: ""; grid-column: 1; grid-row: 1 / span 2;
  justify-self: center; align-self: center;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
  animation: dot-in .24s cubic-bezier(.2, .9, .3, 1.4) both;
}
@keyframes dot-in { from { transform: scale(0); } to { transform: scale(1); } }
.pay-opt b, .pay-opt small { grid-column: 2; }
.pay-opt:hover { border-color: var(--ink); }

/* 提交按钮：掠过式高光 */
.submit { position: relative; overflow: hidden; }
.submit::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, .26) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .55s ease;
  pointer-events: none;
}
.submit:hover::after { transform: translateX(130%); }

/* ---------- 兜底：表单错误时的抖动 ---------- */
.field.error input { animation: nudge .3s ease; }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  55% { transform: translateX(3px); }
  80% { transform: translateX(-2px); }
}

/* ---------- 移动端结算栏：钉在抽屉底部 ---------- */
.sheet-foot { display: block; }
@media (max-width: 640px) {
  .sheet-foot {
    position: sticky;
    bottom: calc(-1 * (30px + env(safe-area-inset-bottom)));
    z-index: 6;
    margin: 6px -20px calc(-30px - env(safe-area-inset-bottom));
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(244, 241, 234, 0) 0%, var(--paper) 22%);
    border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .sheet-foot .total-row { margin-top: 0; }
  .sheet-foot .sheet-hint { margin-top: 8px; }
}

/* ---------- 移动端头部：留白给内容 ---------- */
@media (max-width: 640px) {
  .live { display: none; }
  .who-user { display: none; }
  .account { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .account::-webkit-scrollbar { display: none; }
  .masthead { gap: 10px; }
  .brand { font-size: 12px; letter-spacing: .16em; }
}

/* ---------- 打印 / 无动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .sk-bar { animation: none; background: var(--paper-2); }
  .submit::after { display: none; }
}

