/* ============================================================
   复播智控台 · 剧本化推流引擎 — 暗色专业风
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
  --bg: #0b0f14;
  --bg-2: #0f141b;
  --card: #141a24;
  --card-2: #1a2230;
  --card-3: #202a3b;
  --border: #232c3a;
  --border-2: #2f3b4e;

  --text: #e6edf3;
  --text-dim: #8b98a9;
  --text-faint: #5d6b7d;

  --accent: #ff5a3c;        /* 直播红橙 */
  --accent-2: #f0883e;
  --info: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* 素材类型色 */
  --t-a: #34d399;  /* 开场暖场 */
  --t-b: #38bdf8;  /* 产品讲解 */
  --t-c: #fb923c;  /* 逼单循环 */
  --t-d: #a78bfa;  /* 答疑切片 */

  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: var(--text); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a4a61; }
::-webkit-scrollbar-track { background: transparent; }

.app { display: flex; height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 220px; min-width: 220px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid var(--border); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: 0 4px 14px rgba(255, 90, 60, .35);
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

.nav { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; text-align: left; transition: all .15s;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,90,60,.16), rgba(255,90,60,.04));
  border-color: rgba(255,90,60,.4); color: var(--text); font-weight: 600;
}
.nav-ico { width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600;
}
.nav-live {
  margin-left: auto; background: rgba(239,68,68,.15); color: var(--danger);
  font-size: 10px; padding: 1px 6px; border-radius: 4px; letter-spacing: 1px; font-weight: 700;
  animation: pulse 2s infinite;
}
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; }
.obs-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.obs-ping { margin-left: auto; color: var(--text-faint); font-family: var(--mono); font-size: 11px; }
.ver { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 6px rgba(34,197,94,.7); }
.dot.warn { background: var(--warn); box-shadow: 0 0 6px rgba(245,158,11,.7); }
.dot.bad { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,.7); }

/* ---------- 主区域 & 顶栏 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(11,15,20,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.date-chip, .clock { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.clock { color: var(--info); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--info), #6366f1);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff;
}

.view { flex: 1; overflow-y: auto; padding: 24px; display: none; }
.view.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sec-title { font-size: 16px; font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 600;
  border: 1px solid var(--border-2);
}
.badge.live { color: var(--accent); background: rgba(255,90,60,.12); border-color: rgba(255,90,60,.35); }
.badge.replay { color: var(--info); background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.35); }
.badge.offline { color: var(--text-faint); background: var(--card-2); }
.badge.ok { color: var(--ok); background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); }
.badge.warn { color: var(--warn); background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.35); }
.badge.danger { color: var(--danger); background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); }
.badge.t-a { color: var(--t-a); background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.35); }
.badge.t-b { color: var(--t-b); background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.35); }
.badge.t-c { color: var(--t-c); background: rgba(251,146,60,.1); border-color: rgba(251,146,60,.35); }
.badge.t-d { color: var(--t-d); background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.35); }

.btn {
  border: 1px solid var(--border-2); background: var(--card-2); color: var(--text);
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--card-3); border-color: #3a4a61; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.danger-solid { background: linear-gradient(135deg, #dc2626, var(--danger)); border-color: transparent; color: #fff; font-weight: 700; }
.btn.danger-solid:hover { filter: brightness(1.12); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.input, .select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; outline: none;
}
.input:focus, .select:focus { border-color: var(--info); box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.select { appearance: none; }

.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 20px; background: var(--card-3);
  border: 1px solid var(--border-2); transition: all .2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px;
  border-radius: 50%; background: var(--text-dim); transition: all .2s;
}
.switch input:checked + .slider { background: rgba(56,189,248,.25); border-color: var(--info); }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--info); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.switch-row .lbl { font-size: 13px; }
.switch-row .hint { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

input[type=range].wslide { width: 100%; accent-color: var(--accent-2); height: 4px; }
.weight-val { font-family: var(--mono); color: var(--info); font-size: 12px; font-weight: 700; }

/* ============================================================
   视图 1 · 总览 Dashboard
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; opacity: .07; }
.kpi.k1::after { background: var(--info); } .kpi.k2::after { background: var(--ok); }
.kpi.k3::after { background: var(--accent); } .kpi.k4::after { background: var(--danger); }
.kpi .k-label { font-size: 12px; color: var(--text-dim); }
.kpi .k-value { font-size: 28px; font-weight: 800; margin-top: 4px; font-family: var(--mono); }
.kpi .k-foot { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.kpi .k-foot.up { color: var(--ok); }
.kpi .k-foot.down { color: var(--danger); }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.room-list { display: flex; flex-direction: column; gap: 12px; }
.room-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; transition: border-color .15s;
}
.room-card:hover { border-color: var(--border-2); }
.room-card .room-ico {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--card-2);
}
.room-card .rm-main { flex: 1; min-width: 0; }
.room-card .rm-top { display: flex; align-items: center; gap: 8px; }
.room-card .rm-name { font-weight: 700; }
.room-card .rm-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.online {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--text);
}
.online .arrow { color: var(--ok); font-size: 12px; }
.risk-dot { width: 9px; height: 9px; border-radius: 50%; }
.risk-0 { background: var(--ok); } .risk-1 { background: var(--warn); }
.risk-2 { background: var(--accent-2); } .risk-3 { background: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,.8); }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--warn); border-radius: var(--radius-sm);
  padding: 11px 12px;
}
.alert-item.danger- { border-left-color: var(--danger); }
.alert-item .al-time { font-family: var(--mono); font-size: 11px; color: var(--text-faint); flex: none; padding-top: 2px; }
.alert-item .al-body { flex: 1; font-size: 13px; }
.alert-item .al-body b { font-weight: 600; }
.alert-item .al-body .desc { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

/* ============================================================
   视图 2 · 素材中心 Material
   ============================================================ */
.filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px;
}
.filter-bar .input, .filter-bar .select { width: auto; }
.filter-bar .f-actions { margin-left: auto; display: flex; gap: 8px; }
.chip-group { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--border-2); background: transparent; color: var(--text-dim);
  font-size: 12px; padding: 5px 12px; border-radius: 20px; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-faint); }
.chip.active { background: rgba(56,189,248,.12); border-color: var(--info); color: var(--info); font-weight: 600; }

.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.mat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s;
}
.mat-card:hover { transform: translateY(-3px); border-color: var(--border-2); }
.mat-cover { height: 92px; position: relative; display: flex; align-items: flex-end; }
.mat-cover .mat-type-tag {
  position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; color: #0b0f14;
}
.mat-cover .mat-len { position: absolute; right: 8px; bottom: 8px; font-family: var(--mono); font-size: 11px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 4px; }
.mat-cover .mat-ico { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 26px; opacity: .6; }
.mat-body { padding: 12px 14px 14px; }
.mat-body .mat-title { font-weight: 600; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mat-body .mat-meta { font-size: 12px; color: var(--text-dim); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.mat-body .mat-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11px; color: var(--text-dim); background: var(--card-2);
  border: 1px solid var(--border); padding: 1px 8px; border-radius: 5px;
}
.path-bar {
  margin-top: 18px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px dashed var(--border-2); border-radius: var(--radius-sm);
  padding: 10px 14px; font-family: var(--mono); font-size: 12px; color: var(--text-dim);
}

/* ============================================================
   视图 3 · 智能编排 Scheduler
   ============================================================ */
.sch-grid { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.form-card .card-title { margin-bottom: 18px; }
.weights { display: flex; flex-direction: column; gap: 12px; }
.weight-row .wr-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.weight-row .wr-top .wr-name { display: flex; align-items: center; gap: 7px; }
.wr-dot { width: 9px; height: 9px; border-radius: 3px; }

.timeline-card .tc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-bar {
  display: flex; height: 40px; width: 100%;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; position: relative;
}
.tl-seg {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #0b0f14; font-weight: 700; overflow: hidden; white-space: nowrap;
  border-right: 1px solid rgba(0,0,0,.25); position: relative; cursor: pointer;
}
.tl-seg:hover { filter: brightness(1.18); z-index: 2; }
.tl-seg .tl-t { position: absolute; top: 2px; left: 4px; font-size: 9px; font-weight: 600; opacity: .75; }
.tl-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.tl-legend .lg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.tl-legend .lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ok-note {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.3);
  color: var(--ok); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12px;
}
.plan-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.plan-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.plan-item .pi-main { flex: 1; min-width: 0; }
.plan-item .pi-name { font-weight: 600; }
.plan-item .pi-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ============================================================
   视图 4 · 排期日历 Schedule
   ============================================================ */
.cal-wrap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; overflow: auto;
}
.cal-days { display: grid; grid-template-columns: 52px repeat(7, 1fr); gap: 2px; margin-bottom: 10px; }
.cal-days .cd-h { text-align: center; font-size: 12px; color: var(--text-dim); padding: 6px 0; border-radius: 6px; }
.cal-days .cd-h.today { background: rgba(255,90,60,.14); color: var(--accent); font-weight: 700; }
.cal-grid {
  display: grid; grid-template-columns: 52px repeat(7, 1fr); gap: 2px;
  position: relative; min-width: 720px;
}
.cal-axis { font-family: var(--mono); font-size: 10px; color: var(--text-faint); display: flex; align-items: start; justify-content: flex-end; padding-right: 8px; height: 32px; }
.cal-cell { height: 32px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 4px; position: relative; }
.cal-cell:hover { border-color: var(--border-2); }
.strategy-band { position: absolute; left: 0; right: 0; border-radius: 8px; z-index: 0; pointer-events: none; }
.band-gold { background: linear-gradient(180deg, rgba(255,146,60,.16), rgba(255,146,60,.06)); border: 1px dashed rgba(255,146,60,.45); }
.band-night { background: linear-gradient(180deg, rgba(56,189,248,.14), rgba(56,189,248,.05)); border: 1px dashed rgba(56,189,248,.4); }
.band-lbl { position: absolute; left: 8px; top: 3px; font-size: 10px; color: var(--text-dim); font-weight: 600; letter-spacing: .5px; }
.sched-block {
  position: absolute; z-index: 1; border-radius: 6px;
  padding: 3px 6px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(255,255,255,.14);
  transition: filter .15s;
}
.sched-block:hover { filter: brightness(1.15); }
.sched-block .sb-t { font-size: 10px; font-weight: 700; white-space: nowrap; }
.sched-block .sb-s { font-size: 9px; opacity: .8; white-space: nowrap; }
.cal-legend { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.cal-legend .lg { display: flex; align-items: center; gap: 6px; }
.cal-legend .lg i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

/* ============================================================
   视图 5 · 推流控制台 Console
   ============================================================ */
.console-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.console-top .room-sel { width: 220px; }
.console-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
.stage {
  background: #05070a; border: 1px solid var(--border); border-radius: var(--radius);
  aspect-ratio: 16 / 9; position: relative; overflow: hidden;
}
.stage-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 500px at 20% 20%, rgba(56,189,248,.14), transparent 60%),
    radial-gradient(900px 500px at 85% 85%, rgba(255,90,60,.16), transparent 60%),
    linear-gradient(180deg, #0c1320, #05070a);
}
.stage-emoji { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); font-size: 72px; opacity: .85; filter: drop-shadow(0 10px 30px rgba(0,0,0,.6)); }
.stage-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%); background-size: 250% 100%; animation: shine 5s linear infinite; }
@keyframes shine { 0% { background-position: 150% 0; } 100% { background-position: -150% 0; } }

.stage-ol { position: absolute; z-index: 3; font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,.92); text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.ol-time { top: 12px; left: 14px; background: rgba(0,0,0,.45); padding: 4px 9px; border-radius: 6px; display: flex; align-items: center; gap: 7px; }
.ol-time .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
.ol-online { top: 12px; right: 14px; background: rgba(0,0,0,.45); padding: 4px 9px; border-radius: 6px; }
.ol-bgm { bottom: 12px; left: 14px; background: rgba(0,0,0,.45); padding: 4px 9px; border-radius: 6px; color: #a5f3fc; }
.ol-flag { bottom: 12px; right: 14px; background: rgba(0,0,0,.45); padding: 4px 9px; border-radius: 6px; letter-spacing: 1px; }
.stage-status { position: absolute; left: 14px; top: 46px; z-index: 3; }
.stage .takeover-flag {
  position: absolute; inset: 0; z-index: 4; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  background: radial-gradient(ellipse at center, rgba(239,68,68,.28), rgba(5,7,10,.75));
}
.stage.takenover .takeover-flag { display: flex; }
.takeover-flag .tf-t { font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 0 20px rgba(239,68,68,.8); }
.takeover-flag .tf-s { font-size: 13px; color: rgba(255,255,255,.85); }

.console-info {
  margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.ci-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.ci-card .ci-l { font-size: 11px; color: var(--text-faint); }
.ci-card .ci-v { font-size: 15px; font-weight: 700; margin-top: 3px; font-family: var(--mono); }

.controls {
  margin-top: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.ctrl-row { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 6px; background: var(--card-3); border-radius: 3px; overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.ctrl-time { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--card-2); border: 1px solid var(--border-2); color: var(--text);
  font-size: 15px; transition: all .15s;
}
.icon-btn:hover { background: var(--card-3); border-color: #3a4a61; }
.icon-btn.play { width: 46px; height: 46px; font-size: 17px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }

.takeover-panel {
  background: linear-gradient(160deg, rgba(239,68,68,.12), rgba(239,68,68,.02));
  border: 1px solid rgba(239,68,68,.4); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.takeover-panel .tp-t { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.btn-takeover {
  width: 100%; padding: 18px 10px; border-radius: 12px;
  background: linear-gradient(135deg, #dc2626, var(--danger));
  border: 1px solid rgba(255,255,255,.15); color: #fff;
  font-size: 18px; font-weight: 800; letter-spacing: 2px;
  box-shadow: 0 8px 28px rgba(239,68,68,.4); transition: all .15s;
}
.btn-takeover:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 12px 34px rgba(239,68,68,.5); }
.btn-takeover:active { transform: translateY(0); }
.takeover-panel .tp-hint { font-size: 11px; color: var(--text-faint); margin-top: 10px; line-height: 1.6; }

.queue { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.queue-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 12px;
}
.queue-item .q-idx { font-family: var(--mono); color: var(--text-faint); font-size: 11px; width: 18px; }
.queue-item .q-bar { width: 4px; height: 30px; border-radius: 2px; flex: none; }
.queue-item .q-main { flex: 1; min-width: 0; }
.queue-item .q-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item .q-s { color: var(--text-faint); font-size: 11px; }
.queue-item.current { border-color: var(--accent); background: rgba(255,90,60,.06); }
.queue-item.current .q-t { color: var(--accent); }
.queue-item.done { opacity: .45; }

/* ============================================================
   视图 6 · 互动应答 Interaction
   ============================================================ */
.int-grid { display: grid; grid-template-columns: 280px 1fr 280px; gap: 16px; align-items: start; }
.rule-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 8px;
}
.rule-item .rl-badge { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 6px; color: #0b0f14; flex: none; }
.rule-item .rl-kw { font-family: var(--mono); font-size: 12px; flex: 1; }
.rule-item .rl-count { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.rule-item .rl-del { background: none; border: none; color: var(--text-faint); font-size: 14px; }
.rule-item .rl-del:hover { color: var(--danger); }

.barrage-window {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  height: 600px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.barrage {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; animation: barIn .25s ease;
}
@keyframes barIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.barrage .b-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.barrage .b-name { font-size: 12px; color: var(--text-dim); }
.barrage .b-text { font-size: 13px; margin-top: 2px; }
.barrage .b-time { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-faint); flex: none; }
.barrage.hit { border-color: var(--accent); background: rgba(255,90,60,.08); }
.barrage.hit .b-text { color: #ffd9cf; }
.kw-hl { color: var(--accent-2); font-weight: 700; }
.barrage .b-cut { margin-left: 8px; }
.barrage .b-more { position: relative; }

.cut-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px;
}
.cut-card .cc-bar { width: 4px; height: 30px; border-radius: 2px; flex: none; }
.cut-card .cc-main { flex: 1; min-width: 0; }
.cut-card .cc-t { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-card .cc-s { font-size: 11px; color: var(--text-faint); }

/* ============================================================
   Modal / Toast
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(4,7,11,.7);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  animation: fadeIn .18s ease;
}
.modal-mask[hidden], .modal[hidden] { display: none !important; }
.modal {
  position: fixed; z-index: 101; width: min(480px, 92vw);
  background: var(--card); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  padding: 22px 24px; animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal .m-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.modal .m-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; line-height: 1.6; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toast-wrap { position: fixed; top: 70px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card); border: 1px solid var(--border-2); border-left: 3px solid var(--info);
  border-radius: var(--radius-sm); padding: 11px 16px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: toastIn .25s ease;
  display: flex; align-items: center; gap: 9px; max-width: 340px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .3s; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .dash-grid, .console-grid { grid-template-columns: 1fr; }
  .int-grid { grid-template-columns: 1fr; }
  .sch-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { width: 64px; min-width: 64px; }
  .brand-txt, .nav-item span:not(.nav-ico), .sidebar-foot { display: none; }
  .nav-item { justify-content: center; }
}
