/* ==========================================================================
   GlobalCard · 全球卡站  —  Design System
   原创实现，参考同类自动发卡平台的信息架构
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-page);
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4, h5, h6, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
table { border-collapse: collapse; width: 100%; }
code, pre, kbd { font-family: "JetBrains Mono", "Cascadia Code", Consolas, Menlo, monospace; }
::selection { background: var(--primary); color: #fff; }

/* ---------- 2. Design Tokens ---------- */
:root {
  --primary:        #165DFF;
  --primary-hover:  #0E4BDB;
  --primary-active: #0A3CB0;
  --primary-1:      #E8F0FF;
  --primary-2:      #BEDAFF;
  --primary-6:      #165DFF;

  --success:        #00B42A;
  --success-1:      #E8FFEA;
  --warning:        #FF7D00;
  --warning-1:      #FFF3E8;
  --danger:         #F53F3F;
  --danger-1:       #FFECE8;
  --purple:         #722ED1;
  --purple-1:       #F5E8FF;
  --cyan:           #0FC6C2;

  --text-1: #1D2129;
  --text-2: #4E5969;
  --text-3: #86909C;
  --text-4: #C9CDD4;

  --border-1: #E5E6EB;
  --border-2: #F2F3F5;

  --bg-page:   #F5F7FA;
  --bg-card:   #FFFFFF;
  --bg-hover:  #F7F8FA;
  --bg-sunken: #F2F3F5;
  --bg-topbar: #1D2129;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
  --shadow-primary: 0 8px 20px rgba(22,93,255,.28);

  --header-h: 64px;
  --nav-h: 48px;
  --topbar-h: 36px;
  --container: 1240px;

  --grad-hero: linear-gradient(135deg, #165DFF 0%, #3C7EFF 45%, #0FC6C2 100%);
  --grad-brand: linear-gradient(135deg, #165DFF, #0FC6C2);
}

html.dark {
  --primary:        #3C7EFF;
  --primary-hover:  #5A93FF;
  --primary-active: #2B6AE0;
  --primary-1:      #1B2A4A;
  --primary-2:      #22375F;

  --success:  #23C343;
  --success-1:#16281C;
  --warning:  #FF9A2E;
  --warning-1:#2B2116;
  --danger:   #F76560;
  --danger-1: #2C1A19;
  --purple:   #8D4EDA;
  --purple-1: #241B33;

  --text-1: #F2F3F5;
  --text-2: #C9CDD4;
  --text-3: #8A8F99;
  --text-4: #5B5F68;

  --border-1: #33333A;
  --border-2: #26262B;

  --bg-page:   #17171A;
  --bg-card:   #1F1F23;
  --bg-hover:  #26262B;
  --bg-sunken: #131316;
  --bg-topbar: #0F0F12;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.55);
  --shadow-primary: 0 8px 20px rgba(60,126,255,.3);
}

/* ---------- 3. Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.page { min-height: 60vh; padding-bottom: 56px; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-40 { margin-top: 40px; }
.hide { display: none !important; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-16 { font-size: 16px; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.mono { font-family: "JetBrains Mono", Consolas, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 4. Top announcement bar ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-topbar);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 60;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-notice { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-notice .ico { width: 16px; height: 16px; flex: none; opacity: .9; }
.topbar-track { overflow: hidden; height: 18px; }
.topbar-track span { display: block; animation: marquee 22s linear infinite; white-space: nowrap; }
@keyframes marquee { 0% { transform: translateY(0); } 20% { transform: translateY(0); } 25% { transform: translateY(-18px); } 45% { transform: translateY(-18px); } 50% { transform: translateY(-36px); } 70% { transform: translateY(-36px); } 75% { transform: translateY(-54px); } 95% { transform: translateY(-54px); } 100% { transform: translateY(0); } }
.topbar-right { display: flex; align-items: center; gap: 18px; flex: none; }
.topbar-right a { display: flex; align-items: center; gap: 5px; color: rgba(255,255,255,.8); transition: color .2s; }
.topbar-right a:hover { color: #fff; }
.topbar-right .divider { width: 1px; height: 12px; background: rgba(255,255,255,.18); }
.theme-toggle { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.8); }
.theme-toggle:hover { color: #fff; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-2);
  backdrop-filter: saturate(180%) blur(12px);
}
.header-main { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: var(--radius); flex: none;
  background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
  box-shadow: var(--shadow-primary);
}
.logo-text { line-height: 1.15; }
.logo-text b { display: block; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.logo-text small { font-size: 10px; color: var(--text-3); letter-spacing: 1.6px; text-transform: uppercase; }

/* search */
.search { position: relative; flex: 1; max-width: 620px; }
.search-box { display: flex; align-items: center; height: 40px; border: 1px solid var(--border-1); border-radius: var(--radius-full); background: var(--bg-sunken); padding-left: 16px; transition: all .2s; }
.search-box:focus-within { border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 3px var(--primary-1); }
.search-box svg { flex: none; color: var(--text-3); }
.search-box input { flex: 1; border: 0; background: transparent; outline: none; padding: 0 10px; min-width: 0; }
.search-box input::placeholder { color: var(--text-3); }
.search-btn { height: 32px; margin-right: 4px; padding: 0 20px; border-radius: var(--radius-full); background: var(--primary); color: #fff; font-weight: 500; transition: background .2s; }
.search-btn:hover { background: var(--primary-hover); }
.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border-1); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 16px; z-index: 70; display: none;
}
.search-panel.open { display: block; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.search-panel h5 { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 10px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 12px; border-radius: var(--radius-full); background: var(--bg-sunken); color: var(--text-2); font-size: 12px; transition: all .18s; }
.chip:hover { background: var(--primary-1); color: var(--primary); }

/* header actions */
.header-actions { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.hact { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 11px; transition: all .18s; }
.hact:hover { background: var(--bg-hover); color: var(--primary); }
.hact svg { width: 18px; height: 18px; }
.btn-login { height: 34px; padding: 0 18px; border-radius: var(--radius-full); border: 1px solid var(--primary); color: var(--primary); font-weight: 500; transition: all .2s; }
.btn-login:hover { background: var(--primary-1); }
.btn-reg { height: 34px; padding: 0 18px; border-radius: var(--radius-full); background: var(--primary); color: #fff; font-weight: 500; margin-left: 8px; transition: all .2s; box-shadow: var(--shadow-primary); }
.btn-reg:hover { background: var(--primary-hover); }
.avatar-btn { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--radius-full); background: var(--bg-sunken); transition: background .2s; }
.avatar-btn:hover { background: var(--bg-hover); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }

/* nav */
.site-nav { border-top: 1px solid var(--border-2); background: var(--bg-card); }
.nav-list { height: var(--nav-h); display: flex; align-items: center; gap: 4px; overflow: visible; }
.nav-item { position: relative; }
.nav-item > a {
  display: flex; align-items: center; gap: 5px; height: var(--nav-h);
  padding: 0 16px; font-size: 14px; color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.nav-item > a:hover { color: var(--primary); }
.nav-item.active > a { color: var(--primary); border-bottom-color: var(--primary); }
.nav-drop {
  position: absolute; top: 100%; left: 0; min-width: 180px;
  background: var(--bg-card); border: 1px solid var(--border-1); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .18s; z-index: 65;
}
.nav-item:hover .nav-drop { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drop a { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); }
.nav-drop a:hover { background: var(--primary-1); color: var(--primary); }
.nav-more { margin-left: auto; color: var(--text-3); font-size: 12px; display: flex; align-items: center; gap: 4px; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 22px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; transition: all .2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { border: 1px solid var(--border-1); color: var(--text-1); background: var(--bg-card); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-light { background: var(--primary-1); color: var(--primary); }
.btn-light:hover { background: var(--primary-2); }
.btn-text { color: var(--primary); height: auto; padding: 0; }
.btn-danger { background: var(--danger-1); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 32px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ---------- 7. Cards / tags ---------- */
.card { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border-2); }
.card-head h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

.tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: var(--radius-sm); font-size: 11px; line-height: 18px; font-weight: 500; }
.tag-blue   { background: var(--primary-1); color: var(--primary); }
.tag-green  { background: var(--success-1); color: var(--success); }
.tag-orange { background: var(--warning-1); color: var(--warning); }
.tag-red    { background: var(--danger-1);  color: var(--danger); }
.tag-purple { background: var(--purple-1);  color: var(--purple); }
.tag-gray   { background: var(--bg-sunken); color: var(--text-3); }
.tag-line   { border: 1px solid currentColor; background: transparent; }

/* ---------- 8. Sections ---------- */
.section { margin-top: 48px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.2px; display: flex; align-items: center; gap: 10px; }
.section-head .bar { width: 4px; height: 20px; border-radius: 2px; background: var(--grad-brand); }
.section-head p { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.link-more { color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 4px; transition: color .2s; }
.link-more:hover { color: var(--primary); }

/* ---------- 9. Hero ---------- */
.hero { margin-top: 20px; border-radius: var(--radius-xl); overflow: hidden; position: relative; background: var(--grad-hero); color: #fff; min-height: 280px; display: flex; align-items: center; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.13); }
.hero::before { width: 340px; height: 340px; right: -90px; top: -140px; }
.hero::after { width: 220px; height: 220px; right: 160px; bottom: -130px; background: rgba(255,255,255,.08); }
.hero-inner { position: relative; z-index: 2; padding: 44px 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px; width: 100%; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: var(--radius-full); background: rgba(255,255,255,.18); backdrop-filter: blur(6px); font-size: 12px; letter-spacing: .5px; margin-bottom: 16px; }
.hero h1 { font-size: 36px; line-height: 1.25; font-weight: 800; letter-spacing: -.5px; margin-bottom: 12px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg,#FFE58F,#FFF7E8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 15px; color: rgba(255,255,255,.86); max-width: 520px; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; }
.hero .btn-white { background: #fff; color: var(--primary); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.hero .btn-white:hover { transform: translateY(-1px); }
.hero .btn-outline { border: 1px solid rgba(255,255,255,.6); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.14); }
.hero-stats { display: flex; gap: 34px; flex: none; }
.hero-stats div b { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; }
.hero-stats div span { font-size: 12px; color: rgba(255,255,255,.78); }

/* ---------- 10. Product grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cat { grid-template-columns: repeat(7, 1fr); }

.goods {
  display: flex; flex-direction: column; background: var(--bg-card);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  overflow: hidden; transition: all .22s ease; position: relative;
}
.goods:hover { transform: translateY(-4px); border-color: var(--primary-2); box-shadow: var(--shadow-md); }
.goods-thumb { position: relative; aspect-ratio: 16 / 10; background: var(--bg-sunken); overflow: hidden; display: grid; place-items: center; }
.goods-thumb .glyph { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: var(--primary); opacity: .9; }
.goods-thumb .cover { position: absolute; inset: 0; display: grid; place-items: center; }
.goods-tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; z-index: 2; }
.goods-fav { position: absolute; top: 10px; right: 10px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--text-3); display: grid; place-items: center; font-size: 13px; }
.goods-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.goods-title { font-size: 13.5px; font-weight: 500; line-height: 1.5; min-height: 41px; }
.goods-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--text-3); }
.goods-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 12px; gap: 8px; }
.price { color: var(--danger); font-weight: 700; }
.price .cur { font-size: 12px; margin-right: 1px; }
.price .num { font-size: 19px; letter-spacing: -.5px; }
.price .unit { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.stock { font-size: 11px; color: var(--text-3); }
.buy-mini { height: 30px; padding: 0 14px; border-radius: var(--radius-full); background: var(--primary); color: #fff; font-size: 12px; font-weight: 500; transition: background .2s; }
.buy-mini:hover { background: var(--primary-hover); }
.buy-mini.sold-out { background: var(--bg-sunken); color: var(--text-3); cursor: not-allowed; }

/* category tile */
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 10px;
  background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  transition: all .22s;
}
.cat-tile:hover { border-color: var(--primary-2); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.cat-ico { width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center; font-size: 20px; background: var(--primary-1); color: var(--primary); }
.cat-tile b { font-size: 13px; font-weight: 600; }
.cat-tile span { font-size: 11px; color: var(--text-3); }

/* ---------- 11. News / reviews ---------- */
.news-list { display: grid; gap: 2px; }
.news-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); transition: background .18s; }
.news-item:hover { background: var(--bg-hover); }
.news-date { flex: none; width: 46px; height: 46px; border-radius: var(--radius); background: var(--bg-sunken); display: grid; place-items: center; text-align: center; line-height: 1.1; }
.news-date b { font-size: 16px; font-weight: 700; }
.news-date span { font-size: 10px; color: var(--text-3); }
.news-main { min-width: 0; flex: 1; }
.news-main b { font-size: 14px; font-weight: 500; display: block; }
.news-main p { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.review {
  background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  padding: 22px; position: relative; height: 100%;
}
.review .quote { position: absolute; top: 14px; right: 18px; font-size: 44px; line-height: 1; color: var(--primary-1); font-family: Georgia, serif; }
.review-stars { color: #FFB400; font-size: 13px; letter-spacing: 1px; margin-bottom: 10px; }
.review p { font-size: 13px; color: var(--text-2); line-height: 1.75; min-height: 92px; }
.review-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-1); }
.review-user { display: flex; align-items: center; gap: 10px; }
.review-user .av { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-1); color: var(--primary); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.review-user b { font-size: 13px; display: block; }
.review-user span { font-size: 11px; color: var(--text-3); }

/* ---------- 12. Feature strip ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { display: flex; align-items: center; gap: 14px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg); }
.feature .fi { width: 44px; height: 44px; flex: none; border-radius: var(--radius); display: grid; place-items: center; font-size: 20px; }
.feature b { display: block; font-size: 14px; font-weight: 600; }
.feature span { font-size: 12px; color: var(--text-3); }

/* ---------- 13. Footer ---------- */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border-2); margin-top: 64px; padding: 48px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; padding-bottom: 40px; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p { font-size: 13px; color: var(--text-3); max-width: 300px; line-height: 1.8; }
.footer-contact { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; font-size: 13px; color: var(--text-2); }
.footer-contact div { display: flex; align-items: center; gap: 8px; }
.footer-col h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 13px; color: var(--text-3); transition: color .18s; }
.footer-col a:hover { color: var(--primary); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-links a { font-size: 12px; color: var(--text-3); padding: 3px 10px; border: 1px solid var(--border-1); border-radius: var(--radius-full); }
.footer-links a:hover { color: var(--primary); border-color: var(--primary-2); }
.footer-bottom { border-top: 1px solid var(--border-2); padding: 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.footer-bottom .pay { display: flex; gap: 8px; }
.footer-bottom .pay span { padding: 2px 10px; border-radius: var(--radius-sm); background: var(--bg-sunken); }

/* ---------- 14. Mobile tabbar ---------- */
.mobile-tabbar { display: none; }
@media (max-width: 900px) {
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: var(--bg-card); border-top: 1px solid var(--border-1);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  }
  .mobile-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--text-3); }
  .mobile-tabbar a.on { color: var(--primary); }
  .mobile-tabbar svg { width: 22px; height: 22px; }
}

/* ---------- 15. Breadcrumb / page head ---------- */
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); padding: 18px 0 14px; flex-wrap: wrap; }
.crumb a:hover { color: var(--primary); }
.crumb .sep { opacity: .5; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }

/* ---------- 16. Layout with sidebar ---------- */
.layout { display: grid; grid-template-columns: 232px 1fr; gap: 22px; align-items: start; }
.side-menu { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: calc(var(--header-h) + var(--nav-h) + 16px); }
.side-user { padding: 20px; background: linear-gradient(135deg, var(--primary-1), transparent); border-bottom: 1px solid var(--border-2); text-align: center; }
.side-user .av { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 10px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.side-user b { display: block; font-size: 14px; }
.side-user span { font-size: 11px; color: var(--text-3); }
.side-group { padding: 10px 0; }
.side-group > h5 { font-size: 11px; color: var(--text-3); padding: 6px 20px; letter-spacing: .5px; }
.side-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 13.5px; color: var(--text-2); border-left: 2px solid transparent; transition: all .18s; }
.side-menu a:hover { background: var(--bg-hover); color: var(--primary); }
.side-menu a.on { background: var(--primary-1); color: var(--primary); border-left-color: var(--primary); font-weight: 500; }
.side-menu svg { width: 17px; height: 17px; }

/* ---------- 17. Filter bar / toolbar ---------- */
.filter { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 6px 18px; }
.filter-row { display: flex; align-items: flex-start; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--border-1); }
.filter-row:last-child { border-bottom: 0; }
.filter-row > label { flex: none; width: 62px; font-size: 13px; color: var(--text-3); padding-top: 3px; }
.filter-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-opts a { padding: 3px 12px; border-radius: var(--radius-full); font-size: 13px; color: var(--text-2); transition: all .18s; }
.filter-opts a:hover { color: var(--primary); }
.filter-opts a.on { background: var(--primary); color: #fff; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.toolbar .sorts { display: flex; gap: 2px; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 3px; }
.toolbar .sorts button { padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); transition: all .18s; }
.toolbar .sorts button:hover { color: var(--primary); }
.toolbar .sorts button.on { background: var(--primary); color: #fff; }

/* ---------- 18. Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; }
.pager button, .pager a { min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border-2); font-size: 13px; color: var(--text-2); display: grid; place-items: center; transition: all .18s; }
.pager .on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:hover:not(.on):not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 19. Forms ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--border-1);
  border-radius: var(--radius); background: var(--bg-card); outline: none; transition: all .2s;
}
.textarea { height: auto; padding: 10px 14px; resize: vertical; min-height: 90px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-1); }
.input[readonly] { background: var(--bg-sunken); color: var(--text-2); }
.input-sm { height: 34px; font-size: 13px; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.field-err { font-size: 12px; color: var(--danger); margin-top: 6px; }
.input-group { display: flex; gap: 10px; }
.input-group .input { flex: 1; }
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); }
.checkline input { margin-top: 3px; accent-color: var(--primary); width: 15px; height: 15px; flex: none; }
.checkline a { color: var(--primary); }

/* auth card */
.auth-wrap { display: grid; place-items: center; padding: 48px 20px 64px; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 36px 34px; }
.auth-card h2 { font-size: 22px; font-weight: 700; text-align: center; }
.auth-card .sub { text-align: center; font-size: 13px; color: var(--text-3); margin: 6px 0 26px; }
.auth-tabs { display: flex; background: var(--bg-sunken); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.auth-tabs a { flex: 1; text-align: center; padding: 8px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); }
.auth-tabs a.on { background: var(--bg-card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-xs); }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 22px; }
.auth-foot a { color: var(--primary); }
.captcha { height: 42px; padding: 0 16px; border-radius: var(--radius); background: linear-gradient(100deg, #E8F0FF, #D6E7FF 40%, #E8F0FF); color: var(--primary); font-weight: 700; letter-spacing: 5px; font-size: 17px; font-family: Georgia, serif; font-style: italic; user-select: none; cursor: pointer; flex: none; }
html.dark .captcha { background: linear-gradient(100deg,#1B2A4A,#22375F 40%,#1B2A4A); }

/* ---------- 20. Tables ---------- */
.tbl { width: 100%; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--text-3); padding: 11px 14px; background: var(--bg-sunken); white-space: nowrap; font-size: 12.5px; }
.tbl th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.tbl th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--bg-hover); }
.tbl .t-actions { display: flex; gap: 12px; white-space: nowrap; }
.tbl .t-actions a { color: var(--primary); font-size: 13px; }
.tbl .t-actions a.muted { color: var(--text-3); }
.tbl-scroll { overflow-x: auto; }

/* ---------- 21. Document table (API docs) ---------- */
.doc-tbl { width: 100%; font-size: 12.5px; border: 1px solid var(--border-1); border-radius: var(--radius); overflow: hidden; }
.doc-tbl th { background: var(--bg-sunken); color: var(--text-2); font-weight: 500; text-align: left; padding: 9px 12px; }
.doc-tbl td { padding: 9px 12px; border-top: 1px solid var(--border-2); vertical-align: top; }
.doc-tbl td .mono { color: var(--primary); }

/* code block */
.code-wrap { position: relative; }
.code-block {
  background: #1D2129; color: #D6DEE8; border-radius: var(--radius);
  padding: 16px; font-size: 12.5px; line-height: 1.75; overflow-x: auto; white-space: pre;
}
html.dark .code-block { background: #0F0F12; border: 1px solid var(--border-1); }
.code-block .k { color: #7EE0FF; }
.code-block .s { color: #A6E3A1; }
.code-block .c { color: #7A8794; font-style: italic; }
.code-block .n { color: #FFB86C; }
.copy-btn { position: absolute; top: 10px; right: 10px; height: 26px; padding: 0 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,.12); color: #fff; font-size: 11px; transition: background .18s; }
.copy-btn:hover { background: rgba(255,255,255,.24); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-1); overflow-x: auto; }
.tabs button { padding: 11px 18px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; transition: all .18s; }
.tabs button:hover { color: var(--primary); }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: pop .18s ease; }

/* ---------- 22. Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 20px; position: relative; overflow: hidden; }
.stat .si { width: 38px; height: 38px; border-radius: var(--radius); display: grid; place-items: center; font-size: 18px; margin-bottom: 12px; }
.stat span { font-size: 12.5px; color: var(--text-3); }
.stat b { display: block; font-size: 25px; font-weight: 700; letter-spacing: -.5px; line-height: 1.3; }

/* ---------- 23. Key box (卡密) ---------- */
.keybox { background: var(--bg-sunken); border: 1px dashed var(--border-1); border-radius: var(--radius); padding: 14px 16px; }
.keybox pre { font-size: 12.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-all; color: var(--text-1); }

/* ---------- 24. Steps ---------- */
.steps { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--bg-sunken); color: var(--text-3); }
.step.on .dot { background: var(--primary); color: #fff; }
.step.done .dot { background: var(--success-1); color: var(--success); }
.step b { font-size: 13.5px; font-weight: 500; color: var(--text-3); }
.step.on b { color: var(--text-1); }
.step-line { flex: 1; height: 1px; background: var(--border-1); margin: 0 12px; }

/* ---------- 25. Empty / modal / toast ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty .ei { font-size: 44px; margin-bottom: 12px; opacity: .5; }
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 6px; }

.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.mask.open { display: flex; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; overflow: hidden; animation: pop .2s ease; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border-2); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 22px; max-height: 65vh; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border-2); display: flex; justify-content: flex-end; gap: 10px; }

.toast-wrap { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--bg-card); border: 1px solid var(--border-1); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: 10px 20px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; animation: pop .2s ease; }
.toast.ok { color: var(--success); } .toast.err { color: var(--danger); }

/* ---------- 26. Variant picker ---------- */
.sku-list { display: grid; gap: 10px; }
.sku {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--border-1); border-radius: var(--radius); padding: 13px 16px; cursor: pointer; transition: all .18s;
}
.sku:hover { border-color: var(--primary-2); background: var(--bg-hover); }
.sku.on { border-color: var(--primary); background: var(--primary-1); box-shadow: 0 0 0 2px var(--primary-1); }
.sku .radio { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--border-1); flex: none; display: grid; place-items: center; }
.sku.on .radio { border-color: var(--primary); }
.sku.on .radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.sku-main b { font-size: 13.5px; font-weight: 500; display: block; }
.sku-main span { font-size: 11.5px; color: var(--text-3); }
.sku-price { text-align: right; flex: none; }

.qty { display: flex; align-items: center; border: 1px solid var(--border-1); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 36px; height: 38px; font-size: 16px; color: var(--text-2); background: var(--bg-sunken); transition: all .18s; }
.qty button:hover { color: var(--primary); }
.qty input { width: 56px; height: 38px; text-align: center; border: 0; outline: none; background: transparent; font-weight: 500; }

/* ---------- 27. Misc ---------- */
.divider-h { height: 1px; background: var(--border-2); margin: 18px 0; }
.notice-bar { display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--warning-1); color: var(--warning); font-size: 13px; line-height: 1.7; }
.notice-bar.info { background: var(--primary-1); color: var(--primary); }
.notice-bar.ok { background: var(--success-1); color: var(--success); }
.scroll-x { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--border-1); border-radius: 3px; }
.sec-num { font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-cat { grid-template-columns: repeat(4, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 30px; }
}
@media (max-width: 900px) {
  /* 移动端：隐藏顶部公告与导航，头部精简保留（Logo + 搜索 + 我的） */
  .topbar, .site-nav { display: none !important; }
  .site-header { position: static; }
  .header-main { height: 56px; gap: 12px; }
  .logo-mark { width: 30px; height: 30px; font-size: 15px; }
  .logo-text b { font-size: 15px; }
  .logo-text small { display: none; }
  .search { max-width: none; }
  .search-btn { display: none; }
  .hact { display: none; }
  .btn-login, .btn-reg { height: 30px; padding: 0 12px; font-size: 12.5px; }
  .btn-reg { display: none; }

  .layout { grid-template-columns: 1fr; }
  .side-menu { position: static; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-cat { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .page { padding-bottom: 88px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-inner { padding: 28px 22px; flex-direction: column; align-items: flex-start; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .hero h1 { font-size: 26px; }
  .hero::before, .hero::after { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-title { font-size: 20px; }
  .review p { min-height: 0; }
  .steps b { font-size: 12px; }
  .modal { max-width: none; }

  /* 两栏布局在移动端自动堆叠 */
  .stack-sm { grid-template-columns: 1fr !important; gap: 18px !important; }
  .stack-sm > aside { position: static !important; top: auto !important; }
  .stack-sm > * { min-width: 0; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr; }
  .container { padding: 0 14px; }
  .grid-cat { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 23px; }
  .hero-stats div b { font-size: 22px; }
  .goods-title { font-size: 12.5px; }
  .price .num { font-size: 17px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .sorts { overflow-x: auto; }
}
@media (min-width: 901px) { .mobile-only { display: none !important; } }
