/* 设计令牌。默认值是原 2xpro 控制台的紫色（violet，作兜底）；各产品在下方 html[data-theme] 里整套覆盖。
   颜色只在这里定义，组件一律引用令牌：换主题不留紫色漏色。成功、警告、危险等状态色所有主题共用。 */
:root {
  --primary: #7138c7; --primary-dark: #55229c; --primary-soft: #9b6ae0; --hot: #c44fd8;
  --tint: #efe7fb; --ink: #1d1430; --ink-2: #140c26; --text: #2b2440; --muted: #6f6880; --faint: #a49cb3;
  --workspace: #f7f5fb; --surface: #fff; --glass: #ffffffb8; --glass-strong: #ffffffe6; --soft: #f4f0fa; --surface-3: #ece6f5;
  --line: #e8e2f0; --line-strong: #d9cdea; --danger: #b4233a; --success: #1f8a5b; --warning: #a8620a; --info: #2d6fd6;
  /* 光：g 系列用于浅底上的渐变与光晕，d 系列是深色面板上的亮色 */
  --g1: #8b4cf0; --g2: #c44fd8; --g3: #5b6cf0; --d1: #c9a8ff; --d2: #f6b8ff; --d3: #b98aff;
  --shade: #2a124a;
  /* 深色面板：3D 终端、主推价格卡、推广横幅、会员卡 */
  --term-bg: linear-gradient(160deg, #241843 0%, #150d29 60%, #1b1035 100%);
  --panel: linear-gradient(170deg, #2a1a4d 0%, #170e2c 70%);
  --hero-dark: linear-gradient(130deg, #2a1a4d 0%, #1a0f30 55%, #3a1660 100%);
  --panel-deep: #1d1236; --panel-shadow: #3a1a7acc;
  --on-dark: #d9cdee; --on-dark-muted: #a99cc4; --on-dark-dim: #8d81a8; --on-dark-ink: #e9e1f7; --ribbon-ink: #3b1670;
  /* 背景光晕与卡片顶部柔光 */
  --aurora-top: #efe4ff; --aurora-1: #c9a8ff; --aurora-2: #f2b5f5; --aurora-3: #b7c3ff;
  --wash-1: #efe4ff; --wash-2: #fbe1f7;
  --brand-gradient: linear-gradient(120deg, var(--g1) 0%, var(--primary) 42%, var(--g2) 100%);
  --text-gradient: linear-gradient(100deg, var(--primary-dark) 0%, var(--g1) 35%, var(--g2) 70%, var(--g3) 100%);
  --radius: 20px; --radius-sm: 12px; --radius-lg: 28px;
  --shadow: 0 1px 2px color-mix(in srgb, var(--shade) 4%, transparent), 0 8px 28px color-mix(in srgb, var(--shade) 5%, transparent);
  --shadow-lift: 0 2px 6px color-mix(in srgb, var(--shade) 7%, transparent), 0 22px 48px color-mix(in srgb, var(--shade) 14%, transparent);
  --shadow-glow: 0 18px 60px -12px color-mix(in srgb, var(--primary) 40%, transparent), 0 6px 18px -6px color-mix(in srgb, var(--g2) 30%, transparent);
  /* 店铺标识（buyai）中性统一，不随产品变色；产品自身识别靠官方应用图标 */
  --store-ink: #17161a;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: Inter, "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--workspace); overflow-x: hidden; line-height: 1.6; }
img, svg { display: block; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- 背景：极光光晕 + 细点阵（同 2xpro M3） ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: radial-gradient(1200px 600px at 70% -10%, var(--aurora-top) 0%, transparent 60%), var(--workspace); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: var(--aurora-1); }
.aurora i:nth-child(2) { width: 38vw; height: 38vw; right: -10vw; top: 6vw; background: var(--aurora-2); animation-duration: 32s; animation-delay: -8s; }
.aurora i:nth-child(3) { width: 34vw; height: 34vw; left: 30vw; top: 46vh; background: var(--aurora-3); opacity: .4; animation-duration: 38s; animation-delay: -16s; }
.aurora::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--primary) 12%, transparent) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 0%, transparent 70%); }

/* ---------- 按钮 ---------- */
.btn { --h: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; white-space: nowrap; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, opacity .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { position: relative; color: #fff; background: var(--brand-gradient); background-size: 160% 100%; box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--primary) 60%, transparent), inset 0 1px 0 #ffffff40; }
.btn-primary:hover:not([disabled]) { background-position: 100% 0; box-shadow: var(--shadow-glow), inset 0 1px 0 #ffffff40; transform: translateY(-1px); }
.btn-ghost { background: var(--glass-strong); border-color: var(--line); color: var(--ink); backdrop-filter: blur(10px); }
.btn-ghost:hover:not([disabled]) { border-color: var(--line-strong); box-shadow: var(--shadow); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not([disabled]) { background: var(--ink-2); }
.btn-text { background: none; border: 0; padding: 0 6px; height: auto; color: var(--primary); font-weight: 600; }
.btn-lg { --h: 54px; padding: 0 28px; font-size: 16px; }
.btn-sm { --h: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #ffffff66; border-top-color: #fff; animation: spin-r .7s linear infinite; }

/* ---------- 表面 ---------- */
.card { background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px) saturate(140%); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--tint); color: var(--primary-dark); white-space: nowrap; }
.pill.ok { background: #e3f4ec; color: var(--success); }
.pill.warn { background: #fdf0dc; color: var(--warning); }
.pill.info { background: #e4edfb; color: var(--info); }
.pill.mute { background: var(--surface-3); color: var(--muted); }
.pill.bad { background: #fbe5e9; color: var(--danger); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live .dot { animation: pulse 1.4s ease-in-out infinite; }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 12.5px; }
.input { height: 48px; width: 100%; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: none; border-color: var(--primary-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.input.error { border-color: var(--danger); box-shadow: 0 0 0 4px #b4233a14; }
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; min-width: 0; }
.form-error { color: var(--danger); font-size: 13px; min-height: 1em; }

/* ---------- 弹窗与提示 ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); }
dialog::backdrop { background: color-mix(in srgb, var(--ink) 40%, transparent); backdrop-filter: blur(6px); }
dialog[open] { animation: pop .32s var(--ease); }
.modal { width: min(440px, 100vw - 32px); padding: 32px; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 40px 100px -20px color-mix(in srgb, var(--shade) 40%, transparent); position: relative; overflow: hidden; }
.modal::before { content: ""; position: absolute; inset: 0 0 auto; height: 120px; background: radial-gradient(260px 120px at 30% 0, var(--wash-1), transparent 70%), radial-gradient(220px 120px at 85% 0, var(--wash-2), transparent 70%); pointer-events: none; }
.modal > * { position: relative; }
.modal-close { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #ffffffaa; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: var(--soft); color: var(--ink); }
.modal h2 { margin: 6px 0 4px; font-size: 24px; color: var(--ink); letter-spacing: -.01em; }
.modal form { display: grid; gap: 16px; margin-top: 22px; }
.demo-note { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 12.5px; color: var(--muted); }

.toast-host { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--ink) 67%, transparent); animation: rise .3s var(--ease); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--danger); }

/* ---------- 骨架与空态 ---------- */
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--soft) 25%, var(--surface) 50%, var(--soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty svg { margin: 0 auto 12px; color: var(--primary-soft); }
.region-error { padding: 20px; border-radius: 14px; background: #fbe5e9; color: var(--danger); display: flex; justify-content: space-between; align-items: center; gap: 12px; }

@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vw, 4vw) scale(1.12); } 100% { transform: translate(-4vw, 6vw) scale(.95); } }
@keyframes shimmer { to { background-position: -200% 0; } }
/* 骨架屏：等数据的页面（app.js SKELETON）与解码中的图片 */
.sk-page { display: grid; gap: 22px; }
.sk-page .skeleton { display: block; }
.sk-buy { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.sk-account { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.sk-col { display: grid; gap: 16px; }
.sk-narrow { max-width: 560px; margin: 0 auto; justify-items: center; }
.sk-narrow .skeleton { width: 100%; }
.sk-title { height: 34px; width: 42%; border-radius: 10px; }
.sk-narrow .sk-ring { width: 72px; height: 72px; border-radius: 50%; }
.sk-narrow .sk-title { width: 50%; }
img.img-wait { background: linear-gradient(90deg, var(--soft) 25%, var(--surface) 50%, var(--soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
/* 文件末尾才到的详情图：占位中间放一个图片符号，图片到达后由模糊淡入（boot.js 加 .img-in） */
img.img-wait[data-lazy] {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a96a8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='9' cy='10' r='1.8'/%3E%3Cpath d='M21 16l-5-5-9 9'/%3E%3C/svg%3E") center / 44px no-repeat,
    linear-gradient(90deg, var(--soft) 25%, var(--surface) 50%, var(--soft) 75%) 0 0 / 200% 100%;
  animation: shimmer-lazy 1.4s linear infinite; }
@keyframes shimmer-lazy { from { background-position: center, 0 0; } to { background-position: center, -200% 0; } }
img.img-in { animation: img-in .7s var(--ease) both; }
@keyframes img-in { from { opacity: 0; filter: blur(14px); } to { opacity: 1; filter: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spin-r { to { transform: rotate(360deg); } }
@keyframes spin { to { --angle: 360deg; } }
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   主题：颜色只在上面的 :root 定义。要换风格（如以后的黑色版），新增一个
   html[data-theme="xxx"] { --primary: …; } 覆盖令牌，并在 config.js 的 theme 里切换。
   商品详情图是内容，不跟随站点主题。
   ========================================================================== */
:root {
  /* 新组件使用的语义令牌，映射到当前主题 */
  --accent: var(--primary); --accent-hover: var(--primary-dark);
  --ok: var(--success); --warn: var(--warning);
  --surface-2: var(--soft);
  --nav-h: 68px;
}

/* ---------- 产品主题（本站设计选择，不代表各厂商官方配色）：取色自各产品详情图的色调 ---------- */
/* Claude · 陶土暖：奶油白纸感底、陶土橙主色、琥珀高光，深色面板为暖炭 */
html[data-theme="clay"] {
  --primary: #b4532a; --primary-dark: #8c3d1c; --primary-soft: #d48a62; --hot: #b0611a;
  --tint: #f7e8dc; --ink: #2a1c14; --ink-2: #1d130d; --text: #3b2b21; --muted: #7a685b; --faint: #b2a293;
  --workspace: #faf6f0; --surface: #fffdfa; --glass: #fffdf8b8; --glass-strong: #fffdf9eb; --soft: #f5ede3; --surface-3: #efe4d6;
  --line: #ebe0d3; --line-strong: #dccbb7;
  --g1: #d0703f; --g2: #e0a04a; --g3: #c2552d; --d1: #f2c4a2; --d2: #ffd89c; --d3: #e8956a;
  --shade: #4a2a16;
  --term-bg: linear-gradient(160deg, #2e231c 0%, #18120e 60%, #241912 100%);
  --panel: linear-gradient(170deg, #35261c 0%, #1a130f 70%);
  --hero-dark: linear-gradient(130deg, #36261c 0%, #1b140f 55%, #4a2c19 100%);
  --panel-deep: #1d1510; --panel-shadow: #4a2a16cc;
  --on-dark: #ecdfd2; --on-dark-muted: #b9a594; --on-dark-dim: #93806f; --on-dark-ink: #f6ece1; --ribbon-ink: #5b2810;
  --aurora-top: #fbe5cf; --aurora-1: #f5c39d; --aurora-2: #fadca8; --aurora-3: #f0cfc0;
  --wash-1: #fbe8d8; --wash-2: #fdf0d8;
  --brand-gradient: linear-gradient(120deg, #c9653a 0%, #b4532a 45%, #cf7f35 100%);
  --text-gradient: linear-gradient(100deg, #8c3d1c 0%, #c2602f 38%, #dd9440 72%, #b4532a 100%);
}
/* GPT · 石墨绿：冷灰白底、石墨黑按钮，鼠尾草绿只做强调，避免与“已交付”状态绿混淆 */
html[data-theme="graphite"] {
  --primary: #1d2220; --primary-dark: #0b0d0c; --primary-soft: #5d6a62; --hot: #3d7a50;
  --tint: #e6eee5; --ink: #111412; --ink-2: #0a0c0b; --text: #262b28; --muted: #646d67; --faint: #a1a9a3;
  --workspace: #f3f4f2; --surface: #fff; --glass: #ffffffb8; --glass-strong: #ffffffeb; --soft: #eceeeb; --surface-3: #e4e7e3;
  --line: #e0e3df; --line-strong: #cdd2cc;
  --g1: #6f9f6b; --g2: #a9c99f; --g3: #4c7d5b; --d1: #b8d6ae; --d2: #dcedcf; --d3: #8fbf86;
  --shade: #0f1411;
  --term-bg: linear-gradient(160deg, #1e2220 0%, #0d0f0e 60%, #141a16 100%);
  --panel: linear-gradient(170deg, #202624 0%, #0e1110 70%);
  --hero-dark: linear-gradient(130deg, #202624 0%, #0f1211 55%, #1c2b22 100%);
  --panel-deep: #0f1211; --panel-shadow: #0b0f0ccc;
  --on-dark: #dce3dc; --on-dark-muted: #9aa59d; --on-dark-dim: #78837b; --on-dark-ink: #eef3ee; --ribbon-ink: #15301f;
  --aurora-top: #e5ede2; --aurora-1: #cfe1c8; --aurora-2: #e2e6df; --aurora-3: #d2dfdc;
  --wash-1: #e8f0e5; --wash-2: #f0f2ee;
  --brand-gradient: linear-gradient(120deg, #343c38 0%, #121614 50%, #2c3d32 100%);
  --text-gradient: linear-gradient(100deg, #121614 0%, #2e4a38 34%, #5f925f 68%, #121614 100%);
  --shadow-glow: 0 18px 50px -14px #0f141166, 0 6px 18px -6px #6f9f6b55;
}
/* Grok · 冷银紫：冷白银灰底、降饱和灰紫，不用品红；深色面板为冷炭，光泽偏银紫 */
html[data-theme="silver"] {
  --primary: #5a54a0; --primary-dark: #423d7e; --primary-soft: #8f8ac6; --hot: #5a54a0;
  --tint: #ebeaf6; --ink: #16151c; --ink-2: #0d0c12; --text: #2a2933; --muted: #686778; --faint: #a4a3b2;
  --workspace: #f5f5f8; --surface: #fff; --soft: #efeff4; --surface-3: #e7e7ef;
  --line: #e3e3ea; --line-strong: #d2d2dd;
  --g1: #8e89d2; --g2: #b3bad6; --g3: #7487b8; --d1: #d0ccf3; --d2: #eceef8; --d3: #aaa5e2;
  --shade: #1b1a30;
  --term-bg: linear-gradient(160deg, #201f2a 0%, #0f0e15 60%, #19182b 100%);
  --panel: linear-gradient(170deg, #24232f 0%, #111018 70%);
  --hero-dark: linear-gradient(130deg, #25243a 0%, #111018 55%, #282742 100%);
  --panel-deep: #13121b; --panel-shadow: #14132acc;
  --on-dark: #dddce9; --on-dark-muted: #a3a2b6; --on-dark-dim: #807f93; --on-dark-ink: #efeff7; --ribbon-ink: #25224a;
  --aurora-top: #e9e9f6; --aurora-1: #d6d3f1; --aurora-2: #e1e5f2; --aurora-3: #cdd5ea;
  --wash-1: #eeedf8; --wash-2: #eef1f8;
  --brand-gradient: linear-gradient(120deg, #6d67b4 0%, #514b95 45%, #6f7fb2 100%);
  --text-gradient: linear-gradient(100deg, #3a356c 0%, #6a64b2 36%, #9aa4c9 70%, #4f4994 100%);
}

/* ---------- 补充组件 ---------- */
img { max-width: 100%; height: auto; }
a.btn:hover { text-decoration: none; }
.wrap.narrow { width: min(860px, 100% - 32px); }
.center { text-align: center; }
.page-pad { padding: 64px 0 96px; }
.fine { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; }
.btn-xs { --h: 28px; padding: 0 12px; font-size: 12.5px; }
.link-more { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: 0; font-weight: 600; font-size: 15px; color: var(--primary); }
.link-more svg { transition: transform .25s var(--ease); }
.link-more:hover svg { transform: translateX(3px); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6880' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 38px; }
textarea.input { height: auto; min-height: 112px; padding: 12px 15px; resize: vertical; }
.field > span em { font-style: normal; font-weight: 500; color: var(--faint); font-size: 12.5px; margin-left: 4px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 14px; margin-bottom: 16px; }
.notice svg { flex: none; margin-top: 3px; }
.notice.bad { background: #fbe5e9; color: var(--danger); }
.empty { display: grid; justify-items: center; gap: 8px; }
.empty b { color: var(--ink); font-size: 17px; }
.empty p { margin: 0 0 8px; }
.narrow-card { max-width: 480px; margin: 0 auto; }
.modal.viewer { width: min(780px, 100vw - 32px); padding: 16px; }
.modal.viewer img { width: 100%; border-radius: 12px; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes badge { 0% { transform: scale(.92); opacity: .4; } 60% { transform: scale(1.03); } 100% { transform: none; opacity: 1; } }
