/* ============================================================
   关澜协同中枢 · Design Tokens（国际企业级设计体系）
   Light: 商务沟通 / Dark: 审图会议
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* 品牌与语义色 */
  --brand: #1D4ED8;
  --brand-strong: #1E40AF;
  --brand-soft: #EEF2FF;
  --brand-border: #E0E7FF;
  --emerald: #059669;
  --emerald-soft: #ECFDF5;
  --emerald-border: #A7F3D0;
  --amber: #B45309;
  --amber-soft: #FFFBEB;
  --amber-border: #FDE68A;
  --amber-fill: #FEF3C7;
  --red: #DC2626;
  --red-soft: #FEF2F2;
  --red-border: #FECACA;
  --slate-soft: #F1F5F9;
  --slate-border: #E2E8F0;

  /* Light 主题表面 */
  --canvas: #F8FAFC;
  --panel: #FFFFFF;
  --panel-2: #FCFDFF;
  --line: #E2E8F0;
  --line-soft: #EDF2F7;
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;

  /* Dark（关澜会议 · 审图模式） */
  --d-canvas: #0B0F19;
  --d-panel: #101623;
  --d-panel-2: #151D2E;
  --d-line: rgba(148, 163, 184, .14);
  --d-line-soft: rgba(148, 163, 184, .08);
  --d-ink: #E5E7EB;
  --d-ink-2: #9CA3AF;
  --d-ink-3: #6B7280;
  --d-brand: #60A5FA;
  --d-brand-soft: rgba(96, 165, 250, .12);

  /* 字体与度量 */
  --font: 'Inter', -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 16px 48px -12px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px; line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(29, 78, 216, .16); }

/* 细滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 图标 ---------- */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 22px; height: 22px; }

/* ---------- 通用元素 ---------- */
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  transition: all .15s ease; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--slate-soft); color: var(--ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn-ghost:hover { background: var(--slate-soft); }
.btn-danger { color: var(--red); border-color: var(--red-border); background: var(--red-soft); }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: .01em;
  border: 1px solid var(--line); background: var(--slate-soft); color: var(--ink-2);
}
.chip-blue   { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand); }
.chip-green  { background: var(--emerald-soft); border-color: var(--emerald-border); color: var(--emerald); }
.chip-amber  { background: var(--amber-fill); border-color: var(--amber-border); color: var(--amber); }
.chip-red    { background: var(--red-soft); border-color: var(--red-border); color: var(--red); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #64748B, #334155);
}
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Toast / Modal ---------- */
#toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 8px; max-width: 460px;
  padding: 10px 16px; border-radius: var(--r-md);
  background: #0F172A; color: #F8FAFC; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: toast-in .25s ease;
}
.toast.warn { background: #7C2D12; }
.toast.ok { background: #064E3B; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15, 23, 42, .44); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(520px, calc(100vw - 48px)); max-height: 82vh; overflow: auto;
  background: var(--panel); border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: modal-in .22s cubic-bezier(.16, 1, .3, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 16px 20px 20px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--ink-3); }
.icon-btn:hover { background: var(--slate-soft); color: var(--ink); }

.divider-v { width: 1px; align-self: stretch; background: var(--line); }
.kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  background: var(--panel-2); color: var(--ink-3);
}
@keyframes pulse-dot { 50% { opacity: .35; } }
.pulse { animation: pulse-dot 1.6s ease infinite; }
