:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #17211f;
  background: #f3f5f4;
  font-synthesis: none;
  line-height: 1.5;
  --ink: #17211f;
  --muted: #65716d;
  --line: #dce2df;
  --soft: #eef2f0;
  --surface: #ffffff;
  --green: #176b52;
  --green-dark: #124c3c;
  --blue: #2875a7;
  --amber: #be7b1d;
  --danger: #b33b32;
}

* { box-sizing: border-box; }
/* 页面级禁止横向滚动：各数据表格由 .data-area 内部横向滚动，避免个别长内容撑出浏览器级滚动条 */
html, body { overflow-x: hidden; }
body { margin: 0; min-width: 320px; background: #f3f5f4; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
[hidden] { display: none !important; }

.startup-panel { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 7px; color: var(--muted); text-align: center; }
.startup-panel strong { color: var(--ink); font-size: 16px; }
.startup-panel p { margin: 0; font-size: 13px; }
.loading-spinner { width: 26px; height: 26px; margin-bottom: 6px; border: 3px solid #d5dfdb; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-shell {
  width: min(920px, calc(100% - 32px));
  min-height: 570px;
  margin: max(32px, 8vh) auto;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(24, 45, 38, 0.1);
}
.auth-brand { padding: 52px 44px; color: #fff; background: #173f35; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand h1 { margin: 18px 0 8px; font-size: 34px; letter-spacing: 0; }
.auth-brand p { margin: 0; color: #c7d8d2; }
.brand-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: #bfd3cc; }
.brand-meta span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #65c5a3; vertical-align: 1px; }
.brand-mark { position: relative; width: 48px; height: 44px; }
.brand-mark span { position: absolute; display: block; background: #65c5a3; border-radius: 2px; }
.brand-mark span:nth-child(1) { width: 11px; height: 42px; left: 3px; top: 1px; }
.brand-mark span:nth-child(2) { width: 11px; height: 30px; left: 20px; top: 13px; background: #fff; }
.brand-mark span:nth-child(3) { width: 11px; height: 20px; left: 37px; top: 23px; background: #d7a44a; }
.brand-mark.small { width: 30px; height: 28px; transform: scale(.65); transform-origin: left center; margin-right: -8px; }
.auth-content { padding: 38px 48px; align-self: center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.auth-tabs button { color: var(--muted); background: transparent; padding: 10px; border-bottom: 2px solid transparent; }
.auth-tabs button.active { color: var(--green-dark); border-color: var(--green); font-weight: 700; }
.auth-form { display: grid; gap: 17px; }
.form-title { margin-bottom: 5px; }
.form-title h2 { margin: 0 0 4px; font-size: 24px; }
.form-title p { margin: 0; color: var(--muted); font-size: 14px; }

label { display: flex; flex-direction: column; gap: 7px; color: #47534f; font-size: 13px; font-weight: 600; }
.filter-row label { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.filter-row label input { width: auto; min-width: 140px; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd4d0;
  border-radius: 5px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 82, .12); }
input::placeholder, textarea::placeholder { color: #99a39f; }
input:disabled, select:disabled { color: #89938f; background: #f3f5f4; }

.primary, .secondary, .link-button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  font-weight: 650;
  font-size: 13px;
}
.primary { color: #fff; background: var(--green); }
.primary:hover { background: var(--green-dark); }
.primary:disabled, .secondary:disabled { cursor: wait; opacity: .72; }
button[aria-busy="true"]::before { content: ""; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
.secondary { color: #33403c; background: #fff; border: 1px solid #cbd4d0; }
.secondary:hover { background: #f1f4f2; }
.block { width: 100%; min-height: 44px; }
.icon-button { width: 34px; height: 34px; padding: 0; border-radius: 5px; background: transparent; color: #6a7772; font-size: 22px; }
.icon-button:hover { background: var(--soft); color: var(--ink); }
.form-message { min-height: 21px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--green); }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.checkbox-label { width: fit-content; min-height: 42px; flex-direction: row; align-items: center; gap: 8px; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; box-shadow: none; accent-color: var(--green); }
#bootstrap-area { margin-top: 18px; }
#bootstrap-area .bootstrap-toggle { width: 100%; color: var(--green); background: transparent; font-size: 13px; }
#bootstrap-form { display: grid; gap: 12px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }

.workspace { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 228px;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 16px;
  color: #dce9e5;
  background: #173f35;
}
.sidebar-brand { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: #fff; font-size: 17px; }
.sidebar nav { display: grid; gap: 4px; margin-top: 34px; }
.sidebar nav button { height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 11px; border-radius: 5px; color: #c2d5cf; background: transparent; text-align: left; }
.sidebar nav button:hover { background: rgba(255,255,255,.07); }
.sidebar nav button.active { color: #fff; background: #2a5b4e; }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; font-size: 11px; }
.sidebar-user { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.14); display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 9px; }
.sidebar-user .icon-button { color: #b8cec7; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #fff; font-size: 13px; }
.sidebar-user small { color: #a9c2ba; font-size: 11px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #173f35; background: #d7a44a; font-size: 13px; font-weight: 800; }

.content-shell { margin-left: 228px; padding: 0 34px 48px; }
.topbar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.topbar h1 { margin: 2px 0 0; font-size: 24px; letter-spacing: 0; }
.eyebrow { margin: 0; color: #78837f; font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.view { max-width: 1220px; margin: 0 auto; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; min-height: 128px; padding: 19px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.stat-accent { position: absolute; inset: 0 auto 0 0; width: 4px; }
.stat-accent.green { background: var(--green); }
.stat-accent.blue { background: var(--blue); }
.stat-accent.amber { background: var(--amber); }
.stat small { display: block; color: var(--muted); font-weight: 650; }
.stat strong { display: block; margin-top: 7px; font-size: 27px; line-height: 1.15; }
.stat p { margin: 6px 0 0; color: #8a9591; font-size: 12px; }
.surface { margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #e7ebe9; }
.section-heading.compact { align-items: center; padding-bottom: 14px; margin-bottom: 14px; }
.section-heading h2 { margin: 2px 0 1px; font-size: 18px; letter-spacing: 0; }
.section-heading p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid > * { min-width: 0; }
.wi-line2 > * { min-width: 0; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.form-grid > div:empty { min-height: 1px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid #e7ebe9; }
.form-footer .form-message { flex: 1; margin: 0; }
.metrics { border: 1px solid var(--line); border-radius: 5px; background: #f8faf9; }
.metrics summary { padding: 12px 14px; cursor: pointer; color: #38443f; font-size: 13px; font-weight: 700; }
.metrics summary span { margin-left: 6px; color: var(--muted); font-weight: 400; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; padding: 0 14px 14px; }
.field-label { color: #47534f; font-size: 13px; font-weight: 600; }
.people-field, .work-items { display: grid; gap: 9px; }
.person-chips { display: flex; flex-wrap: wrap; gap: 7px; min-height: 2px; }
.person-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 7px 4px 9px; border: 1px solid #9bb9ad; border-radius: 4px; color: #194d3c; background: #e8f4ef; font-size: 12px; font-weight: 700; }
.person-chip.external { color: #83571d; border-color: #e0ba78; background: #fff3d9; }
.person-chip button { width: 18px; height: 18px; padding: 0; color: inherit; background: transparent; font-size: 17px; line-height: 1; }
.inline-add { display: grid; grid-template-columns: auto minmax(160px, 250px) 34px; gap: 8px; align-items: stretch; }
.inline-add input { align-self: center; }
.inline-add button { align-self: center; }
.work-item-row { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfc; }
.work-item-row + .secondary { margin-top: 14px; }
.wi-line2 { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(120px, 1.3fr) 90px 1fr 1fr 80px; gap: 8px; align-items: center; }
.wi-line3 { display: grid; grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 1fr) 34px; gap: 8px; align-items: center; }
.wi-line3 > * { min-width: 0; }
.subsection-hint { flex: 1; color: var(--muted); font-size: 12px; font-weight: 400; }
.detail-items { width: 100%; margin-top: 6px; }
.detail-items th, .detail-items td { white-space: normal; overflow-wrap: anywhere; }
.detail-items th:first-child, .detail-items td:first-child { min-width: 180px; max-width: 320px; }
.detail-items tfoot td { font-weight: 700; }
.picker-list { display: grid; gap: 6px; max-height: min(55vh, 420px); overflow: auto; margin: 18px 22px; }
.picker-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.picker-row input { width: 16px; min-height: 16px; padding: 0; }
.picker-row small { color: var(--muted); font-size: 11px; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.status-badge.draft { color: #7b5418; background: #fff3d9; }
.status-badge.submitted, .status-badge.completed, .status-badge.published { color: #176048; background: #e6f4ef; }
.status-badge.active, .status-badge.in_progress, .status-badge.pending_review { color: #24658e; background: #e6f1f8; }
.toolbar, .filter-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.report-editor { display: grid; gap: 16px; margin: 18px 22px; max-height: 60vh; overflow-y: auto; }
.report-period h3, .report-category h4 { margin: 0 0 8px; }
.report-row-editor { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; }
.report-row-editor strong { display: block; padding-bottom: 8px; border-bottom: 1px solid #e7ebe9; color: #1f2421; font-size: 14px; }
.report-row-editor strong small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.report-row-editor textarea { min-height: 90px; padding: 10px 12px; border: 1px solid #d4dcd8; border-radius: 5px; font-size: 13px; line-height: 1.6; resize: vertical; }
.report-row-editor textarea:focus { border-color: #9bb9ad; outline: none; box-shadow: 0 0 0 3px rgba(47, 143, 107, 0.08); }
.report-row-editor button { justify-self: start; }
.toolbar label { min-width: 160px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-row input { max-width: 200px; }
.filter-row select { width: 130px; }

.data-area { min-width: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e8ecea; text-align: left; vertical-align: top; }
th { color: #66736e; background: #f7f9f8; font-size: 11px; font-weight: 800; white-space: nowrap; }
tbody tr:hover { background: #fafcfb; }
td .subline { margin-top: 3px; color: var(--muted); font-size: 11px; }
.table-action { padding: 5px 8px; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; }
.table-action:hover { background: #e8f2ee; }
.project-name { font-weight: 700; color: #26332f; }
.category-groups { display: grid; gap: 14px; }
.category-group { border: 1px solid #e1e6e4; border-radius: 5px; overflow: hidden; }
.category-title { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: #f5f8f6; }
.category-title h3 { margin: 0; font-size: 14px; }
.category-title span { color: var(--muted); font-size: 11px; }
.project-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-item { min-width: 0; padding: 14px; border-top: 1px solid #e8ecea; border-right: 1px solid #e8ecea; box-shadow: inset 0 -1px #e8ecea; }
.project-item:nth-child(3n) { border-right: 0; }
.project-item strong, .project-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item strong { font-size: 13px; }
.project-item small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.empty-state { padding: 42px 16px; text-align: center; color: var(--muted); border: 1px dashed #ced7d3; border-radius: 5px; background: #fafcfb; }
.empty-state strong { display: block; margin-bottom: 4px; color: #47534f; font-size: 14px; }
.output { min-height: 70px; max-height: 360px; overflow: auto; padding: 14px; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 5px; background: #f7f9f8; font: inherit; font-size: 13px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0 20px; border-bottom: 1px solid var(--line); }
.setting-row strong { font-size: 14px; }
.setting-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.switch { position: relative; display: inline-flex; flex-shrink: 0; }
.switch input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.switch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 3px; }
.switch span { position: relative; width: 38px; height: 21px; border-radius: 11px; background: #aeb8b4; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(17px); }
.management-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 20px; }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.subsection-heading h3 { margin: 0; font-size: 15px; }
.manage-list { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.manage-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px; border-bottom: 1px solid #e8ecea; }
.manage-item:last-child { border-bottom: 0; }
.manage-item strong, .manage-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-item strong { font-size: 13px; }
.manage-item small { color: var(--muted); font-size: 11px; }
.manage-actions { display: flex; gap: 2px; }
.tree-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 11px; border-bottom: 1px solid #e8ecea; }
.tree-item:hover { background: #f5f9f7; }
.tree-description { min-width: 0; overflow-wrap: anywhere; }
.tree-description small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.tree-toggle, .tree-leaf { width: 28px; height: 28px; border: none; border-radius: 5px; background: #eef4f1; cursor: pointer; color: var(--green); font-size: 16px; padding: 0; display: flex; align-items: center; justify-content: center; }
.tree-leaf { cursor: default; background: transparent; }
.tree-children { margin-left: 24px; border-left: 1px solid #d7e4dd; }
.tree-toggle:hover { color: var(--ink); }
.tree-toggle.leaf { visibility: hidden; }
.tree-line { position: relative; }
.tree-line::before { content: ''; position: absolute; left: -12px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tree-line::after { content: ''; position: absolute; left: -12px; top: 50%; width: 12px; height: 1px; background: var(--line); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-top: 1px solid var(--line); background: #fafbfa; }
.pagination-info { color: var(--muted); font-size: 12px; }
.pagination-controls { display: flex; gap: 8px; }
.pagination-controls button { padding: 6px 12px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; }
.pagination-controls button:hover:not(:disabled) { background: #f5f6f5; }
.pagination-controls button:disabled { opacity: 0.5; cursor: not-allowed; }
.recipient-field, .department-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.recipient-field legend, .department-field legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
.department-cascade { display: grid; gap: 10px; }
.department-cascade label { font-size: 12px; color: var(--muted); }
.department-fixed { border: 1px solid var(--line); background: #f5f8f6; border-radius: 5px; padding: 10px; }
.current-department { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 10px 0 14px; font-size: 12px; color: var(--muted); }
.current-department select { width: auto; min-width: 160px; max-width: min(400px, 50vw); min-height: 32px; padding: 4px 8px; font-size: 12px; }
.management-pagination { margin-top: 0; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 5px 5px; }
.management-pagination select { width: auto; min-height: 30px; padding: 4px; font-size: 12px; }
.manage-list:has(table) { overflow-x: auto; }
.recipient-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: #f4f8f6; font-size: 12px; }
.recipient-toolbar > div { display: flex; flex-wrap: wrap; gap: 8px; }
.recipient-toolbar button { padding: 4px 6px; background: transparent; color: var(--green); font-size: 12px; }
.recipient-tree { max-height: 380px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; background: #fff; }
.recipient-branch > summary { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px; cursor: pointer; list-style: none; background: #f7f9f8; }
.recipient-branch > summary::-webkit-details-marker { display: none; }
.recipient-branch > summary::before { content: '▸'; width: 16px; flex-shrink: 0; color: var(--muted); }
.recipient-branch[open] > summary::before { content: '▾'; }
.recipient-branch { margin: 3px 0; }
.recipient-children { margin-left: 16px; padding-left: 8px; border-left: 1px solid #dce6e0; }
.recipient-tree .recipient-choice { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; margin: 0; cursor: pointer; }
.recipient-tree input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; padding: 0; margin: 0; accent-color: var(--green); box-shadow: none; }
.recipient-count { margin-left: auto; flex-shrink: 0; color: var(--muted); font-size: 11px; }
.recipient-tree .recipient-user-item { padding: 8px; background: #fff; }
.recipient-user-name, .recipient-dept-name { overflow-wrap: anywhere; }
.recipient-user-role { flex-shrink: 0; }
.recipient-dept-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #f0f2f1; }
.recipient-dept-item label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.recipient-dept-name { font-size: 13px; font-weight: 500; color: #1f2421; }
.recipient-toggle { min-width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: #6b736e; cursor: pointer; font-size: 12px; line-height: 1; }
.recipient-toggle.leaf { cursor: default; color: #d0d6d2; }
.recipient-toggle:not(.leaf):hover { color: #2f8f6b; }
.recipient-user-item { display: flex; align-items: center; padding: 5px 8px; border-bottom: 1px solid #f7f8f7; background: #fafbfa; }
.recipient-user-item:last-child { border-bottom: 0; }
.recipient-user-item label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.recipient-user-name { font-size: 13px; color: #47534f; }
.recipient-user-role { font-size: 11px; color: var(--muted); margin-left: auto; }
.recipient-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #e8ecea; }
.recipient-item:last-child { border-bottom: 0; }
.recipient-item label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.recipient-item input[type="checkbox"] { cursor: pointer; }
.danger-action { color: var(--danger); }
.notification-list { display: grid; gap: 10px; margin: 18px 22px; }
.notification-item { padding: 13px; border: 1px solid var(--line); border-left: 4px solid #b7c0bc; border-radius: 5px; }
.notification-item.unread { border-left-color: var(--green); background: #f7fbf9; }
.notification-item h3 { margin: 0; font-size: 14px; }
.notification-item p { margin: 6px 0; white-space: pre-wrap; font-size: 13px; }
.notification-item small { color: var(--muted); }
#notification-count { min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 4px; border-radius: 9px; color: #fff; background: var(--danger); font-size: 10px; }
.muted { color: var(--muted); }

.modal { width: min(480px, calc(100% - 28px)); max-height: calc(100vh - 36px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(20, 38, 32, .24); }
.modal::backdrop { background: rgba(18, 32, 27, .5); backdrop-filter: blur(2px); }
.modal > form, .modal > .modal-heading, .modal > #record-detail, .modal > .actions { margin-left: 22px; margin-right: 22px; }
.modal > form { display: grid; gap: 15px; margin-top: 22px; margin-bottom: 22px; }
.modal > form > .modal-heading { margin: 0; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal > .modal-heading { margin-top: 22px; }
.modal-heading h2 { margin: 2px 0 0; font-size: 19px; }
.modal > .actions { margin-top: 18px; margin-bottom: 22px; }
.wide-modal { width: min(760px, calc(100% - 28px)); }
.assessment-modal { width: min(1440px, calc(100% - 32px)); border: 0; border-radius: 12px; }
.assessment-modal > .assessment-heading { margin: 0; padding: 24px 28px; color: #fff; background: #202b32; border: 0; }
.assessment-heading .eyebrow { margin: 0 0 6px; color: #afc4d0; font-size: 10px; letter-spacing: .16em; }
.assessment-heading h2 { font-size: 23px; letter-spacing: .04em; }
.assessment-heading #assessment-review-subtitle { margin: 8px 0 0; color: #cad8e0; font-size: 12px; }
.assessment-heading .icon-button { color: #fff; background: #34444e; flex-shrink: 0; }
.assessment-modal > form { margin: 24px 28px 0; gap: 22px; min-width: 0; }
#assessment-review-scores { min-width: 0; }
.assessment-meta { display: grid; grid-template-columns: 1fr 1.35fr 1.35fr 1.8fr; gap: 1px; margin: 0 0 26px; overflow: hidden; border: 1px solid #d1deeb; border-radius: 6px; background: #d1deeb; }
.assessment-meta > div { min-width: 0; padding: 12px 16px; background: #edf3f9; }
.assessment-meta dt { margin-bottom: 6px; color: #667a8c; font-size: 11px; }
.assessment-meta dd { margin: 0; color: #263d51; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.assessment-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.assessment-section-heading h3 { margin: 0; font-size: 15px; }
.assessment-section-heading > div { display: flex; gap: 12px; align-items: center; color: #71808a; font-size: 11px; }
.assessment-alert { padding: 12px 15px; margin: 10px 0; border: 1px solid #ebd6ae; border-radius: 6px; color: #805a20; background: #fff8eb; font-size: 12px; overflow-wrap: anywhere; }
.assessment-table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid #d9dfe4; border-radius: 6px; }
.assessment-table-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.assessment-sheet { table-layout: fixed; min-width: 1120px; font-size: 12px; color: #33434d; }
.assessment-sheet caption { padding: 10px 14px; background: #f8fafc; text-align: left; color: #667a8c; font-size: 11px; }
.assessment-sheet .col-category { width: 9%; }
.assessment-sheet .col-indicator { width: 17%; }
.assessment-sheet .col-weight { width: 6%; }
.assessment-sheet .col-target { width: 8%; }
.assessment-sheet .col-ai { width: 8%; }
.assessment-sheet .col-final { width: 10%; }
.assessment-sheet .col-evidence { width: 22%; }
.assessment-sheet .col-opinion { width: 20%; }
.assessment-sheet th, .assessment-sheet td { padding: 10px 12px; border: 1px solid #e4e9ed; vertical-align: middle; white-space: normal; overflow-wrap: anywhere; }
.assessment-sheet thead th { padding: 14px 8px; background: #293840; color: #fff; font-size: 12px; text-align: center; font-weight: 500; }
.assessment-sheet tbody td, .assessment-sheet tbody th { background: #fff; }
.assessment-sheet tbody tr:not(.assessment-subtotal):nth-child(even) td:not(.assessment-ai-score):not(.assessment-final-score), .assessment-sheet tbody tr:nth-child(even) .assessment-indicator { background: #f8fafb; }
.assessment-sheet .assessment-category { background: #e8edf1; text-align: center; color: #344a5b; font-size: 13px; }
.assessment-category small { display: block; margin-top: 7px; color: #788a99; font-weight: 500; }
.assessment-sheet .assessment-indicator { font-size: 13px; font-weight: 500; line-height: 1.7; color: #33434d; }
.assessment-sheet .assessment-number, .assessment-sheet .assessment-target { text-align: center; font-variant-numeric: tabular-nums; }
.assessment-sheet .assessment-ai-score { background: #fbe8dc; text-align: center; font-weight: 700; font-size: 17px; color: #915337; font-variant-numeric: tabular-nums; }
.assessment-sheet .assessment-final-score { background: #eaf1f8; }
.assessment-final-score input { display: block; width: 84px; max-width: 100%; margin: auto; min-height: 38px; padding: 8px 4px; text-align: center; border-color: #c7d7e5; font-weight: 700; font-variant-numeric: tabular-nums; }
.assessment-final-score input:disabled { color: #344a5b; opacity: 1; }
.assessment-opinion-field { border: 1px solid transparent; border-bottom-color: #d6e1e8; border-radius: 5px; transition: background .15s, border-color .15s; }
.assessment-opinion-field:hover { border-color: #d6e1e8; background: #f4f8fb; }
.assessment-opinion-field:focus-within { border-color: #668ca8; background: #fff; box-shadow: 0 0 0 3px #2875a710; }
.assessment-opinion textarea { display: block; min-height: 42px; max-height: 200px; padding: 10px; border: 0; border-radius: 5px; background: transparent; line-height: 1.65; font-size: 12px; resize: none; }
.assessment-opinion textarea:focus { box-shadow: none; }
.assessment-opinion textarea::placeholder { color: #94a4b1; }
.assessment-opinion textarea:disabled { color: #47534f; }
.assessment-opinion-field:has(textarea:disabled) { border-color: transparent; background: transparent; }
.assessment-evidence { color: #65747e; line-height: 1.65; }
.assessment-evidence p { margin: 0; white-space: pre-wrap; }
.assessment-evidence summary { cursor: pointer; color: #65747e; font-size: 12px; }
.assessment-evidence summary span { display: block; margin-top: 4px; color: #3f6d8a; font-size: 11px; }
.assessment-evidence details > div { margin-top: 8px; white-space: pre-wrap; }
.assessment-evidence details[open] + p { display: none; }
.assessment-sheet .assessment-subtotal > * { background: #dce3e8; color: #3e5261; font-weight: 600; text-align: center; }
.assessment-sheet .assessment-subtotal > :last-child { color: #788a99; font-size: 11px; font-weight: 400; text-align: left; }
.assessment-sheet tfoot > tr > * { background: #293840; color: #fff; font-weight: 600; text-align: center; }
.assessment-sheet tfoot [data-review-total] { color: #fff; font-size: 22px; font-variant-numeric: tabular-nums; }
.assessment-sheet tfoot > tr > :last-child { text-align: left; font-weight: 400; color: #cad8e0; font-size: 11px; }
.assessment-calculation { display: flex; gap: 12px; margin: 12px 0 20px; color: #71808a; font-size: 11px; }
.assessment-calculation strong { flex-shrink: 0; color: #4b6272; }
.assessment-summary { padding: 16px 18px; margin: 12px 0; border: 1px solid #dae5e0; border-radius: 6px; background: #f6faf8; }
.assessment-summary h3, .assessment-summary summary { margin: 0; color: #315b49; font-size: 13px; font-weight: 600; }
.assessment-summary summary { cursor: pointer; }
.assessment-summary p { margin: 10px 0 0; color: #5c6c64; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.assessment-review-footer { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0; background: #fff; border-top: 1px solid #e0e6e3; }
.assessment-review-footer .form-message { flex: 1; margin: 0; }
.assessment-review-footer .actions { flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px 20px; margin-top: 18px; }
.detail-item { min-width: 0; }
.detail-item.wide { grid-column: 1 / -1; }
.detail-item dt { margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.detail-item dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; white-space: pre-wrap; }
.metric-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--line); }
.metric-strip div { padding: 10px; background: #f8faf9; }
.metric-strip small, .metric-strip strong { display: block; }
.metric-strip small { color: var(--muted); font-size: 10px; }
.metric-strip strong { margin-top: 3px; font-size: 13px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; max-width: min(420px, calc(100% - 32px)); padding: 10px 15px; border-radius: 5px; color: #fff; background: #24352f; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8f302a; }

@media (max-width: 1050px) {
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-item:nth-child(3n) { border-right: 1px solid #e8ecea; }
  .project-item:nth-child(2n) { border-right: 0; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #manage-scope-panel .setting-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .tree-item .manage-actions { grid-column: 2 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .tree-item { grid-template-columns: 28px minmax(0, 1fr); gap: 5px 8px; }
  .tree-children { margin-left: 16px; }
  body { padding-bottom: 68px; }
  .auth-shell { width: min(100% - 24px, 480px); min-height: 0; margin: 18px auto; display: block; }
  .auth-brand { min-height: 168px; padding: 25px 24px; }
  .auth-brand h1 { margin: 8px 0 3px; font-size: 27px; }
  .auth-brand .brand-meta { display: none; }
  .brand-mark { transform: scale(.75); transform-origin: left top; margin-bottom: -8px; }
  .auth-content { padding: 25px 22px 28px; }
  .auth-tabs { margin-bottom: 24px; }
  .sidebar { inset: auto 0 0; width: 100%; height: 66px; padding: 0; background: #fff; border-top: 1px solid var(--line); }
  .sidebar-brand, .sidebar-user { display: none; }
  .sidebar nav { height: 100%; margin: 0; display: grid; grid-template-columns: repeat(var(--nav-count, 4), 1fr); gap: 0; }
  .sidebar nav button { height: 100%; padding: 7px 3px 5px; display: flex; flex-direction: column; justify-content: center; gap: 3px; border-radius: 0; color: #68746f; font-size: 10px; text-align: center; }
  .sidebar nav button:hover { background: #f5f8f6; }
  .sidebar nav button.active { color: var(--green); background: #edf5f2; }
  .nav-icon { width: 25px; height: 22px; border-color: currentColor; }
  .content-shell { margin-left: 0; padding: 0 12px 24px; }
  .topbar { min-height: 74px; margin-bottom: 14px; }
  .topbar h1 { font-size: 20px; }
  .top-actions #today { display: none; }
  .top-actions .secondary { min-width: 38px; width: 38px; padding: 0; font-size: 0; }
  .top-actions .secondary::after { content: "↻"; font-size: 21px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .stat { min-height: 102px; padding: 13px 10px 12px 13px; }
  .stat small { font-size: 10px; }
  .stat strong { font-size: 21px; }
  .stat p { font-size: 9px; }
  .surface { padding: 16px 14px; margin-bottom: 12px; }
  .section-heading { gap: 12px; padding-bottom: 14px; margin-bottom: 14px; }
  .section-heading h2 { font-size: 17px; }
  .section-heading p:not(.eyebrow) { display: none; }
  .heading-actions { justify-content: flex-end; }
  .heading-actions .secondary { display: none; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .span-2, .span-all { grid-column: auto; }
  .form-grid > div:empty { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-add { grid-template-columns: 1fr 34px; }
  .inline-add .secondary { grid-column: 1 / -1; }
  .wi-line2 { grid-template-columns: 1fr 1fr; }
  .wi-line3 { grid-template-columns: 1fr 1fr 34px; }
  .report-row-editor { grid-template-columns: 1fr; }
  .assessment-modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .assessment-modal > .assessment-heading { padding: 18px 16px; }
  .assessment-heading h2 { font-size: 18px; }
  .assessment-modal > form { margin: 16px 12px 0; gap: 16px; }
  .assessment-meta { grid-template-columns: 1fr 1fr; }
  .assessment-meta > div { padding: 10px; }
  .assessment-calculation { flex-direction: column; gap: 4px; }
  .assessment-review-footer { display: block; }
  .assessment-review-footer .actions { margin-top: 8px; gap: 6px; }
  .assessment-review-footer .actions button { flex: 1; min-width: 100px; }
  .form-footer { display: block; }
  .form-footer .actions { margin-top: 10px; }
  .form-footer .actions button { flex: 1; min-width: 95px; }
  .project-list { grid-template-columns: 1fr; }
  .project-item, .project-item:nth-child(2n), .project-item:nth-child(3n) { border-right: 0; }
  .toolbar { align-items: stretch; }
  .toolbar label { min-width: calc(50% - 5px); flex: 1; }
  .toolbar button, .toolbar .link-button { flex: 1; }
  .filter-row input { max-width: none; flex: 1; min-width: 180px; }
  table { min-width: 640px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .toast { bottom: 82px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: 1 / -1; min-height: 84px; }
  .section-heading { flex-wrap: wrap; }
  .heading-actions { width: 100%; justify-content: stretch; }
  .heading-actions button { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.wide, .metric-strip { grid-column: auto; }
}

/* 换行文本单元格（聚合后的多段内容） */
.pre-line { white-space: pre-line; }

/* 说明文本块 */
.hint-block { margin: 8px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent, #2f8f6b); border-radius: 4px; color: #47534f; background: #f3f8f6; font-size: 12px; line-height: 1.6; }

/* 人物画像气泡卡片 */
.persona-card { margin: 14px 0 4px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, #f3f8f6 0%, #eef4fb 100%); }
.persona-loading, .persona-error { padding: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.persona-error { color: #a3441f; }
.persona-card:has(.persona-bubbles) { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: start; }
.persona-avatar { display: grid; justify-items: center; gap: 8px; padding: 14px 8px; border-radius: 10px; background: #ffffff; border: 1px solid var(--line); font-size: 52px; line-height: 1; }
.persona-name { font-size: 14px; font-weight: 700; color: #22423a; }
.persona-bubbles { display: grid; gap: 12px; }
.bubble { position: relative; padding: 12px 14px; border-radius: 12px; background: #ffffff; border: 1px solid #d9e3df; font-size: 13px; line-height: 1.65; color: #33403b; box-shadow: 0 1px 3px rgba(30, 60, 50, 0.06); }
.bubble::before { content: ''; position: absolute; left: -8px; top: 16px; width: 14px; height: 14px; background: inherit; border-left: 1px solid #d9e3df; border-bottom: 1px solid #d9e3df; transform: rotate(45deg); }
.bubble.headline { font-size: 15px; font-weight: 700; color: #1c4a3a; background: #e8f4ef; border-color: #a9cfc0; }
.bubble.good { background: #eaf6ee; border-color: #a9d3b6; }
.bubble.info { background: #eaf1fb; border-color: #a9c2e6; }
.bubble.warn { background: #fdf1e6; border-color: #e9c39a; }
.bubble .bubble-label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: #6a7873; text-transform: uppercase; }
.bubble ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.bubble.headline::before { background: #e8f4ef; }
.bubble.good::before { background: #eaf6ee; }
.bubble.info::before { background: #eaf1fb; }
.bubble.warn::before { background: #fdf1e6; }

@media (max-width: 720px) {
  .persona-card:has(.persona-bubbles) { grid-template-columns: 1fr; }
  .persona-avatar { flex-direction: row; }
}
/* Monthly workbook preview keeps project/manager pairs on aligned rows. */
.monthly-table-scroll { overflow-x: auto; margin: 16px 0 28px; }
.monthly-table { min-width: 1120px; width: 100%; border-collapse: collapse; }
.monthly-table th, .monthly-table td { white-space: pre-wrap; vertical-align: middle; border: 1px solid #d9e2dc; min-width: 90px; }
.monthly-table th:first-child, .monthly-table td:first-child { min-width: 45px; }
.monthly-table td:nth-child(6), .monthly-people td:nth-child(5) { min-width: 240px; }
.monthly-table textarea { min-width: 170px; }
.monthly-analysis { white-space: pre-wrap; line-height: 1.8; }
