/* ============================================
   assa Shop · iOS Style · PC
   设计语言：iOS 卡片式 · 大圆角 · 毛玻璃 · 柔和层次
   2026-08-12 按豆包设计建议全面优化：
   - 主色状态色阶 / 语义色对齐 iOS 系统色
   - 中性灰阶 + prefers-color-scheme 深色模式
   - 阴影/毛玻璃按层级分层
   - 字号对齐 iOS HIG / 按下反馈 / 滚动吸附
   ============================================ */

/* ---- 主题变量（亮色默认） ---- */
:root {
  /* 主色状态色阶 */
  --brand: #FF7A45;
  --primary-text: #D84A1F; /* 主色文字（对比度 4.8:1 达标 AA，--brand 仅装饰/图标/背景） */
  --brand-hover: #E66A3B;
  --brand-disabled: #FFBFA8;
  --brand-soft: #FFF2EC;
  --brand-gradient: linear-gradient(135deg, #FF8F65 0%, #FF6B35 100%);

  /* 语义色（对齐 iOS 系统色） */
  --success: #30D158;
  --success-soft: rgba(48, 209, 88, 0.12);
  --danger: #FF3B30;
  --danger-soft: rgba(255, 59, 48, 0.1);
  --link: #007AFF;
  --warning: #FF9F0A;

  /* 中性灰阶（10 级，从背景到主文字） */
  --neutral-1: #FFFFFF;
  --neutral-2: #F2F4F8;
  --neutral-3: #ECEEF3;
  --neutral-4: #E1E4EB;
  --neutral-5: #C6CBD4;
  --neutral-6: #8E939E;
  --neutral-7: #6E7380;
  --neutral-8: #555A66;
  --neutral-9: #343844;
  --neutral-10: #1C1C1E;

  /* 语义化文字/背景（tertiary 刻意压深一档保证小字可读，不再直接用 neutral-5 的浅灰） */
  --text-primary: var(--neutral-10);
  --text-secondary: var(--neutral-7);
  --text-tertiary: #8E939E;
  --text-quaternary: #C6CBD4;
  --bg-primary: var(--neutral-2);
  --bg-secondary: var(--neutral-1);
  --bg-tertiary: var(--neutral-3);
  --bg-glass: rgba(242, 244, 248, 0.7);
  --border-light: rgba(0, 0, 0, 0.05);
  --border-medium: rgba(0, 0, 0, 0.08);

  /* 圆角分层 */
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* 双层阴影分层 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 6px 16px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(255, 122, 69, 0.2), 0 16px 48px rgba(255, 122, 69, 0.15);
  --shadow-sheet: 0 2px 8px rgba(0, 0, 0, 0.08), 0 24px 64px rgba(0, 0, 0, 0.14);

  /* 字号层级（iOS HIG） */
  --fs-title-1: 28px;
  --fs-title-2: 20px;
  --fs-headline: 17px;
  --fs-subheadline: 15px;
  --fs-body: 15px;
  --fs-caption: 13px;
  --fs-caption-2: 11px;

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- 深色模式 ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --neutral-1: #1C1C1E;
    --neutral-2: #0E0E10;
    --neutral-3: #2C2C2E;
    --neutral-4: #3A3A3C;
    --neutral-5: #48484A;
    --neutral-6: #636366;
    --neutral-7: #98989D;
    --neutral-8: #BEBEC2;
    --neutral-9: #E5E5E7;
    --neutral-10: #F2F2F7;

    --brand: #FF8F65;
    --primary-text: #FF9A73;
    --brand-hover: #FFA585;
    --brand-disabled: #7A3D2C;
    --brand-soft: rgba(255, 122, 69, 0.15);

    --bg-glass: rgba(14, 14, 16, 0.75);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);

    /* 深色模式文字对比度：tertiary/quaternary 必须提亮到 iOS dark 可读级别，
       否则 #48484A 在 #0E0E10 背景上小字完全看不清 */
    --text-primary: #F2F2F7;
    --text-secondary: #AEAEB2;
    --text-tertiary: #8E8E93;
    --text-quaternary: #636366;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
               'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei',
               'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.5;
  min-height: 100vh;
  letter-spacing: -0.01em;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(255, 122, 69, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 10%, rgba(102, 126, 234, 0.04) 0%, transparent 55%),
    var(--bg-primary);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- 通用按压反馈（模拟 iOS 触感） ---- */
.press-feedback {
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
  will-change: transform;
}

.press-feedback:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* 全交互按压反馈（iOS 触感，未单独定义 :active 的元素统一生效） */
button:active,
a:active,
.goods-card:active,
.cat-pill:active,
.topbar-link:active,
.notice-pill:active,
.fab-main-btn:active,
.back-top-btn:active {
  transform: scale(0.97);
}

/* ================================================
   顶部导航栏（毛玻璃，64px）
   ================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--border-medium);
  transition: background 0.3s var(--ease);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
  letter-spacing: -0.5px;
}

.topbar-title {
  font-size: var(--fs-headline);
  font-weight: 600;
  color: var(--text-primary);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-link {
  padding: 7px 14px;
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: all 0.15s var(--ease);
}

.topbar-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* 客服按钮：主色填充小按钮（比文字链接醒目） */
.topbar-link.primary {
  color: #fff;
  background: var(--brand-gradient);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
}

.topbar-link.primary:hover {
  color: #fff;
  background: var(--brand-gradient);
  opacity: 0.9;
}

/* 搜索快捷键提示 */
.topbar-kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border: 0.5px solid var(--border-light);
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: 4px;
}

/* ================================================
   店铺头卡
   ================================================ */
.shop-header {
  margin-top: 24px;
  margin-bottom: 24px;
}

/* 最近成交滚动条 */
.recent-deals {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 0 0 14px;
  min-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shop-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.shop-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle at top right, rgba(255, 122, 69, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.shop-card-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
}

.shop-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--brand-soft), 0 6px 18px rgba(255, 107, 53, 0.25);
  letter-spacing: -1px;
}

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

.shop-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.shop-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.2;
}

.shop-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  background: #34C759;
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.shop-verified svg { width: 10px; height: 10px; stroke-width: 3.5; }

.shop-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption-2);
  font-weight: 500;
  color: var(--text-secondary);
}

.shop-badge svg { width: 13px; height: 13px; }
.shop-badge strong { color: var(--text-primary); font-weight: 600; }
.shop-badge.success {
  color: var(--primary-text);
  background: var(--brand-soft);
}
.shop-badge.success strong { color: var(--primary-text); font-size: 14px; font-weight: 700; font-feature-settings: 'tnum' 1; }

.shop-join {
  font-size: var(--fs-caption-2);
  color: var(--text-tertiary);
  font-weight: 400;
  white-space: nowrap;
}

/* 累计售卡信任数据 */
.shop-sold-strip {
  margin-top: 12px;
  font-size: var(--fs-caption);
  display: flex;
  align-items: center;
  gap: 14px;
}

.shop-auto {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-primary);
  font-weight: 500;
}

.shop-auto-icon { width: 13px; height: 13px; color: var(--brand); }

.shop-sold {
  color: var(--text-tertiary);
  font-weight: 400;
}

.shop-sold b {
  color: var(--primary-text);
  font-weight: 700;
  font-size: 14px;
  font-feature-settings: 'tnum' 1;
}

/* 销量 <100 弱化为灰（新店不暴露短板），≥100 由 JS 去掉 low 类转品牌橙 */
.shop-sold b.low {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 13px;
}

/* 公告：静态橙底条（点击展开弹窗） */
/* 联系方式条（店铺头卡底部） */
.shop-contact-wrap {
  margin: 20px -24px -24px;
  border-top: 1px solid var(--border-medium);
  padding: 12px 24px;
}

.contact-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-bar-icon {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.contact-bar-label {
  font-size: var(--fs-caption);
  font-weight: 400;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.contact-bar-links {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 联系方式纯文字（无胶囊背景）：主渠道「应用名深灰 + 账号品牌橙」 */
.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 2px;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s var(--ease);
  cursor: pointer;
}

.contact-chip:hover .chip-name { color: var(--primary-text); }
.contact-chip:active { opacity: 0.7; }

.chip-name { color: var(--text-primary); }
.chip-account {
  color: var(--primary-text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-feature-settings: 'tnum' 1;
}

/* 行为提示图标：跳转 ↗ / 复制 ⧉ */
.chip-action-ico {
  width: 12px;
  height: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* 次渠道：纯文字深灰，显示应用名缩写 */
.contact-chip--secondary {
  padding: 5px 2px;
  background: none;
  color: var(--text-secondary);
}
.contact-chip--secondary .chip-name { color: var(--text-secondary); }
.contact-chip--secondary .chip-account { color: var(--text-secondary); }
.contact-chip--secondary:hover .chip-name { color: var(--primary-text); }
.contact-chip--secondary:active { opacity: 0.7; }

.shop-notice-wrap {
  margin: -24px -24px 16px;
}

.notice-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  background: var(--brand);
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  max-width: 100%;
  cursor: default;
  transition: background 0.15s var(--ease);
}

.notice-pill svg { width: 13px; height: 13px; flex-shrink: 0; }

.notice-pill-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 公告条可点击（弹窗展示全部内容） */
.notice-pill.clickable { cursor: pointer; }
.notice-pill.clickable:hover { background: rgba(255, 122, 69, 0.85); }

/* 公告弹窗（点击公告条弹出全部内容） */
.notice-modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: calc(100vw - 48px);
  margin: auto;
}
.notice-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.notice-modal-card {
  width: 420px;
  max-width: calc(100vw - 48px);
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sheet);
  padding: 24px;
  text-align: center;
}
.notice-modal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.notice-modal-head svg { width: 18px; height: 18px; color: var(--brand); }
.notice-modal-head h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.notice-modal-body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 50vh;
  overflow-y: auto;
}
.notice-count {
  margin-top: 10px;
  min-height: 17px;
  font-size: 12px;
  color: var(--text-tertiary, #8e8e93);
  text-align: right;
}
.notice-modal-ok {
  margin-top: 20px;
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}
.notice-modal-ok:hover { opacity: 0.9; }

/* ================================================
   分类 + 搜索合并行（PC 专属）
   ================================================ */
/* 分类自动换行 + 搜索框按宽度分档：
   - 宽桌面：分类在左自动换行，搜索框 240px 固定在右、与首行顶部对齐；
   - 中等/窄窗口：分类自身的 flex-basis 保证搜索框整体换到下一行，独占一行。
   不再使用横向滚动（隐藏滚动条会让后面的分类"看起来不存在"，2026-10-24 修复）。 */
.toolbar-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.cat-pills {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
}

.cat-pill {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  background: var(--bg-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}

.cat-pill:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.cat-pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(255, 122, 69, 0.3);
}

.cat-pill[data-empty="true"] { display: none; }

.cat-count {
  font-size: var(--fs-caption-2);
  font-weight: 600;
  opacity: 0.6;
  margin-left: 2px;
}

/* 搜索框（宽桌面靠右固定 240px；换行后独占一行、填满可用宽度） */
.search-box {
  position: relative;
  flex: 0 0 240px;
  width: 240px;
  max-width: 100%;
  box-sizing: border-box;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  display: flex;
}

.search-icon svg { width: 15px; height: 15px; }

.search-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 40px 0 38px;
  background: var(--bg-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}

.search-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 500;
}

.search-input:focus {
  border-color: var(--primary-text);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px rgba(255, 122, 69, 0.12);
}

.search-clear {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-tertiary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease);
}

.search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-clear:hover { color: var(--text-secondary); }
.search-clear svg { width: 11px; height: 11px; }

.search-stats {
  margin-top: 6px;
  font-size: var(--fs-caption-2);
  color: var(--text-tertiary);
  font-weight: 500;
  min-height: 16px;
  padding-left: 4px;
  margin-bottom: 12px;
}

/* ================================================
   商品网格
   ================================================ */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-bottom: 72px;
  transition: opacity 0.2s var(--ease);
}

.goods-grid.switching { opacity: 0.4; }

/* 商品卡：iOS 毛玻璃基底 + 质感封面 + 信息区（豆包优化） */
.goods-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  display: flex;
  flex-direction: column;
  position: relative;
}

.goods-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.08);
}

.goods-card:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* 右上角状态标：iOS 毛玻璃胶囊 */
.card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  letter-spacing: 0.3px;
  pointer-events: none;
}

.card-status.low { background: rgba(255, 59, 48, 0.8); box-shadow: 0 2px 8px rgba(255, 59, 48, 0.25); }
.card-status.out { background: rgba(142, 142, 147, 0.8); box-shadow: 0 2px 8px rgba(142, 142, 147, 0.2); }

/* 封面：顶部高光 + 卡密条纹肌理 + 品牌橙浅渐变（全店统一色） */
.goods-cover {
  aspect-ratio: 3 / 2;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 0, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    repeating-linear-gradient(to bottom, transparent, transparent 7px, rgba(0, 0, 0, 0.025) 7px, rgba(0, 0, 0, 0.025) 8px),
    linear-gradient(135deg, rgba(255, 122, 69, 0.10), rgba(255, 122, 69, 0.03));
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 实物商品封面图（有图才渲染；无图保持原装饰背景） */
.goods-cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}

/* 顶部品牌橙渐变消融（全店统一色） */
.goods-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(to bottom, var(--brand) 0%, var(--brand) 25%, transparent 100%);
  opacity: 0.65;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
  pointer-events: none;
}

/* 右下角磁条（卡密暗示） */
.goods-cover::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 26px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
  opacity: 0.18;
  z-index: 1;
  pointer-events: none;
}

/* 售罄整卡灰化 */
.goods-card.sold-out {
  cursor: not-allowed;
  opacity: 0.55;
}

.goods-card.sold-out .goods-cover {
  filter: grayscale(1);
}

.goods-card.sold-out:hover {
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* 深色模式：卡片毛玻璃转深色 */
@media (prefers-color-scheme: dark) {
  .goods-card {
    background: rgba(28, 28, 30, 0.72);
    border-color: rgba(255, 255, 255, 0.1);
  }
  .goods-cover {
    background:
      linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
      repeating-linear-gradient(to bottom, transparent, transparent 7px, rgba(255, 255, 255, 0.04) 7px, rgba(255, 255, 255, 0.04) 8px),
      linear-gradient(135deg, rgba(255, 138, 89, 0.12), rgba(255, 122, 69, 0.04));
  }
}

/* 商品信息 */
.goods-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.goods-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.goods-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 4px;
  margin-top: auto;
  padding-top: 2px;
}

/* 价格永远完整显示；空间不足时库存/已售胶囊换行 */
.goods-price {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-text);
  letter-spacing: -0.3px;
  font-feature-settings: 'tnum' 1;
}
.goods-price::first-letter {
  font-size: 0.62em;
  font-weight: 500;
  margin-right: 0.5px;
}

.goods-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}

.goods-sold {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.goods-stock {
  font-size: 10px;
  font-weight: 500;
  color: var(--success);
  background: var(--success-soft);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goods-stock.low { color: var(--danger); background: var(--danger-soft); }
.goods-stock.out { color: var(--text-tertiary); background: var(--bg-tertiary); }

/* 备注行固定占位：有无备注卡片结构都一致（底部价格/库存统一对齐） */
.goods-tag-row {
  min-height: 20px;
  display: flex;
  align-items: flex-start;
}

.goods-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--brand-soft);
  color: var(--primary-text);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5;
}

/* ================================================
   空状态
   ================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  box-shadow: var(--shadow-sm);
}

.empty-state-icon svg { width: 24px; height: 24px; }

.empty-state p {
  font-size: var(--fs-subheadline);
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state span {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
}

/* ================================================
   Sheet 弹窗（居中，毛玻璃）
   ================================================ */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.sheet-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.sheet-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--radius-xl);
  z-index: 201;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (prefers-color-scheme: dark) {
  .sheet-panel { background: rgba(28, 28, 30, 0.85); }
}

.sheet-panel.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* sheet 顶部拖动条 */
.sheet-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
}

.sheet-handle-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-quaternary);
}

.sheet-header {
  padding: 8px 24px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border-light);
}

.sheet-title {
  flex: 1;
  min-width: 0;
}

.sheet-title h2 {
  font-size: var(--fs-title-2);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.3;
  /* 商品名最长 500 字符：标题只占 3 行，完整名称在下方可滚动的商品确认区里 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
}

.sheet-close:hover {
  background: var(--border-medium);
  color: var(--text-primary);
}

.sheet-close svg { width: 14px; height: 14px; }

.sheet-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
  /* flex 子项默认 min-height:auto 会被内容顶开：必须给 0 才能真正收缩并滚动，
     否则超长标题会把正文挤没、把底部按钮顶出可视区 */
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.sheet-footer {
  padding: 14px 24px 24px;
  flex-shrink: 0;
  border-top: 0.5px solid var(--border-light);
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

@media (prefers-color-scheme: dark) {
  .sheet-footer { background: rgba(28, 28, 30, 0.7); }
}

/* ================================================
   Sheet 内：商品详情
   ================================================ */
/* 信任条 + 防欺诈 */
.sheet-trustbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 0 12px;
  font-size: var(--fs-caption-2);
  color: var(--text-tertiary);
}
.tb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.tb-item svg { width: 13px; height: 13px; color: var(--brand); flex-shrink: 0; }

.sheet-trustbar svg { width: 14px; height: 14px; flex-shrink: 0; }

/* 商品确认区（视觉锚点） */
.sheet-goods {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.sheet-goods-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* 商品确认区：长商品名/长单词必须能在容器内折行（min-width:0 让 flex 子项真正可收缩） */
.sheet-goods-info { flex: 1; min-width: 0; }
.sheet-goods-title { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; }
.sheet-goods-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; overflow-wrap: anywhere; }

.sheet-fraud {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--fs-caption-2);
  color: var(--text-tertiary);
  font-weight: 400;
  line-height: 1.6;
}
.sheet-fraud svg { width: 14px; height: 14px; color: var(--brand); flex-shrink: 0; margin-top: 1px; }

.sheet-desc {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 160px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.sheet-desc p { margin-bottom: 6px; }
.sheet-desc ul, .sheet-desc ol { padding-left: 18px; margin: 4px 0; }
.sheet-desc li { margin-bottom: 2px; }
.sheet-desc strong { font-weight: 600; color: var(--text-primary); }
.sheet-desc img { max-width: 100%; border-radius: 8px; }

.sheet-remark {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--primary-text);
  font-size: var(--fs-caption);
  font-weight: 600;
}

/* 金额信息卡片分组 */
.sheet-summary {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px 16px;
  margin-bottom: 14px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border-light);
}

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

.info-label {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  font-size: var(--fs-subheadline);
  font-weight: 600;
  color: var(--text-primary);
}

.info-value.price {
  font-size: 18px;
  color: var(--primary-text);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.info-note {
  font-size: var(--fs-caption-2);
  color: var(--text-tertiary);
  font-weight: 500;
  margin-left: 8px;
}

/* 应付合计（突出） */
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 12px;
}

.summary-total-label {
  font-size: var(--fs-subheadline);
  font-weight: 600;
  color: var(--text-primary);
}

.summary-total-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-text);
  letter-spacing: -0.5px;
  font-feature-settings: 'tnum' 1;
}
.summary-total-value::first-letter {
  font-size: 0.6em;
  font-weight: 600;
  margin-right: 0.5px;
}

/* 数量控件 */
.qty-control {
  display: inline-flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.qty-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s var(--ease);
  font-size: 16px;
  font-weight: 500;
}

.qty-btn:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

.qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.qty-input {
  width: 44px;
  height: 34px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: var(--fs-subheadline);
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  font-feature-settings: 'tnum' 1;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 联系方式输入 */
.field-group {
  margin-top: 14px;
}

.field-label {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--bg-tertiary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--fs-subheadline);
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s var(--ease);
}

.field-input::placeholder { color: var(--text-tertiary); font-weight: 500; }

.field-input:focus {
  border-color: var(--primary-text);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px rgba(255, 122, 69, 0.12);
}

.field-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: var(--fs-caption-2);
  color: var(--text-tertiary);
  font-weight: 500;
}

.form-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 59, 48, 0.15);
  border-radius: var(--radius-md);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--danger);
}

/* 支付方式 */
.pay-section {
  margin-top: 14px;
}

.pay-channels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.pay-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: left;
}

.pay-channel:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

.pay-channel.active {
  background: rgba(255, 122, 69, 0.08);
  border-color: var(--primary-text);
  box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.15);
}

.pay-channel-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 官方品牌 logo 徽标 */
.pay-channel-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  flex-shrink: 0;
}

.pay-channel-name {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--text-quaternary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}

.pay-check svg { width: 10px; height: 10px; }

.pay-channel.active .pay-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pay-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  font-weight: 500;
  padding: 12px;
  justify-content: center;
}

.pay-empty {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  font-weight: 500;
  padding: 12px;
  text-align: center;
}

/* 加载失败：可原地重试，不重建购买表单（收货草稿与数量保留） */
.pay-error-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
}
.pay-error-text {
  font-size: var(--fs-caption);
  color: #b45309;
  font-weight: 500;
}
.pay-retry {
  appearance: none;
  padding: 5px 12px;
  font-size: var(--fs-caption);
  font-weight: 600;
  font-family: inherit;
  color: var(--brand);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 8px;
  cursor: pointer;
}
.pay-retry:disabled { opacity: .5; cursor: default; }

/* 底部按钮 */
.btn-primary {
  flex: 1;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--fs-headline);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.3);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  padding: 0 20px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--fs-subheadline);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================
   Sheet 内：订单结果 + 即时交付
   ================================================ */
.order-result {
  text-align: center;
  padding: 20px 0;
}

.order-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--success-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  animation: popIn 0.4s var(--ease-spring);
}

.order-success-icon svg { width: 28px; height: 28px; }

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.order-pay-title {
  font-size: var(--fs-title-2);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.order-pay-amount {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary-text);
  margin: 10px 0;
  letter-spacing: -0.5px;
  font-feature-settings: 'tnum' 1;
}

.order-no {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 6px;
  word-break: break-all;
  font-feature-settings: 'tnum' 1;
}

.order-no b {
  color: var(--text-secondary);
  font-weight: 600;
}

.order-qr-section {
  margin: 16px 0;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  text-align: center;
}

.order-qr-section img {
  max-width: 200px;
  margin: 0 auto 8px;
  border-radius: 8px;
}

.order-qr-hint {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  font-weight: 500;
}

.order-copy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 18px;
  background: var(--brand-soft);
  color: var(--primary-text);
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.order-copy-link:hover { background: rgba(255, 122, 69, 0.18); }

.order-countdown {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  margin-top: 8px;
  font-weight: 500;
}

.order-countdown b {
  color: var(--primary-text);
  font-weight: 700;
  font-feature-settings: 'tnum' 1;
}

.order-countdown.warning b { color: var(--danger); }

.order-pay-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* 待支付时「立即支付」是整个结果页唯一的主操作：实心品牌渐变，比「刷新支付状态」更醒目 */
  min-height: 48px;
  padding: 12px 16px;
  background: var(--brand-gradient);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: var(--fs-headline);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.3);
  margin-top: 12px;
  transition: all 0.2s var(--ease);
}

.order-pay-link:hover { filter: brightness(1.04); box-shadow: 0 6px 18px rgba(255, 107, 53, 0.36); color: #fff; }
.order-pay-link:active { transform: scale(0.98); }

/* 刷新支付状态：次要按钮，整行宽度，与「立即支付」同宽 */
/* 刷新支付状态：弹层底色是半透明渐变，--bg-tertiary 几乎看不出是按钮（2026-11-06 业主同意加深）。
   用 iOS 系统填充色 + 细边框做成整行次要按钮，亮/暗色都可见，仍明显弱于「立即支付」 */
#sheetBody #payRefreshBtn {
  display: flex;
  width: 100%;
  height: 44px;
  margin-top: 10px;
  background: rgba(120, 120, 128, 0.16);
  border: 1px solid rgba(60, 60, 67, 0.18);
  color: var(--text-primary);
}
#sheetBody #payRefreshBtn:hover { background: rgba(120, 120, 128, 0.24); }
#sheetBody #payRefreshBtn:disabled { opacity: .5; cursor: default; }

/* 支付成功 → 即时交付卡密 */
.delivery-card {
  text-align: center;
  padding: 20px 0;
}

.delivery-card-title {
  font-size: var(--fs-title-2);
  font-weight: 700;
  color: var(--success);
  margin: 0 0 4px;
}

.delivery-card-sub {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  margin-bottom: 16px;
  font-weight: 500;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin-bottom: 12px;
}

.card-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.card-item-main {
  flex: 1;
  min-width: 0;
}

/* 长卡密：纯文本、保留空格与 Tab、自动换行；默认最多 8em，展开后完整可见 */
.card-item-text {
  font-size: var(--fs-subheadline);
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  letter-spacing: 0.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  tab-size: 4;
  max-height: 8em;
  overflow: hidden;
  user-select: text;
  cursor: text;
}

.card-item.expanded .card-item-text { max-height: none; overflow: visible; }

.card-item-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-expand-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption-2);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.card-expand-btn:hover { background: var(--border-light); }

.card-copy-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--brand-soft);
  color: var(--primary-text);
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption-2);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.card-copy-btn:hover { background: rgba(255, 122, 69, 0.18); }
.card-copy-btn.copied { background: var(--success-soft); color: var(--success); }

.card-copy-all {
  width: 100%;
  height: 42px;
  margin-bottom: 8px;
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--fs-subheadline);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.25);
}

.delivery-usage {
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: var(--fs-caption-2);
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
}

/* Toast 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28, 28, 30, 0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-weight: 500;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

/* 过期状态 */
.order-expired {
  text-align: center;
  padding: 20px 0;
}

.order-expired p {
  font-size: var(--fs-headline);
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 4px;
}

.order-expired span {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
}

/* ================================================
   客服 FAB
   ================================================ */
.fab-contact {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 150;
}

.fab-main-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 122, 69, 0.2), 0 16px 48px rgba(255, 122, 69, 0.15);
  transition: all 0.25s var(--ease-spring);
}

.fab-main-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(255, 122, 69, 0.3), 0 20px 56px rgba(255, 122, 69, 0.2);
}

.fab-main-btn svg { width: 24px; height: 24px; }

.fab-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  padding: 6px;
  transform-origin: bottom right;
  animation: fabPop 0.25s var(--ease-spring);
}

.fab-panel.hidden { display: none; }

@keyframes fabPop {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.fab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.15s var(--ease);
}

.fab-item:hover {
  background: var(--bg-tertiary);
  color: var(--primary-text);
}

.fab-item-copy {
  cursor: pointer;
}

/* 返回顶部 */
.back-top-btn {
  position: fixed;
  right: 24px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.2s var(--ease);
  z-index: 140;
}

.back-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-top-btn:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

.back-top-btn svg { width: 18px; height: 18px; }

/* ================================================
   页脚
   ================================================ */
.site-footer {
  padding: 24px 0 32px;
  text-align: center;
  border-top: 0.5px solid var(--border-light);
  margin-top: 20px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.footer-link {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.15s var(--ease);
}

.footer-link:hover { color: var(--primary-text); }

.footer-copy {
  font-size: var(--fs-caption-2);
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ================================================
   响应式
   ================================================ */
@media (max-width: 900px) {
  .goods-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-row { flex-direction: column; align-items: stretch; }
  .cat-pills { flex: 1 1 auto; }
  .search-box { flex: 1 1 auto; width: 100%; }
}

/* 2026-11-06 顶栏防挤压：店铺名过长时省略、导航链接不换行（原窄窗口下导航被挤成一字一行的竖排并撑出页面） */
.topbar-left { min-width: 0; flex: 1 1 auto; }
.topbar-logo { flex-shrink: 0; }
.topbar-title { min-width: 0; }
.topbar-actions { flex-shrink: 0; margin-left: 12px; }
.topbar-link { white-space: nowrap; }

/* 窄窗口（iPad 分屏 / 缩小的桌面浏览器窗口仍走 PC 模板）：收紧边距，店铺名可换两行，不被认证徽章挤成窄竖条 */
@media (max-width: 600px) {
  .wrap, .topbar-inner { padding: 0 14px; }
  .topbar-title { max-width: none; font-size: 15px; }
  .topbar-actions { gap: 2px; margin-left: 8px; }
  .topbar-link { padding: 6px 8px; }
  .shop-card { padding: 16px; }
  .shop-card-content { gap: 14px; align-items: flex-start; }
  .shop-avatar { width: 52px; height: 52px; font-size: 22px; }
  .shop-name-row { flex-wrap: wrap; gap: 4px 8px; }
  .shop-name { font-size: 17px; min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .shop-sold-strip { flex-wrap: wrap; gap: 4px 14px; }
  .shop-auto { white-space: nowrap; }
  .goods-grid { gap: 12px; }
}
@media (max-width: 380px) {
  .topbar-link { padding: 5px 5px; font-size: 12px; }
  .topbar-logo { width: 30px; height: 30px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 超长商品名 + 矮窗口兜底（2026-10-26）：
   头部只占 3 行、正文可收缩滚动；窗口极矮时面板自身也可滚动，保证底部按钮始终能点到。 */
@media (max-height: 620px) {
  .sheet-panel { max-height: 96vh; }
  .sheet-body { padding: 12px 18px; }
}
@media (max-height: 480px) {
  .sheet-panel { overflow-y: auto; }
  .sheet-body { overflow-y: visible; min-height: 72px; }
}

/* 数量限购提示（2026-11-07）：有限购时常显「每单限购 N 件」，超上限被改回时变红说明原因 */
.qty-hint { margin: -2px 0 8px; text-align: right; font-size: 12px; line-height: 1.4; color: var(--text-tertiary); }
.qty-hint:empty { display: none; }
.qty-hint.warn { color: #e5484d; font-weight: 600; }
