/* ==========================================================================
   芒果-社媒出海 · 设计系统
   Stripe / Vercel 风格：留白克制、毛玻璃、细腻边框高亮、芒果橙渐变
   ========================================================================== */

:root {
  --brand-1: #009A55;
  --brand-2: #3ED598;
  --grad: linear-gradient(135deg, #009A55 0%, #3ED598 100%);
  --grad-135: linear-gradient(135deg, #009A55 0%, #3ED598 100%);
  --grad-text: linear-gradient(120deg, #009A55 0%, #00B265 45%, #3ED598 100%);

  /* 默认：亮色主题 */
  --bg: #FAFAFB;
  --bg-soft: #FFFFFF;
  --surface: rgba(16, 22, 34, .035);
  --surface-2: rgba(16, 22, 34, .06);
  --border: rgba(16, 22, 34, .09);
  --border-strong: rgba(16, 22, 34, .16);
  --text: #0F131A;
  --text-2: #3C4453;
  --muted: #6B7383;

  --success: #17A45B;
  --danger: #E5484D;
  --warn: #C77E00;
  --info: #3D6FE0;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 10px rgba(18, 24, 40, .06);
  --shadow: 0 12px 34px rgba(18, 24, 40, .10);
  --shadow-glow: 0 0 0 1px rgba(0, 178, 101, .30), 0 10px 30px rgba(0, 178, 101, .14);

  --maxw: 1240px;
  --nav-h: 64px;
}

/* 深色主题（手动切换） */
[data-theme="dark"] {
  --bg: #08090C;
  --bg-soft: #0C0E13;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #F3F5F8;
  --text-2: #C6CBD4;
  --muted: #8A93A2;

  --success: #25C26E;
  --danger: #FF5A5F;
  --warn: #FFB020;
  --info: #5B8DEF;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --shadow-glow: 0 0 0 1px rgba(0, 178, 101, .28), 0 10px 34px rgba(0, 178, 101, .16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(0, 178, 101, .16), transparent 60%),
    radial-gradient(760px 420px at 92% 4%, rgba(62, 213, 152, .12), transparent 62%);
}
[data-theme="light"] body::before { opacity: .55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(0, 178, 101, .32); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ------------------------------- 导航栏 ------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.2px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: var(--shadow-glow); }
.brand-text { font-size: 16px; }
.brand-text span { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  padding: 7px 12px; border-radius: 9px; font-size: 14px; color: var(--text-2);
  transition: .18s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

.search {
  flex: 1; max-width: 320px; position: relative; display: flex; align-items: center;
}
.search input {
  width: 100%; height: 38px; padding: 0 14px 0 36px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  outline: none; transition: .18s ease; font-size: 14px;
}
.search input:focus { border-color: rgba(0, 178, 101, .55); box-shadow: 0 0 0 4px rgba(0, 178, 101, .12); }
.search svg { position: absolute; left: 12px; opacity: .55; }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn {
  height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: .18s ease; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--grad); border: none; color: #FFFFFF; font-weight: 650;
  box-shadow: 0 6px 18px rgba(0, 178, 101, .28);
}
/* 显式保持渐变：.btn:hover（0-2-0）特异性高于 .btn-primary（0-1-0），
   不写这条的话鼠标悬停时背景会被通用的 --surface-2 浅灰盖掉，白字变得不可读 */
.btn-primary:hover {
  background: var(--grad); border: none; color: #FFFFFF;
  box-shadow: 0 10px 26px rgba(0, 178, 101, .38);
  filter: brightness(1.05); transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); filter: brightness(.98); }
.btn-ghost { background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 域名提示条 */
.domain-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(0, 178, 101, .07), rgba(62, 213, 152, .05));
}
.domain-bar b { color: var(--text-2); font-weight: 600; letter-spacing: .2px; }
.pill {
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.pill-brand { border: none; background: var(--grad); color: #FFFFFF; font-weight: 600; }

/* ------------------------------- Hero ------------------------------- */
/* 注意：.hero 与内部 .container 分开写，不用 padding 简写覆盖水平内边距 */
.hero {
  position: relative; overflow: hidden;
  padding-top: 44px; padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
/* 全屏分层背景：柔光渐变 + 极淡网格 + 底部渐隐 */
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(820px 420px at 8% -6%, rgba(0, 178, 101, .18), transparent 62%),
    radial-gradient(680px 360px at 86% 4%, rgba(62, 213, 152, .15), transparent 62%),
    radial-gradient(900px 520px at 50% 118%, rgba(0, 178, 101, .10), transparent 60%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0, 178, 101, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 178, 101, .07) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(72% 78% at 50% 26%, #000 0%, transparent 100%);
  mask-image: radial-gradient(72% 78% at 50% 26%, #000 0%, transparent 100%);
  opacity: .7;
}
.hero-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--bg));
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface); margin-bottom: 18px;
}
.hero-badge i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px rgba(37, 194, 110, .18);
}
.hero h1 {
  font-size: clamp(32px, 5.2vw, 54px); line-height: 1.12; letter-spacing: -1.4px;
  margin: 0 0 16px; font-weight: 750;
}
.hero h1 em {
  font-style: normal; background: var(--grad-text); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 16px; max-width: 620px; margin: 0 0 24px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats div b { display: block; font-size: 22px; letter-spacing: -.5px; }
.hero-stats div span { font-size: 12.5px; color: var(--muted); }

/* ------------------------------- 工具栏 ------------------------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: .18s ease; color: var(--text-2);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active {
  background: var(--grad); color: #FFFFFF; border-color: transparent; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 178, 101, .25);
}
.select {
  height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); outline: none; font-size: 13.5px;
}

/* ------------------------------- 商品网格 ------------------------------- */
.grid {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}
.card {
  position: relative; border-radius: var(--radius-lg); padding: 18px;
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: .22s cubic-bezier(.4, 0, .2, 1); overflow: hidden; cursor: pointer;
  /* 弹性列布局：保证同行卡片高度一致，元信息与页脚统一贴底对齐 */
  display: flex; flex-direction: column; height: 100%;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px 200px at var(--mx, 50%) var(--my, 0%), rgba(0, 178, 101, .16), transparent 70%);
  opacity: 0; transition: .25s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(0, 178, 101, .38); box-shadow: var(--shadow-glow); }
.card:hover::after { opacity: 1; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title {
  font-size: 15.5px; font-weight: 650; letter-spacing: -.2px; margin: 0 0 4px;
  line-height: 1.35; min-height: 42px;   /* 两行固定高度，保证标题区高度一致 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sub { font-size: 13px; color: var(--muted); min-height: 38px; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 库存 / 已售：固定行高 + 贴底，整行卡片完全对齐 */
.card-meta {
  display: flex; align-items: baseline; gap: 16px; font-size: 12.5px; color: var(--muted);
  margin-top: auto; margin-bottom: 14px; height: 20px; overflow: hidden; white-space: nowrap;
}
.card-meta label { margin-right: 5px; opacity: .72; }
.card-meta b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.card-meta .cat-name { margin-left: auto; opacity: .8; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.price {
  font-size: 22px; font-weight: 750; letter-spacing: -.6px; line-height: 1.2;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.price .sym { font-size: 15px; font-weight: 700; margin-right: 1px; }
.price small { font-size: 11.5px; font-weight: 600; opacity: .72; margin-left: 3px; letter-spacing: .2px; }
.cny-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.bar-dot { opacity: .6; }
.tag {
  font-size: 11.5px; padding: 3px 8px; border-radius: 7px; font-weight: 600; white-space: nowrap;
}
.tag-auto { background: rgba(37, 194, 110, .14); color: var(--success); }
.tag-manual { background: rgba(91, 141, 239, .14); color: var(--info); }
.tag-off { background: rgba(140, 148, 162, .16); color: var(--muted); }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 8px; font-size: 17px; }

/* ------------------------------- 抽屉 / 弹窗 ------------------------------- */
.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px);
  z-index: 90; opacity: 0; pointer-events: none; transition: .22s ease;
}
.mask.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 100%);
  background: color-mix(in srgb, var(--bg-soft) 96%, transparent);
  border-left: 1px solid var(--border); z-index: 100;
  transform: translateX(102%); transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .35);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; transition: .18s;
}
.icon-btn:hover { background: var(--surface-2); }

.modal {
  position: fixed; z-index: 100; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.97);
  width: min(520px, calc(100% - 32px)); max-height: 86vh; overflow: auto;
  background: color-mix(in srgb, var(--bg-soft) 97%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .22s ease;
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { padding: 20px 22px 0; }
.modal-body { padding: 18px 22px 22px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  background: none; border: none; cursor: pointer; padding: 10px 12px; font-size: 14px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--brand-1); font-weight: 600; }

.rich { font-size: 14.5px; color: var(--text-2); line-height: 1.75; }
.rich h1, .rich h2, .rich h3 { color: var(--text); margin: 18px 0 10px; font-size: 16px; letter-spacing: -.2px; }
.rich p { margin: 0 0 10px; }
.rich img { border-radius: var(--radius); margin: 10px 0; max-width: 100%; height: auto; }
.rich video { max-width: 100%; width: 100%; border-radius: var(--radius); margin: 10px 0; background: #000; display: block; }
.rich .rte-embed { position: relative; margin: 12px 0; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.rich .rte-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rich ul { padding-left: 20px; margin: 0 0 10px; }
.rich li { margin-bottom: 6px; }
.rich b { color: var(--text); }
.rich code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 11px; background: var(--surface);
  border: 1px solid var(--border); outline: none; transition: .18s; font-size: 14px;
}
.field input:focus, .field textarea:focus { border-color: rgba(0, 178, 101, .55); box-shadow: 0 0 0 4px rgba(0, 178, 101, .12); }
.field textarea { min-height: 92px; resize: vertical; }

/* ------------------------------- 悬浮客服 ------------------------------- */
.fab-wrap { position: fixed; right: 24px; bottom: 68px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.fab {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad); color: #FFFFFF; display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(0, 178, 101, .38); transition: .2s ease;
}
.fab:hover { transform: translateY(-2px) scale(1.04); }
.fab-items { display: flex; flex-direction: column; gap: 8px; }
.fab-item {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 13.5px; font-weight: 500; cursor: pointer; transition: .18s;
}
.fab-item:hover { border-color: rgba(0, 178, 101, .45); transform: translateX(-2px); }
.fab-item svg { width: 18px; height: 18px; }

/* ------------------------------- 订单 / 支付页 ------------------------------- */
.pay-wrap { max-width: 880px; margin: 36px auto 60px; padding: 0 20px; position: relative; z-index: 1; }
.pay-card {
  border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--surface);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 26px 28px; box-shadow: var(--shadow);
}
.pay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pay-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.pay-no { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.countdown {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding: 7px 14px; border-radius: 999px; background: rgba(255, 176, 32, .13); color: var(--warn);
}
.countdown.danger { background: rgba(229, 72, 77, .12); color: var(--danger); }

/* 三步引导 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 0; }
.step {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.step-n {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; margin-top: 1px;
  background: var(--grad); color: #FFFFFF; font-weight: 750; font-size: 12px;
  display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0, 178, 101, .28);
}
.step b { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; letter-spacing: -.1px; }
.step, .step div { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* 主体两栏：左金额/地址 · 右二维码 */
.pay-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; margin-top: 16px; }
.pay-col { display: flex; flex-direction: column; }
.amount-box {
  text-align: center; padding: 22px 20px; flex: 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(0, 178, 101, .10), rgba(0, 178, 101, .03));
  border: 1px solid rgba(0, 178, 101, .28);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.amount-label { font-size: 12.5px; color: var(--muted); }
.amount-box .num {
  font-size: clamp(30px, 4.6vw, 40px); font-weight: 780; letter-spacing: -1.2px; line-height: 1.15;
  margin: 6px 0 2px;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.amount-box .tip { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.sec-label { font-size: 12.5px; color: var(--muted); margin: 14px 2px 8px; }
.addr-box {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.addr-box code {
  flex: 1; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--text-2); line-height: 1.5;
}
.qr-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 18px; text-align: center;
}
.qr-card img { width: 148px; height: 148px; border-radius: 14px; background: #fff; padding: 8px; }
.qr-note { font-size: 12.5px; color: var(--muted); max-width: 210px; line-height: 1.6; }
.qr-note b { color: var(--text-2); }

/* TxID 提交 */
.txid-box { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
.txid-row { display: flex; gap: 10px; }
.txid-row input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 11px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border); outline: none; transition: .18s;
}
.txid-row input:focus { border-color: rgba(0, 178, 101, .55); box-shadow: 0 0 0 4px rgba(0, 178, 101, .12); }
.wait-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.card-list { display: grid; gap: 10px; margin-top: 14px; }
.card-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.card-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  word-break: break-all; flex: 1;
}
.success-icon {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(37, 194, 110, .2), rgba(37, 194, 110, .08));
  border: 1px solid rgba(37, 194, 110, .35);
}
.center { text-align: center; }

/* ------------------------------- Toast ------------------------------- */
.toast-wrap { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  background: var(--bg-soft); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ------------------------------- 页脚 ------------------------------- */
.footer { margin-top: 70px; padding: 34px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }

/* ------------------------------- 骨架屏 ------------------------------- */
.skeleton { border-radius: var(--radius-lg); height: 190px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 860px) {
  .nav-links, .search { display: none; }
  .hero { padding-top: 40px; padding-bottom: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .card-sub { min-height: 32px; }
}

/* ==========================================================================
   分类侧栏 + 商品区（左右分栏）
   ========================================================================== */
.shop-layout {
  display: grid; grid-template-columns: 236px minmax(0, 1fr);
  gap: 20px; align-items: start; margin-top: 40px;
}
.side-panel {
  position: sticky; top: calc(var(--nav-h) + 16px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 14px 12px;
}
.side-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 4px 8px 10px;
}
.side-cats { display: flex; flex-direction: column; gap: 3px; }
.side-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 9px 12px; border: none; border-radius: 11px;
  background: none; cursor: pointer; font-size: 14px; color: var(--text-2);
  text-align: left; transition: .16s ease;
}
.side-cat:hover { background: var(--surface-2); color: var(--text); }
.side-cat.active {
  background: var(--grad); color: #FFFFFF; font-weight: 650;
  box-shadow: 0 4px 14px rgba(0, 178, 101, .25);
}
.side-cat .cnt { font-size: 12px; opacity: .68; font-variant-numeric: tabular-nums; }
.side-hot {
  display: inline-flex; margin-left: 6px; font-size: 10.5px; padding: 1px 6px;
  border-radius: 6px; background: rgba(0, 178, 101, .14); color: var(--brand-1); font-weight: 700;
}
.side-cat.active .side-hot { background: rgba(23, 18, 10, .18); color: #FFFFFF; }

.result-hint { font-size: 13px; color: var(--muted); align-self: center; }
.result-hint b { color: var(--text-2); }

/* ---- Font Awesome 扁平平台图标 ---- */
.nav-links a i, .nav-drop a i, .side-cat i, .icon-emoji {
  font-size: 14px; width: 18px; text-align: center; opacity: .72;
}
.side-cat.active i, .nav-links a.active i, .nav-drop a.active i { opacity: .95; }
.icon-emoji { font-style: normal; }

/* 后台：平台图标自动识别预览 */
.icon-preview {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}
.icon-preview i { font-size: 20px; color: var(--brand-1); width: 24px; text-align: center; }
.icon-preview b { color: var(--text-2); }

/* ==========================================================================
   商品视图切换：列表（默认） / 卡片
   ========================================================================== */
.view-toggle {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
}
.vt-btn {
  width: 32px; height: 30px; border: none; border-radius: 8px; background: none;
  cursor: pointer; color: var(--muted); display: grid; place-items: center;
  font-size: 13px; transition: .16s ease;
}
.vt-btn:hover { color: var(--text); background: var(--surface-2); }
.vt-btn.active { background: var(--grad); color: #FFFFFF; box-shadow: 0 3px 8px rgba(0, 178, 101, .25); }

/* 列表模式：表格化布局（表头 + 行），参考传统发卡站列表 */
.product-list { display: block; }
.table-card {
  border-radius: var(--radius-lg); border: 1px solid rgba(16, 22, 34, .07);
  background: #FFFFFF;
  box-shadow: 0 6px 24px rgba(18, 24, 40, .05);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.product-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.product-table thead th {
  padding: 12px 14px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--muted); background: #F5FBF8; white-space: nowrap; letter-spacing: .02em;
  border-bottom: 1px solid rgba(16, 22, 34, .07);
}
.product-table tbody td { padding: 13px 14px; border-top: 1px solid rgba(16, 22, 34, .055); vertical-align: middle; }
.product-table tbody tr { cursor: pointer; transition: background .15s ease; }
.product-table tbody tr:hover { background: #F4FAF7; }
[data-theme="dark"] .table-card {
  background: var(--surface); border-color: var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
[data-theme="dark"] .product-table thead th { background: var(--surface-2); border-bottom-color: var(--border); }
[data-theme="dark"] .product-table tbody td { border-top-color: var(--border); }
[data-theme="dark"] .product-table tbody tr:hover { background: var(--surface-2); }
.th-num, .td-num { text-align: right !important; font-variant-numeric: tabular-nums; color: var(--text-2); }
.th-op, .td-op { text-align: right !important; white-space: nowrap; }
.td-name { max-width: 460px; }
.td-name .p-name { font-weight: 600; color: var(--text); letter-spacing: -.1px; line-height: 1.4; }
.td-name .p-sub {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.td-price {
  font-weight: 750; font-size: 15.5px; white-space: nowrap; letter-spacing: -.2px;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.td-price .sym { font-size: 12px; margin-right: 1px; }
.td-price small { font-size: 10.5px; opacity: .72; margin-left: 2px; font-weight: 600; }
.td-op .btn { margin-left: 10px; }
.mini-link {
  border: none; background: none; color: var(--muted); cursor: pointer;
  font-size: 12.5px; padding: 4px 2px; transition: .15s;
}
.mini-link:hover { color: var(--brand-1); }

/* 移动端：表格允许横向滚动，缩小留白，副标题省略更紧 */
@media (max-width: 700px) {
  .product-table { min-width: 640px; font-size: 13px; }
  .product-table thead th { padding: 10px 11px; font-size: 11.5px; }
  .product-table tbody td { padding: 11px; }
  .td-name { max-width: 240px; }
  .td-name .p-sub { max-width: 220px; }
  .td-op .mini-link { display: none; }
}

/* 移动端：侧栏变横向滑动，并提供搜索框 */
.search-m { display: none; max-width: none; margin-top: 12px; }

/* ------------------------------- 导航「更多」下拉 ------------------------------- */
.nav-more { position: relative; }
.nav-more > button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 9px; font-size: 14px; color: var(--text-2);
  border: none; background: none; cursor: pointer; transition: .18s ease;
}
.nav-more > button:hover { background: var(--surface-2); color: var(--text); }
.nav-more > button .caret { transition: transform .18s ease; font-size: 10px; }
.nav-more.open > button .caret { transform: rotate(180deg); }
.nav-drop {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; z-index: 70;
  display: none; max-height: 340px; overflow: auto;
}
.nav-drop.show { display: block; }
.nav-drop a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: var(--text-2);
}
.nav-drop a:hover { background: var(--surface-2); color: var(--text); }
.nav-drop a.active { color: var(--brand-1); font-weight: 600; }

/* ==========================================================================
   交付流程（HOW IT WORKS）
   ========================================================================== */
.how { margin-top: 100px; }
.how-eyebrow {
  font-size: 12px; font-weight: 750; letter-spacing: .2em; text-transform: uppercase;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 6px;
}
.how-title { font-size: clamp(22px, 3vw, 28px); letter-spacing: -.6px; margin: 0 0 18px; font-weight: 750; }
.how-panel {
  border-radius: var(--radius-xl); border: 1px solid var(--border);
  background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 28px 26px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 26px;
  box-shadow: var(--shadow-sm);
}
.how-card { position: relative; }
.how-num {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #FFFFFF; font-weight: 750; font-size: 14px;
  box-shadow: 0 6px 16px rgba(0, 178, 101, .30); margin-bottom: 14px;
}
.how-card b { display: block; font-size: 15px; letter-spacing: -.2px; margin-bottom: 6px; }
.how-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.how-card:not(:last-child)::after {
  content: ""; position: absolute; top: 16px; right: -14px; width: 1px; height: calc(100% - 32px);
  background: var(--border);
}
@media (max-width: 700px) { .how-card:not(:last-child)::after { display: none; } }

/* 分栏响应式 */
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .side-cats { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .side-cat { width: auto; white-space: nowrap; flex: 0 0 auto; }
  .side-title { display: none; }
  .search-m { display: flex; }
}
