/* 不眠币藏 · SPA（移动优先） */
:root {
  --bg: #f7cadb;
  --bg-2: #ffe8f0;
  --paper: #fff8fb;
  --ink: #2a1520;
  --muted: #7c5f6b;
  --line: #f0c9d8;
  --rose: #e2487f;
  --rose-deep: #a81f56;
  --rose-soft: #fce4ed;
  --plum: #241019;
  --plum-2: #351a28;
  --gold: #c9a45c;
  --ok: #3f6b46;
  --shadow: 0 10px 30px rgba(42, 21, 32, .10);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 15% 0%, var(--bg-2) 0%, transparent 60%),
    radial-gradient(100% 50% at 95% 8%, #ffd9e7 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; display: block; }
a { color: var(--rose-deep); text-decoration: none; }
button { font-family: var(--sans); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.28; letter-spacing: .01em; margin: 0; text-wrap: balance; }
p { margin: 8px 0; }
.wrap { max-width: 1120px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--rose-deep); font-weight: 700;
}
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 10px;
  border: 1px solid var(--rose); background: var(--rose); color: #fff;
  font-size: 15px; font-weight: 650; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn.outline { background: transparent; color: var(--rose-deep); }
.btn.dark { background: var(--plum); border-color: var(--plum); color: #fff; }
.btn.block { width: 100%; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 40;
  margin: 0 -16px; padding: 0 16px;
  background: rgba(36, 16, 25, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 72, 127, .3);
  color: #f7f0e4;
}
.app-header .inner { max-width: 1120px; margin: 0 auto; min-height: 60px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #f7f0e4; }
.brand img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(226,72,127,.6); }
.brand b { font-family: var(--serif); font-size: 18px; letter-spacing: .1em; }
.brand span { display: block; font-size: 9px; letter-spacing: .2em; color: var(--rose); margin-top: 1px; }
.top-nav { display: none; margin-left: auto; gap: 18px; }
.top-nav a { color: #d9d2c4; font-size: 14px; padding: 6px 0; }
.top-nav a.active { color: var(--rose); }
.cart-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--rose); border: 1px solid rgba(226,72,127,.6);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.cart-pill .n { min-width: 18px; height: 18px; border-radius: 999px; background: var(--rose); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
.cart-pill .n[hidden] { display: none; }

/* Page */
.page { padding-top: 18px; }
.page-head { margin: 10px 0 16px; }
.page-head h1 { font-size: clamp(28px, 7vw, 40px); margin: 6px 0 6px; }
.page-head p { color: var(--muted); margin: 0; font-size: 14px; }
.section { margin: 30px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(22px, 5.5vw, 30px); }
.link-more { font-size: 13px; color: var(--rose-deep); white-space: nowrap; }

/* Hero */
.hero {
  position: relative; border-radius: 18px; overflow: hidden;
  background: var(--plum); min-height: 560px;
  display: flex; align-items: flex-end;
  margin-top: 6px; box-shadow: var(--shadow);
}
.hero-media { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 16%;
  opacity: 0; transition: opacity .9s ease;
}
.hero-slide.active { opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,8,15,.05) 0%, rgba(20,8,15,.35) 45%, rgba(20,8,15,.92) 100%); }
.hero-content { position: relative; z-index: 2; padding: 26px 22px 30px; color: #fbf6ea; width: 100%; }
.hero-content h1 { font-size: clamp(34px, 9vw, 54px); color: #fff9ee; margin: 8px 0 10px; }
.hero-content p { color: #e9dfcf; max-width: 520px; font-size: 15px; margin: 0 0 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-dots { position: absolute; right: 18px; top: 18px; z-index: 3; display: flex; gap: 7px; }
.hero-dots button { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); background: rgba(0,0,0,.25); padding: 0; }
.hero-dots button.active { background: var(--rose); border-color: var(--rose); }

/* Collection rows */
.collection { margin-top: 30px; }
.collection-head { margin-bottom: 8px; }
.collection-head h2 { font-size: clamp(24px, 6vw, 34px); }
.col-row {
  display: grid; grid-template-columns: 1fr 1.08fr; gap: 10px;
  align-items: start;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.col-coin, .col-model { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.col-coin img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.col-model img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.col-year, .col-model-tag {
  position: absolute; left: 9px; bottom: 9px;
  background: rgba(36,16,25,.85); color: var(--rose);
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(226,72,127,.4);
}
.col-model-tag { left: auto; right: 9px; color: #ffd9e6; }
.col-info { grid-column: 1 / -1; padding-top: 4px; }
.col-info h3 { font-size: 22px; margin: 2px 0 4px; }
.col-info .meta { color: var(--muted); font-size: 13px; }
.col-price { font-family: var(--serif); font-size: 26px; color: var(--rose-deep); font-weight: 700; margin: 6px 0 10px; }
.col-actions { display: flex; gap: 8px; }
.col-actions .btn { flex: 1; }

/* Shop cards */
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-img { position: relative; aspect-ratio: 1/1; background: #fff; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 10px; top: 10px; background: rgba(36,16,25,.88); color: var(--rose); border: 1px solid rgba(226,72,127,.5); font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.badge.warn { background: rgba(168,31,86,.92); color: #fff; border-color: transparent; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 18px; margin: 0 0 3px; }
.card-body .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.card-price { font-family: var(--serif); font-size: 22px; color: var(--rose-deep); font-weight: 700; }
.card-price small { font-family: var(--sans); font-size: 11px; color: var(--muted); font-weight: 400; }

/* Product page */
.crumb { font-size: 12px; color: var(--muted); margin: 6px 0 12px; }
.crumb a { color: var(--muted); }
.gallery { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.gallery img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #fff; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 2px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: 0 0 62px; border: 2px solid transparent; border-radius: 9px; overflow: hidden; padding: 0; background: #fff; }
.thumb img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.thumb.active { border-color: var(--rose); }
.product-info { margin-top: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.product-info h1 { font-size: clamp(24px, 6vw, 32px); margin: 4px 0 4px; }
.sku { font-size: 11px; color: var(--muted); letter-spacing: .08em; font-family: ui-monospace, Consolas, monospace; }
.product-price { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 6px; }
.product-price b { font-family: var(--serif); font-size: 32px; color: var(--rose-deep); }
.stock { font-size: 12px; color: var(--ok); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.tag { font-size: 11px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 3px 8px; }
.tag.real { border-color: #bcd3bd; background: #eef5ea; color: var(--ok); }
.tag.schematic { border-color: #e0c9a0; background: #fbf1de; color: #8a5a18; }
.notice { border-left: 3px solid var(--rose); background: var(--rose-soft); padding: 10px 12px; border-radius: 0 10px 10px 0; color: #6d3a4e; font-size: 13px; margin: 10px 0; }
.qty-row { display: flex; gap: 10px; margin: 12px 0 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { width: 42px; height: 46px; border: 0; background: transparent; font-size: 18px; }
.qty input { width: 48px; height: 46px; border: 0; text-align: center; font-size: 15px; background: transparent; }
.product-actions { display: flex; flex-direction: column; gap: 8px; }
.product-actions .btn { width: 100%; }
.meta-list { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.meta-list b { color: var(--ink); }
.model-card { margin-top: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.model-card h3 { font-size: 18px; margin-bottom: 8px; }
.model-card img { width: 100%; border-radius: 12px; aspect-ratio: 3/4; object-fit: cover; }
.specs { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.specs th, .specs td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.specs th { width: 35%; color: var(--muted); font-weight: 600; background: #fdf1f5; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.video-box { max-width: 420px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #000; }
.video-box video { width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover; }
.prose h3 { margin: 20px 0 4px; font-size: 17px; }
.prose p { color: #4a3a42; font-size: 14px; }

/* About */
.about-block { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 14px 0; box-shadow: var(--shadow); }
.about-block h2 { font-size: 22px; margin-bottom: 8px; }
.checklist { list-style: none; padding: 0; margin: 6px 0 0; }
.checklist li { position: relative; padding-left: 22px; margin: 6px 0; font-size: 14px; color: #4a3a42; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--rose-deep); font-weight: 700; }

/* Footer */
.app-footer { margin: 34px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* Tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(36, 16, 25, .98);
  border-top: 1px solid rgba(226,72,127,.3);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(10px);
}
.tabbar a, .tabbar button {
  min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: transparent; border: 0; color: #b9aab2; font-size: 11px; text-decoration: none;
}
.tabbar .ico { font-size: 17px; line-height: 1; }
.tabbar a.active, .tabbar button.active { color: var(--rose); }

/* Cart */
.overlay { position: fixed; inset: 0; background: rgba(20,8,15,.55); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60; }
body.cart-open .overlay { opacity: 1; pointer-events: auto; }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%);
  background: var(--paper); z-index: 70; transform: translateX(102%);
  transition: transform .28s ease; display: flex; flex-direction: column;
  box-shadow: -20px 0 50px rgba(0,0,0,.25);
}
body.cart-open .cart { transform: translateX(0); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cart-head h3 { font-size: 19px; }
.cart-close { border: 0; background: transparent; font-size: 26px; color: var(--muted); line-height: 1; }
.cart-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 10px; font-size: 14px; }
.cart-item { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 62px; height: 62px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.cart-item .nm { font-size: 13.5px; line-height: 1.45; }
.cart-item .pr { font-size: 12.5px; color: var(--rose-deep); margin-top: 2px; }
.cart-item .ops { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ci-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; }
.ci-qty button { width: 26px; height: 26px; border: 0; background: transparent; font-size: 14px; }
.ci-qty span { min-width: 22px; text-align: center; font-size: 12px; }
.ci-del { border: 0; background: transparent; color: var(--muted); font-size: 11px; text-decoration: underline; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 18px calc(16px + env(safe-area-inset-bottom, 0px)); background: #fdf1f5; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.total-row b { font-family: var(--serif); font-size: 26px; color: var(--rose-deep); }
.cart-foot .btn { margin-top: 8px; }
.cart-note { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-card { position: relative; width: min(440px, 100%); background: var(--paper); border-radius: 16px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-card h3 { font-size: 20px; margin-bottom: 4px; }
.modal-close { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 24px; color: var(--muted); }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.contact-row .val { font-weight: 600; word-break: break-all; }
.contact-row button { flex: none; min-height: 36px; padding: 6px 12px; }
.modal-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); background: var(--plum); color: #f8f0e2; padding: 10px 16px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 90; max-width: 88vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Desktop */
@media (min-width: 760px) {
  body { padding-bottom: 30px; }
  .tabbar { display: none; }
  .top-nav { display: flex; }
  .cart-pill { margin-left: 8px; }
  .hero { display: grid; grid-template-columns: 1.05fr .95fr; align-items: stretch; min-height: 560px; }
  .hero::after { display: none; }
  .hero-media { position: relative; grid-column: 2; grid-row: 1; height: 100%; }
  .hero-content { grid-column: 1; grid-row: 1; align-self: center; padding: 46px 48px; max-width: none; z-index: 2; }
  .hero-dots { right: 20px; top: 20px; }
  .col-row { grid-template-columns: .9fr .9fr 1.25fr; gap: 18px; align-items: center; }
  .col-info { grid-column: auto; padding-top: 0; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .product-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 22px; align-items: start; }
  .product-info { margin-top: 0; }
  .product-actions { flex-direction: row; }
  .product-actions .btn { width: auto; flex: 1; }
  .thumbs { flex-wrap: wrap; overflow: visible; }
}
@media (max-width: 759px) {
  .hero { min-height: 74vh; }
  .hero-content { padding: 22px 18px 24px; }
  .hero-content h1 { font-size: clamp(34px, 11vw, 46px); }
  .cart { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
