/* 706Subor_Console 前端主题 —— 参考 CyberStrikeAI 的浅色 SaaS 风（slate 调 + 蓝紫渐变）。 */
:root {
  --bg: #f1f5f9; --surface: #ffffff; --surface-alt: #f8fafc;
  --border: #e2e8f0; --border-hover: #cbd5e1;
  --text: #0f172a; --text-dim: #64748b; --text-muted: #94a3b8;
  --accent: #3b82f6; --accent-hover: #2563eb; --accent-dim: rgba(59,130,246,.08);
  --brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --green: #10b981; --green-dim: rgba(16,185,129,.1);
  --red: #ef4444; --red-dim: rgba(239,68,68,.1);
  --amber: #f59e0b; --amber-dim: rgba(245,158,11,.1);
  --purple: #8b5cf6;
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04); --shadow: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.1);
  --mono: 'SF Mono','JetBrains Mono','Fira Code','Cascadia Code',ui-monospace,monospace;
  --sans: -apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
#app { display: flex; min-height: 100vh; }

/* —— 侧边栏 —— */
.sidebar { width: 232px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border); }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand);
  display: grid; place-items: center; font-size: 18px; box-shadow: var(--shadow-sm); }
.sidebar .brand .name { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.sidebar .brand .name .sub { display: block; font-weight: 500; font-size: 11px; color: var(--text-muted); }
.nav { padding: 10px; flex: 1; overflow-y: auto; }
.nav .item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer; font-weight: 500; margin-bottom: 2px; user-select: none; }
.nav .item .ico { width: 18px; text-align: center; opacity: .8; }
.nav .item:hover { background: var(--surface-alt); color: var(--text); }
.nav .item.active { background: var(--accent-dim); color: var(--accent); }
.sidebar .foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }

/* —— 主区 —— */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 17px; margin: 0; font-weight: 650; }
.topbar .spacer { flex: 1; }
.topbar .mission-pick { color: var(--text-dim); font-size: 13px; }
.topbar .mission-pick code { color: var(--accent); }
.content { padding: 24px; max-width: 1180px; width: 100%; }

/* —— 卡片 —— */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 18px; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 650; }
.card .sub { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.between { justify-content: space-between; align-items: center; }
.grid { display: grid; gap: 14px; }

/* —— 表单 —— */
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; font: inherit; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* —— 按钮 —— */
button { font: inherit; cursor: pointer; border: none; border-radius: var(--radius-sm); }
.btn { background: var(--brand); color: #fff; padding: 9px 16px; font-weight: 600; box-shadow: var(--shadow-sm); }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; font-weight: 600; }
.btn-ghost:hover { border-color: var(--border-hover); background: var(--surface-alt); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }

/* —— 表格 —— */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-alt); }
code { font-family: var(--mono); font-size: 12px; color: var(--accent); background: var(--accent-dim);
  padding: 1px 6px; border-radius: 5px; }

/* —— 徽章 / 状态点 —— */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; }
.badge.green { background: var(--green-dim); color: var(--green); }
.badge.red { background: var(--red-dim); color: var(--red); }
.badge.amber { background: var(--amber-dim); color: var(--amber); }
.badge.blue { background: var(--accent-dim); color: var(--accent); }
.badge.gray { background: var(--surface-alt); color: var(--text-dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.dot.red { background: var(--red); }
.dot.gray { background: var(--text-muted); }

/* —— 结果色 —— */
.out-executed { color: var(--green); } .out-blocked_perimeter, .out-frozen_holdpoint { color: var(--purple); }
.out-denied_gate, .out-rejected_human { color: var(--amber); } .out-exec_failed { color: var(--red); }
.muted { color: var(--text-muted); } .ok { color: var(--green); } .bad { color: var(--red); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pager-info { font-size: 12px; color: var(--text-muted); }
.pager-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-num { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.pager-num:hover { border-color: var(--border-hover); }
.pager-num.active { background: var(--brand); color: #fff; border-color: var(--brand); }
/* —— 回查弹窗（完整输出）—— */
.modal-mask { position: fixed; inset: 0; z-index: 90; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { width: min(860px, 96vw); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 20px; }

/* —— 悬浮提示气泡（卡带/角色介绍）—— */
.tip { position: relative; cursor: help; }
.tip::after { content: attr(data-tip); position: absolute; left: 0; top: 100%; margin-top: 8px; z-index: 50;
  width: max-content; max-width: 360px; white-space: pre-wrap; text-align: left;
  background: #0b1220; color: #e2e8f0; font: 400 12px/1.55 var(--sans); font-weight: 400;
  padding: 9px 12px; border-radius: 8px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.tip:hover::after { opacity: 1; visibility: visible; transform: translateY(0); }

.kpi { display: flex; gap: 14px; flex-wrap: wrap; }
.kpi .box { flex: 1; min-width: 120px; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; }
.kpi .box .n { font-size: 24px; font-weight: 700; }
.kpi .box .l { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* —— 终端/控制台 —— */
.term { background: #0b1220; color: #cbd5e1; border-radius: var(--radius-sm); padding: 14px;
  font-family: var(--mono); font-size: 12.5px; height: 440px; overflow-y: auto; line-height: 1.6; }
.term .line { white-space: pre-wrap; }
.term .t { color: #64748b; } .term .star { color: var(--accent); }
.gate { background: var(--amber-dim); border: 1px solid var(--amber); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 12px; }
pre.report { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; max-height: 560px; overflow: auto; }

/* —— 登录 —— */
.login-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e293b, #312e81); }
.login-card { width: 340px; background: var(--surface, #fff); border-radius: 14px; padding: 28px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand .mark { font-size: 30px; }
.login-brand .lt { font-weight: 700; font-size: 16px; }
.login-brand .ls { font-size: 12px; color: var(--muted, #64748b); }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted, #64748b); }
.login-card input { padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; }
.login-card input:focus { border-color: var(--accent); }
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img { display: inline-flex; align-items: center; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; overflow: hidden; background: #f6f8fa; }
.captcha-img svg { display: block; }
.login-err { color: #dc2626; font-size: 12px; }
.login-card button { margin-top: 4px; padding: 10px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; letter-spacing: 2px; }
.login-card button:disabled { opacity: .6; cursor: default; }

.userchip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink, #1e293b); }
.userchip .role { font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-dim, #dbeafe); color: var(--accent); }
.userchip .logout { border: 1px solid var(--border); background: transparent; border-radius: var(--radius-sm);
  padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--muted, #64748b); }
.userchip .logout:hover { color: #dc2626; border-color: #dc2626; }

/* 单一/批量 分段切换 */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { background: var(--surface); color: var(--muted, #64748b); border: none; padding: 6px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent); color: #fff; }

/* 人工协同聊天框 */
.hintbox { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.hintbox h4 { margin: 0 0 8px; }
.hintlog { font-size: 13px; padding: 5px 8px; margin-top: 6px; border-radius: var(--radius-sm);
  background: var(--surface-alt, #f6f8fa); border-left: 3px solid var(--accent); }
.hintlog.q { border-left-color: #d97706; }
.hintlog.err { border-left-color: #dc2626; }

/* 卡带配置弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
  align-items: center; justify-content: center; z-index: 1000; }
.modal { background: var(--surface, #fff); border-radius: var(--radius, 10px); padding: 20px 22px;
  min-width: 480px; max-width: 90vw; box-shadow: 0 12px 40px rgba(0,0,0,.3); }

.dot.amber { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.18); }
