/* ============================================================
   云声数字人直播管理系统 · 统一设计系统
   所有页面共用：圆润控件、大尺寸按钮、矢量图标、模块化卡片
   ============================================================ */
:root {
  --brand: #2f6bff;
  --brand-deep: #1f4fd8;
  --brand-soft: #eaf0ff;
  --cyan: #0ea5b7;
  --purple: #7a5cff;
  --amber: #f59e0b;
  --green: #10a97a;
  --pink: #e94f8a;
  --red: #e5484d;
  --indigo: #4f6bed;
  --slate: #64748b;

  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --line: #e5eaf4;
  --line-strong: #d5dded;
  --text: #16203a;
  --muted: #6b7690;
  --muted-2: #98a2b8;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --shadow-sm: 0 2px 8px rgba(22, 32, 58, 0.05);
  --shadow-md: 0 12px 30px rgba(22, 32, 58, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 48, 0.14);

  --sidebar-w: 248px;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(175deg, #0e1730 0%, #141f3f 50%, #16264b 100%);
  color: #c6d0e8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 16px;
  z-index: 20;
  overflow: hidden;
}
.sidebar .brand-block { flex: 0 0 auto; }
.sidebar .brand-tag { flex: 0 0 auto; }
.sidebar .nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar .nav-scroll::-webkit-scrollbar { width: 6px; }
.sidebar .nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.sidebar .sidebar-foot { flex: 0 0 auto; margin-top: auto; }
.brand-block { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(140deg, #4d7dff, #7a5cff);
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(77, 125, 255, .35);
  flex: 0 0 auto;
}
.brand-text strong { display: block; font-size: 16px; color: #fff; letter-spacing: .5px; }
.brand-text span { font-size: 11px; color: #8fa0c4; letter-spacing: 1.5px; }
.brand-tag {
  margin: 0 8px 18px; padding: 7px 12px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  font-size: 11px; color: #9fb0d2; display: flex; align-items: center; gap: 8px;
}
.brand-tag i { width: 7px; height: 7px; border-radius: 50%; background: #31d0aa; box-shadow: 0 0 0 4px rgba(49,208,170,.16); }
.nav-group-label { font-size: 11px; letter-spacing: 1.5px; color: #6f7f9f; padding: 16px 12px 6px; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 12px;
  color: #c0cbe4; font-size: 13.5px;
  border: 1px solid transparent;
  transition: background .18s, color .18s, transform .18s;
  cursor: pointer; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(79,125,255,.22), rgba(79,125,255,.06));
  color: #fff; border-color: rgba(107,140,255,.25);
  box-shadow: inset 3px 0 0 #4d7dff;
}
.nav-item .nav-icon {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255,255,255,.06); flex: 0 0 auto;
}
.nav-item.active .nav-icon { background: rgba(79,125,255,.2); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; font-size: 11px; color: #6d7d9d; line-height: 1.7; border-top: 1px solid rgba(255,255,255,.07); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 15;
}
.topbar-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.topbar-title .sub { font-size: 12px; color: var(--muted-2); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #4d7dff, #7a5cff); color: #fff; font-size: 12px; font-weight: 600;
}
.user-meta strong { display: block; font-size: 12.5px; line-height: 1.3; }
.user-meta span { display: block; font-size: 10.5px; color: var(--muted-2); }
.page-wrap { flex: 1; padding: 26px 30px 44px; }
.page-inner { max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  height: 44px; padding: 0 20px; border-radius: 12px;
  border: 1px solid transparent; background: #fff; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, #3d74ff, #2f6bff); color: #fff; box-shadow: 0 8px 18px rgba(47,107,255,.28); }
.btn-primary:hover { box-shadow: 0 12px 24px rgba(47,107,255,.34); }
.btn-secondary { border-color: var(--line-strong); background: #fff; color: var(--text); }
.btn-secondary:hover { border-color: #b9c6e4; background: var(--surface-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #fff0f0; border-color: #f6cccc; color: #c23237; }
.btn-danger:hover { background: #ffe3e3; }
.btn-success { background: linear-gradient(135deg, #17bf8b, #0d9c73); color: #fff; box-shadow: 0 8px 18px rgba(16,169,122,.24); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 14.5px; border-radius: 14px; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; background: transparent; border: 1px solid transparent; }
.btn-icon:hover { background: var(--surface-2); border-color: var(--line); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 600; color: #3a4762; display: flex; align-items: center; gap: 5px; }
.form-field label .req { color: var(--red); }
.form-field .help { font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  font-size: 13.5px; outline: none; transition: border-color .18s, box-shadow .18s;
}
.textarea { height: auto; min-height: 112px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; cursor: pointer; }
.input:focus, .select:focus, .textarea:focus { border-color: #8ba8ff; box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.input::placeholder, .textarea::placeholder { color: #aab3c6; }
.input[type="datetime-local"] { padding-right: 10px; }
.switch { position: relative; display: inline-flex; align-items: center; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d7deea; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: linear-gradient(135deg, #4d7dff, #2f6bff); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.switch-row .hint { font-size: 12px; color: var(--muted); }
.inline-field { display: flex; align-items: center; gap: 10px; }
.inline-field .input, .inline-field .select { flex: 1 1 auto; }
.inline-field .btn { flex: 0 0 auto; white-space: nowrap; }
.rule-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface-2);
}
.rule-check {
  display: flex; align-items: center; gap: 9px; min-height: 42px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; cursor: pointer; transition: border-color .18s, box-shadow .18s;
}
.rule-check:hover { border-color: #a9bdf5; }
.rule-check:has(input:checked) { border-color: #8ba8ff; box-shadow: 0 0 0 3px rgba(47,107,255,.10); background: #f4f8ff; }
.rule-check input { accent-color: var(--brand); width: 16px; height: 16px; }
.rule-check .rule-name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-check .rule-type { margin-left: auto; font-size: 11px; color: var(--muted-2); flex: 0 0 auto; }
.callback-card {
  margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line);
  border-left: 3px solid var(--brand); border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f7faff, #ffffff); box-shadow: var(--shadow-sm);
}
.callback-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.callback-head strong { font-size: 13px; display: flex; align-items: center; gap: 7px; color: var(--text); }
.callback-head span { font-size: 11.5px; color: var(--muted-2); }
.callback-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.callback-row code {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 10px;
  background: #eef3ff; color: #27408b; font-size: 12px; word-break: break-all;
}
.callback-row code, .mono { font-family: "Consolas", "SFMono-Regular", "Menlo", monospace; }
@media (max-width: 720px) {
  .inline-field { flex-direction: column; align-items: stretch; }
  .callback-row { flex-direction: column; align-items: stretch; }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 22px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head .desc { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.card-grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  animation: fadeUp .4s ease both;
}
.stat-card::after {
  content: ""; position: absolute; right: -38px; top: -38px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--stat-tint, #eaf0ff); opacity: .75;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--stat-tint, #eaf0ff); flex: 0 0 auto; position: relative; z-index: 1;
}
.stat-body { position: relative; z-index: 1; }
.stat-body .label { font-size: 12px; color: var(--muted); }
.stat-body .value { font-size: 26px; font-weight: 700; letter-spacing: .5px; line-height: 1.25; }
.stat-body .foot { font-size: 11.5px; color: var(--muted-2); }
.stat-body .foot strong { color: var(--green); font-weight: 600; }

.panel-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 12px 14px; background: var(--surface-2); white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table td { padding: 14px; border-bottom: 1px solid #eef1f7; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fafbff; }
.table .cell-main { font-weight: 600; font-size: 13.5px; }
.table .cell-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-empty { padding: 46px 20px; text-align: center; color: var(--muted-2); font-size: 13px; }
.table-empty svg { margin-bottom: 10px; opacity: .55; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: #f1f4fa; color: var(--muted); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.blue { background: #eaf0ff; color: #2f6bff; }
.badge.green { background: #e6f7f1; color: #0b8f66; }
.badge.amber { background: #fff4e0; color: #b46b00; }
.badge.red { background: #ffecec; color: #c23237; }
.badge.purple { background: #f0ecff; color: #6a4dff; }
.badge.slate { background: #eff2f7; color: #5a677d; }
.badge.plain::before { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.live { background: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,.15); animation: pulse 1.8s infinite; }
.dot.ok { background: #10a97a; }
.dot.idle { background: #aab3c6; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filter-bar .search {
  position: relative; flex: 1; min-width: 200px; max-width: 340px;
}
.filter-bar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .6; }
.filter-bar .search .input { padding-left: 40px; }
.filter-bar .select { width: auto; min-width: 132px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12, 20, 40, .48); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 20px; z-index: 100; animation: fadeUp .2s ease both;
  overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: min(620px, 100%); animation: fadeUp .25s ease both;
  border: 1px solid rgba(255,255,255,.6);
}
.modal.wide { width: min(900px, 100%); }
.modal.narrow { width: min(440px, 100%); }
.modal-head { padding: 22px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-head .sub { font-size: 12px; color: var(--muted-2); margin-top: 4px; line-height: 1.6; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 0 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-close { border: none; background: var(--surface-2); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: #eef1f8; color: var(--text); }

/* ---------- 提示 ---------- */
.toast-stack { position: fixed; top: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 12px 16px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
  animation: fadeUp .25s ease both;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast .toast-text { line-height: 1.6; }

.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px;
  border-radius: 12px; font-size: 12.5px; line-height: 1.7;
  background: #f4f8ff; border: 1px solid #dbe7ff; color: #325a9e;
}
.alert.amber { background: #fff9ec; border-color: #f7e2b6; color: #8a6100; }
.alert.green { background: #eefaf4; border-color: #c9efdf; color: #0b7a5a; }
.alert.red { background: #fff2f2; border-color: #f6d0d0; color: #a52a2e; }

/* ---------- 概览图表 ---------- */
.trend-chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 8px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.trend-col .bar {
  width: 100%; max-width: 42px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #6b93ff, #2f6bff); min-height: 6px;
  transition: height .5s ease; position: relative;
}
.trend-col .bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); }
.trend-col .day { font-size: 11px; color: var(--muted-2); }
.bucket-row { display: flex; flex-direction: column; gap: 13px; }
.bucket { display: grid; grid-template-columns: 92px 1fr 36px; align-items: center; gap: 10px; font-size: 12px; }
.bucket .track { height: 8px; background: #eef1f8; border-radius: 999px; overflow: hidden; }
.bucket .fill { height: 100%; border-radius: 999px; }
.bucket .num { text-align: right; color: var(--muted); font-weight: 600; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row .avatar-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: 0 0 auto; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .grow span { display: block; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .time { font-size: 11px; color: var(--muted-2); white-space: nowrap; }

/* ---------- 平台卡片 ---------- */
.platform-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.platform-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.platform-card.ready { border-color: #cfe4ff; background: linear-gradient(180deg, #fbfdff, #fff); }
.platform-card .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.platform-logo { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); }
.platform-card h4 { font-size: 14.5px; margin-top: 13px; }
.platform-card .desc { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; min-height: 36px; }
.platform-card .caps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.platform-card .foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted-2); }

/* ---------- 形象卡片 ---------- */
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.avatar-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.avatar-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.avatar-stage {
  height: 190px; position: relative; overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, var(--stage-soft, #eaf0ff), #f7f9ff 70%);
  display: grid; place-items: center;
}
.avatar-stage svg { width: 100%; height: 100%; }
.avatar-card .info { padding: 15px 16px 16px; }
.avatar-card .info .name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.avatar-card .info h4 { font-size: 14.5px; }
.avatar-card .meta { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.avatar-card .actions { margin-top: 12px; display: flex; gap: 8px; }

/* ---------- 规则卡片 ---------- */
.rule-card {
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px;
  background: var(--surface); display: flex; gap: 14px; align-items: flex-start;
}
.rule-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.rule-card .grow { flex: 1; min-width: 0; }
.rule-card h4 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rule-card .desc { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.rule-card .keywords { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.rule-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 开播控制台 ---------- */
.live-shell { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
  padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--line);
  background: #fff; cursor: pointer; transition: border-color .18s, box-shadow .18s;
}
.task-item:hover { border-color: #bcd0ff; }
.task-item.active { border-color: #93b1ff; box-shadow: 0 0 0 3px rgba(47,107,255,.1); background: #fbfdff; }
.task-item .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-item h4 { font-size: 13px; }
.task-item .meta { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.console {
  background: #0d1526; border-radius: var(--radius-lg); padding: 0; overflow: hidden;
  box-shadow: var(--shadow-md); border: 1px solid #1b2a47;
}
.console-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: #121d33; border-bottom: 1px solid #1d2c4b; color: #cdd8ef;
}
.console-head .title { font-size: 13.5px; display: flex; align-items: center; gap: 9px; }
.console-body { padding: 16px 18px; height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.console-line { display: flex; gap: 10px; font-size: 12px; line-height: 1.7; color: #aab8d4; animation: fadeUp .25s ease both; }
.console-line .t { color: #5f7095; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.console-line .who { color: #7f93bb; flex: 0 0 auto; }
.console-line .msg { color: #d4deee; }
.console-line.comment .msg { color: #ffd48a; }
.console-line.reply .msg { color: #8fe3bd; }
.console-line.auto_report .msg { color: #9db9ff; }
.console-line.warning .msg { color: #ff9d9d; }
.console-line.stream_start .msg, .console-line.stream_stop .msg { color: #8fc9ff; }
.console-empty { color: #5f7095; font-size: 12px; margin: auto; text-align: center; }
.console-foot { display: flex; gap: 10px; padding: 12px 18px; background: #121d33; border-top: 1px solid #1d2c4b; flex-wrap: wrap; }
.console-foot .input { flex: 1; min-width: 180px; background: #0d1526; border-color: #26385c; color: #dfe8f8; }
.console-foot .input::placeholder { color: #667794; }

.stage-card {
  background: linear-gradient(150deg, #16203c 0%, #1c2a4d 55%, #22335c 100%);
  border-radius: var(--radius-lg); color: #dbe4f7; padding: 22px; position: relative; overflow: hidden;
  border: 1px solid #2a3a5e;
}
.stage-card::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 240px; height: 240px;
  border-radius: 50%; background: radial-gradient(circle, rgba(77,125,255,.35), transparent 70%);
}
.stage-card .live-head { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #9fb0d2; }
.stage-card h3 { color: #fff; font-size: 18px; margin-top: 10px; }
.stage-card .stage-meta { display: flex; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.stage-card .stage-meta div span { display: block; font-size: 11px; color: #8fa0c4; }
.stage-card .stage-meta div strong { font-size: 16px; color: #fff; }
.stage-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- 预检清单 ---------- */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border-radius: 10px; background: var(--surface-2); font-size: 12px; line-height: 1.6;
}
.check-item .icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px; }
.check-item.ok .icon { background: #e2f7ef; color: #0b8f66; }
.check-item.fail .icon { background: #ffecec; color: #c23237; }
.check-item.warn .icon { background: #fff4e0; color: #b46b00; }
.check-item .grow { flex: 1; min-width: 0; }
.check-item strong { display: block; font-size: 12.5px; }
.check-item span { color: var(--muted); }

/* ---------- 登录 ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); background: #0d1526; }
.auth-hero {
  position: relative; overflow: hidden; padding: 52px 58px; color: #e8eeff;
  background: radial-gradient(120% 90% at 20% 10%, #1d3a86 0%, #12213f 48%, #0b1324 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::before, .auth-hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.auth-hero::before { width: 520px; height: 520px; right: -190px; top: -160px; background: radial-gradient(circle, rgba(93,132,255,.4), transparent 68%); }
.auth-hero::after { width: 420px; height: 420px; left: -140px; bottom: -180px; background: radial-gradient(circle, rgba(122,92,255,.32), transparent 70%); }
.auth-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-brand .brand-text strong { font-size: 18px; }
.auth-hero h2 { font-size: 38px; line-height: 1.35; letter-spacing: 1px; margin: 44px 0 16px; position: relative; z-index: 1; font-weight: 700; }
.auth-hero h2 em { font-style: normal; color: #8fb0ff; }
.auth-hero > p { font-size: 13.5px; color: #9fb0d2; max-width: 480px; line-height: 1.9; position: relative; z-index: 1; }
.auth-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 1; margin-top: 30px; }
.auth-feature { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045); border-radius: 14px; padding: 14px; }
.auth-feature .icon { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; margin-bottom: 10px; }
.auth-feature strong { display: block; font-size: 12.5px; color: #fff; }
.auth-feature span { font-size: 11px; color: #93a4c7; line-height: 1.6; display: block; margin-top: 3px; }
.auth-hero .auth-footer { position: relative; z-index: 1; font-size: 11px; color: #6f80a4; }
.auth-panel { background: #f7f9fe; display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 24px; box-shadow: 0 30px 80px rgba(9, 18, 40, .18); padding: 38px 36px 34px; border: 1px solid #eef1f8; }
.auth-card .eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--brand); font-weight: 600; }
.auth-card h1 { font-size: 24px; margin-top: 8px; }
.auth-card .sub { font-size: 12.5px; color: var(--muted-2); margin-top: 6px; line-height: 1.7; }
.auth-form { margin-top: 24px; display: flex; flex-direction: column; gap: 15px; }
.auth-form .btn { width: 100%; }
.auth-note { margin-top: 18px; font-size: 11.5px; color: var(--muted-2); line-height: 1.7; padding-top: 16px; border-top: 1px dashed var(--line); }
.auth-switch { margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted); }
.auth-switch a { font-weight: 600; }

/* ---------- 用户端 ---------- */
.portal-hero {
  background: linear-gradient(135deg, #16203c, #22335c 65%, #2b4173);
  border-radius: 22px; color: #e6ecfb; padding: 26px 30px; display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 20px;
  position: relative; overflow: hidden; border: 1px solid #2c3f68;
}
.portal-hero::after {
  content: ""; position: absolute; width: 340px; height: 340px; right: -70px; top: -120px;
  border-radius: 50%; background: radial-gradient(circle, rgba(93,132,255,.35), transparent 70%);
}
.portal-hero h2 { font-size: 24px; color: #fff; margin-top: 8px; }
.portal-hero p { font-size: 12.5px; color: #a5b6d6; margin-top: 8px; max-width: 560px; line-height: 1.8; }
.portal-hero .hero-stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.portal-hero .hero-stats div span { font-size: 11px; color: #8fa0c2; display: block; }
.portal-hero .hero-stats div strong { font-size: 22px; color: #fff; }
.hero-visual { display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.license-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); font-size: 11.5px; color: #cfe0ff; }
.license-pill.warn { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.3); color: #ffd18a; }
.license-pill.expired { background: rgba(229,72,77,.16); border-color: rgba(229,72,77,.35); color: #ffb3b5; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.section-title h3 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.section-title .link { font-size: 12px; color: var(--brand); cursor: pointer; }

.persona-visual { width: 180px; height: 180px; }

/* ---------- 空状态 / 加载 ---------- */
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted-2); font-size: 13px; }
.loading-box { padding: 60px 20px; display: grid; place-items: center; gap: 12px; color: var(--muted-2); font-size: 12.5px; }
.skeleton { background: linear-gradient(90deg, #f0f3fa 25%, #f7f9fe 50%, #f0f3fa 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avatar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .sidebar { position: fixed; left: -260px; transition: left .25s; height: 100vh; }
  .sidebar.open { left: 0; }
  .main { width: 100%; }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .live-shell { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 820px) {
  .page-wrap { padding: 20px 16px 36px; }
  .topbar { padding: 0 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-grid { grid-template-columns: 1fr; }
  .portal-hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-panel { padding: 24px 16px; }
}
@media (max-width: 520px) {
  .avatar-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .topbar-title .sub { display: none; }
  .user-meta { display: none; }
}

/* ---------- 权限选择 ---------- */
.perm-group { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); }
.perm-group h5 { margin: 0 0 10px; font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-item {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px;
  border-radius: 10px; background: #fff; border: 1px solid var(--line); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.perm-item:hover { border-color: #bfd0f2; }
.perm-item input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.perm-item strong { display: block; font-size: 12px; line-height: 1.4; }
.perm-item span { display: block; font-size: 11px; color: var(--muted-2); line-height: 1.5; margin-top: 1px; }

/* ---------- 信息列表 ---------- */
.kv-list { display: flex; flex-direction: column; }
.kv { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.kv:last-child { border-bottom: none; }
.kv > span { color: var(--muted); flex: 0 0 auto; }
.kv > strong { font-weight: 600; text-align: right; word-break: break-all; }
.section-caption { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 11.5px; }
.copy-field {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px;
  border-radius: 10px; border: 1px dashed var(--line-strong); background: var(--surface-2);
  font-size: 11.5px; color: var(--muted); word-break: break-all;
}
.copy-field .text { flex: 1; min-width: 0; }
.copy-field button { flex: 0 0 auto; }

/* ---------- 事件流（浅色） ---------- */
.event-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.event-item { display: flex; gap: 10px; font-size: 12px; line-height: 1.7; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); }
.event-item .t { color: var(--muted-2); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.event-item .type { flex: 0 0 auto; font-weight: 600; color: #3a4762; }
.event-item .msg { color: var(--text); flex: 1; }
.event-item.comment { background: #fffaf0; }
.event-item.reply { background: #f0fbf6; }
.event-item.warning { background: #fff2f2; }
.event-item.stream_start, .event-item.stream_stop { background: #f2f7ff; }

/* ---------- 设置分组 ---------- */
.settings-group { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.settings-group h3 { font-size: 14.5px; display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.settings-group .group-desc { font-size: 12px; color: var(--muted-2); margin-bottom: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.settings-grid .full { grid-column: 1 / -1; }

/* ---------- 其它 ---------- */
.inline-flex { display: inline-flex; align-items: center; gap: 7px; }
.warn-text { color: #b46b00; font-size: 11.5px; }
.error-text { color: #c23237; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.bar-line { height: 1px; background: var(--line); margin: 14px 0; }
.two-col-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.test-result { margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.7; background: var(--surface-2); border: 1px dashed var(--line-strong); }
.chip-btn { border: 1px solid var(--line-strong); background: #fff; color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 11.5px; }
.chip-btn:hover { border-color: #9db6f0; color: var(--brand); }
.quick-days { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.quick-days button { border: 1px solid var(--line-strong); background: #fff; border-radius: 9px; padding: 6px 13px; font-size: 12px; color: var(--muted); }
.quick-days button:hover { border-color: var(--brand); color: var(--brand); }
.login-error { display: none; padding: 10px 13px; border-radius: 10px; background: #fff2f2; border: 1px solid #f6d0d0; color: #a52a2e; font-size: 12px; line-height: 1.6; }
.login-error.show { display: block; }
.field-with-icon { position: relative; }
.field-with-icon > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .55; }
.field-with-icon .input { padding-left: 40px; }
/* 验证码输入框：验证码按钮固定在右侧，input flex:1 */
.form-field .field-with-icon:has(.captcha-img) { display: flex; align-items: center; gap: 0; }
.form-field .field-with-icon:has(.captcha-img) .input { padding-left: 14px; padding-right: 10px; min-width: 0; }
.captcha-img {
  width: 130px; height: 44px; flex: 0 0 130px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; cursor: pointer; padding: 0; overflow: hidden;
  display: grid; place-items: center; transition: border-color .15s, box-shadow .15s;
}
.captcha-img:hover { border-color: #8ba8ff; box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.captcha-img span, .captcha-img svg { display: block; width: 100%; height: 100%; }
/* 注册入口 */
.auth-switch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.auth-switch a { color: var(--brand); }
.auth-hint { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; color: var(--muted-2); line-height: 1.7; }
.mini-bar-row { display: flex; flex-direction: column; gap: 10px; }
.mini-bar-row .row { display: grid; grid-template-columns: 64px 1fr 32px; gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); }
.mini-bar-row .track { height: 8px; border-radius: 999px; background: #eef1f8; overflow: hidden; }
.mini-bar-row .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6b93ff, #2f6bff); }
.event-empty { padding: 26px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ---------- 移动端侧栏开关 ---------- */
.sidebar-toggle { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); }
.sidebar-toggle:hover { border-color: #9db6f0; color: var(--brand); }

@media (max-width: 1080px) {
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 820px) {
  .perm-grid, .settings-grid, .two-col-list { grid-template-columns: 1fr; }
}
