/* ==========================================================================
   NEBULA CLOUD — 简约大气的云服务器售卖站
   ========================================================================== */

:root {
  --ink: #07080c;
  --ink-1: #0b0d13;
  --ink-2: #11141c;
  --ink-3: #171b25;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eef0f5;
  --text-2: #a2a8b8;
  --text-3: #6b7182;
  --mint: #3ddc97;
  --cyan: #4cc9f0;
  --violet: #8b7cf8;
  --amber: #f6c95c;
  --rose: #f2698f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --max: 1180px;
}

* { box-sizing: border-box; }

/* 确保 hidden 属性始终生效（覆盖 .admin-shell / .login-center 等 display 规则） */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

/* 背景光晕 */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(60% 60% at 20% 0%, rgba(76, 201, 240, 0.16), transparent 70%),
    radial-gradient(50% 60% at 80% 10%, rgba(139, 124, 248, 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.mono {
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-variant-ligatures: none;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- 顶部导航 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(160%) blur(18px);
  background: rgba(7, 8, 12, 0.72);
  border-bottom: 1px solid var(--line);
}

.topbar .wrap {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; letter-spacing: 0.14em; }
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  box-shadow: 0 0 14px rgba(61, 220, 151, 0.7);
}
.brand strong { font-size: 13px; font-weight: 600; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav button {
  background: none; border: 0; padding: 8px 14px; border-radius: 999px;
  color: var(--text-2); font-size: 13.5px; transition: 0.2s var(--ease);
}
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav button.on { color: var(--ink); background: var(--text); font-weight: 600; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.lang-switch button {
  border: 0; background: none; color: var(--text-3);
  height: 28px; min-width: 32px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { background: var(--text); color: var(--ink); }

.icon-btn {
  position: relative;
  height: 38px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px; transition: 0.2s var(--ease);
}
.icon-btn:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.07); }

.badge-count {
  min-width: 19px; height: 19px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, var(--mint), var(--cyan)); color: #04150e;
}

/* --------------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  border: 1px solid transparent; font-size: 14px; font-weight: 600;
  transition: 0.2s var(--ease); white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(120deg, var(--mint), var(--cyan) 90%);
  color: #04150e; box-shadow: 0 12px 30px -12px rgba(61, 220, 151, 0.6);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn-quiet { background: none; border-color: transparent; color: var(--text-2); }
.btn-quiet:hover { color: var(--text); }
.btn-danger { background: rgba(242, 105, 143, 0.14); border-color: rgba(242, 105, 143, 0.4); color: #ffb9cc; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------------- Hero */
.hero { position: relative; z-index: 1; padding: 96px 0 56px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03);
  font-size: 12px; letter-spacing: 0.08em; color: var(--text-2);
}
.hero h1 {
  margin: 26px 0 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--mint), var(--cyan) 45%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  margin: 22px 0 0; max-width: 560px;
  font-size: 17px; color: var(--text-2);
}
.hero-cta { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; margin-top: 64px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.stats div { background: var(--ink-1); padding: 22px 24px; }
.stats b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stats span { font-size: 12.5px; color: var(--text-3); }

/* -------------------------------------------------------------- 区块与标题 */
.section { position: relative; z-index: 1; padding: 72px 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 30px;
}
.section-head h2 {
  margin: 0; font-size: 27px; font-weight: 600; letter-spacing: -0.02em;
}
.section-head p { margin: 8px 0 0; color: var(--text-3); font-size: 14px; }

/* 分段控件（计费周期 / 筛选） */
.segment {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 999px;
}
.segment button {
  border: 0; background: none; color: var(--text-2);
  padding: 8px 16px; border-radius: 999px; font-size: 13px;
  transition: 0.18s var(--ease); white-space: nowrap;
}
.segment button small { color: var(--mint); margin-left: 6px; font-size: 11px; }
.segment button.on { background: rgba(255, 255, 255, 0.94); color: #0a0b0f; font-weight: 600; }
.segment button.on small { color: #0f7a4f; }
.segment button:hover:not(.on) { color: var(--text); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
  color: var(--text-2); transition: 0.18s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--ink); font-weight: 600; }

.store-toolbar { margin: -8px 0 18px; }
.dim-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dim-label {
  font-size: 12px; color: var(--text-3); letter-spacing: 0.06em;
  text-transform: none; white-space: nowrap;
}

/* --------------------------------------------------------------- 商品卡片 */
.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow);
}
.card.featured::after {
  content: ""; position: absolute; inset: -1px; border-radius: var(--radius);
  padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(61, 220, 151, 0.5), rgba(139, 124, 248, 0.35), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card .sku { margin-top: 4px; font-size: 11.5px; color: var(--text-3); letter-spacing: 0.04em; }
.tag {
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(61, 220, 151, 0.14); color: var(--mint);
  border: 1px solid rgba(61, 220, 151, 0.28); white-space: nowrap;
}
.tag.violet { background: rgba(139, 124, 248, 0.14); color: #b6adff; border-color: rgba(139, 124, 248, 0.3); }

.specs { margin: 20px 0 0; display: grid; gap: 9px; }
.specs div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.specs dt, .specs .k { color: var(--text-3); }
.specs .v { color: var(--text); }

.card .desc {
  margin: 16px 0 0; font-size: 12.5px; color: var(--text-3);
  line-height: 1.65; min-height: 42px;
}

.price-row {
  margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.price { display: flex; align-items: baseline; gap: 6px; }
.price b { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.price span { font-size: 12.5px; color: var(--text-3); }
.price-was { font-size: 12px; color: var(--text-3); text-decoration: line-through; }
.stock { font-size: 11.5px; color: var(--text-3); }
.stock.low { color: var(--amber); }
.stock.out { color: var(--rose); }

.card-actions { margin-top: 18px; display: flex; gap: 8px; }

/* --------------------------------------------------------------- 特性列表 */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
}
.feature .ic {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2);
  font-size: 17px; margin-bottom: 14px;
}
.feature h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.feature p { margin: 0; font-size: 13px; color: var(--text-3); }

/* ----------------------------------------------------------------- 抽屉/弹层 */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 4, 7, 0.66);
  backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: 0.25s var(--ease);
}
.overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(440px, 100%);
  display: flex; flex-direction: column;
  background: var(--ink-1); border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform 0.32s var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer header, .modal header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--line);
}
.drawer header h3, .modal header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.drawer .body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer .foot { padding: 20px 24px; border-top: 1px solid var(--line); background: var(--ink-2); }

.close-x {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: none; color: var(--text-2); display: grid; place-items: center;
  font-size: 17px; line-height: 1; transition: 0.2s var(--ease);
}
.close-x:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.06); }

.modal {
  position: fixed; z-index: 70; top: 50%; left: 50%;
  width: min(440px, calc(100% - 32px));
  transform: translate(-50%, -46%) scale(0.97);
  background: var(--ink-1); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: 0.25s var(--ease);
}
.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal .body { padding: 24px; }

/* ------------------------------------------------------------------ 购物车项 */
.cart-item {
  display: grid; gap: 10px; padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item .ci-top { display: flex; justify-content: space-between; gap: 12px; }
.cart-item h4 { margin: 0; font-size: 14px; font-weight: 600; }
.cart-item .ci-spec { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.cart-item .ci-ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; }
.stepper button {
  width: 30px; height: 30px; border: 0; background: none; color: var(--text-2);
  font-size: 15px; line-height: 1; border-radius: 50%;
}
.stepper button:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.stepper span { min-width: 26px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }

.mini-select {
  height: 30px; padding: 0 26px 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--ink-2) ;
  font-size: 12px; color: var(--text-2);
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 13px, calc(100% - 11px) 13px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.sum-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.sum-row.total { margin: 14px 0 18px; font-size: 15px; color: var(--text); font-weight: 600; }
.sum-row.total b { font-size: 24px; letter-spacing: -0.02em; }
.sum-row .off { color: var(--mint); }

.empty { text-align: center; padding: 60px 20px; color: var(--text-3); font-size: 13.5px; }
.empty .big { font-size: 34px; margin-bottom: 12px; opacity: 0.5; }

/* -------------------------------------------------------------------- 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--ink-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); color: var(--text);
  transition: 0.18s var(--ease);
}
textarea.input { height: auto; padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.6; }
select.input { -webkit-appearance: none; appearance: none; }
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: rgba(76, 201, 240, 0.6); background: var(--ink-3); outline: none; }

.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 12.5px;
  margin-bottom: 14px; border: 1px solid transparent;
}
.alert.err { background: rgba(242, 105, 143, 0.12); border-color: rgba(242, 105, 143, 0.32); color: #ffc0d0; }
.alert.ok { background: rgba(61, 220, 151, 0.12); border-color: rgba(61, 220, 151, 0.3); color: #a9f2cf; }
.alert.info { background: rgba(76, 201, 240, 0.1); border-color: rgba(76, 201, 240, 0.26); color: #b6e6f8; }
.alert.warn { background: rgba(246, 201, 92, 0.1); border-color: rgba(246, 201, 92, 0.3); color: #f7dfa6; }

/* -------------------------------------------------------------- 支付/结算 */
.pay-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px; align-items: start; }
.panel {
  padding: 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
}
.panel h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.panel .sub { margin: 0 0 20px; font-size: 12.5px; color: var(--text-3); }

.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.net {
  text-align: left; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
  transition: 0.18s var(--ease);
}
.net:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.05); }
.net.on { border-color: rgba(61, 220, 151, 0.6); background: rgba(61, 220, 151, 0.08); }
.net strong { display: block; font-size: 13.5px; font-weight: 600; }
.net span { font-size: 11.5px; color: var(--text-3); }
.net .chain { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--cyan); }

.addr-box {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2); background: var(--ink);
}
.addr-box code { flex: 1; font-size: 12.5px; word-break: break-all; color: #d7f7e8; }

.pay-scan {
  display: flex; align-items: center; gap: 22px;
  margin: 4px 0 18px; flex-wrap: wrap;
}
.pay-qr {
  width: 168px; height: 168px; padding: 10px;
  background: #fff; border-radius: 14px; flex-shrink: 0;
}
.pay-qr img { width: 100%; height: 100%; display: block; }
.pay-scan-meta { flex: 1; min-width: 180px; }
.pay-scan-meta p { margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.pay-remain {
  margin-top: 10px; font-size: 13px; color: var(--amber); font-variant-numeric: tabular-nums;
}

.pill.expired { background: rgba(255, 255, 255, 0.06); color: var(--text-3); border-color: var(--line); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-3); }
.kv .v { text-align: right; }

.amount-hero {
  display: flex; align-items: baseline; gap: 8px;
  padding: 18px 0 4px;
}
.amount-hero b { font-size: 40px; font-weight: 600; letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--mint), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.amount-hero span { color: var(--text-2); font-size: 14px; }

/* -------------------------------------------------------------- token 展示 */
.token-card {
  padding: 18px; border-radius: var(--radius-sm);
  border: 1px solid rgba(61, 220, 151, 0.3);
  background: linear-gradient(140deg, rgba(61, 220, 151, 0.07), rgba(76, 201, 240, 0.04));
  margin-bottom: 12px;
}
.token-card .tc-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.token-card h4 { margin: 0; font-size: 14px; font-weight: 600; }
.token-card .tc-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.token-val {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line);
}
.token-val code { flex: 1; font-size: 12px; word-break: break-all; color: var(--mint); letter-spacing: 0.02em; }

/* -------------------------------------------------------------------- 表格 */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 13px 16px; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
  background: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.pill.pending { background: rgba(246, 201, 92, 0.13); color: #f7dfa6; border-color: rgba(246, 201, 92, 0.3); }
.pill.submitted { background: rgba(76, 201, 240, 0.13); color: #b6e6f8; border-color: rgba(76, 201, 240, 0.3); }
.pill.paid { background: rgba(61, 220, 151, 0.13); color: #a9f2cf; border-color: rgba(61, 220, 151, 0.3); }
.pill.cancelled { background: rgba(255, 255, 255, 0.06); color: var(--text-3); border-color: var(--line); }

/* ------------------------------------------------------------------- Toast */
.toasts {
  position: fixed; z-index: 90; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: 10px; pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: 999px; font-size: 13px;
  background: rgba(20, 23, 31, 0.97); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); animation: toast-in 0.28s var(--ease);
  max-width: 82vw;
}
.toast.ok { border-color: rgba(61, 220, 151, 0.45); }
.toast.err { border-color: rgba(242, 105, 143, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------------ 页脚 */
footer.site {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0;
  color: var(--text-3); font-size: 12.5px;
}
footer.site .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

/* --------------------------------------------------------------- 后台布局 */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-side {
  border-right: 1px solid var(--line); background: var(--ink-1);
  padding: 24px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
}
.admin-side .brand { padding: 0 10px 22px; }
.admin-side button.navi {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--text-2); font-size: 13.5px; text-align: left; width: 100%;
  transition: 0.18s var(--ease);
}
.admin-side button.navi:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.admin-side button.navi.on { background: rgba(255, 255, 255, 0.09); color: var(--text); font-weight: 600; }
.admin-main { padding: 30px 34px 60px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -0.02em; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
}
.stat span { font-size: 12px; color: var(--text-3); }
.stat b { display: block; margin-top: 6px; font-size: 27px; font-weight: 600; letter-spacing: -0.02em; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 620px) { .form-grid .span-2 { grid-column: span 1; } }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.switch input { width: 16px; height: 16px; accent-color: var(--mint); }

.login-center { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }

/* --------------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .pay-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .admin-side .brand { width: 100%; padding-bottom: 12px; }
  .admin-side button.navi { width: auto; }
  .admin-main { padding: 22px 18px 50px; }
}
@media (max-width: 680px) {
  .topbar .wrap { height: 60px; gap: 12px; }
  .nav { display: none; }
  .nav.mobile-on {
    display: flex; position: fixed; top: 60px; left: 0; right: 0;
    background: var(--ink-1); border-bottom: 1px solid var(--line);
    padding: 10px; gap: 6px; z-index: 39; overflow-x: auto;
  }
  .hero { padding: 60px 0 30px; }
  .section { padding: 48px 0; }
  .icon-btn .lbl { display: none; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 640px; }
}

/* --------------------------------------------------------------- 在线客服 */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  box-shadow: 0 14px 34px -10px rgba(61, 220, 151, 0.6);
  display: grid; place-items: center;
  transition: 0.22s var(--ease);
}
.chat-fab:hover { transform: translateY(-2px) scale(1.04); }
.chat-fab-ic { font-size: 22px; line-height: 1; filter: saturate(0) brightness(0.25); }
.chat-dot {
  position: absolute; top: 4px; right: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--rose); border: 2px solid var(--ink);
}

.chat-panel {
  position: fixed; right: 24px; bottom: 90px; z-index: 81;
  width: min(374px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 140px));
  display: flex; flex-direction: column;
  background: var(--ink-1); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  overflow: hidden;
  animation: chat-in 0.24s var(--ease);
}
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.chat-panel header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}
.chat-panel header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chat-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--text-3); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 220px;
}
.chat-msg { max-width: 82%; display: flex; flex-direction: column; gap: 4px; }
.chat-msg .bubble {
  padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg .meta { font-size: 10.5px; color: var(--text-3); }
.chat-msg.from-user { align-self: flex-end; align-items: flex-end; }
.chat-msg.from-user .bubble {
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  color: #04150e; border-bottom-right-radius: 5px; font-weight: 500;
}
.chat-msg.from-admin { align-self: flex-start; }
.chat-msg.from-admin .bubble {
  background: var(--ink-3); border: 1px solid var(--line);
  color: var(--text); border-bottom-left-radius: 5px;
}
.chat-msg.is-system { align-self: stretch; max-width: 100%; }
.chat-msg.is-system .bubble {
  background: rgba(76, 201, 240, 0.08); border: 1px solid rgba(76, 201, 240, 0.22);
  color: #bfe8f7; font-size: 12.5px; border-radius: 12px;
}

.chat-foot {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px 14px; border-top: 1px solid var(--line); background: var(--ink-2);
}
.chat-input {
  flex: 1; resize: none; max-height: 96px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--ink); border: 1px solid var(--line-2); color: var(--text);
  font-size: 13px; line-height: 1.5;
}
.chat-input:focus { outline: none; border-color: rgba(76, 201, 240, 0.6); }
.chat-input::placeholder { color: var(--text-3); }

.chat-login { padding: 24px 8px; text-align: center; color: var(--text-3); font-size: 13px; }
.chat-login .btn { margin-top: 14px; }

@media (max-width: 680px) {
  .chat-fab { right: 16px; bottom: 16px; }
  .chat-panel { right: 16px; left: 16px; bottom: 80px; width: auto; }
}

/* --------------------------------------------------- 后台：客服会话布局 */
.support-layout { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.thread-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.thread {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line);
  background: var(--ink-1); color: var(--text); transition: 0.16s var(--ease);
}
.thread:last-child { border-bottom: 0; }
.thread:hover { background: rgba(255, 255, 255, 0.04); }
.thread.on { background: rgba(61, 220, 151, 0.09); }
.thread .th-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.thread .th-email { font-size: 13px; font-weight: 600; }
.thread .th-last { margin-top: 4px; font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .th-time { font-size: 10.5px; color: var(--text-3); margin-top: 4px; }
.unread-pill {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; background: var(--rose); color: #fff;
}
.support-convo { display: flex; flex-direction: column; min-height: 460px; }
.support-convo .chat-body { background: var(--ink); border-radius: var(--radius-sm); }
@media (max-width: 900px) { .support-layout { grid-template-columns: 1fr; } }

/* --------------------------------------------------- 到期提醒（我的实例） */
.exp-badge {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.exp-badge.normal  { background: rgba(255,255,255,0.06); color: var(--text-3); border-color: var(--line); }
.exp-badge.soon    { background: rgba(246,201,92,0.14); color: #f7dfa6; border-color: rgba(246,201,92,0.4); }
.exp-badge.urgent  { background: rgba(242,105,143,0.16); color: #ffb9cc; border-color: rgba(242,105,143,0.5); }
.exp-badge.expired { background: rgba(255,255,255,0.05); color: var(--text-3); border-color: var(--line); }

/* 卡片按档位强调左边框 */
.token-card.exp-soon   { border-color: rgba(246,201,92,0.45); box-shadow: inset 3px 0 0 var(--amber); }
.token-card.exp-urgent { border-color: rgba(242,105,143,0.55); box-shadow: inset 3px 0 0 var(--rose); }
.token-card.exp-expired { opacity: 0.72; }
.token-card.exp-expired code { color: var(--text-3); }

/* 导航项到期角标 */
.nav-badge {
  min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--rose); color: #fff; vertical-align: middle;
}

/* --------------------------------------------------- 批量续费（选择与操作条） */
.sel-box {
  display: flex; align-items: center; padding-right: 4px; cursor: pointer;
}
.sel-box input {
  width: 17px; height: 17px; accent-color: var(--mint); cursor: pointer;
}
.token-card.sel-on {
  border-color: rgba(61,220,151,0.55);
  box-shadow: inset 3px 0 0 var(--mint), 0 0 0 1px rgba(61,220,151,0.25);
}
/* 选中态与到期档位边框并存时，选中优先 */
.token-card.sel-on.exp-urgent, .token-card.sel-on.exp-soon {
  box-shadow: inset 3px 0 0 var(--mint);
}

.batch-bar {
  position: sticky; bottom: 16px; z-index: 30;
  margin-top: 14px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(20,23,31,0.97); border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: toast-in 0.24s var(--ease);
}
.batch-bar > span { font-size: 13.5px; font-weight: 600; }

/* 已释放实例：明显弱化，禁止操作感 */
.token-card.inst-released { opacity: 0.55; border-style: dashed; }
.token-card.inst-released h4 { text-decoration: line-through; text-decoration-color: var(--text-3); }

/* --------------------------------------------------- 闲置退出提醒 / 系统通知 */
.idle-warn {
  position: fixed; z-index: 95; left: 50%; top: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px; border-radius: 999px;
  background: rgba(28, 20, 24, 0.97);
  border: 1px solid rgba(246, 201, 92, 0.5);
  box-shadow: var(--shadow); font-size: 13px; color: #f7dfa6;
  animation: chat-in 0.24s var(--ease); max-width: 92vw;
}
.idle-warn[hidden] { display: none; }

/* 客服里的系统通知气泡：与人工对话区分 */
.chat-msg.is-sysnotice { align-self: stretch; max-width: 100%; }
.chat-msg.is-sysnotice .bubble {
  background: rgba(246, 201, 92, 0.08);
  border: 1px solid rgba(246, 201, 92, 0.28);
  color: #f7dfa6; border-radius: 12px; font-size: 12.5px;
}
.sys-tag {
  display: inline-block; margin-bottom: 4px; padding: 1px 8px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: rgba(246, 201, 92, 0.18); color: #f7dfa6;
}

/* ------------------------------------------------ 助记词一次性展示弹层 */
.mn-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3, 4, 7, 0.86); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 24px; overflow: auto;
}
.mn-modal {
  width: min(560px, 100%); padding: 26px;
  background: var(--ink-1); border: 1px solid rgba(242, 105, 143, 0.4);
  border-radius: 20px; box-shadow: var(--shadow);
}
.mn-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 14px; border-radius: 12px;
  background: var(--ink); border: 1px dashed var(--line-2);
}
@media (max-width: 520px) { .mn-grid { grid-template-columns: repeat(2, 1fr); } }
.mn-word {
  display: flex; align-items: center; gap: 7px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 13px; color: var(--text);
}
.mn-word span {
  min-width: 20px; text-align: right;
  font-size: 10.5px; color: var(--text-3);
}
