/* =========================================================
   QMT License Console - Financial Terminal × Midnight Editorial
   ========================================================= */

:root {
  /* 背景层级 */
  --bg-deep: #07090F;
  --bg-base: #0A0E1A;
  --bg-elev: #11172A;
  --bg-elev-2: #161E33;
  --bg-line: #1F2944;
  --bg-line-soft: #1A2238;

  /* 文字 */
  --fg: #E8ECF5;
  --fg-soft: #B3BCD1;
  --fg-mute: #6E7895;
  --fg-dim: #4A5371;

  /* 强调色 */
  --gold: #E8B547;
  --gold-soft: #C9963A;
  --gold-glow: rgba(232, 181, 71, 0.18);
  --cyan: #3DD9D6;
  --cyan-soft: #2BA9A6;
  --cyan-glow: rgba(61, 217, 214, 0.16);

  /* 状态 */
  --ok: #3DD9D6;
  --warn: #E8B547;
  --bad: #FF5C7A;
  --info: #6FA8FF;
  --neutral: #8B95B0;

  /* 字体 */
  --font-display: 'Cormorant Garamond', 'Source Han Serif SC', 'Songti SC', serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  --font-sans: 'Manrope', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* 尺寸 */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --shadow-1: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow-gold: 0 0 0 1px rgba(232,181,71,0.35), 0 8px 30px rgba(232,181,71,0.08);
  --shadow-glow-cyan: 0 0 0 1px rgba(61,217,214,0.3), 0 8px 30px rgba(61,217,214,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
code { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-line); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-elev-2); background-clip: padding-box; }

/* =========================================================
   登录页
   ========================================================= */
.login-view {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 30% 20%, #131A30 0%, var(--bg-base) 45%, var(--bg-deep) 100%);
  overflow: hidden;
}
.login-bg-grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(var(--bg-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  opacity: 0.5;
}
.login-bg-glow {
  position: absolute;
  width: 720px; height: 720px;
  right: -180px; bottom: -260px;
  background: radial-gradient(circle, rgba(232,181,71,0.12), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 2;
  width: 600px;
  background: linear-gradient(180deg, rgba(22,30,51,0.85), rgba(17,23,42,0.85));
  border: 1px solid var(--bg-line);
  border-radius: var(--radius-lg);
  padding: 40px 38px 28px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.03);
}
.login-mark {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.mark-bar { width: 28px; height: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.mark-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--gold); }
.login-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.login-title .accent { color: var(--gold); font-style: italic; }
.login-subtitle { color: var(--fg-mute); font-size: 13px; margin-bottom: 28px; }
.login-form .field { display: block; margin-bottom: 18px; }
.field-label {
  display: block; font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-mute);
  margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.login-row { margin-top: 8px; }
.login-hint {
  margin-top: 18px;
  font-size: 12px; color: var(--fg-mute);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.login-hint code {
  background: var(--bg-base); padding: 2px 6px; border-radius: 4px;
  color: var(--cyan); font-size: 11px;
}
.login-foot {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--bg-line-soft);
  font-size: 11px; color: var(--fg-dim);
  display: flex; gap: 6px; letter-spacing: 0.05em;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--bg-line);
  background: var(--bg-elev);
  color: var(--fg-soft);
  transition: all .15s ease;
  letter-spacing: 0.02em;
}
.btn:hover { border-color: var(--fg-dim); color: var(--fg); }
.btn-primary {
  background: linear-gradient(180deg, rgba(232,181,71,0.16), rgba(232,181,71,0.06));
  border: 1px solid var(--gold);
  color: var(--gold);
  text-shadow: 0 0 12px var(--gold-glow);
}
.btn-primary:hover {
  background: linear-gradient(180deg, rgba(232,181,71,0.28), rgba(232,181,71,0.12));
  box-shadow: var(--shadow-glow-gold);
  color: #fff;
}
.btn-cyan {
  background: linear-gradient(180deg, rgba(61,217,214,0.14), rgba(61,217,214,0.05));
  border: 1px solid var(--cyan);
  color: var(--cyan);
}
.btn-cyan:hover { box-shadow: var(--shadow-glow-cyan); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: rgba(255,92,122,0.4); }
.btn-danger:hover { background: rgba(255,92,122,0.1); border-color: var(--bad); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link-btn {
  background: none; border: none; color: var(--cyan);
  font-size: 12px; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--gold); }
.link-btn-danger { color: var(--bad); font-size: 11px; }

/* =========================================================
   主应用布局
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background: var(--bg-base);
}

/* 侧边栏 */
.sidebar {
  background: var(--bg-deep);
  border-right: 1px solid var(--bg-line-soft);
  display: flex; flex-direction: column;
  position: relative;
}
.sidebar::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-glow) 30%, transparent 70%);
  opacity: 0.4;
}
.brand {
  padding: 22px 22px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--bg-line-soft);
}
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(232,181,71,0.18), rgba(232,181,71,0.04));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--fg); }
.brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--fg-mute); margin-top: 2px; }

.nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-group {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.2em; color: var(--fg-dim);
  padding: 16px 12px 8px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--fg-soft); font-size: 13px; font-weight: 500;
  margin-bottom: 2px;
  position: relative;
  transition: all .15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item:hover { background: var(--bg-elev); color: var(--fg); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(232,181,71,0.12), transparent);
  color: var(--gold);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--gold); border-radius: 2px;
  box-shadow: 0 0 8px var(--gold-glow);
}
.nav-item.active svg { opacity: 1; }

.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--bg-line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.admin-chip { display: flex; align-items: center; gap: 10px; }
.admin-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--bg-deep); font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
.admin-info { display: flex; flex-direction: column; line-height: 1.1; }
.admin-name { font-size: 13px; font-weight: 600; }
.admin-role { font-size: 10px; color: var(--fg-mute); letter-spacing: 0.06em; }

/* 主区 */
.main {
  display: flex; flex-direction: column;
  min-width: 0; height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--bg-line-soft);
  background: rgba(10,14,26,0.7);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.crumbs .crumb-root { color: var(--fg-mute); }
.crumbs .crumb-sep { color: var(--fg-dim); }
.crumbs .crumb-current { color: var(--fg); font-weight: 600; }
.icon-btn {
  width: 34px; height: 34px; display: none; place-items: center;
  border-radius: var(--radius); border: 1px solid var(--bg-line);
  color: var(--fg-soft);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn svg { width: 18px; height: 18px; }
.clock {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--cyan); letter-spacing: 0.06em;
}
.status-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(61,217,214,0.08); border: 1px solid rgba(61,217,214,0.25);
  font-size: 12px; color: var(--cyan);
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot-gold { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot-red { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.dot-gray { background: var(--neutral); }

.page {
  flex: 1; overflow-y: auto;
  padding: 28px 32px 60px;
  animation: pageIn .35s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   通用组件
   ========================================================= */
.page-head { margin-bottom: 24px; }
.page-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 32px; line-height: 1.1; color: var(--fg);
  letter-spacing: 0.5px;
}
.page-title .accent { color: var(--gold); font-style: italic; }
.page-desc { color: var(--fg-mute); font-size: 13px; margin-top: 6px; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--bg-line-soft);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
}
.card-title {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-mute); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; width: 3px; height: 12px;
  background: var(--gold); border-radius: 2px;
}

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left; padding: 12px 14px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute); font-weight: 600;
  border-bottom: 1px solid var(--bg-line);
  background: var(--bg-elev-2);
  white-space: nowrap;
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bg-line-soft);
  color: var(--fg-soft);
  vertical-align: middle;
}
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: rgba(232,181,71,0.04); }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-mono { font-family: var(--font-mono); font-size: 12px; color: var(--fg); }
.cell-strong { color: var(--fg); font-weight: 600; }
.cell-mute { color: var(--fg-mute); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.03em;
  font-family: var(--font-mono);
  border: 1px solid;
}
.tag-ok { color: var(--ok); border-color: rgba(61,217,214,0.35); background: rgba(61,217,214,0.08); }
.tag-warn { color: var(--warn); border-color: rgba(232,181,71,0.35); background: rgba(232,181,71,0.08); }
.tag-bad { color: var(--bad); border-color: rgba(255,92,122,0.35); background: rgba(255,92,122,0.08); }
.tag-info { color: var(--info); border-color: rgba(111,168,255,0.35); background: rgba(111,168,255,0.08); }
.tag-neutral { color: var(--neutral); border-color: rgba(139,149,176,0.3); background: rgba(139,149,176,0.08); }

/* =========================================================
   Dashboard
   ========================================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-elev);
  border: 1px solid var(--bg-line-soft);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--bg-line); }
.kpi-card::after {
  content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.kpi-card[data-tone="gold"] { --accent-glow: var(--gold-glow); }
.kpi-card[data-tone="cyan"] { --accent-glow: var(--cyan-glow); }
.kpi-card[data-tone="red"] { --accent-glow: rgba(255,92,122,0.16); }
.kpi-card[data-tone="info"] { --accent-glow: rgba(111,168,255,0.14); }
.kpi-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-mute); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.kpi-value {
  font-family: var(--font-mono); font-weight: 600;
  font-size: 34px; line-height: 1; color: var(--fg);
  letter-spacing: -0.02em;
}
.kpi-card[data-tone="gold"] .kpi-value { color: var(--gold); }
.kpi-card[data-tone="cyan"] .kpi-value { color: var(--cyan); }
.kpi-card[data-tone="red"] .kpi-value { color: var(--bad); }
.kpi-card[data-tone="info"] .kpi-value { color: var(--info); }
.kpi-foot {
  margin-top: 12px; font-size: 12px; color: var(--fg-mute);
  display: flex; align-items: center; gap: 6px;
}
.kpi-delta { font-family: var(--font-mono); }
.kpi-delta.up { color: var(--cyan); }
.kpi-delta.down { color: var(--bad); }

.dash-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px;
}
.timeline { list-style: none; }
.timeline li {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--bg-line-soft);
}
.timeline li:last-child { border-bottom: none; }
.timeline .t-dot {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--bg-line);
  font-family: var(--font-mono); font-size: 11px;
}
.t-dot.gold { color: var(--gold); border-color: var(--gold); background: var(--gold-glow); }
.t-dot.cyan { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-glow); }
.t-dot.red { color: var(--bad); border-color: var(--bad); background: rgba(255,92,122,0.12); }
.t-dot.info { color: var(--info); border-color: var(--info); background: rgba(111,168,255,0.1); }
.t-body { flex: 1; min-width: 0; }
.t-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.t-title { font-size: 13px; color: var(--fg); font-weight: 500; }
.t-time { font-family: var(--font-mono); font-size: 11px; color: var(--fg-mute); }
.t-desc { font-size: 12px; color: var(--fg-mute); word-break: break-all; }

/* =========================================================
   License 生成
   ========================================================= */
.gen-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
  align-items: start;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field-group { margin-bottom: 18px; }
.field-group .field-label { margin-bottom: 8px; }
.field-hint { font-size: 11px; color: var(--fg-dim); margin-top: 6px; }

/* 程序位选择 */
.prog-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.prog-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--bg-base);
}
.prog-item:hover { border-color: var(--gold); }
.prog-item.checked {
  border-color: var(--gold);
  background: rgba(232,181,71,0.06);
  box-shadow: inset 0 0 0 1px var(--gold-glow);
}
.prog-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid var(--bg-line);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .15s;
}
.prog-check svg { width: 12px; height: 12px; opacity: 0; transition: opacity .15s; color: var(--bg-deep); }
.prog-item.checked .prog-check { background: var(--gold); border-color: var(--gold); }
.prog-item.checked .prog-check svg { opacity: 1; }

/* 穿梭框（开通策略程序位） */
.transfer {
  display: flex; gap: 12px; align-items: stretch;
}
.transfer-panel {
  flex: 1 1 0; min-width: 0;
  background: var(--bg-deep);
  border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.transfer-panel-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--bg-line-soft);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-elev-2);
  flex-shrink: 0;
}
.transfer-panel-head .tp-count {
  font-family: var(--font-mono); color: var(--gold);
  background: var(--bg-deep); padding: 1px 7px; border-radius: 10px;
  font-size: 11px;
}
.transfer-panel.right .transfer-panel-head .tp-count { color: var(--cyan); }
.transfer-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  max-height: 240px; min-height: 180px;
  padding: 6px;
}
.transfer-list-empty {
  display: grid; place-items: center; height: 100%;
  color: var(--fg-dim); font-size: 12px; text-align: center;
  padding: 20px;
}
.transfer-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  border: 1px solid transparent;
  margin-bottom: 3px;
  width: 100%; min-width: 0;
  box-sizing: border-box;
}
.transfer-item:hover { background: var(--bg-elev); }
.transfer-item.selected {
  background: rgba(232,181,71,0.18);
  border-color: var(--gold);
}
/* 右侧已开通 item：默认带青色边框+背景，清晰可见 */
.transfer-panel.right .transfer-item {
  background: rgba(61,217,214,0.08);
  border-color: rgba(61,217,214,0.25);
}
.transfer-panel.right .transfer-item:hover {
  background: rgba(61,217,214,0.15);
}
.transfer-panel.right .transfer-item.selected {
  background: rgba(61,217,214,0.28);
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan) inset;
}
.transfer-item .ti-pos {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--fg-mute);
  background: var(--bg-elev-2);
  padding: 2px 6px; border-radius: 3px;
  flex-shrink: 0;
}
.transfer-panel.right .transfer-item .ti-pos {
  color: var(--cyan);
  background: rgba(61,217,214,0.15);
}
.transfer-item .ti-pid {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg-dim);
  background: var(--bg-elev-2);
  padding: 2px 5px; border-radius: 3px;
  flex-shrink: 0; white-space: nowrap;
  border: 1px solid var(--bg-line-soft);
}
.transfer-panel.right .transfer-item .ti-pid {
  color: var(--cyan);
  background: rgba(61,217,214,0.08);
  border-color: rgba(61,217,214,0.25);
}
.transfer-item .ti-code {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--gold); flex-shrink: 0;
  max-width: 80px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.transfer-panel.right .transfer-item .ti-code { color: var(--cyan); font-weight: 600; }
.transfer-item .ti-name {
  font-size: 13px; color: var(--fg-soft); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.transfer-panel.right .transfer-item .ti-name { color: #fff; font-weight: 600; }

.transfer-buttons {
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  flex: 0 0 auto; width: 44px; min-width: 44px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 6px 4px;
}
.transfer-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--fg-mute);
  transition: all .15s;
}
.transfer-btn:hover:not(:disabled) {
  border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-glow);
}
.transfer-btn:active:not(:disabled) { transform: scale(0.94); }
.transfer-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.transfer-btn svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .transfer { flex-direction: column; }
  .transfer-buttons { flex-direction: row; justify-content: center; }
  .transfer-btn { transform: rotate(90deg); }
}
.prog-info { display: flex; flex-direction: column; line-height: 1.2; }
.prog-id { font-family: var(--font-mono); font-size: 11px; color: var(--fg-mute); }
.prog-name { font-size: 13px; color: var(--fg); margin-top: 2px; }

/* 策略勾选列表 */
.ck-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 340px; overflow-y: auto;
  padding: 8px; border: 1px solid var(--bg-line-soft); border-radius: var(--radius);
  background: var(--bg-base);
}
.ck-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  cursor: pointer; transition: background .15s;
  border: 1px solid transparent;
}
.ck-row:hover { background: var(--bg-elev); }
.ck-row.is-checked {
  background: rgba(61,217,214,0.07);
  border-color: rgba(61,217,214,0.2);
}
.ck-row.is-deprecated {
  opacity: 0.4; cursor: not-allowed;
  text-decoration: line-through;
}
.ck-row input[type="checkbox"] {
  accent-color: var(--cyan); width: 15px; height: 15px; flex-shrink: 0;
  cursor: pointer;
}
.ck-row.is-deprecated input[type="checkbox"] { cursor: not-allowed; }
.ck-pos {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--fg-mute); background: var(--bg-elev-2);
  padding: 2px 6px; border-radius: 3px; flex-shrink: 0;
}
.ck-row.is-checked .ck-pos { color: var(--cyan); background: rgba(61,217,214,0.15); }
.ck-pid {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg-dim); background: var(--bg-elev-2);
  padding: 2px 5px; border-radius: 3px; flex-shrink: 0; white-space: nowrap;
  border: 1px solid var(--bg-line-soft);
}
.ck-row.is-checked .ck-pid {
  color: var(--cyan); background: rgba(61,217,214,0.08);
  border-color: rgba(61,217,214,0.25);
}
.ck-code {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--gold); flex-shrink: 0;
}
.ck-row.is-checked .ck-code { color: var(--cyan); font-weight: 600; }
.ck-name {
  font-size: 13px; color: var(--fg-soft); font-weight: 500; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ck-row.is-checked .ck-name { color: #fff; font-weight: 600; }
.ck-dep {
  font-size: 10px; color: var(--fg-dim);
  background: var(--bg-elev-2); padding: 1px 6px; border-radius: 3px;
  flex-shrink: 0;
}

/* 授权码输出 */
.lic-out {
  background: var(--bg-deep);
  border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  min-height: 120px;
}
.lic-out-empty {
  display: grid; place-items: center; min-height: 120px;
  color: var(--fg-dim); font-size: 12px; text-align: center;
}
.lic-code {
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  color: var(--gold); word-break: break-all;
  letter-spacing: 0.04em; line-height: 1.5;
  text-shadow: 0 0 14px var(--gold-glow);
  min-height: 1.5em;
}
.lic-meta {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--bg-line);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  font-size: 12px;
}
.lic-meta-item { display: flex; flex-direction: column; }
.lic-meta-key { color: var(--fg-mute); font-size: 11px; letter-spacing: 0.06em; }
.lic-meta-val { color: var(--fg); font-family: var(--font-mono); margin-top: 2px; }
.lic-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 在线验证接口 URL 提示框 */
.lic-verify-url {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(78,158,255,0.06);
  border: 1px solid rgba(78,158,255,0.25);
  border-radius: 8px;
}
.lic-verify-url-label {
  font-size: 11px; color: var(--fg-mute);
  letter-spacing: 0.04em; margin-bottom: 6px;
}
.lic-verify-url-link {
  display: block;
  font-family: var(--font-mono); font-size: 12px;
  color: #4E9EFF; word-break: break-all;
  text-decoration: none; cursor: pointer;
  transition: color .15s;
}
.lic-verify-url-link:hover { color: #7AB5FF; text-decoration: underline; }

.member-id-box {
  margin-top: 12px; padding: 10px 14px;
  background: var(--bg-deep); border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 12px;
  color: var(--cyan); word-break: break-all;
  display: flex; align-items: center; gap: 10px;
}
.member-id-box .label { color: var(--fg-mute); }

/* =========================================================
   在线验证
   ========================================================= */
.verify-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
  margin-bottom: 22px;
}
.verify-result {
  background: var(--bg-deep);
  border: 1px solid var(--bg-line);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-height: 280px;
}
.vr-empty {
  display: grid; place-items: center; min-height: 280px;
  color: var(--fg-dim); font-size: 12px; text-align: center;
}
.vr-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; margin-bottom: 18px;
}
.vr-badge.ok { background: rgba(61,217,214,0.1); color: var(--cyan); border: 1px solid var(--cyan); }
.vr-badge.bad { background: rgba(255,92,122,0.1); color: var(--bad); border: 1px solid var(--bad); }
.vr-badge.warn { background: rgba(232,181,71,0.1); color: var(--gold); border: 1px solid var(--gold); }
.vr-fields { display: grid; gap: 1px; background: var(--bg-line-soft); border-radius: var(--radius); overflow: hidden; }
.vr-field {
  display: grid; grid-template-columns: 160px 1fr;
  background: var(--bg-elev);
  padding: 12px 16px;
  font-size: 13px;
}
.vr-field-key { color: var(--fg-mute); font-family: var(--font-mono); font-size: 12px; }
.vr-field-val { color: var(--fg); font-family: var(--font-mono); word-break: break-all; }
.vr-field-val.bool-true { color: var(--cyan); }
.vr-field-val.bool-false { color: var(--bad); }

/* 接口文档 */
.doc-card { margin-top: 22px; }
.doc-block {
  background: var(--bg-deep); border: 1px solid var(--bg-line-soft);
  border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 14px;
}
.doc-block h4 {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--gold); margin-bottom: 10px;
}
.doc-block p { color: var(--fg-soft); font-size: 13px; margin-bottom: 8px; }
.doc-block code.inline {
  background: var(--bg-elev); padding: 2px 6px; border-radius: 4px;
  color: var(--cyan); font-size: 12px;
}
.doc-block pre {
  background: var(--bg-deep); border: 1px solid var(--bg-line-soft);
  border-radius: var(--radius); padding: 14px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-soft); overflow-x: auto;
  margin-top: 8px;
}
.doc-block pre .kw { color: var(--gold); }
.doc-block pre .str { color: var(--cyan); }
.doc-block pre .cmt { color: var(--fg-dim); }

/* =========================================================
   筛选条
   ========================================================= */
.filter-bar {
  background: var(--bg-elev);
  border: 1px solid var(--bg-line-soft);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.filter-bar .field { min-width: 0; }
.filter-bar .field .field-label { font-size: 10px; margin-bottom: 6px; }
.filter-bar .field input, .filter-bar .field select {
  padding: 8px 12px; font-size: 13px;
  min-width: 140px;
}
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

/* =========================================================
   用户管理 / 抽屉
   ========================================================= */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.user-status { display: inline-flex; align-items: center; gap: 6px; }
.user-status .us-dot { width: 7px; height: 7px; border-radius: 50%; }
.user-status.active .us-dot { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.user-status.disabled .us-dot { background: var(--bad); }
.row-actions { display: flex; gap: 6px; }
.row-actions .link-btn { font-size: 12px; padding: 2px 4px; }

/* 策略位可视化（program_ids 每一位的色块） */
.pid-bit {
  display: inline-block;
  width: 18px; height: 18px; line-height: 18px;
  text-align: center; margin-right: 3px;
  border-radius: 4px; font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
}
.pid-bit.on {
  background: rgba(78,158,255,0.18);
  color: #4E9EFF;
  border: 1px solid rgba(78,158,255,0.4);
}
.pid-bit.off {
  background: rgba(110,120,149,0.1);
  color: var(--fg-dim);
  border: 1px solid var(--bg-line);
}

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(7,9,15,0.7); backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
  width: 520px; max-width: 92vw;
  background: var(--bg-elev);
  border-left: 1px solid var(--bg-line);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  animation: drawerIn .28s cubic-bezier(.2,.8,.3,1);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  padding: 22px 24px; border-bottom: 1px solid var(--bg-line-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.drawer-close {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--radius); border: 1px solid var(--bg-line);
  color: var(--fg-soft);
}
.drawer-close:hover { border-color: var(--bad); color: var(--bad); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.drawer-section { margin-bottom: 26px; }
.drawer-section h5 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-mute); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.drawer-section h5::before {
  content: ''; width: 3px; height: 11px; background: var(--gold); border-radius: 2px;
}
.kv-list { display: grid; gap: 1px; background: var(--bg-line-soft); border-radius: var(--radius); overflow: hidden; }
.kv-row {
  display: grid; grid-template-columns: 130px 1fr;
  background: var(--bg-elev);
  padding: 10px 14px; font-size: 13px;
}
.kv-key { color: var(--fg-mute); font-size: 12px; }
.kv-val { color: var(--fg); font-family: var(--font-mono); word-break: break-all; }

/* 模态 */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(7,9,15,0.7); backdrop-filter: blur(4px);
  display: grid; place-items: center;
  animation: fadeIn .2s ease;
}
.modal {
  width: 460px; max-width: 92vw;
  background: var(--bg-elev);
  border: 1px solid var(--bg-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  animation: modalIn .24s cubic-bezier(.2,.8,.3,1);
}
.modal-wide {
  width: 900px; max-width: 96vw;
}
@keyframes modalIn { from { transform: scale(.96) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--bg-line-soft); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--bg-line-soft); display: flex; justify-content: flex-end; gap: 10px; }

/* Toast */
.toast-root {
  position: fixed; top: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-elev-2);
  border: 1px solid var(--bg-line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: var(--shadow-1);
  min-width: 240px; max-width: 360px;
  animation: toastIn .25s ease;
}
.toast.ok { border-left-color: var(--cyan); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--gold); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { transform: translateX(20px); opacity: 0; } }

/* 空态 */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--fg-mute);
}
.empty-state .es-icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%; border: 1px solid var(--bg-line);
  display: grid; place-items: center;
  color: var(--fg-dim);
}
.empty-state .es-icon svg { width: 26px; height: 26px; }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elev) 0%, var(--bg-elev-2) 50%, var(--bg-elev) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 打字机光标 */
.cursor-blink::after {
  content: '▌'; color: var(--gold);
  animation: blink 1s infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

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

/* =========================================================
   策略列表页
   ========================================================= */
.alert-bar {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  background: rgba(232,181,71,0.08);
  border: 1px solid rgba(232,181,71,0.3);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 12.5px; color: var(--fg-soft); line-height: 1.6;
}
.alert-bar svg { color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.alert-bar strong { color: var(--gold); }

.pos-id {
  display: inline-grid; place-items: center;
  min-width: 36px; height: 26px;
  padding: 0 8px;
  background: var(--bg-deep);
  border: 1px solid var(--gold);
  border-radius: 4px;
  font-family: var(--font-mono); font-weight: 600; font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* 位置 → program_ids 映射示意 */
.map-box {
  background: var(--bg-deep);
  border: 1px solid var(--bg-line-soft);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
}
.map-row {
  display: flex; gap: 4px; margin-bottom: 4px;
  min-width: max-content;
}
.map-row-id { margin-bottom: 2px; }
.map-row-name { margin-bottom: 14px; }
.map-cell {
  min-width: 64px; text-align: center;
  padding: 6px 4px;
  font-family: var(--font-mono); font-size: 12px;
  border-radius: 4px;
}
.map-cell-id {
  color: var(--fg-mute); font-size: 10px; letter-spacing: 0.1em;
  border-bottom: 1px dashed var(--bg-line);
  padding-bottom: 4px;
}
.map-cell-bit {
  font-size: 16px; font-weight: 700;
  min-width: 64px; padding: 10px 4px;
}
.map-cell-bit.bit-on {
  color: var(--cyan);
  background: rgba(61,217,214,0.1);
  border: 1px solid rgba(61,217,214,0.3);
  text-shadow: 0 0 10px var(--cyan-glow);
}
.map-cell-bit.bit-off {
  color: var(--fg-dim);
  background: var(--bg-elev);
  border: 1px solid var(--bg-line-soft);
}
.map-cell-name {
  color: var(--gold); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-cell-name.is-deprecated,
.map-cell-id.is-deprecated {
  opacity: 0.4; text-decoration: line-through;
}
.map-preview {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed var(--bg-line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px;
}
.mp-label { color: var(--fg-mute); font-family: var(--font-mono); font-size: 12px; }
.mp-code {
  font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  color: var(--gold);
  background: var(--bg-elev); padding: 4px 10px; border-radius: 4px;
  border: 1px solid var(--gold-glow);
  letter-spacing: 0.08em;
}
.mp-meta { color: var(--fg-dim); font-size: 11px; }

/* 模态提示 */
.modal-note {
  background: var(--bg-deep);
  border: 1px solid var(--bg-line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px; color: var(--fg-soft);
  margin-bottom: 18px;
}
.modal-note code {
  color: var(--cyan); background: var(--bg-elev);
  padding: 1px 6px; border-radius: 3px;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .gen-grid, .verify-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: 260px; transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 30px 0 60px rgba(0,0,0,0.6); }
  .icon-btn { display: grid; }
  .page { padding: 20px 18px 50px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .topbar-right .status-pill { display: none; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .login-card { width: 92vw; padding: 32px 24px 22px; }
  .login-title { font-size: 30px; }
  .vr-field { grid-template-columns: 1fr; gap: 4px; }
  .kv-row { grid-template-columns: 1fr; gap: 4px; }
}
