/* 统一字号层级：正文 16px，操作与表格 14px，标题 22px，统计数字 28px。 */
:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: #253545;
  background: #f4f6f9;
  font-synthesis: none;
  --accent: #197f75;
  --border: #e3e8ef;
  --muted: #67788a;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
button, input, select, textarea { font: inherit; font-size: .875rem; }
button {
  cursor: pointer; border: 1px solid #dce3ea; background: white;
  border-radius: 6px; padding: 7px 13px; min-height: 34px; color: #445568;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover { background: #f0f6f5; border-color: #9fc8c2; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.primary:hover { background: #146a62; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid #258f83; outline-offset: 3px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; min-height: 36px;
  border: 1px solid #d8e0e8; border-radius: 6px; background: white; color: #253545;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: #f5f7fa; color: #67788a; }
input::placeholder, textarea::placeholder { color: #8a97a6; }
select {
  appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, #718092 50%), linear-gradient(135deg, #718092 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 11px) 50%;
  background-size: 4px 4px; background-repeat: no-repeat;
}
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: .875rem; color: #536477; }
label input, label select, label textarea { margin-top: 6px; }
input[type=checkbox] { min-height: auto; accent-color: var(--accent); }
aside {
  position: fixed; width: 216px; background: #182e3d; color: #c7d4df;
  height: 100vh; height: 100dvh; padding: 24px 14px; display: flex; flex-direction: column;
  overflow-y: auto; border-right: 1px solid #243b4b;
}
.brand { font-size: 1.0625rem; font-weight: 650; color: #fff; margin: 0 10px 30px; white-space: nowrap; }
.brand small { display: block; font-size: .6875rem; letter-spacing: 2px; color: #91a7b8; margin-top: 6px; font-weight: 400; }
nav button { display: block; width: 100%; text-align: left; margin: 5px 0; background: transparent; color: #b5c6d5; border: 1px solid transparent; padding: 10px 14px; }
nav button:hover { background: #223d4d; color: white; border-color: transparent; }
nav button.active { background: #264956; color: #e5faf5; border-color: #355b65; box-shadow: inset 3px 0 #52bbab; }
.identity { margin-top: auto; padding: 18px 10px 0; font-size: .875rem; line-height: 1.8; }
.identity .muted { color: #a2b7c6; }
.identity button { margin-top: 12px; background: transparent; border-color: #456070; color: #c7d4df; }
main { margin-left: 216px; padding: 26px 30px; max-width: 1700px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 18px; }
h1 { font-size: 1.375rem; line-height: 1.4; margin: 0 0 5px; font-weight: 650; letter-spacing: -.3px; }
h2 { font-size: 1rem; margin: 0 0 16px; font-weight: 650; }
h3 { font-size: .9375rem; font-weight: 600; }
p { color: var(--muted); line-height: 1.7; margin: 6px 0; }
header p { font-size: .875rem; }
.eyebrow { font-size: .6875rem; letter-spacing: 1.5px; color: #718394; font-weight: 500; margin-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.card, .panel { background: white; border: 1px solid var(--border); border-radius: 9px; padding: 20px; box-shadow: 0 2px 4px #21354d03; }
.card { position: relative; padding: 17px 20px; }
.card::before { content: ''; position: absolute; left: 0; top: 20px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: #6fb6aa; }
.card.alert::before { background: #dda28a; }
.card small { color: #596c7d; font-size: .875rem; }
.card strong { display: block; font-size: 1.75rem; line-height: 1.25; margin: 10px 0 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card.alert strong { color: #b96348; }
.panel { margin-bottom: 20px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
header .toolbar { margin-bottom: 0; }
.toolbar input, .toolbar select { width: auto; max-width: 260px; }
.toolbar label { display: flex; align-items: center; gap: 8px; }
.toolbar label input { margin: 0; }
.scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; font-size: .875rem; font-variant-numeric: tabular-nums; }
th { text-align: left; background: #f7f9fb; color: #657587; font-weight: 500; padding: 11px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid #edf0f4; }
td b { font-weight: 550; }
tbody tr:hover { background: #f9fbfc; }
tbody tr:last-child td { border-bottom: 0; }
td.title { white-space: normal; min-width: 190px; max-width: 330px; }
td .muted { margin-top: 3px; }
td button { min-height: 30px; padding: 4px 10px; }
.muted { color: #728294; font-size: .8125rem; }
.badge { display: inline-block; border-radius: 4px; background: #edf7f3; color: #267a68; padding: 3px 7px; font-size: .8125rem; line-height: 1.5; margin: 2px 2px 2px 0; }
.badge.red { background: #fff2ec; color: #ac573a; }
.badge.gray { background: #eef2f6; color: #657587; }
progress { display: block; width: 130px; height: 5px; margin-top: 7px; border: 0; border-radius: 5px; overflow: hidden; accent-color: #32998a; background: #edf1f5; }
progress::-webkit-progress-bar { background: #edf1f5; }
progress::-webkit-progress-value { background: #32998a; border-radius: 5px; }
progress::-moz-progress-bar { background: #32998a; }
.empty { text-align: center; padding: 45px 20px; color: #728294; font-size: .875rem; }
.board { display: grid; grid-template-columns: repeat(5,minmax(215px,1fr)); gap: 12px; overflow: auto; padding-bottom: 8px; }
.column { background: #f0f3f7; border: 1px solid #e7ecf2; border-radius: 7px; padding: 12px; }
.column > b { font-size: .875rem; font-weight: 600; color: #526477; }
.task { background: white; border: 1px solid #e0e6ed; border-radius: 7px; margin: 12px 0 0; padding: 14px; box-shadow: 0 2px 3px #21354d04; }
.task h3 { line-height: 1.6; margin: 7px 0; }
.task p { font-size: .875rem; }
.task button { margin-top: 10px; width: 100%; }
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at 75% 15%,#2c5c61 0,transparent 55%),#182e3d; }
.auth .panel { width: min(420px,92vw); padding: 32px; box-shadow: 0 20px 60px #061c3240; }
.auth p { font-size: .875rem; }
.auth label { margin: 18px 0; }
.auth button { width: 100%; margin-top: 8px; }
dialog { color: #253545; border: 1px solid #e2e8ef; border-radius: 10px; width: min(740px,94vw); max-height: 90vh; padding: 24px; box-shadow: 0 24px 90px #122a3b44; }
dialog::backdrop { background: #152a3d77; backdrop-filter: blur(2px); }
dialog h2 { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
dialog p { font-size: .875rem; }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.wide { grid-column: 1/-1; min-width: 0; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.error { color: #ba4832; white-space: pre-wrap; font-size: .875rem; margin-top: 8px; }
.error:empty { display: none; }
.report-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.report-item { padding: 12px 0; border-bottom: 1px solid #edf0f4; font-size: .875rem; }
.report-item b { font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.check input { width: auto; margin: 0; }
#permissions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.document-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: end; margin: 14px 0; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #173c4b; color: white; padding: 10px 20px; border-radius: 7px; display: none; z-index: 10; font-size: .875rem; max-width: 90vw; box-shadow: 0 4px 20px #173c4b20; }
@media(max-width:1100px) { main { padding: 24px; } .cards { gap: 12px; } .card { padding: 16px; } }
@media(max-width:900px) {
  aside { position: static; width: 100%; height: auto; padding: 16px; }
  .brand { margin: 0 0 12px; }
  nav { display: flex; overflow: auto; gap: 4px; }
  nav button { width: auto; white-space: nowrap; padding: 8px 12px; }
  .identity { display: flex; justify-content: space-between; padding: 12px 0 0; align-items: center; }
  .identity button { margin: 0; }
  main { margin: 0; padding: 20px; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-grid { grid-template-columns: 1fr; }
  header { align-items: flex-start; }
}
@media(max-width:600px) {
  .document-row, #permissions { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { max-width: 100%; }
  dialog { padding: 20px; }
}
@media(max-width:520px) {
  main { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .cards { gap: 10px; }
  .card, .panel { padding: 15px; }
  header { flex-direction: column; gap: 12px; }
  h1 { font-size: 1.25rem; }
  .card strong { font-size: 1.5rem; }
  input, select, textarea { font-size: 1rem; }
}
@media(prefers-reduced-motion:reduce) { button { transition: none; } }
@media print {
  aside, header button, .toolbar, button { display: none!important; }
  main { margin: 0; padding: 0; max-width: none; }
  .panel, .card { break-inside: avoid; box-shadow: none; }
  body { background: white; }
  .scroll { overflow: visible; }
}

/* 快捷工作流：只展开当前操作需要的字段，历史记录和低频选项保留在折叠区。 */
[hidden] { display: none!important; }
.form-details { border-top: 1px solid var(--border); padding-top: 12px; }
.form-details summary { cursor: pointer; color: #526c7d; font-size: .875rem; padding: 5px 0; }
.form-details > .form-grid { margin-top: 16px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions select { width: 115px; min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
dialog .actions { position: sticky; bottom: -24px; background: white; padding-bottom: 12px; z-index: 1; }

.conflict-panel{border:1px solid #e0b08e;background:#fff8f2;border-radius:8px;padding:18px;margin-top:18px}.conflict-row{padding:12px 0;border-bottom:1px solid #ecd8c9}.release-candidate{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 0;border-bottom:1px solid var(--border)}
/* 报表控制区：范围与生成操作独立，导出折叠，所有周期使用同一组控件。 */
.mobile-menu-toggle { display:none; }
main, #content, .panel, .column, .form-grid > *, .report-grid > * { min-width:0; }
.report-controls-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:18px; }
.report-controls-heading h2 { margin:0 0 4px; }
.report-filter-row { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
.report-filter-row > label { flex:1 1 160px; max-width:240px; }
.report-filter-row button { min-height:40px; }
.custom-range { display:flex; gap:12px; flex:2 1 320px; }
.custom-range label { flex:1; min-width:0; }
.period-navigation { display:flex; gap:6px; }
.report-exports { position:relative; flex-shrink:0; }
.report-exports summary { cursor:pointer; padding:8px 14px; border:1px solid var(--border); border-radius:7px; color:var(--accent); font-size:.875rem; }
.export-options { position:absolute; right:0; z-index:4; width:240px; padding:10px; border:1px solid var(--border); border-radius:9px; background:white; box-shadow:0 12px 32px #173c4b20; display:grid; gap:6px; }
.export-options button { text-align:left; }
.export-options span { font-size:.75rem; color:var(--muted); padding:8px 6px 2px; }
.report-shortcuts { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.report-shortcuts a { text-decoration:none; border:1px solid var(--border); border-radius:20px; padding:6px 14px; font-size:.8125rem; background:white; }
#report > section { scroll-margin-top:16px; margin-top:28px; padding-top:20px; border-top:1px solid var(--border); }
#report > section:first-of-type { margin-top:16px; padding-top:0; border:0; }
.scroll { max-width:100%; overscroll-behavior-x:contain; }
.report-item, .task, .conflict-row { overflow-wrap:anywhere; }
@media(max-width:900px){
  .report-filter-row > label { max-width:none; }
  .mobile-brand-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .board { grid-template-columns:repeat(5,minmax(240px,1fr)); }
}
@media(max-width:600px){
  body { overflow-wrap:anywhere; }
  aside { padding:12px 16px; }
  .brand { margin:0; font-size:1rem; }
  .brand small { display:none; }
  .mobile-menu-toggle { display:block; background:#264956; color:white; border-color:#456070; }
  aside nav, aside .identity { display:none; }
  aside.menu-open nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:12px; overflow:visible; }
  aside.menu-open .identity { display:flex; }
  nav button { width:100%; white-space:normal; margin:0; }
  main { padding:16px 12px; width:100%; }
  header { flex-direction:column; gap:10px; margin-bottom:16px; }
  header .toolbar { width:100%; }
  header .eyebrow { display:none; }
  button, td button { min-height:44px; padding:9px 12px; }
  input, select, textarea { font-size:16px; min-height:44px; max-width:100%; }
  .toolbar { gap:8px; }
  .toolbar > input, .toolbar > select, .toolbar > label { flex:1 1 140px; width:100%; min-width:0; max-width:none; }
  .toolbar label { flex-wrap:wrap; }
  .toolbar label input, .toolbar label select { width:100%; }
  .panel,.card { padding:14px; }
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .card small { font-size:.8125rem; }
  .card strong { font-size:1.5rem; }
  .board { display:flex; gap:10px; scroll-snap-type:x proximity; }
  .column { flex:0 0 min(82vw,310px); scroll-snap-align:start; }
  dialog { width:100%; max-width:100%; max-height:100dvh; margin:auto 0 0; border-radius:14px 14px 0 0; padding:16px; }
  .form-grid, .document-row, #permissions { grid-template-columns:minmax(0,1fr); }
  dialog .actions { bottom:-16px; flex-wrap:wrap; padding-bottom:max(16px,env(safe-area-inset-bottom)); }
  dialog .actions button { flex:1 1 100px; }
  .conflict-panel { padding:12px; }
  .release-candidate { align-items:stretch; flex-direction:column; gap:8px; }
  .row-actions { flex-wrap:wrap; }
  .row-actions select { min-height:44px; width:100%; }
  .report-controls-heading { flex-wrap:wrap; margin-bottom:14px; }
  .report-filter-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; }
  .report-filter-row > label { width:100%; }
  .custom-range { grid-column:1/-1; }
  .period-navigation { grid-column:1/-1; }
  .period-navigation button { flex:1; }
  #generate { grid-column:1/-1; width:100%; }
  .report-exports { margin-left:auto; }
  .export-options { width:min(260px,calc(100vw - 52px)); }
  .report-shortcuts { gap:6px; }
  .report-shortcuts a { flex:1 1 40%; text-align:center; padding:10px 6px; }
  .mobile-cards,.mobile-cards tbody,.mobile-cards tr,.mobile-cards td { display:block; width:100%; white-space:normal; }
  .mobile-cards thead { display:none; }
  .mobile-cards tr { padding:10px 0; border-bottom:1px solid var(--border); }
  .mobile-cards td { display:grid; grid-template-columns:94px minmax(0,1fr); gap:10px; padding:7px 0; border:0; min-width:0; max-width:none; }
  .mobile-cards td::before { content:attr(data-label); color:var(--muted); font-size:.8125rem; }
  .mobile-cards td[colspan] { display:block; }
  .mobile-cards td[colspan]::before { display:none; }
  .cell-value { min-width:0; overflow-wrap:anywhere; }
  .auth .panel { padding:24px; }
}
@media print {
  .report-controls,.report-shortcuts,.mobile-menu-toggle { display:none!important; }
  #report > section { border:0; }
}
