/* ============================================================
   全站视觉统一层（2026-11-22）
   加载顺序：base.html 中位于各页面 extra_head 之后，用于覆盖页面内联
   样式中的零散不一致；不改变布局结构与 data-action 契约。
   ============================================================ */
:root {
  --ui-card-radius: 14px;
  --ui-card-shadow: 0 1px 2px rgba(15, 23, 42, .04),
    0 10px 28px -24px rgba(15, 23, 42, .28);
  --ui-card-shadow-hover: 0 2px 4px rgba(15, 23, 42, .05),
    0 16px 36px -26px rgba(15, 23, 42, .32);
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: var(--bg-base); }

/* 应用壳层：内容区顶部轻微蓝色光晕，避免整页纯灰显得发平 */
.app-main {
  background:
    radial-gradient(1100px 420px at 88% -12%, rgba(0, 115, 255, .055), transparent 62%),
    var(--bg-base);
}
.app-navbar { box-shadow: 0 1px 0 rgba(15, 23, 42, .035); }
.app-sidebar { box-shadow: 1px 0 0 rgba(15, 23, 42, .025); }
.side-nav-item { border-radius: 8px; }
.side-nav-item.active { box-shadow: inset 0 0 0 1px rgba(0, 115, 255, .08); }

/* 页面标题行：统一成轻量介绍卡，让每页开头不像裸文字 */
:is(.schemes-head, .review-header, .stats-head) {
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background:
    linear-gradient(120deg, var(--bg-card) 0%, var(--bg-card) 62%, rgba(0, 115, 255, .045) 100%);
  box-shadow: var(--ui-card-shadow);
}
:is(.schemes-head, .review-header) { align-items: center; }
:is(.schemes-title, .review-title, .stats-heading) { letter-spacing: -.02em; }
:is(.schemes-sub, .review-desc, .stats-sub, .new-review-header p) {
  color: var(--text-secondary);
  line-height: 1.6;
}
.new-review-header h1 { letter-spacing: -.015em; }

/* 卡片语言：统一圆角、阴影和交互过渡 */
:is(.project-group, .list-panel, .inspector, .ov-card, .chart-card,
    .token-card, .section-card, .quick-card, .step-content,
    .review-scope-card, .project-card, .template-grid .tpl-card) {
  border-radius: var(--ui-card-radius);
  box-shadow: var(--ui-card-shadow);
}
:is(.quick-card, .project-card, .tpl-card) {
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out),
    border-color .18s var(--ease-out);
}
:is(.quick-card, .project-card, .tpl-card):hover {
  transform: translateY(-2px);
  box-shadow: var(--ui-card-shadow-hover);
}
:is(.list-panel, .inspector, .chart-card, .section-card, .step-content) {
  border-color: var(--border);
}

/* 列表/表格：表头更轻、行悬停统一为主色浅底 */
:is(.scheme-table, .company-table, .token-table) thead th,
.table-head {
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: .72rem;
  letter-spacing: .015em;
}
:is(.scheme-table, .company-table, .token-table) thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
:is(.scheme-table, .company-table, .token-table) tbody tr,
.task-row { transition: background .15s ease; }
:is(.scheme-table, .company-table, .token-table) tbody tr:hover td,
.task-row:hover { background: var(--primary-light); }
:is(.scheme-table, .company-table, .token-table) td { border-color: var(--border-light); }
.table-head { border-bottom-color: var(--border-light); }

/* 筛选区：从一条裸输入升级为统一工具条 */
.search-bar,
.filter-strip {
  border-radius: 12px;
  box-shadow: var(--ui-card-shadow);
}
.search-bar input,
.search-bar select,
.filter-strip .field,
.filter-strip input,
.filter-strip select { border-radius: 9px; }
.search-bar input:focus,
.search-bar select:focus,
.filter-strip .field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 状态徽章与操作按钮：统一触感 */
.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: .005em;
  white-space: nowrap;
}
.badge--ok { color: #15803d; background: rgba(22, 163, 74, .08); border-color: rgba(22, 163, 74, .2); }
.badge--warn { color: #b45309; background: rgba(245, 158, 11, .09); border-color: rgba(245, 158, 11, .24); }
.badge--bad { color: #b91c1c; background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .22); }
.badge--info { color: #1d4ed8; background: rgba(37, 99, 235, .08); border-color: rgba(37, 99, 235, .2); }
.badge--neutral { color: var(--text-secondary); background: var(--bg-base); border-color: var(--border); }
:root[data-theme="dark"] .badge--ok { color: #6ee7b7; background: rgba(16, 185, 129, .14); }
:root[data-theme="dark"] .badge--warn { color: #fbbf24; background: rgba(245, 158, 11, .14); }
:root[data-theme="dark"] .badge--bad { color: #fca5a5; background: rgba(239, 68, 68, .14); }
:root[data-theme="dark"] .badge--info { color: #93c5fd; background: rgba(59, 130, 246, .14); }
:is(.btn-sm, .btn-sb, .review-new-btn, .token-btn, .btn-step, .btn-nav,
    .filter-reset, .toolbar-btn) {
  border-radius: 9px !important;
  transition: transform .15s ease, box-shadow .15s ease,
    background-color .15s ease, border-color .15s ease;
}
:is(.btn-sm, .btn-sb, .review-new-btn, .btn-step, .btn-nav):active {
  transform: translateY(1px);
}
:is(.btn-sm.primary, .btn-sb.primary, .review-new-btn):hover {
  box-shadow: 0 6px 16px -8px var(--primary-glow);
}

/* 首页 */
.dash-page { width: 100%; max-width: 1280px !important; }
.hero {
  border-radius: 20px;
  box-shadow: 0 18px 44px -26px rgba(0, 82, 204, .55) !important;
}
.hero h1 { letter-spacing: -.025em !important; }
.sec-title { margin: 22px 0 14px; }
.sec-title h2 { font-size: 1.02rem; letter-spacing: -.01em; }
.quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 14px !important; }
.quick-card { padding: 20px 20px 18px !important; }
.quick-card h3 { letter-spacing: -.005em; }
.hero .h-actions .icon-inline svg { width: 16px; height: 16px; }
@media (max-width: 1100px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
  .quick-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .hero .h-actions { flex-wrap: wrap; }
  .create-page-head { flex-direction: column; align-items: flex-start; }
}

/* 方案管理 */
.schemes-wrap { padding-top: 22px !important; }
.schemes-actions :is(.btn-sm) { min-height: 34px; }
.scheme-tab { transition: color .15s ease, border-color .15s ease; }
.scheme-tab:hover { color: var(--primary) !important; }
.project-group { overflow: hidden; }
.project-group .scheme-table { border-radius: 0; }

/* 方案审核 */
.review-wrap { padding-top: 22px !important; }
.task-row { padding-top: 12px; padding-bottom: 12px; }
.row-status { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
@media (min-width: 901px) {
  .table-head,
  .task-row { grid-template-columns: 22px minmax(0, 1fr) 118px 92px 30px; }
}
.task-row.is-active { box-shadow: inset 3px 0 0 var(--primary); }
.inspector-head { background: var(--bg-base); }
.inspector-body { background: var(--bg-card); }
.review-empty,
.insp-empty { color: var(--text-secondary); }

/* 数据统计 */
.stats-page { padding-top: 22px !important; }
.ov-card { padding: 14px 16px !important; }
.ov-card:hover { box-shadow: var(--ui-card-shadow-hover); }
.stats-overview .ov-card:not(.token-cell) {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas: "icon num" "icon label";
  align-items: center;
  column-gap: 10px;
  min-height: 68px;
}
.stats-overview .ov-card:not(.token-cell) .ov-icon {
  grid-area: icon;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 10px;
}
.stats-overview .ov-card:not(.token-cell) .ov-num { grid-area: num; font-size: 1.35rem; }
.stats-overview .ov-card:not(.token-cell) .ov-label { grid-area: label; margin: 0; }
.chart-card { padding: 16px 18px !important; }
.chart-card > h3,
.chart-card > .chart-head { letter-spacing: -.005em; }

/* 公司管理 */
.companies-wrap { width: 100%; max-width: 1280px !important; padding-top: 22px !important; }
.page-hero {
  border-radius: 20px !important;
  box-shadow: 0 18px 44px -28px rgba(0, 82, 204, .55) !important;
}
.section-card { padding: 22px 24px 24px !important; }
.section-actions { margin-bottom: 14px; }

/* 新建方案 / 新建审核向导 */
.create-wrap,
.new-review-wrap { max-width: 780px !important; }
.create-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background:
    linear-gradient(120deg, var(--bg-card) 0%, var(--bg-card) 62%, rgba(0, 115, 255, .045) 100%);
  box-shadow: var(--ui-card-shadow);
}
.create-page-head h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.015em;
}
.create-page-head h1 .icon-inline svg { width: 20px; height: 20px; color: var(--primary); }
.create-page-head p { margin: 0; color: var(--text-secondary); font-size: .82rem; line-height: 1.6; }
.create-page-head .btn-sm {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}
.create-page-head .btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.create-wrap .steps-bar {
  margin-bottom: 18px !important;
  padding: 18px 20px !important;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--ui-card-shadow);
}
.new-review-header {
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background:
    linear-gradient(120deg, var(--bg-card) 0%, var(--bg-card) 62%, rgba(0, 115, 255, .045) 100%);
  box-shadow: var(--ui-card-shadow);
}
.step-content {
  padding: 34px 36px !important;
  border-radius: 18px !important;
}
.step-panel { border-radius: 16px !important; }
.step-panel-title { letter-spacing: -.01em; }
.btn-step { min-height: 36px; padding-left: 16px; padding-right: 16px; }
.project-card { background: var(--bg-card) !important; }
.project-card.selected { box-shadow: 0 0 0 3px var(--primary-light); }

/* 工作台：只统一面板边界与工具条，不动三栏宽度 */
.workspace-page .panel-header,
.workspace-page .ws-toolbar,
.workspace-page .section-breadcrumb {
  background: var(--bg-card);
}
.workspace-page .ws-panel-left,
.workspace-page .ws-panel-center,
.workspace-page .ws-panel-right {
  border-color: var(--border);
}
.workspace-page .panel-header { letter-spacing: -.005em; }

/* 深色模式补充 */
:root[data-theme="dark"] .app-main {
  background:
    radial-gradient(1100px 420px at 88% -12%, rgba(0, 115, 255, .10), transparent 62%),
    var(--bg-base);
}
:root[data-theme="dark"] :is(.scheme-table, .company-table, .token-table) thead th,
:root[data-theme="dark"] .table-head,
:root[data-theme="dark"] .inspector-head { background: var(--bg-base); }
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .page-hero { box-shadow: 0 18px 44px -28px rgba(0, 0, 0, .8) !important; }
:root[data-theme="dark"] :is(.schemes-head, .review-header, .stats-head, .new-review-header) {
  background: linear-gradient(120deg, var(--bg-card) 0%, var(--bg-card) 70%, rgba(0, 115, 255, .10) 100%);
}
:root[data-theme="dark"] .qc-icon.blue { background: rgba(0, 115, 255, .18); color: #93c5fd; }
:root[data-theme="dark"] .qc-icon.green { background: rgba(16, 185, 129, .16); color: #6ee7b7; }
:root[data-theme="dark"] .qc-icon.orange { background: rgba(255, 140, 0, .16); color: #fdba74; }
:root[data-theme="dark"] .qc-icon.purple { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
:root[data-theme="dark"] .qc-icon.teal { background: rgba(14, 165, 160, .18); color: #5eead4; }
:root[data-theme="dark"] .qc-icon.rose { background: rgba(232, 70, 108, .18); color: #fda4af; }
:root[data-theme="dark"] .qc-icon.amber { background: rgba(212, 137, 10, .18); color: #fcd34d; }
:root[data-theme="dark"] .qc-icon.indigo { background: rgba(85, 104, 232, .2); color: #a5b4fc; }
:root[data-theme="dark"] .super-banner {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .32);
}
:root[data-theme="dark"] .super-banner .sb-text h3 { color: #fbbf24; }
:root[data-theme="dark"] .super-banner .sb-text p { color: #fcd34d; }
:root[data-theme="dark"] .sb-link {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(245, 158, 11, .3);
  color: var(--text-primary);
}
:root[data-theme="dark"] .review-quota-banner {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .32);
  color: #fcd34d;
}
:root[data-theme="dark"] .review-quota-banner strong { color: #fbbf24; }

/* ── 工作台：资源配置入口（从拥挤的方案头移到底部生成区） ── */
.ws-generate-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.ws-resource-confirm-btn {
  color: #7c3aed !important;
  border-color: rgba(124, 58, 237, .45) !important;
  background: rgba(124, 58, 237, .06) !important;
}
.ws-resource-confirm-btn:hover {
  border-color: #7c3aed !important;
  background: rgba(124, 58, 237, .10) !important;
}

/* ── 资源配置确认弹窗 ─────────────────────────────── */
#resource-confirm-modal .rc2-modal-box {
  width: min(1240px, 97vw);
  max-width: 1240px;
  /* 必须给出确定高度：只写 max-height 时，flex 子项的可用高度可能解析成
     auto，长内容不会在 body 内滚动，而是把页签顶出可视区。 */
  height: min(90vh, 900px);
  max-height: 90vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
}
#resource-confirm-modal .rc2-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-light);
  background:
    linear-gradient(120deg, var(--bg-card) 0%, var(--bg-card) 65%, rgba(0, 115, 255, .045) 100%);
}
#resource-confirm-modal .rc2-modal-head .modal-title { margin: 0; }
.rc2-modal-sub {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: .78rem;
  line-height: 1.55;
}
.rc2-close { flex-shrink: 0; }

/* 分区页签：概览常驻，四个编辑区按需切换，避免一个弹窗里滚到底。 */
.rc2-tabbar {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 7px 20px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}
.rc2-tabbar:empty { display: none; }
.rc2-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px 9px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: .76rem;
  white-space: nowrap;
  cursor: pointer;
}
.rc2-tab svg { width: 14px; height: 14px; }
.rc2-tab b {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-base);
  color: var(--text-muted);
  font-size: .64rem;
  font-weight: 650;
  text-align: center;
}
.rc2-tab:hover { color: var(--text-primary); }
.rc2-tab.is-active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 650;
}
.rc2-tab.is-active b { background: var(--primary-light); color: var(--primary); }
.rc2-tab-warn { width: 13px !important; height: 13px !important; color: #d97706; }
.rc2-tab-warn.hidden { display: none; }

.rc2-coverage {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-card);
}
.rc2-cover-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 190px;
  flex: 0 1 250px;
  color: var(--text-secondary);
  font-size: .69rem;
}
.rc2-cover-item b { color: var(--text-primary); font-size: .71rem; white-space: nowrap; }
.rc2-cover-track {
  flex: 1 1 auto;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-base);
  box-shadow: inset 0 0 0 1px var(--border-light);
}
.rc2-cover-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width .25s ease;
}
.rc2-cover-track.is-neutral i { background: linear-gradient(90deg, #64748b, #94a3b8); }
.rc2-cover-hint { color: var(--text-muted); font-size: .66rem; line-height: 1.5; }

.rc2-panels { min-height: 120px; }
.rc2-panel { display: none; }
.rc2-panel.is-active { display: block; }

.rc2-q-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.rc2-search {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 240px;
  max-width: 340px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.rc2-search svg { width: 14px; height: 14px; color: var(--text-muted); }
.rc2-search .rc2-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: none;
  box-shadow: none;
}
.rc2-q-filter { width: auto !important; min-width: 120px; }
.rc2-apply-all { white-space: nowrap; }
.rc2-table tbody tr.is-filtered { display: none; }

.rc2-row-tags {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.rc2-chip {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: .61rem;
  font-weight: 600;
  white-space: nowrap;
}
.rc2-chip.is-ok { background: rgba(22, 163, 74, .1); color: #15803d; }
.rc2-chip.is-warn { background: rgba(245, 158, 11, .13); color: #b45309; }
.rc2-chip.is-muted { background: var(--bg-base); color: var(--text-muted); }
.rc2-chip.is-info { background: rgba(37, 99, 235, .1); color: #1d4ed8; }

.rc2-combo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 2px 7px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: .65rem;
  cursor: pointer;
}
.rc2-combo-toggle:hover { border-color: var(--primary); color: var(--primary); }
.rc2-combo-toggle svg { width: 12px; height: 12px; transition: transform .15s ease; }
.rc2-combo-toggle.is-open svg { transform: rotate(90deg); }
.rc2-combo-toggle em {
  color: var(--text-muted);
  font-style: normal;
  font-size: .6rem;
}
.rc2-quota-combo.is-collapsed { display: none; }

.rc2-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 178px;
}
.rc2-param-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-muted);
  font-size: .62rem;
}
.rc2-param-grid .rc2-input { width: 100%; }

/* 横向滚动时固定工作项目列，改定额/设备时还能看到对应工作项。 */
.rc2-table thead th:first-child,
.rc2-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-card);
}
.rc2-table thead th:first-child { z-index: 3; background: var(--bg-base); }
.rc2-table tbody tr:hover td:first-child { background: #f7faff; }
:root[data-theme="dark"] .rc2-table tbody tr:hover td:first-child { background: var(--bg-hover); }
.rc2-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 16px 22px 20px;
  background: var(--bg-base);
}
.rc2-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 22px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
}
.rc2-foot-status { color: var(--text-secondary); font-size: .74rem; }
.rc2-foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rc2-loading,
.rc2-error {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: .82rem;
}
.rc2-error { color: var(--danger); }
.rc2-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr)) minmax(180px, 1.2fr);
  gap: 10px;
  margin-bottom: 12px;
}
.rc2-stat,
.rc2-state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 11px;
  background: var(--bg-card);
}
.rc2-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.rc2-stat-icon svg { width: 16px; height: 16px; }
.rc2-stat-icon.blue { color: #1d4ed8; background: rgba(37, 99, 235, .1); }
.rc2-stat-icon.amber { color: #b45309; background: rgba(245, 158, 11, .1); }
.rc2-stat-icon.green { color: #15803d; background: rgba(22, 163, 74, .1); }
.rc2-stat b {
  display: block;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.rc2-stat small,
.rc2-state small { display: block; color: var(--text-secondary); font-size: .68rem; }
.rc2-state { flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
.rc2-pill {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 650;
}
.rc2-state.is-ok .rc2-pill { color: #15803d; background: rgba(22, 163, 74, .1); }
.rc2-state.is-warn .rc2-pill { color: #b45309; background: rgba(245, 158, 11, .12); }
.rc2-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, .32);
  border-radius: 10px;
  background: rgba(245, 158, 11, .08);
  color: #92400e;
}
.rc2-alert > .icon-inline { flex-shrink: 0; }
.rc2-alert > .icon-inline svg { width: 17px; height: 17px; }
.rc2-alert strong { font-size: .8rem; }
.rc2-alert p { margin: 2px 0 0; font-size: .73rem; line-height: 1.55; }
.rc2-alert .btn-outline-sm { margin-left: auto; flex-shrink: 0; }
.rc2-section {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card);
}
.rc2-section:last-child { margin-bottom: 0; }
.rc2-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rc2-section-head h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: .84rem;
  font-weight: 700;
}
.rc2-section-head p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: .71rem;
  line-height: 1.55;
}
.rc2-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rc2-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: .68rem;
  white-space: nowrap;
}
.rc2-table-wrap {
  overflow: auto;
  max-height: 360px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
}
.rc2-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .74rem;
}
.rc2-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 9px;
  text-align: left;
  white-space: nowrap;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: .68rem;
  font-weight: 650;
  border-bottom: 1px solid var(--border-light);
}
.rc2-table td {
  padding: 7px 8px;
  vertical-align: top;
  border-top: 1px solid var(--border-light);
}
.rc2-table tbody tr:first-child td { border-top: 0; }
.rc2-table tbody tr:hover { background: rgba(0, 115, 255, .03); }
.rc2-input,
.rc2-select {
  width: 100%;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: .73rem;
  box-sizing: border-box;
}
.rc2-input:focus,
.rc2-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.rc2-table td:nth-child(1) .rc2-input { min-width: 170px; }
.rc2-table td:nth-child(2) .rc2-input { min-width: 76px; }
.rc2-table td:nth-child(3) .rc2-input { min-width: 62px; }
.rc2-table td:nth-child(4) .rc2-select { min-width: 230px; }
.rc2-table td:nth-child(5) .rc2-select { min-width: 180px; }
.rc-quota-custom,
.rc-equipment-custom { margin-top: 4px; font-size: .7rem; }
.rc2-quota-combo {
  margin-top: 5px;
  padding: 5px 6px;
  border-left: 2px solid var(--primary-light);
  background: rgba(0, 115, 255, .035);
  border-radius: 0 6px 6px 0;
}
.rc2-quota-combo-title {
  font-size: .66rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.rc2-quota-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: start;
  padding: 4px 0;
}
.rc2-quota-item + .rc2-quota-item { border-top: 1px dashed var(--border-light); }
.rc2-quota-item input[type="checkbox"] { margin-top: 4px; }
.rc2-quota-item-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc2-quota-item-head {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 4px;
}
.rc2-quota-item-head .rc2-select,
.rc2-quota-item-head .rc2-input { min-width: 0; }
.rc2-quota-item-name { font-size: .66rem; }
.rc2-quota-item-path {
  font-size: .6rem;
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc2-quota-item.is-off { opacity: .55; }
.rc2-quota-item-remove { width: 22px; height: 22px; margin-top: 3px; }
.rc2-quota-item-meta {
  font-size: .64rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.rc2-quota-item-meta .rc-quota-ratio {
  width: 54px;
  min-height: 24px;
  padding: 2px 5px;
  font-size: .66rem;
}
.rc2-quota-main-meta {
  margin-top: 4px;
  font-size: .64rem;
  color: var(--text-secondary);
}
.rc2-quota-add { margin-top: 4px; }
.rc2-quota-combo { max-height: 240px; overflow-y: auto; }
@media (max-width: 720px) {
  .rc2-quota-item-head { grid-template-columns: minmax(0, 1fr); }
}
.rc2-equip-params .rc2-input { min-width: 0; }
.rc2-row-action { width: 32px; text-align: center; }
.rc2-icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}
.rc2-icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.rc2-icon-btn.rc-danger:hover { border-color: var(--danger); color: var(--danger); }
.rc2-gap { margin-top: 3px; color: #b45309; font-size: .66rem; }
.rc2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 26px 14px;
  text-align: center;
}
.rc2-empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
}
.rc2-empty-icon svg { width: 21px; height: 21px; }
.rc2-empty strong { color: var(--text-primary); font-size: .86rem; }
.rc2-empty p { margin: 0; color: var(--text-secondary); font-size: .73rem; }
.rc2-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.rc2-empty-inline {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: .73rem;
}
.rc2-cond-list { display: flex; flex-direction: column; gap: 7px; }
.rc2-cond-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 32px;
  gap: 7px;
  align-items: start;
}
.rc2-cond-value {
  min-height: 58px;
  resize: vertical;
  line-height: 1.55;
}
.rc2-design-row { grid-template-columns: 150px minmax(0, 1fr) 110px; }
.rc2-design-row .rc2-input[readonly] {
  background: var(--bg-sidebar);
  color: var(--text-primary);
}
.rc2-risk { cursor: default; }
.rc2-risk:hover { border-color: var(--border-light); background: var(--bg-card); }
.rc2-method-grid > .rc2-alert { grid-column: 1 / -1; }
.rc2-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.rc2-method {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.rc2-method:has(input:checked) {
  border-color: rgba(0, 115, 255, .35);
  background: var(--primary-light);
}
.rc2-method input { margin-top: 3px; accent-color: var(--primary); }
.rc2-method-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc2-method-body strong { color: var(--text-primary); font-size: .79rem; line-height: 1.4; }
.rc2-method-meta { color: var(--text-secondary); font-size: .68rem; }
.rc2-method-reason { color: var(--text-secondary); font-size: .69rem; line-height: 1.5; }
.rc2-notes {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: .78rem;
  line-height: 1.55;
  resize: vertical;
}
.rc2-notes:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

:root[data-theme="dark"] .rc2-modal-head { background: linear-gradient(120deg, var(--bg-card) 0%, var(--bg-card) 68%, rgba(0, 115, 255, .1) 100%); }
:root[data-theme="dark"] .rc2-alert { background: rgba(245, 158, 11, .12); color: #fcd34d; }
:root[data-theme="dark"] .rc2-state.is-ok .rc2-pill { color: #6ee7b7; background: rgba(16, 185, 129, .14); }
:root[data-theme="dark"] .rc2-state.is-warn .rc2-pill { color: #fbbf24; background: rgba(245, 158, 11, .14); }

@media (max-width: 900px) {
  .rc2-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc2-state { grid-column: 1 / -1; }
  .rc2-cond-row { grid-template-columns: minmax(100px, .7fr) minmax(0, 1fr) 32px; }
}
@media (max-width: 640px) {
  #resource-confirm-modal .rc2-modal-head { padding: 14px 16px 12px; }
  .rc2-body { padding: 12px 16px 16px; }
  .rc2-modal-foot { padding: 10px 16px; }
  .rc2-overview { grid-template-columns: minmax(0, 1fr); }
  .rc2-state { grid-column: auto; }
  .rc2-cond-row { grid-template-columns: minmax(0, 1fr) 32px; }
  .rc2-design-row { grid-template-columns: minmax(0, 1fr); }
  .rc2-cond-row .rc-cond-value { grid-column: 1; }
  .rc2-cond-row .rc2-icon-btn { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .rc2-foot-actions { width: 100%; }
  .rc2-foot-actions .btn { flex: 1; justify-content: center; }
}


/* ── 用户与权限：权限管理弹窗 ───────────────────────────── */
#modal-permissions .perm-modal-box {
  width: min(1080px, 96vw);
  max-width: 1080px;
  max-height: 91vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
}
#modal-permissions .perm-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 17px 22px 14px;
  border-bottom: 1px solid var(--border-light);
  background:
    linear-gradient(120deg, var(--bg-card) 0%, var(--bg-card) 66%, rgba(0, 115, 255, .045) 100%);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
#modal-permissions .perm-modal-title .icon-inline {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
}
#modal-permissions .perm-modal-title .icon-inline svg { width: 16px; height: 16px; }
.perm-modal-user { color: var(--primary); font-weight: 650; }
.perm-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 18px;
  background: var(--bg-base);
}
.perm-help {
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-card);
}
.perm-help summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  color: var(--text-secondary);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.perm-help summary::-webkit-details-marker { display: none; }
.perm-help summary::after { content: "展开"; margin-left: auto; color: var(--text-muted); font-size: .68rem; font-weight: 500; }
.perm-help[open] summary::after { content: "收起"; }
.perm-help summary svg { width: 14px; height: 14px; }
.perm-help-body {
  padding: 0 12px 11px;
  color: var(--text-secondary);
  font-size: .72rem;
  line-height: 1.65;
}
.perm-help-body b { color: var(--text-primary); }
.perm-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.perm-help + .perm-section-head { border-top: 0; padding-top: 0; }
.perm-section-head > div { min-width: 0; }
.perm-section-head .perm-section-title {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text-primary);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -.005em;
}
.perm-section-sub { margin: 3px 0 0; color: var(--text-secondary); font-size: .71rem; line-height: 1.5; }
.perm-section-head > .btn-outline-sm { flex-shrink: 0; }
.perm-cap-section-head { margin-top: 18px; }
.perm-cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.perm-cap-card {
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--ui-card-shadow);
}
.perm-cap-wide { grid-column: 1 / -1; }
.perm-cap-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.perm-cap-title { font-size: .88rem; font-weight: 700; }
.perm-cap-sub { color: var(--text-secondary); font-size: .71rem; line-height: 1.5; }
.perm-cap-note { color: var(--text-secondary); font-size: .7rem; line-height: 1.55; }
.perm-cap-body { gap: 8px 12px; }
.perm-cap-field { color: var(--text-secondary); font-size: .7rem; }
.perm-cap-field select,
.perm-cap-field input {
  min-height: 31px;
  margin-top: 3px;
  border-radius: 7px;
}
.perm-cap-switch { font-size: .72rem; }
.perm-cap-switch:has(input:checked) { color: var(--primary); }
#modal-permissions .perm-modal-actions {
  margin: 0;
  padding: 11px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  flex-shrink: 0;
}
.perm-warning {
  border-color: rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .08);
  color: #92400e;
}
:root[data-theme="dark"] .perm-warning { color: #fcd34d; }
@media (max-width: 640px) {
  .perm-modal-body { padding: 12px 14px 16px; }
  #modal-permissions .perm-modal-title { padding: 14px 16px 12px; }
  #modal-permissions .perm-modal-actions { padding: 10px 14px; }
  .perm-cap-grid { grid-template-columns: minmax(0, 1fr); }
  .perm-cap-wide { grid-column: auto; }
}


/* ── 工作台：待人工核实规范清单 ───────────────────────── */
.std-pending-panel {
  margin: 8px 12px 0;
  padding: 10px 12px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(245, 158, 11, .34);
  border-radius: 10px;
  background: rgba(245, 158, 11, .06);
}
.std-pending-panel.hidden { display: none !important; }
.std-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #92400e;
  font-size: .8rem;
}
.std-pending-head > span { display: inline-flex; align-items: center; gap: 6px; }
.std-pending-head svg { width: 15px; height: 15px; }
.std-pending-head b {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .18);
  font-size: .7rem;
}
.std-pending-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.std-pending-item {
  padding-top: 8px;
  border-top: 1px solid rgba(245, 158, 11, .22);
}
.std-pending-item:first-child { padding-top: 0; border-top: 0; }
.std-pending-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.std-pending-code {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, .14);
  color: #92400e;
  font-size: .72rem;
  font-weight: 700;
}
.std-pending-chapter { color: var(--text-secondary); font-size: .7rem; }
.std-pending-reason { margin: 4px 0 0; color: var(--text-secondary); font-size: .72rem; line-height: 1.55; }
.std-pending-snippet {
  margin: 6px 0 0;
  padding: 7px 9px;
  border-left: 3px solid rgba(245, 158, 11, .5);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, .55);
  color: var(--text-secondary);
  font-size: .71rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.std-pending-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.std-pending-input {
  width: 150px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: .72rem;
}
.std-pending-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.std-pending-actions .toolbar-btn { min-height: 30px; padding: 4px 9px; font-size: .7rem; }
:root[data-theme="dark"] .std-pending-panel { background: rgba(245, 158, 11, .12); }
:root[data-theme="dark"] .std-pending-head,
:root[data-theme="dark"] .std-pending-code { color: #fcd34d; }
:root[data-theme="dark"] .std-pending-snippet { background: rgba(15, 23, 42, .5); }
@media (max-width: 640px) {
  .std-pending-panel { margin-left: 8px; margin-right: 8px; }
  .std-pending-actions { align-items: flex-start; }
  .std-pending-input { width: 100%; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge--ok { color: #6ee7b7; background: rgba(16, 185, 129, .14); }
  :root:not([data-theme="light"]) .badge--warn { color: #fbbf24; background: rgba(245, 158, 11, .14); }
  :root:not([data-theme="light"]) .badge--bad { color: #fca5a5; background: rgba(239, 68, 68, .14); }
  :root:not([data-theme="light"]) .badge--info { color: #93c5fd; background: rgba(59, 130, 246, .14); }
}

/* 全站键盘焦点可见性（鼠标点击不出现） */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .dash-page,
  .schemes-wrap,
  .review-wrap,
  .stats-page,
  .companies-wrap { padding-left: 16px !important; padding-right: 16px !important; }
  .step-content { padding: 24px 20px !important; }
  .create-wrap,
  .new-review-wrap { padding-left: 16px !important; padding-right: 16px !important; }
}

.rc2-row-invalid td { background: color-mix(in srgb, #ef4444 7%, transparent) !important; }
.rc2-row-invalid .rc-work-item { outline: 2px solid #ef4444; outline-offset: 1px; }
.rc2-equip-reco { margin-top: 3px; color: #0f766e; font-size: .66rem; line-height: 1.35; }
.rc2-equip-reco i { width: .72rem; height: .72rem; vertical-align: -1px; }
.rc2-equip-kb { display: block; margin-top: 1px; color: #64748b; font-size: .62rem; }
.rc2-equip-plan { margin-top: 3px; color: #0f766e; font-size: .64rem; line-height: 1.35; }
.rc2-equip-plan span { display: block; color: #64748b; font-size: .6rem; }
.rc2-equip-plan { margin-top: 4px; padding: 5px 6px; border: 1px solid #dbe7e4; border-radius: 6px; background: #f5fbf9; }
.rc2-plan-title { color: #0f766e; font-size: .64rem; font-weight: 600; }
.rc2-plan-quota { margin-top: 3px; color: #334155; font-size: .6rem; font-weight: 600; }
.rc2-plan-group { margin-top: 3px; padding: 3px 4px; border: 1px dashed #d5e5e1; border-radius: 5px; }
.rc2-plan-item { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; margin-top: 2px; color: #475569; font-size: .6rem; }
.rc2-plan-item .rc2-input { height: 20px; padding: 1px 3px; font-size: .6rem; }
.rc2-plan-item .rc-plan-role { width: 78px; }
.rc2-plan-name { width: 108px; white-space: nowrap; }
.rc2-plan-item .rc-plan-code { width: 82px; }
.rc2-plan-item .rc-plan-model { width: 68px; }
.rc2-plan-item .rc-plan-count { width: 42px; }
.rc2-plan-item .rc-plan-capacity, .rc2-plan-item .rc-plan-shift-output { width: 70px; }
.rc2-plan-item .rc-plan-basis { width: 120px; }
.rc2-plan-remove { flex: 0 0 auto; }
.rc2-plan-add { margin-top: 3px; padding: 1px 6px; font-size: .58rem; }
.rc2-plan-item em { font-style: normal; color: #64748b; }
.rc2-plan-cap, .rc2-plan-basis { color: #64748b; font-size: .56rem; white-space: nowrap; }
.rc2-plan-gap { color: #b45309; font-size: .58rem; }
.rc2-plan-shifts { margin-top: 2px; color: #0f766e; font-size: .6rem; font-weight: 600; }

/* 资源配置弹窗：页签固定在弹窗顶部，内容只在 body 内滚动。
   避免切换“设计参数”等分区后，表头/长内容把上方页签压住。 */
#resource-confirm-modal .rc2-modal-head,
#resource-confirm-modal .rc2-tabbar,
#resource-confirm-modal .rc2-modal-foot {
  flex: 0 0 auto;
  position: relative;
  z-index: 30;
}
#resource-confirm-modal .rc2-tabbar {
  position: relative;
  z-index: 20;
  background: var(--bg-card);
}
