/* 娄底绩效自评复核 Demo — 高保真原型样式 */
:root {
  --primary: #1a56a8;
  --primary-dark: #0f2d52;
  --primary-light: #e6f0fa;
  --accent: #096dd9;
  --login-bg: #f5f7fb;
  --bg: #eef1f6;
  --surface: #ffffff;
  --border: #d9dee7;
  --text: #1f2937;
  --text-secondary: #5c6578;
  --success: #237804;
  --success-bg: #f6ffed;
  --warning: #d48806;
  --warning-bg: #fffbe6;
  --danger: #cf1322;
  --info: #0958d9;
  --sidebar-w: 200px;
  --tree-w: 260px;
  --header-h: 56px;
  --radius: 4px;
  --shadow: 0 1px 4px rgba(15, 45, 82, 0.08);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }

.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--header-h);
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.topbar-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.topbar-sub { font-size: 11px; font-weight: 400; opacity: .65; margin-left: 4px; }

.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 13px; }

.topbar-meta select {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.quota-pill {
  background: rgba(255,255,255,.1); padding: 4px 12px; border-radius: 20px; font-size: 12px;
  border: none; color: inherit; cursor: pointer; font-family: inherit;
}
.quota-pill:hover { background: rgba(255,255,255,.18); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

.body-row { display: flex; flex: 1; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
.nav-label { padding: 4px 16px 8px; font-size: 11px; color: var(--text-secondary); font-weight: 600; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active {
  background: var(--primary-light); color: var(--primary);
  border-left-color: var(--primary); font-weight: 600;
}

.org-panel {
  width: var(--tree-w);
  background: #fafbfc;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}

.org-panel-header {
  padding: 12px 14px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
}

.org-tree { flex: 1; overflow-y: auto; padding: 8px 0; }

.tree-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 12px; cursor: pointer; font-size: 13px;
  border-radius: var(--radius); margin: 1px 6px;
}

.tree-row:hover { background: #e8eef5; }
.tree-row.selected { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.tree-sub { font-size: 12px; color: var(--text-secondary); padding-left: 28px !important; }
.tree-sub.selected { color: var(--primary); font-weight: 500; }

.tree-children { display: none; padding-left: 12px; }
.tree-children.open { display: block; }

.chevron { width: 14px; font-size: 10px; color: var(--text-secondary); }
.chevron.open { transform: rotate(90deg); display: inline-block; }

.rank-badge {
  font-size: 10px; font-weight: 700; padding: 1px 5px;
  border-radius: 3px; background: var(--primary); color: #fff;
}
.rank-badge.pending { background: var(--warning); }
.rank-badge.final { background: var(--success); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.done { background: var(--success); }
.status-dot.review { background: var(--warning); }
.status-dot.final-p { background: #722ed1; }

.body-row.hide-org-panel .org-panel { display: none; }

.main-content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.page-view { display: none; }
.page-view.active { display: block; }

.page-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.breadcrumb { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }

.page-context {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; background: #f5f7fa; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; font-size: 13px;
}
.page-context .ctx-meta { font-size: 12px; color: var(--text-secondary); }

.c1-view, .c1-panel, .c2-panel, .c4-step-panel { display: none; }
.c1-view.active, .c1-panel.active, .c2-panel.active, .c4-step-panel.active { display: block; }

.context-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.context-strip.hidden { display: none; }
.ctx-pin { opacity: .6; }
.ctx-cta { margin-left: auto; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.nav-item.nav-disabled { opacity: .45; cursor: not-allowed; }
.nav-item.nav-disabled:hover { background: transparent; color: inherit; }

.notify-btn {
  position: relative; background: rgba(255,255,255,.1); border: none; color: inherit;
  padding: 4px 10px; border-radius: var(--radius); cursor: pointer; font-size: 16px;
}
.notify-btn:hover { background: rgba(255,255,255,.18); }
.notify-badge {
  position: absolute; top: -4px; right: -2px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.user-chip { display: flex; align-items: center; gap: 8px; }

.summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.summary-metrics {
  display: flex; flex-wrap: wrap; gap: 24px 40px; margin-bottom: 16px;
}
.summary-metrics .label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.summary-metrics strong { font-size: 22px; color: var(--primary); }
.summary-text { font-size: 14px; line-height: 1.7; margin-bottom: 16px; color: var(--text); }

.c3-details { display: none; margin-top: 8px; }
.c3-details.open { display: block; }

.wizard-indicator {
  font-size: 13px; color: var(--text-secondary); margin-bottom: 16px;
  padding: 10px 14px; background: #f5f7fa; border-radius: var(--radius);
}

.lock-icon { font-size: 11px; margin-left: 4px; opacity: .7; }
.role-hint-card {
  padding: 10px 12px; background: #f5f7fa; border-radius: var(--radius);
  font-size: 12px; color: var(--text-secondary); margin-top: 8px;
}
.tree-editor-full { max-width: 720px; }

.onboard-steps {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 14px 18px; background: #f5f7fa; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; font-size: 13px;
}
.onboard-step { white-space: nowrap; }
.onboard-step.done { color: var(--success); font-weight: 500; }
.onboard-step.pending { color: var(--text-secondary); }
.onboard-arrow { color: var(--text-secondary); font-size: 12px; }

.pipeline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 14px 16px; background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius);
}
.pipeline-step { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.pipeline-step.done { color: var(--success); font-weight: 500; }
.pipeline-step.active { color: var(--warning); font-weight: 600; }
.pipeline-arrow { color: var(--text-secondary); font-size: 12px; }

.sub-meta-list { list-style: none; font-size: 13px; line-height: 2; }

.readonly-chip {
  display: inline-block; padding: 8px 14px; background: #f5f7fa;
  border: 1px solid var(--border); border-radius: var(--radius); font-weight: 500; max-width: 480px;
}
.readonly-chip.muted { color: var(--text-secondary); font-weight: 400; }

.form-select-sm { max-width: 160px; padding: 4px 8px; font-size: 12px; }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; }
.btn-link:hover { text-decoration: underline; }

.report-preview {
  background: #fafbfc; font-size: 13px; line-height: 1.8; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
}

.finance-block {
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border);
}
.finance-block-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 12px; margin-bottom: 12px;
}
.finance-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

.finance-title {
  font-size: 14px; font-weight: 600; margin: 0; color: var(--primary);
}

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

.finance-metric {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px;
}

.finance-metric .label {
  display: block; font-size: 11px; color: var(--text-secondary); margin-bottom: 4px;
}

.finance-metric strong { font-size: 15px; color: var(--text); }

.finance-details summary { font-size: 13px; }
.finance-total-row td { background: var(--bg-muted, #f4f6f9); border-top: 2px solid var(--border); }

@media (max-width: 900px) {
  .finance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.btn-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow);
}

.stat-card .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .value span { font-size: 16px; font-weight: 400; color: var(--text-secondary); }
.stat-card .bar { height: 4px; background: #e8eef5; border-radius: 2px; margin-top: 12px; }
.stat-card .bar-fill { height: 100%; background: var(--primary); border-radius: 2px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px;
}

.panel-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 600; flex-wrap: wrap;
}
.panel-header .tag { flex-shrink: 0; font-weight: 500; }

.panel-body { padding: 16px 18px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; background: #f5f7fa;
  border-bottom: 1px solid var(--border); font-weight: 600;
  color: var(--text-secondary); font-size: 12px;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: #fafbfc; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 500;
}
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-info { background: #e6f4ff; color: var(--info); }
.tag-purple { background: #f9f0ff; color: #722ed1; }
.tag-danger { background: #fff1f0; color: var(--danger); }
.tag-default { background: #f5f5f5; color: var(--text-secondary); }

/* [hidden] 须压过 .btn 等 display 规则，否则向导步按钮无法隐藏 */
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius); font-size: 13px;
  font-weight: 500; cursor: pointer; border: 1px solid transparent;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #164a91; }
.btn-default { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 10px 18px; cursor: pointer; font-size: 13px;
  color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.sub-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.sub-tab {
  padding: 4px 12px; border-radius: 20px; font-size: 12px; cursor: pointer;
  background: #f0f2f5; color: var(--text-secondary);
}
.sub-tab.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.tab-panel, .c3-panel, .c0-panel, .c8-panel, .s3-panel { display: none; }
.tab-panel.active, .c3-panel.active, .c0-panel.active, .c8-panel.active, .s3-panel.active { display: block; }

.rule-meta-bar {
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center;
  padding: 12px 16px; background: #f5f7fa; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; font-size: 13px;
}

.weight-list { list-style: none; max-width: 520px; }
.weight-list li {
  display: grid; grid-template-columns: 100px 1fr 48px; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.weight-bar { height: 8px; background: #e8eef5; border-radius: 4px; overflow: hidden; }
.weight-bar > div { height: 100%; background: var(--primary); border-radius: 4px; }

.track-a-total td { background: #f5f7fa; font-weight: 500; }
.data-table tfoot tr td { background: #f0f6ff; font-weight: 500; border-top: 2px solid var(--primary); }

.rbac-matrix td:first-child { white-space: nowrap; }

.admin-shell .tenant-select {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; padding: 4px 8px; border-radius: var(--radius); font-size: 13px;
}
.admin-shell .tenant-row.active td { background: rgba(26,86,168,.08); }

.topbar-meta label { display: flex; align-items: center; gap: 6px; }

.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; max-width: 480px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px;
}
.form-input.form-date {
  max-width: none; min-height: 36px;
  color-scheme: light;
}
.form-input-tel { max-width: 280px; letter-spacing: 0.02em; }
.form-region-row {
  display: flex; gap: 10px; flex-wrap: wrap; max-width: 480px;
}
.form-region-row .form-select { flex: 1; min-width: 140px; max-width: none; }
.form-date-range {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 480px;
}
.form-date-range .form-date { flex: 1; min-width: 140px; max-width: 200px; }
.form-date-sep { font-size: 13px; color: var(--text-secondary); }
.inline-field {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
}
.rule-meta-bar .inline-field .form-select-sm { max-width: 100px; }
.modal-lead { margin: 0 0 16px; font-size: 14px; }
.modal-meta { margin: 12px 0 0; font-size: 13px; color: var(--text-secondary); }
.validate-result-list { list-style: none; margin: 0; padding: 0; }
.validate-result-list li {
  padding: 10px 12px; margin-bottom: 8px; border-radius: var(--radius); font-size: 13px;
}
.validate-result-list .validate-ok { background: #f6ffed; border: 1px solid #b7eb8f; }
.validate-result-list .validate-warn { background: #fffbe6; border: 1px solid #ffe58f; }
.task-log-pre {
  margin: 0; padding: 12px; background: #fafafa; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 12px; line-height: 1.6; white-space: pre-wrap;
  font-family: ui-monospace, Consolas, monospace; max-height: 360px; overflow: auto;
}
.btn-link {
  background: none; border: none; color: var(--primary); cursor: pointer;
  padding: 0; font-size: 13px; text-decoration: underline;
}
.btn-link:hover { color: var(--accent); }
.admin-task-table .btn-link { text-decoration: none; }
.admin-task-table .btn-link:hover { text-decoration: underline; }

.admin-overview-actions { margin-bottom: 16px; }
.quota-grid { margin-bottom: 0; }
.quota-grid .stat-card .value { font-size: 22px; }
.stat-card.quota-warn { border-color: #ffe58f; background: #fffbe6; }
.stat-card.quota-warn .bar-fill { background: #faad14; }
.admin-ledger-table { font-size: 13px; }
.admin-ledger-table td { vertical-align: top; }
.form-row { margin-bottom: 16px; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; color: var(--text-secondary);
  cursor: pointer; max-width: 480px;
}
.upload-zone:hover { border-color: var(--primary); color: var(--primary); }

.alert {
  padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px;
}
.alert-info { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }

.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 6px;
  width: min(560px, 92vw); max-width: 92vw;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.modal.modal-md { width: min(640px, 92vw); max-width: 92vw; }
.modal.modal-lg { width: min(840px, 94vw); max-width: 94vw; }
.modal.modal-xl { width: min(960px, 96vw); max-width: 96vw; }
.modal-overlay.modal-upload .modal { width: min(840px, 94vw); max-width: 94vw; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.modal-body { padding: 20px 24px; max-height: min(72vh, 720px); overflow-y: auto; }
.modal-body ul { margin: 12px 0 0 20px; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

.toast-container {
  position: fixed; top: 70px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); padding: 12px 16px;
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.12);
  font-size: 13px; max-width: 320px;
}

.page-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.page-tab {
  padding: 10px 20px; cursor: pointer; font-size: 14px;
  color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.page-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.progress-wrap { background: #e8eef5; border-radius: 4px; height: 8px; margin: 12px 0; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 4px; width: 0%; transition: width .3s; }

.score-input {
  width: 56px; padding: 4px 6px; border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
  box-sizing: border-box;
}
.score-input.changed { border-color: var(--warning); background: var(--warning-bg); }

.score-confirm-table .reason-input.changed { border-color: var(--warning); background: var(--warning-bg); }

.drawer {
  display: none; background: #f5f7fa; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; font-size: 13px;
}
.drawer.open { display: block; }

.footnote { font-size: 12px; color: var(--text-secondary); margin-top: 12px; }

.prototype-badge { display: none; }

.quota-pill-secondary { margin-left: 8px; background: #f0f5ff; color: var(--primary); border: 1px solid #adc6ff; }

.drawer-empty-state[hidden] { display: none !important; }

.drawer-empty-state, .lib-empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center; color: var(--text-secondary);
}
.empty-title, .lib-empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.empty-desc, .lib-empty-desc { font-size: 13px; margin: 0; max-width: 280px; }
.drawer-detail-panel { flex: 1; overflow-y: auto; padding: 12px 16px 20px; }
.drawer-detail-head { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.drawer-detail-head h3 { margin: 0; font-size: 16px; }
.drawer-detail-meta { font-size: 12px; color: var(--text-secondary); margin: 0 0 8px; }
.drawer-detail-summary { font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.drawer-detail-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.drawer-detail-metrics .label { display: block; font-size: 11px; color: var(--text-secondary); }
.drawer-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-tree-empty { font-size: 12px; color: var(--text-secondary); padding: 12px; }

/* Report library v5.6 */
.lib-layout {
  display: grid; grid-template-columns: minmax(360px, 420px) 1fr; min-height: 420px;
}
.lib-tree-col {
  border-right: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  min-width: 0; background: #f8fafc;
}
.lib-tree-search { font-size: 13px; }
.lib-tree-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.lib-tree-toolbar .lib-tree-legend { flex: 1; min-width: 0; margin: 0; }
.lib-tree-collapse-btn {
  flex-shrink: 0; padding: 0 2px; font-size: 12px; color: var(--primary); white-space: nowrap;
}
.lib-tree-collapse-btn:hover { color: var(--accent); text-decoration: underline; }
.lib-tree { flex: 1; overflow-y: auto; font-size: 13px; padding-right: 4px; }
.lib-tree-nested { display: flex; flex-direction: column; gap: 4px; }

.lib-tree-l1, .lib-tree-l2, .lib-tree-year, .lib-tree-node {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 7px 10px; border-radius: 6px; color: var(--text);
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 45, 82, 0.04);
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.lib-tree-l1-row.lib-tree-l1-card {
  display: flex; align-items: stretch; margin-bottom: 2px;
  border: 1px solid var(--border); border-radius: 5px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 45, 82, 0.04);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lib-tree-l1-card.selected {
  border-color: var(--primary); background: var(--primary-light);
  box-shadow: 0 0 0 1px rgba(26, 86, 168, 0.12);
}
.lib-tree-l1-card:hover { border-color: #adc6ff; background: #fafcff; }
.lib-tree-l1-card.selected:hover { background: var(--primary-light); }
.lib-tree-l1-card .lib-tree-toggle {
  flex-shrink: 0; width: 26px; align-self: stretch; min-height: 32px;
  border: none; border-right: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); font-size: 11px; padding: 0; border-radius: 0;
  cursor: pointer;
}
.lib-tree-l1-card .lib-tree-toggle:hover { background: rgba(26, 86, 168, 0.06); color: var(--primary); }
.lib-tree-l1-card.selected .lib-tree-toggle { border-right-color: #adc6ff; color: var(--primary); }
.lib-tree-l1-card .lib-tree-l1 {
  flex: 1; min-width: 0; margin-bottom: 0;
  border: none; box-shadow: none; border-radius: 0; background: transparent;
  padding: 6px 8px;
}
.lib-tree-l1-card .lib-tree-l1:hover { background: transparent; border: none; }
.lib-tree-l1-card.selected .lib-tree-name { color: var(--primary); }
.lib-tree-l1-row { display: flex; align-items: stretch; gap: 0; }
.lib-tree-toggle {
  flex-shrink: 0; width: 24px; align-self: stretch; min-height: 32px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  color: var(--text-secondary); font-size: 11px; padding: 0;
  border-radius: 5px;
}
.lib-tree-toggle:hover { background: #f0f5ff; color: var(--primary); border-color: #adc6ff; }
.lib-tree-l1-wrap { margin-bottom: 2px; }
.lib-tree-children {
  display: none; flex-direction: column; gap: 3px;
  padding: 0 0 2px 8px; margin-left: 6px; border-left: 2px solid #e8eef5;
}
.lib-tree-children.open { display: flex; }
.lib-tree-name {
  width: 100%; line-height: 1.35;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.lib-tree-l2 .lib-tree-name {
  font-size: 12px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.lib-tree-l1 .lib-tree-name,
.lib-tree-year .lib-tree-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-tree-l1.selected, .lib-tree-l2.selected, .lib-tree-year.selected {
  border-color: var(--primary); background: var(--primary-light);
  box-shadow: 0 0 0 1px rgba(26, 86, 168, 0.12);
}
.lib-tree-l1-card.selected .lib-tree-l1,
.lib-tree-l1-card.selected .lib-tree-l1:hover {
  background: transparent; border: none; box-shadow: none;
}
.lib-tree-l2.selected .lib-tree-name, .lib-tree-year.selected .lib-tree-name { color: var(--primary); }
.lib-tree-l1:hover, .lib-tree-l2:hover, .lib-tree-year:hover {
  border-color: #adc6ff; background: #fafcff;
}
.lib-report-status-row {
  display: flex; flex-wrap: nowrap; gap: 4px; width: 100%; overflow: hidden;
}
.lib-tree .lib-status-chip {
  font-size: 10px; line-height: 1.25; padding: 2px 6px; flex-shrink: 0;
}
.lib-status-chip {
  display: inline-block; font-size: 11px; line-height: 1.3;
  padding: 3px 8px; border-radius: 4px; border: 1px solid #e8e8e8;
  color: var(--text-secondary); background: #f5f5f5; white-space: nowrap;
}
.lib-status-chip.ready {
  color: #0958d9; background: #e6f4ff; border-color: #91caff; font-weight: 500;
}
.lib-status-chip.pending { color: #8c8c8c; background: #fafafa; border-color: #e8e8e8; }

.lib-tree-legend { margin: 0; line-height: 1.4; color: var(--text-secondary); font-size: 11px; }
.lib-tree-legend .lib-status-chip { vertical-align: middle; margin: 0 2px; }

.home-lib-summary {
  display: block; width: 100%; text-align: left; margin-bottom: 20px; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.home-lib-summary:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(26,86,168,.08); }
.home-lib-summary-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.home-lib-summary-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.home-lib-summary-sub { font-size: 12px; color: var(--text-secondary); }
.home-lib-summary-num { font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.home-lib-summary-num strong { font-size: 28px; color: var(--primary); font-weight: 700; }
.home-lib-summary-bar {
  height: 6px; background: #f0f0f0; border-radius: 3px; margin: 12px 0 10px; overflow: hidden;
}
.home-lib-summary-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.home-lib-summary-types { display: flex; flex-wrap: wrap; gap: 8px; }
.home-lib-type-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 12px; background: #f5f7fa; color: var(--text-secondary);
}
.home-lib-type-chip em { font-style: normal; font-weight: 600; margin-right: 4px; color: var(--text); }
.home-lib-type-chip.done { background: #f6ffed; color: #389e0d; }
.home-lib-type-chip.done em { color: #389e0d; }

.report-card-pending { opacity: 0.72; background: #fafbfc; border-style: dashed; }
.report-card-pending .report-card-title { color: var(--text-secondary); }
.lib-tree-l2 { margin: 0; }
.lib-tree-year {
  margin-top: 4px; padding: 6px 8px; font-weight: 500;
  border-top: 1px dashed var(--border);
}
.lib-tree-year-top {
  margin-bottom: 6px; padding: 7px 10px; font-weight: 500;
  border: 1px solid #91caff; border-radius: 6px; background: #e6f4ff;
}
.lib-tree-year-top .lib-tree-name { color: var(--primary); }
.lib-main-col { padding: 20px 24px; min-height: 320px; position: relative; }
.lib-empty-state[hidden], .lib-detail[hidden] { display: none !important; }
.lib-detail:not([hidden]) { display: block; }
.lib-detail-summary {
  font-size: 13px; color: var(--text-secondary); margin: 0 0 12px; line-height: 1.55;
}
#lib-materials { margin-bottom: 16px; }
#lib-materials[hidden] { display: none !important; }
.lib-materials-table .lib-material-filename { font-size: 12px; word-break: break-all; }
.material-preview-dl {
  display: grid; grid-template-columns: 100px 1fr; gap: 8px 16px; font-size: 13px; margin: 0 0 16px;
}
.material-preview-dl dt { color: var(--text-secondary); font-weight: 500; margin: 0; }
.material-preview-dl dd { margin: 0; }
.material-finance-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border, #e8e8e8); }
.material-finance-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.material-finance-heading { margin: 0; font-size: 15px; font-weight: 600; }
.material-finance-actions { display: flex; gap: 4px; }
.material-finance-tables .report-table-fold { margin-bottom: 8px; }
.report-goal { margin: 8px 0 16px; line-height: 1.7; font-size: 14px; color: var(--text-secondary); }
.report-perf-table .report-cell-note { font-size: 12px; max-width: 220px; line-height: 1.5; }
.lib-filter-notice {
  grid-column: 1 / -1; font-size: 12px; color: var(--warning); background: var(--warning-bg);
  padding: 8px 12px; border-radius: var(--radius); margin-bottom: 4px;
}

.status-chip-all em { display: none; }
.nav-back-platform { font-size: 12px; opacity: 0.85; margin-bottom: 4px; }

.admin-tenant-switch {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255,255,255,.75); margin-right: 12px;
}
.admin-shell .admin-tenant-select {
  min-width: 200px; background: rgba(255,255,255,.12); color: #fff;
  border-color: rgba(255,255,255,.25);
}
.admin-shell .admin-tenant-select option { color: #333; background: #fff; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.report-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: #fff;
}
.report-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.report-card-title { margin: 0; font-size: 14px; font-weight: 600; }
.report-card-meta { font-size: 12px; color: var(--text-secondary); margin: 0 0 12px; }
.report-card-actions { display: flex; gap: 8px; }
.lib-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.lib-detail-title { margin: 0; font-size: 18px; }
.lib-cards-empty { padding: 24px; text-align: center; color: var(--text-secondary); font-size: 13px; }

.demo-only-panel { margin-top: 16px; font-size: 13px; }
.demo-only-panel summary { cursor: pointer; color: var(--text-secondary); }

/* ── 登录页 ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1a3a6a 50%, var(--primary) 100%);
  padding: 24px;
  position: relative; z-index: 10;
}
.login-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,.2);
  width: min(420px, 100%);
  padding: 40px 36px 32px;
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--text);
  margin-bottom: 4px;
}
.login-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.login-field .form-input { width: 100%; }
.login-forgot { float: right; font-size: 12px; color: var(--primary); cursor: pointer; }
.login-forgot:hover { text-decoration: underline; }
.login-btn { width: 100%; padding: 10px; font-size: 15px; margin-top: 4px; justify-content: center; }
.login-error { color: var(--danger); font-size: 12px; margin-top: 8px; display: none; }
.login-error.show { display: block; }
.login-footer-link { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-secondary); }
.login-footer-link a { color: var(--primary); cursor: pointer; }

/* 用户菜单展开态 */
.user-chip { position: relative; cursor: pointer; }
.user-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 180px; z-index: 100; font-size: 13px;
}
.user-menu.open { display: block; }
.user-menu-header { padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 500; }
.user-menu-item {
  display: block; width: 100%; text-align: left; padding: 9px 14px;
  border: none; background: none; cursor: pointer; font-size: 13px; color: var(--text);
}
.user-menu-item:hover { background: var(--primary-light); color: var(--primary); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: #fff2f0; }
.admin-shell .user-menu { background: #2a2a2a; border-color: #444; }
.admin-shell .user-menu-header { color: #ddd; border-color: #444; }
.admin-shell .user-menu-item { color: #ddd; }
.admin-shell .user-menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-shell .user-menu-item.danger { color: #ff7875; }
.admin-shell .user-menu-item.danger:hover { background: rgba(255,120,117,.15); }

/* 登录后框架显示 */
.app-shell.hidden { display: none; }
.login-page.hidden { display: none !important; }

/* Admin dual mode */
.admin-mode-platform .nav-tenant-only { display: none; }
.admin-mode-platform .admin-view:not(#admin-s0) { display: none !important; }
.admin-mode-tenant .nav-platform-only { display: none; }
.admin-mode-tenant #admin-s0 { display: none !important; }
.wizard-steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.wizard-step {
  font-size: 12px; padding: 4px 10px; border-radius: 12px; background: #f0f0f0; color: var(--text-secondary);
}
.wizard-step.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* Admin */
.admin-shell .topbar { background: #141414; }
.admin-shell .sidebar { background: #1f1f1f; border-color: #303030; }
.admin-shell .nav-item { color: rgba(255,255,255,.75); }
.admin-shell .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-shell .nav-item.active {
  background: rgba(26,86,168,.35); color: #fff; border-left-color: var(--accent);
}
.admin-shell .nav-label { color: rgba(255,255,255,.35); }
.admin-shell .nav-section { border-color: #303030; }
.admin-shell .main-content { flex: 1; }
.admin-view { display: none; }
.admin-view.active { display: block; }

.tree-editor {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0; background: #fafbfc; font-size: 13px; line-height: 1.45;
  overflow: hidden;
}

.tree-editor .node-assessment { font-weight: 600; color: var(--primary); }
.tree-editor .node-sub { padding-left: 24px; color: var(--text-secondary); }

.org-tree-panel-wrap { padding: 0 !important; }
.org-panel-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.tree-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: #fafbfc;
}
.form-input-num { max-width: 120px; }
.org-import-zone { display: block; width: 100%; max-width: none; margin-top: 0; cursor: pointer; }
.org-import-zone input { display: none; }
.org-import-hint { margin: 0 0 14px; font-size: 13px; line-height: 1.6; }
.org-import-hint a { margin-right: 6px; }
.org-import-preview { margin-top: 16px; }
.org-tree-nested { padding: 12px 16px 16px; }
.tree-dep-block { margin-bottom: 16px; }
.tree-dep-block:last-child { margin-bottom: 0; }
.tree-dep-title {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--border);
}
.tree-l1-block { margin-bottom: 10px; }
.tree-l1-block:last-child { margin-bottom: 0; }
.tree-l2-list { margin-left: 8px; border-left: 1px solid #e8ecf0; padding-left: 4px; }
.tree-node {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: var(--radius); font-size: 13px; min-height: 36px;
}
.tree-node.l1 { font-weight: 600; color: var(--primary); background: #f8fafc; margin-bottom: 2px; }
.tree-node.l2 { color: var(--text); }
.tree-node.l2.muted { color: var(--text-secondary); }
.tree-chevron { width: 16px; font-size: 10px; color: var(--text-secondary); flex-shrink: 0; text-align: center; }
.tree-branch { width: 16px; color: var(--text-secondary); font-family: monospace; flex-shrink: 0; text-align: center; }
.tree-node-label { flex: 1; min-width: 0; line-height: 1.45; word-break: break-word; }
.tree-node-tags {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto;
}
.tree-meta { font-size: 11px; color: var(--text-secondary); font-weight: 400; white-space: nowrap; }
.data-table-compact td, .data-table-compact th { padding: 8px 10px; font-size: 12px; }
.modal-body code { font-size: 12px; background: #f5f5f5; padding: 1px 4px; border-radius: 3px; }

.drawer-tree-nested { font-size: 13px; }
.drawer-tree-l1 { margin-bottom: 8px; }
.drawer-tree-l2 {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer; padding: 5px 8px 5px 4px;
  font-size: 12px; color: var(--text-secondary); border-radius: var(--radius);
}
.drawer-tree-l2 .tree-l2-name { flex: 1; line-height: 1.4; white-space: normal; word-break: break-word; text-align: left; }
.tree-unit-container { align-items: center !important; }
.tree-unit-container .tree-unit-name { line-height: 1.4; white-space: normal; word-break: break-word; font-weight: 600; }
.tree-container-meta { font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.tag-mini { font-size: 10px; padding: 1px 6px; }
.drawer-tree-l2 .tag-mini { margin-left: auto; flex-shrink: 0; }
.tree-l2-dot.success { background: var(--success); }
.tree-l2-dot.warning { background: var(--warning); }
.tree-l2-dot.danger { background: var(--danger); }
.tree-l2-dot.purple { background: #722ed1; }
.tree-l2-dot.default { background: #d9d9d9; }
.drawer-tree-l2:hover { background: #e8eef5; color: var(--text); }
.drawer-tree-l2.selected { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.drawer-tree-l2.missing { color: #cf1322; }
.drawer-tree-l2 .tree-branch { width: 12px; flex-shrink: 0; color: #bfbfbf; }
.drawer-tree-l2 .tree-l2-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #d9d9d9; flex-shrink: 0;
}
.drawer-tree-l2.missing .tree-l2-dot { background: var(--danger); }
.tree-unit-row.selected { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.drawer-list-hint {
  padding: 8px 14px 0; font-size: 12px; color: var(--text-secondary);
}
.l2-focus-card {
  margin: 8px; padding: 12px; border: 1px dashed var(--primary);
  border-radius: var(--radius); background: var(--primary-light);
}
.l2-focus-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.l2-focus-card-head strong { font-size: 14px; }
.l2-focus-card-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 10px; }
.l2-focus-card .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.unit-row.highlight { background: #f7faff; border-color: var(--border); box-shadow: none; }

/* —— 任务流 v2.0 —— */
.sidebar-minimal { padding-top: 8px; }
.sidebar-minimal .nav-item { font-size: 14px; padding: 12px 16px; }

.app-view { display: none; max-width: 880px; }
.app-view.active { display: block; }

.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card {
  width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.task-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(26,86,168,.12); }
.task-card-static { cursor: default; }
.task-card-static:hover { border-color: var(--border); box-shadow: var(--shadow); }
.task-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.task-card-meta { font-size: 13px; color: var(--text-secondary); }
.task-card-action { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--primary); }

.unit-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.unit-header-meta { flex: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.unit-header .page-title { margin: 0; font-size: 22px; }

.flow-stepper {
  display: flex; gap: 0; margin-bottom: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.flow-step {
  flex: 1; padding: 12px 8px; text-align: center; font-size: 12px;
  color: var(--text-secondary); border-right: 1px solid var(--border);
  position: relative;
}
.flow-step:last-child { border-right: none; }
.flow-step.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.flow-step.done { color: var(--success); }
.flow-step.done .flow-step-num::before { content: '✓ '; }
.flow-step.locked { opacity: .4; cursor: not-allowed; }
.flow-step:not(.locked) { cursor: pointer; }
.flow-step:not(.locked):hover { background: #f5f7fa; }

.flow-panel { display: none; }
.flow-panel.active { display: block; }
.flow-card { margin-bottom: 0; }
.flow-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.flow-details summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.flow-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
}

.final-checklist { list-style: none; font-size: 13px; line-height: 2; margin-top: 12px; }
.export-done { text-align: center; padding: 24px !important; }
.export-icon { font-size: 48px; color: var(--success); line-height: 1; margin-bottom: 12px; }

.settings-panel { display: none; }
.settings-panel.active { display: block; }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 480px; }

.c2-panel { display: none; }
.c2-panel.active { display: block; }

.notify-wrap { position: relative; }
.notify-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  width: 300px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 100;
}
.notify-panel.open { display: block; }
.notify-panel-header { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--border); font-size: 13px; }
.notify-item {
  display: block; width: 100%; text-align: left; padding: 12px 14px;
  border: none; background: none; font-family: inherit; font-size: 13px;
  cursor: pointer; border-bottom: 1px solid var(--border);
}
.notify-item:hover { background: #f5f7fa; }
.notify-item.unread { background: var(--primary-light); }
.notify-time { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* —— v5.0 客户门户 · 顶栏 IA + 工作抽屉 —— */
.top-tabs {
  display: flex; align-items: center; gap: 4px; margin-left: 24px;
}
.top-tab {
  background: transparent; border: none; color: rgba(255,255,255,.72);
  padding: 8px 16px; border-radius: var(--radius); font-size: 14px;
  font-family: inherit; cursor: pointer; font-weight: 500;
}
.top-tab:hover { background: rgba(255,255,255,.1); color: #fff; }
.top-tab.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }

.main-area {
  flex: 1; overflow-y: auto; padding: 24px 28px 48px;
  max-width: 1200px; width: 100%; margin: 0 auto;
}
.view { display: none; }
.view.active { display: block; }
.page-head { margin-bottom: 20px; }

.progress-cards {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px;
}
.progress-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 12px; text-align: center; cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.progress-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.progress-card-star { border-color: #ffa39e; background: #fff2f0; }
.progress-num { display: block; font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.progress-label { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.progress-hint { font-size: 12px; color: var(--text-secondary); margin-bottom: 20px; }

.role-todo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.role-todo-row:last-child { border-bottom: none; }

.reg-bar {
  display: grid; grid-template-columns: 88px 1fr 48px; gap: 12px; align-items: center;
  margin-bottom: 10px; font-size: 13px;
}
.bar-track { height: 8px; background: #e8eef5; border-radius: 4px; overflow: hidden; }
.bar-track .bar-fill { height: 100%; background: var(--primary); border-radius: 4px; }

.matrix-table .matrix-l1-row td { background: #f7f9fc; font-weight: 500; }
.matrix-table .matrix-rollup-cell { color: var(--text-secondary); font-size: 13px; }
.matrix-table .matrix-review-row .matrix-indent { padding-left: 20px; color: var(--text-secondary); font-size: 13px; }

.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-bottom: 16px;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.seg-control { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.seg-control .seg {
  border: none; background: var(--surface); padding: 6px 12px; font-size: 12px;
  cursor: pointer; font-family: inherit; color: var(--text-secondary);
}
.seg-control .seg.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.rank-tip { margin-bottom: 16px; }
.text-muted { color: var(--text-secondary); font-size: 12px; }
.text-secondary { color: var(--text-secondary); }
.org-import-zone-text { display: block; line-height: 1.5; }

.sys-panel { display: none; }
.sys-panel.active { display: block; }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* 系统页 · 分段 Tab */
.sys-tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 24px;
  background: #eef2f7; border-radius: 10px; border: 1px solid var(--border);
}
.sys-tab {
  appearance: none; border: none; background: transparent;
  padding: 10px 22px; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--text-secondary);
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.sys-tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.55); }
.sys-tab.active {
  background: var(--surface); color: var(--primary); font-weight: 600;
  box-shadow: 0 1px 4px rgba(15,45,82,.1);
}
.sys-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.form-grid { display: grid; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; color: var(--text-secondary); }

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,45,82,.35); z-index: 900;
}
.work-drawer {
  position: fixed; top: 0; right: 0; width: min(960px, 58vw); height: 100vh;
  background: var(--surface); box-shadow: -8px 0 32px rgba(0,0,0,.15);
  z-index: 950; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.work-drawer.open { transform: translateX(0); }
.drawer-main {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.work-drawer.mode-list #unit-panel { display: none !important; }
.work-drawer.mode-unit #drawer-list-view { display: none !important; }
.work-drawer.mode-unit .status-chips { flex-shrink: 0; }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-title { font-size: 18px; font-weight: 600; margin: 0; }
.drawer-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.drawer-close {
  background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer;
  color: var(--text-secondary); padding: 0 4px;
}
.status-chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.status-chip {
  border: 1px solid var(--border); background: #f5f7fa; border-radius: 20px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.status-chip em { font-style: normal; font-weight: 700; margin-left: 4px; color: var(--primary); }
.status-chip.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.status-chip.star { border-color: #ffa39e; }

.drawer-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.drawer-split { display: grid; grid-template-columns: minmax(240px, 280px) 1fr; flex: 1; min-height: 0; overflow: hidden; }
.drawer-tree {
  border-right: 1px solid var(--border); padding: 12px 10px; overflow-y: auto; background: #fafbfc;
}
.tree-dep-row { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin: 8px 0 4px; }
.tree-unit-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 13px;
  border-radius: var(--radius); cursor: pointer;
}
.tree-unit-row:hover { background: #e8eef5; }
.tree-dot { width: 8px; height: 8px; border-radius: 50%; background: #d9d9d9; flex-shrink: 0; }
.tree-dot.warning { background: var(--warning); }
.tree-dot.purple { background: #722ed1; }
.tree-dot.success { background: var(--success); }
.tree-dot.danger { background: var(--danger); }

.drawer-units { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.drawer-units-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px;
}
.drawer-count { color: var(--text-secondary); }
.unit-list { flex: 1; overflow-y: auto; padding: 8px; }
.unit-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; background: var(--surface);
}
.unit-row-action { display: flex; justify-content: flex-end; flex-shrink: 0; }
.btn-unit-action {
  min-width: 72px; width: 72px; padding-left: 0; padding-right: 0;
  text-align: center; justify-content: center;
}
.unit-row-hint {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 72px; font-size: 12px; color: var(--text-secondary);
}
.unit-row-check { display: flex; align-items: center; }
.unit-row-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0;
}
.unit-row-main strong { display: inline; font-weight: 600; line-height: 1.4; margin-bottom: 0; }
.unit-row-meta { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

.batch-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: #f5f7fa; flex-shrink: 0;
}

.unit-panel {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.unit-panel-top {
  flex-shrink: 0; padding: 12px 20px 0; background: var(--surface);
  border-bottom: 1px solid var(--border); z-index: 2;
}
.unit-panel-scroll {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px;
}
.unit-panel-head { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.unit-panel-head h3 { margin: 0; font-size: 18px; flex: 1; }

.modal-overlay { z-index: 1100; }
.work-drawer .flow-stepper { margin-bottom: 0; }
.work-drawer .flow-footer {
  flex-shrink: 0; padding: 12px 20px 16px; border-top: 1px solid var(--border); background: #fafbfc;
}

/* FR-11/12/18 看结论 · 溯源 */
.issue-section { margin: 20px 0 0; }
.issue-section-title { font-size: 14px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.benchmark-note { font-size: 12px; font-weight: 400; color: var(--text-secondary); font-style: normal; }
.issue-table .excerpt { font-size: 12px; color: var(--text-secondary); max-width: 220px; }
.audit-trail-block { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.benchmark-panel { margin-bottom: 16px; }
.benchmark-footnote { padding: 0 16px 12px; }

.trace-backdrop {
  position: fixed; inset: 0; background: rgba(15,45,82,.25); z-index: 980;
}
.trace-drawer {
  position: fixed; top: 0; right: 0; width: min(480px, 92vw); height: 100vh;
  background: var(--surface); box-shadow: -8px 0 24px rgba(0,0,0,.12);
  z-index: 990; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.trace-drawer.open { transform: translateX(0); }
.trace-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.trace-drawer-head h3 { margin: 0; font-size: 16px; }
.trace-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.trace-title { font-weight: 600; margin: 0 0 16px; }
.trace-dl { margin: 0; font-size: 13px; }
.trace-dl dt { color: var(--text-secondary); font-size: 11px; margin-top: 12px; }
.trace-dl dd { margin: 4px 0 0; }
.trace-dl code { background: #f5f7fa; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.upload-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px;
  text-align: center; color: var(--text-secondary); cursor: pointer; background: #fafbfc;
}
.upload-dropzone input { display: none; }
.upload-dropzone:hover { border-color: var(--primary); color: var(--primary); }

.report-preview-body { max-height: min(70vh, 680px); overflow-y: auto; font-size: 14px; line-height: 1.7; }
.report-preview-body .data-table { font-size: 13px; }
.report-preview-body .data-table th,
.report-preview-body .data-table td { padding: 8px 12px; white-space: nowrap; }
/* 自评再评价打分表：须正常换行，不可继承预览区 nowrap */
.report-preview-body .report-reeval-table th,
.report-preview-body .report-reeval-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.report-preview-body h4 { margin: 0 0 12px; }
.report-preview-body > h5,
.report-preview-body > p + h5 { margin: 16px 0 8px; font-size: 14px; }

/* 预决算分析摘要 · 长文排版 */
.report-preview-body.report-preview-finance {
  font-size: 15px;
  line-height: 1.78;
  padding: 12px 32px 28px;
  max-height: min(78vh, 780px);
  background: #fafbfc;
}
.report-preview-finance .report-doc-finance {
  max-width: 840px;
  margin: 0 auto;
  line-height: 1.78;
  color: var(--text);
}
.report-preview-finance .report-doc-finance .report-doc-head {
  margin-bottom: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.report-preview-finance .report-doc-finance .report-doc-head h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.5;
  color: var(--text);
}
.report-preview-finance .report-doc-finance .report-meta {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.report-preview-finance .report-doc-finance .report-section {
  margin: 0;
  padding: 0;
}
.report-preview-finance .report-doc-finance h5 {
  font-size: 16px;
  font-weight: 600;
  margin: 32px 0 14px;
  padding: 0 0 0 12px;
  border-left: 3px solid var(--primary);
  line-height: 1.45;
  color: var(--text);
}
.report-preview-finance .report-doc-finance .report-section > h5:first-child,
.report-preview-finance .report-doc-finance > .report-section:first-child > h5:first-child {
  margin-top: 8px;
}
.report-preview-finance .report-doc-finance h6 {
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 10px;
  line-height: 1.5;
  color: var(--text);
}
.report-preview-finance .report-doc-finance p {
  margin: 0 0 14px;
  text-align: justify;
  text-justify: inter-ideograph;
}
.report-preview-finance .report-doc-finance p strong {
  font-weight: 600;
}
.report-preview-finance .report-doc-finance .data-table {
  font-size: 14px;
  margin: 14px 0 18px;
  width: 100%;
  border-collapse: collapse;
}
.report-preview-finance .report-doc-finance .data-table th,
.report-preview-finance .report-doc-finance .data-table td {
  padding: 10px 14px;
  white-space: normal;
  line-height: 1.55;
  vertical-align: top;
  border: 1px solid var(--border);
}
.report-preview-finance .report-doc-finance .data-table th {
  background: #f0f4f9;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.report-preview-finance .report-doc-finance .data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}
.report-preview-finance .report-doc-finance .report-footnote {
  font-size: 12px;
  margin-top: 36px;
  padding-top: 14px;
  line-height: 1.6;
}
.report-preview-body .report-tree-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-preview-body .report-tree-table .tree-code {
  color: var(--text-secondary); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums;
}
.report-preview-body .report-tree-table .tree-depth-0 td:first-child { padding-left: 8px; }
.report-preview-body .report-tree-table .tree-depth-1 td:first-child { padding-left: 28px; }
.report-preview-body .report-tree-table .tree-depth-2 td:first-child { padding-left: 48px; }
.report-preview-body .report-tree-table .tree-depth-3 td:first-child { padding-left: 68px; }
.report-table-fold {
  margin: 10px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.report-table-fold summary {
  padding: 10px 12px; font-weight: 600; cursor: pointer; background: #fafafa; list-style: none;
}
.report-table-fold summary::-webkit-details-marker { display: none; }
.report-table-fold .report-fold-body { padding: 8px 12px 12px; overflow-x: auto; }
.report-attach-group { font-size: 13px; font-weight: 600; margin: 18px 0 8px; color: var(--text-secondary); }

.report-reeval-scroll { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.report-reeval-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.report-table.report-reeval-table { min-width: 680px; }
.report-reeval-table th,
.report-reeval-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
  hyphens: auto;
}
.report-reeval-table .col-content { width: 16%; }
.report-reeval-table .col-standard { width: 36%; font-size: 12px; line-height: 1.55; }
.report-reeval-table .col-score { width: 8%; text-align: center; font-weight: 600; white-space: nowrap; }
.report-reeval-table .col-reason { width: 32%; font-size: 12px; line-height: 1.5; }
.report-reeval-table .col-trace { width: 8%; text-align: center; vertical-align: middle; }
.reeval-content-label {
  display: block;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.reeval-standard-text { display: block; line-height: 1.55; }
.score-confirm-scroll { overflow-x: auto; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.score-confirm-table.report-reeval-table { min-width: 760px; }
.score-confirm-table .col-standard { font-size: 11px; line-height: 1.5; }

/* 确认分 / 扣分理由 / 溯源：与行高对齐的操作列 */
.score-confirm-table tbody td.col-score-system,
.score-confirm-table tbody td.col-score-edit,
.score-confirm-table tbody td.col-reason,
.score-confirm-table tbody td.col-trace {
  padding: 0;
  height: 1px;
  vertical-align: middle;
  word-break: normal;
  overflow-wrap: normal;
}
.score-confirm-table .reeval-system-score {
  display: block;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.score-confirm-table tbody td.col-trace {
  white-space: nowrap;
  min-width: 56px;
}
.score-confirm-table .reeval-field-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 100%;
  height: 100%;
  padding: 8px 10px;
}
.score-confirm-table .reeval-field-wrap--center {
  align-items: center;
  justify-content: center;
}
.score-confirm-table .reeval-reason-wrap {
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  min-height: 100%;
  height: 100%;
  padding: 8px 10px;
}
.score-confirm-table .reeval-score-input {
  width: 52px;
  max-width: 100%;
  height: 28px;
  margin: 0;
  padding: 2px 6px;
  line-height: 1.2;
  font-size: 13px;
  flex-shrink: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.score-confirm-table .reeval-score-input::-webkit-outer-spin-button,
.score-confirm-table .reeval-score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.score-confirm-table .reason-input {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 28px;
  height: 100%;
  margin: 0;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: none;
  overflow: auto;
  box-sizing: border-box;
  font-family: inherit;
}
.score-confirm-table .reeval-trace-btn {
  white-space: nowrap;
  flex-shrink: 0;
  writing-mode: horizontal-tb;
  padding: 4px 10px;
  line-height: 1.25;
}
.flow-panel .report-reeval-table th,
.flow-panel .report-reeval-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.report-doc-head-center { text-align: center; border-bottom: none; }
.report-sheet-title { font-size: 18px; font-weight: 700; margin: 0; line-height: 1.5; }
.report-sheet-title-block { text-align: center; font-weight: 600; line-height: 1.6; margin: 12px 0 16px; }
.report-sheet-unit { margin: 16px 0 12px; font-size: 14px; }
.report-sheet-sign { margin-top: 24px; font-size: 14px; }
.report-section-attach { margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--border); }
.report-summary-table th { text-align: center; white-space: nowrap; }
.report-summary-table td:nth-child(1),
.report-summary-table td:nth-child(3),
.report-summary-table td:nth-child(4),
.report-summary-table td:nth-child(5),
.report-summary-table td:nth-child(6) { text-align: center; }

.grade-pie-block {
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px;
  margin: 12px 0 16px; padding: 16px; background: #f8fafc; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.grade-pie-figure { margin: 0; flex: 0 0 auto; text-align: center; }
.grade-pie-svg { width: 160px; height: 160px; display: block; }
.grade-pie-caption { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }
.grade-pie-legend {
  list-style: none; margin: 0; padding: 0; flex: 1 1 220px; min-width: 200px;
}
.grade-pie-legend-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.grade-pie-legend-item:last-child { border-bottom: none; }
.grade-pie-legend-item.is-zero { opacity: 0.45; }
.grade-pie-swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.grade-pie-legend-label { min-width: 48px; font-weight: 500; }
.grade-pie-legend-val { color: var(--text-secondary); }
.grade-delta-cell { white-space: nowrap; }
.grade-delta-score { margin-left: 6px; font-size: 13px; font-weight: 600; }
.tag-grade-up { background: #e8f5e9; color: #2d8f5e; border: 1px solid #b7dfbf; }
.tag-grade-down { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.tag-grade-flat { background: #f0f0f0; color: #666; border: 1px solid #ddd; }
.tag-grade-none { background: #fafafa; color: #999; border: 1px solid #eee; }
.report-grade-compare-table td:nth-child(6) { text-align: center; }

.report-doc-head { margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.report-doc-head h4 { font-size: 16px; margin: 0 0 8px; line-height: 1.4; }
.report-meta { font-size: 12px; color: var(--text-secondary); margin: 0; }
.report-section { margin: 20px 0; }
.report-section h5 { font-size: 14px; font-weight: 600; margin: 0 0 10px; color: var(--text); }
.report-section p { margin: 0 0 10px; }
.report-muted { color: var(--text-secondary); font-size: 12px; }
.report-list { margin: 8px 0 0; padding-left: 20px; }
.report-list li { margin-bottom: 6px; }
.report-list-compact { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.report-list-compact li { margin-bottom: 4px; }
.report-callout {
  border-left: 3px solid var(--primary); background: #f5f9ff;
  padding: 10px 12px; margin: 10px 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.report-callout-warn { border-left-color: #faad14; background: #fffbe6; }
.report-score-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 12px 0;
}
.report-score-cell,
.report-score-card {
  background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; text-align: center;
}
.report-score-cell .label,
.report-score-card .label { display: block; font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.report-score-cell strong,
.report-score-card strong { font-size: 18px; }
.report-score-card .hint { display: block; font-size: 10px; color: var(--text-secondary); margin-top: 4px; }
.report-score-card.primary { border-color: var(--primary); background: #f0f7ff; }
.report-subtitle { font-size: 15px; font-weight: 600; margin: 4px 0 8px; color: var(--text); }
.report-lead { font-size: 14px; line-height: 1.75; margin-bottom: 20px; text-indent: 2em; }
.report-section h6 { font-size: 13px; font-weight: 600; margin: 14px 0 8px; color: var(--text); }
.report-footnote { margin-top: 24px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 11px; color: var(--text-secondary); }
.report-status-done { color: #52c41a; font-weight: 500; }
.report-status-warn { color: #faad14; font-weight: 500; }
.report-status-pending { color: #999; }
.report-row-deducted { background: #fff7e6; }
.report-row-total { background: #f0f7ff; font-weight: 600; }
.report-table tbody tr:hover { background: #fafbfc; }
.report-table tbody tr.report-row-deducted:hover { background: #fff3d6; }

.unit-row-no-check .unit-row-main { margin-left: 0; }

.role-switch-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 400; }
.alert-warning { background: #fffbe6; border: 1px solid #ffe58f; padding: 10px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; }

/* P-C-ANALYTICS · PB-10 */
.top-tab-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  border-radius: 3px;
  background: rgba(255, 193, 7, 0.25);
  color: #ffe58f;
  vertical-align: middle;
}
.analytics-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.analytics-filter-bar { flex-wrap: wrap; }
.analytics-source { margin: -8px 0 16px; padding: 0 4px; }
.analytics-summary { font-size: 14px; line-height: 1.65; color: var(--text); }
.analytics-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.analytics-chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.analytics-chart-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.swatch-budget { background: #91caff; }
.swatch-final { background: var(--primary); }
.analytics-bar-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  min-height: 160px;
  padding: 8px 4px 0;
}
.analytics-bar-group { flex: 1; text-align: center; min-width: 48px; }
.analytics-bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 140px;
}
.analytics-bar-wrap {
  width: 28px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: #f5f7fa;
  border-radius: 3px 3px 0 0;
}
.analytics-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; }
.analytics-bar-budget { background: #91caff; }
.analytics-bar-final { background: var(--primary); }
.analytics-bar-label { display: block; margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.analytics-mini-line { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.analytics-mini-line-title { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.analytics-line-svg { width: 100%; height: 72px; display: block; }
.analytics-line-x { position: relative; height: 18px; font-size: 11px; color: var(--text-secondary); }
.analytics-line-x span { position: absolute; transform: translateX(-50%); }
.analytics-line-dot { fill: var(--primary); }
.analytics-subtitle { font-size: 13px; font-weight: 600; margin: 0 0 12px; }
.analytics-cross-grid { display: flex; flex-direction: column; gap: 20px; }
.analytics-cross-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  min-height: 136px;
  padding-bottom: 0;
}
.analytics-cross-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 88px;
}
.analytics-cross-item.analytics-bar-highlight .analytics-cross-bar { background: #fa8c16; }
.analytics-cross-bar-wrap {
  flex-shrink: 0;
  height: 88px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 36px;
  background: #f5f7fa;
  border-radius: 4px 4px 0 0;
}
.analytics-cross-bar-score .analytics-cross-bar { background: #52c41a; }
.analytics-cross-bar-rate .analytics-cross-bar { background: #13c2c2; }
.analytics-cross-bar { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 6px; }
.analytics-cross-foot {
  flex-shrink: 0;
  width: 100%;
  min-height: 46px;
  max-height: 46px;
  padding-top: 6px;
  text-align: center;
  overflow: hidden;
}
.analytics-cross-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-all;
}
.analytics-cross-val { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analytics-solo-group { font-size: 13px; line-height: 1.6; }
.analytics-solo-group .footnote { margin-top: 12px; }
.analytics-anomaly-note { margin-bottom: 12px; }
.analytics-eco-details { margin-top: 16px; }
.analytics-scope-seg .seg[disabled] { opacity: 0.55; cursor: not-allowed; }

.analytics-structure-grid { display: flex; flex-direction: column; gap: 16px; }
.analytics-kpi-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px 16px;
  margin: 0;
}
.analytics-kpi-dl > div { min-width: 0; }
.analytics-kpi-dl dt { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.analytics-kpi-dl dd { margin: 0; font-size: 14px; }
.analytics-kpi-dl dd strong { font-size: 16px; color: var(--text); }
.analytics-kpi-hint { display: block; font-size: 10px; color: var(--text-secondary); margin-top: 2px; font-weight: 400; }
.analytics-structure-bar {
  display: flex;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}
.analytics-structure-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.analytics-structure-basic { background: var(--primary); }
.analytics-structure-project { background: #722ed1; }

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  min-height: 520px;
}
.analytics-main-col {
  padding: 12px 16px;
  min-width: 0;
  overflow-y: auto;
}
.analytics-tree-col {
  min-height: 480px;
  padding: 8px 10px;
}
.analytics-l1-row {
  cursor: default;
  background: #f3f4f6;
  border-style: dashed;
}
.analytics-l1-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 10px;
  min-width: 0;
}
.analytics-l1-tag { align-self: flex-start; font-size: 11px; }
.analytics-node-muted { opacity: 0.72; }
.analytics-empty-state {
  padding: 48px 24px;
  text-align: center;
}
.analytics-empty-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.trace-actions { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

@media (max-width: 1024px) {
  .progress-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .drawer-split { grid-template-columns: 1fr; }
  .drawer-tree { max-height: 140px; border-right: none; border-bottom: 1px solid var(--border); }
  .lib-layout { grid-template-columns: 1fr; }
  .lib-tree-col { max-height: 180px; border-right: none; border-bottom: 1px solid var(--border); }
  .analytics-grid-2 { grid-template-columns: 1fr; }
  .analytics-layout { grid-template-columns: 1fr; }
  .analytics-tree-col { max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 768px) {
  .top-tabs { display: none; }
  .progress-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

