/* ==========================================================================
   卡密小店 — 单一样式表，三套皮肤 × 明暗
   皮肤：shop（电商卡片，默认）| magazine（杂志风）| saas（经典 SaaS 紫）
   模式：data-theme = light | dark | 缺省跟随系统
   全部视觉差异都收敛在下面的令牌里，组件层不感知皮肤。
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box }

/* ---------- 1. 皮肤令牌 ---------- */

:root {
  /* shop / 浅色电商（默认） */
  --frame: #eef0f6;
  --bg: #f2f3f8;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceef5;
  --text: #171a21;
  --muted: #8b91a0;
  --line: #171a210f;
  --line-strong: #171a2126;
  --accent: #12b886;
  --accent-2: #0ca678;
  --on-accent: #ffffff;
  --danger: #e03131;
  --ok: #12b886;
  --warn: #e8930c;
  --gold: #f0a500;

  --app-radius: 0px;
  --app-pad: 0px;
  --radius: 24px;
  --radius-sm: 14px;
  --radius-lg: 30px;
  --pill: 999px;
  --border-w: 1px;

  --display: "Barlow", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  --body: "Barlow", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  --title-transform: none;
  --title-weight: 700;
  --title-tracking: -0.015em;

  --btn-grad: linear-gradient(135deg, #2ad3aa, #0ea87e);
  --btn-ink: #ffffff;
  --btn-shadow: 0 6px 18px #12b88640;
  --btn-shift: 0 -1px;
  --btn-shift-active: 0 0;
  --card-shadow: 0 1px 2px #171a210a, 0 10px 28px #171a210f;
  --card-shadow-hover: 0 2px 4px #171a210f, 0 18px 44px #171a211a;
  --shadow-solid: #171a2114;

  color-scheme: light;
  font: 15px/1.65 var(--body);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --frame: #0b0d11;
    --bg: #0f1116;
    --surface: #171a21;
    --surface-2: #1e222b;
    --surface-3: #262b36;
    --text: #e9ecf2;
    --muted: #98a0b0;
    --line: #ffffff14;
    --line-strong: #ffffff2e;
    --accent: #1fc99a;
    --accent-2: #12b886;
    --on-accent: #06281f;
    --danger: #ff6b6b;
    --ok: #1fc99a;
    --warn: #ffc078;
    --btn-grad: linear-gradient(135deg, #23d6a8, #0f9e77);
    --btn-ink: #04150f;
    --btn-shadow: 0 8px 24px #00000060;
    --card-shadow: 0 1px 2px #00000040, 0 12px 32px #00000050;
    --card-shadow-hover: 0 2px 6px #00000050, 0 20px 48px #00000070;
    --shadow-solid: #00000050;
    color-scheme: dark;
  }
}

:root[data-theme=dark] {
  --frame: #0b0d11; --bg: #0f1116; --surface: #171a21; --surface-2: #1e222b; --surface-3: #262b36;
  --text: #e9ecf2; --muted: #98a0b0; --line: #ffffff14; --line-strong: #ffffff2e;
  --accent: #1fc99a; --accent-2: #12b886; --on-accent: #06281f;
  --danger: #ff6b6b; --ok: #1fc99a; --warn: #ffc078;
  --btn-grad: linear-gradient(135deg, #23d6a8, #0f9e77); --btn-ink: #04150f;
  --btn-shadow: 0 8px 24px #00000060;
  --card-shadow: 0 1px 2px #00000040, 0 12px 32px #00000050;
  --card-shadow-hover: 0 2px 6px #00000050, 0 20px 48px #00000070;
  --shadow-solid: #00000050;
  color-scheme: dark;
}
:root[data-theme=light] { color-scheme: light }

/* ---------- magazine / 杂志风 ---------- */

:root[data-style=magazine] {
  --frame: #e2432f;
  --bg: #f5f2ea;
  --surface: #fffdf7;
  --surface-2: #eee7d9;
  --surface-3: #e3dbc9;
  --text: #3a2314;
  --muted: #7b604c;
  --line: #3a23141f;
  --line-strong: #3a231436;
  --accent: #e2432f;
  --accent-2: #1f8f7a;
  --on-accent: #fffdf7;
  --lime: #c9ef2e;
  --lime-deep: #93b513;

  --app-radius: 30px;
  --app-pad: 10px;
  --radius: 28px;
  --radius-sm: 18px;
  --radius-lg: 36px;
  --border-w: 2px;

  --display: "Barlow Condensed", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --title-transform: uppercase;
  --title-weight: 600;
  --title-tracking: 0.005em;

  --btn-grad: var(--lime);
  --btn-ink: #2a3a06;
  --btn-shadow: 5px 5px 0 var(--lime-deep);
  --btn-shift: 2px 2px;
  --btn-shift-active: 5px 5px;
  --card-shadow: 8px 8px 0 var(--shadow-solid);
  --card-shadow-hover: 5px 5px 0 var(--shadow-solid);
  --shadow-solid: #3a231426;
}

@media (prefers-color-scheme: dark) {
  :root[data-style=magazine]:not([data-theme=light]) {
    --frame: #a8301f; --bg: #1c1512; --surface: #261d18; --surface-2: #31261f; --surface-3: #3d3027;
    --text: #f4e9dc; --muted: #c3aa94; --line: #f4e9dc1c; --line-strong: #f4e9dc33;
    --accent: #ff6b4e; --accent-2: #3cc4ae; --on-accent: #1c1512;
    --lime: #c9ef2e; --lime-deep: #93b513;
    --btn-ink: #1c2405; --shadow-solid: #00000055;
  }
}
:root[data-style=magazine][data-theme=dark] {
  --frame: #a8301f; --bg: #1c1512; --surface: #261d18; --surface-2: #31261f; --surface-3: #3d3027;
  --text: #f4e9dc; --muted: #c3aa94; --line: #f4e9dc1c; --line-strong: #f4e9dc33;
  --accent: #ff6b4e; --accent-2: #3cc4ae; --on-accent: #1c1512;
  --lime: #c9ef2e; --lime-deep: #93b513;
  --btn-ink: #1c2405; --shadow-solid: #00000055;
}

/* ---------- saas / 经典 SaaS 紫 ---------- */

:root[data-style=saas] {
  --frame: #f6f5fb;
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f1effa;
  --surface-3: #e7e4f4;
  --text: #1b1a24;
  --muted: #6c6879;
  --line: #1b1a2414;
  --line-strong: #1b1a2426;
  --accent: #7c5cff;
  --accent-2: #14b8a6;
  --on-accent: #ffffff;
  --danger: #e5484d;
  --ok: #14b8a6;
  --warn: #f59e0b;

  --app-radius: 0px;
  --app-pad: 0px;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --border-w: 1px;

  --display: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --title-transform: none;
  --title-weight: 650;
  --title-tracking: -0.01em;

  --btn-grad: linear-gradient(135deg, #8b6cff, #6d4fd8);
  --btn-ink: #ffffff;
  --btn-shadow: 0 10px 26px #7c5cff38;
  --card-shadow: 0 10px 30px #00000010;
  --card-shadow-hover: 0 16px 40px #0000001a;
  --shadow-solid: #00000012;
}

@media (prefers-color-scheme: dark) {
  :root[data-style=saas]:not([data-theme=light]) {
    --frame: #0c0b11; --bg: #111017; --surface: #1c1a25; --surface-2: #252233; --surface-3: #2f2b40;
    --text: #eeecf6; --muted: #a09bb3; --line: #ffffff12; --line-strong: #ffffff24;
    --accent: #9a82ff; --accent-2: #2dd4bf; --on-accent: #15141c;
    --danger: #ff7b80; --ok: #2dd4bf; --warn: #ffc078;
    --btn-grad: linear-gradient(135deg, #9a82ff, #6d4fd8); --btn-ink: #ffffff;
    --btn-shadow: 0 10px 30px #00000060;
    --card-shadow: 0 10px 30px #00000040;
    --card-shadow-hover: 0 16px 44px #00000060;
    color-scheme: dark;
  }
}
:root[data-style=saas][data-theme=dark] {
  --frame: #0c0b11; --bg: #111017; --surface: #1c1a25; --surface-2: #252233; --surface-3: #2f2b40;
  --text: #eeecf6; --muted: #a09bb3; --line: #ffffff12; --line-strong: #ffffff24;
  --accent: #9a82ff; --accent-2: #2dd4bf; --on-accent: #15141c;
  --danger: #ff7b80; --ok: #2dd4bf; --warn: #ffc078;
  --btn-grad: linear-gradient(135deg, #9a82ff, #6d4fd8); --btn-ink: #ffffff;
  --btn-shadow: 0 10px 30px #00000060;
  --card-shadow: 0 10px 30px #00000040;
  --card-shadow-hover: 0 16px 44px #00000060;
  color-scheme: dark;
}

/* ---------- 强调色覆写（三套皮肤通用） ---------- */
:root[data-accent=violet] { --accent: #6d4fd8; --accent-2: #9a82ff }
:root[data-accent=amber] { --accent: #d97a06; --accent-2: #f0a500 }
:root[data-accent=rose] { --accent: #d6336c; --accent-2: #e0426e }
:root[data-accent=blue] { --accent: #2463d6; --accent-2: #4c8df5 }
:root[data-accent=teal] { --accent: #0f8f80; --accent-2: #14b8a6 }
:root[data-accent=ink] { --accent: #2a2521; --accent-2: #6c6879 }
:root[data-accent=ink][data-theme=dark] { --accent: #d9d3c8; --accent-2: #a09bb3 }
:root[data-accent=ink]:not([data-theme=light]) { --accent: #d9d3c8 }
:root[data-accent=coral] { --accent: #e2432f; --accent-2: #ff6b4e }
:root[data-style=magazine][data-accent=violet] { --frame: #6d4fd8 }
:root[data-style=magazine][data-accent=teal] { --frame: #0f8f80 }
:root[data-style=magazine][data-accent=rose] { --frame: #d6336c }
:root[data-style=magazine][data-accent=blue] { --frame: #2463d6 }
:root[data-style=magazine][data-accent=amber] { --frame: #d97a06 }
:root[data-style=magazine][data-accent=ink] { --frame: #2a2521 }

/* 商品色调，用于标题第二色与卡面渐变 */
[data-tone=teal] { --tone: #12b886; --tone-2: #0ea87e; --tone-soft: #12b8861a }
[data-tone=violet] { --tone: #7c5cff; --tone-2: #6d4fd8; --tone-soft: #7c5cff1a }
[data-tone=amber] { --tone: #e0870a; --tone-2: #c96f00; --tone-soft: #e0870a1a }
[data-tone=green] { --tone: #2f9e44; --tone-2: #248437; --tone-soft: #2f9e441a }
[data-tone=rose] { --tone: #e0426e; --tone-2: #c9305c; --tone-soft: #e0426e1a }
[data-tone=blue] { --tone: #3b74e8; --tone-2: #2a5cc4; --tone-soft: #3b74e81a }
:root[data-theme=dark] [data-tone=teal] { --tone: #38d9a9 }
:root[data-theme=dark] [data-tone=amber] { --tone: #f7b02e }
:root[data-theme=dark] [data-tone=green] { --tone: #51cf66 }
:root[data-theme=dark] [data-tone=rose] { --tone: #f783ac }
:root[data-theme=dark] [data-tone=violet] { --tone: #9a82ff }
:root[data-theme=dark] [data-tone=blue] { --tone: #5c9bff }

/* ---------- 2. 版式与骨架 ---------- */

html, body { margin: 0; padding: 0 }
body {
  background: var(--frame);
  color: var(--text);
  font-family: var(--body);
  min-height: 100vh;
  transition: background .28s ease, color .28s ease;
}
.app {
  background: var(--bg);
  border-radius: var(--app-radius);
  padding: var(--app-pad);
  min-height: 100vh;
  overflow: clip;
  transition: background .28s ease;
}
.wrap { width: min(1240px, 100% - 40px); margin-inline: auto }
h1, h2, h3, h4 { font-family: var(--display); text-transform: var(--title-transform); letter-spacing: var(--title-tracking); margin: 0 0 .4em; line-height: 1.15 }
h1 { font-size: clamp(28px, 4.4vw, 46px); font-weight: var(--title-weight) }
h2 { font-size: clamp(20px, 2.6vw, 28px); font-weight: var(--title-weight) }
h3 { font-size: 17px; font-weight: 600 }
p { margin: 0 0 1em }
a { color: inherit; text-decoration: none }
.muted { color: var(--muted) }
.small { font-size: 13px }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }

/* ---------- 3. 顶栏 ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--border-w) solid var(--line);
}
:root[data-style=magazine] .topbar { border-radius: 0 0 var(--radius-lg) var(--radius-lg) }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 74px }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--btn-grad); box-shadow: var(--btn-shadow);
  display: grid; place-items: center; color: var(--btn-ink); font-weight: 800; font-size: 15px;
  font-family: var(--display);
}
.brand-name { font-weight: 700; font-size: 16.5px; line-height: 1.15; font-family: var(--display) }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase }

.nav { display: flex; align-items: center; gap: 4px; margin-inline: auto; overflow-x: auto; scrollbar-width: none }
.nav::-webkit-scrollbar { display: none }
.nav a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 9px 13px; border-radius: var(--pill); font-size: 14px; color: var(--muted);
  border: var(--border-w) solid transparent; transition: background .16s, color .16s;
}
.nav a:hover { color: var(--text); background: var(--surface-2) }
.nav a[aria-current=page] { color: var(--accent); background: var(--tone-soft, color-mix(in srgb, var(--accent) 12%, transparent)); font-weight: 600 }
:root[data-style=magazine] .nav a[aria-current=page] { border-color: var(--line-strong) }
.nav a.nav-hot { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent) }
.nav svg { width: 15px; height: 15px; flex: 0 0 auto }

.tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface); border: var(--border-w) solid var(--line); color: var(--text);
  display: grid; place-items: center; position: relative; transition: transform .14s, border-color .16s, box-shadow .16s;
}
.icon-btn:hover { border-color: var(--line-strong); transform: translateY(-1px) }
.icon-btn svg { width: 18px; height: 18px }
.icon-btn .badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--pill); background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 700; display: none; place-items: center; line-height: 18px;
}
.icon-btn .badge[data-count] { display: grid }

/* ---------- 4. 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--pill); cursor: pointer;
  font: 600 14.5px/1.2 var(--body); border: var(--border-w) solid var(--line-strong);
  background: var(--surface); color: var(--text); white-space: nowrap;
  transition: transform .14s ease, box-shadow .14s ease, background .16s, opacity .16s;
}
.btn:hover { border-color: var(--muted) }
.btn:active { transform: translateY(1px) }
.btn-primary {
  background: var(--btn-grad); color: var(--btn-ink); border-color: transparent;
  box-shadow: var(--btn-shadow);
}
.btn-primary:hover { transform: translate(var(--btn-shift)); box-shadow: var(--btn-shadow) }
.btn-primary:active { transform: translate(var(--btn-shift-active)); box-shadow: none }
.btn-ghost { background: transparent; border-color: var(--line) }
.btn-sm { padding: 7px 14px; font-size: 13px }
.btn-lg { padding: 15px 30px; font-size: 16px }
.btn-block { width: 100% }
.btn[disabled] { opacity: .5; pointer-events: none }
.btn svg { width: 15px; height: 15px }

/* ---------- 5. 主区与卡片 ---------- */

main { padding: 26px 0 60px }
section { margin-bottom: 10px }
.card {
  background: var(--surface); border-radius: var(--radius);
  border: var(--border-w) solid var(--line);
  box-shadow: var(--card-shadow);
  padding: 26px;
}
:root[data-style=magazine] .card { border-color: var(--line-strong) }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap }
.kicker { font: 600 11.5px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px }

/* 商品网格：主推卡占两列，与参考布局一致 */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px }
.pcard {
  grid-column: span 1; display: flex; flex-direction: column; gap: 0;
  background: var(--surface); border-radius: var(--radius); border: var(--border-w) solid var(--line);
  box-shadow: var(--card-shadow); padding: 26px 26px 22px; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.pcard[data-featured] { grid-column: span 2 }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover) }
:root[data-style=magazine] .pcard:hover { transform: translate(-2px, -2px) }
.pcard h3 { font-family: var(--display); font-size: clamp(21px, 2.3vw, 27px); font-weight: var(--title-weight); text-transform: var(--title-transform); letter-spacing: var(--title-tracking); margin: 0 }
.pcard h3 .tone { color: var(--tone, var(--accent)) }
.pcard .sub { color: var(--muted); font-size: 13px; margin: 6px 0 16px }
.pcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px }
.badge-hot {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--pill);
  background: var(--tone-soft, color-mix(in srgb, var(--accent) 14%, transparent)); color: var(--tone, var(--accent));
  margin-bottom: 10px; letter-spacing: .04em;
}

/* 价格 */
.price { display: flex; align-items: baseline; gap: 4px; font-family: var(--display); color: var(--text); white-space: nowrap; flex: 0 0 auto }
.price .cur { font-size: 19px; font-weight: 700 }
.price .amt { font-size: 31px; font-weight: 800; letter-spacing: -0.02em }
.price .from { font-size: 12px; color: var(--muted); font-family: var(--body); margin-left: 3px }
.price .was { font-size: 13px; color: var(--muted); text-decoration: line-through; font-family: var(--body); margin-left: 8px }

/* 卡面插画：纯 CSS/SVG，不引外部图片 */
.art {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  background: linear-gradient(140deg, color-mix(in srgb, var(--tone, var(--accent)) 16%, var(--surface)),
    color-mix(in srgb, var(--tone, var(--accent)) 5%, var(--surface-2)));
  min-height: 176px; display: grid; place-items: center;
}
.pcard[data-featured] .art { min-height: 250px }
.art svg { width: 100%; height: 100%; display: block }
.art .tag {
  position: absolute; inset-inline-end: 16px; inset-block-end: 12px;
  font: 800 26px/1 var(--display); color: var(--tone, var(--accent)); letter-spacing: -0.02em;
}
.art .tag small { font-size: 13px; font-weight: 600; margin-inline-start: 3px }
.sparkle { position: absolute; inset-block-start: 18px; inset-inline-start: 22px; width: 12px; height: 12px; opacity: .55 }

/* 套餐选择 */
.variants { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 }
.vchip {
  display: flex; flex-direction: column; gap: 2px; cursor: pointer; text-align: start;
  padding: 12px 16px; border-radius: var(--radius-sm); min-width: 116px;
  border: var(--border-w) solid var(--line-strong); background: var(--surface); transition: all .16s;
}
.vchip:hover { border-color: var(--accent) }
.vchip[aria-checked=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent) }
.vchip b { font-size: 14.5px; font-weight: 650 }
.vchip span { font-size: 12px; color: var(--muted) }
.vchip .vp { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--tone, var(--accent)) }

/* 行内列表 / 表格 */
.rows { display: flex; flex-direction: column; gap: 12px }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius-sm); border: var(--border-w) solid var(--line) }
table { width: 100%; border-collapse: collapse; font-size: 13.5px }
th, td { text-align: start; padding: 10px 12px; border-bottom: var(--border-w) solid var(--line) }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em }
tr:hover td { background: var(--surface-2) }

/* 表单 */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px }
input, select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: var(--surface); border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-sm); outline: none; transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent) }
textarea { min-height: 92px; resize: vertical }
.field { margin-bottom: 16px }

/* 卡密展示 */
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: var(--border-w) dashed var(--accent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 16px; letter-spacing: .04em;
}
.code-box .lbl { font-family: var(--body); font-size: 12px; color: var(--muted); letter-spacing: 0 }
.copy-btn { flex: 0 0 auto }

/* 状态标签 */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--pill); font-size: 12px; font-weight: 650; white-space: nowrap }
.pill svg { width: 13px; height: 13px }
.pill[data-s=stock], .pill[data-s=delivered] { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok) }
.pill[data-s=reserved], .pill[data-s=pending] { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn) }
.pill[data-s=void], .pill[data-s=refunded], .pill[data-s=expired] { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger) }
.pill[data-s=cancelled] { background: var(--surface-3); color: var(--muted) }

/* 提示条 */
.notice-bar {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; margin-bottom: 20px;
  border-radius: var(--radius-sm); font-size: 13.5px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border: var(--border-w) solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.notice-bar.info { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 34%, transparent) }
.notice-bar b { display: block; margin-bottom: 3px }

/* 右侧竖排客服条 */
.rail {
  position: fixed; inset-inline-end: 0; top: 50%; transform: translateY(-50%); z-index: 35;
  writing-mode: vertical-rl; padding: 16px 11px; cursor: pointer;
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600;
  border: var(--border-w) solid var(--line); border-inline-end: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); box-shadow: var(--card-shadow);
  display: flex; align-items: center; gap: 10px;
}
.rail svg { width: 17px; height: 17px; color: var(--accent) }

/* 页脚 */
footer { background: var(--surface); border-top: var(--border-w) solid var(--line); padding: 34px 0 40px; margin-top: 30px }
:root[data-style=magazine] footer { background: var(--text); color: var(--bg); border-radius: var(--radius-lg); border: 0; margin: 30px 20px 20px; padding: 34px 30px }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13.5px }
.foot-links a { color: var(--muted) }
.foot-links a:hover { color: inherit }

/* 外观设置浮层 */
.pop {
  position: fixed; inset-inline-end: 20px; inset-block-start: 84px; z-index: 60; width: 292px;
  background: var(--surface); border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--card-shadow-hover); padding: 20px; display: none;
}
.pop[data-open] { display: block }
.pop h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 0 9px; font-family: var(--body) }
.pop h4:first-child { margin-top: 0 }
.seg { display: flex; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: var(--pill) }
.seg button { flex: 1; padding: 8px 14px; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted); font: 600 13px var(--body); cursor: pointer; white-space: nowrap }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--text); box-shadow: var(--card-shadow) }
.swatches { display: flex; gap: 9px; flex-wrap: wrap }
.swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid var(--line); background: var(--sw); padding: 0 }
.swatch[aria-pressed=true] { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset }
.swatch[data-style-p=shop] { --sw: linear-gradient(135deg, #2ad3aa, #0ea87e) }
.swatch[data-style-p=magazine] { --sw: conic-gradient(#e2432f 0 50%, #c9ef2e 50%) }
.swatch[data-style-p=saas] { --sw: linear-gradient(135deg, #8b6cff, #14b8a6) }
.swatch[data-accent-p=teal] { --sw: #0f8f80 } .swatch[data-accent-p=violet] { --sw: #6d4fd8 }
.swatch[data-accent-p=amber] { --sw: #d97a06 } .swatch[data-accent-p=rose] { --sw: #d6336c }
.swatch[data-accent-p=blue] { --sw: #2463d6 } .swatch[data-accent-p=ink] { --sw: #2a2521 }
.swatch[data-accent-p=coral] { --sw: #e2432f } .swatch[data-accent-p=default] { --sw: conic-gradient(#12b886 0 50%, #7c5cff 50%) }

/* 移动端底部标签栏 */
.tabbar { display: none }

/* 表格外层横向滚动容器：列数多的后台表在窄屏不挤压换行 */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px }
.tscroll table { min-width: 640px }

/* 响应式网格：后台统计卡与商品表单用 */
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }

/* 杂项 */
.stack { display: flex; flex-direction: column; gap: 16px }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start }
.empty { text-align: center; padding: 70px 20px; color: var(--muted) }
.empty svg { width: 46px; height: 46px; opacity: .35; margin-bottom: 14px }
.countdown { font-family: var(--display); font-weight: 700; color: var(--warn) }
.toast {
  position: fixed; inset-block-end: 26px; inset-inline-start: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 22px; border-radius: var(--pill);
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; z-index: 90;
  transition: opacity .2s, transform .2s; box-shadow: var(--card-shadow-hover);
}
.toast[data-show] { opacity: 1; transform: translateX(-50%) translateY(0) }

@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .pcard[data-featured] { grid-column: span 2 }
  .split { grid-template-columns: 1fr }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 760px) {
  .wrap { width: min(1240px, 100% - 26px) }
  .topbar .wrap { height: 64px; gap: 10px }
  .nav { display: none }
  .grid { grid-template-columns: 1fr }
  .pcard[data-featured] { grid-column: span 1 }
  .card, .pcard { padding: 20px }
  main { padding-bottom: 92px }
  .rail { display: none }
  .g4, .g3, .g2 { grid-template-columns: 1fr }
  .page-head { align-items: flex-start }
  /* 分类筛选不再等分挤压：改成横向滚动，标签保持单行 */
  .seg { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none }
  .seg::-webkit-scrollbar { display: none }
  .seg button { flex: 0 0 auto }
  .row { flex-wrap: wrap }
  .row > * { min-width: 0 }
  .pop { inset-inline: 13px; inset-inline-end: 13px; width: auto }
  .tabbar a span { white-space: nowrap; font-size: 10.5px }
  .tabbar {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
    border-top: var(--border-w) solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 5px }
  .tabbar a[aria-current=page] { color: var(--accent) }
  .tabbar svg { width: 19px; height: 19px }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important }
  .pcard:hover, .btn-primary:hover { transform: none }
}

/* ---------- 品牌素材、账户与后台抽屉 ---------- */
.brand-icon {
  display: inline-block; width: 1em; height: 1em; flex: 0 0 auto;
  background: currentColor; color: var(--tone, var(--accent));
  -webkit-mask: var(--brand-icon) center / contain no-repeat;
  mask: var(--brand-icon) center / contain no-repeat;
}
.art-brand {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: clamp(76px, 13vw, 116px); height: clamp(76px, 13vw, 116px);
  display: grid; place-items: center; border-radius: 30%;
  color: var(--tone, var(--accent)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: var(--border-w) solid color-mix(in srgb, var(--tone, var(--accent)) 28%, transparent);
  box-shadow: 0 14px 40px color-mix(in srgb, var(--tone, var(--accent)) 16%, transparent);
  backdrop-filter: blur(8px);
}
.art-brand .brand-icon { width: 54%; height: 54%; }
.product-image { width: 100%; height: 100%; object-fit: cover; display: block }
.art[data-ratio="1:1"]:has(.product-image) { aspect-ratio: 1; min-height: 0 !important }
.art[data-ratio="4:3"]:has(.product-image) { aspect-ratio: 4 / 3; min-height: 0 !important }
.art[data-ratio="16:9"]:has(.product-image) { aspect-ratio: 16 / 9; min-height: 0 !important }

.auth-layout {
  display: grid; grid-template-columns: 1.05fr .95fr; min-height: min(760px, calc(100vh - 110px));
  margin: 26px 0 50px; background: var(--surface); border: var(--border-w) solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--card-shadow);
}
.auth-story {
  position: relative; overflow: hidden; padding: clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 13%, var(--surface)), var(--surface-2));
  border-inline-end: var(--border-w) solid var(--line);
}
.auth-story::after {
  content: ""; position: absolute; width: 280px; height: 280px; inset-inline-end: -100px; inset-block-start: -90px;
  border: 42px solid color-mix(in srgb, var(--accent) 9%, transparent); border-radius: 50%; pointer-events: none;
}
.auth-brand { width: 76px; height: 76px; display: grid; place-items: center; color: var(--accent); margin-bottom: 26px }
.auth-brand .brand-icon { width: 62px; height: 62px }
.auth-story h1 { font-size: clamp(32px, 4vw, 52px); max-width: 520px }
.auth-story > p { color: var(--muted); max-width: 480px }
.auth-points { display: grid; gap: 18px; margin: 24px 0 30px }
.auth-points > div { display: flex; gap: 13px; align-items: flex-start }
.auth-points svg { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; margin-top: 2px }
.auth-points span { display: grid; gap: 2px }
.auth-points small { color: var(--muted) }
.auth-demo { font-size: 12px; margin: 0; padding-top: 18px; border-top: var(--border-w) solid var(--line) }
.auth-form-card { border: 0; border-radius: 0; box-shadow: none; padding: clamp(28px, 5vw, 64px); align-self: center }
.auth-form-card h2 { font-size: clamp(26px, 3vw, 36px) }
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 }
.auth-switch a { color: var(--accent); font-weight: 700 }
.form-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); border: var(--border-w) solid color-mix(in srgb, var(--danger) 28%, transparent); border-radius: var(--radius-sm); padding: 10px 13px; margin-bottom: 14px; font-size: 13px }
.verify-card, .account-gate { max-width: 560px; margin: 8vh auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px }
.verify-card > svg, .account-gate > svg { width: 46px; height: 46px; color: var(--accent) }
.verify-icon { width: 74px; height: 74px; color: var(--accent); margin-bottom: 8px }
.verify-card h1, .account-gate h1 { font-size: clamp(26px, 4vw, 36px) }

.account-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px }
.account-summary .card { display: grid; gap: 4px }
.account-summary b { font: 800 clamp(26px, 3vw, 38px)/1.2 var(--display) }
.account-summary small { color: var(--muted) }
.account-verify { margin-bottom: 22px }
.account-grid { grid-template-columns: 1.5fr .8fr }
.account-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px }
.account-orders { display: grid; gap: 10px }
.account-order { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: start; padding: 15px; color: var(--text); background: var(--surface-2); border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font: inherit; transition: border-color .16s, transform .16s }
.account-order:hover { border-color: var(--accent); transform: translateY(-1px) }
.account-order-main, .account-order-side { display: grid; gap: 4px; min-width: 0 }
.account-order-main b { overflow-wrap: anywhere }
.account-order-main small { color: var(--muted) }
.account-order-side { justify-items: end; grid-auto-flow: column; align-items: center; gap: 10px }
.account-order-side svg { width: 16px; height: 16px; color: var(--muted) }
.account-order-lines { display: grid; gap: 8px }

.overlay { position: fixed; inset: 0; z-index: 70; background: #0006; backdrop-filter: blur(3px) }
.drawer { position: fixed; z-index: 71; inset-block: 0; inset-inline-end: 0; width: min(560px, 100%); overflow-y: auto; background: var(--surface); color: var(--text); border-inline-start: var(--border-w) solid var(--line); box-shadow: -20px 0 60px #0003; padding: 26px }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px }
.drawer-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: var(--border-w) solid var(--line) }
.permission-group { padding: 14px 0; border-bottom: var(--border-w) solid var(--line) }
.permission-group h4 { margin: 0 0 10px }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px }
.permission-option { display: flex; align-items: flex-start; gap: 8px; padding: 9px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; color: var(--text) }
.permission-option input { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent) }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px }
.media-card { overflow: hidden; background: var(--surface-2); border: var(--border-w) solid var(--line); border-radius: var(--radius-sm) }
.media-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-3) }
.media-card[data-ratio="1:1"] img { aspect-ratio: 1 }
.media-card[data-ratio="16:9"] img { aspect-ratio: 16 / 9 }
.media-card-body { padding: 11px; display: grid; gap: 6px }
.media-card-body b { font-size: 12px; overflow-wrap: anywhere }
.media-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; max-height: 230px; overflow-y: auto; padding: 4px }
.media-choice { position: relative; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--surface-2) }
.media-choice[aria-pressed=true] { border-color: var(--accent) }
.media-choice img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover }
.brand-preview { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-inline-end: 6px }
:root { --brand-filter: none }
:root[data-theme=dark] { --brand-filter: invert(1) }
:root:not([data-theme=light]) img[src*="/assets/brands/"] { filter: var(--brand-filter) }
:root[data-theme=dark] img[src*="/assets/brands/"] { filter: var(--brand-filter) }
.product-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: var(--border-w) solid var(--line); background: var(--surface-2) }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px }
.upload-progress { height: 7px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; margin: 12px 0 }
.upload-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s }
.upload-preview { max-height: 220px; max-width: 100%; object-fit: contain; border-radius: var(--radius-sm); margin-top: 12px }
:where(button, a, input, select, textarea):focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px }

@media (max-width: 1080px) {
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .account-grid { grid-template-columns: 1fr }
}
@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; min-height: 0; margin-top: 14px }
  .auth-story { padding: 28px 22px; border-inline-end: 0; border-block-end: var(--border-w) solid var(--line) }
  .auth-story h1 { font-size: 32px }
  .auth-brand { width: 54px; height: 54px; margin-bottom: 16px }
  .auth-brand .brand-icon { width: 46px; height: 46px }
  .auth-points { gap: 12px; margin: 18px 0 }
  .auth-form-card { padding: 26px 22px }
  .account-summary { grid-template-columns: 1fr; gap: 10px }
  .account-summary .card { grid-template-columns: 1fr auto; align-items: center }
  .account-summary small:last-child { grid-column: 1 / -1 }
  .account-order { align-items: flex-start }
  .account-order-side { grid-auto-flow: row; justify-items: end }
  .account-order-side > svg { display: none }
  .drawer { padding: 20px }
  .permission-grid { grid-template-columns: 1fr }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .media-picker { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}
