/* ================================================================
   Nova Edge Design System — AI Agent 需求采集工作台
   设计语言来自 Nova Edge UI Template v1.0
   ================================================================ */

/* ──────────────────────────────────────────────
   1. DESIGN TOKENS
   ────────────────────────────────────────────── */
:root {
  /* Nova Edge 主色 — 深海军蓝 */
  --primary-950: #020912;
  --primary-900: #050E28;
  --primary-800: #0A1B3D;
  --primary-700: #14264A;
  --primary-600: #243657;

  /* 强调色 — 电光蓝 */
  --accent:      #0A5FEF;
  --accent-600:  #1A6BFF;
  --accent-pale: #E7EFFD;
  --accent-mist: #F2F6FD;

  /* 暖金色 — 高端点缀 */
  --gold:        #C8A35B;
  --gold-soft:   rgba(200,163,91,.12);
  --gold-border: rgba(200,163,91,.32);

  /* 语义色（功能性保留）*/
  --teal:        #0a8c7c;
  --teal-soft:   #e5f4f1;
  --red:         #b03010;
  --red-soft:    #fceeea;
  --violet:      #5e30a0;
  --violet-soft: #f0e9fb;

  /* 文字 */
  --ink:   #0A1B3D;
  --ink-2: #46556F;
  --ink-3: #7C8AA3;

  /* 背景 */
  --paper:  #FBFCFE;
  --mist:   #EEF2F9;
  --line:   #DCE4F0;
  --line-2: #C9D5E6;

  /* 兼容旧变量名 */
  --surface:      #ffffff;
  --surface-soft: #EEF2F9;
  --navy:         #0A1B3D;
  --blue:         #0A5FEF;
  --blue-soft:    #E7EFFD;
  --muted:        #7C8AA3;

  /* 字体 */
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --sans:  'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;

  /* 圆角 */
  --r-sm:  6px;
  --r:     10px;
  --r-lg:  16px;
  --r-pill: 100px;
  --radius: 10px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(10,27,61,.06), 0 1px 2px rgba(10,27,61,.04);
  --shadow:    0 8px 30px rgba(10,27,61,.08);
  --shadow-lg: 0 20px 60px rgba(10,27,61,.14);

  /* 布局 */
  --nav-w: 228px;
}

/* ──────────────────────────────────────────────
   2. RESET & BASE
   ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }

h2, h3, h4 { margin: 0; font-weight: 700; color: var(--navy); }

p { margin: 0; }

/* ──────────────────────────────────────────────
   3. SIGNATURE ELEMENT — Edge Stripe
   ────────────────────────────────────────────── */
.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 2px;
}

/* ──────────────────────────────────────────────
   4. NAVIGATION SIDEBAR
   ────────────────────────────────────────────── */
.nav-sidebar {
  width: var(--nav-w);
  min-height: 100vh;
  background: var(--primary-900);
  color: rgba(231,238,249,.75);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}

/* 顶部斜切装饰条 */
.nav-sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}

.brand-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}

.brand-sub {
  font-size: 10px;
  color: rgba(231,238,249,.4);
  margin-top: 1px;
}

.nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: rgba(231,238,249,.5);
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(231,238,249,.88);
}

.nav-item.active {
  background: rgba(10,95,239,.18);
  color: #fff;
  font-weight: 700;
}

/* 激活项左侧斜切蓝条 */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  clip-path: polygon(0 0, 100% 12%, 100% 88%, 0 100%);
}

.nav-num {
  font-size: 10px;
  font-weight: 800;
  color: rgba(231,238,249,.3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  letter-spacing: .04em;
}

.nav-item.active .nav-num { color: rgba(110,160,255,.75); }

.nav-label { font-size: 12.5px; }

.nav-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(231,238,249,.45);
  transition: color .2s;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(231,238,249,.2);
  flex-shrink: 0;
  transition: background .2s, box-shadow .2s;
}

/* 未连接：灰色 */
.status-dot.offline { background: rgba(231,238,249,.25); box-shadow: none; }

/* 已连接：绿色 + 呼吸光圈 */
.status-dot.online {
  background: #2ec26f;
  box-shadow: 0 0 0 3px rgba(46,194,111,.22);
  animation: dot-breathe 1.8s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46,194,111,.22); }
  50%       { box-shadow: 0 0 0 5px rgba(46,194,111,.05); }
}

/* ──────────────────────────────────────────────
   5. APP SHELL
   ────────────────────────────────────────────── */
.app {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px;
}

.view.active { display: flex; }

/* View header */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.view-header h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 6px;
}

.view-header .eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.view-header .eyebrow::before {
  content: '';
  width: 18px;
  height: 6px;
  background: var(--accent);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────
   6. WORKSPACE (Tab 01)
   ────────────────────────────────────────────── */
#workspace { overflow: hidden; padding: 0; }

#workspace.active {
  display: flex;
  flex-direction: column;
}

/* Task bar */
.task-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: var(--primary-800);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.task-name-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.task-name-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(231,238,249,.4);
  white-space: nowrap;
  flex-shrink: 0;
}

.task-name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.06);
  color: #fff;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: border-color .15s, background .15s;
}

.task-name-input::placeholder { color: rgba(231,238,249,.28); }

.task-name-input:focus {
  border-color: var(--accent);
  background: rgba(10,95,239,.1);
}

.task-bar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* Progress badge */
.progress-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,.07);
  color: rgba(231,238,249,.5);
  white-space: nowrap;
}

.progress-badge.done {
  background: rgba(10,140,124,.22);
  color: #5fd4c3;
}

/* Three-column workspace */
.workspace-cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 256px minmax(300px, 0.8fr) minmax(440px, 1.2fr);
  overflow: hidden;
}

.col {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.col:last-child { border-right: none; }

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 11px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.col-title {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
}

/* ──────────────────────────────────────────────
   7. NODE LIST (Left Column)
   ────────────────────────────────────────────── */
.node-list {
  flex: 1;
  padding: 6px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.node-list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-3);
  padding: 24px 16px;
  text-align: center;
}

.node-list-empty .empty-icon { font-size: 28px; opacity: .2; }
.node-list-empty p { font-size: 12px; line-height: 1.6; }

.node-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}

.node-item:hover { background: var(--accent-mist); }

.node-item.selected {
  background: var(--accent-pale);
  box-shadow: inset 3px 0 0 var(--accent);
}

.node-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--mist);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.node-item.selected .node-num { background: var(--accent); color: #fff; }
.node-item.completed .node-num { background: var(--teal); color: #fff; }

.node-name-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.node-item.selected .node-name-input { color: var(--accent); font-weight: 700; }

.node-name-input:focus {
  background: rgba(10,95,239,.05);
  border-radius: 4px;
  padding: 0 4px;
  cursor: text;
}

.node-delete-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .12s, background .12s, color .12s;
}

.node-item:hover .node-delete-btn { opacity: 1; }
.node-delete-btn:hover { background: var(--red-soft); color: var(--red); }

/* Insert slots */
.insert-slot {
  padding: 1px 8px;
  opacity: 0;
  transition: opacity .15s;
}

.node-list:hover .insert-slot { opacity: 1; }

.insert-slot-btn {
  width: 100%;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-size: 10.5px;
  padding: 3px 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, color .12s, background .12s;
}

.insert-slot-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-mist);
}

/* Bulk node input */
.bulk-node-box {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}

.bulk-node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.field-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
}

.bulk-node-box textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 10px;
  font-size: 12.5px;
  resize: none;
  height: 96px;
  outline: none;
  transition: border-color .15s;
  line-height: 1.6;
}

.bulk-node-box textarea:focus { border-color: var(--accent); }
.bulk-node-box textarea::placeholder { color: var(--ink-3); }

/* Mic button */
.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}

.mic-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-mist);
}

.mic-btn.recording {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  animation: pulse-ring 1.4s ease infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176,48,16,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(176,48,16,0); }
}

/* ──────────────────────────────────────────────
   8. CARDS COLUMN (Middle)
   ────────────────────────────────────────────── */
.cards-list {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cards-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

.flow-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.flow-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.flow-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,95,239,.1);
}

.flow-card.completed { border-color: var(--teal); }

.flow-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.flow-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.flow-card.completed .flow-card-num { background: var(--teal); }
.flow-card.selected  .flow-card-num { background: var(--accent); }

.flow-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-card-check { font-size: 12px; color: var(--teal); flex-shrink: 0; }

.flow-card-owner { font-size: 11px; color: var(--ink-3); margin-bottom: 6px; }

.flow-card-fields { display: flex; flex-direction: column; gap: 4px; }

.flow-card-field {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flow-card-field strong {
  color: var(--accent);
  font-size: 10px;
  display: block;
  margin-bottom: 1px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ──────────────────────────────────────────────
   9. CAPTURE PANEL (Right Column)
   ────────────────────────────────────────────── */
.col-capture {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.capture-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-3);
  padding: 40px 24px;
  text-align: center;
}

.capture-empty-arrow { font-size: 32px; opacity: .15; }

.capture-empty h3 {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-2);
  font-weight: 600;
}

.capture-empty p { font-size: 13px; line-height: 1.65; }

.capture-active {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Capture node header */
.capture-node-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--primary-800);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.capture-node-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 200px at 90% 0, rgba(10,95,239,.2), transparent 60%);
  pointer-events: none;
}

.capture-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  color: rgba(231,238,249,.65);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
}

.capture-badge.done { background: var(--teal); color: #fff; }

.capture-node-info { flex: 1; min-width: 0; position: relative; }

.capture-node-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.capture-node-owner {
  font-size: 11px;
  color: rgba(231,238,249,.45);
  margin-top: 2px;
}

.capture-done-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: rgba(10,140,124,.25);
  color: #5fd4c3;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

/* Guide strip */
.guide-strip {
  padding: 10px 16px;
  background: var(--accent-mist);
  border-bottom: 1px solid var(--accent-pale);
  flex-shrink: 0;
}

.guide-strip-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.guide-strip-label::before {
  content: '';
  width: 14px;
  height: 5px;
  background: var(--accent);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}

.guide-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid var(--accent-pale);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

/* Recorder block */
.recorder-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.record-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}

.record-btn:hover { border-color: var(--red); background: var(--red-soft); }

.record-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
}

.record-btn.recording {
  border-color: var(--red);
  background: var(--red);
  animation: pulse-ring 1.4s ease infinite;
}

.record-btn.recording .record-dot {
  background: #fff;
  border-radius: 3px;
  width: 11px;
  height: 11px;
}

.recorder-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.record-state { font-size: 13px; font-weight: 700; color: var(--ink); }

.record-timer {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-family: 'Cascadia Code', Consolas, monospace;
}

.recorder-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* Transcript / Field blocks */
.field-block {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.field-block .field-label { margin-bottom: 7px; display: block; }

.field-block textarea,
.field-block input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 11px;
  font-size: 13px;
  resize: none;
  outline: none;
  transition: border-color .15s, background .15s;
  line-height: 1.6;
}

.field-block textarea { height: 96px; }

.field-block textarea:focus,
.field-block input:focus { border-color: var(--accent); background: #fff; }

.field-block textarea::placeholder,
.field-block input::placeholder { color: var(--ink-3); }

/* AI Extract button */
.ai-extract-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 10px 16px;
  padding: 10px 0;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--accent);
  background: var(--accent-mist);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s cubic-bezier(.2,.7,.3,1);
  flex-shrink: 0;
}

.ai-extract-btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(10,95,239,.28);
  transform: translateY(-1px);
}

.ai-extract-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: .6; }
  50%       { opacity: .85; }
}

/* Structured fields section */
.fields-section {
  padding: 0 16px 14px;
  flex-shrink: 0;
}

.fields-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.fields-hint { font-size: 11px; color: var(--ink-3); }

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-item { display: flex; flex-direction: column; gap: 5px; }
.field-item.full { grid-column: 1 / -1; }
.field-item .field-label { margin-bottom: 0; }

.field-item input,
.field-item textarea {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, background .15s;
  width: 100%;
  line-height: 1.55;
}

.field-item textarea { resize: none; height: 68px; }

.field-item input:focus,
.field-item textarea:focus { border-color: var(--accent); background: #fff; }

.field-item input::placeholder,
.field-item textarea::placeholder { color: var(--ink-3); }

/* Save button */
.save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 16px 18px;
  padding: 13px 0;
  border-radius: var(--r-pill);
  border: none;
  background: var(--primary-800);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s cubic-bezier(.2,.7,.3,1);
  flex-shrink: 0;
  letter-spacing: .01em;
}

.save-btn:hover {
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(10,95,239,.28);
  transform: translateY(-1px);
}

.save-btn::after { content: ' →'; }

/* ──────────────────────────────────────────────
   10. BUTTONS
   ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 14px;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s cubic-bezier(.2,.7,.3,1);
}

.btn:hover { border-color: var(--line); background: var(--mist); }

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

.btn.primary:hover {
  background: var(--accent-600);
  border-color: var(--accent-600);
  box-shadow: 0 6px 18px rgba(10,95,239,.3);
  transform: translateY(-1px);
}

.btn.sm { min-height: 26px; padding: 0 11px; font-size: 11.5px; }

.btn.danger {
  color: var(--red);
  border-color: #edb4a8;
  background: var(--red-soft);
}

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

.icon-btn-round {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

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

/* ──────────────────────────────────────────────
   11. OUTPUT VIEW (Tab 02)
   ────────────────────────────────────────────── */
.output-block {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.output-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--mist);
}

.output-block-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}

.board-note { font-size: 12px; color: var(--ink-3); }

.ai-draft-empty {
  padding: 28px 24px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

.ai-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  padding: 20px;
}

.ai-flow-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: box-shadow .15s, transform .15s;
}

.ai-flow-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.ai-flow-card .card-num {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  line-height: 1;
}

.ai-flow-card h4 { font-size: 13px; margin-bottom: 4px; }
.ai-flow-card p  { font-size: 11.5px; color: var(--ink-3); }
.ai-flow-card small { font-size: 10.5px; color: var(--ink-3); }

.ai-flow-card.ai-auto   { border-color: var(--teal); background: var(--teal-soft); }
.ai-flow-card.ai-assist { border-color: var(--accent); }
.ai-flow-card.new       { border-color: var(--gold); background: var(--gold-soft); }
.ai-flow-card.external  { border-style: dashed; }

/* Diagnosis summary */
.diagnosis-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.summary-card {
  padding: 18px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.summary-card:last-child { border-right: none; }

.sum-num {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.summary-card strong { font-size: 12.5px; display: block; margin-bottom: 3px; }
.summary-card p { font-size: 11px; color: var(--ink-3); }

/* Agent grid */
.agent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
}

.agent-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.agent-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.agent-card h4 {
  font-family: var(--serif);
  font-size: 14px;
  margin-bottom: 6px;
}

.agent-card > p { font-size: 12.5px; color: var(--ink-2); margin-bottom: 14px; }

.kv { display: flex; flex-direction: column; gap: 0; }

.kv-row {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.kv-row:last-child { border-bottom: none; }

.kv-row span {
  width: 64px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 1px;
}

.kv-row strong { flex: 1; color: var(--ink-2); font-weight: 500; line-height: 1.5; }

/* Submit bar */
.submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary-900), var(--primary-800));
  border-radius: var(--r-lg);
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.submit-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 300px at 80% 50%, rgba(10,95,239,.18), transparent 60%);
  pointer-events: none;
}

.submit-bar strong {
  display: block;
  font-size: 15px;
  font-family: var(--serif);
  color: #fff;
  margin-bottom: 4px;
}

.submit-bar p { font-size: 12px; color: rgba(231,238,249,.5); }

/* ──────────────────────────────────────────────
   12. REFERENCE VIEW (Tab 03)
   ────────────────────────────────────────────── */
.case-note {
  background: rgba(200,163,91,.08);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  font-size: 13px;
  color: #5a4000;
  margin-bottom: 20px;
  line-height: 1.6;
}

.ref-flow {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 18px;
}

.ref-flow-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.ref-flow-row:last-child { border-bottom: none; }

.ref-flow-label {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  border-right: 1px solid var(--line);
  letter-spacing: .04em;
}

.ref-flow-label.muted { background: var(--mist); color: var(--ink-3); }
.ref-flow-label.ai    { background: var(--accent-pale); color: var(--accent); }

.flow-track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  overflow-x: auto;
}

.flow-node {
  flex: 0 0 100px;
  min-height: 64px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 7px 8px;
  background: var(--surface);
}

.flow-node strong { display: block; font-size: 11.5px; color: var(--navy); line-height: 1.35; }
.flow-node span   { display: block; font-size: 10px; color: var(--ink-3); margin-top: 3px; }

.flow-node.ai-auto   { border-color: var(--teal); background: var(--teal); }
.flow-node.ai-auto strong, .flow-node.ai-auto span { color: #fff; }
.flow-node.ai-assist { border-color: var(--accent); }
.flow-node.ai-assist strong { color: var(--accent); }
.flow-node.external  { border-style: dashed; background: var(--mist); }
.flow-node.new       { border-color: var(--gold); background: var(--gold); }
.flow-node.new strong, .flow-node.new span { color: #fff; }
.flow-node.gap       { border-style: dashed; border-color: #edb4a8; background: var(--red-soft); }

/* Reference tabs */
.ref-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--line);
}

.rtab {
  min-height: 32px;
  border: none;
  background: transparent;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.rtab:hover { color: var(--ink); }
.rtab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: 13px;
}

.table th {
  text-align: left;
  background: var(--primary-800);
  color: rgba(255,255,255,.7);
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 700;
}

.table td {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
  color: var(--ink-2);
}

.table tr:nth-child(even) td { background: var(--mist); }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 800;
}

.pill.confirmed { color: var(--teal);   background: var(--teal-soft); }
.pill.missing   { color: var(--red);    background: var(--red-soft); }
.pill.unclear   { color: var(--gold);   background: var(--gold-soft); }
.pill.human     { color: var(--violet); background: var(--violet-soft); }

/* ──────────────────────────────────────────────
   13. SETTINGS VIEW (Tab 04)
   ────────────────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.settings-layout .wide { grid-column: 1 / -1; }

.panel {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel .eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel .eyebrow::before {
  content: '';
  width: 16px;
  height: 5px;
  background: var(--accent);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}

.panel h3 {
  font-family: var(--serif);
  font-size: 16px;
  margin: 6px 0 14px;
}

.settings-list { display: flex; flex-direction: column; gap: 10px; }

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.settings-list span   { color: var(--ink-3); font-size: 13px; }
.settings-list strong { font-size: 13px; }

/* ARK / ECS config form */
.ark-config-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ark-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.ark-field span {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ark-field em { font-style: normal; font-weight: 400; opacity: .65; }

.ark-field input {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
  font-size: 13px;
  font-family: 'Cascadia Code', Consolas, monospace;
  transition: border-color .14s;
}

.ark-field input:focus { border-color: var(--accent); background: #fff; }

.ark-status     { font-size: 12px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.ark-status.ok  { color: var(--teal); }

.schema-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

code {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line);
  background: var(--mist);
  color: var(--accent);
  font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 11.5px;
}

/* ──────────────────────────────────────────────
   14. RESULTS VIEW (Tab 05)
   ────────────────────────────────────────────── */
.results-task-id {
  font-size: 11px;
  color: var(--ink-3);
  font-family: 'Cascadia Code', Consolas, monospace;
  margin-top: 4px;
}

.results-status     { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.results-status.ok  { color: var(--teal); }
.results-status.warn { color: var(--gold); }

.results-list { display: flex; flex-direction: column; gap: 14px; }
/* 合并视图：节点优化结果在 output-block 内需要内边距 */
.output-block .results-list { padding: 16px; }
.output-block .results-list .ai-draft-empty { padding: 20px 0; }

.result-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .15s;
}

.result-card:hover { box-shadow: var(--shadow); }

.result-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}

.result-node-name {
  flex: 1;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--navy);
}

.result-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 800;
  background: var(--gold-soft);
  color: var(--gold);
}

.result-status-badge.done  { background: var(--teal-soft); color: var(--teal); }
.result-status-badge.error { background: var(--red-soft);  color: var(--red); }

.result-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.result-col {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}

.result-col:last-child { border-right: none; }
.result-col.result-col-pending { background: var(--mist); }

.result-col-head {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.result-field { margin-bottom: 10px; }

.result-field label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin-bottom: 3px;
}

.result-field p      { font-size: 12.5px; color: var(--ink); line-height: 1.55; }
.result-field p em   { color: var(--ink-3); font-style: italic; }

.result-pending { font-size: 13px; color: var(--ink-3); font-style: italic; padding: 16px 0; }

.agent-spec-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* 人机协作核心章节高亮 */
.agent-spec-box.star {
  margin-top: 14px;
  padding: 12px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent-mist);
}

.agent-spec-head {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-spec-head::before {
  content: '';
  width: 14px;
  height: 5px;
  background: var(--accent);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
  flex-shrink: 0;
}

/* 自动化层级标签 */
.mode-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 12px;
  margin-bottom: 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.mode-chip.mode-ai-auto   { background: var(--teal-soft);   color: var(--teal); }
.mode-chip.mode-ai-assist { background: var(--accent-pale); color: var(--accent); }
.mode-chip.mode-new       { background: var(--gold-soft);   color: var(--gold); }
.mode-chip.mode-external  { background: var(--mist);        color: var(--ink-3); }

.transcript-detail { border-top: 1px solid var(--line); }

.transcript-detail summary {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.transcript-detail summary::marker,
.transcript-detail summary::-webkit-details-marker { display: none; }

.transcript-detail pre {
  padding: 12px 20px;
  font-size: 12px;
  font-family: var(--sans);
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink-2);
  line-height: 1.65;
  background: var(--mist);
  border-top: 1px solid var(--line);
  max-height: 300px;
  overflow-y: auto;
}

.results-doc-box {
  margin-top: 24px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.results-doc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
}

.results-doc-head strong { flex: 1; }

.results-doc-content {
  padding: 20px;
  font-size: 13px;
  font-family: var(--sans);
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink);
  line-height: 1.7;
  max-height: 600px;
  overflow-y: auto;
}

/* ──────────────────────────────────────────────
   15. SHARED UTILITIES
   ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 100;
  max-width: 320px;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--primary-800);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* Icon buttons */
.icon-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .15s;
}

.icon-btn:hover { background: var(--mist); color: var(--ink); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,14,40,.65);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: min(460px, 100%);
}

.modal-dialog.sm { width: min(400px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h3 {
  font-family: var(--serif);
  font-size: 17px;
}

.modal-body-text {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ──────────────────────────────────────────────
   16. RESPONSIVE
   ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .workspace-cols {
    grid-template-columns: 240px minmax(270px, 0.8fr) minmax(400px, 1.2fr);
  }
}

@media (max-width: 1000px) {
  .workspace-cols {
    grid-template-columns: 220px minmax(250px, 0.75fr) minmax(360px, 1.25fr);
  }
}

@media (max-width: 900px) {
  body { flex-direction: column; height: auto; overflow: auto; }

  .nav-sidebar {
    width: 100%;
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .brand { padding: 12px 14px; border-bottom: none; border-right: 1px solid rgba(255,255,255,.08); }

  .nav { flex-direction: row; flex-wrap: wrap; padding: 8px; flex: 1; gap: 4px; }
  .nav-item { min-height: 34px; }
  .nav-footer { padding: 8px 14px; }

  .app { height: auto; }
  #workspace { height: auto; overflow: visible; }

  .workspace-cols {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .col { height: auto; max-height: 500px; }
  .col-capture { overflow-y: visible; }

  .diagnosis-summary { grid-template-columns: repeat(3, 1fr); }
  .agent-grid        { grid-template-columns: 1fr; }
  .settings-layout   { grid-template-columns: 1fr; }
  .schema-grid       { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .task-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .task-bar-right { justify-content: flex-end; }
  .fields-grid { grid-template-columns: 1fr; }
  .diagnosis-summary { grid-template-columns: repeat(2, 1fr); }
  .view-header { flex-direction: column; }
  .ref-flow-row { grid-template-columns: 1fr; }
  .ref-flow-label { min-height: 30px; border-right: none; border-bottom: 1px solid var(--line); }
  .result-compare { grid-template-columns: 1fr; }
  .result-col { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ──────────────────────────────────────────────
   自动模式开关
   ────────────────────────────────────────────── */
.auto-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  user-select: none;
}

.auto-mode-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auto-mode-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  transition: all .18s;
}

.auto-mode-label input:checked + .auto-mode-pill {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(10,95,239,.28);
}

.auto-mode-label input:checked + .auto-mode-pill::before {
  content: '⚡ ';
  font-size: 10px;
}

/* 录音状态区 — 管道步骤文字 */
.record-state {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
