/* ============================================================
   蓝邮VOS聚合管理系统（部署版）
   深色科技商务风 · 蓝(#2b7fff) → 绿(#00d6a5) 渐变
   ============================================================ */

:root {
  --bg: #070b12;
  --bg-soft: #0a1019;
  --panel: #0e1622;
  --panel-2: #121d2b;
  --panel-3: #162334;
  --line: rgba(122, 160, 214, 0.10);
  --line-strong: rgba(122, 160, 214, 0.20);
  --text: #e9effb;
  --text-2: #8a9ab3;
  --text-3: #5a6982;
  --blue: #2b7fff;
  --blue-2: #5aa2ff;
  --green: #00d6a5;
  --green-2: #3cf0c4;
  --red: #ff5c6c;
  --amber: #ffb020;
  --purple: #9d8bff;
  --grad: linear-gradient(135deg, #2b7fff 0%, #00d6a5 100%);
  --grad-soft: linear-gradient(135deg, rgba(43,127,255,.18) 0%, rgba(0,214,165,.14) 100%);
  --shadow: 0 8px 32px rgba(0, 0, 0, .38);
  --r: 12px;
  --r-sm: 8px;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(43, 127, 255, .13), transparent 62%),
    radial-gradient(760px 420px at 92% 4%, rgba(0, 214, 165, .09), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(122, 160, 214, .18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(122, 160, 214, .32); }

.num, .mono { font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* ================= 布局 ================= */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ================= 侧边栏 ================= */
.sidebar {
  background: linear-gradient(180deg, #0b1320 0%, #080d16 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 0 12px;
  position: relative;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0; right: -1px;
  width: 1px; height: 160px;
  background: linear-gradient(180deg, rgba(0,214,165,.55), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 20px;
}

.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(43, 127, 255, .35);
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark img { width: 84%; height: 84%; object-fit: contain; display: block; }

.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt strong { font-size: 14.5px; letter-spacing: .06em; font-weight: 650; }
.brand-txt span { font-size: 10.5px; color: var(--text-3); letter-spacing: .16em; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  position: relative;
  transition: background .16s, color .16s;
}
.nav a svg { width: 16px; height: 16px; fill: currentColor; opacity: .8; flex-shrink: 0; }
.nav a:hover { background: rgba(122, 160, 214, .07); color: var(--text); }
.nav a.active {
  background: linear-gradient(90deg, rgba(43,127,255,.20), rgba(0,214,165,.06));
  color: #fff;
  font-weight: 550;
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px;
  border-radius: 0 3px 3px 0;
  background: var(--grad);
}
.nav a.active svg { opacity: 1; color: var(--green-2); }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  margin-left: auto;
  box-shadow: 0 0 0 3px rgba(0, 214, 165, .13);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .32; }
}

.badge {
  margin-left: auto;
  font-style: normal;
  font-size: 10.5px;
  font-family: var(--mono);
  background: rgba(255, 92, 108, .16);
  color: #ff8b96;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}
.badge:empty { display: none; }

.side-foot {
  margin-top: auto;
  padding: 16px 18px 0;
  border-top: 1px solid var(--line);
}
.side-title {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.site-list { display: flex; flex-direction: column; gap: 8px; }
.site-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-2); }
.site-row i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0, 214, 165, .6);
}
.site-row i.off { background: var(--red); box-shadow: 0 0 6px rgba(255, 92, 108, .6); }
.site-row span { margin-left: auto; font-family: var(--mono); color: var(--text-3); font-size: 10.5px; }

.side-meta {
  margin-top: 14px;
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.7;
}

/* ================= 主区 ================= */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px 14px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.crumb h1 { font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.crumb p { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

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

.chip {
  font-size: 11px;
  color: var(--text-2);
  background: rgba(122, 160, 214, .07);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 20px;
  font-family: var(--mono);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(122, 160, 214, .06);
  color: var(--text);
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all .16s;
  white-space: nowrap;
}
.btn:hover { background-color: rgba(122, 160, 214, .13); border-color: rgba(122, 160, 214, .3); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 14px; height: 14px; fill: currentColor; }
.btn-primary {
  background: var(--grad);
  border: none;
  color: #fff;
  font-weight: 550;
  box-shadow: 0 4px 16px rgba(43, 127, 255, .3);
}
.btn-primary:hover { background-color: transparent; filter: brightness(1.1); box-shadow: 0 6px 22px rgba(43, 127, 255, .42); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(122, 160, 214, .1); color: var(--text); }
.btn-sm { padding: 4px 9px; font-size: 11.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.content { flex: 1; overflow-y: auto; padding: 20px 26px 40px; }

/* ================= 通用组件 ================= */
.grid { display: grid; gap: 14px; }
.cards-5 { grid-template-columns: repeat(5, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1420px) {
  .cards-5 { grid-template-columns: repeat(3, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .app { grid-template-columns: 68px 1fr; }
  .brand-txt, .nav a span, .side-foot { display: none; }
  .nav a { justify-content: center; }
  .cards-5, .cards-4, .cards-3, .cards-2 { grid-template-columns: repeat(2, 1fr); }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.panel-glow::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 214, 165, .5), transparent);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.panel-head h3 { font-size: 13px; font-weight: 580; letter-spacing: .01em; }
.panel-head .hint { font-size: 11px; color: var(--text-3); }

/* KPI 卡 */
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  animation: fadeUp .42s both;
}
.kpi::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43,127,255,.16), transparent 70%);
}
.kpi .k-label {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
.kpi .k-val {
  font-size: 25px;
  font-weight: 620;
  font-family: var(--mono);
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi .k-val small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.kpi .k-sub { font-size: 11px; color: var(--text-3); margin-top: 7px; display: flex; gap: 8px; align-items: center; }
.kpi.grad .k-val {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.up { color: var(--green-2); }
.down { color: var(--red); }
.warn { color: var(--amber); }
.muted { color: var(--text-3); }

/* 进度条 */
.bar {
  height: 4px;
  background: rgba(122, 160, 214, .1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--grad);
  transition: width .5s ease;
}
.bar.warn > i { background: linear-gradient(90deg, #ffb020, #ff7a45); }
.bar.bad > i { background: linear-gradient(90deg, #ff5c6c, #ff2d55); }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  position: sticky; top: 0;
  background: var(--panel);
  z-index: 1;
}
td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(122, 160, 214, .055);
  color: var(--text-2);
  white-space: nowrap;
}
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tbody tr { transition: background .13s; }
tbody tr:hover { background: rgba(122, 160, 214, .045); }
tbody tr:hover td { color: var(--text); }
td strong { color: var(--text); font-weight: 550; }
.t-link { color: var(--blue-2); cursor: pointer; text-decoration: none; }
.t-link:hover { text-decoration: underline; }

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  border: 1px solid transparent;
}
.tag.ok { background: rgba(0, 214, 165, .11); color: var(--green-2); border-color: rgba(0, 214, 165, .2); }
.tag.warn { background: rgba(255, 176, 32, .11); color: #ffc453; border-color: rgba(255, 176, 32, .2); }
.tag.bad { background: rgba(255, 92, 108, .11); color: #ff8b96; border-color: rgba(255, 92, 108, .2); }
.tag.blue { background: rgba(43, 127, 255, .12); color: var(--blue-2); border-color: rgba(43, 127, 255, .22); }
.tag.gray { background: rgba(122, 160, 214, .08); color: var(--text-2); }

/* 图表容器 */
.chart { width: 100%; height: 260px; }
.chart.sm { height: 200px; }
.chart.lg { height: 320px; }

/* 工具条 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
select, input[type="text"], input[type="password"], input[type="number"], textarea {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .16s;
}
select:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, textarea:focus { border-color: rgba(43, 127, 255, .55); }
select option { background: var(--panel-2); }
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; }
.seg button {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 11.5px;
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.seg button.on { background: rgba(43, 127, 255, .2); color: #fff; }

/* 列表条目 */
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(122, 160, 214, .05);
}
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: rgba(122, 160, 214, .1);
  color: var(--text-3);
  font-size: 10px;
  font-family: var(--mono);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.rank-row:nth-child(1) .rank-no { background: rgba(255, 176, 32, .18); color: #ffc453; }
.rank-row:nth-child(2) .rank-no { background: rgba(180, 200, 230, .14); color: #cbd8ea; }
.rank-row:nth-child(3) .rank-no { background: rgba(205, 127, 50, .16); color: #d99b6a; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.rank-val { font-family: var(--mono); font-size: 12px; color: var(--text); }

/* 前缀代码块 */
.code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(4, 8, 14, .72);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  color: #a8d8ff;
  word-break: break-all;
  line-height: 1.85;
  max-height: 180px;
  overflow: auto;
}
.code .hl { color: var(--green-2); }

/* 空态 */
.empty {
  text-align: center;
  padding: 44px 0;
  color: var(--text-3);
  font-size: 12px;
}
.empty svg { width: 38px; height: 38px; fill: currentColor; opacity: .3; display: block; margin: 0 auto 10px; }

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(2, 5, 10, .62);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
  z-index: 40;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 92vw;
  background: var(--bg-soft);
  border-left: 1px solid var(--line-strong);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .55);
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  z-index: 41;
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 13.5px; font-weight: 580; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 30px; }

/* Toast */
.toast-wrap {
  position: fixed;
  right: 20px; bottom: 22px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 60;
}
.toast {
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--green);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  box-shadow: var(--shadow);
  animation: slideIn .24s both;
  max-width: 340px;
}
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.kpi:nth-child(1) { animation-delay: .02s; }
.kpi:nth-child(2) { animation-delay: .06s; }
.kpi:nth-child(3) { animation-delay: .10s; }
.kpi:nth-child(4) { animation-delay: .14s; }
.kpi:nth-child(5) { animation-delay: .18s; }

/* 站点卡 */
.site-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.site-card .s-ic {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--green-2);
  flex-shrink: 0;
}
.site-card h4 { font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.site-card p { font-size: 10.5px; color: var(--text-3); margin-top: 3px; font-family: var(--mono); }

/* 时间线 */
.tl { position: relative; padding-left: 16px; }
.tl::before {
  content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px;
  width: 1px; background: var(--line-strong);
}
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -15px; top: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(0, 214, 165, .12);
}
.tl-item.bad::before { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 92, 108, .12); }
.tl-time { font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.tl-txt { font-size: 12px; margin-top: 2px; }

/* 微信预览 */
.wx-preview {
  background: #0b141f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.9;
  color: #cfe0f5;
  font-family: inherit;
}

/* ================= 自动化开通 ================= */
.step-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sf-group {
  flex: 1;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sf-group > .sf-title {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sf-title .sf-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 8px rgba(0, 214, 165, .5);
}
.sf-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.sf-step {
  flex: 1;
  min-width: 100px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-2);
}
.sf-step b { display: block; font-size: 12px; color: var(--text); font-weight: 550; margin-bottom: 2px; }
.sf-arrow { align-self: center; color: var(--text-3); font-size: 16px; flex-shrink: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 5px;
}
.field label .opt { color: var(--text-3); opacity: .75; font-style: normal; }
.field input[type="text"],
.field input[type="number"],
.field textarea,
.field select { width: 100%; }
.field textarea { resize: vertical; min-height: 54px; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; }
.field .help { font-size: 10.5px; color: var(--text-3); margin-top: 4px; }

.pair { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }

/* 毛利对比卡 */
.margin-card {
  border: 1px solid rgba(0, 214, 165, .24);
  background: linear-gradient(135deg, rgba(0, 214, 165, .08), rgba(43, 127, 255, .06));
  border-radius: var(--r);
  padding: 14px 16px;
}
.mc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mc-item { text-align: center; flex: 1; }
.mc-item .v { font-family: var(--mono); font-size: 19px; font-weight: 620; }
.mc-item .l { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.mc-arrow { color: var(--green-2); font-size: 18px; }
.mc-foot { display: flex; gap: 16px; justify-content: center; margin-top: 10px; font-size: 11px; color: var(--text-2); }
.mc-foot b { color: var(--green-2); font-family: var(--mono); }

/* 步骤执行结果 */
.exec-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(122, 160, 214, .06);
}
.exec-step:last-child { border-bottom: none; }
.exec-ic {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  background: rgba(122, 160, 214, .1);
  color: var(--text-3);
}
.exec-step.created .exec-ic { background: rgba(0, 214, 165, .15); color: var(--green-2); }
.exec-step.exists .exec-ic { background: rgba(255, 176, 32, .15); color: #ffc453; }
.exec-step.skipped .exec-ic { background: rgba(255, 176, 32, .15); color: #ffc453; }
.exec-step.failed .exec-ic { background: rgba(255, 92, 108, .15); color: #ff8b96; }
.exec-step.blocked .exec-ic { background: rgba(122, 160, 214, .08); color: var(--text-3); }
.exec-step.running .exec-ic { background: rgba(43, 127, 255, .2); color: var(--blue-2); animation: pulse 1.2s infinite; }

/* SIP 交付单（同步记录） */
.delivery-card { font-size: 12px; }
.dv-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid rgba(0, 214, 165, .2);
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(0, 214, 165, .07), rgba(43, 127, 255, .05));
}
.dv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.dv-k { font-size: 10.5px; color: var(--text-3); margin-bottom: 2px; }
.dv-v { font-size: 12px; color: var(--text); word-break: break-all; }
.dv-v.mono { font-family: var(--mono); color: #a8d8ff; }
.dv-text-label { margin: 16px 0 6px; font-size: 10.5px; color: var(--text-3); }
.dv-text {
  margin: 0; padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.85;
  color: var(--text-2);
  white-space: pre-wrap; word-break: break-all;
  max-height: 320px; overflow: auto;
}

/* 主站对象核对（先搜索再创建） */
.check-list { display: flex; flex-direction: column; }
.check-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(122, 160, 214, .06);
}
.check-row:last-child { border-bottom: none; }
.check-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(122, 160, 214, .3); }
.check-dot.on { background: var(--amber); box-shadow: 0 0 8px rgba(255, 176, 32, .5); }
.check-dot.off { background: var(--green); box-shadow: 0 0 8px rgba(0, 214, 165, .45); }
.check-dot.unk { background: var(--text-3); }
.check-name { font-size: 11.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-iface { font-size: 9.5px; color: var(--text-3); }
.check-res { font-size: 10.5px; }
.check-res.on { color: var(--amber); }
.check-res.off { color: var(--green-2); }
.check-note { font-size: 10px; color: var(--text-3); margin: -2px 0 6px 22px; line-height: 1.5; }
.exec-body { flex: 1; min-width: 0; }
.exec-title { font-size: 12px; display: flex; gap: 8px; align-items: center; }
.exec-title .iface { font-family: var(--mono); font-size: 10.5px; color: var(--blue-2); }
.exec-detail { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.exec-payload {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: #7ba7cc;
  background: rgba(4, 8, 14, .6);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.warn-list { display: flex; flex-direction: column; gap: 7px; }
/* ---- 生效验证（软交换实时回读） ---- */
.act-box {
  margin: 12px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(4, 8, 14, .45);
}
.act-box.ok { border-color: rgba(0, 214, 165, .35); }
.act-box.bad { border-color: rgba(255, 92, 108, .4); }
.act-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.act-head strong { color: var(--text-2); }
.act-head .muted { margin-left: auto; }
.act-row { display: flex; align-items: baseline; gap: 8px; margin-top: 7px; font-size: 11px; }
.act-ic { width: 16px; height: 16px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; flex: none; align-self: center; }
.act-ic.ok { background: rgba(0, 214, 165, .15); color: var(--green-2); }
.act-ic.bad { background: rgba(255, 92, 108, .15); color: #ff8b96; }
.act-ic.idle { background: rgba(122, 160, 214, .1); color: var(--text-3); }
.act-kind { color: var(--text-3); flex: none; }
.act-name { color: #a8d8ff; font-size: 10.5px; flex: none; }
.act-detail { color: var(--text-3); font-size: 10.5px; word-break: break-all; }
.act-note { margin-top: 8px; font-size: 10.5px; color: var(--text-3); border-top: 1px dashed var(--line); padding-top: 7px; }
.act-note.bad { color: #ff8b96; }
.warn-list .w-item {
  display: flex; gap: 8px;
  font-size: 11.5px; color: #d8c394;
  background: rgba(255, 176, 32, .06);
  border: 1px solid rgba(255, 176, 32, .16);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  line-height: 1.6;
}
.w-item::before { content: "!"; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; background: rgba(255,176,32,.2); color: #ffc453; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 1px; }

.mode-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  border-radius: var(--r);
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.mode-banner.demo { border-color: rgba(255, 176, 32, .25); background: rgba(255, 176, 32, .05); color: #ffd98a; }
.mode-banner.live { border-color: rgba(0, 214, 165, .3); background: rgba(0, 214, 165, .06); color: var(--green-2); }

/* ================= 登录页 ================= */
/* 尺寸全部用 clamp 跟随视口：卡片铺满可用区域，字号/间距按屏幕等比缩放 */
.auth-screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: clamp(0px, 2vh, 32px) clamp(0px, 2.2vw, 42px);
  background:
    radial-gradient(760px 420px at 8% 0%, #eef2f8, transparent 62%),
    radial-gradient(700px 420px at 100% 100%, #e4eaf2, transparent 60%),
    #e9edf3;
  z-index: 100;
}
/* hidden 属性必须优先于上面的 display，否则登录层会一直压在主界面上 */
.auth-screen[hidden] { display: none !important; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: clamp(0px, 1.5vw, 26px);
  overflow: hidden;
  box-shadow: 0 42px 90px -28px rgba(11, 23, 37, .42), 0 2px 10px rgba(11, 23, 37, .06);
  animation: fadeUp .45s both;
}

/* ---------- 左栏：品牌叙事 ---------- */
.auth-hero {
  --pad-y: clamp(22px, 2.4vw, 56px);
  position: relative;
  display: flex; flex-direction: column;
  padding: var(--pad-y) clamp(22px, 3.2vw, 72px) clamp(20px, 2.4vw, 56px);
  color: #fff;
  background: linear-gradient(158deg, #0e1c2c 0%, #0a1521 58%, #091320 100%);
  overflow: hidden;
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 360px at 18% 106%, rgba(37, 99, 235, .42), transparent 70%),
    radial-gradient(420px 300px at 96% 102%, rgba(0, 190, 170, .16), transparent 72%),
    radial-gradient(360px 260px at 92% -6%, rgba(37, 99, 235, .16), transparent 70%);
}
.auth-hero > * { position: relative; z-index: 1; }

.auth-brand { display: flex; align-items: center; gap: clamp(9px, .9vw, 14px); }
.auth-logo {
  --s: clamp(46px, 4.1vw, 72px);
  width: var(--s); height: var(--s); flex: 0 0 var(--s);
  border-radius: calc(var(--s) * .27); overflow: hidden;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
}
.auth-logo img {
  display: block; width: 92%; height: 92%; object-fit: contain;
}
.auth-brand-txt strong {
  display: block; font-size: clamp(14px, 1.05vw, 17px); font-weight: 600;
  letter-spacing: .1em; color: #f2f7ff;
}
.auth-brand-txt span {
  display: block; font-size: clamp(9.5px, .7vw, 11.5px);
  color: #7c8fa6; letter-spacing: .14em; margin-top: 2px;
}

.auth-hero-body {
  flex: 1 1 auto; min-height: 0; width: 100%; max-width: 560px;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(14px, 2vw, 40px);
}

.auth-eyebrow {
  font-size: clamp(9px, .68vw, 11px); font-weight: 700; letter-spacing: .22em;
  color: #7b8fa8; text-transform: uppercase;
}
.auth-h1 {
  font-size: clamp(26px, 2.6vw, 46px); line-height: 1.26; font-weight: 700; letter-spacing: -.5px;
  margin: clamp(10px, 1.4vw, 20px) 0 clamp(10px, 1.2vw, 18px); color: #fff;
}
.auth-sub {
  font-size: clamp(11.5px, .9vw, 14px); line-height: 1.7; color: #8497ad;
  padding-bottom: clamp(13px, 1.6vw, 24px); border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.auth-groups { margin-top: clamp(12px, 1.6vw, 24px); }
.auth-groups-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: clamp(10px, .78vw, 12px); font-weight: 600; color: #4b8cf7; letter-spacing: .04em;
}
.auth-groups-head em {
  font-style: normal; font-family: var(--mono); font-size: clamp(8.5px, .64vw, 10px);
  letter-spacing: .16em; color: #5f7288;
}
.auth-groups ol { list-style: none; margin-top: clamp(6px, .8vw, 12px); }
.auth-groups li {
  display: grid; grid-template-columns: clamp(24px, 2vw, 34px) 1fr; gap: 2px;
  padding: clamp(7px, 1.1vw, 14px) 0; border-bottom: 1px solid rgba(255, 255, 255, .045);
}
.auth-groups li:last-child { border-bottom: 0; padding-bottom: 0; }
.auth-groups li i {
  font-style: normal; font-family: var(--mono); font-size: clamp(9px, .66vw, 10.5px);
  color: #465c76; padding-top: 3px; letter-spacing: .04em;
}
.auth-groups li strong {
  display: block; font-size: clamp(12px, .92vw, 14.5px); font-weight: 600;
  color: #e6eef9; letter-spacing: .01em;
}
.auth-groups li span {
  display: block; font-size: clamp(10.5px, .78vw, 12.5px);
  color: #73869d; margin-top: 2px; letter-spacing: .01em;
}

/* ---------- 右栏：表单 ---------- */
.auth-panel {
  position: relative;
  display: flex; align-items: center;
  padding: 0 clamp(26px, 3.8vw, 80px);
  background: #fff;
}
.auth-form { width: 100%; max-width: clamp(320px, 25vw, 392px); margin: 0 auto; }

.auth-panel .auth-eyebrow.sm { color: #2563eb; font-size: clamp(8.5px, .64vw, 10px); letter-spacing: .2em; }
.auth-title {
  font-size: clamp(23px, 1.95vw, 31px); font-weight: 700; letter-spacing: -.3px;
  color: #0f1b2b; margin: clamp(8px, .9vw, 13px) 0 6px;
}
.auth-lead { font-size: clamp(11.5px, .85vw, 13.5px); color: #7d8b9d; margin-bottom: clamp(16px, 2vw, 26px); }

.auth-note {
  font-size: clamp(11px, .82vw, 13px); line-height: 1.6; padding: 9px 12px;
  border-radius: 8px; margin-bottom: clamp(13px, 1.6vw, 18px);
  border: 1px solid transparent;
}
.auth-note[hidden] { display: none !important; }
.auth-note.ok { background: #edfcf3; border-color: #c3eed5; color: #0d8354; }
.auth-note.err { background: #fef3f2; border-color: #fbd7d3; color: #cf3a2f; }

.auth-field { display: block; margin-bottom: clamp(12px, 1.5vw, 18px); }
.auth-field > span {
  display: block; font-size: clamp(11px, .82vw, 12.5px); font-weight: 600;
  color: #2c3b4e; margin-bottom: 6px; letter-spacing: .02em;
}
.auth-field input {
  display: block; width: 100%; height: clamp(40px, 4.8vh, 52px);
  background: #fff; color: #0f1b2b;
  border: 1px solid #dde4ed; border-radius: 8px;
  padding: 0 clamp(11px, 1vw, 15px); font-size: clamp(12.5px, .9vw, 14px); font-family: inherit;
  transition: border-color .16s, box-shadow .16s;
}
.auth-field input::placeholder { color: #a9b5c5; }
.auth-field input:hover { border-color: #c9d5e4; }
.auth-field input:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}

.auth-submit {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: clamp(42px, 5.2vh, 54px); margin-top: clamp(6px, .8vw, 12px);
  border: 0; border-radius: 8px; cursor: pointer;
  background: #2563eb; color: #fff;
  font-family: inherit; font-size: clamp(13px, .95vw, 15px); font-weight: 600; letter-spacing: .04em;
  box-shadow: 0 10px 20px -12px rgba(37, 99, 235, .9);
  transition: background-color .16s, box-shadow .16s, transform .1s;
}
.auth-submit:hover { background-color: #1d55d0; box-shadow: 0 12px 24px -12px rgba(37, 99, 235, 1); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { background-color: #7ba2f0; cursor: not-allowed; box-shadow: none; }

@media (max-width: 900px) {
  .auth-screen { padding: 0; }
  .auth-shell {
    grid-template-columns: 1fr; grid-template-rows: auto 1fr;
    border-radius: 0; box-shadow: none;
    align-content: stretch;
  }
  /* 左栏收成顶部品牌区，不丢品牌感也不挤压表单 */
  .auth-hero { padding: 24px 24px 26px; border-radius: 0 0 22px 22px; }
  .auth-hero-body { padding-top: 18px; }
  .auth-h1 { font-size: clamp(23px, 5.6vw, 30px); line-height: 1.32; margin: 10px 0 0; }
  .auth-sub, .auth-groups { display: none; }
  .auth-panel { padding: 28px 24px 32px; align-items: center; }
  .auth-form { max-width: 420px; }
  .auth-title { font-size: clamp(22px, 5.2vw, 26px); }
}
@media (max-height: 700px) and (min-width: 901px) {
  .auth-hero { padding: 22px 34px 20px; }
  .auth-hero-body { padding-top: 10px; }
  .auth-h1 { font-size: clamp(24px, 2.1vw, 32px); margin: 9px 0 10px; line-height: 1.24; }
  .auth-sub { padding-bottom: 11px; }
  .auth-groups { margin-top: 10px; }
  .auth-groups ol { margin-top: 4px; }
  .auth-groups li { padding: 5px 0; }
  .auth-groups li span { margin-top: 1px; }
  .auth-lead { margin-bottom: 14px; }
  .auth-field { margin-bottom: 11px; }
}

/* 用户区 */
.user-area { display: flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); }
.user-area .user-name { font-size: 12.5px; font-weight: 550; }

/* 角色权限矩阵 */
.perm-matrix { overflow: auto; max-height: 520px; }
.perm-matrix table th { text-align: center; }
.perm-matrix table thead th { position: sticky; top: 0; z-index: 3; background: var(--panel-2); }
.perm-matrix table th:first-child, .perm-matrix table td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 2; }
.perm-matrix table thead th:first-child { z-index: 4; background: var(--panel-2); }
.perm-cell { text-align: center; }
/* 自绘勾选框：暗色下原生禁用态几乎看不见勾 */
.perm-cell input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; margin: 0;
  border: 1px solid rgba(122, 160, 214, .32);
  border-radius: 4px;
  background: rgba(122, 160, 214, .07);
  cursor: pointer; position: relative;
  transition: background .14s, border-color .14s;
}
.perm-cell input[type="checkbox"]:hover { border-color: rgba(0, 214, 165, .65); }
.perm-cell input[type="checkbox"]:checked { background: var(--green); border-color: var(--green); }
.perm-cell input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 4.5px; top: 1.5px;
  width: 4px; height: 8px;
  border: solid #04140f; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.perm-cell.view input[type="checkbox"]:checked { background: var(--blue); border-color: var(--blue); }
.perm-cell.view input[type="checkbox"]:checked::after { border-color: #061422; }
/* 管理员列：全选且锁定 */
.perm-cell input[type="checkbox"]:disabled { opacity: .55; cursor: not-allowed; }
.role-head { white-space: nowrap; min-width: 96px; }
.role-head .role-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 9.5px; color: var(--text-3); font-weight: 400;
  text-transform: none; letter-spacing: 0; margin: 2px auto 0; max-width: 96px; white-space: normal; line-height: 1.45;
}

/* 密码表单 */
.pwd-form .field { margin-bottom: 12px; }

/* ================= 批量导入开通 ================= */
.page-back {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; font-size: 12px;
}
.page-back a { color: var(--blue-2); text-decoration: none; }
.page-back a:hover { color: #a8d8ff; }

.batch-paste { position: relative; border-radius: var(--r-sm); transition: box-shadow .16s; }
.batch-paste.drag { box-shadow: 0 0 0 2px rgba(43, 127, 255, .5), 0 0 0 6px rgba(43, 127, 255, .1); }
.batch-paste textarea {
  width: 100%; min-height: 210px; resize: vertical;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75;
  padding: 11px 13px; tab-size: 8;
  white-space: pre; overflow: auto;
}
.batch-paste textarea::placeholder { font-family: inherit; color: var(--text-3); }
.batch-drop-hint {
  margin-top: 7px; font-size: 10.5px; color: var(--text-3); line-height: 1.6;
}

.col-tip { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.col-tip summary {
  cursor: pointer; font-size: 11px; color: var(--text-2); list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.col-tip summary::-webkit-details-marker { display: none; }
.col-tip summary::before { content: "＋"; color: var(--blue-2); font-size: 11px; }
.col-tip[open] summary::before { content: "－"; }
.col-tip-body { margin-top: 8px; font-size: 11px; color: var(--text-2); line-height: 1.85; }
.col-tip-body b { color: var(--text); font-weight: 600; }

/* 批次概览 */
.bs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border-radius: var(--r-sm); overflow: hidden;
}
.bs-grid > div { background: var(--panel); padding: 10px 12px; }
.bs-l { font-size: 10.5px; color: var(--text-3); }
.bs-v { font-size: 17px; font-weight: 650; font-family: var(--mono); margin-top: 2px; letter-spacing: -.3px; }
.bs-margin {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 10px; font-size: 11px; color: var(--text-3);
}
.bs-margin b { font-family: var(--mono); font-weight: 600; }
.bs-note {
  margin-top: 9px; font-size: 11px; color: #ffd98a;
  background: rgba(255, 176, 32, .07); border: 1px solid rgba(255, 176, 32, .22);
  padding: 6px 10px; border-radius: 6px;
}

/* 逐行核对表 */
.row-warn { font-size: 10px; color: #ffb020; margin-top: 3px; line-height: 1.5; }
tr.row-bad td { background: rgba(255, 92, 108, .045); }

/* 批量执行进度 */
.batch-prog { padding: 2px 0 4px; }
.bp-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; }
.bp-head strong { font-weight: 600; color: var(--text); }
.bp-head span { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.bp-bar {
  height: 6px; border-radius: 3px; margin-top: 9px;
  background: rgba(122, 160, 214, .12); overflow: hidden;
}
.bp-bar i {
  display: block; height: 100%; border-radius: 3px;
  background: var(--grad); transition: width .4s ease;
}
.bp-cur { margin-top: 8px; font-size: 11px; color: var(--text-2); font-family: var(--mono); }
.bp-list { margin-top: 12px; display: flex; flex-direction: column; gap: 1px; max-height: 260px; overflow: auto; }
.bp-row {
  display: grid; grid-template-columns: 40px 1fr 1.1fr 64px; gap: 8px;
  align-items: center; padding: 6px 2px; font-size: 11.5px;
  border-bottom: 1px solid var(--line);
}
.bp-row:last-child { border-bottom: 0; }
.bp-row .tag { justify-self: end; }

@media (max-width: 1100px) {
  .bs-grid { grid-template-columns: repeat(2, 1fr); }
}

.batch-grid { grid-template-columns: 1.12fr 1fr; align-items: start; }
@media (max-width: 1180px) {
  .batch-grid { grid-template-columns: 1fr; }
}

/* 数据来源提示条（话单接口未返回数据时置顶说明） */
.notice-bar {
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 14px; border-radius: 10px;
  background: rgba(255, 196, 83, .08); border: 1px solid rgba(255, 196, 83, .28);
  font-size: 12.5px; line-height: 1.6; color: #d8c9a8;
}
.notice-bar b { color: #ffc453; font-weight: 600; white-space: nowrap; }
.notice-bar span { flex: 1; min-width: 220px; color: #b9ac93; }
