/* ==========================================================================
   鲸落接码 · 设计系统
   --------------------------------------------------------------------------
   灵感来自射频仪器的读数面板：近黑底 + 薄荷信号绿 + 精密等宽数字
   ========================================================================== */

@import url('/assets/css/fonts.css');
@import url('/assets/css/navigation.css');

:root {
  /* ---- 底色层级 ---- */
  --bg-0: #08090B;
  --bg-1: #0C0E11;
  --bg-2: #111418;
  --bg-3: #171B21;
  --bg-4: #1E242B;

  /* ---- 描边 ---- */
  --line-1: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.10);
  --line-3: rgba(255, 255, 255, 0.16);

  /* ---- 文字 ---- */
  --fg-1: #F2F5F7;
  --fg-2: #A8B2BD;
  --fg-3: #6D7885;
  --fg-4: #484F58;

  /* ---- 信号色 ---- */
  --sig: #3DDC97;
  --sig-dim: #2AA877;
  --sig-glow: rgba(61, 220, 151, 0.14);
  --sig-line: rgba(61, 220, 151, 0.32);

  /* ---- 状态色 ---- */
  --warn: #F0B429;
  --warn-glow: rgba(240, 180, 41, 0.14);
  --danger: #F2555A;
  --danger-glow: rgba(242, 85, 90, 0.14);
  --info: #5AA9F0;
  --info-glow: rgba(90, 169, 240, 0.14);
  --info-line: rgba(90, 169, 240, 0.22);
  --violet: #8B7BFF;

  /* ---- 圆角 ---- */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 20px;
  --r-full: 999px;

  /* ---- 字体 ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

  /* ---- 阴影 ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.75);

  --header-h: 64px;
  --max-w: 1200px;

  /* ---- 语义提示文字色（随主题变化） ---- */
  --alert-info-fg: #B9D9F5;
  --alert-warn-fg: #F5DCA0;
  --alert-danger-fg: #F7B9BB;
  --alert-sig-fg: #A9F0D2;

  /* ---- 顶栏底色（半透明，配合毛玻璃） ---- */
  --header-bg: rgba(8, 9, 11, 0.78);

  /* ---- 主题相关派生量 ---- */
  --term-key: #8B7BFF;
  --code-fn: #8B7BFF;
  --code-str: #A9F0D2;
  --code-key: #5AA9F0;
  --shadow-color: 0 0 0;
  --on-sig: #04140D;          /* 信号色上的文字色 */
  --surface-blur: 12px;

  /* ---- 悬停与叠加层（深色主题是白色微光，浅色主题是黑色微影） ---- */
  --hover-1: rgba(255, 255, 255, 0.05);
  --hover-2: rgba(255, 255, 255, 0.08);
  --hover-row: rgba(255, 255, 255, 0.022);
  --hover-head: rgba(255, 255, 255, 0.012);
  --btn-inset: rgba(255, 255, 255, 0.3);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 背景噪点 + 光晕 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(61, 220, 151, 0.09), transparent 70%),
    radial-gradient(700px 420px at 88% 6%, rgba(139, 123, 255, 0.06), transparent 68%);
}

body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }

::selection { background: rgba(61, 220, 151, 0.28); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: var(--r-full);
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* ============================ 排版 ============================ */
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
h1 { font-size: clamp(30px, 4.4vw, 52px); letter-spacing: -0.035em; }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: 17px; }
p { margin: 0; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-2); }
.dim { color: var(--fg-3); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.sig { color: var(--sig); }
.warn-t { color: var(--warn); }
.danger-t { color: var(--danger); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ============================ 布局 ============================ */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-wide { max-width: 1440px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.section { padding: 88px 0; }
.section-sm { padding: 56px 0; }

/* ============================ 顶栏 ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line-1);
}
.site-header .wrap { display: flex; align-items: center; gap: 32px; height: 100%; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--sig), var(--sig-dim));
  color: var(--on-sig);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.4), 0 6px 18px -6px rgba(61, 220, 151, 0.55);
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 7px 13px;
  border-radius: var(--r-1);
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: color .16s, background .16s;
}
.nav a:hover { color: var(--fg-1); background: var(--hover-1); }
.nav a.active { color: var(--sig); background: var(--sig-glow); }

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

/* 窄屏顶栏：把「返回前台 / 退出」收进右侧，不跟站名抢一行。
   不处理的后果是整站每一页都在 390px 上横向溢出（实测撑到 411px）——
   页面能滚动但右边永远差一截，看起来就是「布局坏了」。
   做法是让顶栏内的 wrap 允许换行 + 缩小间距，站名与徽标可被压缩。 */
@media (max-width: 520px) {
  .site-header .wrap {
    gap: 8px !important;
    padding-left: 12px;
    padding-right: 12px;
  }
  .site-header .brand { min-width: 0; }
  /* 站名文字在极窄屏让位给操作按钮，只留 logo 方块 */
  .site-header .brand > span:not(.brand-mark) { display: none; }
  .site-header .header-actions { gap: 6px; min-width: 0; }
  .site-header .header-actions .tiny { display: none; }
  .site-header .btn-sm { padding: 0 9px; font-size: 12px; }
}

.balance-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--bg-2);
  font-size: 13px;
  transition: border-color .16s, background .16s;
}
.balance-pill:hover { border-color: var(--sig-line); background: var(--bg-3); }
.balance-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sig);
  box-shadow: 0 0 0 3px var(--sig-glow);
}

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: var(--bg-3);
  color: var(--fg-1);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .16s, border-color .16s, transform .1s, box-shadow .16s;
}
.btn:hover { background: var(--bg-4); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, #46E7A4, var(--sig));
  border-color: transparent;
  color: var(--on-sig);
  font-weight: 600;
  box-shadow: 0 1px 0 var(--btn-inset) inset, 0 8px 24px -10px rgba(61, 220, 151, 0.7);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #5AF0B0, #43E5A2);
  box-shadow: 0 1px 0 var(--btn-inset) inset, 0 10px 30px -8px rgba(61, 220, 151, 0.85);
}
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--hover-1); }
.btn-danger { color: var(--danger); border-color: rgba(242, 85, 90, 0.3); background: var(--danger-glow); }
.btn-danger:hover { background: rgba(242, 85, 90, 0.22); border-color: rgba(242, 85, 90, 0.5); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-1); }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; border-radius: var(--r-3); }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

.btn-link {
  background: none; border: none; padding: 0;
  color: var(--sig); font-size: 13px; font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  padding: 20px;
}
.card-tight { padding: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-hover { transition: border-color .2s, transform .2s, box-shadow .2s; }
.card-hover:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-1);
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-body { padding: 20px; }
.card-body-tight { padding: 14px 16px; }

/* 高亮卡片（带渐变描边） */
.card-accent {
  position: relative;
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
    linear-gradient(140deg, rgba(61, 220, 151, 0.5), rgba(61, 220, 151, 0.05) 40%, rgba(139, 123, 255, 0.25)) border-box;
  border: 1px solid transparent;
}

/* ============================ 表单 ============================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  letter-spacing: 0.01em;
}
.field .hint { font-size: 11.5px; color: var(--fg-3); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  color: var(--fg-1);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--fg-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--sig-line);
  box-shadow: 0 0 0 3px var(--sig-glow);
  background: var(--bg-2);
}
.input:disabled { opacity: .5; cursor: not-allowed; }
.input-mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236D7885' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

/* 带勾选框的一行（用于开关类选项）。
   原生 checkbox 用 accent-color 跟随主题，不自己画 —— 自己画就失去了
   键盘焦点、读屏器语义、以及不同系统的习惯手感。 */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--fg-1);
  line-height: 1.55;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: var(--bg-2);
  transition: border-color .16s, background .16s;
}
.check-row:hover { border-color: var(--line-3); background: var(--hover-1); }
.check-row input[type="checkbox"] {
  /* 顶到第一行文字的基线上，多行文字时勾选框不会被拉到中间 */
  margin: 2px 0 0;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--sig);
  cursor: pointer;
}
.check-row > span { min-width: 0; }

/* 可折叠说明块。
   用于「原理是什么」「怎么对接」这类长文 —— 默认收起，
   不让它们把表单里真正要填的字段挤出可视区。
   用原生 <details>，键盘（Enter/Space）与读屏器都天然支持，
   不自己用 div+click 模拟。 */
.det {
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: var(--bg-1);
  overflow: hidden;
}
.det > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--fg-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: color .16s, background .16s;
}
.det > summary::-webkit-details-marker { display: none; }
.det > summary::before {
  content: '';
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .16s;
  flex-shrink: 0;
  margin-left: 2px;
}
.det[open] > summary::before { transform: rotate(45deg); }
.det > summary:hover { color: var(--fg-1); background: var(--hover-1); }
.det[open] > summary { border-bottom: 1px solid var(--line-1); }
.det-body {
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--fg-3);
  /* 长文横向不能撑破，代码块自己会滚 */
  min-width: 0;
}
.det-body > * + * { margin-top: 10px; }
.det-body p { margin: 0; }

/* ---------------------------- 安全画像 ----------------------------
   用户详情里的「最近 IP / IP 来源 / 最近设备 / 累计去重」四个小格。
   单独一套而不是复用 .kpi-row：那边的字号是给页面级大数字用的，
   这里是弹窗内的辅助信息，用同样的字号会把正文压得看不见。 */
.sec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.sec-cell {
  padding: 9px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  /* grid 子项必写，否则长 IP / 长设备名会把格子撑破 */
  min-width: 0;
}

/* 安全防护页的类型分布条 */
.sec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 代码/密钥展示 */
.code-box {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-1);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-2);
  padding: 10px 12px;
  color: var(--sig);
  word-break: break-all;
  line-height: 1.7;
}

/* ============================ 徽章 ============================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--r-1);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-sig { color: var(--sig); background: var(--sig-glow); border-color: rgba(61, 220, 151, 0.25); }
.badge-warn { color: var(--warn); background: var(--warn-glow); border-color: rgba(240, 180, 41, 0.25); }
.badge-danger { color: var(--danger); background: var(--danger-glow); border-color: rgba(242, 85, 90, 0.25); }
.badge-info { color: var(--info); background: var(--info-glow); border-color: rgba(90, 169, 240, 0.25); }
.badge-dim { color: var(--fg-2); background: var(--hover-1); border-color: var(--line-1); }

.badge-dot::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px currentColor;
  opacity: .9;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* ============================ 表格 ============================ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line-1);
  white-space: nowrap;
  background: var(--hover-head);
}
table.tbl td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-1);
  color: var(--fg-2);
  vertical-align: middle;
}
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--hover-row); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.strong { color: var(--fg-1); font-weight: 500; }

/* ============================ 商城卡片 ============================ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 12px;
}
.proj {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, transform .18s, background .18s;
}
.proj::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 90px at 50% 0%, rgba(61, 220, 151, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.proj:hover { border-color: var(--sig-line); transform: translateY(-2px); background: var(--bg-3); }
.proj:hover::after { opacity: 1; }
.proj.selected {
  border-color: var(--sig);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px var(--sig-glow);
}
.proj-top { display: flex; align-items: flex-start; gap: 10px; }
.proj-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-1);
}
.proj-name { font-size: 14px; font-weight: 600; color: var(--fg-1); }
.proj-meta { font-size: 11.5px; color: var(--fg-3); margin-top: 1px; }
.proj-price {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--sig);
  letter-spacing: -0.02em;
}
.proj-price .unit { font-size: 11px; color: var(--fg-3); font-weight: 400; letter-spacing: 0; }
.proj-hot {
  position: absolute; top: 0; right: 0;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--on-sig);
  background: linear-gradient(135deg, var(--warn), #F5CE63);
  border-bottom-left-radius: 8px;
}

/* ============================ 状态点 ============================ */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { color: var(--warn); }
.status-pending::before { animation: pulse 1.4s ease-in-out infinite; }
.status-received { color: var(--sig); }
.status-refunded { color: var(--fg-3); }
.status-failed { color: var(--danger); }

/* ============================ 统计 ============================ */
.stat {
  padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
}
.stat-label {
  font-size: 11.5px;
  color: var(--fg-3);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stat-value {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-sub { margin-top: 3px; font-size: 11.5px; color: var(--fg-3); }

/* ============================ 空态 ============================ */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--fg-3);
}
.empty-icon {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  color: var(--fg-4);
}

/* ============================ 加载 ============================ */
/* 切页进度条：细信号线沿顶部推进，替代整片白屏 */
.page-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 9000;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}
.page-progress::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, var(--sig), transparent);
  animation: pageSweep .9s cubic-bezier(.3,.7,.4,1) infinite;
}
@keyframes pageSweep {
  0%   { left: -34%; }
  100% { left: 100%; }
}

/* 切页期间旧内容保持可见，仅轻微降透明度，不出现空白帧 */
#page-body.is-swapping { opacity: .55; transition: opacity .12s ease; }

/* 新视图就绪后淡入并轻微上浮 */
.view-in { animation: viewIn .24s cubic-bezier(.2,.8,.3,1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--line-2);
  border-top-color: var(--sig);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-2);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================ Toast ============================ */
.toast-host {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--sig);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--fg-1);
  pointer-events: auto;
  animation: toastIn .26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  backdrop-filter: blur(12px);
}
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast.leaving { animation: toastOut .2s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(16px) scale(.97); }
}

/* ============================ 弹窗 ============================ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 5, 6, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-lg);
  animation: modalIn .24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}
.modal-wide { max-width: 760px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line-1);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-x {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: none; border-radius: var(--r-1);
  background: transparent;
  color: var(--fg-3);
  font-size: 18px;
  line-height: 1;
}
.modal-x:hover { background: var(--hover-2); color: var(--fg-1); }

/* ============================ 页脚 ============================ */
.site-footer {
  border-top: 1px solid var(--line-1);
  padding: 40px 0 32px;
  margin-top: 40px;
  background: var(--bg-1);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-col h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  margin-bottom: 12px;
  font-weight: 600;
}
.footer-col a, .footer-col span {
  display: block;
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 8px;
  transition: color .14s;
}
.footer-col a:hover { color: var(--sig); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line-1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--fg-4);
}

/* ============================ 控制台布局 ============================ */
.console {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}
.sidebar {
  border-right: 1px solid var(--line-1);
  padding: 20px 12px;
  background: var(--bg-1);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.side-group { margin-bottom: 22px; }
.side-title {
  padding: 0 10px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.side-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-1);
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .14s, color .14s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.side-item:hover { background: var(--hover-1); color: var(--fg-1); }
.side-item.active { background: var(--sig-glow); color: var(--sig); }
.side-item .ico { width: 16px; height: 16px; flex-shrink: 0; opacity: .9; }

.page-head {
  padding: 26px 32px;
  border-bottom: 1px solid var(--line-1);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; letter-spacing: -0.02em; }
.page-head .sub { font-size: 13px; color: var(--fg-3); margin-top: 3px; }
.page-body { padding: 26px 32px 60px; }

/* ============================ 取码面板 ============================ */
.code-display {
  position: relative;
  padding: 24px;
  border-radius: var(--r-3);
  background:
    radial-gradient(360px 140px at 50% 0%, rgba(61, 220, 151, 0.1), transparent 72%),
    var(--bg-1);
  border: 1px solid var(--line-2);
  text-align: center;
  overflow: hidden;
}
.code-display::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sig), transparent);
  opacity: .6;
}
.code-value {
  font-family: var(--font-mono);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--sig);
  text-shadow: 0 0 40px rgba(61, 220, 151, 0.45);
  font-variant-numeric: tabular-nums;
}
.code-value.idle {
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--fg-3);
  text-shadow: none;
  font-weight: 500;
}

/* 波形动画 */
.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 26px;
}
.wave i {
  width: 2.5px;
  border-radius: 2px;
  background: var(--sig);
  opacity: .55;
  animation: waveA 1.2s ease-in-out infinite;
}
.wave i:nth-child(1) { height: 8px;  animation-delay: 0s; }
.wave i:nth-child(2) { height: 15px; animation-delay: .12s; }
.wave i:nth-child(3) { height: 22px; animation-delay: .24s; }
.wave i:nth-child(4) { height: 13px; animation-delay: .36s; }
.wave i:nth-child(5) { height: 18px; animation-delay: .48s; }
.wave i:nth-child(6) { height: 9px;  animation-delay: .6s; }
@keyframes waveA {
  0%, 100% { transform: scaleY(0.45); opacity: .4; }
  50% { transform: scaleY(1); opacity: .9; }
}

/* 计时环 */
.timer-ring { position: relative; width: 46px; height: 46px; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-1);
}

/* ============================ 标签页 ============================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line-1);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 9px 14px;
  border: none;
  background: none;
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .14s, border-color .14s;
}
.tab:hover { color: var(--fg-1); }
.tab.active { color: var(--sig); border-bottom-color: var(--sig); }

/* 分段控件 */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  gap: 2px;
}
.segmented button {
  padding: 5px 12px;
  border: none;
  background: none;
  border-radius: var(--r-1);
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: background .14s, color .14s;
}
.segmented button.active { background: var(--bg-4); color: var(--fg-1); }

/* ============================ 筛选条 ============================
   后台每个列表页顶部那一条「搜索框 + 分段筛选」。原本直接用 .row，
   但 .row 是 nowrap：手机上一行塞不下，它不会换行，而是把整个文档撑宽
   —— 实测 390px 视口下「用户管理」被撑到 499px、「审计日志」482px。
   这里单列一套：
     · flex-wrap 允许折到第二行；
     · 子项 min-width:0，输入框才能在容器里真正收窄；
     · 输入框的固定 width 只在宽屏生效，窄屏交给 flex 分配。
   ================================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.filter-bar > * { min-width: 0; }

@media (max-width: 620px) {
  /* 窄屏：下拉与搜索框各占满一行，分段筛选整体横向滚动（内部滚动不撑文档） */
  .filter-bar { gap: 8px; width: 100%; }
  .filter-bar .input,
  .filter-bar .select { width: 100% !important; flex: 1 1 100%; }
  .filter-bar .segmented { max-width: 100%; overflow-x: auto; }
}

/* ============================ 分页 ============================ */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 0;
  font-size: 12.5px;
  color: var(--fg-3);
  /* 窄屏上「共 N 条」与页码按钮放不下一行时要能折行，
     否则按钮组会顶出容器、把整页撑宽（320px 下实测文档 381px）。 */
  flex-wrap: wrap;
}
.pager-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================ 提示条 ============================ */
.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-2);
  font-size: 13px;
  border: 1px solid;
  line-height: 1.55;
}
.alert-info { background: var(--info-glow); border-color: rgba(90, 169, 240, 0.22); color: var(--alert-info-fg); }
.alert-warn { background: var(--warn-glow); border-color: rgba(240, 180, 41, 0.22); color: var(--alert-warn-fg); }
.alert-danger { background: var(--danger-glow); border-color: rgba(242, 85, 90, 0.22); color: var(--alert-danger-fg); }
.alert-sig { background: var(--sig-glow); border-color: rgba(61, 220, 151, 0.22); color: var(--alert-sig-fg); }

/* ============================ 工具类 ============================ */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.divider { height: 1px; background: var(--line-1); margin: 16px 0; }

/* 复制按钮反馈 */
.copied { color: var(--sig) !important; }

/* ============================ 响应式 ============================ */
@media (max-width: 1024px) {
  .console { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line-1);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 12px;
    /* flex 容器必须能收缩，否则子项按内容宽撑开，整个文档跟着变宽 */
    min-width: 0;
    /* 横向滚动的容器自己滚，不要影响外层 */
    max-width: 100%;
  }
  .side-group { margin: 0; display: flex; gap: 4px; flex-shrink: 0; }
  .side-title { display: none; }
  .side-item { white-space: nowrap; flex-shrink: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .page-body, .page-head { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .wrap { padding: 0 16px; }
  .section { padding: 56px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .proj { padding: 13px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .toast-host { left: 12px; right: 12px; max-width: none; }
  .page-body, .page-head { padding-left: 16px; padding-right: 16px; }
  .stat-value { font-size: 22px; }
  table.tbl th, table.tbl td { padding: 10px 10px; }
}

/* 窄屏全局兜底：所有横向排列的行都允许折行。
   .row / .row-between 原本是 nowrap，宽度不够时不会折，而是直接顶出容器
   —— 这是 320~390px 下页面被撑宽的最常见原因。这里统一放开，
   再配合子项 min-width:0，输入框与长文本才能真正在容器内收窄。 */
@media (max-width: 620px) {
  .row, .row-between { flex-wrap: wrap; }
  .row > *, .row-between > * { min-width: 0; }
  /* 行内按钮组（详情/导出/对账单这类）同样允许折 */
  .row .btn, .row-between .btn { flex-shrink: 0; }
}
/* ==========================================================================
   首页专用
   ========================================================================== */

.hero { padding: 76px 0 64px; overflow: hidden; }
.hero-inner { max-width: 640px; }
.hero-badge { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }

.hero-title {
  font-size: clamp(38px, 5.6vw, 66px);
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin-bottom: 20px;
}
.hero-title .grad {
  background: linear-gradient(100deg, #3DDC97 0%, #6CF0BE 40%, #8B7BFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 浅色主题：浅绿+浅紫在白底上几乎看不见，改用实色渐变 */
:root[data-theme="light"] .hero-title .grad {
  background: linear-gradient(100deg, #0E7A55 0%, #12996A 45%, #6247D6 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-sub {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--fg-2);
  max-width: 500px;
  margin-bottom: 30px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-meta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-meta-item { display: flex; flex-direction: column; gap: 2px; }
.hero-num {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg-1);
  line-height: 1.1;
}
.hero-num .plus, .hero-num .unit { font-size: 15px; color: var(--sig); margin-left: 2px; }
.hero-divider { width: 1px; height: 30px; background: var(--line-2); }

/* 终端可视化 */
.hero-visual {
  position: absolute;
  right: -20px;
  top: 96px;
  width: 420px;
  opacity: .96;
  pointer-events: none;
}
.hero .wrap { position: relative; }

.terminal {
  background: linear-gradient(180deg, rgba(23, 27, 33, 0.96), rgba(12, 14, 17, 0.98));
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line-1);
  backdrop-filter: blur(10px);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-1);
  background: var(--hover-1);
}
.term-dot { width: 9px; height: 9px; border-radius: 50%; opacity: .85; }
.term-title { margin-left: auto; font-size: 10.5px; color: var(--fg-4); letter-spacing: 0.04em; }
.term-body { padding: 18px; font-size: 12px; line-height: 1.95; }
.term-line { white-space: nowrap; }
.term-gap { height: 10px; }
.term-key { color: var(--term-key); }
/* 中文标签用正文字体，等宽字体不含中文字形 */
.term-key:not(:lang(en)) { font-family: var(--font-sans); font-weight: 500; letter-spacing: 0; }
.term-op { color: var(--fg-4); }
.term-val { color: var(--fg-2); }
.term-code {
  color: var(--sig);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(61, 220, 151, 0.6);
}
.term-progress .sig { letter-spacing: 0; }

/* 区块标题 */
.sec-head { margin-bottom: 36px; }
.sec-head.center { text-align: center; }
.sec-label {
  display: block;
  font-size: 11px;
  color: var(--sig);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.sec-sub { margin-top: 10px; font-size: 14px; }
.section-tight { padding: 40px 0 88px; }

/* 能力卡片 */
.feat-grid { gap: 14px; }
.feat {
  padding: 22px 20px;
  border-radius: var(--r-3);
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  transition: border-color .2s, transform .2s;
}
.feat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.feat-ico {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--sig-glow);
  border: 1px solid rgba(61, 220, 151, 0.2);
  color: var(--sig);
  margin-bottom: 16px;
}
.feat h3 { font-size: 15px; margin-bottom: 7px; }
.feat p { font-size: 12.5px; line-height: 1.75; color: var(--fg-3); }

/* 流程 */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  overflow: hidden;
}
.step {
  padding: 28px 22px;
  background: var(--bg-2);
  position: relative;
  transition: background .2s;
}
.step:hover { background: var(--bg-3); }
.step-num {
  font-size: 12px;
  color: var(--sig);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  opacity: .8;
}
.step h4 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 12.5px; line-height: 1.7; }

/* 开发者面板 */
.dev-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
  border-radius: var(--r-4);
  background:
    radial-gradient(560px 240px at 10% 0%, rgba(61, 220, 151, 0.08), transparent 70%),
    var(--bg-2);
  border: 1px solid var(--line-1);
  align-items: center;
}
.dev-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 26px; }
.dev-feat { font-size: 12.5px; color: var(--fg-2); display: flex; gap: 7px; align-items: center; }

.code-preview {
  margin: 0;
  padding: 20px 22px;
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  font-size: 11.5px;
  line-height: 1.85;
  overflow-x: auto;
  color: var(--fg-2);
  white-space: pre;
}
.c-cmt { color: var(--fg-4); }
.c-fn { color: var(--code-fn); }
.c-str { color: var(--code-str); }
.c-key { color: var(--code-key); }
.c-num { color: var(--warn); }

/* CTA 条 */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 34px 40px;
  border-radius: var(--r-4);
  background:
    linear-gradient(100deg, rgba(61, 220, 151, 0.13), rgba(139, 123, 255, 0.08)),
    var(--bg-2);
  border: 1px solid rgba(61, 220, 151, 0.22);
}

/* 公告位 */
.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 8px;
  border-radius: var(--r-2);
  background: var(--info-glow);
  border: 1px solid var(--info-line);
  font-size: 13px;
  color: var(--alert-info-fg);
}

@media (max-width: 1180px) {
  .hero-visual { width: 340px; right: -60px; opacity: .35; }
}
@media (max-width: 900px) {
  .hero-visual { display: none; }
  .dev-panel { grid-template-columns: 1fr; gap: 26px; padding: 26px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .hero-meta { gap: 16px; }
  .hero-num { font-size: 24px; }
}

/* ==========================================================================
   认证页
   ========================================================================== */

.auth-body { min-height: 100vh; }
.auth-main {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 40px 20px 60px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 34px 32px 26px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sig), transparent);
  opacity: .7;
}
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand { margin-bottom: 16px; }
.auth-title { font-size: 23px; letter-spacing: -0.02em; }
.auth-sub { margin-top: 5px; font-size: 13px; color: var(--fg-3); }

.pw-toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; border-radius: var(--r-1);
  background: transparent;
  color: var(--fg-3);
}
.pw-toggle:hover { color: var(--fg-1); background: var(--hover-1); }

.pw-meter { display: flex; gap: 4px; margin-top: 6px; }
.pw-meter i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--bg-4);
  transition: background .24s;
}
.pw-meter.s1 i:nth-child(1) { background: var(--danger); }
.pw-meter.s2 i:nth-child(-n+2) { background: var(--warn); }
.pw-meter.s3 i:nth-child(-n+3) { background: #7BC96F; }
.pw-meter.s4 i { background: var(--sig); }

.auth-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.auth-trust {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

@media (max-width: 480px) {
  .auth-card { padding: 26px 20px 22px; border-radius: var(--r-3); }
  .auth-title { font-size: 20px; }
}

/* ==========================================================================
   取码台
   ========================================================================== */

.wb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.wb-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.wb-left { position: sticky; top: calc(var(--header-h) + 20px); }

.wb-filter { padding: 12px 12px 0; }
.wb-cats {
  display: flex;
  gap: 5px;
  padding: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-1);
  scrollbar-width: none;
}
.wb-cats::-webkit-scrollbar { display: none; }
.wb-cat {
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-1);
  background: transparent;
  color: var(--fg-2);
  font-size: 12px;
  white-space: nowrap;
  transition: all .14s;
}
.wb-cat:hover { border-color: var(--line-3); color: var(--fg-1); }
.wb-cat.active { background: var(--sig-glow); border-color: var(--sig-line); color: var(--sig); }

.wb-proj-list { max-height: 520px; overflow-y: auto; padding: 6px; }

.wb-proj {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: transparent;
  text-align: left;
  transition: background .13s, border-color .13s;
}
.wb-proj:hover { background: var(--hover-1); }
.wb-proj.active { background: var(--sig-glow); border-color: var(--sig-line); }
.wb-proj-ico {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  font-weight: 700;
}
.wb-proj.active .wb-proj-ico { background: rgba(61, 220, 151, 0.15); border-color: var(--sig-line); color: var(--sig); }
.wb-proj-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wb-proj-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-proj-sub {
  display: block;
  font-size: 11px;
  color: var(--fg-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-proj-price { font-family: var(--font-mono); font-size: 12.5px; color: var(--sig); font-weight: 600; }

.wb-panel { padding: 20px; }
.wb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-1);
}
.wb-price { text-align: right; }
.wb-price .mono { font-size: 20px; font-weight: 600; color: var(--sig); }

.wb-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.wb-phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
}

.wb-recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-1);
  font-size: 12.5px;
}
.wb-recent-row:last-child { border-bottom: none; }
.wb-recent-row .pname { flex: 1; color: var(--fg-1); font-weight: 500; }
.wb-recent-row .pcode { font-family: var(--font-mono); color: var(--sig); font-weight: 600; letter-spacing: 0.04em; }

.cat-count {
  font-size: 10px;
  color: var(--fg-4);
  margin-left: 3px;
}

@media (max-width: 900px) {
  .wb-grid { grid-template-columns: 1fr; }
  .wb-left { position: static; }
  .wb-proj-list { max-height: 240px; }
  .wb-opts { grid-template-columns: 1fr; }
}

/* ==========================================================================
   项目大厅
   ========================================================================== */

.shop-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.shop-stats { display: flex; gap: 28px; }
#submit-project-banner { flex: 1 1 100%; min-width: 0; }
.shop-stat { display: flex; flex-direction: column; gap: 1px; text-align: right; }
.shop-stat .mono { font-size: 21px; font-weight: 600; color: var(--sig); letter-spacing: -0.02em; }

.shop-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
}
.shop-cats { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; min-width: 0; }
.shop-cat {
  padding: 6px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-1);
  background: transparent;
  color: var(--fg-2);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all .14s;
}
.shop-cat:hover { border-color: var(--line-3); color: var(--fg-1); }
.shop-cat.active { background: var(--sig-glow); border-color: var(--sig-line); color: var(--sig); }

@media (max-width: 768px) {
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .shop-search-wrap { width: 100%; }
  .shop-head { margin-bottom: 18px; }
  .shop-stats { gap: 18px; }
}

/* ==========================================================================
   控制台补充
   ========================================================================== */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.tab-content { animation: tabIn .22s ease; }
@keyframes tabIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 订单卡片（移动端友好） */
.order-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-1);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.order-card:last-child { border-bottom: none; }
.order-card-main { min-width: 0; }
.order-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.order-card-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--fg-3);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.order-code {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--sig);
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .14s;
}
.order-code:hover { background: var(--sig-glow); }
.order-code-empty { font-size: 12px; color: var(--fg-4); font-family: var(--font-sans); letter-spacing: 0; }

/* 钱包统计块 */
.wallet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
}
.balance-card {
  padding: 26px;
  border-radius: var(--r-3);
  background:
    radial-gradient(420px 180px at 20% 0%, rgba(61, 220, 151, 0.14), transparent 70%),
    var(--bg-2);
  border: 1px solid rgba(61, 220, 151, 0.2);
  position: relative;
  overflow: hidden;
}
.balance-card::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(61, 220, 151, 0.12);
}
.balance-label { font-size: 12px; color: var(--fg-2); letter-spacing: 0.04em; }
.balance-value {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--sig);
  line-height: 1.1;
  text-shadow: 0 0 44px rgba(61, 220, 151, 0.32);
}
.balance-value .cur { font-size: 20px; color: var(--fg-2); margin-right: 3px; }
.balance-sub { margin-top: 12px; font-size: 12px; color: var(--fg-3); }

.wallet-mini {
  display: grid;
  gap: 12px;
  align-content: start;
}

/* 卡密输入 */
.redeem-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* API 文档代码块 */
.api-doc-section { margin-bottom: 32px; }
.api-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2) var(--r-2) 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.method {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.method-get { background: rgba(90, 169, 240, 0.16); color: var(--info); }
.method-post { background: var(--sig-glow); color: var(--sig); }
.api-body {
  border: 1px solid var(--line-1);
  border-top: none;
  border-radius: 0 0 var(--r-2) var(--r-2);
  padding: 14px;
}

pre.code-block {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-0);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  font-size: 11.5px;
  line-height: 1.8;
  overflow-x: auto;
  color: var(--fg-2);
  white-space: pre;
  font-family: var(--font-mono);
}

.api-doc-nav {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
}
.api-doc-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-1);
  font-size: 12.5px;
  color: var(--fg-2);
  border-left: 2px solid transparent;
}
.api-doc-nav a:hover { color: var(--fg-1); background: var(--hover-1); }

@media (max-width: 900px) {
  .wallet-hero { grid-template-columns: 1fr; }
  .api-doc-nav { display: none; }
}
@media (max-width: 600px) {
  .order-card { grid-template-columns: 1fr; }
  .balance-value { font-size: 32px; }
  .redeem-box { flex-direction: column; }
}

/* ==========================================================================
   文档页
   ========================================================================== */

.docs-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.docs-head { margin-bottom: 36px; padding-bottom: 26px; border-bottom: 1px solid var(--line-1); }

.doc-h2 {
  font-size: 19px;
  margin: 36px 0 14px;
  padding-top: 8px;
  scroll-margin-top: 90px;
}
.doc-h2:first-of-type { margin-top: 0; }
.doc-p { font-size: 13.5px; line-height: 1.85; color: var(--fg-2); margin-bottom: 14px; }

.doc-table td code, .doc-p code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--sig);
}

.err-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--warn);
}

@media (max-width: 1024px) {
  .docs-layout { grid-template-columns: 1fr; gap: 0; }
  .docs-head { margin-bottom: 24px; }
}

/* ==========================================================================
   溢出修复：grid / flex 子项默认 min-width:auto 会被内容撑破
   ========================================================================== */

.grid > *,
.dev-panel > *,
.wallet-hero > *,
.docs-layout > *,
.console > *,
.wb-grid > *,
.kpi-row > *,
.proj-grid > *,
.steps > * {
  min-width: 0;
}

#doc-body { min-width: 0; overflow-wrap: break-word; }

/* 文档页移动端收紧 */
@media (max-width: 640px) {
  .docs-head h1 { font-size: 24px; }
  .doc-h2 { font-size: 17px; }
  .code-block { font-size: 10.5px; }
  .doc-p, .doc-table td { font-size: 12.5px; }
  .api-endpoint { font-size: 11px; }
}

/* 首页开发者面板在窄屏的收口 */
@media (max-width: 900px) {
  .dev-feats { grid-template-columns: 1fr; }
  .code-preview { font-size: 10.5px; }
}

/* 取码台细节优化 */
.wb-cats {
  flex-wrap: wrap;
  overflow-x: visible;
  padding: 10px 12px;
}
.wb-cat { font-size: 11.5px; padding: 4px 9px; }

/* 右侧空态更紧凑，避免大片空洞 */
.wb-empty-mini { padding: 44px 20px !important; }

/* 取码过程中号码区的强调 */
#res-phone {
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}

/* ============================ 无障碍与动效降级 ============================ */
@media (prefers-reduced-motion: reduce) {
  .page-progress::after { animation: none; left: 0; width: 100%; opacity: .35; }
  .view-in { animation: none; }
  #page-body.is-swapping { opacity: 1; transition: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 键盘可达性：统一焦点圈，不破坏视觉风格 */
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sig) 70%, transparent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* ============================ 添加项目弹窗 ============================ */
.pf-field { display: flex; flex-direction: column; gap: 7px; }
.pf-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-1);
}
.pf-required {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sig);
  background: var(--sig-glow);
  border: 1px solid var(--sig-line);
  border-radius: var(--r-full);
  padding: 1px 7px;
}
.pf-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}
.pf-preview-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-1);
  background: var(--bg-3);
  border-radius: 4px;
  padding: 1px 7px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================ 关键词填写帮助 ============================ */
.kw-help {
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 14px;
  background: var(--bg-1);
}
.kw-help-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--fg-1);
}
.kw-help-rule {
  font-size: 12px;
  line-height: 1.7;
  color: var(--fg-2);
  padding: 9px 11px;
  background: var(--bg-3);
  border-radius: var(--r-1);
  margin-bottom: 12px;
}
.kw-help-rule .dim { color: var(--fg-4); }

.kw-samples { display: flex; flex-direction: column; gap: 10px; }

.kw-sample {
  border-left: 2px solid var(--sig-line);
  padding: 2px 0 2px 11px;
}
.kw-sample-bad { border-left-color: var(--line-3); }

.kw-sample-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  line-height: 1.7;
}
.kw-sample-label {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--fg-4);
  width: 52px;
}
.kw-sample-sms {
  font-size: 11.5px;
  color: var(--fg-2);
  word-break: break-word;
  min-width: 0;
}
.kw-sample-kw {
  font-size: 12px;
  font-weight: 600;
  color: var(--sig);
  background: var(--sig-glow);
  padding: 1px 7px;
  border-radius: 4px;
}
.kw-sample-none {
  font-size: 11.5px;
  color: var(--fg-4);
}
.kw-sample-tip {
  font-size: 11px;
  color: var(--fg-4);
  margin-top: 3px;
  padding-left: 60px;
}
.kw-warn { margin-top: 14px; }

/* ============================ 商城页「添加项目」入口条 ============================ */
.submit-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--r-3);
  border: 1px dashed var(--sig-line);
  background: var(--sig-glow);
}
.submit-banner > div { flex: 1 1 auto; min-width: 0; }
.submit-banner-ico {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--sig);
  color: var(--on-sig);
}
.submit-banner-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-1);
}
.submit-banner .btn { flex-shrink: 0; margin-left: auto; }

@media (max-width: 520px) {
  .submit-banner { padding: 12px 13px; }
  .submit-banner .btn { width: 100%; margin-left: 0; }
  .kw-sample-label { width: 46px; }
  .kw-sample-tip { padding-left: 54px; }
}

/* ============================ 我的项目 · 新手引导 ============================ */
.proj-guide { padding: 22px; }
.proj-guide-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.proj-guide-head h3 { margin-bottom: 0; }
.proj-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.proj-guide-step {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px;
  background: var(--bg-3);
  border-radius: var(--r-2);
  min-width: 0;
}
.proj-guide-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sig);
  color: var(--on-sig);
  font-size: 11px;
  font-weight: 700;
}
@media (max-width: 720px) {
  .proj-guide-steps { grid-template-columns: 1fr; }
  .proj-guide { padding: 16px; }
}

/* ==========================================================================
   浅色主题
   --------------------------------------------------------------------------
   不是简单反色：浅色下需要提高描边对比、降低信号色亮度（否则薄荷绿在白底
   上对比不足），并把阴影从"光晕"改为"投影"。
   ========================================================================== */
:root[data-theme="light"] {
  /* 底色层级：从近白到浅灰，越靠上层越亮 */
  --bg-0: #F7F8FA;
  --bg-1: #FFFFFF;
  --bg-2: #FFFFFF;
  --bg-3: #F1F3F6;
  --bg-4: #E6E9EF;

  /* 描边：浅色下用深色半透明才有层次 */
  --line-1: rgba(16, 24, 40, 0.07);
  --line-2: rgba(16, 24, 40, 0.12);
  --line-3: rgba(16, 24, 40, 0.20);

  /* 文字：从深到浅 */
  --fg-1: #101828;
  --fg-2: #475467;
  --fg-3: #667085;
  --fg-4: #98A2B3;

  /* 信号色：白底上需要压暗，才够对比度 */
  --sig: #12996A;
  --sig-dim: #0E7A55;
  --sig-glow: rgba(18, 153, 106, 0.10);
  --sig-line: rgba(18, 153, 106, 0.30);

  /* 状态色同步压暗 */
  --warn: #B7791F;
  --warn-glow: rgba(183, 121, 31, 0.10);
  --danger: #D92D20;
  --danger-glow: rgba(217, 45, 32, 0.09);
  --info: #1570CD;
  --info-glow: rgba(21, 112, 205, 0.09);
  --info-line: rgba(21, 112, 205, 0.24);
  --violet: #6247D6;

  /* 阴影：从深色主题的"发光"改为真实投影 */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 20px -6px rgba(16, 24, 40, 0.12);
  --shadow-lg: 0 20px 48px -16px rgba(16, 24, 40, 0.18);

  /* 提示文字 */
  --alert-info-fg: #0B4A8F;
  --alert-warn-fg: #7A5210;
  --alert-danger-fg: #A81E14;
  --alert-sig-fg: #0A6444;

  --term-key: #5B45C7;
  --code-fn: #6247D6;
  --code-str: #0A6444;
  --code-key: #1570CD;
  --on-sig: #FFFFFF;

  /* 顶栏：白毛玻璃 */
  --header-bg: rgba(255, 255, 255, 0.82);

  /* 叠加层：深色主题是白微光，浅色主题改为黑微影 */
  --hover-1: rgba(16, 24, 40, 0.045);
  --hover-2: rgba(16, 24, 40, 0.07);
  --hover-row: rgba(16, 24, 40, 0.022);
  --hover-head: rgba(16, 24, 40, 0.012);
  --btn-inset: rgba(255, 255, 255, 0.4);
}

/* 浅色主题下的个别微调 */
:root[data-theme="light"] body {
  background: var(--bg-0);
}

/* 主按钮：深色主题用亮绿+暗字，浅色主题用深绿+白字，保证对比 */
:root[data-theme="light"] .btn-primary {
  color: #FFFFFF;
  background: linear-gradient(180deg, #14A874, var(--sig));
  border-color: transparent;
}
:root[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(180deg, var(--sig), var(--sig-dim));
}

/* 信号色文字在白底上改用压暗值 */
:root[data-theme="light"] .sig { color: var(--sig); }

/* 终端：浅色下改浅底深字，避免整块黑 */
:root[data-theme="light"] .terminal {
  background: #0E1116;
}
:root[data-theme="light"] .term-body { color: var(--fg-2); }
:root[data-theme="light"] .terminal .term-line.dim,
:root[data-theme="light"] .terminal .dim { color: #7B8794; }
:root[data-theme="light"] .terminal .term-key { color: #9B8CFF; }
:root[data-theme="light"] .terminal .term-val { color: #C9D2DC; }
:root[data-theme="light"] .terminal .term-code { color: #46E0A4; }

/* 取码台号码与验证码：浅色下降低发光强度 */
:root[data-theme="light"] .code-value {
  text-shadow: 0 0 18px rgba(18, 153, 106, 0.30);
}

/* 商城卡片 hover 的径向光在浅色下会发灰，换成轻微上浮+描边 */
:root[data-theme="light"] .proj:hover {
  border-color: var(--sig-line);
  box-shadow: var(--shadow-md);
}

/* 侧栏在浅色下需要与内容区区分 */
:root[data-theme="light"] .console-side,
:root[data-theme="light"] .sidebar {
  background: var(--bg-1);
  border-right-color: var(--line-2);
}

/* ============================ 主题切换控件 ============================ */
.theme-switch {
  display: flex;
  gap: 3px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  padding: 3px;
}
.theme-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 7px;
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: var(--fg-3);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.theme-opt:hover { color: var(--fg-1); background: var(--hover-1); }
.theme-opt.active {
  background: var(--bg-1);
  color: var(--sig);
  box-shadow: var(--shadow-sm);
}
.theme-opt-ico { display: flex; align-items: center; }

/* 设置页里的宽版：三档平分，字距放松一点 */
.theme-switch-wide { width: 100%; }
.theme-switch-wide .theme-opt { padding: 9px 10px; font-size: 12.5px; gap: 6px; }

/* 顶栏的主题按钮：图标切换比较紧凑，单独收紧内边距 */
.theme-toggle { padding: 0; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }

/* ============================ 卡密详情 ============================ */
/* 键值对展示：左侧固定宽度标签，右侧等宽字体取值，长值自动换行不撑破容器 */
.kv-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  overflow: hidden;
}
.kv {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-1);
}
.kv:last-child { border-bottom: 0; }
.kv:nth-child(odd) { background: var(--hover-row); }
.kv-k { color: var(--fg-4); }
.kv-v { color: var(--fg-1); font-family: var(--font-mono); word-break: break-all; min-width: 0; }

/* ============================ 在线支付 ============================ */
/* 支付方式选择行：整行可点，选中态用信号色描边，不依赖单选框 */
.pay-choice {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: transparent;
  color: var(--fg-1);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pay-choice:hover { border-color: var(--sig); background: var(--hover-1); }
.pay-choice.active {
  border-color: var(--sig);
  background: var(--sig-glow);
  color: var(--fg-1);
}
.pay-choice-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--fg-4); }
.pay-choice-auto {
  color: var(--sig);
  border: 1px solid rgba(61, 220, 151, .3);
  border-radius: var(--r-full);
  padding: 0 7px;
  font-size: 10.5px;
  line-height: 17px;
}

/* 支付金额：数字要压得住，别跟标题一样大 */
.pay-amount {
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
  font-family: var(--font-mono);
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sig);
  font-variant-numeric: tabular-nums;
}
.pay-amount .cur { font-size: 16px; font-weight: 500; color: var(--fg-3); }

/* 收款二维码：白底是必须的，二维码在深色底上很多扫码器识别不了 */
.pay-qr {
  display: block;
  width: 220px; height: 220px;
  margin: 6px auto;
  padding: 10px;
  border-radius: var(--r-2);
  background: #fff;
  object-fit: contain;
}

/* 轮询状态行 */
.pay-status {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 22px;
  font-size: 12.5px;
  color: var(--fg-3);
}
.dot-sig, .dot-warn, .dot-danger {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
}
.dot-sig { background: var(--sig); box-shadow: 0 0 0 3px var(--sig-glow); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-glow); }
.dot-danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-glow); }
