:root {
  color-scheme: light;
  --bg: #f0f4f8;
  --panel: #ffffff;
  --text: #1a2332;
  --muted: #6b7a8d;
  --primary: #1f6feb;
  --primary-soft: #e8f1ff;
  --border: #dce3ec;
  --danger: #d4380d;
  --ok: #389e0d;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.06);
  --page-bg: linear-gradient(160deg, #e8eef6 0%, #f5f7fa 45%, #eef3f8 100%);
  --input-bg: #f8fafc;
  --topbar-bg: rgba(255, 255, 255, .8);
  --hover-bg: #f8fbff;
  --dashed: #edf1f5;
  --ghost-bg: #ffffff;
  --soft-panel: #fbfcfe;
  --track: #edf1f5;
  --pending-track: #d9e2ec;
  --card-border: rgba(220, 227, 236, .8);
  --chip-bg: #f8fbff;
  --chip-border: #edf1f5;
  --stage-bg: #eef3f8;
  --control-height: 42px;
  --control-radius: 10px;
  --control-padding-x: 12px;
  --choice-size: 18px;
  --control-chevron: url("/icons/chevron-down.svg");
  --smart-blue: #1677ff;
  --smart-cyan: #13a8a8;
  --smart-green: #24a865;
  --nav-bg: #132238;
  --nav-sub-bg: #0c1a2d;
  --nav-text: #b9c8da;
  --nav-hover-bg: #22344b;
  --nav-active-bg: #284f86;
  --nav-active-text: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e8eef6;
  --muted: #94a3b8;
  --primary: #4c8dff;
  --primary-soft: rgba(76, 141, 255, .18);
  --border: #2d3a4d;
  --danger: #ff7875;
  --ok: #73d13d;
  --shadow: 0 8px 28px rgba(0, 0, 0, .4);
  --page-bg: linear-gradient(160deg, #0b1220 0%, #121a27 45%, #0f1623 100%);
  --input-bg: #121a27;
  --topbar-bg: rgba(18, 26, 39, .88);
  --hover-bg: #243044;
  --dashed: #2d3a4d;
  --ghost-bg: #1a2332;
  --soft-panel: #152031;
  --track: #2d3a4d;
  --pending-track: #3a4a60;
  --card-border: rgba(45, 58, 77, .95);
  --chip-bg: #152031;
  --chip-border: #2d3a4d;
  --stage-bg: #121a27;
}

* { box-sizing: border-box; }
html {
  height: 100%;
  min-height: 100%;
  margin: 0;
  background-color: var(--bg);
  background-image: var(--page-bg);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}
body,
#app {
  min-height: 100%;
  margin: 0;
}
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  height: auto;
  background: transparent;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
#app { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
input[type="checkbox"],
input[type="radio"] {
  width: var(--choice-size);
  height: var(--choice-size);
  min-width: var(--choice-size);
  min-height: var(--choice-size);
  margin: 0;
  flex: 0 0 var(--choice-size);
  vertical-align: middle;
  accent-color: var(--primary);
}

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(31,111,235,.18), transparent 36%),
    radial-gradient(circle at 80% 10%, rgba(19, 84, 160, .14), transparent 28%),
    linear-gradient(160deg, #163a6b, #1f6feb 55%, #6aa1ff);
}
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  color: var(--text);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  border: 1px solid var(--card-border);
}
.login-theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  background: rgba(255, 255, 255, .92) !important;
  color: #1a2332 !important;
  border-color: rgba(255, 255, 255, .55) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}
html[data-theme="dark"] .login-theme-toggle {
  background: rgba(26, 35, 50, .92) !important;
  color: #e8eef6 !important;
  border-color: rgba(255, 255, 255, .18) !important;
}
.login-brand {
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 800;
  letter-spacing: .02em;
  margin-bottom: 6px;
  line-height: 1.35;
}
.login-sub { color: var(--muted); margin-bottom: 24px; font-size: 13px; line-height: 1.5; }
.demo-list {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  max-height: 220px;
  overflow: auto;
}
.demo-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--dashed);
  font-size: 13px;
  cursor: pointer;
}
.demo-item:hover { color: var(--primary); }

/* —— Form —— */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input:not([type="radio"]):not([type="checkbox"]),
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--input-bg);
  color: var(--text);
  resize: none;
}
.field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.field select {
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 var(--control-padding-x);
  line-height: 1.2;
  vertical-align: middle;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: right var(--control-padding-x) center;
  background-size: 16px 16px;
  cursor: pointer;
}
.field textarea {
  min-height: 88px;
  padding: 10px var(--control-padding-x);
  resize: none;
  overflow-y: auto;
}
textarea,
input:not([type="radio"]):not([type="checkbox"]):not([type="range"]) {
  resize: none;
}
.field.grow { flex: 1; min-width: 160px; }
.field.inline { margin-bottom: 0; }
.error-text { color: var(--danger); font-size: 13px; margin: 8px 0; }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 0 2px;
  min-height: 42px;
  align-items: center;
}
.radio-group label, .check-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.radio-group input, .check-group input {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.form-grid .field { margin-bottom: 0; min-width: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }

.page-form {
  padding: 18px 20px 20px;
}
.page-form-section {
  padding: 16px 18px 18px;
  margin-bottom: 12px;
}
.page-form-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--dashed);
}
.page-form-section-head strong {
  font-size: 15px;
}
.page-form-section-head .muted {
  font-size: 12px;
}
.page-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.page-form-actions-bar {
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 0;
  border-top: 0;
  background: transparent;
  box-shadow: none;
}
.page-form .q-picker {
  max-height: min(56vh, 560px);
}
.page-form .lesson-editor,
.page-form-section .lesson-editor {
  margin-top: 0;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.ghost {
  background: var(--ghost-bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* —— Shell —— */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  transition: grid-template-columns .2s ease;
}
.shell.sider-collapsed { grid-template-columns: 64px 1fr; }
.sider {
  background: #122238;
  color: #dce7f5;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 40;
}
.sider-nav { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 2px 18px;
}
.sider .logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.sider-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: #dce7f5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.sider-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 11px;
  color: #b7c6d8;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.nav-item.active, .nav-item:hover {
  background: rgba(255,255,255,.09);
  color: #fff;
  color: #fff;
}
.nav-dropdown { position: relative; width: 100%; }
.nav-dropdown-trigger { justify-content: space-between; }
.nav-caret {
  font-size: 11px;
  opacity: .75;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-dropdown-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
}
.nav-item.nav-sub {
  padding: 8px 10px 8px 16px;
  font-size: 13px;
  color: #9eb0c4;
}
.nav-item.nav-sub.active {
  background: rgba(76, 141, 255, .28);
  color: #fff;
}
.shell.sider-collapsed .sider { padding: 12px 8px; align-items: stretch; }
.shell.sider-collapsed .sider-top { flex-direction: column; align-items: center; padding-bottom: 8px; }
.shell.sider-collapsed .sider .logo { font-size: 18px; text-align: center; width: 100%; }
.shell.sider-collapsed .nav-item { text-align: center; padding: 10px 4px; font-size: 13px; justify-content: center; }
.shell.sider-collapsed .nav-dropdown-panel { padding: 4px 2px; }
.shell.sider-collapsed .nav-item.nav-sub { padding: 8px 2px; }

.main {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 64px;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.topbar-brand { display: none; font-size: 15px; font-weight: 700; letter-spacing: .03em; }
.topbar-role {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-ai {
  min-width: 176px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.topbar-ai small,
.ai-model-inline {
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
}
.topbar-ai small {
  padding: 4px 6px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
}
.topbar-ai:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.ai-model-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .05em;
  white-space: nowrap;
}
.ai-model-inline {
  display: inline-flex;
  margin-left: 5px;
  padding: 4px 6px;
  color: currentColor;
  background: color-mix(in srgb, currentColor 9%, transparent);
  border-radius: 999px;
  opacity: .88;
}
.ai-modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-field-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}
.ai-field-note .ai-model-badge {
  min-height: 20px;
  padding: 0 7px;
  font-size: 9px;
}
.topbar-user {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  padding: 0 4px;
}
.content { padding: 22px 26px 40px; }

.page-title { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.page-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--kpi-accent, var(--primary-soft));
  opacity: .55;
}
.kpi-card .stat-value { position: relative; z-index: 1; }
.kpi-card .stat-label { position: relative; z-index: 1; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.toolbar:has(.field) { align-items: flex-end; }
.toolbar .field { margin-bottom: 0; }
.toolbar.space-between { justify-content: space-between; }

.knowledge-space-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 9px;
  margin: 14px 0 16px;
}
.knowledge-space-card {
  appearance: none;
  text-align: left;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.knowledge-space-card:hover { transform: translateY(-1px); border-color: var(--primary); }
.knowledge-space-card.active { border-color: var(--primary); background: var(--primary-soft); }
.knowledge-space-card strong { display: block; font-size: 14px; margin-bottom: 5px; }
.knowledge-space-card span { display: block; color: var(--muted); font-size: 11px; }
.knowledge-workspace {
  position: relative;
  overflow: hidden;
  padding: 0 18px 18px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 94% 0%, rgba(22, 119, 255, .10), transparent 27%),
    linear-gradient(180deg, var(--panel) 0%, var(--soft-panel) 100%);
  box-shadow: var(--shadow);
}
.knowledge-workspace::before {
  content: none;
}
.knowledge-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px 18px;
  border-bottom: 1px solid var(--dashed);
}
.knowledge-workspace-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.knowledge-workspace-icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--primary), #6098f5);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 119, 255, .22);
  font-size: 18px;
  font-weight: 800;
}
.knowledge-workspace-identity h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}
.knowledge-workspace-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}
.knowledge-workspace-stats > div {
  min-width: 52px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  text-align: center;
}
.knowledge-workspace-stats strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.15;
}
.knowledge-workspace-stats strong.is-published { color: var(--ok); }
.knowledge-workspace-stats strong.is-pending { color: var(--primary); }
.knowledge-workspace-stats strong.is-draft { color: #d48806; }
.knowledge-workspace-stats span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}
.knowledge-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
}
.knowledge-selection-hint {
  color: var(--muted);
  font-size: 12px;
}
.knowledge-search-hits {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--panel));
}
.knowledge-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
}
.knowledge-search-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.knowledge-search-head > span {
  color: var(--muted);
  font-size: 11px;
}
.knowledge-search-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.knowledge-hit-list { padding: 4px 10px 8px; }
.knowledge-hit {
  display: block;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid var(--dashed);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.knowledge-hit:hover { background: color-mix(in srgb, var(--primary-soft) 60%, transparent); }
.knowledge-hit:last-child { border-bottom: 0; }
.knowledge-hit-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.knowledge-hit-title > span {
  color: var(--muted);
  font-size: 11px;
}
.knowledge-hit .muted {
  margin-top: 4px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.knowledge-hit mark {
  background: #fff3bf;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}
.knowledge-score {
  font-size: 12px;
  padding: 1px 6px;
  background: var(--primary-soft);
  color: var(--primary) !important;
  border-radius: 8px;
}
.knowledge-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.knowledge-doc-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 15px 16px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(28, 54, 88, .045);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.knowledge-doc-card::before {
  content: none;
}
.knowledge-doc-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  box-shadow: 0 12px 28px rgba(28, 75, 135, .10);
}
.knowledge-doc-card-top,
.knowledge-doc-kind,
.knowledge-doc-footer {
  display: flex;
  align-items: center;
}
.knowledge-doc-card-top {
  justify-content: space-between;
  gap: 12px;
}
.knowledge-doc-kind { gap: 9px; min-width: 0; }
.knowledge-doc-kind > span {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.knowledge-doc-card.is-faq .knowledge-doc-kind > span {
  background: rgba(19, 168, 168, .11);
  color: #118c8c;
}
.knowledge-doc-kind strong,
.knowledge-doc-kind small { display: block; }
.knowledge-doc-kind strong { font-size: 12px; line-height: 1.25; }
.knowledge-doc-kind small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.knowledge-doc-title {
  overflow: hidden;
  margin-top: 13px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.knowledge-doc-number {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.knowledge-doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 25px;
  margin-top: 12px;
}
.knowledge-soft-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 10px;
}
.knowledge-doc-footer {
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--dashed);
}
.knowledge-doc-footer > span { color: var(--muted); font-size: 10px; }
.knowledge-open-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.knowledge-open-btn b { font-size: 16px; line-height: 0; vertical-align: -1px; }
.knowledge-loading,
.knowledge-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  border: 1px dashed color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 15px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  text-align: center;
}
.knowledge-loading { flex-direction: row; gap: 6px; }
.knowledge-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: knowledge-loading 1s ease-in-out infinite alternate;
}
.knowledge-loading span:nth-child(2) { animation-delay: .18s; }
.knowledge-loading span:nth-child(3) { animation-delay: .36s; }
.knowledge-loading p { margin-left: 6px; color: var(--muted); font-size: 12px; }
@keyframes knowledge-loading { to { opacity: .25; transform: translateY(-3px); } }
.knowledge-empty-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 13px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--primary-soft), color-mix(in srgb, var(--panel) 78%, #fff));
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 14%, transparent);
}
.knowledge-empty-mark span { font-size: 22px; font-weight: 800; }
.knowledge-empty-mark i {
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 23px;
  height: 23px;
  border: 4px solid var(--panel);
  border-radius: 50%;
  background: #80aef8;
}
.knowledge-empty h3 { margin: 0; font-size: 16px; }
.knowledge-empty p {
  max-width: 480px;
  margin: 8px 20px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.knowledge-empty-actions { display: flex; gap: 8px; margin-top: 15px; }
.knowledge-tag-expired {
  background: #fff1f0;
  color: #cf1322;
  margin-left: 6px;
}
.knowledge-tag-expiring {
  background: #fff7e6;
  color: #d46b08;
  margin-left: 6px;
}
.ai-draft-source {
  margin-top: 6px;
  font-size: 12px;
}
.ai-draft-source summary {
  cursor: pointer;
  color: #1677ff;
}
.ai-draft-source .muted {
  padding-left: 12px;
  line-height: 1.6;
}
.knowledge-related {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--dashed);
}
.knowledge-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.knowledge-related-list .btn {
  max-width: 100%;
  text-align: left;
}
.knowledge-version-list {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.knowledge-version {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--dashed);
}
.knowledge-version .tag { margin-left: 8px; }
.knowledge-citations {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--dashed);
}
.knowledge-citations > strong { display: block; font-size: 13px; margin-bottom: 8px; }
.knowledge-citation {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 4px 0;
  cursor: pointer;
  font-size: 12px;
}
.ai-draft-list {
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 8px;
}
.ai-draft-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.ai-draft-card > input { margin-top: 2px; }
.ai-draft-card .muted { margin-top: 5px; line-height: 1.45; }
.ai-progress-panel {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--panel));
}
.ai-progress-panel.is-error {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}
.ai-progress-panel.is-stopped {
  border-color: color-mix(in srgb, #d48806 42%, var(--border));
  background: color-mix(in srgb, #d48806 8%, var(--panel));
}
.ai-progress-panel.is-complete {
  border-color: color-mix(in srgb, var(--ok) 38%, var(--border));
  background: color-mix(in srgb, var(--ok) 8%, var(--panel));
}
.ai-progress-head,
.ai-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-progress-head > div {
  min-width: 0;
}
.ai-progress-head strong,
.ai-progress-head span {
  display: block;
}
.ai-progress-head strong {
  color: var(--text);
  font-size: 13px;
}
.ai-progress-head span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-progress-controls {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}
.ai-progress-controls b {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 14px;
}
.ai-progress-controls button {
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--border));
  border-radius: 8px;
  background: var(--panel);
  color: var(--danger);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.ai-progress-controls button:hover {
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}
.ai-progress-track {
  overflow: hidden;
  height: 7px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--track);
}
.ai-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--smart-cyan));
  transition: width .24s ease;
}
.ai-progress-panel.is-complete .ai-progress-track i {
  background: var(--ok);
}
.ai-progress-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}
.ai-task-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
}
.ai-task-dock {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  backdrop-filter: blur(14px);
}
.ai-task-orb {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  color: #fff;
  background: linear-gradient(145deg, #285bd7, #558bff);
  border: 3px solid color-mix(in srgb, var(--panel) 92%, transparent);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(40, 91, 215, .3);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ai-task-orb:hover,
.ai-task-widget.is-expanded .ai-task-orb {
  transform: translateY(-2px);
  box-shadow: 0 15px 34px rgba(40, 91, 215, .38);
}
.ai-task-orb > span {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -.02em;
}
.ai-task-orb > b {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--danger);
  border: 2px solid var(--panel);
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
}
.ai-task-orb.is-running::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid color-mix(in srgb, var(--primary) 44%, transparent);
  border-radius: 50%;
  animation: ai-task-orb-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes ai-task-orb-pulse {
  0% { transform: scale(.84); opacity: .9; }
  75%, 100% { transform: scale(1.28); opacity: 0; }
}
.ai-task-dock-title,
.ai-task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ai-task-dock-title {
  padding: 2px 3px 9px;
  color: var(--text);
  font-size: 13px;
}
.ai-task-dock-title span {
  color: var(--muted);
  font-size: 11px;
}
.ai-task-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.ai-task-card + .ai-task-card {
  margin-top: 9px;
}
.ai-task-card .ai-progress-panel {
  margin: 8px 0 0;
}
.ai-task-link,
.ai-task-dismiss {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.ai-task-link {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-task-link:hover {
  text-decoration: underline;
}
.ai-task-dismiss {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 19px;
  line-height: 24px;
}
.ai-task-dismiss:hover {
  background: var(--soft-panel);
  color: var(--text);
}

@media (max-width: 1200px) {
  .knowledge-space-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}

@media (max-width: 900px) {
  .ai-task-widget {
    right: 12px;
    bottom: 12px;
  }
  .ai-task-dock {
    width: calc(100vw - 24px);
    max-height: 52vh;
  }
  .ai-task-orb {
    width: 48px;
    height: 48px;
  }
  .knowledge-workspace-head { align-items: flex-start; flex-direction: column; }
  .knowledge-workspace-stats { width: 100%; }
  .knowledge-workspace-stats > div { flex: 1; }
  .knowledge-doc-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .knowledge-space-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .knowledge-space-card { padding: 10px; }
  .knowledge-version { align-items: flex-start; }
  .knowledge-workspace { padding: 0 12px 12px; border-radius: 14px; }
  .knowledge-workspace-head { padding-top: 18px; }
  .knowledge-workspace-toolbar { align-items: flex-start; flex-direction: column; }
  .knowledge-workspace-stats { flex-wrap: wrap; }
  .knowledge-workspace-stats > div { min-width: calc(50% - 4px); }
  .knowledge-type-tabs { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .knowledge-type-tabs button { white-space: nowrap; }
  .knowledge-hit-title { align-items: flex-start; flex-direction: column; gap: 3px; }
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  background: var(--ghost-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--dashed);
  font-size: 14px;
  vertical-align: middle;
}
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table tr { cursor: pointer; }
.table tr:hover td { background: var(--hover-bg); }
.table-actions { white-space: nowrap; width: 1%; text-align: right; }
.table-actions .btn + .btn { margin-left: 8px; }
.table.no-hover tr { cursor: default; }
.table.no-hover tr:hover td { background: transparent; }

/* 管理页列表：固定列宽，组间列对齐 */
.table-manage {
  table-layout: fixed;
  width: 100%;
}
.table-manage th,
.table-manage td {
  vertical-align: middle;
}
.table-manage .cell-main {
  min-width: 0;
  overflow: hidden;
}
.table-manage .cell-main > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-manage .cell-main .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-manage .col-center,
.table-manage th.col-center,
.table-manage td.col-center {
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}
.table-manage .col-num,
.table-manage th.col-num,
.table-manage td.col-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}
.table-manage td.col-center .tag {
  vertical-align: middle;
}
.table-manage .cell-stack {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
}
.table-manage .col-types,
.table-manage th.col-types,
.table-manage td.col-types {
  text-align: center;
  white-space: normal;
  padding-left: 8px;
  padding-right: 8px;
}
.table-manage td.col-types .type-chips {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
}
.table-manage .col-actions,
.table-manage th.col-actions,
.table-manage td.col-actions,
.table-manage .table-actions {
  text-align: right;
  width: 132px;
  padding-right: 4px;
  white-space: nowrap;
}

/* 题库：题目 | 题型 | 难度 | 分值 | 操作 */
.table-manage-q th:nth-child(1), .table-manage-q td:nth-child(1) { width: 48%; text-align: left; }
.table-manage-q th:nth-child(2), .table-manage-q td:nth-child(2),
.table-manage-q th:nth-child(3), .table-manage-q td:nth-child(3),
.table-manage-q th:nth-child(4), .table-manage-q td:nth-child(4) {
  width: 11%;
  text-align: center;
}
.table-manage-q th:nth-child(5), .table-manage-q td:nth-child(5) { width: 132px; }

/* 课程：课程 | 形态 | 课时数 | 状态 | 操作 */
.table-manage-c th:nth-child(1), .table-manage-c td:nth-child(1) { width: 32%; text-align: left; }
.table-manage-c th:nth-child(2), .table-manage-c td:nth-child(2) {
  width: 30%;
  text-align: center;
  white-space: normal;
}
.table-manage-c th:nth-child(3), .table-manage-c td:nth-child(3),
.table-manage-c th:nth-child(4), .table-manage-c td:nth-child(4) {
  width: 11%;
  text-align: center;
  white-space: nowrap;
}
.table-manage-c th:nth-child(5), .table-manage-c td:nth-child(5) { width: 132px; }

/* 考试：考试 | 课程 | 题目 | 及格线 | 状态 | 操作 */
.table-manage-e th:nth-child(1), .table-manage-e td:nth-child(1) { width: 28%; text-align: left; }
.table-manage-e th:nth-child(2), .table-manage-e td:nth-child(2) { width: 20%; text-align: left; }
.table-manage-e th:nth-child(3), .table-manage-e td:nth-child(3),
.table-manage-e th:nth-child(4), .table-manage-e td:nth-child(4),
.table-manage-e th:nth-child(5), .table-manage-e td:nth-child(5) {
  width: 11%;
  text-align: center;
}
.table-manage-e th:nth-child(6), .table-manage-e td:nth-child(6) { width: 132px; }

/* 账号：账号 | 姓名 | 角色 | 状态 | 操作 */
.table-manage-u th:nth-child(1), .table-manage-u td:nth-child(1) { width: 22%; }
.table-manage-u th:nth-child(2), .table-manage-u td:nth-child(2) { width: 22%; }
.table-manage-u th:nth-child(3), .table-manage-u td:nth-child(3) { width: 20%; }
.table-manage-u th:nth-child(4), .table-manage-u td:nth-child(4) { width: 14%; }
.table-manage-u th:nth-child(5), .table-manage-u td:nth-child(5) { width: 120px; }

.question-groups .table-manage,
.question-subgroup .table-manage {
  background: transparent;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.progress {
  height: 10px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1f6feb, #6aa1ff);
  transition: width .3s ease;
}
.progress.sm { height: 6px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
}
.kv { display: grid; gap: 8px; }
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--dashed);
  font-size: 14px;
}
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 600; text-align: right; }

.lesson-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-panel);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.lesson-item:hover, .lesson-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.lesson-item.done { border-color: rgba(56, 158, 13, .35); }
.lesson-index {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--stage-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.lesson-item.done .lesson-index {
  background: rgba(56, 158, 13, .15);
  color: var(--ok);
}
.lesson-body { min-width: 0; flex: 1; }
.lesson-title { font-weight: 600; font-size: 14px; }
.lesson-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.lesson-content {
  margin-top: 14px;
  line-height: 1.7;
  font-size: 14px;
  white-space: pre-wrap;
}
.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.lesson-stage { min-height: 320px; }
.video-shell {
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid var(--border);
}
.lesson-video {
  display: block;
  width: 100%;
  max-height: 420px;
  background: #000;
}
.video-progress-block { margin-top: 12px; }
.practical-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-panel);
}
.practical-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.check-row.disabled { cursor: default; opacity: .85; }
.check-row input { margin-top: 1px; }
.review-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(212, 136, 6, .12);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.flow-hint {
  margin-bottom: 14px;
}
.flow-hint.soft {
  background: var(--soft-panel);
  border: 1px dashed var(--border);
  box-shadow: none;
}
.flow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.flow-arrow { color: var(--muted); font-weight: 400; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.type-inline { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; }
.tag.xs {
  font-size: 11px;
  padding: 1px 6px;
  vertical-align: middle;
}
.tab-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.knowledge-ai-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-soft) 48%, var(--panel));
}
.knowledge-ai-actions.is-disabled {
  border-color: var(--border);
  background: color-mix(in srgb, var(--muted) 5%, var(--panel));
}
.knowledge-ai-actions-copy {
  min-width: 0;
}
.knowledge-ai-actions-copy strong,
.knowledge-ai-actions-copy span {
  display: block;
}
.knowledge-ai-actions-copy strong {
  color: var(--text);
  font-size: 14px;
}
.knowledge-ai-actions-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.knowledge-ai-actions-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
@media (max-width: 700px) {
  .knowledge-ai-actions { align-items: stretch; flex-direction: column; }
  .knowledge-ai-actions-buttons { flex-wrap: wrap; }
  .knowledge-ai-actions-buttons .btn { flex: 1 1 150px; }
}
.lesson-editor { margin-top: 16px; display: grid; gap: 12px; }
.lesson-editor-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-panel);
}
.modal.modal-lg {
  width: min(860px, 96vw);
}
.q-picker {
  max-height: min(48vh, 420px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: var(--input-bg);
}
.q-picker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 13px;
}
.q-picker-meta .score-total {
  font-weight: 700;
  color: var(--primary);
}
.q-picker-group {
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.q-picker-group:last-child { margin-bottom: 0; }
.q-picker-group-head,
.q-picker-leaf-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 8px 10px;
}
.q-picker-group-head {
  background: var(--soft-panel);
  font-weight: 600;
}
.q-picker-leaf {
  border-top: 1px dashed var(--dashed);
}
.q-picker-leaf-head {
  padding-left: 18px;
  font-size: 13px;
}
.q-picker-leaf-body {
  padding: 0 8px 8px 18px;
}
.q-picker label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  border-radius: 6px;
}
.q-picker label > input { margin-top: 1px; }
.q-picker label:hover {
  background: var(--soft-panel);
}
.q-picker label .stem {
  flex: 1;
  min-width: 0;
}
.q-picker label .score {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}
.review-card {
  padding: 14px 0;
  border-bottom: 1px dashed var(--dashed);
}
.review-card:last-child { border-bottom: 0; }
.review-checklist {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.review-checklist li.done { color: var(--ok); }
.review-note-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.exam-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}
.exam-timer.warn { background: rgba(212, 56, 13, .12); color: var(--danger); }
.question-card { margin-bottom: 14px; }
.question-stem { font-weight: 600; font-size: 15px; margin-bottom: 12px; line-height: 1.5; }
.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  cursor: pointer;
}
.option-item input {
  margin-top: 1px;
}
.option-label {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--muted);
  min-width: 1.5em;
}
.option-text {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  word-break: break-word;
}
.option-item:hover { border-color: var(--primary); }
.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option-item.correct {
  border-color: var(--ok);
  background: rgba(56, 158, 13, .1);
}
.option-item.wrong {
  border-color: var(--danger);
  background: rgba(212, 56, 13, .08);
}
.category-block {
  padding: 12px 0;
  border-bottom: 1px dashed var(--dashed);
}
.category-block:last-child { border-bottom: 0; }
.category-row,
.category-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.category-row-root {
  padding: 4px 0 8px;
}
.category-child {
  padding: 10px 12px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft-panel);
  font-size: 14px;
}
.category-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.category-count { font-size: 12px; white-space: nowrap; }
.category-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.category-actions .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.question-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.question-group-head,
.question-subgroup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.question-group-head {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.question-group.collapsed .question-group-head {
  padding-bottom: 0;
  border-bottom: 0;
}
.question-group-body {
  margin-top: 10px;
}
.question-fold-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.question-fold-caret {
  display: inline-block;
  width: 1em;
  color: var(--muted, #8c8c8c);
  font-size: 12px;
  line-height: 1;
}
.question-subgroup {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-panel);
}
.question-subgroup:first-of-type {
  margin-top: 0;
}
.question-subgroup-head {
  margin-bottom: 0;
  font-weight: 600;
  font-size: 14px;
}
.question-subgroup:not(.collapsed) .question-subgroup-head {
  margin-bottom: 8px;
}
.question-subgroup .table {
  background: transparent;
}
.material-block {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--soft-panel);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  line-height: 1.7;
  max-height: 480px;
  overflow: auto;
}
.material-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.material-upload-row input[type="file"] {
  max-width: 100%;
}

.file-drop {
  position: relative;
  display: block;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, var(--soft-panel), var(--input-bg));
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.file-drop:hover,
.file-drop.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .08);
}
.file-drop.disabled {
  opacity: .65;
  pointer-events: none;
}
.file-drop-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.file-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  pointer-events: none;
}
.file-drop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.file-drop-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.file-drop-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.file-uploaded {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.file-uploaded-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.file-uploaded-ext {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 36px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}
.file-uploaded-ext.is-pdf { background: rgba(212, 56, 13, .12); color: var(--danger); }
.file-uploaded-ext.is-ppt,
.file-uploaded-ext.is-pptx { background: rgba(212, 136, 6, .14); color: #d48806; }
.file-uploaded-ext.is-doc,
.file-uploaded-ext.is-docx { background: rgba(22, 119, 255, .12); color: #1677ff; }
.file-uploaded-ext.is-mp3,
.file-uploaded-ext.is-wav,
.file-uploaded-ext.is-m4a,
.file-uploaded-ext.is-aac,
.file-uploaded-ext.is-ogg,
.file-uploaded-ext.is-flac,
.file-uploaded-ext.is-audio { background: rgba(114, 46, 209, .12); color: #722ed1; }
.file-uploaded-ext.is-txt,
.file-uploaded-ext.is-md { background: rgba(19, 168, 168, .12); color: #13a8a8; }
.file-uploaded-ext.is-cfg { background: rgba(22, 119, 255, .12); color: #1677ff; }
.file-uploaded-ext.is-dat { background: rgba(114, 46, 209, .12); color: #722ed1; }
.file-uploaded-ext.is-csv,
.file-uploaded-ext.is-log { background: rgba(19, 168, 168, .12); color: #118c8c; }
.file-uploaded-name {
  font-weight: 600;
  font-size: 14px;
  word-break: break-all;
}
.file-uploaded-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.file-uploaded-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.file-upload-stack {
  display: grid;
  gap: 10px;
}

.material-preview-modal .material-preview-shell {
  margin: 0;
}
.material-preview-modal .material-pdf-frame {
  height: min(70vh, 760px);
}
.online-file-preview-name {
  max-width: min(70vw, 680px);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.material-preview-text {
  margin: 0;
  max-height: min(60vh, 560px);
  overflow: auto;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 13px;
}

.material-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--soft-panel);
}
.material-preview-shell {
  margin: 12px 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
}
.material-pdf-frame {
  display: block;
  width: 100%;
  height: min(78vh, 900px);
  border: 0;
  background: #525659;
}
.ppt-preview {
  background: #0b1220;
}
.ppt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #e2e8f0;
}
.ppt-toolbar .muted {
  color: #94a3b8;
}
.ppt-slide {
  min-height: 360px;
  padding: 22px 24px 28px;
  color: #f8fafc;
}
.ppt-slide.has-hero {
  padding: 0 0 18px;
}
.ppt-slide-lines p {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.7;
}
.ppt-slide-lines p:first-child {
  font-size: 22px;
  font-weight: 650;
}
.ppt-slide.has-hero .ppt-slide-lines {
  padding: 16px 22px 0;
}
.ppt-slide-images {
  display: grid;
  gap: 0;
}
.ppt-slide-images img {
  display: block;
  width: 100%;
  max-height: min(68vh, 760px);
  object-fit: contain;
  background: #000;
}
.material-text-toggle {
  margin: 4px 0 8px;
}
.ai-draft-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  margin-bottom: 8px;
}
.ai-draft-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--soft-panel);
}
.ai-draft-item.on {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.ai-draft-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}
.ai-draft-head input { margin-top: 1px; }
.ai-draft-opts {
  margin-top: 8px;
  padding-left: 28px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-draft-opts .ans {
  color: var(--ok);
  font-weight: 600;
}
.option-editor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.option-answer-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.option-answer-pick input { margin: 0; }
.option-text-input {
  flex: 1;
  min-width: 0;
  height: var(--control-height);
  padding: 0 var(--control-padding-x);
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--input-bg);
  color: var(--text);
  resize: none;
}
.score-hero {
  text-align: center;
  padding: 28px 16px;
}
.score-hero .big {
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}
.score-hero .sub { margin-top: 10px; color: var(--muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  font-size: 12px;
  color: var(--muted);
}
.chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, .45);
  z-index: 80;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal {
  width: min(640px, 100%);
  max-height: none;
  margin: 0;
  overflow: visible;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: 20px 22px;
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 28px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.dash-heading-copy { min-width: 0; }
.dash-title {
  margin: 4px 0 0;
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1.1;
}
.dash-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.dash-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 2px;
}
.dash-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.dash-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20a86b;
}
.dash-focus-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding-inline: 17px;
  border-radius: 11px;
}
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.dash-kpi {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--dash-accent, var(--primary));
  border-radius: 15px;
  padding: 16px 17px;
  box-shadow: var(--shadow);
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .18s ease, box-shadow .18s ease;
}
.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(26, 35, 50, .1);
}
.dash-kpi-blue { --dash-accent: #2f73ef; }
.dash-kpi-cyan { --dash-accent: #2bb7b2; }
.dash-kpi-purple { --dash-accent: #8b61e9; }
.dash-kpi-orange { --dash-accent: #efa82f; }
.dash-kpi-green { --dash-accent: #65bc47; }
.dash-kpi-sky { --dash-accent: #5d9bf2; }
.dash-kpi-red { --dash-accent: #e55b68; }
.dash-kpi-admin .dash-kpi {
  background: var(--soft-panel);
  min-height: 86px;
  padding: 12px 14px;
  border-top-width: 1px;
}
.dash-kpi-val {
  margin: 8px 0 6px;
  font-size: clamp(27px, 2vw, 34px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.dash-kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}
.dash-kpi-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-type-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.dash-type-item {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.dash-type-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

/* —— 看板图表 —— */
.dash-charts {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.dash-charts-admin {
  margin-top: 2px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.dash-chart-card {
  grid-column: span 4;
  padding: 19px 21px 18px;
  min-height: 286px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dash-chart-wide {
  grid-column: span 8;
}
.dash-chart-full {
  grid-column: 1 / -1;
}
.dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(1) {
  order: 5;
  grid-column: span 4;
}
.dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(2) {
  order: 2;
  grid-column: span 4;
}
.dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(3) {
  order: 4;
  grid-column: span 4;
}
.dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(4) {
  order: 1;
  grid-column: span 8;
}
.dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(5) {
  order: 3;
  grid-column: span 8;
}
.dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(6) {
  order: 6;
  grid-column: span 4;
}
.dash-charts-admin > .dash-chart-card:first-child { grid-column: span 8; }
.dash-charts-admin > .dash-chart-card:last-child { grid-column: span 4; }
.dash-charts .card + .card,
.dash-side .card + .card {
  margin-top: 0;
}
.dash-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.dash-chart-head strong {
  font-size: 15px;
  font-weight: 750;
}
.dash-chart-head .muted {
  font-size: 11px;
}
.dash-donut-wrap {
  display: grid;
  grid-template-columns: minmax(112px, 150px) minmax(0, 1fr);
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.dash-donut {
  width: min(100%, 150px);
  height: auto;
  aspect-ratio: 1;
  display: block;
}
.dash-donut-num {
  font-size: 18px;
  font-weight: 800;
  fill: var(--text);
}
.dash-donut-sub {
  font-size: 11px;
  fill: var(--muted);
}
.dash-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.dash-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.dash-legend-item strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dash-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.dash-bars {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 220px;
  padding: 8px 4px 0;
  flex: 1;
}
.dash-bars-dense {
  gap: 4px;
  height: 210px;
}
.dash-bar-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dash-bar-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  min-height: 12px;
  font-variant-numeric: tabular-nums;
}
.dash-bar-track {
  flex: 1;
  width: 100%;
  max-width: 28px;
  background: var(--track);
  border-radius: 6px 6px 4px 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.dash-bar-fill {
  width: 100%;
  min-height: 0;
  border-radius: 6px 6px 2px 2px;
  background: #3978eb;
  transition: height .25s ease;
}
.dash-bar-fill.required {
  background: #d95733;
}
.dash-bar-fill.admin {
  background: #22a7a1;
}
.dash-bar-label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-line-wrap {
  flex: 1;
  min-height: 210px;
}
.dash-line {
  width: 100%;
  height: 220px;
  display: block;
}
.dash-line-grid {
  stroke: var(--dashed);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.dash-line-axis {
  font-size: 9px;
  fill: var(--muted);
}
.dash-line-area {
  fill: rgba(31, 111, 235, .12);
}
html[data-theme="dark"] .dash-line-area {
  fill: rgba(76, 141, 255, .16);
}
.dash-line-path {
  stroke: var(--primary);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.dash-line-dot {
  fill: var(--primary);
  stroke: var(--panel);
  stroke-width: 1.5;
}
.dash-line-dot.ok { fill: var(--ok); }
.dash-line-dot.bad { fill: var(--danger); }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.dash-side {
  display: grid;
  gap: 12px;
}
.dash-panel {
  padding: 17px 19px;
}
.dash-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dash-panel-head strong {
  font-size: 15px;
}
.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--dashed);
  cursor: pointer;
}
.dash-row:last-child { border-bottom: 0; }
.dash-row-main { min-width: 0; flex: 1; }
.dash-row-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.dash-row-meta {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
  line-height: 1.4;
}
.dash-row-side {
  width: 72px;
  flex-shrink: 0;
}
.dash-pct {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  margin-bottom: 4px;
}
.empty.compact {
  padding: 16px 8px;
  font-size: 13px;
}

.dashboard-shell .content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}
.dashboard-shell .card {
  border-radius: 16px;
}

.dash-hero {
  margin-bottom: 18px;
}
.dash-hero h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.dash-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 520px;
}
.dash-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--dashed);
}
.list-row:last-child { border-bottom: 0; }
.list-row .title { font-weight: 600; font-size: 14px; }
.list-row .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

.modal .error-text {
  margin: 0 0 12px;
  position: relative;
  z-index: 1;
}

.modal-error-panel {
  position: sticky;
  top: 8px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -2px 0 16px;
  padding: 11px 12px;
  color: var(--danger);
  background: rgba(212, 56, 13, .08);
  background: color-mix(in srgb, var(--danger) 9%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--border));
  border-radius: 10px;
  box-shadow: inset 3px 0 0 var(--danger);
}
.modal-error-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
  color: #fff;
  background: var(--danger);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}
.modal-error-panel strong {
  display: block;
  margin-bottom: 2px;
  color: var(--danger);
  font-size: 13px;
}
.modal-error-panel p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .dash-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ========== AI 智能问答 · 流式聊天体验 ========== */
.knowledge-chat-page > .knowledge-chat-history {
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.knowledge-chat-main {
  background:
    radial-gradient(circle at 78% 4%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 16%, var(--panel)), var(--panel) 34%);
}

.knowledge-chat-conversation-head {
  min-height: 64px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
}

.knowledge-chat-messages {
  padding-top: 30px;
  padding-bottom: 32px;
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--primary) 8%, transparent) 1px, transparent 0);
  background-size: 24px 24px;
}

.knowledge-chat-messages .chat-msg {
  margin-bottom: 24px;
}

.knowledge-chat-messages .chat-msg.user .chat-bubble {
  border: 1px solid color-mix(in srgb, #fff 15%, var(--primary));
  box-shadow: 0 10px 26px rgba(31, 111, 235, .18);
}

.chat-bubble.ai,
.knowledge-chat-messages .chat-msg.assistant .knowledge-answer-bubble {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-left: 3px solid color-mix(in srgb, var(--primary) 72%, #7aa7ff);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 24%, var(--panel)), var(--panel) 58%);
  box-shadow: 0 12px 30px rgba(24, 47, 82, .09);
}

.chat-bubble.ai.is-streaming {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  box-shadow:
    0 14px 34px rgba(24, 47, 82, .11),
    0 0 0 3px color-mix(in srgb, var(--primary) 5%, transparent);
}

.chat-bubble.ai.has-content > .chat-thinking-state {
  min-height: 0;
  margin-bottom: 0;
  padding-top: 13px;
  padding-bottom: 8px;
  border-bottom: 1px dashed color-mix(in srgb, var(--primary) 18%, var(--border));
}

.chat-bubble.ai .ai-stream-content {
  min-width: 0;
}

.chat-bubble.ai.is-streaming .ai-stream-content {
  padding-bottom: 24px;
}

.chat-stream-cursor {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 8px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--smart-cyan));
  box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 45%, transparent);
  animation: ai-stream-cursor 1s steps(2, end) infinite;
}

@keyframes ai-stream-cursor {
  0%, 45% { opacity: 1; transform: translateY(0); }
  46%, 100% { opacity: .18; transform: translateY(1px); }
}

.knowledge-question-scope.is-conversation {
  padding: 10px 18px 8px;
  background: color-mix(in srgb, var(--panel) 94%, var(--primary-soft));
}

.knowledge-chat-composer:not(.is-welcome) {
  padding: 10px 16px 16px;
  background: color-mix(in srgb, var(--panel) 96%, var(--primary-soft));
}

.knowledge-chat-composer:not(.is-welcome) textarea {
  min-height: 52px;
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(24, 47, 82, .04);
}

.knowledge-chat-composer:not(.is-welcome) .knowledge-chat-send {
  min-height: 52px;
  border-radius: 14px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 24%, transparent);
}

@media (max-width: 700px) {
  .knowledge-chat-messages {
    padding: 18px 12px 24px;
    background-size: 20px 20px;
  }

  .knowledge-chat-page > .knowledge-chat-history {
    border-radius: 14px;
  }

  .chat-bubble.ai.has-content > .chat-thinking-state {
    padding-top: 10px;
  }
}

/* ========== 知识库 · AI技术解疑 ========== */
.technical-page-head { align-items: center; }
.technical-ai-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--smart-green);
  background: color-mix(in srgb, var(--smart-green) 9%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--smart-green) 28%, var(--border));
  border-radius: 999px;
  font-size: 12px;
}
.technical-ai-state span {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}
.technical-ai-state.off { color: var(--danger); }
.technical-page-error {
  position: static;
  margin: 0 0 16px;
}
.technical-standard-panel,
.technical-workspace,
.technical-result-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.technical-standard-panel {
  padding: 20px;
  margin-bottom: 16px;
}
.technical-category-standards {
  margin-top: 18px;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 28%, var(--soft-panel)), var(--soft-panel));
  border: 1px solid color-mix(in srgb, var(--primary) 17%, var(--border));
  border-radius: 14px;
}
.technical-category-standards .technical-standard-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 12px;
}
.technical-category-standards .technical-standard-file {
  background: var(--panel);
}
.technical-category-standards .technical-standard-upload {
  margin-top: 14px;
}
.technical-standard-intro {
  display: flex;
  align-items: center;
  gap: 14px;
}
.technical-standard-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  color: #fff;
  background: linear-gradient(145deg, #2f66cf, #5b8de7);
  border-radius: 15px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(47, 102, 207, .2);
}
.technical-standard-intro h2,
.technical-case-head h2,
.technical-result-panel h2 {
  margin: 2px 0 3px;
  font-size: 18px;
}
.technical-standard-intro p,
.technical-case-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.technical-standard-upload {
  display: block;
  margin-top: 18px;
  padding: 0;
  background: transparent;
  border: 0;
}
.technical-standard-upload-stack {
  width: 100%;
}
.technical-standard-file-drop {
  min-height: 124px;
  height: 124px;
}
.technical-standard-file-drop,
.technical-case-file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
}
.technical-standard-file-drop .file-drop-inner,
.technical-case-file-drop .file-drop-inner {
  width: 100%;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.technical-standard-upload .file-uploaded {
  min-height: 124px;
  height: 124px;
}
.technical-standard-commit {
  display: flex;
  justify-content: flex-end;
}
.technical-inline-upload {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.technical-picked-file {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.technical-picked-file strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}
.technical-picked-file small {
  color: var(--muted);
  font-size: 10px;
}
.technical-standard-empty {
  margin-top: 14px;
  padding: 16px;
  color: #9a6b00;
  background: color-mix(in srgb, #d48806 9%, var(--panel));
  border: 1px solid color-mix(in srgb, #d48806 25%, var(--border));
  border-radius: 11px;
  font-size: 12px;
}
.technical-standard-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.technical-standard-file {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--soft-panel);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.technical-standard-file-ext {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
}
.technical-standard-file > div {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.technical-standard-file strong,
.technical-standard-file small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.technical-standard-file strong { font-size: 12px; }
.technical-standard-file small {
  color: var(--muted);
  font-size: 10px;
}
.technical-workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
}
.technical-tabs {
  padding: 16px 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 34%, var(--soft-panel)), var(--soft-panel));
  border-right: 1px solid var(--border);
}
.technical-tabs button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px 10px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}
.technical-tabs button:hover {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.technical-tabs button.active {
  background: var(--panel);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  box-shadow: 0 8px 22px rgba(31, 111, 235, .09);
}
.technical-tabs button > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: var(--muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}
.technical-tabs button.active > span {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.technical-tabs button > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.technical-tabs strong { font-size: 13px; }
.technical-tabs small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.technical-case-panel {
  min-width: 0;
  padding: 20px;
}
.technical-case-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.technical-case-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}
.technical-case-head > div:first-child > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 12px;
  font-weight: 800;
}
.technical-step {
  padding: 7px 10px;
  color: var(--muted);
  background: var(--soft-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}
.technical-record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.technical-case-upload {
  min-width: 0;
}
.technical-case-file-drop {
  min-height: 124px;
  height: 124px;
  padding: 12px 14px;
}
.technical-case-file-drop .file-drop-inner {
  gap: 4px;
}
.technical-case-file-drop .file-drop-title {
  font-size: 13px;
}
.technical-case-file-drop .file-drop-hint {
  font-size: 11px;
  line-height: 1.35;
}
.technical-case-file-uploaded {
  min-height: 124px;
  height: 124px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}
.technical-case-file-uploaded .file-uploaded-actions {
  justify-content: flex-end;
}
.technical-upload-optional {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  vertical-align: 2px;
}
.technical-file-slot {
  min-width: 0;
  min-height: 142px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 11px;
  padding: 16px;
  background: var(--soft-panel);
  border: 1px dashed color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 13px;
  cursor: pointer;
}
.technical-file-slot:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 34%, var(--panel));
}
.technical-file-slot.filled {
  border-style: solid;
  border-color: color-mix(in srgb, var(--smart-green) 40%, var(--border));
  background: color-mix(in srgb, var(--smart-green) 6%, var(--panel));
}
.technical-file-slot-ext {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 30px;
  padding: 0 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}
.technical-file-slot.filled .technical-file-slot-ext {
  color: var(--smart-green);
  background: color-mix(in srgb, var(--smart-green) 12%, var(--panel));
}
.technical-file-slot-copy {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.technical-file-slot-copy strong,
.technical-file-slot-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.technical-file-slot-copy strong { font-size: 13px; }
.technical-file-slot-copy strong em {
  display: inline-flex;
  margin-left: 4px;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  vertical-align: 1px;
}
.technical-file-slot-copy small {
  color: var(--muted);
  font-size: 10px;
}
.technical-file-slot-action {
  position: absolute;
  right: 12px;
  top: 12px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 650;
}
.technical-evidence-upload {
  margin: 18px 0;
}
.technical-evidence-upload .technical-case-file-drop {
  min-height: 124px;
}
.technical-evidence-upload .technical-case-file-uploaded {
  min-height: 124px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.technical-evidence-upload .technical-file-slot {
  min-height: 110px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}
.technical-description {
  margin-top: 4px;
}
.technical-description textarea {
  min-height: 104px;
  resize: vertical;
}
.technical-analyze-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 13px 14px;
  background: var(--soft-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.technical-analyze-actions > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.technical-analyze-actions strong { font-size: 12px; }
.technical-analyze-actions span {
  color: var(--muted);
  font-size: 10px;
}
.technical-analyze-btn { min-width: 168px; }
.technical-result-panel {
  margin-top: 16px;
  overflow: hidden;
}
.technical-result-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--panel));
  border-bottom: 1px solid var(--border);
}
.technical-result-panel > header > div {
  display: flex;
  align-items: center;
  gap: 11px;
}
.technical-result-panel > header small {
  color: var(--muted);
  font-size: 10px;
}
.technical-result-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(145deg, #285bd7, #558bff);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
}
.technical-result-body {
  padding: 22px;
  line-height: 1.75;
}
.technical-report-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 420px;
}
.technical-analysis-history {
  padding: 14px 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 32%, var(--soft-panel)), var(--soft-panel));
  border-right: 1px solid var(--border);
}
.technical-analysis-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 12px;
}
.technical-analysis-history-head > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.technical-analysis-history-head strong { font-size: 13px; }
.technical-analysis-history-head small,
.technical-analysis-history-head > span {
  color: var(--muted);
  font-size: 9px;
}
.technical-analysis-history-empty {
  padding: 28px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}
.technical-analysis-history-item {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 10px 8px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}
.technical-analysis-history-item:hover {
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  border-color: var(--border);
}
.technical-analysis-history-item.active {
  background: var(--panel);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  box-shadow: 0 7px 18px rgba(31, 111, 235, .08);
}
.technical-analysis-history-item > div {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.technical-analysis-history-item strong,
.technical-analysis-history-item small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.technical-analysis-history-item strong { font-size: 11px; }
.technical-analysis-history-item small {
  color: var(--muted);
  font-size: 9px;
}
.technical-analysis-history-item > b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
}
.technical-analysis-history-item:hover > b { opacity: 1; }
.technical-analysis-history-item > b:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}
.technical-report-chat {
  min-width: 0;
  padding: 20px;
  background:
    radial-gradient(circle at 80% 0, color-mix(in srgb, var(--primary-soft) 34%, transparent), transparent 34%),
    var(--stage-bg);
}
.technical-report-context {
  max-width: 86%;
  margin: 0 0 16px auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  color: #fff;
  background: linear-gradient(145deg, #2865d8, #447fec);
  border-radius: 13px 13px 3px 13px;
  box-shadow: 0 8px 22px rgba(31, 111, 235, .16);
}
.technical-report-context > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  background: rgba(255,255,255,.16);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}
.technical-report-context > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.technical-report-context strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}
.technical-report-context p {
  margin: 3px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 10px;
  line-height: 1.55;
}
.technical-report-message {
  width: 100%;
  margin: 0;
}
.technical-report-message .chat-bubble {
  width: 100%;
  max-width: 100%;
  padding: 16px 18px;
  border-radius: 3px 13px 13px 13px;
}
.technical-report-ai-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.technical-report-ai-head > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  color: #fff;
  background: linear-gradient(145deg, #285bd7, #558bff);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
}
.technical-report-ai-head > div {
  display: flex;
  flex-direction: column;
}
.technical-report-ai-head strong { font-size: 12px; }
.technical-report-ai-head small {
  color: var(--muted);
  font-size: 9px;
}
.technical-report-chat .technical-result-body {
  padding: 14px 0 0;
}
.technical-report-sources {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px dashed var(--border);
}
.technical-report-sources > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.technical-report-sources strong {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
}
.technical-report-sources span {
  padding: 5px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: 7px;
  font-size: 9px;
}
.technical-report-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 24px;
  color: var(--muted);
  background: var(--stage-bg);
  font-size: 12px;
}
.technical-result-files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}
.technical-result-files strong {
  width: 100%;
  margin-bottom: 2px;
  font-size: 12px;
}
.technical-result-files span {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--soft-panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 10px;
}

@media (max-width: 1000px) {
  .technical-workspace {
    grid-template-columns: 1fr;
  }
  .technical-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .technical-tabs button { margin: 0; }
  .technical-tabs small { display: none; }
  .technical-record-grid {
    grid-template-columns: 1fr;
  }
  .technical-file-slot { min-height: 110px; }
  .technical-report-layout {
    grid-template-columns: 1fr;
  }
  .technical-analysis-history {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .technical-analysis-history-head {
    min-width: 104px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 4px;
  }
  .technical-analysis-history-item {
    min-width: 190px;
    margin: 0;
  }
}

@media (max-width: 700px) {
  .technical-standard-upload,
  .technical-analyze-actions,
  .technical-case-head,
  .technical-result-panel > header {
    align-items: stretch;
    flex-direction: column;
  }
  .technical-standard-list { grid-template-columns: 1fr; }
  .technical-tabs button {
    justify-content: center;
    padding: 10px 6px;
  }
  .technical-tabs button > div { display: none; }
  .technical-case-panel,
  .technical-standard-panel,
  .technical-category-standards,
  .technical-result-body {
    padding: 16px;
  }
  .technical-step { white-space: normal; }
  .technical-analyze-btn { width: 100%; }
  .technical-report-chat { padding: 12px; }
  .technical-report-context { max-width: 94%; }
}

@media (max-width: 900px) {
  .shell, .shell.sider-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  .shell-narrow {
    grid-template-rows: max-content minmax(0, 1fr);
    align-content: start;
  }

  /* —— 窄屏顶栏 + 导航 —— */
  .mobile-chrome {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #132238;
    color: #dce7f5;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 8px 24px rgba(15, 20, 25, .18);
  }
  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 8px;
  }
  .mobile-brand {
    min-width: 0;
    flex: 1;
  }
  .mobile-logo {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: .04em;
    color: #fff;
    line-height: 1.2;
  }
  .mobile-user-line {
    margin-top: 3px;
    font-size: 11px;
    color: #9fb0c4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-user-name { color: #c9d7e8; font-weight: 600; }
  .mobile-user-sep { margin: 0 4px; opacity: .55; }
  .mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .mobile-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(145deg, rgba(76,141,255,.35), rgba(255,255,255,.08));
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-icon-btn.active,
  .mobile-icon-btn:hover {
    border-color: rgba(255,255,255,.35);
    background: rgba(76,141,255,.45);
  }
  .mobile-ai-btn {
    width: auto;
    min-width: 42px;
    padding: 0 10px;
    border-radius: 12px;
    letter-spacing: .04em;
  }
  .mobile-user-menu { position: relative; }
  .mobile-user-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(220px, calc(100vw - 28px));
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 80;
  }
  .mobile-user-card {
    padding: 12px 14px;
    background: var(--soft-panel);
    border-bottom: 1px solid var(--dashed);
  }
  .mobile-user-card-name {
    font-weight: 700;
    font-size: 14px;
  }
  .mobile-user-card-meta {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
  }
  .mobile-user-action {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 11px 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
  }
  .mobile-user-action:hover { background: var(--hover-bg); }
  .mobile-user-action.danger { color: var(--danger); }

  .mobile-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 7px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 20px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(183, 198, 216, .42) transparent;
  }
  .mobile-nav::-webkit-scrollbar { height: 3px; }
  .mobile-nav::-webkit-scrollbar-track { background: transparent; }
  .mobile-nav::-webkit-scrollbar-thumb {
    background: rgba(183, 198, 216, .42);
    border-radius: 999px;
  }
  .mobile-nav-item {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(255,255,255,.06);
    color: #b7c6d8;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: center;
  }
  .mobile-nav-item.active,
  .mobile-nav-item:hover {
    background: #fff;
    color: #132238;
    border-color: #fff;
  }
  .mobile-manage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: -2px;
    padding-top: 8px;
    background: rgba(0,0,0,.18);
  }
  .mobile-manage-row .mobile-manage-item {
    background: rgba(255,255,255,.1);
    color: #d5e2f2;
  }
  .mobile-manage-row .mobile-manage-item.active,
  .mobile-manage-row .mobile-manage-item:hover {
    background: #fff;
    color: #132238;
  }

  .shell-narrow .main { width: 100%; min-width: 0; min-height: 0; }
  .shell-narrow .content { width: 100%; min-width: 0; padding-top: 12px; }

  /* 旧 sider 窄屏规则不再使用（窄屏改走 mobile-chrome） */
  .shell-narrow > .sider { display: none; }

  .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .card:has(.table) {
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 122, 141, .45) transparent;
  }
  .card:has(.table)::-webkit-scrollbar { height: 5px; }
  .card:has(.table)::-webkit-scrollbar-track { background: transparent; }
  .card:has(.table)::-webkit-scrollbar-thumb {
    background: rgba(107, 122, 141, .45);
    border-radius: 999px;
  }
  .card:has(.table)::before {
    content: "左右滑动查看更多 →";
    position: sticky;
    left: 10px;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    margin: 8px 0 2px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--soft-panel);
    color: var(--muted);
    box-shadow: 0 3px 10px rgba(15, 20, 25, .08);
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    pointer-events: none;
  }
  .card:has(.table) .table th:first-child,
  .card:has(.table) .table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--panel);
    box-shadow: 8px 0 14px -14px rgba(15, 20, 25, .75);
  }
  .card:has(.table) .table th:first-child { z-index: 4; }
  .detail-grid, .dash-panels, .dash-grid, .form-grid {
    grid-template-columns: 1fr;
  }
  .dash-type-row {
    grid-template-columns: 1fr;
  }
  .dash-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(1),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(2),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(3),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(6) {
    grid-column: span 1;
  }
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(4),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(5),
  .dash-charts-admin > .dash-chart-card:first-child,
  .dash-charts-admin > .dash-chart-card:last-child {
    grid-column: span 2;
  }
  .dash-chart-card,
  .dash-chart-wide,
  .dash-chart-full {
    grid-column: span 1;
    min-width: 0;
  }
  .dash-charts .dash-chart-full,
  .dash-charts .dash-chart-wide {
    grid-column: span 2;
  }
  .dash-charts-admin {
    grid-template-columns: 1fr;
  }
  .dash-donut-wrap {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .dash-donut {
    width: 120px;
    height: 120px;
  }
  .dash-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .content { padding: 14px 12px 28px; }
  .page-title { font-size: 22px; }
  .toolbar {
    gap: 8px;
  }
  .toolbar .field.grow,
  .toolbar .field { min-width: 0; flex: 1 1 140px; }
  .table-wrap, .card {
    max-width: 100%;
  }
  .table {
    min-width: 560px;
  }
  .table-manage {
    min-width: 640px;
  }
  .table th, .table td {
    padding: 10px 8px;
    font-size: 13px;
  }
  .table-actions {
    white-space: nowrap;
  }
  .table-manage .col-actions,
  .table-manage th.col-actions,
  .table-manage td.col-actions,
  .table-manage .table-actions {
    width: 118px;
  }
  .question-card, .lesson-editor-item, .file-uploaded {
    padding: 12px;
  }
  .file-uploaded {
    flex-direction: column;
    align-items: stretch;
  }
  .file-uploaded-actions {
    justify-content: flex-start;
  }
  .modal-mask {
    padding: 12px 10px;
    align-items: flex-start;
  }
  .modal, .modal.modal-lg {
    width: 100%;
    margin: 0;
  }
  .q-picker, .page-form .q-picker {
    max-height: min(42vh, 360px);
  }
  .material-pdf-frame,
  .material-preview-modal .material-pdf-frame {
    height: min(55vh, 480px);
  }
  .login-card {
    width: min(100%, 420px);
    padding: 22px 18px;
  }
  .exam-timer {
    font-size: 13px;
    padding: 6px 10px;
  }
  .option-item {
    padding: 10px;
  }
}

@media (max-width: 640px) {
  .dash-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-charts {
    grid-template-columns: 1fr;
  }
  .dash-charts .dash-chart-full,
  .dash-charts .dash-chart-wide,
  .dash-charts-admin .dash-chart-wide {
    grid-column: span 1;
  }
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(1),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(2),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(3),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(4),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(5),
  .dash-charts:not(.dash-charts-admin) > .dash-chart-card:nth-child(6),
  .dash-charts-admin > .dash-chart-card:first-child,
  .dash-charts-admin > .dash-chart-card:last-child {
    grid-column: span 1;
  }
  .dash-donut-wrap {
    grid-template-columns: 112px minmax(0, 1fr);
  }
  .dash-donut {
    width: 112px;
    height: 112px;
  }
  .dash-bars {
    height: 140px;
  }
  .dash-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .dash-title {
    font-size: 34px;
  }
  .dash-head-actions {
    width: 100%;
    justify-content: space-between;
  }
  .dash-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .dash-row-side {
    width: 100%;
  }
  .dash-pct { text-align: left; }
  .btn-row {
    width: 100%;
  }
  .btn-row .btn,
  .btn-row .exam-timer {
    flex: 1 1 auto;
  }
  .page-form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .page-form-actions .btn {
    width: 100%;
  }
  .toolbar:has(.field):not(.space-between) > .btn {
    flex: 1 1 100%;
    width: 100%;
  }
  .lesson-actions {
    flex-wrap: wrap;
  }
  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .score-hero .big {
    font-size: 42px;
  }
  .content { padding: 12px 10px 24px; }
  .nav-item {
    padding: 7px 10px;
    font-size: 13px;
  }
}

/* ========== 问答消息样式（AI 学习助手浮层使用）========== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.chat-msg { margin-bottom: 20px; display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.7;
  word-break: break-word;
}
.chat-msg.assistant .chat-bubble {
  width: auto;
  max-width: 72%;
  min-width: 0;
}
.chat-bubble.ai {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border, #e8e8e8);
  box-shadow: 0 5px 18px rgba(26, 35, 50, .05);
}
.chat-msg.user .chat-bubble {
  background: #1677ff;
  color: #fff;
}
.chat-bubble.ai .chat-content {
  min-width: 0;
  font-size: 14px;
}
.chat-bubble.ai .chat-content :first-child { margin-top: 0; }
.chat-bubble.ai .chat-content :last-child { margin-bottom: 0; }
.chat-content h1,
.chat-content h2,
.chat-content h3,
.chat-content h4 {
  margin: 1.25em 0 .55em;
  color: var(--text);
  line-height: 1.4;
}
.chat-content h1 { font-size: 19px; }
.chat-content h2 {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
}
.chat-content h3 { font-size: 15px; }
.chat-content h4 { font-size: 14px; }
.chat-content p {
  margin: .65em 0;
  line-height: 1.78;
}
.chat-content ul,
.chat-content ol {
  margin: .65em 0;
  padding-left: 1.55em;
}
.chat-content li {
  margin: .35em 0;
  line-height: 1.7;
}
.chat-content blockquote {
  margin: .8em 0;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--soft-panel);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
}
.chat-content blockquote p { margin: 0; }
.chat-bubble.ai .chat-content pre {
  background: var(--input-bg);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
}
.chat-bubble.ai .chat-content code {
  background: var(--input-bg);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 13px;
}
.chat-content .chat-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 14px 0;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.chat-content .chat-table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}
.chat-content .chat-table-wrap thead {
  background: color-mix(in srgb, var(--primary-soft) 65%, var(--panel));
}
.chat-content .chat-table-wrap tr {
  display: table-row;
}
.chat-content .chat-table-wrap tbody tr:nth-child(even) {
  background: var(--soft-panel);
}
.chat-content .chat-table-wrap tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--panel));
}
.chat-content .chat-table-wrap th,
.chat-content .chat-table-wrap td {
  min-width: 112px;
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.chat-content .chat-table-wrap th {
  color: var(--text);
  font-weight: 700;
}
.chat-content .chat-table-wrap th:last-child,
.chat-content .chat-table-wrap td:last-child {
  border-right: 0;
}
.chat-content .chat-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.chat-reasoning {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted, #8c8c8c);
  background: #fafafa;
  border-radius: 6px;
  padding: 6px 10px;
}
.chat-reasoning summary { cursor: pointer; }
.chat-reasoning div { margin-top: 6px; max-height: 200px; overflow-y: auto; }

.chat-loading { color: var(--muted, #8c8c8c); font-size: 13px; }
.chat-loading .dots { display: inline-block; animation: chatdots 1.2s infinite; }
@keyframes chatdots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.chat-thinking-state {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
}
.chat-thinking-state > span:last-child {
  background: linear-gradient(90deg, var(--muted) 20%, var(--primary) 50%, var(--muted) 80%);
  background-size: 220% 100%;
  background-clip: text;
  color: transparent;
  animation: chat-thinking-text 1.8s linear infinite;
}
.chat-thinking-pulse {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}
.chat-thinking-pulse i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  animation: chat-thinking-dot 1.05s ease-in-out infinite;
}
.chat-thinking-pulse i:nth-child(2) { animation-delay: .14s; }
.chat-thinking-pulse i:nth-child(3) { animation-delay: .28s; }
@keyframes chat-thinking-dot {
  0%, 70%, 100% { opacity: .28; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}
@keyframes chat-thinking-text {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.chat-citations {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e8e8e8);
}
.chat-cite-btn {
  display: block;
  text-align: left;
  background: #f0f5ff;
  border: 1px solid #d6e4ff;
  border-radius: 6px;
  padding: 5px 10px;
  margin-top: 4px;
  font-size: 12px;
  color: #1677ff;
  cursor: pointer;
}
.chat-cite-btn:hover { background: #e6f4ff; }

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 24px 20px;
  background: #fff;
  border-top: 1px solid var(--border, #e8e8e8);
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  font-family: inherit;
  outline: none;
}
.chat-input:focus { border-color: #1677ff; }

/* FAQ 录入/详情样式 */
.knowledge-faq-input {
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
}
.knowledge-faq-input:focus { border-color: #1677ff; }
.knowledge-faq-detail {
  margin: 12px 0 16px;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 8px;
  overflow: hidden;
}
.knowledge-faq-section {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #e8e8e8);
}
.knowledge-faq-section:last-child { border-bottom: 0; }
.knowledge-faq-label {
  font-weight: 600;
  font-size: 13px;
  color: #1677ff;
  margin-bottom: 8px;
}
.knowledge-faq-body { font-size: 14px; line-height: 1.7; }
.knowledge-faq-body :first-child { margin-top: 0; }
.knowledge-faq-body :last-child { margin-bottom: 0; }
.knowledge-faq-body pre {
  background: #f6f8fa; padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 13px;
}
.knowledge-faq-body code {
  background: #f6f8fa; padding: 2px 5px; border-radius: 3px; font-size: 13px;
}

/* 知识库类型筛选 tab */
.knowledge-type-tabs {
  display: flex;
  gap: 8px;
  margin: 0;
}
.knowledge-type-tabs button {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.knowledge-type-tabs button:hover { border-color: var(--primary); color: var(--primary); }
.knowledge-type-tabs button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 5px 13px rgba(22, 119, 255, .17);
}
.knowledge-tag-faq {
  background: #f6ffed;
  color: #389e0d;
  border: 1px solid #b7eb8f;
  margin-left: 6px;
  font-size: 11px;
}
.knowledge-category-edit-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.knowledge-category-edit-row > span {
  flex: 1;
  min-width: 80px;
}
.knowledge-category-edit-row.is-editing select {
  flex: 1 1 210px;
  min-width: 0;
}
.knowledge-category-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.knowledge-category-group {
  min-width: 0;
}
.knowledge-category-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}
.knowledge-category-group-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.knowledge-category-group-head strong {
  font-size: 16px;
}
.knowledge-category-group-head span,
.knowledge-category-group-head small {
  color: var(--muted);
  font-size: 12px;
}
.knowledge-type-name-editor {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 14px 0 6px;
  padding: 14px;
}
.knowledge-type-manager-head {
  align-items: flex-start;
  margin: 0 0 10px;
}
.knowledge-type-manager-head .modal-title {
  margin-bottom: 4px;
}
.knowledge-type-manager-head p {
  margin: 0;
}
.knowledge-root-fixed {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.knowledge-level-two {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 650;
}
.knowledge-type-name-editor .field {
  margin: 0;
}

/* ========== AI 学习助手浮层（居中弹窗）========== */
.ai-panel-mask {
  position: fixed;
  inset: 0;
  background: rgba(28, 39, 54, .42);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.ai-panel {
  width: min(760px, 100%);
  height: min(720px, calc(100vh - 32px));
  background: #fff;
  color: #131b2b;
  border: 1px solid #d9e2ee;
  border-radius: 18px;
  box-shadow: 0 18px 54px rgba(15, 23, 42, .2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 12px 18px 12px 16px;
  border-bottom: 1px solid #d9e2ee;
  flex-shrink: 0;
}
.ai-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ai-panel-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #4163f6;
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 8px 20px rgba(65, 99, 246, .2);
}
.ai-panel-title-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.ai-panel-title strong {
  color: #172033;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
}
.ai-panel-subtitle {
  color: #718198;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-panel-history-btn {
  background: #f8faff;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  color: #607087;
  cursor: pointer;
  font-family: inherit;
}
.ai-panel-history-btn:hover {
  color: #2f63cf;
  border-color: #9fbae8;
  background: #f3f7ff;
}
.ai-panel-close {
  background: transparent;
  border: 0;
  color: #69798e;
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.ai-panel-close img {
  width: 18px;
  height: 18px;
  display: block;
}
.ai-panel-close:hover {
  background: #f4f7fb;
  color: #172033;
}

.ai-panel-history {
  border-bottom: 1px solid #d9e2ee;
  padding: 10px 16px;
  max-height: 240px;
  overflow-y: auto;
  background: #f8faff;
  flex-shrink: 0;
}
.ai-panel-new { margin-bottom: 8px; }
.ai-panel-history-item {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  margin-bottom: 4px;
}
.ai-panel-history-item:hover { background: rgba(47, 99, 207, .07); }
.ai-panel-history-item.active { background: rgba(47, 99, 207, .12); }
.ai-panel-history-title {
  font-size: 13px;
  font-weight: 500;
  padding-right: 32px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ai-panel-history-item .small {
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.ai-panel-history-del {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted, #8c8c8c);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
}
.ai-panel-history-item:hover .ai-panel-history-del { opacity: 1; }
.ai-panel-history-del:hover { color: #cf1322; }

.ai-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
/* 会话态复用 .chat-messages / .chat-input-area，但限制在浮层尺寸内 */
.ai-panel-body .chat-messages {
  flex: 1;
  padding: 20px;
  max-width: 100%;
  margin: 0;
  background: #fbfcfe;
}
.ai-panel-body .chat-input-area {
  padding: 14px 18px 18px;
  max-width: 100%;
}

/* 空状态：问候、快捷提问和底部固定输入区 */
.ai-panel-greet {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 46px 94px 0;
  text-align: center;
}
.ai-panel-greet-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: #edf4ff;
  color: #2d70dd;
  margin-bottom: 12px;
}
.ai-panel-greet-icon img {
  display: block;
  width: 24px;
  height: 24px;
}
.ai-panel-greet h2 {
  margin: 0 0 7px;
  font-size: 21px;
  line-height: 1.45;
  color: #131b2b;
  font-weight: 700;
}
.ai-panel-greet > p {
  margin: 0 0 24px;
  color: #64758b;
  font-size: 13px;
  line-height: 1.65;
}
.ai-panel-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.ai-suggestion {
  min-height: 68px;
  background: #fff;
  border: 1px solid #d6e0ed;
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: #182235;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background-color .15s, color .15s, transform .15s;
}
.ai-suggestion:hover:not(:disabled) {
  color: #2f63cf;
  border-color: #93b5ed;
  background: #f8fbff;
  transform: translateY(-1px);
}
.ai-suggestion:disabled { opacity: .5; cursor: not-allowed; }

.ai-question-scope {
  width: 100%;
  min-height: 42px;
  margin-bottom: 9px;
  padding: 7px 9px 7px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #25344a;
  background: #eef5ff;
  border: 1px solid #cbdcf5;
  border-radius: 10px;
  text-align: left;
}
.ai-question-scope > strong {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
}
.ai-question-scope > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ai-question-scope button {
  min-height: 28px;
  padding: 0 10px;
  color: #526681;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #cad7e9;
  border-radius: 7px;
  font-size: 11px;
  cursor: pointer;
}
.ai-question-scope button:not(.active):hover:not(:disabled) {
  color: #2f63cf;
  border-color: #8bace1;
}
.ai-question-scope button.active {
  color: #fff;
  background: #416fd5;
  border-color: #416fd5;
  box-shadow: 0 4px 10px rgba(47, 99, 207, .18);
}
.ai-question-scope button:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.ai-question-scope.is-conversation {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 20px;
  background: #f4f8ff;
  border-width: 1px 0 0;
  border-radius: 0;
}

.ai-panel-composer {
  width: calc(100% + 188px);
  margin: auto -94px 0;
  padding: 13px 16px 10px;
  border-top: 1px solid #d9e2ee;
  background: #fff;
}
.ai-panel-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: #f8faff;
  border: 1px solid #d5dfec;
  border-radius: 11px;
  padding: 0;
  min-height: 70px;
  transition: border-color .15s, box-shadow .15s;
}
.ai-panel-input-wrap:focus-within {
  border-color: #86aae7;
  box-shadow: 0 0 0 3px rgba(47, 99, 207, .09);
}
.ai-panel-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.6;
  font-family: inherit;
  color: #172033;
  max-height: 104px;
  min-width: 0;
  padding: 12px 12px;
}
.ai-panel-input::placeholder {
  color: #6b7280;
}
.ai-panel-send {
  flex: 0 0 74px;
  align-self: stretch;
  min-height: 70px;
  border-radius: 10px;
  border: none;
  background: #91b3ed;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, opacity .15s, transform .15s;
}
.ai-panel-send:hover:not(:disabled) {
  background: #73a0e8;
  transform: translateY(-1px);
}
.ai-panel-send:disabled {
  background: #a7c3f0;
  color: rgba(255, 255, 255, .9);
  cursor: not-allowed;
}
.ai-panel-send.sending { background: #d46b70; }
.ai-panel-send.sending:hover { background: #c45259; }
.ai-panel-security {
  margin: 8px 0 0;
  color: #718198;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

/* 会话态：历史/新建按钮行 */
.ai-panel-conv-head {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
  flex-shrink: 0;
}
.ai-panel-conv-head .ai-panel-history-btn { background: #fff; }

/* AI 助手跟随全局暗色主题，保持与浅色版一致的层级和对比度。 */
html[data-theme="dark"] .ai-panel {
  background: #1a2332;
  color: #e8eef6;
  border-color: #2d3a4d;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .46);
}
html[data-theme="dark"] .ai-panel-head {
  border-bottom-color: #2d3a4d;
}
html[data-theme="dark"] .ai-panel-title strong,
html[data-theme="dark"] .ai-panel-greet h2 {
  color: #f1f5fb;
}
html[data-theme="dark"] .ai-panel-subtitle,
html[data-theme="dark"] .ai-panel-greet > p,
html[data-theme="dark"] .ai-panel-security {
  color: #94a3b8;
}
html[data-theme="dark"] .ai-panel-history-btn {
  background: #152031;
  border-color: #344258;
  color: #aebbd0;
}
html[data-theme="dark"] .ai-panel-history-btn:hover {
  color: #8fb8ff;
  border-color: #4c72ad;
  background: #1d2b40;
}
html[data-theme="dark"] .ai-panel-close {
  color: #aebbd0;
}
html[data-theme="dark"] .ai-panel-close img {
  filter: invert(88%) sepia(7%) saturate(496%) hue-rotate(178deg) brightness(91%);
}
html[data-theme="dark"] .ai-panel-close:hover {
  color: #f1f5fb;
  background: #243044;
}
html[data-theme="dark"] .ai-panel-history {
  background: #121a27;
  border-bottom-color: #2d3a4d;
}
html[data-theme="dark"] .ai-panel-history-item:hover {
  background: rgba(76, 141, 255, .1);
}
html[data-theme="dark"] .ai-panel-history-item.active {
  background: rgba(76, 141, 255, .18);
}
html[data-theme="dark"] .ai-panel-body {
  background: #1a2332;
}
html[data-theme="dark"] .ai-panel-body .chat-messages {
  background: #121a27;
}
html[data-theme="dark"] .ai-panel-body .chat-input-area {
  background: #1a2332;
  border-top-color: #2d3a4d;
}
html[data-theme="dark"] .ai-panel .chat-bubble.ai {
  background: #1f2b3d;
  border-color: #344258;
  color: #e8eef6;
}
html[data-theme="dark"] .ai-panel .chat-reasoning {
  background: #152031;
  color: #aebbd0;
}
html[data-theme="dark"] .ai-panel .chat-bubble.ai .chat-content pre,
html[data-theme="dark"] .ai-panel .chat-bubble.ai .chat-content code {
  background: #101824;
}
html[data-theme="dark"] .ai-panel .chat-bubble.ai .chat-content th,
html[data-theme="dark"] .ai-panel .chat-bubble.ai .chat-content td {
  border-color: #344258;
}
html[data-theme="dark"] .ai-panel .chat-citations {
  border-top-color: #344258;
}
html[data-theme="dark"] .ai-panel .chat-cite-btn {
  background: rgba(76, 141, 255, .12);
  border-color: rgba(76, 141, 255, .35);
  color: #8fb8ff;
}
html[data-theme="dark"] .ai-panel .chat-cite-btn:hover {
  background: rgba(76, 141, 255, .2);
}
html[data-theme="dark"] .ai-panel-greet-icon {
  background: rgba(76, 141, 255, .16);
}
html[data-theme="dark"] .ai-suggestion {
  background: #1f2b3d;
  border-color: #344258;
  color: #e8eef6;
}
html[data-theme="dark"] .ai-suggestion:hover:not(:disabled) {
  color: #a9c8ff;
  border-color: #4c72ad;
  background: #24344a;
}
html[data-theme="dark"] .ai-question-scope {
  color: #dce7f7;
  background: #18263a;
  border-color: #355072;
}
html[data-theme="dark"] .ai-question-scope button {
  color: #b3c0d3;
  background: #121d2c;
  border-color: #3a4c64;
}
html[data-theme="dark"] .ai-question-scope button:not(.active):hover:not(:disabled) {
  color: #a9c8ff;
  border-color: #527bb7;
}
html[data-theme="dark"] .ai-question-scope button.active {
  color: #fff;
  background: #4c7edc;
  border-color: #4c7edc;
}
html[data-theme="dark"] .ai-question-scope.is-conversation {
  background: #152031;
}
html[data-theme="dark"] .ai-panel-composer {
  background: #1a2332;
  border-top-color: #2d3a4d;
}
html[data-theme="dark"] .ai-panel-input-wrap {
  background: #121a27;
  border-color: #344258;
}
html[data-theme="dark"] .ai-panel-input-wrap:focus-within {
  border-color: #5b8ddd;
  box-shadow: 0 0 0 3px rgba(76, 141, 255, .14);
}
html[data-theme="dark"] .ai-panel-input,
html[data-theme="dark"] .ai-panel .chat-input {
  color: #e8eef6;
  background: transparent;
}
html[data-theme="dark"] .ai-panel-input::placeholder,
html[data-theme="dark"] .ai-panel .chat-input::placeholder {
  color: #7f8da3;
}
html[data-theme="dark"] .ai-panel .chat-input {
  border-color: #344258;
  background: #121a27;
}
html[data-theme="dark"] .ai-panel-conv-head .ai-panel-history-btn {
  background: #152031;
}

@media (max-width: 768px) {
  .ai-panel-mask { padding: 0; }
  .ai-panel {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .ai-panel-greet {
    padding: 34px 18px 0;
  }
  .ai-panel-suggestions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ai-suggestion {
    min-height: 48px;
  }
  .ai-panel-composer {
    width: calc(100% + 36px);
    margin-inline: -18px;
    padding-inline: 12px;
  }
  .ai-panel-input-wrap {
    min-height: 58px;
  }
  .ai-panel-send {
    flex-basis: 68px;
    min-height: 58px;
  }
}

@media (max-height: 650px) and (min-width: 769px) {
  .ai-panel-greet {
    padding-top: 26px;
  }
  .ai-panel-greet-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    margin-bottom: 8px;
  }
  .ai-panel-greet > p {
    margin-bottom: 16px;
  }
}

/* ========== 知识库 · AI智能问答全屏页 ========== */
.knowledge-ai-head {
  align-items: center;
}
.knowledge-ai-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.knowledge-ai-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.knowledge-ai-role-dot {
  width: 8px;
  height: 8px;
  background: var(--smart-green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--smart-green) 16%, transparent);
}
.knowledge-chat-page {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  min-height: min(720px, calc(100vh - 190px));
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.knowledge-chat-history {
  padding: 18px 14px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 36%, var(--soft-panel)), var(--soft-panel));
  border-right: 1px solid var(--border);
}
.knowledge-chat-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 4px;
}
.knowledge-chat-history-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.knowledge-chat-history-head strong { font-size: 14px; }
.knowledge-chat-history-head span {
  color: var(--muted);
  font-size: 11px;
}
.knowledge-chat-history-empty {
  padding: 34px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.knowledge-chat-session {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 6px;
  padding: 10px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  text-align: left;
  cursor: pointer;
}
.knowledge-chat-session:hover {
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  border-color: color-mix(in srgb, var(--primary) 16%, var(--border));
}
.knowledge-chat-session.active {
  background: var(--panel);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: 0 6px 18px rgba(31, 111, 235, .08);
}
.knowledge-chat-session-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.knowledge-chat-session-copy strong,
.knowledge-chat-session-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.knowledge-chat-session-copy strong { font-size: 12px; }
.knowledge-chat-session-copy small {
  color: var(--muted);
  font-size: 10px;
}
.knowledge-chat-session-delete {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  border-radius: 7px;
  opacity: 0;
}
.knowledge-chat-session:hover .knowledge-chat-session-delete { opacity: 1; }
.knowledge-chat-session-delete:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}
.knowledge-chat-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 12%, color-mix(in srgb, var(--primary-soft) 45%, transparent), transparent 36%),
    var(--panel);
}
.knowledge-chat-welcome {
  width: min(760px, 100%);
  min-height: 100%;
  margin: auto;
  padding: 48px 34px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.knowledge-chat-orbit {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: #fff;
  background: linear-gradient(145deg, #285bd7, #558bff);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(40, 91, 215, .24);
  font-size: 18px;
  font-weight: 800;
  transform: rotate(-5deg);
}
.knowledge-chat-orbit span { transform: rotate(5deg); }
.knowledge-chat-welcome h2 {
  margin: 6px 0 8px;
  font-size: clamp(24px, 3vw, 36px);
}
.knowledge-chat-welcome > p {
  max-width: 560px;
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.7;
}
.knowledge-chat-suggestions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.knowledge-chat-suggestions button {
  min-height: 72px;
  padding: 13px;
  color: var(--text);
  background: color-mix(in srgb, var(--soft-panel) 86%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  line-height: 1.5;
}
.knowledge-chat-suggestions button:hover:not(:disabled) {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  background: var(--primary-soft);
}
.knowledge-chat-suggestions button span {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-weight: 800;
}
.knowledge-question-scope {
  width: 100%;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 9px 11px 9px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 12px;
  text-align: left;
}
.knowledge-question-scope > strong {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
}
.knowledge-question-scope > span {
  color: var(--muted);
  font-size: 10px;
}
.knowledge-question-scope > div {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.knowledge-question-scope button {
  min-height: 32px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.knowledge-question-scope button:not(.active):hover:not(:disabled) {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
}
.knowledge-question-scope button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 22%, transparent);
}
.knowledge-question-scope button:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.knowledge-question-scope.is-conversation {
  flex: 0 0 auto;
  margin: 0;
  padding: 9px 16px;
  background: color-mix(in srgb, var(--primary-soft) 32%, var(--soft-panel));
  border-width: 1px 0 0;
  border-radius: 0;
}
.knowledge-question-scope + .knowledge-chat-composer {
  border-top: 0;
}
.knowledge-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  background: var(--soft-panel);
  border-top: 1px solid var(--border);
}
.knowledge-chat-composer.is-welcome {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(31, 111, 235, .08);
}
.knowledge-chat-composer textarea {
  min-height: 48px;
  max-height: 140px;
  flex: 1;
  padding: 12px 14px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  resize: none;
}
.knowledge-chat-composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.knowledge-chat-send {
  min-width: 74px;
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 11px;
  font-weight: 650;
  cursor: pointer;
}
.knowledge-chat-send:disabled { opacity: .45; cursor: not-allowed; }
.knowledge-chat-send.is-stop { background: var(--danger); }
.knowledge-chat-security {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}
.knowledge-chat-conversation-head {
  min-height: 70px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.knowledge-chat-conversation-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.knowledge-chat-conversation-head > div > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.knowledge-chat-conversation-head strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}
.knowledge-chat-conversation-head small {
  color: var(--muted);
  font-size: 10px;
}
.knowledge-chat-ai-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: #fff;
  background: linear-gradient(145deg, #285bd7, #558bff);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
}
.knowledge-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px clamp(18px, 3vw, 38px);
  scroll-behavior: smooth;
}
.knowledge-chat-messages .chat-msg {
  width: min(980px, 100%);
  margin-right: auto;
  margin-left: auto;
}
.knowledge-chat-messages .chat-msg.user .chat-bubble {
  max-width: min(76%, 680px);
  padding: 11px 16px;
  background: linear-gradient(145deg, #2865d8, #447fec);
  border-radius: 15px 15px 4px 15px;
  box-shadow: 0 8px 22px rgba(31, 111, 235, .14);
}
.knowledge-chat-messages .chat-msg.assistant .knowledge-answer-bubble {
  width: auto;
  max-width: min(76%, 680px);
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 18%, var(--panel)), var(--panel) 90px);
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 5px 16px 16px 16px;
  box-shadow: 0 12px 32px rgba(24, 47, 82, .07);
}
.knowledge-answer-head {
  min-height: 66px;
  padding: 13px 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 13%, var(--border));
}
.knowledge-answer-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #285bd7, #558bff);
  border-radius: 11px;
  box-shadow: 0 7px 16px rgba(40, 91, 215, .2);
  font-size: 10px;
  font-weight: 800;
}
.knowledge-answer-head > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.knowledge-answer-head > div strong {
  color: var(--text);
  font-size: 13px;
}
.knowledge-answer-head > div small {
  color: var(--muted);
  font-size: 10px;
}
.knowledge-answer-media-badge {
  margin-left: auto;
  padding: 5px 9px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}
.knowledge-answer-bubble > .ai-progress-display,
.knowledge-answer-bubble > .chat-reasoning,
.knowledge-answer-bubble > .chat-loading,
.knowledge-answer-bubble > .chat-thinking-state {
  margin-right: 18px;
  margin-left: 18px;
}
.knowledge-answer-bubble > .chat-loading,
.knowledge-answer-bubble > .chat-thinking-state {
  padding: 22px 0;
}
.knowledge-answer-bubble > .chat-content {
  padding: 18px 20px 6px;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
  font-size: 14px;
  line-height: 1.82;
}
.knowledge-answer-bubble > .chat-content > p:first-child {
  margin: 0 0 18px;
  padding: 12px 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--panel));
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  font-weight: 550;
}
.knowledge-answer-bubble > .chat-content h2 {
  position: relative;
  margin-top: 1.55em;
  padding: 0 0 8px 13px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.knowledge-answer-bubble > .chat-content h2::before {
  content: "";
  position: absolute;
  top: .25em;
  bottom: .72em;
  left: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 99px;
}
.knowledge-answer-bubble > .chat-content h3 {
  margin-top: 1.35em;
  color: color-mix(in srgb, var(--text) 88%, var(--primary));
}
.knowledge-answer-bubble > .chat-content li {
  padding-left: 2px;
}
.knowledge-answer-bubble > .chat-content strong {
  color: var(--text);
}
.knowledge-answer-bubble > .chat-content blockquote {
  background: color-mix(in srgb, #f59e0b 8%, var(--panel));
  border-left-color: #f59e0b;
}
.knowledge-answer-bubble > .chat-content .chat-table-wrap {
  margin: 16px 0 18px;
  box-shadow: 0 5px 16px rgba(24, 47, 82, .04);
}
.knowledge-answer-bubble > .chat-content .chat-table-wrap th {
  white-space: nowrap;
}
.knowledge-answer-images {
  margin: 12px 20px 18px;
  padding: 14px;
  background: color-mix(in srgb, var(--soft-panel) 82%, var(--panel));
  border: 1px solid var(--border);
  border-radius: 13px;
}
.knowledge-answer-images.is-compact {
  margin: 12px 0;
}
.knowledge-answer-images-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.knowledge-answer-images-head strong {
  font-size: 12px;
}
.knowledge-answer-images-head span {
  color: var(--muted);
  font-size: 10px;
}
.knowledge-answer-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.knowledge-answer-image-grid > button {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  text-align: left;
  cursor: zoom-in;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.knowledge-answer-image-grid > button:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow: 0 9px 22px rgba(24, 47, 82, .1);
}
.knowledge-answer-image-grid img {
  width: 100%;
  height: 190px;
  display: block;
  object-fit: contain;
  background:
    linear-gradient(45deg, var(--soft-panel) 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(-45deg, var(--soft-panel) 25%, transparent 25%) 0 7px / 14px 14px,
    var(--panel);
  border-bottom: 1px solid var(--border);
}
.knowledge-answer-image-grid button > span {
  min-width: 0;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.knowledge-answer-image-grid button strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
}
.knowledge-answer-image-grid button small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
}
.knowledge-answer-bubble > .chat-citations {
  margin: 0;
  padding: 12px 20px 18px;
  border-top: 0;
}
.knowledge-answer-sources {
  overflow: hidden;
  background: var(--soft-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.knowledge-answer-sources summary {
  min-height: 44px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}
.knowledge-answer-sources summary::-webkit-details-marker { display: none; }
.knowledge-answer-sources summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--muted);
  transition: transform .18s ease;
}
.knowledge-answer-sources[open] summary::after { transform: rotate(180deg); }
.knowledge-answer-sources summary span {
  font-size: 12px;
  font-weight: 700;
}
.knowledge-answer-sources summary small {
  color: var(--muted);
  font-size: 10px;
}
.knowledge-answer-source-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
}
.knowledge-answer-source-list .chat-cite-btn {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
  border-radius: 9px;
}
.knowledge-answer-source-list .chat-cite-btn > span:first-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
}
.knowledge-answer-source-list .chat-cite-btn > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.knowledge-answer-source-list .chat-cite-btn strong,
.knowledge-answer-source-list .chat-cite-btn small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.knowledge-answer-source-list .chat-cite-btn strong { font-size: 11px; }
.knowledge-answer-source-list .chat-cite-btn small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}
.knowledge-answer-source-list .chat-cite-btn b {
  color: var(--primary);
  font-size: 9px;
  font-weight: 650;
}

@media (max-width: 900px) {
  .ai-question-scope {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .ai-question-scope > div {
    width: 100%;
  }
  .ai-question-scope button {
    flex: 1 1 0;
    padding-inline: 5px;
  }
  .knowledge-chat-page {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - 210px);
  }
  .knowledge-chat-history {
    display: none;
  }
  .knowledge-chat-suggestions {
    grid-template-columns: 1fr;
  }
  .knowledge-chat-welcome {
    padding: 30px 16px 20px;
  }
  .knowledge-chat-messages {
    padding: 16px 12px;
  }
  .knowledge-chat-messages .chat-msg.user .chat-bubble {
    max-width: 88%;
  }
  .knowledge-chat-messages .chat-msg.assistant .knowledge-answer-bubble {
    max-width: 88%;
  }
  .knowledge-answer-bubble > .chat-content {
    padding: 15px 14px 4px;
  }
  .knowledge-answer-images,
  .knowledge-answer-bubble > .chat-citations {
    margin-right: 12px;
    margin-left: 12px;
    padding-right: 0;
    padding-left: 0;
  }
  .knowledge-answer-images {
    padding: 10px;
  }
  .knowledge-answer-image-grid {
    grid-template-columns: 1fr;
  }
  .knowledge-answer-image-grid img {
    height: 210px;
  }
  .knowledge-answer-head {
    padding-inline: 13px;
  }
  .knowledge-answer-media-badge {
    display: none;
  }
  .knowledge-question-scope {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .knowledge-question-scope > span {
    flex: 1 1 auto;
  }
  .knowledge-question-scope > div {
    width: 100%;
    margin-left: 0;
  }
  .knowledge-question-scope button {
    flex: 1 1 0;
    padding-inline: 6px;
  }
}

/* ========== 2026 学习全景雷达视觉系统 ========== */
html[data-theme="dark"] {
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e8eef6;
  --muted: #94a3b8;
  --primary: #4c8dff;
  --primary-soft: rgba(76, 141, 255, .18);
  --border: #2d3a4d;
  --danger: #ff7875;
  --ok: #73d13d;
  --shadow: 0 8px 28px rgba(0, 0, 0, .4);
  --page-bg: linear-gradient(160deg, #0b1220 0%, #121a27 45%, #0f1623 100%);
  --input-bg: #121a27;
  --topbar-bg: rgba(18, 26, 39, .88);
  --hover-bg: #243044;
  --dashed: #2d3a4d;
  --ghost-bg: #1a2332;
  --soft-panel: #152031;
  --track: #2d3a4d;
  --pending-track: #3a4a60;
  --card-border: rgba(45, 58, 77, .95);
  --chip-bg: #152031;
  --chip-border: #2d3a4d;
  --stage-bg: #121a27;
}

.shell {
  grid-template-columns: 168px minmax(0, 1fr);
}
.shell.sider-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}
.sider {
  gap: 10px;
  padding: 9px 10px 14px;
  background: var(--nav-bg);
  border-right: 0;
  scrollbar-width: none;
}
.sider::-webkit-scrollbar { display: none; }
.sider-top {
  min-height: 29px;
  padding: 0 2px 3px;
}
.sider .logo {
  font-size: 18px;
  letter-spacing: .02em;
}
.nav-item {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--nav-text);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.nav-item:hover {
  color: var(--nav-active-text);
  background: var(--nav-hover-bg);
}
.nav-item.active {
  color: var(--nav-active-text);
  background: var(--nav-active-bg);
  box-shadow: none;
  font-weight: 600;
}
.nav-dropdown-panel {
  background: var(--nav-sub-bg);
  border-radius: 10px;
}
.nav-dropdown-panel .nav-item.nav-sub.active {
  color: var(--nav-active-text);
  background: var(--nav-active-bg);
}
.topbar {
  height: 60px;
  padding: 0 24px;
  border-color: var(--border);
  backdrop-filter: blur(8px);
}
.topbar-role {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.topbar-actions {
  gap: 7px;
}
.topbar-ai {
  min-width: 210px;
  width: 210px;
  height: 36px;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 8px 0 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.topbar-ai img {
  width: 15px;
  height: 15px;
  opacity: .78;
}
html[data-theme="dark"] .topbar-ai img {
  filter: invert(70%) sepia(18%) saturate(485%) hue-rotate(176deg) brightness(91%);
}
.topbar-ai small {
  margin-left: auto;
  border-radius: 5px;
}
.topbar-ai:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--input-bg);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.content {
  padding: 20px 24px 40px;
}
.card {
  border-radius: 12px;
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .card {
  box-shadow: none;
}
.btn,
.btn.ghost,
.tab,
input,
textarea,
select {
  border-radius: 10px;
}
.table th {
  color: var(--muted);
  background: color-mix(in srgb, var(--soft-panel) 82%, transparent);
  font-size: 11px;
  letter-spacing: .02em;
}
.table td {
  border-color: var(--dashed);
}

.dashboard-shell .content {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
}
.dashboard-shell .card {
  border-radius: 12px;
}
.radar-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.radar-kicker {
  margin-bottom: 6px;
  color: #4d8dff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .2em;
}
.radar-head h1 {
  margin: 0;
  font-size: clamp(26px, 2.4vw, 36px);
  line-height: 1.18;
  letter-spacing: -.03em;
}
.radar-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.radar-head-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--soft-panel);
  font-size: 11px;
  white-space: nowrap;
}
.radar-head-state span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #32c68a;
  box-shadow: 0 0 0 3px rgba(50, 198, 138, .11);
}
.radar-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 12px;
}
.radar-kpi {
  min-width: 0;
  min-height: 114px;
  padding: 15px 16px 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--radar-tone) 7%, var(--panel)), var(--panel) 62%);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.radar-kpi::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--radar-tone), transparent 76%);
}
.radar-kpi.is-blue { --radar-tone: #4d8dff; }
.radar-kpi.is-cyan { --radar-tone: #29b7c4; }
.radar-kpi.is-violet { --radar-tone: #8c73ff; }
.radar-kpi.is-amber { --radar-tone: #f0a64a; }
.radar-kpi.is-green { --radar-tone: #31c78a; }
.radar-kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.radar-kpi-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--radar-tone);
  background: color-mix(in srgb, var(--radar-tone) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--radar-tone) 24%, transparent);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}
.radar-kpi-mark img,
.radar-focus-icon img {
  display: block;
  width: 14px;
  height: 14px;
  filter: brightness(0) saturate(100%) invert(73%) sepia(16%) saturate(1287%) hue-rotate(178deg) brightness(102%);
}
.radar-kpi-label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.radar-kpi > strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: clamp(24px, 2vw, 31px);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.radar-kpi > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radar-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(300px, .78fr);
  gap: 12px;
  margin-bottom: 12px;
}
.radar-panel {
  min-width: 0;
  padding: 17px 18px;
}
.radar-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.radar-panel-head h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .01em;
}
.radar-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.radar-panel-head > a {
  color: #6fa3ff;
  font-size: 11px;
}
.radar-period {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--soft-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10px;
}
.radar-panorama-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(180px, .75fr);
  gap: 20px;
}
.radar-section-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.radar-line-wrap {
  height: 190px;
}
.radar-line-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}
.radar-line-grid {
  stroke: var(--dashed);
  stroke-width: 1;
}
.radar-line-axis {
  fill: var(--muted);
  font-size: 8px;
}
.radar-line-area {
  fill: rgba(77, 141, 255, .12);
}
.radar-line-path {
  fill: none;
  stroke: #4d8dff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.radar-line-point {
  fill: #72a8ff;
  stroke: var(--panel);
  stroke-width: 2;
}
.radar-progress-items {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.radar-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 10px;
}
.radar-progress-copy span {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radar-progress-copy strong {
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.radar-progress-track {
  height: 5px;
  overflow: hidden;
  background: var(--track);
  border-radius: 999px;
}
.radar-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3d78e5, #61a0ff);
  border-radius: inherit;
}
.radar-focus {
  display: flex;
  flex-direction: column;
}
.radar-focus-item {
  --focus-color: #4d8dff;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 69px;
  padding: 11px 4px;
  border-top: 1px solid var(--dashed);
  transition: background-color .15s ease;
}
.radar-focus-item:hover {
  background: color-mix(in srgb, var(--focus-color) 6%, transparent);
}
.radar-focus-item.is-danger { --focus-color: #ff657a; }
.radar-focus-item.is-warn { --focus-color: #f0a64a; }
.radar-focus-item.is-info { --focus-color: #4d8dff; }
.radar-focus-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--focus-color);
  background: color-mix(in srgb, var(--focus-color) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--focus-color) 22%, transparent);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}
.radar-focus-item.is-danger .radar-focus-icon img {
  filter: brightness(0) saturate(100%) invert(55%) sepia(66%) saturate(1820%) hue-rotate(315deg) brightness(103%);
}
.radar-focus-item.is-warn .radar-focus-icon img {
  filter: brightness(0) saturate(100%) invert(76%) sepia(48%) saturate(1015%) hue-rotate(338deg) brightness(99%);
}
.radar-focus-item > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.radar-focus-item strong {
  font-size: 12px;
}
.radar-focus-item span,
.radar-focus-item small {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radar-focus-item > b {
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
}
.radar-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 12px;
}
.radar-timeline {
  position: relative;
}
.radar-timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--dashed);
}
.radar-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 8px 0;
}
.radar-timeline-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  z-index: 1;
}
.radar-timeline-dot.is-blue { background: #4d8dff; }
.radar-timeline-dot.is-green { background: #31c78a; }
.radar-timeline-item strong {
  display: block;
  font-size: 11px;
  line-height: 1.35;
}
.radar-timeline-item p,
.radar-timeline-item time {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.radar-timeline-item time {
  white-space: nowrap;
}
.radar-exam-body {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.radar-donut-block {
  min-width: 0;
}
.radar-donut {
  display: block;
  width: 132px;
  height: 132px;
  margin: 0 auto;
}
.radar-donut-value {
  fill: var(--text);
  font-size: 19px;
  font-weight: 800;
}
.radar-donut-label {
  fill: var(--muted);
  font-size: 9px;
}
.radar-donut-legend {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}
.radar-donut-legend span {
  white-space: nowrap;
}
.radar-donut-legend i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 2px;
}
.radar-result-list {
  min-width: 0;
}
.radar-result-head,
.radar-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 58px;
  gap: 8px;
  align-items: center;
  min-height: 31px;
  padding: 0 7px;
  border-bottom: 1px solid var(--dashed);
  font-size: 10px;
}
.radar-result-head {
  min-height: 26px;
  color: var(--muted);
  background: var(--soft-panel);
  border-radius: 5px 5px 0 0;
  font-size: 9px;
}
.radar-result-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radar-result-row strong {
  font-variant-numeric: tabular-nums;
}
.radar-result-row em {
  color: #ff7a8b;
  font-style: normal;
  font-size: 9px;
}
.radar-result-row em.passed {
  color: #31c78a;
}

/* AI 快捷提问卡保持固定位置，避免悬停时整体抖动或文字偏移。 */
.ai-suggestion,
.ai-suggestion:hover:not(:disabled) {
  transform: none;
}
.ai-suggestion:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}

@media (max-width: 1180px) {
  .radar-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .radar-main-grid,
  .radar-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .content {
    padding: 15px 12px 28px;
  }
  .radar-head {
    align-items: flex-start;
  }
  .radar-panorama-grid {
    grid-template-columns: 1fr;
  }
  .radar-progress-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .radar-head {
    flex-direction: column;
    margin-bottom: 16px;
  }
  .radar-head h1 {
    font-size: 27px;
  }
  .radar-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .radar-kpi:last-child {
    grid-column: 1 / -1;
  }
  .radar-panel {
    padding: 15px 13px;
  }
  .radar-progress-items {
    grid-template-columns: 1fr;
  }
  .radar-exam-body {
    grid-template-columns: 1fr;
  }
  .radar-result-head,
  .radar-result-row {
    grid-template-columns: minmax(0, 1fr) 52px 48px;
  }
  .radar-timeline-item {
    grid-template-columns: 12px minmax(0, 1fr);
  }
  .radar-timeline-item time {
    grid-column: 2;
  }
}

/* 窄屏沿用参考系统的 48px 导航条、浮层菜单和紧凑顶栏。 */
@media (max-width: 900px) {
  .shell,
  .shell.sider-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .shell-narrow {
    grid-template-rows: max-content minmax(0, 1fr);
    align-content: start;
  }

  .mobile-chrome {
    position: sticky;
    top: 0;
    z-index: 60;
    overflow: visible;
    color: var(--text);
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
  }

  .mobile-nav-bar {
    position: relative;
    z-index: 72;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--nav-bg);
  }

  .mobile-nav-toggle {
    min-width: 64px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(220, 231, 245, .24);
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
  }

  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    border-color: rgba(220, 231, 245, .42);
    background: rgba(255, 255, 255, .13);
    outline: none;
  }

  .mobile-nav-current {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #fff;
  }

  .mobile-nav-current span {
    flex: 0 0 auto;
    color: #91a4bc;
    font-size: 11px;
  }

  .mobile-nav-current strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-top {
    position: relative;
    z-index: 61;
    min-height: 60px;
    padding: 8px 12px;
    background: var(--topbar-bg);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
  }

  .mobile-logo {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .03em;
  }

  .mobile-user-line {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-user-name {
    color: var(--muted);
    font-weight: 600;
  }

  .mobile-actions {
    gap: 7px;
  }

  .mobile-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--muted);
    box-shadow: none;
  }

  .mobile-icon-btn:hover,
  .mobile-icon-btn.active {
    color: var(--text);
    border-color: var(--primary);
    background: var(--input-bg);
    box-shadow: 0 0 0 3px var(--primary-soft);
  }

  .mobile-ai-btn {
    min-width: 44px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--primary);
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 48px 0 0;
    z-index: 69;
    display: block;
    width: 100%;
    height: calc(100dvh - 48px);
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, .42);
    cursor: default;
  }

  .mobile-nav {
    position: fixed;
    top: 56px;
    left: 12px;
    right: 12px;
    z-index: 71;
    width: auto;
    max-height: calc(100dvh - 72px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(220, 231, 245, .16);
    border-radius: 14px;
    background: var(--nav-bg);
    box-shadow: 0 18px 50px rgba(2, 8, 23, .38);
    scrollbar-width: none;
  }

  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav.mobile-open { display: flex; }

  .mobile-nav .mobile-nav-item {
    width: 100%;
    min-height: 44px;
    margin: 0;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--nav-text);
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    scroll-snap-align: none;
  }

  .mobile-nav .mobile-nav-item:hover {
    color: var(--nav-active-text);
    background: var(--nav-hover-bg);
  }

  .mobile-nav .mobile-nav-item.active {
    color: var(--nav-active-text);
    background: var(--nav-active-bg);
    font-weight: 600;
  }

  .mobile-manage-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 3px;
    margin: 0;
    padding: 6px;
    border: 0;
    border-radius: 10px;
    background: var(--nav-sub-bg);
  }

  .mobile-manage-row .mobile-manage-item {
    padding-left: 18px;
    color: #c8d5e5;
    background: transparent;
  }

  .mobile-user-panel {
    color: var(--text);
    background: var(--panel);
    border-color: var(--border);
  }

  .shell-narrow .main,
  .shell-narrow .content {
    width: 100%;
    min-width: 0;
  }

  .shell-narrow .content {
    padding: 15px 12px 28px;
  }
}

@media (max-width: 720px) {
  .shell-narrow .content {
    padding: 12px 12px 28px;
  }

  .mobile-top {
    min-height: 52px;
    padding: 8px 12px;
  }

  .mobile-icon-btn,
  .mobile-nav-toggle {
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .shell-narrow .content {
    padding: 10px 8px 24px;
  }

  .mobile-user-line {
    max-width: 190px;
  }
}

/* 企业知识库：空间导航 + 内容工作区 */
.knowledge-page-head {
  align-items: flex-end;
  margin-bottom: 18px;
}

.knowledge-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.knowledge-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.knowledge-main {
  min-width: 0;
}

.knowledge-space-sidebar {
  position: sticky;
  top: 76px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.knowledge-space-sidebar-head {
  padding: 16px 15px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 64%, var(--panel)), var(--panel));
}

.knowledge-space-sidebar-head > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.knowledge-space-sidebar-head span {
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
}

.knowledge-space-sidebar-head strong {
  color: var(--primary);
  font-size: 12px;
}

.knowledge-space-sidebar-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.knowledge-space-section {
  padding: 10px 9px 7px;
}

.knowledge-space-section + .knowledge-space-section {
  padding-top: 7px;
  border-top: 1px solid var(--dashed);
}

.knowledge-space-section-title {
  padding: 2px 7px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
}

.knowledge-space-nav-list {
  display: contents;
}

.knowledge-space-nav-item {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  gap: 10px;
  margin: 0 0 3px;
  padding: 7px 8px 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.knowledge-space-nav-item:hover {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  background: var(--soft-panel);
}

.knowledge-space-nav-item.active {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border));
  background: var(--primary-soft);
  color: var(--primary);
}

.knowledge-space-nav-copy {
  min-width: 0;
}

.knowledge-space-nav-copy strong,
.knowledge-space-nav-copy small {
  display: block;
}

.knowledge-space-nav-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-space-nav-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.knowledge-space-nav-count {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  min-width: 26px;
  height: 24px;
  border-radius: 8px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.knowledge-space-nav-item.active .knowledge-space-nav-count {
  background: var(--panel);
  color: var(--primary);
}

.knowledge-workspace {
  padding: 0 18px 18px;
  border-radius: 16px;
  background: var(--panel);
}

.knowledge-workspace-head {
  padding: 19px 2px 16px;
}

.knowledge-workspace-identity {
  gap: 12px;
}

.knowledge-workspace-scope {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 750;
}

.knowledge-command-bar {
  padding: 14px 2px 18px;
}

.knowledge-search-field {
  min-width: 0;
}

.knowledge-search-field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.knowledge-search-field > div {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.knowledge-search-field input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.knowledge-search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.knowledge-search-field .btn {
  flex: 0 0 auto;
  min-width: 74px;
}

.knowledge-filter-panel {
  margin: 14px 2px 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-panel);
}

.knowledge-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.knowledge-filter-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.knowledge-filter-head strong {
  font-size: 13px;
}

.knowledge-filter-head span,
.knowledge-filter-head small {
  color: var(--muted);
  font-size: 11px;
}

.knowledge-type-tabs {
  flex-wrap: wrap;
  gap: 6px;
}

.knowledge-type-tabs button {
  padding: 6px 11px;
  background: var(--panel);
}

.knowledge-category-groups {
  gap: 20px;
}

.knowledge-category-group-head {
  margin-bottom: 10px;
}

@media (min-width: 1440px) {
  .knowledge-doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .knowledge-shell {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 14px;
  }

  .knowledge-workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-workspace-stats {
    width: 100%;
  }

  .knowledge-workspace-stats > div {
    flex: 1;
  }

  .knowledge-doc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .knowledge-page-head {
    align-items: flex-start;
  }

  .knowledge-shell {
    grid-template-columns: 1fr;
  }

  .knowledge-space-sidebar {
    position: static;
  }

  .knowledge-space-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .knowledge-space-sidebar-head small {
    margin: 0;
  }

  .knowledge-space-section {
    display: block;
  }

  .knowledge-space-nav-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
}

@media (max-width: 600px) {
  .knowledge-page-head {
    gap: 14px;
  }

  .knowledge-page-actions {
    width: 100%;
  }

  .knowledge-page-actions .btn {
    flex: 1;
  }

  .knowledge-space-nav-list.is-company {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-space-nav-list.is-department {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: repeat(2, minmax(46px, auto));
    grid-auto-columns: minmax(150px, calc(50% - 3px));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 3px;
  }

  .knowledge-space-nav-list.is-department::-webkit-scrollbar {
    height: 4px;
  }

  .knowledge-workspace {
    padding: 0 12px 14px;
  }

  .knowledge-workspace-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-type-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .knowledge-type-tabs button {
    white-space: nowrap;
  }
}

/* 知识库三个页面共用的左侧分类栏 */
.knowledge-left-panel {
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.knowledge-left-panel-head {
  display: block;
  margin: 0;
  padding: 16px 15px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 64%, var(--panel)), var(--panel));
}

.knowledge-left-panel-head > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.knowledge-left-panel-head > div > span {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
}

.knowledge-left-panel-head > div > strong {
  color: var(--primary);
  font-size: 12px;
}

.knowledge-left-panel-head > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.knowledge-left-panel-action {
  width: 100%;
  margin-top: 12px;
}

.knowledge-left-panel-list {
  padding: 10px 9px 7px;
}

.knowledge-left-panel-section-title {
  padding: 2px 7px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
}

.knowledge-left-nav-item {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  gap: 10px;
  margin: 0 0 3px;
  padding: 7px 8px 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.knowledge-left-nav-item:hover {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  background: var(--soft-panel);
}

.knowledge-left-nav-item.active {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border));
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
}

.knowledge-left-nav-copy {
  min-width: 0;
  flex: 1;
}

.knowledge-left-nav-copy strong,
.knowledge-left-nav-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-left-nav-copy strong {
  font-size: 13px;
  line-height: 1.3;
}

.knowledge-left-nav-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.knowledge-left-nav-count {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  min-width: 26px;
  width: auto;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.knowledge-left-nav-item.active .knowledge-left-nav-count {
  border: 0;
  background: var(--panel);
  color: var(--primary);
}

.knowledge-chat-page,
.technical-workspace {
  grid-template-columns: 238px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.knowledge-chat-page {
  height: clamp(560px, calc(100dvh - 190px), 720px);
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.knowledge-chat-history,
.technical-tabs {
  width: 100%;
  padding: 0;
  border-right: 0;
  background: var(--panel);
}

.knowledge-chat-main,
.technical-case-panel {
  min-width: 0;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.knowledge-chat-main {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.knowledge-chat-history {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.knowledge-chat-welcome {
  overflow-y: auto;
}

.knowledge-chat-messages {
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.technical-case-panel {
  padding: 20px;
}

.technical-tabs .knowledge-left-nav-item {
  gap: 10px;
  margin: 0 0 3px;
  padding: 7px 8px 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.technical-tabs .knowledge-left-nav-item:hover {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  background: var(--soft-panel);
}

.technical-tabs .knowledge-left-nav-item.active {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border));
  background: var(--primary-soft);
}

.technical-tabs .knowledge-left-nav-item > .knowledge-left-nav-copy,
.technical-tabs .knowledge-left-nav-item.active > .knowledge-left-nav-copy {
  display: block;
  width: auto;
  height: auto;
  flex: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  place-items: initial;
  text-align: left;
}

.technical-tabs .knowledge-left-nav-copy strong,
.technical-tabs .knowledge-left-nav-copy small {
  display: block;
}

.knowledge-chat-session-list {
  max-height: calc(min(720px, 100vh - 190px) - 111px);
  overflow-y: auto;
}

.knowledge-chat-session {
  gap: 10px;
  margin: 0 0 3px;
  padding: 7px 8px 7px 10px;
  border-radius: 10px;
}

.knowledge-chat-session-tools {
  display: flex;
  align-items: center;
  gap: 3px;
}

.knowledge-chat-session-delete {
  flex: 0 0 24px;
}

@media (max-width: 1000px) {
  .knowledge-chat-page,
  .technical-workspace {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .knowledge-chat-page {
    height: clamp(560px, calc(100dvh - 190px), 720px);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
  }

  .knowledge-chat-history,
  .technical-tabs {
    display: block;
  }

  .knowledge-chat-history {
    width: 100%;
    height: auto;
    max-height: 154px;
    overflow: hidden;
  }

  .knowledge-chat-main {
    height: 100%;
    min-height: 0;
  }

  .technical-tab-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .technical-tab-list .knowledge-left-panel-section-title {
    grid-column: 1 / -1;
  }

  .technical-tabs .knowledge-left-nav-item {
    margin: 0;
  }

  .knowledge-chat-session-list {
    display: flex;
    gap: 6px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
  }

  .knowledge-chat-session-list .knowledge-left-panel-section-title {
    display: none;
  }

  .knowledge-chat-history-empty {
    width: 100%;
    padding: 18px 10px;
  }

  .knowledge-chat-session {
    flex: 0 0 220px;
    margin: 0;
  }
}

@media (max-width: 600px) {
  .knowledge-left-panel-head {
    padding: 14px 13px 12px;
  }

  .technical-tab-list {
    gap: 3px;
    padding: 8px 7px;
  }

  .technical-tabs .knowledge-left-nav-item {
    justify-content: space-between;
    padding: 7px 7px 7px 9px;
  }

  .technical-tabs .knowledge-left-nav-copy small {
    display: none;
  }

  .knowledge-chat-session-list {
    padding: 8px 7px 10px;
  }

  .knowledge-chat-session {
    flex-basis: min(220px, calc(100vw - 52px));
  }
}

/* 企业知识库：一级、二级分类折叠展示 */
.knowledge-primary-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.knowledge-primary-group-head {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 14px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--soft-panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.knowledge-primary-group-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.knowledge-primary-group-head strong {
  font-size: 16px;
}

.knowledge-primary-group-head > div > span,
.knowledge-collapse-state {
  color: var(--muted);
  font-size: 11px;
}

.knowledge-collapse-state {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  text-align: center;
}

.knowledge-primary-group-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px;
}

.knowledge-primary-group .knowledge-category-group-head {
  appearance: none;
  width: 100%;
  margin: 0 0 10px;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.knowledge-primary-group .knowledge-category-group-head small {
  text-align: right;
}

.knowledge-type-tabs button.is-secondary {
  border-style: dashed;
  font-weight: 500;
}

.knowledge-type-tabs button.is-secondary.active {
  border-style: solid;
}

.knowledge-category-edit-panel {
  display: grid;
  gap: 10px;
}

.knowledge-category-edit-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-category-edit-selects label {
  display: grid;
  gap: 5px;
}

.knowledge-category-edit-selects label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.knowledge-category-edit-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 600px) {
  .knowledge-category-edit-selects {
    grid-template-columns: 1fr;
  }

  .knowledge-primary-group-head {
    align-items: flex-start;
    padding: 12px;
  }

  .knowledge-primary-group-head > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .knowledge-primary-group-body {
    padding: 12px;
  }

  .knowledge-primary-group .knowledge-category-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-primary-group .knowledge-category-group-head small {
    text-align: left;
  }
}

/* AI技术解疑：上传页自然高度，分析记录页固定高度内部滚动 */
.technical-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.technical-page-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--soft-panel);
}

.technical-page-switch a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.technical-page-switch a:hover {
  color: var(--primary);
}

.technical-page-switch a.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 20%, transparent);
}

.technical-page-scroll {
  height: clamp(500px, calc(100dvh - 190px), 760px);
  min-height: 0;
  max-height: 760px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.technical-workspace.technical-page-scroll {
  align-items: start;
  overflow-y: auto;
}

.technical-history-workspace > .technical-analysis-history {
  position: sticky;
  top: 0;
  z-index: 2;
  align-self: start;
  width: 100%;
  max-height: 100%;
  padding: 0;
  border-right: 0;
  background: var(--panel);
  overflow-y: auto;
}

.technical-history-list {
  display: block;
}

.technical-history-workspace .technical-analysis-history-item {
  gap: 9px;
  margin: 0 0 3px;
  padding: 8px 7px 8px 9px;
  border-radius: 10px;
}

.technical-history-workspace .technical-analysis-history-item > .knowledge-left-nav-count {
  display: none !important;
}

.technical-history-workspace .technical-analysis-history-item > .knowledge-left-nav-copy {
  display: flex;
  place-items: initial;
  min-width: 0;
  width: auto;
  height: auto;
  flex: 1;
  color: inherit;
  background: transparent;
  border-radius: 0;
}

.technical-history-report-panel {
  min-height: 100%;
}

.technical-history-report-panel .technical-report-chat {
  margin-top: 18px;
}

@media (max-width: 1000px) {
  .technical-page-scroll {
    height: clamp(520px, calc(100dvh - 210px), 720px);
  }

  .technical-workspace.technical-page-scroll {
    display: block;
  }

  .technical-history-workspace > .technical-analysis-history {
    display: block;
    position: sticky;
    top: 0;
    max-height: none;
    overflow: hidden;
  }

  .technical-history-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
  }

  .technical-history-list .knowledge-left-panel-section-title {
    display: none;
  }

  .technical-history-workspace .technical-analysis-history-item {
    flex: 0 0 220px;
    margin: 0;
  }
}

@media (max-width: 700px) {
  .technical-page-head {
    align-items: stretch;
  }

  .technical-page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .technical-page-switch {
    width: 100%;
  }

  .technical-page-switch a {
    flex: 1;
    justify-content: center;
  }

  .technical-ai-state {
    justify-content: center;
  }

  .technical-page-scroll {
    height: clamp(500px, calc(100dvh - 250px), 680px);
  }
}

/* 知识库三个主页标题区与学习看板保持同一文字层级和间距 */
.knowledge-title-copy {
  min-width: 0;
}

.knowledge-title-copy .knowledge-title-kicker {
  margin-bottom: 6px;
  color: #4d8dff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .2em;
}

.knowledge-title-copy .dash-title {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -.03em;
}

.knowledge-title-copy .knowledge-title-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: normal;
}

@media (max-width: 700px) {
  .knowledge-workspace-stats {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .knowledge-workspace-stats > div {
    min-width: 0;
    padding-inline: 4px;
  }
}

.knowledge-page-head .dash-title,
.knowledge-ai-head .dash-title,
.technical-page-head .dash-title {
  font-size: clamp(26px, 2.4vw, 36px);
}

@media (max-width: 640px) {
  .knowledge-ai-head {
    align-items: flex-start;
  }

  .knowledge-page-head .dash-title,
  .knowledge-ai-head .dash-title,
  .technical-page-head .dash-title {
    font-size: 27px;
  }
}

/* ========== 学习看板 · 智能车间数据大屏 ========== */
.dashboard-shell {
  --bg: #0b1320;
  --panel: #172232;
  --text: #edf3fc;
  --muted: #7f8da3;
  --border: #29394e;
  --dashed: #26364a;
  --track: #33465e;
  --soft-panel: #111c2b;
  --card-border: #29394e;
  background: #0b1320;
}

.dashboard-shell .main {
  background: #0b1320;
}

.dashboard-shell .topbar {
  background: rgba(15, 25, 39, .96);
  border-color: #26364a;
  box-shadow: none;
}

.dashboard-shell .content {
  width: 100%;
  max-width: none;
}

.workshop-dashboard {
  width: 100%;
  min-width: 0;
  color: #edf3fc;
  font-variant-numeric: tabular-nums;
}

.ws-dashboard-head {
  padding: 7px 4px 0;
  margin-bottom: 16px;
}

.ws-kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.ws-kpi {
  --ws-tone: #2585ff;
  position: relative;
  min-width: 0;
  height: 96px;
  padding: 14px 15px 12px;
  overflow: hidden;
  background: #172232;
  border: 1px solid #29394e;
  border-radius: 10px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .015);
}

.ws-kpi.is-blue { --ws-tone: #2e8cff; }
.ws-kpi.is-cyan { --ws-tone: #23b8b8; }
.ws-kpi.is-violet { --ws-tone: #8a3fe2; }
.ws-kpi.is-green { --ws-tone: #5ecf43; }
.ws-kpi.is-sky { --ws-tone: #4296ee; }
.ws-kpi.is-amber { --ws-tone: #eca92e; }
.ws-kpi.is-red { --ws-tone: #dc3548; }

.ws-kpi::before {
  content: "";
  position: absolute;
  width: 94px;
  height: 94px;
  top: -58px;
  right: -24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ws-tone) 12%, transparent);
}

.ws-kpi-orbit {
  position: absolute;
  top: 17px;
  right: 15px;
  width: 6px;
  height: 6px;
  border: 2px solid var(--ws-tone);
  border-radius: 50%;
  box-shadow: 0 0 7px var(--ws-tone);
}

.ws-kpi-label {
  position: relative;
  color: #8190a6;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.ws-kpi strong {
  position: relative;
  display: block;
  margin-top: 8px;
  color: #f0f5ff;
  font-size: clamp(23px, 2vw, 28px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.025em;
}

.ws-kpi p {
  position: relative;
  margin: 8px 0 0;
  color: #73839a;
  font-size: 9px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.ws-grid:last-child {
  margin-bottom: 0;
}

.ws-grid-top .ws-panel { height: 280px; }
.ws-grid-middle .ws-panel { height: 260px; }
.ws-grid-bottom .ws-panel { height: 250px; }
.ws-panel-span-8 { grid-column: span 8; }
.ws-panel-span-6 { grid-column: span 6; }
.ws-panel-span-4 { grid-column: span 4; }
.ws-panel-span-3 { grid-column: span 3; }

.ws-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 15px 16px 13px;
  overflow: hidden;
  background: #172232;
  border: 1px solid #29394e;
  border-radius: 10px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .012);
}

.ws-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 37px;
  flex: 0 0 auto;
}

.ws-panel-head h2 {
  margin: 0;
  color: #e8eef8;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
}

.ws-panel-head p {
  margin: 5px 0 0;
  color: #718197;
  font-size: 9px;
  line-height: 1.2;
}

.ws-panel-value {
  color: #318cff;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.ws-chart {
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}

.ws-chart-donut {
  min-height: 150px;
}

.ws-panel-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 27px;
  padding-top: 10px;
  color: #718197;
  border-top: 1px solid #29394e;
  font-size: 9px;
  flex: 0 0 auto;
}

.ws-panel-summary b {
  margin-left: 4px;
  color: #dbe6f5;
  font-size: 11px;
}

.ws-progress-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding-top: 7px;
  overflow: auto;
}

.ws-progress-item {
  display: block;
  min-width: 0;
}

.ws-progress-item > div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 9px;
}

.ws-progress-item strong {
  min-width: 0;
  overflow: hidden;
  color: #d8e2ef;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-progress-item span {
  color: #687990;
  white-space: nowrap;
}

.ws-progress-item b {
  color: #e2ebf6;
  font-size: 9px;
}

.ws-progress-track {
  height: 6px;
  overflow: hidden;
  background: #33465e;
  border-radius: 5px;
}

.ws-progress-track span {
  display: block;
  height: 100%;
  min-width: 2px;
  background: #328cff;
  border-radius: inherit;
}

.ws-deadline-list {
  display: grid;
  gap: 14px;
  padding-top: 11px;
}

.ws-deadline-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  color: #8493a8;
  font-size: 9px;
}

.ws-deadline-item > div {
  height: 6px;
  overflow: hidden;
  background: #33465e;
  border-radius: 6px;
}

.ws-deadline-item i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}

.ws-deadline-item b {
  color: #dce6f3;
  font-size: 9px;
  text-align: right;
}

@media (max-width: 1280px) {
  .ws-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ws-kpi {
    height: 90px;
  }
}

@media (max-width: 1080px) {
  .ws-panel-span-8,
  .ws-panel-span-6,
  .ws-panel-span-4 {
    grid-column: span 12;
  }

  .ws-panel-span-3 {
    grid-column: span 6;
  }

  .ws-grid-top .ws-panel,
  .ws-grid-middle .ws-panel,
  .ws-grid-bottom .ws-panel {
    height: 260px;
  }
}

@media (max-width: 700px) {
  .ws-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ws-kpi:last-child {
    grid-column: 1 / -1;
  }

  .ws-panel-span-3 {
    grid-column: span 12;
  }

  .ws-grid-top .ws-panel,
  .ws-grid-middle .ws-panel,
  .ws-grid-bottom .ws-panel {
    height: 250px;
  }

  .ws-panel {
    padding: 14px 13px 12px;
  }

  .ws-panel-summary {
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }
}
