:root {
  --bg-page: #f6f5f2;
  --bg-card: #ffffff;
  --bg-sidebar: #f3f2ef;
  --bg-input: #efeeeb;
  --bg-pill: #f4f1ec;
  --bg-soft-tile: #f8f6f2;
  --ink-primary: #1c1b19;
  --ink-secondary: #5c5a55;
  --ink-muted: #98958f;
  --ink-pill: #7a7268;
  --border-light: #eeece7;
  --border-med: #dfddd7;
  --accent-gold: #b8843c;
  --accent-dark: #1c1b19;
  --accent-cream: #f4f1ea;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 58px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background: #e9e6e0;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* H5 Shell: edge-to-edge on mobile, centered phone viewport on desktop */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg-page);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(28, 27, 25, 0.14);
}

@media (max-width: 480px) {
  html,
  body {
    background: var(--bg-page);
  }
  .app-shell {
    max-width: 100%;
    box-shadow: none;
  }
}

/* Tab Views */
.tab-view {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-page);
}

.tab-view.active {
  display: flex;
}

/* Common Top Nav */
.top-header {
  flex-shrink: 0;
  height: 48px;
  background: #faf9f7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 16px;
}

.top-header-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--ink-primary);
}

/* ==================== TAB 1: 首页 ==================== */
.home-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 24px;
}

.home-hero {
  background: linear-gradient(145deg, #24221f 0%, #161513 100%);
  color: #fff;
  border-radius: 14px;
  padding: 20px 18px 18px;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205, 169, 118, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.home-hero-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1px;
  color: #d6c3a5;
  border: 1px solid rgba(214, 195, 165, 0.3);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 10px;
}

.home-hero h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.home-hero p {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.home-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-cream {
  background: var(--accent-cream);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  transition: opacity 0.15s;
}

.btn-cream:active {
  opacity: 0.85;
}

.btn-ghost-light {
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 999px;
}

.home-trust-strip {
  display: flex;
  justify-content: space-between;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--ink-secondary);
  margin-bottom: 16px;
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 2px 10px;
}

.home-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-section-head h2::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--ink-primary);
}

.home-more-link {
  font-size: 12px;
  color: var(--ink-muted);
}

.home-new-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: none;
}

.home-new-rail::-webkit-scrollbar {
  display: none;
}

.home-new-card {
  flex: 0 0 144px;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  padding: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.home-new-card img {
  width: 100%;
  aspect-ratio: 1 / 0.92;
  object-fit: cover;
  border-radius: 6px;
  background: #1b2228;
  margin-bottom: 8px;
}

.home-new-card-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-new-card-spec {
  font-size: 11px;
  color: var(--ink-pill);
  margin-bottom: 5px;
}

.home-new-card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-primary);
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.home-cat-chip {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  border: 1px solid transparent;
}

.home-cat-chip:active {
  background: var(--bg-pill);
}

.home-cat-chip span {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 3px;
  font-weight: 400;
}

/* ==================== TAB 2: 分类 / 选购（核心复刻图1） ==================== */
.catalog-top-wrap {
  flex-shrink: 0;
  background: #faf9f7;
  padding: 2px 12px 10px;
  border-bottom: 1px solid var(--border-light);
}

.search-box {
  display: flex;
  align-items: center;
  height: 38px;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
}

.search-box svg {
  flex-shrink: 0;
  color: #9e9b95;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--ink-primary);
}

.search-box input::placeholder {
  color: #9d9a94;
}

.search-clear {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d5d2cc;
  color: #fff;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear.visible {
  display: flex;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
}

.filter-spacer {
  width: 68px;
}

.filter-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-secondary);
  padding: 4px 8px;
}

.filter-dropdown-btn.active {
  color: var(--ink-primary);
  font-weight: 600;
}

.sort-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--ink-primary);
  background: #ffffff;
  border: 1px solid var(--border-med);
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sort-pill-btn.active {
  border-color: var(--ink-primary);
  font-weight: 600;
}

.caret-svg {
  width: 10px;
  height: 10px;
  opacity: 0.65;
}

/* Split Layout */
.catalog-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.category-sidebar {
  width: 90px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 18px;
  scrollbar-width: none;
}

.category-sidebar::-webkit-scrollbar {
  display: none;
}

.category-item {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  color: #6b6862;
  line-height: 1.3;
  transition: background 0.15s, color 0.15s;
}

.category-item.active {
  background: #ffffff;
  color: var(--ink-primary);
  font-weight: 600;
}

.category-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 26px;
  background: var(--ink-primary);
  border-radius: 0 2px 2px 0;
}

.product-list-wrap {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 24px;
  background: #f5f4f1;
}

.product-card {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.025);
  transition: transform 0.12s ease;
  cursor: pointer;
}

.product-card:active {
  transform: scale(0.99);
}

.product-thumb-wrap {
  position: relative;
  width: 102px;
  height: 98px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #1a2127;
}

.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sold-badge {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 25, 0.44);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sold-badge span {
  font-size: 11px;
  letter-spacing: 1px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(28, 27, 25, 0.55);
}

.product-info {
  flex: 1;
  min-width: 0;
  margin-left: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.25;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 6px;
}

.meta-pill {
  display: inline-block;
  max-width: 100%;
  background: var(--bg-pill);
  color: var(--ink-pill);
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.product-price.sold {
  color: var(--ink-muted);
  text-decoration: line-through;
  font-weight: 500;
  font-size: 15px;
}

.price-symbol {
  font-size: 13.5px;
  font-weight: 600;
  margin-right: 2px;
}

.product-arrow {
  color: #bbb8b2;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-muted);
  font-size: 13.5px;
}

.empty-state p {
  margin: 0 0 14px;
}

.empty-reset-btn {
  display: inline-block;
  border: 1px solid var(--border-med);
  background: #fff;
  color: var(--ink-primary);
  font-size: 12.5px;
  padding: 6px 16px;
  border-radius: 999px;
}

/* ==================== TAB 3: 我的（复刻图3 + 轻量纯展示） ==================== */
.mine-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px 28px;
}

.mine-brand-card {
  background: #1c1b19;
  color: #ffffff;
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mine-brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mine-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e9e7e3;
  color: #b5b2ac;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.mine-brand-title {
  font-size: 16.5px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #ffffff;
}

.mine-brand-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.mine-connect-btn {
  flex-shrink: 0;
  background: var(--accent-cream);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
}

.mine-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.025);
}

.mine-card-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0 0 4px;
}

.mine-card-desc {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0 0 14px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.service-tile {
  position: relative;
  background: var(--bg-soft-tile);
  border-radius: 10px;
  padding: 13px 4px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.service-tile:active {
  background: var(--bg-pill);
}

.service-char {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #efe8dc;
  color: #7c674a;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-label {
  font-size: 12px;
  color: var(--ink-primary);
  font-weight: 500;
}

.tile-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ink-primary);
  color: #fff;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
}

.tile-badge.visible {
  display: flex;
}

.mine-menu-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 4px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.025);
}

.mine-menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.mine-menu-row:last-child {
  border-bottom: none;
}

.mine-menu-row:active {
  opacity: 0.7;
}

.mine-menu-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 3px;
}

.mine-menu-sub {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ==================== BOTTOM TAB BAR ==================== */
.tab-bar {
  flex-shrink: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 20;
}

.tab-btn {
  flex: 1;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #8c8983;
  font-size: 11px;
  font-weight: 500;
}

.tab-btn.active {
  color: var(--ink-primary);
  font-weight: 600;
}

.tab-btn svg {
  width: 22px;
  height: 22px;
}

/* ==================== DETAIL OVERLAY PAGE（核心复刻图2） ==================== */
.overlay-page {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.overlay-page.open {
  transform: translateX(0);
  pointer-events: auto;
}

.detail-nav {
  flex-shrink: 0;
  height: 48px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 48px;
}

.detail-back-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-primary);
}

.detail-nav-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}

/* Top Video Showcase */
.detail-media-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #1a2127;
  overflow: hidden;
  cursor: pointer;
}

.detail-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 8s ease-in-out;
}

.detail-media-box.playing .detail-media-img {
  transform: scale(1.12);
}

.detail-video-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.detail-media-box.has-real-video.playing .detail-video-el {
  display: block;
}

.detail-media-box.has-real-video.playing .detail-media-img {
  display: none;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.detail-media-box.playing .play-overlay {
  opacity: 0;
}

.play-triangle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
}

.media-duration {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.94);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.media-gallery-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sim-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.24);
  display: none;
}

.detail-media-box.playing .sim-progress-track {
  display: block;
}

.sim-progress-fill {
  height: 100%;
  width: 0%;
  background: #f4f1ea;
  transition: width 0.25s linear;
}

.sim-playing-badge {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 8px;
  border-radius: 999px;
  display: none;
}

.detail-media-box.playing .sim-playing-badge {
  display: inline-block;
}

/* Archive Info Block */
.detail-info-block {
  padding: 16px 18px 0;
}

.detail-archive-label {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.detail-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.detail-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-primary);
}

.detail-price {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail-price.sold {
  color: var(--ink-muted);
  text-decoration: line-through;
  font-size: 17px;
}

.detail-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-code {
  font-size: 13px;
  color: #8c8983;
}

.mini-copy-btn {
  font-size: 11px;
  color: var(--ink-pill);
  background: var(--bg-pill);
  padding: 2px 8px;
  border-radius: 4px;
}

.sold-status-tag {
  font-size: 11px;
  color: #8d4b34;
  background: #f8ece8;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* 4-Column Spec Strip */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 13px 0;
  margin-bottom: 18px;
}

.spec-cell {
  text-align: center;
  font-size: 13px;
  color: #55524d;
  position: relative;
  font-variant-numeric: tabular-nums;
}

.spec-cell:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: var(--border-light);
}

/* Detail Sections */
.detail-section {
  padding: 4px 18px 20px;
}

.detail-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0 0 14px;
}

.detail-section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--ink-primary);
  border-radius: 2px;
}

.desc-box {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid #f2f0ec;
  border-bottom: 1px solid #f2f0ec;
}

.desc-label {
  flex-shrink: 0;
  width: 36px;
  font-size: 13px;
  color: var(--ink-muted);
  padding-top: 2px;
}

.desc-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.8;
  color: #31302d;
  white-space: pre-line;
}

.gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-item {
  border-radius: 6px;
  overflow: hidden;
  background: #1a2127;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.gallery-caption {
  background: #faf9f7;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--ink-secondary);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 6px 6px;
}

/* Detail Bottom Sticky Bar */
.detail-bottom-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px calc(9px + var(--safe-bottom));
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.detail-icon-action {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: #55524d;
}

.detail-icon-action.favorited {
  color: var(--accent-gold);
}

.detail-icon-action svg {
  width: 20px;
  height: 20px;
}

.detail-primary-btn {
  flex: 1;
  height: 44px;
  border-radius: 6px;
  background: var(--accent-dark);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-primary-btn:active {
  opacity: 0.88;
}

/* ==================== SUB-PAGES (收藏 / 最近浏览) ==================== */
.subpage-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  background: var(--bg-page);
}

.subpage-header-action {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ==================== MODALS & SHEETS ==================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 19, 17, 0.56);
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal-backdrop.centered {
  align-items: center;
  padding: 20px;
}

.bottom-sheet {
  width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  padding: 16px 18px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  animation: sheetUp 0.2s ease-out;
}

@keyframes sheetUp {
  from {
    transform: translateY(28px);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
}

.sheet-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--ink-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dropdown Options */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-soft-tile);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--ink-primary);
}

.option-btn.selected {
  background: #1c1b19;
  color: #ffffff;
  font-weight: 600;
}

/* WeChat Contact + Copy Code Modal */
.contact-product-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft-tile);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

.contact-product-mini img {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: #1a2127;
}

.contact-mini-info {
  flex: 1;
  min-width: 0;
}

.contact-mini-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.contact-mini-spec {
  font-size: 11.5px;
  color: var(--ink-pill);
}

.contact-mini-price {
  font-size: 15px;
  font-weight: 700;
}

.copy-code-card {
  background: #faf8f4;
  border: 1px dashed #d6cfc3;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-code-text {
  font-size: 12.5px;
  color: var(--ink-primary);
  font-weight: 500;
  line-height: 1.45;
  word-break: break-all;
}

.copy-code-btn {
  flex-shrink: 0;
  background: var(--ink-primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 6px;
}

.copy-code-btn.copied {
  background: #2f7a4d;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.qr-img {
  width: 186px;
  height: 186px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
  -webkit-touch-callout: default;
  user-select: none;
}

.qr-tip {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.qr-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.wechat-id-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-pill);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-primary);
}

.wechat-copy-link {
  color: var(--accent-gold);
  font-weight: 600;
}

/* Standards Modal */
.standard-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.standard-item:last-child {
  border-bottom: none;
}

.standard-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ink-primary);
}

.standard-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-secondary);
}

/* Poster Modal */
.poster-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.poster-preview-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  margin-bottom: 10px;
  background: #faf9f7;
}

.poster-preview-wrap img,
.poster-preview-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

.poster-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0 0 12px;
}

.poster-actions {
  display: flex;
  gap: 10px;
}

.poster-actions button {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--ink-primary);
}

.btn-primary {
  background: var(--ink-primary);
  color: #fff;
}

/* Fullscreen Lightbox */
.lightbox {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 11, 0.94);
  z-index: 80;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 76vh;
  max-height: 76dvh;
  border-radius: 6px;
  object-fit: contain;
}

.icp-footer {
  text-align: center;
  padding: 18px 8px 6px;
  font-size: 11px;
  color: #b4b0a8;
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.lightbox-caption {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  text-align: center;
}

.lightbox-nav {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12.5px;
}

.lightbox-nav button {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12.5px;
}

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(28, 27, 25, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  max-width: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
