:root {
  color-scheme: light;
  --ink: #202a28;
  --muted: #64716c;
  --soft: #8a9790;
  --line: #e3e1d9;
  --paper: #ffffff;
  --canvas: #f5f2ea;
  --navy: #20322e;
  --navy-soft: #314a42;
  --red: #a52d32;
  --red-soft: #f8e9e7;
  --green: #315d50;
  --green-soft: #eaf4ef;
  --amber: #926323;
  --amber-soft: #fbf3e6;
  --shadow: 0 12px 34px rgb(32 42 40 / 7%);
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(circle at 18% 15%, #e9e1d4, transparent 33%), var(--canvas); }
.login-card { width: min(100%, 430px); padding: 42px; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 6px; box-shadow: var(--shadow); }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; color: white; background: var(--red); border-radius: 3px 12px 3px 3px; font-size: 22px; font-weight: 800; }
.eyebrow { margin: 30px 0 10px; color: var(--red); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.login-card h1 { margin: 0; font-family: "Noto Serif CJK SC", "Songti SC", "SimSun", serif; font-size: clamp(30px, 7vw, 38px); line-height: 1.35; letter-spacing: -.025em; }
.login-intro { margin: 14px 0 30px; color: var(--muted); font-size: 14px; }
.stack-form { display: grid; gap: 11px; }
.stack-form label, .field label { color: #414d59; font-size: 13px; font-weight: 650; }
.stack-form input, .field input, .field select, .field textarea, .filter-control {
  width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink); background: #fff;
  border: 1px solid #d7dce1; border-radius: 6px; outline: none;
}
.stack-form input:focus, .field input:focus, .field select:focus, .field textarea:focus, .filter-control:focus { border-color: #7188a1; box-shadow: 0 0 0 3px rgb(79 112 146 / 12%); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.login-note { margin: 20px 0 0; color: var(--soft); font-size: 12px; line-height: 1.6; }
.remember-token { font-weight: 500; color: #4e5b68; }
.form-message { min-height: 20px; margin: 0; color: var(--red); font-size: 13px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 238px; padding: 25px 15px 17px; color: #e8ece8; background: var(--navy); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 7px 26px; color: inherit; text-decoration: none; }
.brand-mark-small { width: 36px; height: 36px; flex: 0 0 36px; font-size: 17px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { color: #fff; font-size: 17px; letter-spacing: .025em; }
.sidebar-brand small { margin-top: 4px; color: #adbbb2; font-size: 11px; }
.nav-caption, .nav-section-label { margin: 7px 10px 9px; color: #a7b8ac; font-size: 11px; letter-spacing: .1em; }
.nav-section-label { display: block; margin-top: 19px; padding-top: 15px; border-top: 1px solid rgb(255 255 255 / 12%); }
/* grid-auto-rows: max-content 让导航项不被侧栏高度压缩；高度不够时由本容器滚动 */
.navigation { display: grid; grid-auto-rows: max-content; gap: 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 22%) transparent; }
.navigation::-webkit-scrollbar { width: 6px; }
.navigation::-webkit-scrollbar-track { background: transparent; }
.navigation::-webkit-scrollbar-thumb { background: rgb(255 255 255 / 20%); border-radius: 3px; }
.navigation::-webkit-scrollbar-thumb:hover { background: rgb(255 255 255 / 32%); }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; color: #c6d1c9; text-align: left; background: transparent; border: 0; border-radius: 4px; font-size: 13px; }
.nav-link:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-link.is-active { color: #fff; background: var(--navy-soft); box-shadow: inset 3px 0 0 #e5a8a5; }
.nav-icon { width: 18px; color: #e1aaa7; text-align: center; font-size: 16px; }
/* 侧栏子栏：当前页模块清单（如「单位定制发布」），点击滚动到对应模块；
   展开/收起用行高过渡 + 渐显，条目按序号轻微错开出现 */
.nav-sub {
  overflow: hidden; max-height: 0; opacity: 0; visibility: hidden;
  transition: max-height .34s cubic-bezier(.22,.61,.36,1), opacity .26s ease, visibility 0s linear .34s;
}
.nav-sub.is-open {
  opacity: 1; visibility: visible;
  transition: max-height .34s cubic-bezier(.22,.61,.36,1), opacity .26s ease, visibility 0s;
}
.nav-sub-list { display: grid; gap: 2px; min-height: 0; margin: 3px 0 6px 10px; padding-left: 10px; border-left: 1px solid rgb(255 255 255 / 14%); }
.nav-sub-link {
  display: block; width: 100%; min-height: 30px; padding: 5px 8px; color: #a9b8ae; text-align: left;
  background: transparent; border: 0; border-radius: 4px; font-size: 12px; line-height: 1.5;
  opacity: 0; transform: translateX(-5px);
  transition: opacity .26s ease, transform .26s ease, background .15s ease, color .15s ease;
}
.nav-sub.is-open .nav-sub-link {
  opacity: 1; transform: none;
  transition-delay: calc(var(--i, 0) * 16ms), calc(var(--i, 0) * 16ms), 0s, 0s;
}
.nav-sub-link:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-sub-link.is-current { color: #fff; background: rgb(255 255 255 / 11%); }
@media (prefers-reduced-motion: reduce) {
  .nav-sub, .nav-sub.is-open, .nav-sub-link, .nav-sub.is-open .nav-sub-link { transition: none; }
}
.sidebar-bottom { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 15px 10px 5px; color: #b9c8be; border-top: 1px solid rgb(255 255 255 / 12%); font-size: 11px; }
.sidebar-bottom a { color: inherit; text-decoration: none; }
.sidebar-bottom a:hover, .sidebar-bottom a:focus-visible { color: #fff; text-decoration: underline; }
.local-status-dot { width: 7px; height: 7px; background: #d6a758; border-radius: 50%; }
.workspace { min-height: 100vh; margin-left: 238px; }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 65px; padding: 0 34px; background: rgb(255 255 255 / 96%); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.breadcrumb, .account-area { display: flex; align-items: center; gap: 10px; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.account-area { gap: 12px; }
.role-badge { padding: 5px 9px; color: #516170; background: #f0f2f4; border-radius: 4px; font-size: 11px; }
.page-content { width: min(100%, 1360px); margin: 0 auto; padding: 36px 34px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; color: var(--ink); font-family: "Noto Serif CJK SC", "Songti SC", "SimSun", serif; font-size: 29px; font-weight: 700; letter-spacing: -.025em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-title { margin: 27px 0 13px; font-size: 15px; font-weight: 720; }
.section-caption { margin: -5px 0 14px; color: var(--muted); font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { padding: 18px 19px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid #bdc9bf; border-radius: 4px; }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 12px; color: var(--ink); font-size: 27px; font-weight: 730; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 5px; color: var(--soft); font-size: 11px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 3px 14px rgb(32 42 40 / 2%); scroll-margin-top: 82px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-body { padding: 18px; }
.notice { display: flex; align-items: flex-start; gap: 11px; margin: 0 0 17px; padding: 13px 15px; color: #644d2e; background: var(--amber-soft); border: 1px solid #f0e2c9; border-radius: 7px; font-size: 12px; line-height: 1.65; }
.notice-mark { display: grid; place-items: center; flex: 0 0 19px; width: 19px; height: 19px; margin-top: 1px; color: #fff; background: #b8893f; border-radius: 50%; font-size: 12px; font-weight: 700; }
.operational-alert { flex-wrap: wrap; }
.operational-alert > span:nth-child(2) { flex: 1 1 220px; min-width: 0; }
.operational-alert > .button { flex: none; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 12px; color: #334150; background: #fff; border: 1px solid #d8dde2; border-radius: 5px; font-size: 12px; font-weight: 620; transition: background .15s ease, border-color .15s ease; }
.button:hover { background: #f6f7f8; border-color: #bec6ce; }
.button:disabled { cursor: not-allowed; opacity: .54; }
.button-primary { color: white; background: var(--red); border-color: var(--red); }
.button-primary:hover { background: #84252a; border-color: #84252a; }
.button-danger { color: var(--red); background: #fff; border-color: #e7c7c8; }
.button-danger:hover { background: var(--red-soft); }
.button-quiet { min-height: 31px; color: var(--muted); background: transparent; border-color: transparent; }
.button-small { min-height: 30px; padding: 0 9px; font-size: 11px; }
.text-button { padding: 0; color: #456784; background: transparent; border: 0; font-size: 12px; font-weight: 620; }
.text-button:hover { color: #274866; text-decoration: underline; }
.article-list { display: grid; }
.wenke-preview-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.wenke-preview-group summary { cursor: pointer; }
.wenke-preview-group .article-excerpt { overflow-wrap: anywhere; }
.wenke-candidate { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wenke-preview-group .wenke-candidate:last-child { border-bottom: 0; }
.wenke-select { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.wenke-select input { flex: 0 0 16px; width: 16px; height: 16px; margin: 4px 0 0; }
.wenke-candidate .article-meta { margin: 5px 0 0 26px; }
.wenke-candidate .article-excerpt, .wenke-source-link { margin-left: 26px; overflow-wrap: anywhere; }
.wenke-source-link { display: inline-block; margin-top: 7px; font-size: 12px; }
.article-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #edf0f2; }
.article-row:last-child { border-bottom: 0; }
.article-title { margin: 0; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.55; }
.article-excerpt { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.article-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 10px; color: var(--soft); font-size: 11px; }
.article-side { display: flex; align-items: flex-start; gap: 7px; }
.status-pill, .tag { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; color: #607080; background: #f1f3f5; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.status-published { color: var(--green); background: var(--green-soft); }
.status-pending { color: var(--amber); background: var(--amber-soft); }
.status-held { color: var(--red); background: var(--red-soft); }
.tag { margin: 2px 4px 2px 0; color: #465d70; background: #edf2f5; }
.empty-state { padding: 38px 18px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 13px; color: #617487; background: #eff2f4; border-radius: 50%; font-size: 19px; }
.empty-state h3 { margin: 0; font-size: 14px; }
.empty-state p { max-width: 420px; margin: 8px auto 16px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 13px 16px; background: #fbfcfc; border-bottom: 1px solid var(--line); }
.toolbar .filter-control { width: auto; min-width: 130px; min-height: 34px; padding: 6px 9px; font-size: 12px; }
.toolbar .filter-search { flex: 1 1 210px; min-width: 160px; }
.library-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); align-items: start; }
.library-toolbar .field { min-width: 0; }
.library-toolbar .field input, .library-toolbar .field select { width: 100%; min-width: 0; }
.library-toolbar > .form-actions { grid-column: 1 / -1; margin-top: 0; }
.library-pagination { padding: 12px 16px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* align-content: start：栅格单元被同行更高的内容撑高时，字段自身不被跟着拉高（否则下拉/输入会变成长条） */
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field-help { color: var(--soft); font-size: 11px; line-height: 1.55; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 12px; padding: 12px; background: #f8f9fa; border: 1px solid var(--line); border-radius: 6px; }
.check-option { display: flex; align-items: flex-start; gap: 8px; color: #4e5b68; font-size: 11px; line-height: 1.55; }
.check-option input { accent-color: var(--navy); }
.check-option input[type="checkbox"], .radio-card input[type="radio"] { flex: 0 0 16px; width: 16px; min-height: 16px; margin: 1px 0 0; padding: 0; border: 0; }
.check-option span { min-width: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 15px; }
.snapshot-row { grid-template-columns: minmax(0, 1fr) auto; }
.snapshot-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.snapshot-row .article-excerpt { overflow-wrap: anywhere; }
.dataset-analysis { grid-column: 1 / -1; min-width: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.dataset-analysis h3 { margin: 0 0 10px; font-size: 16px; }
.library-overview { overflow-wrap: anywhere; }
.overview-ingestion { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); font-size: 12px; }
.overview-ingestion p { margin: 5px 0; }
.statistics-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.statistics-controls .field { min-width: 180px; }
.statistics-summary { font-size: 13px; font-weight: 600; }
.statistics-groups { display: grid; gap: 6px; max-height: 350px; overflow: auto; }
.statistics-group { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(60px, 2fr) minmax(120px, auto); gap: 12px; align-items: center; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; padding: 10px; text-align: left; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.statistics-group:hover, .statistics-group:focus-visible { border-color: var(--red); }
.statistics-label { overflow-wrap: anywhere; }
.statistics-group meter { width: 100%; height: 18px; }
.statistics-count { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dataset-details .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dataset-record { border-top: 1px solid var(--line); padding: 10px 0; font-size: 12px; overflow-wrap: anywhere; }
.dataset-record summary { cursor: pointer; line-height: 1.6; }
.dataset-record dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; max-height: 350px; overflow: auto; }
.dataset-record dt { color: var(--muted); }
.dataset-record dd { margin: 0; white-space: pre-wrap; }
.retrieval-task { padding: 18px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.retrieval-task h3 { margin: 0 0 10px; font-size: 16px; }
.retrieval-task p { font-size: 13px; line-height: 1.6; }
.retrieval-form, .retrieval-upload, .retrieval-retry { display: grid; gap: 14px; }
.retrieval-form .form-actions, .retrieval-task .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.retrieval-upload, .retrieval-batch { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.retrieval-batch h4 { margin: 0 0 10px; font-size: 14px; }
.retrieval-retry { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.retrieval-record { border-top: 1px solid var(--line); padding: 12px 0; font-size: 12px; }
.retrieval-task input[type=file] { width: 100%; min-width: 0; }
.retrieval-task .field, .retrieval-task .field-help { min-width: 0; }
.source-permission-form { display: grid; gap: 12px; margin-top: 18px; }
.file-drop { display: grid; gap: 10px; padding: 18px; background: #fbfcfd; border: 1px dashed #b9c2cc; border-radius: 7px; }
.file-drop input[type=file] { max-width: 100%; color: var(--muted); font-size: 12px; }
.file-drop p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.review-layout { display: grid; grid-template-columns: minmax(280px, .88fr) minmax(400px, 1.12fr); gap: 14px; align-items: start; }
.review-list { max-height: 700px; overflow: auto; }
.review-select { display: grid; width: 100%; gap: 6px; padding: 13px 15px; color: inherit; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #edf0f2; }
.review-select:hover { background: #fafbfc; }
.review-select.is-selected { background: #f4f7f8; box-shadow: inset 3px 0 0 var(--red); }
.review-select strong { font-size: 12px; line-height: 1.5; }
.review-select small { color: var(--soft); font-size: 10px; }
.review-form { display: grid; gap: 14px; }
.review-form > .source-link { justify-self: start; margin-top: -6px; }
.review-duplicate-entry { padding: 12px 14px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; }
.review-duplicate-entry p { margin: 0 0 9px; font-size: 12px; line-height: 1.6; }
.revision-notice { padding: 12px 14px; background: var(--canvas); border-left: 3px solid var(--red); font-size: 12px; line-height: 1.7; }
.revision-notice h3 { margin: 0 0 8px; font-size: 14px; }
.revision-notice p { margin: 5px 0; }
.review-history-entry { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.review-history-entry p { margin: 5px 0; }
.classification-suggestion { padding: 14px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.classification-suggestion h3 { margin: 0 0 10px; font-size: 13px; }
.classification-suggestion p { margin: 8px 0; line-height: 1.65; }
.classification-suggestion blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); line-height: 1.7; }
.segmented { display: flex; flex-wrap: wrap; gap: 7px; }
.radio-card { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; color: #53606c; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.radio-card:has(input:checked) { color: #24384a; background: #f0f4f6; border-color: #9cadba; }
.radio-card input { accent-color: var(--navy); }
.table-scroll { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 11px 14px; color: #697682; text-align: left; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 650; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #edf0f2; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.source-name { color: var(--ink); font-weight: 640; }
.source-sub { display: block; margin-top: 4px; color: var(--soft); font-size: 10px; }
.sync-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sync-card { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.sync-card h3 { margin: 0; font-size: 13px; }
.sync-card p { margin: 8px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.code-value { display: inline-block; max-width: 100%; padding: 5px 7px; color: #415265; background: #f2f4f6; border-radius: 4px; font-family: Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 20; right: 25px; bottom: 22px; max-width: min(420px, calc(100vw - 36px)); padding: 12px 15px; color: #fff; background: #243649; border-radius: 6px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .16s ease, transform .16s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.research-form .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, monospace; font-size: 11px; }
.dialog-title { margin: 0; color: var(--ink); font-size: 21px; line-height: 1.55; }
.dialog-copy { color: #384550; font-size: 13px; line-height: 1.9; white-space: pre-wrap; }
.dialog-full-text { max-height: 40vh; overflow: auto; padding: 14px; background: #fafbfb; border: 1px solid var(--line); border-radius: 6px; }
.dialog-evidence { padding-left: 11px; color: var(--muted); border-left: 3px solid #bd7779; font-size: 12px; line-height: 1.7; }
.source-link { display: inline-block; margin-top: 8px; color: #456784; font-size: 12px; }
.article-dialog { width: min(680px, calc(100vw - 28px)); max-width: 680px; max-height: min(82vh, 760px); padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 22px 70px rgb(16 28 42 / 22%); }
.article-dialog::backdrop { background: rgb(17 28 38 / 38%); backdrop-filter: blur(2px); }
.article-dialog.has-comparison { width: min(1020px, calc(100vw - 28px)); max-width: 1020px; }
.notice-dialog { width: min(430px, calc(100vw - 28px)); max-width: 430px; padding: 0; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 64px rgb(16 28 42 / 22%); }
.notice-dialog::backdrop { background: rgb(17 28 38 / 40%); backdrop-filter: blur(2px); }
.notice-body { display: grid; gap: 12px; padding: 22px 24px 2px; }
.notice-head { display: flex; align-items: center; gap: 11px; }
.notice-mark { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; color: #fff; background: var(--red); border-radius: 50%; font-size: 16px; font-weight: 800; line-height: 1; }
.notice-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.notice-text { margin: 0; color: #334150; font-size: 13px; line-height: 1.95; }
.notice-text strong { color: var(--ink); font-weight: 750; }
.notice-next { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.notice-foot { display: flex; justify-content: flex-end; padding: 14px 24px 18px; }
.duplicate-search { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.duplicate-search input { width: 110px; }
.duplicate-candidate { padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
.duplicate-candidate button { max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.duplicate-comparison { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; scroll-margin-top: 64px; }
.duplicate-comparison h3 { margin: 0 0 12px; font-size: 15px; }
.duplicate-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.duplicate-column { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.duplicate-column h4 { margin: 0 0 10px; font-size: 13px; }
.duplicate-text { max-height: 220px; overflow: auto; background: var(--canvas); border: 1px solid var(--line); padding: 12px; }
.duplicate-differences { padding-left: 20px; line-height: 1.8; }
.dialog-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; background: white; border-bottom: 1px solid var(--line); font-size: 12px; }
.dialog-body { display: grid; gap: 13px; padding: 21px; }
.source-record-list { display: grid; }
.source-record-item { display: grid; gap: 5px; padding: 12px 15px; border-bottom: 1px solid #edf0f2; font-size: 11px; }
.source-record-item:last-child { border-bottom: 0; }
.source-record-item strong { color: var(--ink); font-size: 12px; }
.record-action-form { display: grid; gap: 10px; }
.record-action-form h3 { margin: 0; font-size: 13px; }
.record-action-form .check-option { padding: 8px; background: #f8f9fa; border-radius: 5px; }
.record-action-form input:not([type=checkbox]) { min-height: 36px; padding: 8px 10px; border: 1px solid #d8dde2; border-radius: 5px; font: inherit; }

@media (max-width: 1100px) {
  .sidebar { width: 205px; }
  .workspace { margin-left: 205px; }
  .page-content { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sync-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .statistics-group { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .statistics-group meter { grid-row: 2; grid-column: 1 / -1; }
  .dataset-record dl { grid-template-columns: 75px minmax(0, 1fr); }
  .source-table thead { display: none; }
  .source-table tbody { display: block; }
  .source-table tr { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .source-table tr:last-child { border-bottom: 0; }
  .source-table td { padding: 0; border: 0; }
  .source-table td:nth-child(-n+3) { grid-column: 1 / -1; }
  .source-table td:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
  .source-table td:last-child p { flex-basis: 100%; margin: 0; }
  .source-table td:last-child p:empty { display: none; }
  .duplicate-columns { grid-template-columns: 1fr; }
  .sidebar { position: sticky; inset: 0 0 auto; width: auto; height: auto; padding: 9px 12px 8px; }
  .sidebar-brand { padding: 0 4px 8px; }
  .brand-mark-small { width: 30px; height: 30px; flex-basis: 30px; font-size: 15px; }
  .sidebar-brand strong { font-size: 12px; }
  .sidebar-brand small, .nav-caption, .nav-section-label, .sidebar-bottom { display: none; }
  .navigation { display: flex; gap: 3px; overflow: auto hidden; scrollbar-width: thin; }
  .nav-link { flex: 0 0 auto; min-height: 36px; gap: 5px; padding: 0 8px; font-size: 11px; white-space: nowrap; }
  .nav-icon { width: auto; font-size: 13px; }
  .nav-link.is-active { box-shadow: inset 0 -2px 0 #d75b5f; }
  .nav-sub { display: none; opacity: 1; visibility: visible; }
  .nav-sub.is-open { display: block; flex: 0 0 auto; }
  .nav-sub-list { display: flex; flex-direction: row; gap: 4px; margin: 0; padding-left: 0; border-left: 0; }
  .nav-sub-link { flex: 0 0 auto; width: auto; min-height: 36px; padding: 0 8px; white-space: nowrap; opacity: 1; transform: none; transition: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 50px; padding: 0 15px; }
  .breadcrumb { gap: 7px; font-size: 11px; }
  .role-badge { display: none; }
  .page-content { padding: 20px 14px 32px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 17px; }
  .page-heading h1 { font-size: 23px; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 23px; }
  .panel-header, .panel-body { padding: 14px; }
  .article-row { grid-template-columns: 1fr; gap: 8px; padding: 14px; }
  .article-side { order: -1; }
  .form-grid, .form-grid-three { grid-template-columns: 1fr; }
  .form-section-2 .form-section-body, .form-section-3 .form-section-body { grid-template-columns: minmax(0, 1fr); }
  .field-wide { grid-column: auto; }
  .checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-layout { grid-template-columns: 1fr; }
  .review-list { max-height: 280px; }
  .toolbar { gap: 7px; padding: 10px; }
  .toolbar .filter-control { min-width: 110px; flex: 1 1 auto; }
  .toolbar .filter-search { flex-basis: 100%; }
  .login-card { padding: 28px 23px; }
  .toast { right: 12px; bottom: 12px; }
  .dialog-body { padding: 16px; }
}
.research-coding { grid-column: 1 / -1; width: 100%; min-width: 0; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.research-reports { grid-column: 1 / -1; width: 100%; min-width: 0; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.report-builder, .report-editor { display: grid; gap: 14px; margin: 14px 0; min-width: 0; }
.report-card, .report-evidence { padding: 14px; margin: 14px 0; border: 1px solid var(--line); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.report-facts { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.method-experiments { grid-column: 1 / -1; width: 100%; min-width: 0; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.experiment-builder, .experiment-editor, .experiment-list, .experiment-comparison { display: grid; gap: 14px; min-width: 0; margin: 16px 0; }
.experiment-builder textarea, .experiment-editor textarea { width: 100%; max-width: 100%; }
.experiment-card, .experiment-topics { padding: 14px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.experiment-facts { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.experiment-topic-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.comparison-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.comparison-table th, .comparison-table td { padding: 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 600px) { .experiment-topic-pair { grid-template-columns: minmax(0, 1fr); } .comparison-table th, .comparison-table td { padding: 5px; font-size: 11px; } }
.coding-statistics { grid-column: 1 / -1; min-width: 0; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.coding-statistics .field { flex: 1; min-width: 160px; max-width: 100%; }
.coding-statistics select { max-width: 100%; }
.coding-statistics-details { margin-top: 16px; }
.coding-row-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.coding-editor { display: grid; gap: 14px; min-width: 0; }
.coding-text, .coding-field, .coding-export, .coding-history details { border: 1px solid var(--line); border-radius: 6px; padding: 14px; min-width: 0; }
.coding-field summary, .coding-text summary, .coding-history summary { cursor: pointer; font-weight: 600; }
.coding-field[open] summary { margin-bottom: 14px; }
.dictionary-field, .variable-column-picker { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 10px 0; min-width: 0; }
.research-dictionary summary, .variable-column-picker summary { cursor: pointer; font-weight: 600; }
.dictionary-editor { display: grid; gap: 12px; }
.dictionary-field[open] { display: grid; gap: 12px; }
.variable-column-picker label { display: flex; align-items: flex-start; gap: 8px; overflow-wrap: anywhere; }
.variable-column-picker input { flex: 0 0 auto; }
.coding-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); }
.coding-entry .field:nth-child(3) { grid-column: 1 / -1; }
.coding-entry textarea { width: 100%; max-width: 100%; }
.frozen-text, .coding-candidate { white-space: pre-wrap; overflow-wrap: anywhere; }
.coding-text .frozen-text { max-height: 280px; overflow: auto; }
.coding-exports, .coding-history { display: grid; gap: 12px; margin-top: 16px; }
.text-analysis { grid-column: 1 / -1; width: 100%; min-width: 0; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.analysis-form, .analysis-detail, .analysis-results, .analysis-documents { display: grid; gap: 14px; min-width: 0; margin: 16px 0; }
.analysis-form textarea { width: 100%; max-width: 100%; }
.analysis-parameters, .analysis-topic, .analysis-document { padding: 14px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.analysis-parameters summary { cursor: pointer; font-weight: 600; }
.analysis-parameters[open] summary { margin-bottom: 14px; }
.analysis-parameters > p, .analysis-topic p { overflow-wrap: anywhere; }
.analysis-run { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.analysis-run p { flex: 1; min-width: 150px; }
.analysis-frozen-text { max-height: 300px; overflow: auto; }
.content-issues, .content-issue-form { display: grid; gap: 16px; min-width: 0; }
.content-issues-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: start; }
.content-issues-layout > div { min-width: 0; }
.content-issue-row, .content-issue-form { border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-bottom: 12px; overflow-wrap: anywhere; }
.content-issue-form textarea, .content-issue-form input { width: 100%; max-width: 100%; }
.content-issue-history p { overflow-wrap: anywhere; }
.headline-toolbar { margin-bottom: 14px; align-items: end; }
.headline-explanation { margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; min-width: 0; overflow-wrap: anywhere; }
.headline-explanation summary, .headline-policy summary { cursor: pointer; font-size: 12px; color: var(--ink); }
.headline-policy { margin-bottom: 14px; }
.headline-rating-form, .headline-grade-form { display: grid; gap: 12px; min-width: 0; }
.headline-rating-form textarea, .headline-grade-form textarea { width: 100%; max-width: 100%; }
.source-status-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.source-status-card { padding: 14px; border: 1px solid var(--line); border-radius: 5px; min-width: 0; overflow-wrap: anywhere; }
.source-watch-form { display: grid; gap: 12px; margin-top: 14px; max-width: 600px; }
.source-times, .source-time-list { display: grid; gap: 12px; min-width: 0; }
.source-time-item { border: 1px solid var(--line); border-radius: 5px; padding: 12px; min-width: 0; overflow-wrap: anywhere; }
.personalized-workflow { display: grid; gap: 16px; }
.personalized-form { display: grid; gap: 12px; }
.personalized-form textarea { width: 100%; max-width: 100%; }
.wenke-search-form { grid-template-columns: 1fr; }
.wenke-search-form .form-actions { margin-top: 0; }
/* 长表单分区：小节标题 + 分组栅格，避免字段平铺成一整块两列 */
.form-section { display: grid; gap: 12px; padding-top: 16px; }
.form-section-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 12.5px; font-weight: 700; }
.form-section-title::before { content: ""; flex: none; width: 3px; height: 13px; background: var(--red); border-radius: 2px; }
.form-section-body { display: grid; gap: 14px; }
.form-section-1 .form-section-body { grid-template-columns: minmax(0, 1fr); }
.form-section-2 .form-section-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section-3 .form-section-body { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 单位画像表单：选择/新建行 + 分区 + 操作行 */
.unit-profile-form { gap: 0; }
.unit-profile-target { display: flex; align-items: flex-end; gap: 12px; }
.unit-profile-target .field { flex: 1 1 auto; min-width: 0; }
.unit-profile-target .status-pill { flex: none; margin-bottom: 11px; }
.unit-profile-actions { margin-top: 0; padding-top: 16px; }
/* 生成定制稿表单：分区块 + 候选/检索卡片 + 操作行 */
.draft-form { gap: 0; }
.draft-form .article-finder { gap: 12px; padding: 14px 15px; background: #fbfcfd; border: 1px solid var(--line); border-radius: 6px; }
.draft-form .article-finder > strong { color: var(--ink); font-size: 12.5px; }
.draft-form .article-candidate-list:empty { display: none; }
.form-submit-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 16px; }
.form-submit-row .button { min-width: 132px; }
.form-submit-row .field-help { flex: 1 1 240px; margin: 0; }
/* 单位定制发布：栅格里的非字段内容整行铺开；按钮不再被拉成整条；提交按钮即该模块的主操作 */
.personalized-workflow :is(.personalized-form, .form-grid) > :not(.field) { grid-column: 1 / -1; }
.personalized-workflow :is(.personalized-form, .form-grid) > .button { justify-self: start; min-width: 132px; }
.personalized-workflow button[type="submit"] { color: #fff; background: var(--red); border-color: var(--red); }
.personalized-workflow button[type="submit"]:hover:not(:disabled) { background: #84252a; border-color: #84252a; }
/* 没有内容的容器不留白框 */
.personalized-workflow .source-compare:empty, .personalized-workflow .draft-difference:empty,
.personalized-workflow .article-candidate-list:empty, .personalized-workflow .release-list:empty,
.personalized-workflow .article-list:empty { display: none; }

/* 等待反馈：按钮进入忙碌态转圈；页面上方一条细进度条（请求超过 220ms 才出现，避免一闪而过） */
.button.is-busy { cursor: progress; opacity: .9; }
.button.is-busy::before {
  content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: button-spin .7s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }
body.is-fetching::before {
  content: ""; position: fixed; z-index: 40; top: 0; left: 0; width: 30%; height: 2px;
  background: var(--red); box-shadow: 0 0 6px rgb(165 45 50 / 45%);
  animation: fetch-bar 1.1s ease-in-out infinite;
}
@keyframes fetch-bar { 0% { left: -30%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .button.is-busy::before { animation-duration: 1.8s; }
  body.is-fetching::before { animation-duration: 2.2s; }
}
.unit-profile-actions .button { min-width: 132px; }
.unit-profile-actions .field-help { flex: 1 1 240px; margin: 0; }
.wenke-retrieval-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 12px; background: transparent; border: 1px solid var(--line); border-radius: 6px; }
.wenke-retrieval-bar .filter-control { width: auto; min-height: 36px; padding: 6px 9px; font-size: 12px; }
.wenke-retrieval-bar .wenke-page-input { width: 72px; }
.wenke-inline { display: inline-flex; align-items: center; gap: 6px; color: #414d59; font-size: 13px; font-weight: 650; white-space: nowrap; }
.wenke-inline-note { margin: 0; }
.wenke-selection-status { margin: 0; }
.wenke-selection-status:empty { display: none; }
.customer-entry { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--canvas); font-size: 12px; }
.customer-entry-url { overflow-wrap: anywhere; user-select: all; }
.customer-entry-link { width: fit-content; color: var(--red); font-weight: 700; }
.customer-entry .field-help { margin: 0; }
.article-finder { display: grid; gap: 10px; min-width: 0; }
.article-finder-controls { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.article-finder-controls .field { flex: 1 1 240px; }
.article-candidate-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.article-candidate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.article-candidate strong { grid-column: 1 / -1; overflow-wrap: anywhere; }
.article-candidate p { grid-column: 1; margin: 0; overflow-wrap: anywhere; }
.article-candidate-actions { grid-column: 2; grid-row: 2 / span 2; display: grid; gap: 8px; }
.source-compare { padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: #faf9f6; font-size: 13px; line-height: 1.7; }
.source-compare p { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-compare details p { max-height: 280px; overflow: auto; }
.draft-difference { padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; line-height: 1.7; }
.draft-difference p { margin: 8px 0; overflow-wrap: anywhere; }
.draft-difference ul { margin: 8px 0; padding-left: 22px; max-height: 240px; overflow: auto; overflow-wrap: anywhere; }
.personalized-release { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }
.source-time-input { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; font: inherit; }
@media (max-width: 800px) { .content-issues-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .coding-entry { grid-template-columns: minmax(0, 1fr); } }
