@font-face {
  font-family: "Space Grotesk";
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/space-mono.woff2") format("woff2");
}

:root {
  --bg: #131313;
  --ink: #f4f4f4;
  --muted: #888888;
  --quiet: #8e9192;
  --panel: #201f1f;
  --deep: #0e0e0e;
  --field: #1c1b1b;
  --chip: #2a2a2a;
  --line: #1f1f1f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  /*
    安全区只跟系统 inset：
    14 Pro top≈59 / bottom≈34；iPhone 8 top≈0~20 / bottom≈0。
    不再叠加大额固定偏移，避免一端空太多、另一端贴边。
  */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-bar-h: 44px;
  --chrome-top: var(--safe-top);
  --bar-top: var(--safe-top);
  --foot-pad: 8px; /* 无 Home 条时底部最小空隙（iPhone 8） */
  padding-top: var(--chrome-top);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: var(--safe-bottom);
  padding-left: env(safe-area-inset-left, 0px);
}
@supports (padding-top: constant(safe-area-inset-top)) {
  body {
    --safe-top: constant(safe-area-inset-top);
    --safe-bottom: constant(safe-area-inset-bottom);
  }
}
@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body { background: #000; }
  .home {
    height: calc(100dvh - var(--chrome-top) - var(--safe-bottom));
    max-height: calc(100dvh - var(--chrome-top) - var(--safe-bottom));
  }
  .page-head {
    padding-top: 0;
  }
  .boot {
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
  }
}

/* 全局顶栏：竖屏 App 栈常驻 LONGYING STUDIO + 购物袋 */
.app-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: var(--chrome-top);
  padding: var(--bar-top) 14px 0;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #131313;
  border: 0;
}
.app-bar .logo img {
  width: min(248px, 68vw);
}
button, input, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
}
[hidden] { display: none !important; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: #fff; color: #121212; }
::-webkit-scrollbar { display: none; }

.home {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 490px minmax(0, 1fr);
  background: var(--bg);
  overflow: hidden;
}

.rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 14px 12px 10px;
}
.topbar {
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 6px;
  position: relative;
  z-index: 2;
}
.logo {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  line-height: 0;
}
.logo img {
  display: block;
  width: min(285px, 100%);
  height: auto;
}
.bag-link {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
  color: #c7c6c6;
  font-size: 13px;
  transition: color .3s ease;
}
.bag-link:hover { color: #fff; }
.bag-link svg { display: block; }
.count {
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--chip);
  color: #fff;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cards {
  min-height: 0;
  overflow: auto;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 8px;
}

.catalog-empty {
  min-height: 188px;
  display: grid;
  place-content: center;
  border-radius: 15px;
  background: var(--deep);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}
.catalog-empty span {
  color: var(--muted);
  font-size: 12px;
}

.card {
  position: relative;
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 466 / 188;
  flex: none;
  border-radius: 15px;
  overflow: hidden;
  text-align: left;
  background: var(--card, #f1f1f1);
  color: #141414;
  box-shadow: 0 8px 10px rgba(0, 0, 0, .08), 0 18px 28px rgba(0, 0, 0, .1);
}
.card .photo {
  position: absolute;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transform: scale(1);
  transform-origin: center center;
  transition: transform .7s ease-out;
}
.card:hover .photo { transform: scale(1.05); }
.card .face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
/* 卡片文案跟后台商品名走；深底浅字 / 浅底深字 */
.card .face-live {
  display: flex;
  flex-direction: column;
  padding: 4.6% 4.2% 4.8%;
  box-sizing: border-box;
}
.card .face-no {
  font-family: "Space Mono", monospace;
  font-size: clamp(10px, 1.35vw, 12px);
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--face-muted);
}
.card .face-copy {
  margin-top: auto;
  max-width: 58%;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}
/* 标题与箭头按卡片宽度等比，对齐作品集卡片（06-ui.svg，466 宽基准） */
.card .face-name {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 25px;
  font-size: 5.4cqw;
  font-weight: 700;
  line-height: 1.15;
  color: var(--face-ink);
}
.card .face-en {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(11px, 1.45vw, 13px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--face-muted);
  line-height: 1.2;
}
.card .face-go {
  position: absolute;
  right: 3.65%;
  bottom: 8.35%;
  width: 2.58%;
  height: auto;
  aspect-ratio: 1;
  display: block;
  color: var(--face-ink);
}
.card[data-ink="dark"] {
  --face-ink: #111111;
  --face-muted: #c7c6c6;
}
.card[data-ink="light"] {
  --face-ink: #ffffff;
  --face-muted: rgba(255, 255, 255, 0.72);
}
.card-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.card:hover .card-tag { opacity: 1; transform: translateY(0); }

.hero {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 12px 12px 12px 0;
  border-radius: 15px;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  background: #d7d7d4;
}
.hero-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  opacity: .92;
  transform: scale(1);
  transition: opacity .7s ease, transform .7s ease;
}
.hero:hover .hero-photo { transform: scale(1.02); }
.hero-photo.is-dim { opacity: .3; }
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .08) 42%, rgba(0, 0, 0, .72) 78%, #000 100%);
  pointer-events: none;
}
.hero-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  pointer-events: none;
  width: max-content;
  max-width: 80%;
}
.hero-info { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.hero-info h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
}
.hint {
  margin: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s ease, transform .3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 32px;
  padding: 0 14px;
  border-radius: 7px;
  background: rgba(0, 0, 0, .2);
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.hero:hover .hint,
.hero.is-empty .hint { opacity: 1; transform: translateY(0); }
.lightbox .lb-inspect { display: none; }
.hero-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 28px 22px;
}
.specs { display: flex; gap: 36px; min-width: 0; }
.spec { display: flex; flex-direction: column; gap: 6px; }
.spec b {
  font-weight: 400;
  font-size: 12px;
  color: #9a9a9a;
  letter-spacing: 0.08em;
}
.spec span {
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.01em;
}
.inspect {
  flex: none;
  height: 40px;
  padding: 0 16px 0 18px;
  border-radius: 7px;
  background: #f4f4f4;
  color: #121212;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  transition: background-color .15s ease, transform .15s ease;
}
.inspect:hover { background: #e6e6e6; }
.inspect:active { transform: scale(0.99); }

.lightbox,
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
}
.lightbox.open,
.backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox {
  background: #131313;
  display: flex;
  flex-direction: column;
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
  touch-action: pan-y;
}
.lightbox.is-swiping {
  transition: none;
}
.lb-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 88px 24px;
}
.lb-frame {
  width: min(775px, 100%);
  height: min(533px, 100%);
  background: #efeeeb;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transform: scale(1);
  transition: opacity .5s ease, transform .5s ease;
}
.lb-frame img.is-dim { opacity: .3; transform: scale(0.98); }
.nav-arrow {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  background: #1c1b1b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .3s ease, transform .3s ease;
}
.nav-arrow:hover { background: #2e2d2d; }
.nav-arrow:active { transform: scale(0.96); }
.nav-arrow.prev { left: 28px; }
.nav-arrow.next { right: 28px; }
.lb-foot {
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 28px 22px;
}
.lb-title { display: none; }
.thumbs { display: flex; gap: 8px; }
/* 画册缩略图：桌面/iPad 最多露 4 张，超出部分边缘渐隐（is-fade-* 由脚本按滚动位置切换） */
.lb-foot .thumbs {
  flex: none;
  max-width: calc(64px * 4 + 8px * 3);
  overflow-x: auto;
  -webkit-mask-image: linear-gradient(#000, #000);
  mask-image: linear-gradient(#000, #000);
}
.lb-foot .thumbs.is-fade-end {
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 56px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 56px), transparent 100%);
}
.lb-foot .thumbs.is-fade-start {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 56px, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 56px, #000 100%);
}
.lb-foot .thumbs.is-fade-start.is-fade-end {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 56px, #000 calc(100% - 56px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 56px, #000 calc(100% - 56px), transparent 100%);
}
.thumb { flex: none; }
.thumb {
  width: 64px;
  height: 40px;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  opacity: .5;
  background-size: cover;
  background-position: center;
  transition: opacity .3s ease, transform .3s ease;
}
.thumb:hover,
.thumb.is-on { opacity: 1; }

.backdrop {
  background: rgba(0, 0, 0, .89);
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: min(463px, 100%);
  height: 100%;
  background: #131313;
  transform: translateX(100%);
  transition: transform .3s ease;
  overflow: auto;
  padding: 22px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  touch-action: pan-y;
}
.backdrop.open .drawer { transform: translateX(0); }
.backdrop.is-swiping,
.backdrop.is-swiping .drawer {
  transition: none;
}
.kicker {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.drawer h2,
.detail-copy h1 {
  margin: 6px 0 0;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.drawer-photo,
.detail-photo {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: #efeeeb;
}
.drawer-photo { height: 250px; }
.drawer-photo img,
.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity .5s ease, transform .5s ease;
}
.drawer-photo img { object-fit: cover; object-position: center; }
.drawer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  color: #1a1a1a;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}
.drawer-nav.prev { left: 8px; }
.drawer-nav.next { right: 8px; }
.desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.spec-card {
  background: var(--panel);
  border-radius: 15px;
  padding: 6px 18px;
}
.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-size: 14px;
}
.spec-row em {
  font-style: normal;
  color: #bdbdbd;
  flex: none;
}
.spec-row span { text-align: right; }
.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}
.price-row b {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 500;
}
.btn {
  height: 53px;
  width: 100%;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:active { transform: scale(0.99); }
.btn.light { background: #fff; color: #121212; }
.btn.light:hover { background: #e8e8e8; }
.btn.dark { background: #1c1b1b; color: #f4f4f4; }
.btn.dark:hover { background: #2a2a2a; }
.btn.panel { background: var(--panel); color: #f4f4f4; }
.btn.panel:hover { background: #2a2929; }
.btn svg { display: block; }
.drawer-actions { display: flex; flex-direction: column; gap: 14px; }

.page {
  min-height: 100vh;
  background: var(--bg);
}
.page-head {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: relative;
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--line);
}
.page-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.page-title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.page-title small,
.ghost {
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--quiet);
}
.ghost { letter-spacing: 0.04em; font-family: inherit; font-size: 13px; transition: color .3s ease; }
.ghost:hover { color: #fff; }

.detail {
  width: min(1120px, calc(100% - 48px));
  margin: 28px auto 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 36px;
  align-items: stretch;
}
.detail-copy .qty-row { margin-top: auto; }
.detail-photo {
  position: relative;
  height: min(620px, 72vh);
}
.detail-photo img.is-dim { opacity: .3; transform: scale(0.98); }
.photo-nav {
  position: absolute;
  top: 50%;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  color: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .3s ease, transform .3s ease;
}
.photo-nav:hover { color: #000; }
.photo-nav.prev { left: 8px; }
.photo-nav.next { right: 8px; }
.photo-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  display: flex;
  transform: translateX(-50%);
}
.photo-dots button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}
.photo-dots button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(18, 18, 18, .14);
  transition: background-color .3s ease;
}
.photo-dots button:hover::before { background: rgba(18, 18, 18, .4); }
.photo-dots button.is-on::before { background: #121212; }
.detail-copy { padding-top: 8px; display: flex; flex-direction: column; gap: 18px; }
.detail-copy .en {
  margin: 8px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
}
.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}
.stepper {
  display: inline-flex;
  align-items: center;
  height: 29px;
  border-radius: 4px;
  background: #121212;
  overflow: hidden;
}
.stepper button {
  width: 28px;
  height: 29px;
  color: #f4f4f4;
  transition: background-color .15s ease;
}
.stepper button:hover { background: #1f1f1f; }
.stepper span {
  min-width: 22px;
  text-align: center;
  font-family: "Space Mono", monospace;
  font-size: 13px;
  color: #fff;
}

.narrow {
  width: min(732px, calc(100% - 40px));
  margin: 28px auto 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#lines,
#items {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.line {
  background: #000;
  border-radius: 15px;
  min-height: 111px;
  padding: 14px;
  display: grid;
  grid-template-columns: 83px minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  transition: opacity .3s ease, transform .3s ease;
}
.line-photo {
  width: 83px;
  height: 83px;
  border-radius: 7px;
  overflow: hidden;
  background: #efeeeb;
}
.line-photo img { width: 100%; height: 100%; object-fit: cover; }
.line h2 { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.line p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.line .sum {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  min-width: 52px;
  text-align: right;
}
.icon-btn {
  width: 28px;
  height: 28px;
  color: #9a9a9a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .3s ease;
}
.icon-btn:hover { color: #fff; }
.summary {
  background: #000;
  border-radius: 15px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary div,
.totals div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
}
.summary strong,
.totals strong { color: #fff; font-weight: 500; }
.rule { height: 1px; background: var(--line); margin: 6px 0; }
.total-label { color: #fff !important; font-size: 15px !important; }
.center-link {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  transition: color .3s ease;
}
.center-link:hover { color: #fff; }
.empty {
  min-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.empty svg { color: var(--quiet); }
.empty p { margin: 8px 0 0; font-size: 15px; }
.empty small {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 12px;
}
.empty .btn { width: auto; padding: 0 22px; margin-top: 16px; }

.checkout {
  width: min(560px, calc(100% - 40px));
  margin: 22px auto 64px;
  background: #1a1a1a;
  border-radius: 16px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.block-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.order-line {
  display: flex;
  align-items: center;
  gap: 14px;
}
.order-line img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #0e0e0e;
  flex: none;
}
.order-line > div { min-width: 0; }
.order-line p { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.order-line small { color: var(--muted); font-size: 13px; }
.order-line b {
  margin-left: auto;
  font-weight: 500;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  flex: none;
}
.fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
label.field { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13px; }
label.field.wide { grid-column: 1 / -1; }
.fields input,
.fields textarea {
  width: 100%;
  background: #262626;
  border-radius: 10px;
  color: #e5e2e1;
  padding: 13px 14px;
  resize: none;
  transition: background-color .15s ease;
}
.fields input:focus,
.fields textarea:focus { background: #2e2e2e; }
.fields input::placeholder,
.fields textarea::placeholder { color: #6a6a6a; }
.pays { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay {
  min-height: 96px;
  border-radius: 12px;
  background: #262626;
  color: #c4c7c8;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  text-align: left;
  font-size: 14px;
  transition: background-color .15s ease, color .15s ease;
}
.pay.is-on { background: #333; color: #fff; }
.pay svg { display: block; flex: none; }
.totals { display: flex; flex-direction: column; gap: 10px; }
.totals > div > span:last-child { color: #fff; }
.totals .due { color: #fff; font-size: 16px; font-weight: 500; margin-top: 4px; }
.totals .due b { font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 500; }
.status {
  min-height: 18px;
  text-align: center;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.status.bad { color: #ffb4ab; }
.checkout > .status {
  min-height: 18px;
  margin: 4px 0 -8px;
  line-height: 18px;
}

.qr-backdrop {
  z-index: 50;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.qr-sheet {
  width: min(355px, 100%);
  padding: 28px 33px 36px;
  border-radius: 15px;
  background: #131313;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(12px);
  transition: transform .3s ease;
}
.qr-backdrop.open .qr-sheet { transform: translateY(0); }
.qr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.qr-title {
  color: #c4c7c8;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.qr-head b {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
}
.qr-code {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}
.qr-code img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.qr-code.is-loading img { opacity: 0; }
.qr-missing {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  text-align: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.qr-missing small { font-family: "Space Mono", monospace; font-size: 11px; }
.qr-code.is-missing img { display: none; }
.qr-code.is-missing .qr-missing { display: grid; }
.qr-actions {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.qr-actions .btn {
  height: 53px;
  border-radius: 15px;
}
.qr-actions .btn.dark { background: #1c1b1b; }
.qr-sheet .status:empty { display: none; }
.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checkout-actions .btn {
  height: 52px;
  border-radius: 12px;
}
.checkout-actions .btn.dark { background: #262626; }
.checkout-actions .btn.dark:hover { background: #333; }
.pay-btn:disabled,
.pay-btn:disabled:hover { background: #fff; cursor: default; }
.pay-btn .label { transition: opacity .15s ease; }
.pay-btn .label.is-swap { opacity: 0; }
.pay-btn .icon-slot { position: relative; width: 16px; height: 16px; }
.pay-btn .icon-slot svg { position: absolute; inset: 0; }
.pay-btn .go { transition: transform .3s ease, opacity .3s ease; }
.pay-btn.is-paying .go,
.pay-btn.is-done .go { transform: translateX(14px); opacity: 0; }
.pay-btn .load {
  opacity: 0;
  transform: scale(.6);
  transition: opacity .25s ease, transform .3s ease;
}
.pay-btn .load g {
  transform-origin: 12px 12px;
  animation: pay-turn 1s linear infinite;
  animation-play-state: paused;
}
.pay-btn.is-paying .load { opacity: 1; transform: scale(1); transition-delay: .12s; }
.pay-btn.is-paying .load g,
.pay-btn.is-done .load g { animation-play-state: running; }
.pay-btn.is-done .load { opacity: 0; transform: scale(.6); transition-delay: 0s; }
@keyframes pay-turn { to { transform: rotate(360deg); } }
.pay-btn .tick path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset .4s ease .1s;
}
.pay-btn.is-done .tick path { stroke-dashoffset: 0; }

.added-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  background: #201f1f;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  transform: translateY(calc(100% + 28px));
  transition: transform .4s ease;
  pointer-events: none;
}
.added-toast.is-on { transform: translateY(0); }

.rail-foot {
  flex: none;
  align-self: flex-start;
  margin: 8px 0 0 6px;
  color: var(--quiet);
  font-size: 12px;
  transition: color .3s ease;
}
.rail-foot:hover { color: #fff; }
.agree {
  margin: -8px 0 0;
  text-align: center;
  color: var(--quiet);
  font-size: 12px;
}
.agree a { color: #c7c6c6; transition: color .3s ease; }
.agree a:hover { color: #fff; }

.receipt {
  width: min(560px, calc(100% - 40px));
  margin: 22px auto 64px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.receipt-panel {
  background: var(--deep);
  border-radius: 15px;
  padding: 22px 24px;
  animation: rise .5s ease both;
}
.receipt-ship { background: var(--deep); }
.receipt-panel:nth-child(2) { animation-delay: .06s; }
.receipt-panel:nth-child(3) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.receipt-hero {
  padding: 32px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: rise .5s ease both;
}
.done-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  color: #fff;
}
.done-mark path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: draw .4s ease .25s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.receipt-hero h2 { margin: 18px 0 6px; font-size: 24px; font-weight: 500; letter-spacing: 0.02em; }
.receipt-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.panel-meta { color: var(--quiet); font-family: "Space Mono", monospace; font-size: 11px; }
.receipt #items { gap: 14px; }
.receipt-total {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 7px;
  background: var(--field);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
}
.receipt-total b { color: #fff; font-family: "Space Grotesk", sans-serif; font-size: 20px; font-weight: 500; }
.ship { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ship div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.ship dt { color: var(--muted); font-size: 13px; }
.ship dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.ship-no { margin-top: 4px; }
.ship-no dd { display: flex; align-items: center; gap: 6px; font-family: "Space Mono", monospace; letter-spacing: 0.04em; }
.copy-btn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: color .3s ease;
}
.copy-btn:hover { color: #fff; }
.receipt-note { margin: 6px 0; text-align: center; color: var(--quiet); font-size: 12px; }
.receipt-note span { color: #c7c6c6; font-family: "Space Mono", monospace; }
.receipt .drawer-actions { margin-top: 4px; gap: 10px; }

.doc {
  width: min(1040px, calc(100% - 40px));
  margin: 28px auto 64px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.doc-nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-date {
  margin: 0 0 10px 12px;
  color: var(--quiet);
  font-family: "Space Mono", monospace;
  font-size: 11px;
}
.doc-link {
  height: 40px;
  padding: 0 12px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  transition: background-color .3s ease, color .3s ease;
}
.doc-link small { font-family: "Space Mono", monospace; font-size: 11px; color: var(--quiet); }
.doc-link:hover { color: #fff; }
.doc-link.is-on { background: var(--chip); color: #fff; }
.doc-body, .doc-group { display: flex; flex-direction: column; gap: 12px; }
.doc-group { scroll-margin-top: 24px; }
.doc-group + .doc-group { margin-top: 24px; }
.doc-card { padding: 24px 26px 48px; }
.head-btn {
  height: 36px;
  padding: 0 20px;
  border-radius: 8px;
  background: #fff;
  color: #121212;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: background-color .3s ease;
}
.head-btn:hover { background: #e8e8e8; }
.doc-no { color: var(--quiet); font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 0.04em; }
.doc-card h2 { margin: 10px 0 12px; font-size: 18px; font-weight: 500; }
.doc-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.doc-card p + p { margin-top: 8px; }
.doc-card b { color: var(--ink); font-weight: 500; }

@media (max-width: 980px) {
  /* 竖屏 App 栈：顶栏常驻；0 目录 / 1 预览 / 2 画册 / 3 档案 / 4 详情 */
  /*
    .home / .page 直接 fixed 贴视口：不吃 100dvh / fill-available 的误差。
    iPhone 8 无 Home 条时底边只留 --foot-pad；14 Pro 用 safe-bottom。
    卡片区内滚，购物须知常驻底。
  */
  html, body {
    height: 100%;
    overflow: hidden;
  }
  body {
    /* 有刘海/灵动岛时多下移 10px；iPhone 8（inset 0）不加 */
    --bar-top: calc(var(--safe-top) + min(10px, var(--safe-top)));
    --chrome-top: calc(var(--bar-top) + var(--app-bar-h));
    padding-top: 0;
    padding-bottom: 0;
  }
  .app-bar { display: flex; }
  .topbar-desktop { display: none; }

  .home {
    grid-template-columns: 1fr;
    position: fixed;
    top: var(--chrome-top);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
  }
  .rail {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 2px;
    /* 8：~8px；14 Pro：home 指示条 inset，只加一次 */
    padding-bottom: max(var(--foot-pad), var(--safe-bottom));
  }
  .cards {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .rail-foot {
    flex: none;
    margin: 2px 0 0 6px;
  }
  .page {
    position: fixed;
    top: var(--chrome-top);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(var(--foot-pad), var(--safe-bottom));
  }
  .hero {
    position: absolute;
    inset: 0;
    z-index: 25;
    width: 100%;
    height: 100% !important;
    margin: 0 !important;
    border-radius: 0;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .36s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .36s;
  }
  .home.is-hero .hero {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .36s cubic-bezier(.22, .61, .36, 1), visibility 0s;
  }
  .home.is-hero-drag .hero,
  .backdrop.is-swiping .drawer {
    transition: none;
  }

  /* 1：点卡片后的预览 — 顶栏 + 全幅图 + 中提示 + 标题/规格/检视档案 */
  .hero {
    background: #d8d8d5;
  }
  .hero-shade {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, .28) 55%, rgba(0, 0, 0, .78) 78%, #0e0e0e 100%);
  }
  .hero-photo {
    opacity: 1;
    background-size: cover;
    background-position: center center;
  }
  .hero-foot {
    display: flex;
    padding: 28px 20px max(24px, env(safe-area-inset-bottom, 0px));
    gap: 16px;
    align-items: flex-end;
    justify-content: space-between;
  }
  .hero-info {
    gap: 18px;
    min-width: 0;
    flex: 1;
  }
  .hero-info h1 {
    font-size: 34px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.15;
  }
  .hero .specs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: nowrap;
  }
  .hero .spec {
    gap: 5px;
  }
  .hero .spec b {
    color: #8e9192;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .hero .spec span {
    font-size: 15px;
    color: #f4f4f4;
  }
  .hero-center {
    top: 40%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: calc(100% - 40px);
  }
  .hint {
    opacity: 1;
    transform: none;
    height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    background: rgba(28, 28, 28, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 13px;
    letter-spacing: 0.02em;
  }
  .inspect {
    height: 44px;
    padding: 0 16px 0 18px;
    border-radius: 10px;
    gap: 14px;
    align-self: flex-end;
    margin-bottom: 2px;
  }
  .hero:hover .hero-photo { transform: none; }

  /* 2：全屏画册 — 大图按剩余高度收缩，避免短屏压住标题 */
  .lightbox,
  .backdrop {
    top: var(--chrome-top);
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0;
  }
  .lightbox {
    background: #0e0e0e;
    overflow: hidden;
  }
  .lb-stage {
    flex: 1 1 0;
    min-height: 140px;
    padding: 8px 0 6px;
    overflow: hidden;
  }
  .lb-frame {
    width: 100%;
    height: 100%;
    max-height: 100%;
    background: #efeeeb;
  }
  .lb-frame img { object-fit: contain; }
  .lightbox .nav-arrow {
    width: 44px;
    height: 44px;
    margin-top: -22px;
    border-radius: 0;
    background: transparent;
    color: #1a1a1a;
  }
  .lightbox .nav-arrow svg {
    width: 22px;
    height: 22px;
  }
  .lightbox .nav-arrow.prev { left: 6px; }
  .lightbox .nav-arrow.next { right: 6px; }
  .lb-foot {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 18px;
    padding: 8px 22px max(16px, env(safe-area-inset-bottom, 0px));
    min-height: 0;
    background: #0e0e0e;
    position: relative;
    z-index: 2;
  }
  .lb-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .lb-title {
    display: block;
    margin: 0;
    font-size: clamp(26px, 7vw, 34px);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #f4f4f4;
    line-height: 1.15;
  }
  .lb-foot .specs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .lb-foot .spec {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .lb-foot .spec b {
    color: #8e9192;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
  }
  .lb-foot .spec span {
    font-size: 14px;
    color: #f4f4f4;
    letter-spacing: 0.01em;
  }
  .lb-foot .thumbs {
    max-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .lb-foot .thumb {
    width: 72px;
    height: 48px;
    flex: none;
    border-radius: 6px;
    opacity: .45;
  }
  .lb-foot .thumb.is-on,
  .lb-foot .thumb:hover { opacity: 1; }
  .lb-inspect { display: none; }

  @media (max-height: 700px) {
    .lb-stage { min-height: 110px; padding: 4px 0; }
    .lb-foot { gap: 12px; padding-top: 4px; }
    .lb-info { gap: 10px; }
    .lb-foot .specs { gap: 8px; }
    .lb-title { font-size: 26px; }
    .lb-foot .thumb { width: 64px; height: 42px; }
  }

  /* 3：检视档案 — 全屏层，标题 + 大圆角图 + 左右切换 */
  .backdrop {
    background: #131313;
    justify-content: stretch;
  }
  .drawer {
    width: 100%;
    max-width: none;
    height: 100%;
    transform: translateX(100%);
    padding: 18px 20px max(28px, env(safe-area-inset-bottom, 0px));
    gap: 16px;
  }
  .backdrop.open .drawer { transform: translateX(0); }
  .drawer-head .kicker {
    font-size: 13px;
    color: #8e9192;
  }
  .drawer h2 {
    margin: 8px 0 0;
    font-size: 34px;
    font-weight: 500;
  }
  .drawer-photo {
    flex: none;
    height: min(52vh, 420px);
    border-radius: 18px;
    background: #efeeeb;
  }
  .drawer-photo img {
    object-fit: contain;
    object-position: center;
  }
  .drawer-nav {
    opacity: 1;
    pointer-events: auto;
  }

  .page,
  .checkout,
  .receipt {
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  /* 4：商品详情 — 顶栏常驻 + 页头；从左向右滑入 */
  .page {
    min-height: calc(100dvh - var(--chrome-top));
  }
  .page-head {
    height: auto;
    min-height: 64px;
    padding: 14px 20px 16px;
  }
  .page-title h1 { font-size: 26px; }
  .page-title small {
    font-size: 11px;
    letter-spacing: 0.12em;
  }
  .ghost {
    font-size: 13px;
    white-space: nowrap;
  }
  .detail {
    width: calc(100% - 40px);
    margin: 18px auto 40px;
    gap: 22px;
    grid-template-columns: 1fr;
  }
  .detail-photo {
    height: min(58vh, 440px);
    border-radius: 18px;
    background: #e8e7e4;
  }
  .photo-nav {
    width: 40px;
    height: 40px;
    color: #1a1a1a;
  }
  .photo-nav.prev { left: 4px; }
  .photo-nav.next { right: 4px; }

  body.enter-from-left .page {
    transform: translateX(-100%);
  }
  body.enter-from-left.is-enter-ready .page {
    transform: translateX(0);
    transition: transform .36s cubic-bezier(.22, .61, .36, 1);
  }
  body.is-leave-left .page {
    transform: translateX(-100%);
    transition: transform .3s ease;
  }

  .line { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px 14px; align-items: start; }
  .line-photo { width: 72px; height: 72px; grid-row: 1 / 3; }
  .line > div:nth-child(2) { grid-column: 2; grid-row: 1; }
  .line .icon-btn { grid-column: 3; grid-row: 1; justify-self: end; justify-content: flex-end; padding: 0; margin-top: -4px; }
  .line .stepper { grid-column: 2; grid-row: 2; justify-self: start; align-self: center; }
  .line .sum { grid-column: 3; grid-row: 2; align-self: center; }
  .doc { grid-template-columns: 1fr; gap: 16px; margin-top: 0; }
  .doc-nav {
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    padding: 12px 0;
    background: var(--bg);
    overflow-x: auto;
  }
  .doc-date { order: 3; margin: 0 0 0 auto; white-space: nowrap; }
  .doc-link { flex: none; gap: 10px; }
  .doc-group { scroll-margin-top: 70px; }
}
@media (max-width: 560px) {
  .page-head { padding: 14px 16px 16px; }
  .page-title h1 { font-size: 22px; }
  .receipt-panel { padding: 20px; }
  .doc-card { padding: 20px 20px 36px; }
  .drawer h2 { font-size: 28px; }
}

/* ---- boot / loading ---- */
html.is-soft-enter .boot {
  display: none !important;
}
html.is-booting,
html.is-booting body {
  overflow: hidden;
  background: #000 !important;
}
.boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}
/* 跳转前按下时不拦截点击，否则购物袋的 click 会被挡住 */
.boot.is-nav {
  pointer-events: none;
}
.boot.is-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-stage {
  width: min(168px, 42vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  background: #000;
}
.boot-sprite {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #000 url("assets/loader/moru-loop-poster.png") center / cover no-repeat;
  pointer-events: none;
}
.boot-anim {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.boot-sprite.is-ready .boot-anim {
  opacity: 1;
}
.boot-track {
  width: 72%;
  height: 2px;
  border-radius: 2px;
  background: #2a2a2a;
  overflow: hidden;
}
.boot-bar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #c7c6c6;
  transform: scaleX(0.02);
  transform-origin: left center;
  will-change: transform;
}
