/* ============================================================
   base.css — 设计变量、重置与基础控件（工业浅色主题）
   ============================================================ */
:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel2: #f6f8fb;
  --border: #d8dee8;
  --border2: #e6eaf1;

  --text: #1c2430;
  --text2: #5b6675;
  --text3: #8a94a6;

  --accent: #1f6feb;
  --accent-deep: #1857c4;
  --accent-soft: #e8f0fe;
  --teal: #0ea5a4;
  --amber: #d97706;
  --red: #dc2626;
  --green: #16a34a;
  --purple: #8b5cf6;

  /* 节点分类色 */
  --cat-source: #3b82f6;
  --cat-process: #0ea5a4;
  --cat-output: #8b5cf6;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .14);
  --mono: "Cascadia Code", Consolas, "JetBrains Mono", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font: 13px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
.mono { font-family: var(--mono); }
.muted { color: var(--text3); }
.grow { flex: 1; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c3ccd9; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9b5c6; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--text);
  font-size: 12.5px; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
  user-select: none;
}
.btn:hover { background: var(--panel2); border-color: #c4cedb; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; flex: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-danger { color: var(--red); border-color: #f0c4c4; }
.btn-danger:hover { background: #fdf2f2; border-color: var(--red); }

.btn-icon { padding: 0; width: 28px; justify-content: center; }
.btn-mini { height: 22px; padding: 0 8px; font-size: 11.5px; border-radius: 5px; }

/* ---------- 表单 ---------- */
.field-input, .text-input {
  width: 100%; height: 26px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 12.5px;
  transition: border-color .12s, box-shadow .12s;
}
.field-input:focus, .text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
select.field-input { cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

/* ---------- 状态点 ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b6c0d0; flex: none; }
.dot-idle { background: #b6c0d0; }
.dot-active { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); animation: pulse 1.6s infinite; }
.dot-connected { background: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .15); }
.dot-recording { background: var(--amber); box-shadow: 0 0 0 3px rgba(217, 119, 6, .15); }
.dot-error { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- 面板标题 ---------- */
.panel-title {
  height: 34px; display: flex; align-items: center; padding: 0 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--text2);
  border-bottom: 1px solid var(--border2); background: var(--panel2);
  text-transform: uppercase;
}

/* ---------- 品牌 Logo ---------- */
.brand-logo { display: inline-flex; width: 30px; height: 30px; }
.brand-logo svg { width: 30px; height: 30px; }
