:root {
  --bg: #141a24;
  --surface: #1b2230;
  --surface-2: #212a3a;
  --surface-3: #2a3445;
  --border: #2b3545;
  --border-strong: #3a475b;
  --text: #eef2f8;
  --text-2: #9ba9bd;
  --text-3: #6d7b90;
  --primary: #6c6cf8;
  --primary-hover: #8686ff;
  --primary-soft: #252b4d;
  --accent: #22d3ee;
  --accent-soft: #123840;
  --violet: #a78bfa;
  --orange: #f5a623;
  --green: #2dd4bf;
  --pink: #f472b6;
  --blue: #60a5fa;
  --success: #34d399;
  --success-soft: #12382f;
  --warn: #fbbf24;
  --warn-soft: #3a2f14;
  --danger: #fb7185;
  --danger-soft: #3d2028;
  --info: #60a5fa;
  --info-soft: #172b45;
  --code-bg: #0e1420;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .58);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;
  --border: #e6e9f2;
  --border-strong: #d6dbe8;
  --text: #1b2333;
  --text-2: #5a6478;
  --text-3: #8c95a8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --success: #0f9d6e;
  --success-soft: #e6f7f0;
  --warn: #d97706;
  --warn-soft: #fff4e5;
  --danger: #dc2626;
  --danger-soft: #fdeded;
  --info: #0284c7;
  --info-soft: #e7f4fd;
  --code-bg: #111827;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 60px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.boot-screen { height: 100vh; display: grid; place-items: center; color: var(--text-3); }

/* ---------- 布局 ---------- */
.app-shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 14px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.brand .brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; font-size: 15px; font-weight: 800;
}
.search-trigger {
  margin-left: 18px; width: min(420px, 38vw); height: 34px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  color: var(--text-3); text-align: left; transition: .15s;
}
.search-trigger:hover { border-color: var(--primary); background: var(--surface); }
.search-trigger span { flex: 1; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text-3); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2); transition: .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; position: relative;
}
.avatar { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; }
.user-chip .name { font-size: 13px; font-weight: 600; }
.dropdown {
  position: absolute; right: 0; top: 42px; min-width: 190px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0;
  background: transparent; border-radius: 7px; color: var(--text); font-size: 13px; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-3); }
.dropdown .sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown .muted { color: var(--text-3); font-size: 12px; padding: 4px 10px; }

.workspace { flex: 1; min-height: 0; }
.page { height: 100%; overflow-y: auto; padding: 26px 30px 60px; }
.page-inner { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.page-head .spacer { flex: 1; }

.three-col { display: grid; grid-template-columns: 248px minmax(0, 1fr) 280px; height: 100%; min-height: 0; }
.col-left, .col-right { background: var(--surface); overflow-y: auto; padding: 18px 16px; }
.col-left { border-right: 1px solid var(--border); }
.col-right { border-left: 1px solid var(--border); }
.col-center { overflow-y: auto; padding: 24px 30px 70px; background: var(--bg); }
.side-title { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--text-3); margin: 18px 0 8px; }
.side-title:first-child { margin-top: 0; }

/* ---------- 基础组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px;
  padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.input, .select, .textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); outline: none; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.65; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 3px 0; }
.check input { accent-color: var(--primary); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 650; }
.card-head .spacer { flex: 1; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stat-card { padding: 17px 18px; }
.stat-card .label { color: var(--text-2); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.stat-card .value { font-size: 28px; font-weight: 750; letter-spacing: -1px; margin: 6px 0 2px; }
.stat-card .foot { font-size: 12px; color: var(--text-3); }
.stat-card .foot a { font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge.published, .badge.reviewed, .badge.active, .badge.success { background: var(--success-soft); color: var(--success); }
.badge.draft, .badge.unreviewed, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.corrected, .badge.info { background: var(--info-soft); color: var(--info); }
.badge.disputed, .badge.deprecated, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.official, .badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.list { display: flex; flex-direction: column; }
.list-item {
  display: block; padding: 12px 2px; border-bottom: 1px solid var(--border); color: var(--text); transition: .15s;
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .li-title { font-weight: 620; font-size: 14px; margin-bottom: 3px; }
.list-item .li-desc { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-meta { color: var(--text-3); font-size: 11px; margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }

.doc-card {
  display: block; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; color: var(--text); transition: .15s;
}
.doc-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.doc-card h3 { margin: 0 0 6px; font-size: 15px; }
.doc-card p { margin: 0 0 10px; color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 26px; }
.empty h2 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.empty p { margin: 0 auto 18px; max-width: 480px; font-size: 13px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 700px; margin: 0 auto 24px; text-align: left; }
.step { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.step .num { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; margin-bottom: 9px; }
.step b { display: block; margin-bottom: 4px; font-size: 13px; }
.step span { font-size: 12px; color: var(--text-2); }

/* ---------- 阅读区 ---------- */
.doc-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 20px; }
.doc-header h1 { margin: 8px 0 10px; font-size: 26px; letter-spacing: -.6px; line-height: 1.35; }
.doc-source { color: var(--text-3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
.markdown { font-size: 14.5px; line-height: 1.85; color: var(--text); }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { line-height: 1.4; margin: 26px 0 12px; font-weight: 700; letter-spacing: -.3px; }
.markdown h1 { font-size: 22px; } .markdown h2 { font-size: 19px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.markdown h3 { font-size: 16px; } .markdown h4 { font-size: 14px; }
.markdown p { margin: 0 0 14px; }
.markdown ul, .markdown ol { padding-left: 22px; margin: 0 0 14px; }
.markdown li { margin: 4px 0; }
.markdown blockquote { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 8px 8px 0; color: var(--text-2); }
.markdown blockquote p:last-child { margin: 0; }
.markdown img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.markdown table { border-collapse: collapse; width: 100%; margin: 14px 0; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 8px 11px; text-align: left; white-space: nowrap; }
.markdown th { background: var(--surface-2); font-weight: 650; }
.markdown pre { position: relative; background: var(--code-bg); color: #e5e7eb; padding: 15px 16px; border-radius: 10px; overflow-x: auto; margin: 14px 0; font-size: 12.5px; line-height: 1.7; }
.markdown pre code { font-family: var(--mono); background: transparent; padding: 0; color: inherit; }
.markdown :not(pre) > code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 2px 5px; border-radius: 5px; }
.copy-btn { position: absolute; right: 8px; top: 8px; padding: 3px 8px; font-size: 11px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #d1d5db; }
.copy-btn:hover { background: rgba(255,255,255,.18); }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.toc-item { display: block; padding: 4px 8px; border-left: 2px solid transparent; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.toc-item:hover, .toc-item.active { color: var(--primary); border-left-color: var(--primary); background: var(--primary-soft); }
.toc-item.lv3 { padding-left: 20px; } .toc-item.lv4 { padding-left: 32px; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.meta-row:last-child { border-bottom: 0; }
.meta-row .k { color: var(--text-3); } .meta-row .v { text-align: right; font-weight: 600; word-break: break-all; }

/* ---------- 采集 / 校对 ---------- */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; background: var(--surface-2); transition: .15s; }
.dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.job-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.job-row:last-child { border-bottom: 0; }
.job-row .job-main { flex: 1; min-width: 0; }
.job-row .job-title { font-weight: 620; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row .job-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.progress { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }
.quality { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.quality .badge { font-weight: 500; }
.workbench { display: grid; grid-template-columns: 1fr 1fr; height: 100%; min-height: 0; }
.wb-pane { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.wb-pane + .wb-pane { border-left: 1px solid var(--border); }
.wb-head { flex: 0 0 auto; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 10px; }
.wb-head b { font-size: 13px; }
.wb-body { flex: 1; min-height: 0; overflow: auto; }
.raw-text { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.wb-editor { width: 100%; height: 100%; border: 0; outline: none; resize: none; padding: 18px 20px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; background: var(--surface); }
.wb-preview { padding: 18px 22px; }
.diff-line { font-family: var(--mono); font-size: 12px; padding: 1px 10px; white-space: pre-wrap; word-break: break-word; }
.diff-line.add { background: var(--success-soft); color: var(--success); }
.diff-line.del { background: var(--danger-soft); color: var(--danger); }
.diff-line.same { color: var(--text-3); }
.wb-bottom { flex: 0 0 auto; max-height: 220px; overflow: auto; border-top: 1px solid var(--border); background: var(--surface); padding: 12px 16px; }

/* ---------- 表格 / 其它 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--text-3); font-size: 11.5px; font-weight: 700; letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.notice { padding: 11px 14px; border-radius: 9px; font-size: 12.5px; margin-bottom: 16px; display: flex; gap: 9px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.pill-tabs { display: flex; gap: 4px; padding: 3px; background: var(--surface-3); border-radius: 9px; }
.pill-tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.pill-tabs button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1000px 600px at 50% -10%, #e8eaff 0%, transparent 60%), var(--bg); padding: 20px; }
[data-theme="dark"] .login-page { background: radial-gradient(1000px 600px at 50% -10%, #232a52 0%, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 34px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); }
.login-card .brand { justify-content: center; font-size: 18px; margin-bottom: 6px; }
.login-card .brand .brand-mark { width: 38px; height: 38px; font-size: 18px; }
.login-sub { text-align: center; color: var(--text-3); font-size: 12.5px; margin-bottom: 26px; }
.login-card .btn-primary { width: 100%; height: 40px; margin-top: 6px; }
.login-foot { margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--text-3); }

/* ---------- 浮层 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 20, 35, .48); z-index: 100; display: grid; place-items: start center; padding: 8vh 16px 20px; overflow-y: auto; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal.wide { max-width: 780px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-weight: 700; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; max-height: 65vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.search-overlay { position: fixed; inset: 0; background: rgba(15, 20, 35, .42); z-index: 110; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 20px; }
.search-box { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-box .input { border: 0; border-radius: 0; height: 52px; font-size: 15px; box-shadow: none !important; }
.search-results { max-height: 420px; overflow-y: auto; border-top: 1px solid var(--border); }
.search-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); cursor: pointer; }
.search-item:hover, .search-item.active { background: var(--primary-soft); }
.search-item .t { font-weight: 650; font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.search-item .s { font-size: 12px; color: var(--text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-foot { padding: 8px 14px; font-size: 11px; color: var(--text-3); display: flex; gap: 12px; }
#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 15px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13px; min-width: 220px; animation: slidein .2s ease; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1200px) {
  .three-col { grid-template-columns: 230px minmax(0, 1fr); }
  .col-right { display: none; }
}
@media (max-width: 900px) {
  .three-col { grid-template-columns: 1fr; }
  .col-left { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .steps, .workbench { grid-template-columns: 1fr; }
  .wb-pane + .wb-pane { border-left: 0; border-top: 1px solid var(--border); }
  .page { padding: 18px 16px 50px; }
  .col-center { padding: 18px 16px 60px; }
  .search-trigger { width: 40px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .user-chip .name { display: none; }
}

/* ---------- 一体化语料库：三板块 / 复制 / 资产 / 导出 ---------- */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.section-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  font-weight: 700; font-size: 13px; border-radius: var(--radius) var(--radius) 0 0;
}
.section-head .spacer { flex: 1; }
.section-head .hint { font-weight: 500; font-size: 11px; color: var(--text-3); }
.section-body { padding: 14px 16px; font-size: 13.5px; line-height: 1.8; }
.section-body p:last-child { margin-bottom: 0; }
.section-locked { padding: 7px 11px; background: var(--warn-soft); color: var(--warn); border-radius: 6px; font-size: 12px; margin-bottom: 10px; }
.meta-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-2); }
.meta-strip b { color: var(--text); font-weight: 600; }
.block-copy, .btn-copy {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 11px;
  border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface);
  color: var(--text-2);
}
.block-copy:hover, .btn-copy:hover { color: var(--primary); border-color: var(--primary); }
.code-block { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; margin: 8px 0 14px; }
.code-block pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #d6deeb; white-space: pre-wrap; word-break: break-word; }
.code-block .copy-btn { position: static; float: right; margin: -4px -4px 4px 8px; }
.code-block .code-label { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.markdown pre { background: var(--code-bg); }
.asset-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin: 0 6px 6px 0;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2);
  font-size: 12px; color: var(--text);
}
.asset-chip:hover { border-color: var(--primary); color: var(--primary); }
.asset-chip .type { color: var(--text-3); font-size: 11px; }
.tag-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11px; background: var(--surface-3); color: var(--text-2); }
.tag-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.timeline { border-left: 2px solid var(--border-strong); padding-left: 14px; }
.timeline-item { position: relative; padding: 4px 0 12px; font-size: 12.5px; }
.timeline-item::before { content: ''; position: absolute; left: -19px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.timeline-item .t { color: var(--text-3); font-size: 11px; }
.timeline-item .v { color: var(--text-2); font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stat-grid .stat-card { padding: 13px 14px; }
.stat-grid .value { font-size: 24px; margin: 4px 0 0; }
.quick-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.quick-grid a { padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.quick-grid a:hover { border-color: var(--primary); color: var(--primary); }
.export-preview {
  background: var(--code-bg); color: #d6deeb; font-family: var(--mono); font-size: 12px;
  padding: 14px; border-radius: 8px; max-height: 420px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border);
}
.thumb { width: 104px; height: 76px; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.thumb-list { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb-item { position: relative; }
.thumb-item .rm { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; }
.code-row, .asset-ref-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: start; margin-bottom: 9px; }
.asset-ref-row { grid-template-columns: 1.2fr 1fr auto; }
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 7px 12px; font-size: 13px; }
.kv .k { color: var(--text-3); }
.dense-list .list-item { padding: 9px 2px; }
.badge.expired { background: var(--danger-soft); color: var(--danger); }
.badge.active { background: var(--success-soft); color: var(--success); }
.select-row { display: flex; align-items: flex-start; gap: 10px; }
.select-row > input[type=checkbox] { margin-top: 12px; accent-color: var(--primary); }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; }
.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-cards label { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: pointer; font-size: 13px; }
.radio-cards label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.radio-cards input { accent-color: var(--primary); }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .code-row, .asset-ref-row { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
}

/* ================= 参考图视觉层：深蓝黑科技风 ================= */
body {
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(108, 108, 248, .16), transparent 62%),
    radial-gradient(900px 520px at 6% 4%, rgba(34, 211, 238, .07), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 34px 34px;
}
.app-shell { position: relative; z-index: 1; }
.topbar { height: 62px; flex: 0 0 62px; gap: 22px; padding: 0 22px; background: rgba(20, 26, 36, .92); backdrop-filter: blur(12px); }
.brand { font-size: 16px; letter-spacing: -.2px; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; font-size: 12px; letter-spacing: -.5px;
  background: linear-gradient(135deg, #8b7cf8, #4f46e5); box-shadow: 0 4px 14px rgba(108,108,248,.45);
}
.main-nav { display: flex; align-items: stretch; gap: 4px; height: 100%; }
.main-nav a {
  position: relative; display: flex; align-items: center; padding: 0 15px; font-size: 13.5px;
  font-weight: 600; color: var(--text-2); white-space: nowrap; transition: .15s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 -2px 12px rgba(108,108,248,.6);
}
.nav-search {
  display: flex; align-items: center; gap: 9px; height: 36px; width: 300px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  color: var(--text-3); font-size: 12.5px; text-align: left; transition: .15s;
}
.nav-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-search:hover { border-color: var(--primary); color: var(--text-2); }
.nav-search kbd { font-size: 10px; }
.app-body { display: flex; flex: 1; min-height: 0; }
.icon-rail {
  width: 54px; flex: 0 0 54px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 0; border-right: 1px solid var(--border); background: rgba(24, 30, 42, .72);
}
.rail-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0;
  border-radius: 10px; background: transparent; color: var(--text-3); transition: .15s;
}
.rail-btn:hover { background: var(--surface-3); color: var(--text); }
.rail-btn.active { color: var(--primary); background: var(--primary-soft); }
.rail-btn.active::before { content: ''; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.rail-sep { width: 26px; height: 1px; background: var(--border); margin: 6px 0; }
.workspace { flex: 1; min-width: 0; }
.page { padding: 24px 28px 64px; }

/* ---------- Hero 与仪表盘 ---------- */
.hero { position: relative; display: flex; align-items: center; gap: 24px; min-height: 172px; margin-bottom: 20px; overflow: hidden; }
.hero-copy { flex: 1; min-width: 0; }
.hero h1 { margin: 0 0 12px; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.25; font-weight: 800; letter-spacing: -1.2px; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #a78bfa, #6c6cf8 55%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--text-2); font-size: 14px; }
.hero-art {
  position: relative; width: 230px; height: 160px; flex: 0 0 230px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 55%, rgba(108,108,248,.28), transparent 62%);
}
.hero-art .cube {
  width: 76px; height: 76px; display: grid; place-items: center; border-radius: 18px;
  background: linear-gradient(140deg, #6d7bff, #22d3ee); color: #fff; font-size: 32px;
  box-shadow: 0 18px 48px rgba(80, 100, 255, .55), inset 0 1px 0 rgba(255,255,255,.4);
  transform: perspective(300px) rotateX(14deg) rotateY(-16deg);
}
.hero-art .plate { position: absolute; bottom: 18px; width: 168px; height: 42px; border-radius: 50%; border: 1px solid rgba(108,108,248,.45); box-shadow: 0 0 32px rgba(34,211,238,.22); transform: rotateX(66deg); }
.hero-art .dot { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #8ea2ff; box-shadow: 0 0 10px #8ea2ff; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 96px; }
.stat-icon {
  width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px;
  color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.stat-icon.purple { background: linear-gradient(140deg, #7c6cf8, #4f46e5); }
.stat-icon.orange { background: linear-gradient(140deg, #fbbf5a, #f08c1a); }
.stat-icon.cyan { background: linear-gradient(140deg, #38bdf8, #0ea5e9); }
.stat-icon.violet { background: linear-gradient(140deg, #a78bfa, #7c3aed); }
.stat-card .label { font-size: 12.5px; color: var(--text-2); }
.stat-card .value { font-size: 28px; line-height: 1.15; margin: 2px 0 0; font-weight: 750; letter-spacing: -.6px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature-card {
  position: relative; min-height: 152px; padding: 20px 22px; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.12); color: #fff; transition: .2s; cursor: pointer;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.35); }
.feature-card.plan { background: linear-gradient(125deg, #6d4ae8, #9270ff); }
.feature-card.asset { background: linear-gradient(125deg, #3b62d9, #4f8bf5); }
.feature-card.eca { background: linear-gradient(125deg, #16a6a6, #38c6a8); }
.feature-card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 750; }
.feature-card p { margin: 0; font-size: 13px; opacity: .88; }
.feature-card .feature-icon { position: absolute; right: 18px; bottom: 12px; font-size: 58px; opacity: .18; transform: rotate(-8deg); }
.recent-card { min-height: 152px; }
.recent-item { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; font-size: 12.5px; }
.recent-item .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 8px; flex: 0 0 6px; }
.recent-item b { font-weight: 650; color: var(--text-2); }
.recent-item span { color: var(--text-3); }
.quick-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.quick-bar .qb-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); border: 1px solid transparent; }
.quick-bar .qb-btn:hover { color: var(--text); background: var(--surface-2); }
.quick-bar .qb-btn.primary { background: linear-gradient(100deg, #22b8cf, #2dd4bf); color: #06252b; box-shadow: 0 6px 18px rgba(34,211,238,.25); }
.quick-bar .qb-btn.primary:hover { filter: brightness(1.08); color: #06252b; }
.quick-bar .spacer { flex: 1; }

/* ---------- 语料总库：筛选树 + 关联表格 ---------- */
.library-layout { display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: 16px; align-items: start; }
.filter-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.filter-group { border-bottom: 1px solid var(--border); padding: 8px 0; }
.filter-group:last-child { border-bottom: 0; }
.filter-group > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 650; color: var(--text-2); padding: 5px 2px; }
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary::after { content: '⌄'; margin-left: auto; color: var(--text-3); }
.filter-group[open] > summary::after { transform: rotate(180deg); }
.filter-group .filter-body { padding: 6px 0 4px 22px; }
.filter-link { display: block; padding: 5px 8px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.filter-link:hover, .filter-link.active { background: var(--primary-soft); color: var(--primary); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 2px; }
.tag-cloud button { padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-2); }
.tag-cloud button:hover, .tag-cloud button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.library-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.library-head h1 { margin: 0; font-size: 19px; }
.library-head .spacer { flex: 1; }
.library-search { width: 230px; }
.corpus-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.corpus-head, .corpus-row { display: grid; grid-template-columns: minmax(0, 2.1fr) 1fr 1fr 1fr 34px; gap: 12px; align-items: center; }
.corpus-head { padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-3); font-weight: 650; }
.corpus-row { padding: 13px 16px; border-bottom: 1px solid var(--border); transition: .15s; }
.corpus-row:last-child { border-bottom: 0; }
.corpus-row:hover { background: var(--surface-2); }
.corpus-row .cell-main { display: flex; gap: 11px; align-items: flex-start; min-width: 0; }
.corpus-row input[type=checkbox] { margin-top: 12px; accent-color: var(--primary); }
.type-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; color: #fff; font-size: 15px; }
.type-icon.plan { background: linear-gradient(140deg, #fbbf5a, #f08c1a); }
.type-icon.asset { background: linear-gradient(140deg, #38bdf8, #0ea5e9); }
.type-icon.eca { background: linear-gradient(140deg, #7c6cf8, #4f46e5); }
.type-icon.pink { background: linear-gradient(140deg, #f472b6, #db2777); }
.type-icon.teal { background: linear-gradient(140deg, #2dd4bf, #0d9488); }
.row-title { font-size: 13.5px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title:hover { color: var(--primary); }
.row-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.rel-cell { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-menu { border: 0; background: transparent; color: var(--text-3); font-size: 18px; }
.row-menu:hover { color: var(--primary); }
.export-dock { display: flex; justify-content: flex-end; margin-top: 14px; }
.btn-accent { background: linear-gradient(100deg, #22b8cf, #2dd4bf); border-color: transparent; color: #06252b; font-weight: 700; }
.btn-accent:hover { filter: brightness(1.08); color: #06252b; border-color: transparent; }

/* ---------- 语料详情：三列卡片 ---------- */
.detail-hero { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.detail-hero h1 { margin: 0 0 12px; font-size: 26px; font-weight: 750; letter-spacing: -.6px; }
.detail-hero .spacer { flex: 1; }
.type-pills { display: inline-flex; gap: 6px; padding: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.type-pills button { border: 0; background: transparent; color: var(--text-2); font-size: 12px; padding: 5px 12px; border-radius: 7px; }
.type-pills button.active { background: var(--primary); color: #fff; font-weight: 650; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12.5px; color: var(--text-3); margin-bottom: 18px; }
.detail-meta b { color: var(--text-2); font-weight: 600; }
.triple-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.panel-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 280px; display: flex; flex-direction: column; }
.panel-card.focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 12px 32px rgba(108,108,248,.16); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13.5px; }
.panel-head .spacer { flex: 1; }
.panel-copy { border: 0; background: transparent; color: var(--text-3); display: grid; place-items: center; }
.panel-copy:hover { color: var(--primary); }
.panel-body { padding: 16px; flex: 1; font-size: 13px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.var-line { color: var(--blue); }
.var-line b { color: #93c5fd; font-weight: 650; }
.eca-note { display: block; margin-top: 12px; padding-left: 10px; border-left: 2px dashed var(--primary); color: var(--blue); }
.asset-row-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); margin-bottom: 8px; font-size: 12.5px; }
.asset-row-item .mini-thumb { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.asset-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.asset-tile { display: grid; place-items: center; gap: 6px; padding: 14px 6px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); }
.asset-tile .tile-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.relation-bar { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.relation-bar h3 { margin: 0 0 9px; font-size: 13.5px; }
.detail-extra { margin-top: 14px; }

/* ---------- ECA 库 / 关联图谱 ---------- */
.eca-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.eca-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: .15s; }
.eca-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.eca-card h3 { margin: 10px 0 6px; font-size: 14px; }
.eca-card p { margin: 0 0 12px; font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.graph-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 244px; gap: 13px; height: calc(100vh - 152px); min-height: 460px; }
.graph-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.graph-canvas { position: relative; background: radial-gradient(circle at 50% 40%, rgba(108,108,248,.09), transparent 62%), var(--surface); }
.graph-canvas::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px); background-size: 28px 28px; }
.graph-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.graph-node { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: #232c3d; font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.graph-node.center { border-color: var(--primary); background: #2a2e58; box-shadow: 0 0 0 3px rgba(108,108,248,.18), 0 10px 26px rgba(108,108,248,.28); }
.graph-node .gn-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 12px; }
.graph-node.small { font-size: 11.5px; padding: 7px 11px; }
.graph-side { padding: 16px; overflow: auto; }
.graph-side h3 { margin: 0 0 14px; font-size: 14px; }
.graph-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 13px; }
.tree-node { padding: 6px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.tree-node:hover, .tree-node.active { background: var(--primary-soft); color: var(--primary); }
.tree-node .bullet { width: 7px; height: 7px; border-radius: 50%; }

@media (max-width: 1280px) {
  .graph-layout { grid-template-columns: 180px minmax(0, 1fr) 210px; }
  .nav-search { width: 210px; }
}
@media (max-width: 1050px) {
  .main-nav a { padding: 0 9px; font-size: 12.5px; }
  .feature-grid, .triple-grid, .eca-grid { grid-template-columns: 1fr; }
  .library-layout, .graph-layout { grid-template-columns: 1fr; height: auto; }
  .graph-canvas { min-height: 420px; }
  .hero-art { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .main-nav { overflow-x: auto; }
  .nav-search { width: 40px; }
  .nav-search span, .nav-search kbd { display: none; }
  .icon-rail { display: none; }
  .corpus-head, .corpus-row { grid-template-columns: 1fr 34px; }
  .corpus-head > :nth-child(2), .corpus-head > :nth-child(3), .corpus-head > :nth-child(4),
  .corpus-row > .rel-cell { display: none; }
}

/* ================= 编辑页：左主编辑 + 右折叠设置 ================= */
.editor-page { padding: 0 0 40px; min-height: 100%; }
.editor-topbar {
  position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px;
  padding: 11px 0; margin-bottom: 16px; background: rgba(20, 26, 36, .95);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.ed-crumb { font-size: 13px; font-weight: 650; }
.ed-state { font-size: 12px; color: var(--text-3); }
.ed-state.dirty { color: var(--warn); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.editor-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.editor-side {
  position: sticky; top: 72px; display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 150px); overflow-y: auto; padding-right: 2px;
}
.editor-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.editor-title {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
  font-size: 22px; font-weight: 750; letter-spacing: -.4px; padding: 0;
}
.editor-title::placeholder { color: var(--text-3); }
.editor-subtitle { margin-top: 9px; font-size: 12px; color: var(--text-3); }
.editor-section, .side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.foldable > header {
  display: flex; align-items: center; gap: 9px; padding: 12px 16px; cursor: pointer;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 13.5px; user-select: none;
}
.foldable > header svg { color: var(--text-3); transition: transform .18s; }
.foldable:not(.collapsed) > header > svg:first-child { transform: rotate(180deg); }
.foldable.collapsed > header { border-bottom: 0; }
.foldable.collapsed .fold-body { display: none; }
.fold-note { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.editor-section-body { padding: 16px; }
.side-body { padding: 14px 14px 16px; }
.sub-note { margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
.sub-fold { margin-top: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.sub-fold > summary { display: flex; align-items: center; gap: 8px; padding: 10px 13px; cursor: pointer; font-size: 12.5px; font-weight: 650; list-style: none; }
.sub-fold > summary::-webkit-details-marker { display: none; }
.sub-fold > summary svg { margin-left: auto; color: var(--text-3); }
.sub-fold[open] > summary { border-bottom: 1px solid var(--border); }
.sub-fold > #ed-code-list, .sub-fold > .btn { margin: 12px 13px; }

/* ---------- Markdown 富文本编辑器 ---------- */
.md-editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.md-toolbar { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 7px 9px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.md-tool { min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.md-tool:hover { background: var(--surface-3); color: var(--primary); }
.md-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.md-views { display: flex; gap: 2px; padding: 2px; border-radius: 7px; background: var(--surface-3); }
.md-views button { border: 0; background: transparent; color: var(--text-2); font-size: 11.5px; padding: 4px 9px; border-radius: 5px; }
.md-views button.active { background: var(--primary); color: #fff; font-weight: 650; }
.md-body { display: grid; grid-template-columns: 1fr; }
.md-body[data-view="split"] { grid-template-columns: 1fr 1fr; }
.md-textarea {
  width: 100%; min-height: 280px; border: 0; outline: 0; resize: vertical;
  padding: 16px; background: var(--surface); color: var(--text);
  font-family: var(--mono); font-size: 13px; line-height: 1.85;
}
.md-textarea::placeholder { color: var(--text-3); }
.md-preview { padding: 16px 18px; border-left: 1px solid var(--border); background: var(--surface-2); overflow: auto; max-height: 620px; }
.md-body[data-view="preview"] { grid-template-columns: 1fr; }
.md-body[data-view="preview"] .md-preview { border-left: 0; }
.md-body[data-view="split"] .md-preview { max-height: 620px; }
.md-foot { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11px; color: var(--text-3); }
.md-preview h1, .md-preview h2, .md-preview h3 { margin-top: 14px; }
.md-preview pre { margin: 10px 0; }
.md-preview table { display: block; overflow-x: auto; }

@media (max-width: 1120px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; max-height: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-body[data-view="split"] { grid-template-columns: 1fr; }
  .md-body[data-view="split"] .md-preview { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 720px) {
  .editor-page { padding: 0 0 30px; }
  .editor-side { grid-template-columns: 1fr; }
  .editor-topbar { flex-wrap: wrap; }
  .ed-crumb { display: none; }
}


