/* ============================================================
   算力交易平台 · 运营中台
   全新视觉系统，独立于任何历史管理端样式
   ============================================================ */

:root {
  --bg: #f4f5f9;
  --bg-deep: #eceef5;
  --card: #ffffff;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e7e9f0;
  --line-strong: #d5d9e4;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef2ff;
  --amber: #f59e0b;
  --amber-soft: #fff7e6;
  --ok: #079455;
  --ok-soft: #e9f9f0;
  --warn: #dc6803;
  --warn-soft: #fff4e5;
  --danger: #d92d20;
  --danger-soft: #fef0ef;
  --info: #0ba5ec;
  --info-soft: #e8f7fe;
  --sidebar: #0e1424;
  --sidebar-2: #151d33;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ============ 登录 ============ */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: #0b1120;
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 64px;
  color: #e7eaf3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(900px 600px at 8% 10%, rgba(99, 102, 241, .42), transparent 60%),
    radial-gradient(700px 520px at 92% 88%, rgba(14, 165, 233, .28), transparent 62%),
    linear-gradient(150deg, #101830 0%, #0b1120 55%, #0a0f1c 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(720px 520px at 30% 40%, #000 20%, transparent 80%);
  pointer-events: none;
}
.login-brand > * { position: relative; z-index: 1; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .3px;
}
.brand-logo {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(140deg, #6366f1, #22d3ee);
  box-shadow: 0 8px 24px rgba(99, 102, 241, .45);
}
.login-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.18;
  letter-spacing: -.5px;
  font-weight: 680;
}
.login-copy h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-copy p {
  margin: 0;
  max-width: 520px;
  color: rgba(231, 234, 243, .62);
  font-size: 15px;
  line-height: 1.85;
}
.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.login-points span {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(231, 234, 243, .8);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(6px);
}
.login-meta {
  display: flex;
  gap: 34px;
  color: rgba(231, 234, 243, .45);
  font-size: 12px;
}
.login-meta b {
  display: block;
  color: #e7eaf3;
  font-size: 20px;
  font-weight: 620;
  margin-bottom: 2px;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: #fbfbfd;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -.4px;
}
.login-card .sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}
.login-card .field { margin-bottom: 16px; }
.login-card .field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.login-card input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}
.login-card .btn { width: 100%; height: 46px; margin-top: 6px; font-size: 15px; }
.login-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.7;
}
.login-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}

/* ============ 应用骨架 ============ */
.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(500px 340px at 20% 0%, rgba(99, 102, 241, .18), transparent 70%),
    linear-gradient(180deg, #101830 0%, var(--sidebar) 46%, #0b101d 100%);
  color: #c8d0e0;
  padding: 22px 16px 16px;
  z-index: 30;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
}
.side-brand .brand-logo { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.side-brand b { display: block; font-size: 14px; color: #f2f5fb; letter-spacing: .2px; }
.side-brand small { display: block; font-size: 10.5px; color: rgba(200, 208, 224, .45); margin-top: 2px; letter-spacing: .4px; }

.side-group { margin-top: 8px; }
.side-label {
  padding: 10px 12px 6px;
  font-size: 10.5px;
  color: rgba(200, 208, 224, .38);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  margin: 2px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(214, 222, 238, .74);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, .26), rgba(99, 102, 241, .08));
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .22);
}
.nav-item.on .nav-ico { color: #a5b4fc; }
.nav-ico {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: rgba(200, 208, 224, .55);
  flex: 0 0 auto;
}
.nav-ico svg { width: 18px; height: 18px; }
.nav-item .nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  display: grid;
  place-items: center;
  font-weight: 600;
}
.side-foot {
  margin-top: auto;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.07);
  font-size: 11.5px;
  color: rgba(200, 208, 224, .55);
  line-height: 1.7;
}
.side-foot b { color: #e7eaf3; display: block; font-size: 12.5px; margin-bottom: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
  padding: 0 32px;
  background: rgba(244, 245, 249, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(231, 233, 240, .9);
}
.topbar h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.2px;
  font-weight: 650;
}
.topbar .crumb {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-bottom: 1px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
}
.account-chip .role {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #6366f1, #22d3ee);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }

.view {
  padding: 26px 32px 64px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* ============ 通用组件 ============ */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head .title {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -.5px;
  margin: 0;
}
.page-head .desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.span-2 { grid-column: span 2; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 0;
}
.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.1px;
}
.card-head .sub { font-size: 11.5px; color: var(--muted-2); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 16px 18px 18px; }
.card-body.flush { padding: 8px 0 0; }
.card-body.flush > .tabs { padding: 0 18px; margin-bottom: 12px; }
.card + .card { margin-top: 16px; }

/* KPI */
.kpi {
  position: relative;
  padding: 18px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi .top { display: flex; align-items: center; gap: 8px; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .ico {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.kpi .ico svg { width: 15px; height: 15px; }
.kpi .value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.kpi .foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ok-soft);
  color: var(--ok);
}
.delta.down { background: var(--danger-soft); color: var(--danger); }
.delta.flat { background: var(--bg); color: var(--muted); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: #f9fafb; border-color: var(--muted-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .24);
}
.btn.primary:hover { filter: brightness(1.04); background: linear-gradient(180deg, #6f72f4, #4a41dd); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg); color: var(--ink-2); }
.btn.danger { color: var(--danger); border-color: #f5c2be; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn.soft:hover { background: #e3e8ff; }
.btn.sm { height: 29px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn.xs { height: 25px; padding: 0 8px; font-size: 11px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn svg { width: 14px; height: 14px; }

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: #027a9e; }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.dot::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.lg { height: 25px; padding: 0 10px; font-size: 11.5px; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted-2); }
input:not([type]), input[type="text"], input[type="number"], input[type="search"], input[type="date"],
input[type="url"], input[type="tel"], select, textarea {
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.filters .field { flex: 0 0 auto; }
.filters .field.grow { flex: 1 1 220px; }
.filters .field input, .filters .field select { min-width: 132px; }
.filters .spacer { flex: 1; }

/* 栅格化筛选面板：一行五列，关键词占两列，操作按钮占两列收尾 */
.filter-grid {
  display: grid;
  grid-template-columns: 1.8fr repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
  width: 100%;
}
.filter-grid .field.wide { grid-column: span 2; }
.filter-grid .field.action { grid-column: span 2; }
.filter-grid .field.action .flex { justify-content: flex-end; }
.filter-grid .field.action .btn { min-width: 88px; }
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fafbfd;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
}
.check-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand);
}
.filter-grid .field input:not([type="checkbox"]),
.filter-grid .field select { width: 100%; }
@media (max-width: 1180px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid .field.wide { grid-column: span 2; }
  .filter-grid .field.action { grid-column: span 2; }
}

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: .2px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f2f7;
  color: var(--ink-2);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #fafbff; }
.tbl tbody tr.click { cursor: pointer; }
.tbl .cell-main { font-weight: 600; color: var(--ink); }
.tbl .cell-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.tbl .nowrap { white-space: nowrap; }
.tbl .right { text-align: right; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl .empty-row td { padding: 40px; text-align: center; color: var(--muted-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.pager .spacer { flex: 1; }

/* 空状态 / 加载 */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
}
.empty .ico {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--bg);
  color: var(--muted-2);
}
.empty b { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 3px; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(79, 70, 229, .18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px;
  color: var(--muted);
  font-size: 12.5px;
}
.skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef0f5 25%, #f7f8fb 37%, #eef0f5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* 分段 / tabs */
.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-deep);
  border-radius: 10px;
  gap: 2px;
  flex-wrap: wrap;
}
.seg button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink-2); }
.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs button {
  position: relative;
  height: 40px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { color: var(--brand); }
.tabs button.on::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.tabs .count {
  margin-left: 5px;
  font-size: 10px;
  background: var(--bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 6px;
}
.tabs .count:empty { display: none; }
/* 咨询单状态筛选：独立一行，数量直接挂在状态标签上，不再重复一堆 KPI 卡 */
.ld-tabs { flex-wrap: wrap; overflow: visible; margin-bottom: 16px; }

/* 图表 */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

.bar-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 12px; }
.bar-row .name { width: 76px; color: var(--muted); flex: 0 0 auto; }
.bar-row .track { flex: 1; height: 8px; background: var(--bg-deep); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #818cf8); }
.bar-row .val { width: 62px; text-align: right; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

.list-plain { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .s { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.list-row .right { text-align: right; flex: 0 0 auto; }

.dot-sep { color: var(--line-strong); margin: 0 6px; }
.hint-line { font-size: 11.5px; color: var(--muted-2); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.strong { font-weight: 650; color: var(--ink); }

/* 状态色点 */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--muted-2); }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--amber); }
.status-dot.danger { background: var(--danger); }
.status-dot.info { background: var(--info); }

/* ============ 抽屉 ============ */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .34);
  backdrop-filter: blur(2px);
  z-index: 80;
  animation: fade .18s ease;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(760px, 94vw);
  background: #fbfbfd;
  z-index: 81;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn .24s cubic-bezier(.22,.8,.3,1);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer-head {
  padding: 20px 22px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.drawer-head h2 { margin: 0; font-size: 18px; letter-spacing: -.2px; }
.drawer-head .sub { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.drawer-head .close {
  margin-left: auto;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.drawer-foot {
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: center;
}
.drawer-foot .spacer { flex: 1; }

.tab-panel { animation: fade .16s ease; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.kv {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.kv .k { font-size: 10.5px; color: var(--muted-2); letter-spacing: .2px; }
.kv .v { font-size: 15px; font-weight: 650; margin-top: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kv .v.sm { font-size: 12.5px; font-weight: 600; }

/* ============ 弹窗 ============ */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-mask { position: absolute; inset: 0; background: rgba(16, 24, 40, .4); backdrop-filter: blur(2px); animation: fade .16s ease; }
.modal {
  position: relative;
  width: min(560px, 96vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: pop .2s cubic-bezier(.22,.8,.3,1);
}
.modal.wide { width: min(820px, 96vw); }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  padding: 20px 22px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.2px; }
.modal-head .sub { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.modal-head .close { margin-left: auto; width: 28px; height: 28px; border: 0; background: var(--bg); border-radius: 8px; color: var(--muted); cursor: pointer; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.modal .form-grid .full { grid-column: 1 / -1; }

/* 方案选择卡 */
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.plan-card {
  text-align: left;
  padding: 13px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.plan-card:hover { border-color: var(--brand); }
.plan-card.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
  background: #fbfbff;
}
.plan-card .p-label { font-size: 12px; font-weight: 650; }
.plan-card .p-price { font-size: 19px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.plan-card .p-price small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.plan-card .p-cut { font-size: 10.5px; color: var(--muted-2); text-decoration: line-through; margin-top: 2px; }
.plan-card .p-save { font-size: 10.5px; color: var(--ok); margin-top: 4px; font-weight: 600; }

/* 会员到期条目 */
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.member-row:last-child { border-bottom: 0; }
.member-row .who { flex: 1; min-width: 0; }
.member-row .who b { font-size: 12.5px; font-weight: 600; }
.member-row .who div { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.member-row .quick { display: flex; gap: 4px; }

/* 风险卡 */
.risk-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
}
.risk-card.high { border-left: 3px solid var(--danger); }
.risk-card.mid { border-left: 3px solid var(--amber); }
.risk-card.low { border-left: 3px solid var(--info); }
.risk-card + .risk-card { margin-top: 10px; }
.risk-card .r-head { display: flex; align-items: center; gap: 8px; }
.risk-card .r-title { font-size: 12.5px; font-weight: 650; }
.risk-card .r-detail { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.risk-card .r-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 11px; color: var(--muted-2); }
.risk-card .r-foot .actions { margin-left: auto; display: flex; gap: 5px; }

/* 直聊监管 */
.chat-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; min-height: 520px; }
.thread-list { border-right: 1px solid var(--line); padding-right: 10px; max-height: 640px; overflow-y: auto; }
.thread {
  padding: 10px 11px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}
.thread:hover { background: #fafbff; }
.thread.on { background: var(--brand-soft); border-color: #dfe3ff; }
.thread .t { font-size: 12.5px; font-weight: 600; }
.thread .s { font-size: 11px; color: var(--muted-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .m { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 10.5px; color: var(--muted-2); }
.chat-panel { display: flex; flex-direction: column; min-width: 0; }
.chat-stream { flex: 1; overflow-y: auto; padding: 6px 4px 18px; max-height: 600px; }
.chat-bubble { display: flex; flex-direction: column; align-items: flex-start; margin: 10px 0; }
.chat-bubble.me { align-items: flex-end; }
.chat-bubble .meta { font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }
.chat-bubble .body {
  max-width: 74%;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f1f3f9;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-bubble.me .body { background: var(--brand-soft); color: #3b3494; }
.chat-note {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--amber-soft);
  color: #8a5400;
  font-size: 11.5px;
  line-height: 1.6;
}

/* Toast */
.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #101828;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(16,24,40,.24);
  animation: toastIn .2s ease;
  max-width: 520px;
}
.toast.ok { background: #067a48; }
.toast.err { background: #c4291e; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 排行榜 */
.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
}
.rank-item:last-child { border-bottom: 0; }
.rank-no {
  width: 20px; height: 20px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
  flex: 0 0 auto;
}
.rank-no.top1 { background: #fff1d6; color: #b45309; }
.rank-no.top2 { background: #eef1f6; color: #475467; }
.rank-no.top3 { background: #fbe9df; color: #b54708; }
.rank-item .grow { min-width: 0; }
.rank-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink-2); }
.rank-item .s { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.rank-item .v { font-weight: 650; font-variant-numeric: tabular-nums; }

/* 媒体货盘 */
.thumb {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #eef2ff, #e0f2fe);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

/* 设置 */
.setting-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .info { flex: 1; min-width: 0; }
.setting-row .info b { font-size: 12.5px; }
.setting-row .info p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.setting-row .ctrl { flex: 0 0 280px; display: flex; gap: 8px; align-items: center; }
.setting-row .ctrl input, .setting-row .ctrl select { flex: 1; }

.switch {
  position: relative;
  width: 38px; height: 22px;
  flex: 0 0 auto;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .16s;
  cursor: pointer;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16,24,40,.25);
  transition: transform .16s;
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }

.rule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.rule-row:last-child { border-bottom: 0; }
.rule-row .grow b { font-size: 12.5px; }
.rule-row .grow p { margin: 3px 0 0; font-size: 11px; color: var(--muted-2); }

/* 响应式 */
@media (max-width: 1240px) {
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .g-side { grid-template-columns: minmax(0,1fr); }
  .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .app { grid-template-columns: 76px minmax(0,1fr); }
  .side-brand b, .side-brand small, .side-label, .nav-item span.nav-text, .side-foot { display: none; }
  .side-brand { justify-content: center; padding: 2px 0 18px; }
  .nav-item { justify-content: center; padding: 11px; }
  .view { padding: 20px 18px 48px; }
  .topbar { padding: 0 18px; }
  .g2, .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .span-2 { grid-column: span 1; }
  .kpi { padding: 14px; }
  .kpi .value { margin-top: 8px; font-size: 24px; }
  .chat-layout { grid-template-columns: minmax(0,1fr); }
  .thread-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .modal .form-grid { grid-template-columns: minmax(0,1fr); }
  .setting-row { flex-direction: column; }
  .setting-row .ctrl { flex: 1 1 auto; width: 100%; }
  .kv-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 640px) {
  .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0,1fr); }
  .filter-grid { grid-template-columns: minmax(0,1fr); }
  .filter-grid .field.wide,
  .filter-grid .field.action { grid-column: span 1; }
  .filter-grid .field.action .flex { justify-content: flex-start; }
  .page-head { align-items: flex-start; }
}
