:root {
  --bg: #05070d;
  --panel: rgba(13, 19, 32, 0.78);
  --panel-solid: #0b111c;
  --panel-soft: rgba(255, 255, 255, 0.022);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #e8eef9;
  --muted: #8493ac;
  --dim: #5b677c;
  --cyan: #3ddcff;
  --violet: #8b7cff;
  --green: #3ee0a0;
  --amber: #ffc85c;
  --red: #ff6b81;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(61, 220, 255, 0.25); }

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}
.bg-glow { position: fixed; z-index: 0; pointer-events: none; filter: blur(90px); opacity: .5; }
.bg-glow-a { width: 560px; height: 420px; top: -180px; left: 8%; background: rgba(61,220,255,.16); }
.bg-glow-b { width: 520px; height: 420px; top: -120px; right: 4%; background: rgba(139,124,255,.16); }

/* ------------------------------- 顶栏 ------------------------------- */
.topbar {
  position: relative; z-index: 10;
  height: 64px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 250px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(61,220,255,.12), rgba(139,124,255,.1));
  border: 1px solid rgba(61,220,255,.22);
  box-shadow: 0 0 24px rgba(61,220,255,.12);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text h1 { margin: 0; font-size: 15.5px; letter-spacing: .2px; font-weight: 650; }
.brand-text p { margin: 2px 0 0; font-size: 11px; color: var(--dim); letter-spacing: .4px; }

.nav { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.nav-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 18px; border-radius: 9px; font-size: 13px; transition: .18s;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  color: #061018; font-weight: 600;
  background: linear-gradient(135deg, var(--cyan), #6ce9ff);
  box-shadow: 0 4px 16px rgba(61,220,255,.25);
}

.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 250px; justify-content: flex-end; }
.model-chip {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  padding: 6px 11px; border-radius: 20px; white-space: nowrap;
}
.model-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.model-chip.online { color: #bff5df; border-color: rgba(62,224,160,.28); background: rgba(62,224,160,.08); }
.model-chip.online .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.user-chip {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  padding: 5px 12px 5px 5px; border-radius: 22px; transition: .18s;
}
.user-chip:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.22); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: #08131f;
  background: linear-gradient(135deg, #3ddcff, #8b7cff);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 12px; font-weight: 600; color: var(--text); }
.user-meta i { font-style: normal; font-size: 10px; color: var(--dim); letter-spacing: .2px; }
.user-chip.logged { border-color: rgba(61,220,255,.32); background: rgba(61,220,255,.07); }

/* ------------------------------- 登录 / 账号 ------------------------------- */
.auth-card { max-width: 420px; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; margin-bottom: 18px;
}
.auth-tabs button {
  border: 0; background: transparent; color: var(--dim);
  padding: 8px 0; border-radius: 7px; font-size: 12.5px; transition: .16s;
}
.auth-tabs button.active { background: rgba(61,220,255,.14); color: #cdf3ff; }
.auth-form label {
  display: block; font-size: 11px; color: var(--dim);
  margin: 12px 0 6px; letter-spacing: .3px;
}
.auth-form input {
  width: 100%; background: rgba(3,7,14,.7); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--text);
  outline: none; transition: .16s;
}
.auth-form input:focus { border-color: rgba(61,220,255,.45); box-shadow: 0 0 0 3px rgba(61,220,255,.08); }
.auth-tip {
  font-size: 11px; color: var(--dim); line-height: 1.7;
  background: rgba(255,255,255,.022); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; margin: 16px 0;
}
.auth-tip.err { color: #ffb3bf; border-color: rgba(255,107,129,.3); background: rgba(255,107,129,.07); }
.primary-btn.full { width: 100%; justify-content: center; }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.03);
  color: var(--text); padding: 8px 13px; border-radius: 9px; font-size: 12.5px;
  transition: .18s;
}
.ghost-btn:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.22); }

/* ------------------------------- 布局 ------------------------------- */
main { position: relative; z-index: 1; height: calc(100vh - 64px); }
.view { display: none; height: 100%; padding: 16px; overflow: hidden; }
.view.active { display: block; }
.panel {
  background: linear-gradient(180deg, rgba(17,24,39,.82), rgba(9,14,24,.86));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(14px);
}
.panel-title { font-size: 13px; font-weight: 600; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.step-no {
  font-family: var(--mono); font-size: 10px; color: var(--cyan);
  border: 1px solid rgba(61,220,255,.28); background: rgba(61,220,255,.08);
  border-radius: 5px; padding: 2px 5px; letter-spacing: .5px;
}

.workbench {
  height: 100%;
  display: grid;
  grid-template-columns: 328px minmax(0, 1fr) 304px;
  gap: 14px;
}

/* ------------------------------- DLL 扩展 ------------------------------- */
.dll-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 328px minmax(0, 1fr) 304px;
  gap: 14px;
}
.dll-input {
  width: 100%; background: rgba(3, 7, 14, .72); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--text);
  outline: none; font-family: var(--mono); letter-spacing: .5px; transition: .18s;
}
.dll-input::placeholder { color: #4e5b70; font-family: var(--font, inherit); letter-spacing: 0; }
.dll-input:focus { border-color: rgba(61,220,255,.45); box-shadow: 0 0 0 3px rgba(61,220,255,.08); }
.dll-build { width: 100%; margin-top: 8px; justify-content: center; }
#view-dll .code-shell { height: auto; flex: 1; min-height: 0; }
.dll-source {
  margin: 0; padding: 8px 18px 24px; font-family: var(--mono);
  font-size: 12px; line-height: 1.7; color: #cfe0f5; white-space: pre;
}
.dll-hint {
  margin: 0 16px 16px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(255,255,255,.025);
  font-size: 11.5px; color: var(--muted); line-height: 1.7;
}
.dll-hint code { font-family: var(--mono); color: var(--cyan); }
.dll-hint ul { margin: 8px 0 0; padding-left: 18px; }
.dll-hint li.error { color: #ffb3bf; }
.dll-hint li.warning { color: #ffd894; }
.dll-hint .dll-warn { color: #ffd894; margin-top: 6px; }
.dll-ops { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.dll-ops .mini-btn { padding: 3px 9px; font-size: 10px; }
.dll-lib-author { color: var(--cyan); }

/* ------------------------------- 左栏 ------------------------------- */
.config-panel { padding: 16px; display: flex; flex-direction: column; overflow-y: auto; }
.textarea-wrap { margin-top: 14px; position: relative; }
textarea#requirement, textarea#dllRequirement {
  width: 100%; height: 126px; resize: none;
  background: rgba(3, 7, 14, .72);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 12px 26px; font-size: 13px; line-height: 1.65; color: var(--text);
  outline: none; transition: .18s;
}
textarea#requirement::placeholder, textarea#dllRequirement::placeholder { color: #4e5b70; }
textarea#requirement:focus, textarea#dllRequirement:focus { border-color: rgba(61,220,255,.45); box-shadow: 0 0 0 3px rgba(61,220,255,.08); }
.char-count { position: absolute; right: 10px; bottom: 8px; font-size: 10.5px; color: var(--dim); font-family: var(--mono); }

.chip-label { margin: 14px 0 8px; font-size: 11px; color: var(--dim); letter-spacing: .4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: rgba(255,255,255,.025);
  color: var(--muted); font-size: 11.5px; padding: 5px 9px; border-radius: 7px;
  transition: .16s; text-align: left; line-height: 1.4;
}
.chip:hover { color: var(--cyan); border-color: rgba(61,220,255,.35); background: rgba(61,220,255,.06); }

.field-label { margin: 18px 0 8px; font-size: 11px; color: var(--dim); letter-spacing: .4px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 11px; }
.segmented button {
  border: 0; background: transparent; color: var(--muted); font-size: 12px;
  padding: 8px 4px; border-radius: 8px; transition: .16s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active {
  color: var(--text); background: rgba(61,220,255,.12);
  box-shadow: inset 0 0 0 1px rgba(61,220,255,.3);
}

.option-row { display: flex; gap: 10px; margin-top: 14px; }
.option-row label { flex: 1; font-size: 11px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; }
.option-row select {
  width: 100%; background: rgba(3,7,14,.7); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 8px; font-size: 12px; color: var(--text); outline: none;
}

.primary-btn {
  position: relative; margin-top: 18px; width: 100%;
  border: 0; border-radius: 11px; padding: 13px;
  font-size: 13.5px; font-weight: 650; letter-spacing: .5px; color: #04121a;
  background: linear-gradient(135deg, #45e0ff, #8b7cff);
  box-shadow: 0 10px 26px rgba(61,220,255,.22), 0 0 0 1px rgba(255,255,255,.09) inset;
  overflow: hidden; transition: .2s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(61,220,255,.3); }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary-btn.small { width: auto; padding: 9px 18px; margin: 0; font-size: 12.5px; }
.btn-glow { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-120%); }
.primary-btn.running .btn-glow { animation: sweep 1.3s infinite; }
@keyframes sweep { to { transform: translateX(120%); } }
.primary-btn.running .btn-text::after { content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 8px; border: 2px solid rgba(4,18,26,.35); border-top-color: #04121a; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint-row { text-align: center; margin-top: 8px; font-size: 10.5px; color: var(--dim); }
kbd {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.05); color: var(--muted);
}

.knowledge-note {
  margin-top: auto; padding-top: 16px;
}
.knowledge-note::before { content: ""; display: block; height: 1px; background: var(--line); margin-bottom: 14px; }
.kn-title { font-size: 11px; color: var(--green); letter-spacing: .4px; display: flex; align-items: center; gap: 6px; }
.kn-title::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.kn-body { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.kn-body b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.kn-tip { margin-top: 9px; font-size: 10.5px; line-height: 1.6; color: var(--dim); }
.kn-tip.link { color: var(--cyan); cursor: pointer; }
.kn-tip.link:hover { text-decoration: underline; }

/* ------------------------------- 中栏 ------------------------------- */
.work-panel { display: flex; flex-direction: column; overflow: hidden; }
.pipeline-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px 0; }
.run-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.run-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.run-status.active { color: var(--cyan); }
.run-status.active .dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1.2s infinite; }
.run-status.done { color: var(--green); }
.run-status.done .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.run-status.error { color: var(--red); }
.run-status.error .dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.pipeline { display: flex; padding: 14px 18px 16px; gap: 0; }
.pipe-step { flex: 1; display: flex; align-items: flex-start; gap: 8px; position: relative; min-width: 0; }
.pipe-step:not(:last-child)::after {
  content: ""; position: absolute; top: 11px; left: 24px; right: 4px; height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
.pipe-index {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--line-strong); color: var(--dim); background: #080d16;
  transition: .25s; z-index: 1;
}
.pipe-body { min-width: 0; padding-right: 6px; }
.pipe-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; transition: .2s; }
.pipe-detail { font-size: 10px; color: var(--dim); margin-top: 3px; max-height: 26px; overflow: hidden; line-height: 1.4; }
.pipe-step.running .pipe-index {
  border-color: var(--cyan); color: var(--cyan); background: rgba(61,220,255,.1);
  box-shadow: 0 0 0 4px rgba(61,220,255,.08);
  animation: pulse 1.2s infinite;
}
.pipe-step.running .pipe-label { color: var(--cyan); }
.pipe-step.done .pipe-index { border-color: rgba(62,224,160,.5); color: var(--green); background: rgba(62,224,160,.08); }
.pipe-step.done .pipe-label { color: var(--text); }
.pipe-step.error .pipe-index { border-color: rgba(255,107,129,.5); color: var(--red); background: rgba(255,107,129,.1); }

.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 2px; }
.tab-btn {
  position: relative; border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; padding: 12px 13px; transition: .16s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 2px;
}
.tab-dot { display: none; width: 5px; height: 5px; border-radius: 50%; background: var(--red); position: absolute; top: 10px; right: 4px; }
.tab-dot.show { display: inline-block; }

.toolbar { display: flex; gap: 6px; }
.tool-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  color: var(--muted); font-size: 11.5px; padding: 6px 11px; border-radius: 7px; transition: .16s;
}
.tool-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.tool-btn:disabled { opacity: .35; cursor: not-allowed; }

.tab-body { flex: 1; min-height: 0; position: relative; }
.tab-pane { display: none; height: 100%; overflow-y: auto; }
.tab-pane.active { display: block; }

/* 空状态 */
.empty-state { height: 100%; padding: 34px 38px; display: flex; flex-direction: column; justify-content: center; }
.empty-visual { margin-bottom: 26px; }
.ev-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-node {
  font-size: 11px; color: var(--muted); padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: rgba(255,255,255,.025);
}
.ev-node.accent { color: var(--cyan); border-color: rgba(61,220,255,.35); background: rgba(61,220,255,.08); }
.ev-arrow { color: var(--dim); font-size: 11px; }
.empty-state h2 { margin: 0 0 10px; font-size: 22px; font-weight: 600; letter-spacing: .2px; }
.empty-state > p { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.8; max-width: 560px; }
.empty-state > p b { color: var(--cyan); font-weight: 600; }
.empty-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 620px; }
.empty-card {
  text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.02);
  border-radius: 10px; padding: 11px 12px; color: var(--muted); font-size: 11.5px; line-height: 1.55;
  transition: .18s;
}
.empty-card:hover { border-color: rgba(61,220,255,.3); background: rgba(61,220,255,.05); color: var(--text); }
.empty-card span { display: block; font-size: 10px; color: var(--dim); margin-bottom: 4px; font-family: var(--mono); }

/* 代码区 */
.code-shell { height: 100%; display: flex; flex-direction: column; }
.code-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--dim);
}
.code-dots { display: flex; gap: 5px; }
.code-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.12); }
.code-dots span:first-child { background: rgba(255,107,129,.6); }
.code-dots span:nth-child(2) { background: rgba(255,200,92,.55); }
.code-dots span:nth-child(3) { background: rgba(62,224,160,.5); }
.code-name { font-family: var(--mono); color: var(--muted); }
.code-badge { margin-left: auto; padding: 3px 9px; border-radius: 20px; font-size: 10.5px; border: 1px solid var(--line); color: var(--muted); }
.code-badge.ok { color: #8ef0c8; border-color: rgba(62,224,160,.3); background: rgba(62,224,160,.08); }
.code-badge.bad { color: #ffb3bf; border-color: rgba(255,107,129,.3); background: rgba(255,107,129,.08); }
.code-scroll { flex: 1; overflow: auto; padding: 10px 0 40px; }
.code-lines { min-width: max-content; font-family: var(--mono); font-size: 12.5px; line-height: 1.85; }
.code-line { display: flex; padding: 0 18px 0 0; }
.code-line:hover { background: rgba(255,255,255,.025); }
.code-line.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: rgba(61,220,255,.18); } 100% { background: transparent; } }
.ln {
  flex: none; width: 48px; text-align: right; padding-right: 16px;
  color: #3c4759; user-select: none;
}
.src { white-space: pre; }
.t-com { color: #55647d; font-style: italic; }
.t-kw { color: #c792ea; }
.t-fn { color: #82aaff; }
.t-num { color: #f78c6c; }
.t-str { color: #c3e88d; }
.t-color { color: #ffcb6b; }
.t-out { color: var(--cyan); font-weight: 600; }
.t-op { color: #89ddff; }

/* 方案 */
.plan-view, .lint-view { padding: 22px 26px 40px; }
.plan-empty { padding: 40px; color: var(--dim); font-size: 12.5px; }
.plan-head { margin-bottom: 20px; }
.plan-head h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.plan-head p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.plan-section { margin-top: 22px; }
.plan-section h3 { margin: 0 0 10px; font-size: 11.5px; color: var(--dim); letter-spacing: .6px; font-weight: 500; text-transform: uppercase; }
.logic-list { margin: 0; padding: 0; list-style: none; counter-reset: l; }
.logic-list li {
  counter-increment: l; position: relative; padding: 9px 12px 9px 36px;
  background: rgba(255,255,255,.022); border: 1px solid var(--line); border-radius: 9px;
  margin-bottom: 6px; font-size: 12.5px; color: #c6d2e4; line-height: 1.6;
}
.logic-list li::before {
  content: counter(l, decimal-leading-zero); position: absolute; left: 12px; top: 10px;
  font-family: var(--mono); font-size: 10px; color: var(--cyan); opacity: .75;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono); font-size: 10.5px; color: #a9c4ff;
  border: 1px solid rgba(139,124,255,.28); background: rgba(139,124,255,.08);
  padding: 4px 8px; border-radius: 6px;
}
.param-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.param-table th { text-align: left; font-weight: 500; color: var(--dim); font-size: 10.5px; padding: 0 10px 8px; letter-spacing: .4px; }
.param-table td { padding: 8px 10px; border-top: 1px solid var(--line); color: #c6d2e4; }
.param-table td:first-child { font-family: var(--mono); color: var(--cyan); }
.param-table td.range { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.risk-list { margin: 0; padding-left: 16px; color: #c9b48a; font-size: 12px; line-height: 1.8; }

/* 校验 */
.lint-summary {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02);
  margin-bottom: 16px;
}
.lint-summary .big { font-family: var(--mono); font-size: 26px; }
.lint-summary.ok .big { color: var(--green); }
.lint-summary.bad .big { color: var(--red); }
.lint-summary .sub { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.issue {
  display: flex; gap: 12px; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255,255,255,.018); margin-bottom: 7px;
  transition: .16s; cursor: pointer;
}
.issue:hover { border-color: var(--line-strong); background: rgba(255,255,255,.04); }
.issue .bar { flex: none; width: 2px; border-radius: 2px; background: var(--dim); }
.issue.error .bar { background: var(--red); }
.issue.warning .bar { background: var(--amber); }
.issue.info .bar { background: #6b8cff; }
.issue-main { min-width: 0; }
.issue-msg { font-size: 12.5px; color: #dbe5f4; }
.issue-hint { margin-top: 4px; font-size: 11px; color: var(--dim); line-height: 1.5; }
.issue-loc { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-right: 8px; }
.sev-label { font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-right: 8px; }
.issue.error .sev-label { color: #ffb3bf; background: rgba(255,107,129,.12); }
.issue.warning .sev-label { color: #ffd894; background: rgba(255,200,92,.12); }
.issue.info .sev-label { color: #a8bfff; background: rgba(107,140,255,.12); }

/* ------------------------------- 右栏 ------------------------------- */
.side-panel { display: flex; flex-direction: column; overflow: hidden; }
.side-block { padding: 15px 16px; border-bottom: 1px solid var(--line); }
.side-block.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; border-bottom: 0; }
.side-block:last-child { border-bottom: 0; }
.side-title { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; margin-bottom: 11px; letter-spacing: .3px; }
.side-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 11px; }
.side-tab {
  display: flex; align-items: center; gap: 6px; border: 0; background: transparent;
  color: var(--dim); font-size: 11.5px; letter-spacing: .3px; padding: 3px 8px;
  border-radius: 5px; cursor: pointer; transition: .15s;
}
.side-tab:hover { color: var(--text); }
.side-tab.active { color: var(--text); background: rgba(255,255,255,.06); }
.side-count { font-family: var(--mono); font-size: 10px; color: var(--cyan); background: rgba(61,220,255,.1); border: 1px solid rgba(61,220,255,.2); border-radius: 20px; padding: 1px 7px; }
.mini-btn {
  margin-left: auto; border: 1px solid var(--line); background: transparent; color: var(--dim);
  font-size: 10px; padding: 3px 8px; border-radius: 5px; transition: .16s;
}
.mini-btn:hover { color: var(--text); border-color: var(--line-strong); }
.side-empty { font-size: 11px; color: var(--dim); line-height: 1.7; padding: 6px 0; }

.recall-list { max-height: 238px; overflow-y: auto; margin-right: -4px; padding-right: 4px; }
.recall-item {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-bottom: 6px;
  background: rgba(255,255,255,.018); cursor: pointer; transition: .16s;
}
.recall-item:hover { border-color: rgba(61,220,255,.28); background: rgba(61,220,255,.04); }
.recall-top { display: flex; align-items: baseline; gap: 6px; }
.recall-name { font-family: var(--mono); font-size: 11.5px; color: var(--cyan); }
.recall-cn { font-size: 11px; color: #aab6c9; }
.recall-cat { margin-left: auto; font-size: 9.5px; color: var(--dim); }
.recall-usage { font-size: 10px; color: var(--dim); margin-top: 4px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.score-wrap { display: flex; align-items: center; gap: 14px; }
.score-ring {
  --p: 0; width: 62px; height: 62px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), rgba(255,255,255,.06) 0);
  display: grid; place-items: center; position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #0a101b; }
.score-ring span { position: relative; font-family: var(--mono); font-size: 16px; color: var(--text); }
.score-meta { font-size: 12px; color: #cfdaea; }
.score-sub { font-size: 10.5px; color: var(--dim); margin-top: 4px; }
.score-stats { display: flex; gap: 12px; margin-top: 13px; font-size: 10.5px; color: var(--muted); }
.score-stats span { display: flex; align-items: center; gap: 5px; }
.score-stats b { font-family: var(--mono); color: var(--text); font-weight: 500; }
.sev { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.sev.error { background: var(--red); }
.sev.warn { background: var(--amber); }
.sev.info { background: #6b8cff; }

.history-list { overflow-y: auto; flex: 1; margin-right: -4px; padding-right: 4px; }
.history-item { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; transition: .16s; position: relative; }
.history-item:hover { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.history-title { font-size: 11.5px; color: #d5e0f0; padding-right: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { display: flex; gap: 7px; margin-top: 4px; font-size: 9.5px; color: var(--dim); font-family: var(--mono); }
.history-del { position: absolute; top: 7px; right: 7px; border: 0; background: transparent; color: #47536a; font-size: 14px; line-height: 1; padding: 2px; opacity: 0; transition: .15s; }
.history-item:hover .history-del { opacity: 1; }
.history-del:hover { color: var(--red); }
.history-pub {
  margin-left: auto; border: 1px solid var(--line); background: transparent; color: var(--dim);
  font-family: var(--mono); font-size: 9px; line-height: 1.4; padding: 1px 6px; border-radius: 4px;
  cursor: pointer; transition: .15s; flex-shrink: 0;
}
.history-pub:hover { color: var(--text); border-color: var(--line-strong); }
.history-pub.on { color: var(--cyan); border-color: rgba(61,220,255,.35); background: rgba(61,220,255,.08); }
.history-meta .pub-author { color: var(--cyan); }

/* ------------------------------- 函数库 ------------------------------- */
.library-layout { height: 100%; display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 14px; }
.cat-panel { padding: 15px 12px; overflow-y: auto; }
.cat-panel .panel-title { padding: 0 6px 12px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  display: flex; align-items: center; justify-content: space-between;
  border: 0; background: transparent; color: var(--muted); text-align: left;
  font-size: 12px; padding: 8px 10px; border-radius: 8px; transition: .15s;
}
.cat-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.cat-item.active { background: rgba(61,220,255,.1); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(61,220,255,.2); }
.cat-item span { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.cat-item.active span { color: rgba(61,220,255,.7); }

.lib-main { display: flex; flex-direction: column; overflow: hidden; padding: 18px 20px; }
.lib-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.lib-head h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.lib-head p { margin: 0; font-size: 11.5px; color: var(--dim); line-height: 1.6; }
.search-wrap {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: rgba(3,7,14,.7);
  color: var(--dim); min-width: 250px; transition: .16s;
}
.search-wrap:focus-within { border-color: rgba(61,220,255,.4); }
.search-wrap input { border: 0; background: transparent; outline: none; font-size: 12px; width: 100%; color: var(--text); }
.search-wrap input::placeholder { color: #4e5b70; }
.lib-count { margin: 14px 0 10px; font-size: 11px; color: var(--dim); font-family: var(--mono); }
.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 9px;
  overflow-y: auto; padding-right: 4px; padding-bottom: 20px;
}
.lib-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  background: rgba(255,255,255,.018); cursor: pointer; transition: .18s; position: relative;
}
.lib-card:hover { transform: translateY(-2px); border-color: rgba(61,220,255,.3); background: rgba(61,220,255,.04); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.lib-card-top { display: flex; align-items: baseline; gap: 7px; }
.lib-card-name { font-family: var(--mono); font-size: 12px; color: var(--cyan); font-weight: 500; }
.lib-card-cn { font-size: 11.5px; color: #b9c5d8; }
.lib-card-desc { margin-top: 6px; font-size: 10.5px; color: var(--dim); line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lib-card-cat { position: absolute; top: 10px; right: 10px; font-size: 9px; color: var(--dim); }

/* ------------------------------- 量化知识库 ------------------------------- */
.knowledge-layout { grid-template-columns: 198px minmax(0, 1fr); }
.knowledge-side-note { margin: 18px 6px 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--dim); font-size: 10.5px; line-height: 1.7; }
.knowledge-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); align-content: start; flex: 1; gap: 11px; }
.knowledge-card { min-height: 192px; padding: 15px 16px 12px; display: flex; flex-direction: column; }
.knowledge-card-cat { align-self: flex-start; padding: 2px 7px; border-radius: 5px; background: rgba(139,124,255,.1); color: #aaa0ff; border: 1px solid rgba(139,124,255,.18); font-size: 9.5px; }
.knowledge-card h3 { margin: 11px 0 7px; color: #e7eef9; font-size: 14px; line-height: 1.45; font-weight: 600; }
.knowledge-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.knowledge-keywords { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.knowledge-keywords span, .article-keywords span { color: var(--dim); background: rgba(255,255,255,.035); border-radius: 5px; padding: 2px 6px; font-size: 9.5px; }
.knowledge-read { margin-top: auto; padding-top: 10px; color: var(--cyan); font-size: 10px; opacity: .75; }
.knowledge-read span { margin-left: 4px; transition: margin .15s; }
.knowledge-card:hover .knowledge-read span { margin-left: 8px; }
.knowledge-disclaimer { padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: 9.5px; line-height: 1.55; }

.article-recall { border-color: rgba(139,124,255,.16); background: rgba(139,124,255,.025); }
.article-recall:hover { border-color: rgba(139,124,255,.35); background: rgba(139,124,255,.06); }
.recall-kind { flex: none; color: #aaa0ff; border: 1px solid rgba(139,124,255,.22); border-radius: 4px; padding: 0 4px; font-size: 8.5px; }
.recall-article-title { min-width: 0; color: #c9d4e8; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.article-card { max-width: 720px; }
.article-body { color: #c7d3e5; }
.article-summary { padding: 12px 14px; border-left: 2px solid var(--violet); border-radius: 0 8px 8px 0; background: rgba(139,124,255,.06); color: #b9c7dd; font-size: 12px; line-height: 1.75; }
.article-keywords { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 4px; }
.article-section { margin-top: 20px; }
.article-section h3, .article-subhead { margin: 0 0 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.article-section p { margin: 0; color: #b7c3d6; font-size: 12.5px; line-height: 1.9; white-space: pre-wrap; }
.article-subhead { margin-top: 22px; color: var(--muted); font-size: 11px; }
.article-code { margin: 0; padding: 13px 15px; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: rgba(3,7,14,.72); color: #a9d8ff; font: 11.5px/1.75 var(--mono); white-space: pre-wrap; word-break: break-word; }
.related-funcs { display: flex; flex-wrap: wrap; gap: 7px; }
.related-func { border: 1px solid rgba(61,220,255,.18); border-radius: 6px; padding: 5px 9px; background: rgba(61,220,255,.05); color: var(--cyan); font: 10.5px var(--mono); }
.related-func:hover { background: rgba(61,220,255,.12); border-color: rgba(61,220,255,.35); }

/* ------------------------------- 规范 ------------------------------- */
#view-specs { overflow-y: auto; }
.specs-intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 18px 20px; margin-bottom: 14px; }
.si-item { display: flex; gap: 12px; padding: 0 20px; border-right: 1px solid var(--line); }
.si-item:last-child { border-right: 0; }
.si-no { font-family: var(--mono); font-size: 11px; color: var(--cyan); opacity: .8; }
.si-item b { font-size: 12.5px; font-weight: 600; }
.si-item p { margin: 5px 0 0; font-size: 11px; color: var(--dim); line-height: 1.65; }
.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 24px; }
.spec-card { padding: 18px 20px; min-height: 320px; }
.spec-card.wide { grid-column: 1 / -1; }
.spec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.spec-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.spec-head .tag { margin-left: auto; }
.spec-pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.85; color: #b6c4d9;
  background: rgba(3,7,14,.55); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; max-height: 460px; overflow-y: auto;
}

/* ------------------------------- 弹窗 ------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(2, 4, 9, .72); backdrop-filter: blur(6px);
}
.modal.show { display: flex; }
.modal-card {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, #101725, #0a0f1a);
  border: 1px solid var(--line-strong); border-radius: 18px; padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.modal-head p { margin: 0; font-size: 11.5px; color: var(--dim); line-height: 1.6; max-width: 400px; }
.icon-x { border: 0; background: transparent; color: var(--dim); font-size: 24px; line-height: 1; padding: 0 4px; }
.icon-x:hover { color: var(--text); }

.func-card { max-width: 600px; }
.func-body h3 { font-size: 11px; color: var(--dim); letter-spacing: .5px; margin: 16px 0 7px; font-weight: 500; }
.func-body p { margin: 0; font-size: 12.5px; color: #c7d3e5; line-height: 1.75; white-space: pre-wrap; }
.func-body code, .func-usage {
  display: block; font-family: var(--mono); font-size: 11.5px; line-height: 1.7;
  color: #a9d8ff; background: rgba(3,7,14,.6); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word;
}
.func-example { color: #b8e6a8; }
.func-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.func-top .fname { font-family: var(--mono); font-size: 20px; color: var(--cyan); }
.func-top .fcn { font-size: 13px; color: var(--muted); }

/* ------------------------------- Toast ------------------------------- */
.toast-wrap { position: fixed; z-index: 200; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 16px; border-radius: 9px; font-size: 12px;
  background: rgba(18, 26, 42, .96); border: 1px solid var(--line-strong);
  color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: toastIn .2s ease;
}
.toast.ok { border-color: rgba(62,224,160,.35); color: #b6f7dc; }
.toast.err { border-color: rgba(255,107,129,.35); color: #ffc0c9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

.hidden { display: none !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

@media (max-width: 1360px) {
  .workbench { grid-template-columns: 300px minmax(0, 1fr) 270px; }
  .dll-layout { grid-template-columns: 300px minmax(0, 1fr) 270px; }
  .pipeline { flex-wrap: wrap; gap: 10px 0; }
  .pipe-step { flex: 1 1 33%; }
  .pipe-step:not(:last-child)::after { display: none; }
}
@media (max-width: 1120px) {
  body { overflow: auto; }
  main { height: auto; min-height: calc(100vh - 64px); }
  .view { height: auto; }
  .workbench { grid-template-columns: 300px minmax(0, 1fr); }
  .dll-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .side-panel { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .side-panel .side-block { flex: 1 1 240px; border-bottom: 0; }
  .work-panel { min-height: 640px; }
  .library-layout { height: auto; grid-template-columns: 1fr; }
  .cat-panel { max-height: 180px; }
  .specs-intro { grid-template-columns: 1fr; gap: 14px; }
  .si-item { border-right: 0; padding: 0; }
  .specs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .brand, .topbar-right { min-width: 0; }
  .nav { order: 3; width: 100%; justify-content: center; }
  .nav-btn { padding: 7px 12px; font-size: 12px; }
  .workbench { grid-template-columns: 1fr; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .lib-head { flex-direction: column; }
  .lib-head .search-wrap { width: 100%; }
  .article-card { padding: 18px; }
  .empty-cards { grid-template-columns: 1fr; }
  .empty-state { padding: 22px; }
}


/* ------------------------------- 后台管理 ------------------------------- */
.admin-body { min-height: 100vh; overflow-y: auto; }
.admin-login { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 64px); padding: 20px; }
.admin-wrap { display: flex; gap: 18px; max-width: 1280px; margin: 0 auto; padding: 22px 20px 40px; align-items: flex-start; }
.admin-nav {
  width: 168px; flex: none; display: flex; flex-direction: column; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
  position: sticky; top: 20px;
}
.admin-nav button {
  text-align: left; background: transparent; border: 0; color: var(--muted);
  padding: 11px 13px; border-radius: 9px; font-size: 13px; transition: .16s;
}
.admin-nav button:hover { background: rgba(255,255,255,.05); color: var(--text); }
.admin-nav button.active { background: rgba(61,220,255,.12); color: #cdf3ff; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(10px);
}
.panel-title {
  font-size: 13.5px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
}
.stat-card span { font-size: 11px; color: var(--dim); letter-spacing: .5px; }
.stat-card b { font-size: 28px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.stat-card b i { font-style: normal; font-size: 11px; color: var(--dim); margin-left: 5px; font-family: var(--sans); }
.admin-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.admin-kv > div {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; background: rgba(255,255,255,.02);
}
.admin-kv span { font-size: 11.5px; color: var(--dim); }
.admin-kv b { font-size: 12px; font-weight: 550; }
.ok-text { color: #7fe9bd; }
.warn-text { color: #ffb3bf; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th {
  text-align: left; font-size: 10.5px; color: var(--dim); font-weight: 500;
  padding: 8px 10px; border-bottom: 1px solid var(--line-strong); letter-spacing: .5px;
}
.admin-table td { padding: 10px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table .mono { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.admin-table .ops { white-space: nowrap; display: flex; gap: 6px; }
.mini-btn.danger { color: #ffb3bf; border-color: rgba(255,107,129,.25); }
.mini-btn.danger:hover { background: rgba(255,107,129,.12); }
.admin-empty { text-align: center; color: var(--dim); font-size: 12px; padding: 26px 0 10px; }
.admin-code {
  max-height: 55vh; overflow: auto; background: rgba(3,7,14,.8);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  font-family: var(--mono); font-size: 12px; line-height: 1.7; color: #cfe3f5; white-space: pre-wrap;
}
@media (max-width: 860px) {
  .admin-wrap { flex-direction: column; }
  .admin-nav { width: 100%; flex-direction: row; overflow-x: auto; position: static; }
  .admin-table { display: block; overflow-x: auto; }
}

/* ------------------------------- 知识库维护 ------------------------------- */
.kb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.kb-grid .kb-span { grid-column: 1 / -1; }
.kb-textarea {
  width: 100%; min-height: 150px; resize: vertical;
  background: rgba(3,7,14,.7); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; color: var(--text); font-family: var(--mono); font-size: 12px;
  line-height: 1.7; outline: none; margin-top: 6px;
}
.kb-textarea.tall { min-height: 320px; }
.kb-textarea.compact { min-height: 76px; }
.kb-textarea.article-sections { min-height: 220px; }
.kb-textarea:focus { border-color: rgba(61,220,255,.4); }
.article-mode-options { display: flex; flex-wrap: wrap; gap: 8px 12px; min-height: 39px; align-items: center; }
.auth-form .article-mode-options label { display: inline-flex; align-items: center; gap: 5px; margin: 0; white-space: nowrap; color: var(--muted); }
.auth-form .article-mode-options input { width: auto; margin: 0; accent-color: var(--cyan); }
.permission-options { display: flex; flex-wrap: wrap; gap: 9px 16px; align-items: center; min-height: 39px; }
.permission-options label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); white-space: nowrap; }
.permission-options input { width: auto; margin: 0; accent-color: var(--cyan); }
.kb-permission-group { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; }
.kb-permission-children { display: flex; flex-wrap: wrap; gap: 9px 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.kb-permission-children input:disabled { opacity: .65; }
.admin-permissions { display: flex; flex-wrap: wrap; gap: 5px; max-width: 360px; }
.permission-badge { padding: 3px 7px; border: 1px solid rgba(61,220,255,.18); border-radius: 5px; background: rgba(61,220,255,.05); color: #a9dfea; font-size: 10px; white-space: nowrap; }
.article-pagination { align-items: center; justify-content: flex-end; gap: 10px; padding-top: 14px; }
.article-pagination span { color: var(--dim); font-size: 11.5px; }
.article-pagination .mini-btn:disabled { opacity: .35; cursor: not-allowed; }
.kb-tools { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kb-tools input {
  background: rgba(3,7,14,.6); border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 10px; font-size: 11.5px; color: var(--text); outline: none; width: 180px;
}
.kb-tools select {
  background: rgba(3,7,14,.6); border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 8px; font-size: 11.5px; color: var(--text); outline: none; max-width: 190px;
}
.kb-spec-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.kb-spec-tabs .mini-btn.active,
.kb-subnav .mini-btn.active { color: #cdf3ff; border-color: rgba(61,220,255,.4); background: rgba(61,220,255,.1); }
.kb-subnav { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(14, 20, 27, .76); }
.kb-subnav .mini-btn { min-height: 34px; padding: 7px 13px; }
.kb-subview { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.auth-tip.slim { margin: 10px 0 0; padding: 7px 10px; flex: 1; }
.kb-file { font-size: 11px; color: var(--dim); max-width: 260px; }
@media (max-width: 860px) { .kb-grid { grid-template-columns: 1fr; } }
