:root {
  --ink: #182c2a;
  --muted: #758681;
  --line: #dfe7e3;
  --paper: #ffffff;
  --canvas: #f2f5f3;
  --green: #176d57;
  --green-2: #21866a;
  --mint: #e4f2eb;
  --lime: #d8ef8c;
  --orange: #cb6c35;
  --orange-bg: #fff0e5;
  --red: #bf4d46;
  --red-bg: #fff0ed;
  --blue: #4f7291;
  --blue-bg: #eaf1f6;
  --shadow: 0 8px 24px rgba(28, 54, 45, .045);
  --radius: 7px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 14% 18%, #dcefe4 0, transparent 32%), radial-gradient(circle at 88% 82%, #f7e5d6 0, transparent 28%), var(--canvas); }
.login-card { width: min(420px, 100%); padding: 34px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 60px rgba(28,54,45,.1); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 27px; }
.login-brand .brand-mark { flex: 0 0 auto; }
.login-kicker { color: var(--green-2); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; }
.login-title { margin: 7px 0 0; font-size: 27px; line-height: 1.3; }
.login-subtitle { margin: 8px 0 25px; color: var(--muted); font-size: 14px; }
.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.login-field label { color: #526860; font-size: 13px; font-weight: 600; }
.login-field input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: #fbfdfc; }
.login-field input:focus { border-color: #79aa91; background: white; box-shadow: 0 0 0 3px #e4f2eb; }
.login-submit { width: 100%; justify-content: center; height: 42px; margin-top: 7px; font-weight: 700; }
.login-error { min-height: 18px; margin-top: 12px; color: var(--red); font-size: 13px; }
.app.is-hidden { display: none; }
.top-user { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.top-user .avatar { width: 27px; height: 27px; font-size: 13px; }
.top-user-info { line-height: 1.25; }
.top-user-name { font-size: 13px; font-weight: 700; }
.top-user-role { color: var(--muted); font-size: 11px; }
.logout-btn { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 4px; }
.logout-btn:hover { color: var(--red); }
.app { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #183b34; color: #e4f1e9; display: flex; flex-direction: column; padding: 22px 14px 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 25px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px 11px 11px 3px; display: grid; place-items: center; background: var(--lime); color: #1c4337; font-weight: 900; font-size: 20px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0; }
.brand-sub { color: #a9c2b8; font-size: 10px; margin-top: 4px; letter-spacing: .6px; }
.org-switch { margin: 0 5px 20px; padding: 11px 12px; border: 1px solid rgba(222,241,231,.16); background: rgba(255,255,255,.06); border-radius: 6px; display: flex; justify-content: space-between; align-items: center; color: #ebf5ef; }
.org-switch small { color: #a9c2b8; display: block; font-size: 12px; margin-bottom: 4px; }
.org-switch strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.org-switch > span:last-child { font-size: 0; }
.org-switch > span:last-child::after { content: "\25BE"; font-size: 14px; }
.app.is-hidden .org-switch > span:last-child::after { content: none; }
.top-actions [data-action="help"] { display: none; }
.nav { overflow: auto; flex: 1; }
.nav-group { margin: 15px 0 7px; padding: 0 12px; font-size: 12px; color: #85a99b; letter-spacing: 1px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #c4d8ce; border-radius: 5px; padding: 10px 11px; display: flex; align-items: center; gap: 11px; text-align: left; margin: 2px 0; font-size: 15px; }
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: #2a6353; color: white; box-shadow: inset 3px 0 var(--lime); }
.nav-glyph { width: 21px; height: 21px; border-radius: 5px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #b4d1c1; border: 1px solid rgba(216,239,140,.16); }
.nav-item.active .nav-glyph { background: var(--lime); border-color: var(--lime); color: #21473b; }
.side-bottom { border-top: 1px solid rgba(222,241,231,.13); padding: 15px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; color: #21473b; background: #c6df9b; font-weight: 700; }
.side-user { flex: 1; font-size: 14px; }
.side-user small { display: block; color: #9ebbb0; margin-top: 3px; font-size: 12px; }
.side-version { font-size: 12px; color: #87a99c; }
.main { min-width: 0; }
.topbar { height: 66px; padding: 0 34px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); }
.crumb { color: var(--muted); font-size: 14px; }
.crumb strong { color: var(--ink); font-weight: 600; margin-left: 9px; }
.top-actions { display: flex; align-items: center; gap: 11px; }
.search { width: 228px; position: relative; }
.search input { height: 36px; width: 100%; padding: 0 12px 0 34px; border-radius: 5px; background: #f7f9f8; border: 1px solid var(--line); outline: 0; font-size: 14px; }
.search input:focus { border-color: #7cae99; background: white; }
.search:before { content: "?"; position: absolute; left: 12px; top: 5px; font-size: 18px; color: #70847d; }
.top-select { height: 36px; border: 1px solid var(--line); color: #4f655e; background: white; border-radius: 5px; padding: 0 10px; font-size: 14px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #536a62; position: relative; }
.icon-btn:hover { background: var(--mint); }
.alert-icon { width: 16px; height: 16px; display: block; margin: auto; }
.alert-count { position: absolute; top: -7px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid white; border-radius: 10px; background: #cf493f; color: white; font-size: 10px; font-weight: 700; line-height: 13px; text-align: center; }
.alert-list { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.alert-item { border: 1px solid var(--line); border-left-width: 4px; border-radius: 5px; padding: 12px 14px; }
.alert-item.critical { border-left-color: #b42318; }
.alert-item.high { border-left-color: #db594b; }
.alert-item.medium { border-left-color: #d99a32; }
.alert-item.low { border-left-color: #4789a8; }
.alert-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.alert-item-title { color: var(--ink); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.alert-severity { flex: none; border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 650; }
.alert-severity.critical { color: #a32219; background: #fde8e6; }
.alert-severity.high { color: #b13d31; background: #fff0ec; }
.alert-severity.medium { color: #8b5c0a; background: #fff6df; }
.alert-severity.low { color: #286984; background: #e8f4fa; }
.alert-item-meta { margin-top: 7px; color: #63746d; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.alert-item-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; color: #7a8983; font-size: 11px; }
.alert-item-actions { display: flex; gap: 6px; }
.alert-item-actions .btn { padding: 5px 8px; font-size: 12px; }
.mobile-menu { display: none; }
.content { max-width: 1600px; padding: 27px 34px 40px; margin: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.eyebrow { color: var(--green-2); font-size: 12px; letter-spacing: 1.6px; font-weight: 700; margin-bottom: 7px; }
h1 { font-size: 26px; letter-spacing: 0; line-height: 1.35; margin: 0; font-weight: 700; }
.page-desc { font-size: 14px; color: var(--muted); margin-top: 7px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: white; color: #344b44; border-radius: 5px; padding: 9px 13px; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; transition: .16s ease; white-space: nowrap; }
[data-import-preview-dismiss][hidden] { display: none; }
.btn:hover { border-color: #9cbdad; background: #f7fbf8; }
.btn-primary { color: white; background: var(--green); border-color: var(--green); }
.btn-primary:hover { background: #105b47; border-color: #105b47; }
.btn-danger { color: white; background: var(--red); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { color: white; background: #a83e38; border-color: #a83e38; }
.btn-danger:disabled { color: #8b7775; background: #f0e8e7; border-color: #e3d7d5; cursor: not-allowed; }
.btn[data-full-action="master-import-commit"]:disabled,
.btn[data-full-action="master-import-commit"]:disabled:hover,
.btn[data-full-action="result-import-commit"]:disabled,
.btn[data-full-action="result-import-commit"]:disabled:hover {
  color: #66716c; background: #e5e7eb; border-color: #d1d5db; cursor: not-allowed;
}
.btn-export { color: white; background: var(--blue); border-color: var(--blue); }
.btn-export:hover, .btn-export:focus-visible { color: white; background: #3d5b76; border-color: #3d5b76; }
.btn-export[aria-busy="true"] { cursor: wait; opacity: .7; }
.btn-daily-report { color: white; background: var(--green); border-color: var(--green); box-shadow: 0 2px 5px rgba(23,109,87,.16); }
.btn-daily-report:hover, .btn-daily-report:focus-visible { color: white; background: #105b47; border-color: #105b47; }
.btn-daily-report:disabled { cursor: not-allowed; opacity: .62; }
.daily-report-icon { width: 17px; height: 17px; display: block; }
.btn-report-generate { color: white; background: #21866a; border-color: #21866a; }
.btn-report-generate:hover, .btn-report-generate:focus-visible { color: white; background: #176c55; border-color: #176c55; }
.btn-report-generate:disabled { color: #71817b; background: #e8eeeb; border-color: #d6dfda; cursor: not-allowed; }
.btn-designer { color: white; background: #2f65b9; border-color: #2f65b9; }
.btn-designer:hover, .btn-designer:focus-visible { color: white; background: #235096; border-color: #235096; }
.export-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: export-spin .8s linear infinite; }
.export-progress { color: var(--blue); font-size: 13px; margin-bottom: 12px; }
@keyframes export-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .export-spinner { animation: none; } }
.btn-warm { color: #a5532c; border-color: #efcfb7; background: #fffaf6; }
.btn-small { padding: 6px 9px; font-size: 13px; }
.btn-text { border: 0; padding: 4px; color: var(--green); background: transparent; font-size: 13px; }
.btn-text:hover { color: #0d4f3d; text-decoration: underline; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 3px; padding: 4px 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill:before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.pill-green { color: #287558; background: #e6f4eb; }
.pill-orange { color: #b76231; background: #fff0e5; }
.pill-red { color: #b34a43; background: #fff0ed; }
.pill-gray { color: #687b74; background: #edf1ef; }
.pill-blue { color: #4f7291; background: #eaf1f6; }
.institution-status-toggle { border: 0; background: transparent; padding: 0; }
.institution-status-toggle:focus-visible { outline: 2px solid var(--green-2); outline-offset: 3px; border-radius: 3px; }
.user-status-button { border: 0; }
.user-status-button:hover:not(:disabled) { filter: brightness(.94); }
.user-status-button:disabled { cursor: not-allowed; opacity: .7; }
.stats, .stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px 15px; min-height: 113px; overflow: hidden; }
.stat > * { position: relative; z-index: 1; }
.stat:after { content: ""; position: absolute; right: -16px; top: -21px; width: 68px; height: 68px; border: 1px solid #edf2ef; border-radius: 50%; box-shadow: 0 0 0 9px #f7faf8, 0 0 0 19px #fbfcfb; pointer-events: none; z-index: 0; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-number { font-size: 30px; line-height: 1.2; margin-top: 10px; font-weight: 650; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; margin-top: 7px; }
.stat-trend { color: var(--green-2); font-weight: 700; }
.stat-alert .stat-number, .stat-alert .stat-trend { color: var(--red); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 17px; border-bottom: 1px solid #edf1ef; }
.panel-title { font-size: 15px; font-weight: 700; }
.panel-sub { color: var(--muted); font-size: 12px; margin-left: 8px; font-weight: 400; }
.panel-body { padding: 16px 17px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .9fr); gap: 14px; margin-bottom: 14px; }
.chart-legend { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--green-2); display: inline-block; margin-right: 5px; }
.legend-dot.orange { background: #e0a26e; }
.chart { height: 198px; display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; color: #94a39d; font-size: 11px; padding: 3px 0 20px; }
.chart-main { display: flex; flex-direction: column; min-width: 0; }
.chart-bars { flex: 1; display: flex; align-items: end; justify-content: space-around; gap: 11px; padding: 5px 7px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 38px, #edf2ef 39px, transparent 40px); }
.bar-group { height: 100%; min-width: 18px; max-width: 48px; flex: 1; display: flex; align-items: end; justify-content: center; gap: 4px; position: relative; }
.bar-stack { height: 100%; width: 40%; max-width: 18px; display: flex; align-items: end; position: relative; }
.bar-value { position: absolute; left: 50%; bottom: calc(var(--bar-height) + 3px); transform: translateX(-50%); color: #53645d; font-size: 10px; line-height: 1; white-space: nowrap; }
.bar-stack.fail-stack { width: 40%; }
.bar-value.fail-value { color: #a66b39; }
.bar { width: 40%; max-width: 18px; border-radius: 3px 3px 0 0; background: #248467; transition: height .3s; }
.bar-stack .bar { width: 100%; }
.bar.fail { background: #e0a26e; }
.chart-labels { height: 22px; display: flex; justify-content: space-around; color: #87958f; font-size: 11px; align-items: end; }
.risk-list { display: flex; flex-direction: column; gap: 0; }
.risk-row { display: grid; grid-template-columns: 31px minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid #eef2ef; padding: 12px 0; }
.risk-row:last-child { border: 0; }
.risk-icon { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: var(--orange-bg); color: var(--orange); font-weight: 700; font-size: 13px; }
.risk-icon.red { color: var(--red); background: var(--red-bg); }
.risk-name { font-weight: 600; font-size: 13px; }
.risk-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.risk-count { font-size: 15px; font-weight: 700; color: #99542f; }
.table-panel { overflow: hidden; }
.testing-panel, .report-manage-panel { overflow: visible; }
.table-controls { display: flex; align-items: center; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: white; color: #566b64; border-radius: 4px; padding: 8px 10px; font-size: 13px; outline: none; }
.filter:focus { border-color: #89b19c; }
.testing-panel .table-controls > .filter, .testing-panel .table-controls > .btn { height: 36px; }
.report-manage-panel .table-controls > .filter, .report-manage-panel .table-controls > .btn { height: 36px; }
.testing-panel .table-controls > .btn, .report-manage-panel .table-controls > .btn { padding-top: 8px; padding-bottom: 8px; }
.testing-date-range { position: relative; }
.report-date-controls { padding: 0 0 16px; }
.testing-date-toggle { min-width: 230px; text-align: left; }
.testing-date-popover { position: absolute; z-index: 12; top: calc(100% + 6px); left: 0; width: min(610px, calc(100vw - 40px)); padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: 0 12px 32px rgba(28,54,45,.16); }
.testing-date-popover[hidden] { display: none; }
.testing-date-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.testing-date-month-title { margin: 2px 0 10px; text-align: center; font-size: 14px; font-weight: 700; }
.testing-date-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.testing-date-weekday { padding: 4px 0; color: var(--muted); font-size: 11px; }
.testing-date-day { min-width: 0; height: 31px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-size: 12px; }
.testing-date-day:hover { background: var(--mint); }
.testing-date-day.is-in-range { background: #e9f4ee; }
.testing-date-day.is-selected { background: var(--green); color: white; }
.testing-date-day.is-today:not(.is-selected) { color: #8a3e1f; background: #f4c9a8; font-weight: 800; box-shadow: inset 0 0 0 2px #cb6c35; }
.testing-date-day.is-empty { visibility: hidden; }
.testing-date-navigation { display: flex; justify-content: space-between; margin-bottom: 10px; }
.testing-date-navigation button, .testing-date-clear { border: 0; background: transparent; color: var(--green); font-size: 13px; }
.testing-date-presets { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.testing-date-preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.testing-date-preset-row--recent { padding-top: 8px; border-top: 1px solid var(--line); }
.testing-date-presets button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: white; color: #526860; font-size: 12px; }
.testing-date-preset-row button:nth-child(6n + 1) { border-color: #c9dafa; background: #eff5ff; color: #3f6398; }
.testing-date-preset-row button:nth-child(6n + 2) { border-color: #d8c9f1; background: #f5f0fc; color: #705497; }
.testing-date-preset-row button:nth-child(6n + 3) { border-color: #f0d89e; background: #fff8e8; color: #8a6a28; }
.testing-date-preset-row button:nth-child(6n + 4) { border-color: #bde3d9; background: #eaf7f3; color: #397567; }
.testing-date-preset-row button:nth-child(6n + 5) { border-color: #f1cbb7; background: #fff2eb; color: #9a6040; }
.testing-date-preset-row button:nth-child(6n) { border-color: #edc9d6; background: #fcf0f4; color: #96556b; }
.testing-date-presets button:hover { filter: saturate(1.2); }
.testing-date-presets button.is-active, .testing-date-presets button.is-active:hover { border-color: var(--green); background: var(--green); color: white; }
.testing-table th:nth-child(6), .testing-table td:nth-child(6),
.testing-table th:nth-child(7), .testing-table td:nth-child(7) { display: none; }
.testing-date-footer { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 12px; }
.testing-reset-button { color: #176448; background: #e6f4eb; border-color: #bdddc9; }
.testing-reset-button:hover { color: #105b47; background: #d8eee1; border-color: #9fcdb1; }
.report-manage-reset-button { color: #176448; background: #e6f4eb; border-color: #bdddc9; }
.report-manage-reset-button:hover { color: #105b47; background: #d8eee1; border-color: #9fcdb1; }
@media (max-width: 640px) { .testing-date-months { grid-template-columns: 1fr; max-height: 55vh; overflow-y: auto; } .testing-date-toggle { min-width: 0; max-width: calc(100vw - 72px); } }
.search-field { position: relative; display: inline-flex; max-width: 100%; }
.search-field input { min-width: 0; max-width: 100%; padding-right: 34px; }
.search-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; display: grid; place-items: center; }
.search-clear[hidden] { display: none; }
.search-clear:hover { color: var(--ink); background: var(--mint); }
.search-clear:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.table-wrap { overflow: auto; width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 760px; text-align: left; }
thead { background: #f7f9f8; }
th { font-size: 12px; color: #73827c; font-weight: 600; padding: 11px 14px; border-top: 1px solid #edf1ef; border-bottom: 1px solid #e8eeea; white-space: nowrap; }
td { font-size: 13px; color: #40544d; padding: 13px 14px; border-bottom: 1px solid #eff2f0; white-space: nowrap; }
.testing-table th:first-child, .testing-table td:first-child:not([colspan]) { width: 56px; padding-left: 6px; padding-right: 6px; text-align: center; }
.testing-table th:first-child label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.testing-table input[type="checkbox"] { margin: 0; vertical-align: middle; }
tbody tr:hover { background: #f9fcfa; }
.primary-cell { font-weight: 650; color: #203e34; }
.secondary-cell { display: block; color: #91a099; font-size: 11px; margin-top: 4px; font-weight: 400; }
.actions { display: flex; gap: 8px; align-items: center; }
.table-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 12px; color: var(--muted); }
.pagination { display: flex; gap: 5px; }
.pagination-footer { flex-wrap: wrap; gap: 12px; }
.pagination-footer .pagination { flex-wrap: wrap; align-items: center; }
.page-jump, .page-size { display: flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.page-jump input { width: 72px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; }
.page-size select { padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); }
.page-num { width: 28px; height: 28px; border: 1px solid var(--line); background: white; color: #62756d; border-radius: 4px; font-size: 12px; }
.pagination-footer .page-num { width: auto; min-width: 28px; padding: 0 9px; flex-shrink: 0; white-space: nowrap; }
.page-num.active { background: var(--green); color: white; border-color: var(--green); }
.tabs { display: flex; align-items: center; gap: 20px; padding: 0 16px; border-bottom: 1px solid #eaf0ec; overflow: auto; }
.tab { border: 0; background: transparent; color: #71817b; font-size: 13px; padding: 14px 0 12px; white-space: nowrap; position: relative; }
.tab.active { color: var(--green); font-weight: 700; }
.tab.active:after { position: absolute; content: ""; height: 2px; bottom: -1px; left: 0; right: 0; background: var(--green-2); }
.master-tabs { overflow-x: auto; overflow-y: hidden; }
.master-tabs .tab { flex-shrink: 0; }
.master-tabs .tab.active:after { bottom: 0; }
.device-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.device-status-strip { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid #edf1ef; }
.device-status-item { padding: 15px 17px; border-right: 1px solid #edf1ef; }
.device-status-item:last-child { border: 0; }
.device-status-item small { color: var(--muted); font-size: 12px; }
.device-status-item strong { display: block; font-size: 21px; margin-top: 6px; }
.device-status-item strong.online { color: var(--green-2); }
.device-map { position: relative; z-index: 0; isolation: isolate; height: 380px; background: #e9efeb; }
.manual-location-actions { display: flex; align-items: center; gap: 8px; }
.manual-location-actions span { color: var(--muted); font-size: 12px; }
.device-map-empty { padding: 10px 15px; color: var(--muted); font-size: 13px; }
.monitor-row { display: flex; justify-content: space-between; border-bottom: 1px solid #edf1ef; padding: 12px 0; font-size: 13px; }
.monitor-row:last-child { border: 0; }
.monitor-row span:first-child { color: #61736c; }
.monitor-value { font-weight: 650; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.report-bars { display: flex; flex-direction: column; gap: 13px; }
.hbar-row { display: grid; grid-template-columns: 90px 1fr 42px; gap: 10px; align-items: center; font-size: 12px; color: #61746b; }
.hbar-track { height: 8px; background: #edf2ee; border-radius: 4px; overflow: hidden; }
.hbar { height: 100%; background: #3a9878; border-radius: 4px; }
.hbar.warn { background: #dc9961; }
.hbar.bad { background: #cf6558; }
.empty-hint { text-align: center; color: #8a9993; font-size: 13px; padding: 28px 10px; }
.banner { padding: 12px 15px; border-radius: 5px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; border: 1px solid #f1d5bd; color: #8e5837; background: #fff8f1; font-size: 13px; }
.banner strong { color: #82482c; }
.banner-left { display: flex; align-items: center; gap: 9px; }
.banner-mark { width: 22px; height: 22px; border-radius: 50%; background: #f4dfcc; display: grid; place-items: center; font-weight: 800; }
.settings-grid { display: grid; grid-template-columns: 210px 1fr; gap: 14px; }
.settings-menu { padding: 8px; }
.settings-link { display: block; border: 0; width: 100%; background: none; text-align: left; padding: 10px; border-radius: 4px; color: #63766e; font-size: 13px; }
.settings-link.active { background: var(--mint); color: var(--green); font-weight: 700; }
.permission-layout { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.permission-panel { min-width: 0; }
.permission-note { margin: 16px 17px 0; padding: 10px 12px; border-left: 3px solid #79aa91; background: #f5f8f6; color: #697b73; font-size: 12px; line-height: 1.7; }
.permission-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; padding: 16px 17px 20px; }
.permission-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; color: #40574e; cursor: pointer; }
.permission-row:hover { border-color: #9cbdad; background: #f7fbf8; }
.permission-row strong, .permission-row small { display: block; }
.permission-row strong { font-size: 13px; }
.permission-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.settings-content { min-height: 310px; }
.settings-content .panel-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.manual-entry-group { display: grid; gap: 13px; min-width: 0; padding: 13px; border: 1px solid #c9dfd2; border-radius: 6px; background: #f0f7f3; }
#modalRoot .field[hidden], #registrationNewDeviceFields[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: #64766f; font-size: 12px; }
.required-mark { color: #c0392b; font-weight: 700; }
.manual-required-field label { color: #c0392b; font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 4px; padding: 10px 11px; outline: none; background: #fff; color: #344a42; font-size: 13px; width: 100%; }
.manual-required-field input, .manual-required-field select { border-color: #dca59e; background: #fff8f7; }
.field input[type="checkbox"] { width: auto; padding: 0; flex: 0 0 auto; }
.device-setting-switch { display: inline-flex; align-items: center; gap: 9px; width: fit-content; cursor: pointer; color: #40574e; font-size: 13px; }
.device-setting-switch input { appearance: none; position: relative; width: 42px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: #bdc8c2; cursor: pointer; transition: background .18s ease; }
.device-setting-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #203e3440; transition: transform .18s ease; }
.device-setting-switch input:checked { background: #39805e; }
.device-setting-switch input:checked::after { transform: translateX(18px); }
.device-setting-switch input:focus-visible { outline: 3px solid #cce5d7; outline-offset: 2px; }
.device-settings-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: 13px; margin-top: 13px; }
.device-settings-row > .device-setting-switch { justify-self: start; }
.device-settings-row + .field { margin-top: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #83ad98; }
.field textarea { resize: vertical; min-height: 72px; }
.archive-date-control { position: relative; display: flex; gap: 6px; }
.archive-date-control .archive-date-native { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.archive-authorities { white-space: pre-line; }
.field.full { grid-column: 1/-1; }
.device-assignment-box { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; }
.device-assignment-option { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #edf1ef; color: #40574e; font-size: 13px; }
.device-assignment-option:last-child { border-bottom: 0; }
.device-assignment-option span { min-width: 0; }
.device-assignment-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.modal-backdrop { position: fixed; z-index: 1000; inset: 0; background: rgba(17,40,33,.45); display: grid; place-items: center; padding: 20px; animation: fadein .15s ease; }
.modal { width: min(600px,100%); max-height: min(88vh,850px); overflow: auto; border-radius: 8px; background: white; box-shadow: 0 24px 80px #112e2460; animation: rise .18s ease; }
.modal.export-config-modal { width: min(920px,100%); }
.modal.sampling-order-modal { width: min(960px,100%); }
.sampling-wide { grid-column: 1 / -1; }
.sampling-line { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 16px 0; }
.sampling-line-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sampling-line h3 { margin: 0 0 12px; font-size: 15px; }
.sampling-item-options { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; padding: 8px; }
.sampling-item-option { display: flex; align-items: center; gap: 6px; padding: 5px; }
.sampling-item-option input { width: auto; }
.sampling-item-option small { color: var(--muted); }
.sampling-selected-items, .sampling-photo-inputs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sampling-chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 4px; padding: 4px 8px; background: #edf6f1; }
.sampling-chip button { border: 0; background: none; cursor: pointer; }
.sampling-photos { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.sampling-photos > div, .sampling-photos > a { display: grid; width: 120px; gap: 5px; overflow-wrap: anywhere; }
.sampling-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; }
.sampling-new-subject { margin: 12px 0; padding: 12px; background: #f5f8f6; border-radius: 4px; }
.sampling-new-subject summary { cursor: pointer; margin-bottom: 10px; }
.sampling-summary { min-width: 160px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; }
.export-scope-options { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 6px 0 12px; }
.export-scope-options label, .export-field-option { display: flex; align-items: center; gap: 8px; color: #526860; font-size: 14px; }
.export-count-note { margin: 10px 0 16px; padding: 12px 14px; border: 1px solid #b9dff7; border-radius: 5px; background: #edf8ff; color: #405a69; font-size: 14px; }
.export-count-note strong { color: #d74444; font-size: 19px; }
.export-template-row { display: flex; align-items: center; gap: 9px; margin: 12px 0 15px; }
.export-template-row select, .export-template-row input { min-width: 0; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); }
.export-template-row select { flex: 1; }
.export-template-row .btn { height: 36px; padding-top: 0; padding-bottom: 0; }
.export-field-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px 16px; padding: 12px 0; }
.export-field-option { min-width: 0; }
.export-field-order { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 10px; background: #e8f3ff; color: #1769aa; font-size: 12px; font-weight: 700; }
.export-field-option input, .export-scope-options input { accent-color: #2589e8; }
@media (max-width: 650px) { .export-field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .export-template-row { align-items: stretch; flex-direction: column; } }
.modal-head { position: sticky; top: 0; z-index: 2; background: white; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { border: 0; background: none; color: #74847d; font-size: 21px; line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #edf1ef; padding: 13px 20px; }
.report-preview-toolbar { position: sticky; top: -18px; z-index: 3; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: -18px -20px 14px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.report-draft-fields { margin: 16px 0; }
.report-preview-toolbar .report-refresh { color: #fff; background: #2463a7; border-color: #2463a7; }
.report-preview-toolbar .report-confirm { color: #fff; background: #157347; border-color: #157347; }
.report-preview-toolbar .report-download { color: #fff; background: #2463a7; border-color: #2463a7; text-decoration: none; }
.report-preview-toolbar .report-close { color: #fff; background: #6c757d; border-color: #6c757d; }
.report-preview-toolbar button:disabled { color: #777; background: #e5e7eb; border-color: #d1d5db; cursor: not-allowed; }
.report-draft-preview { max-height: 65vh; overflow: auto; padding: 12px; background: #dfe3e8; }
.report-draft-preview canvas { display: block; max-width: 100%; height: auto; margin: 0 auto 12px; background: #fff; }
@media print { .report-draft-preview { display: none !important; } }
.report-draft-fields h3 { margin: 0 0 12px; font-size: 15px; }
.report-draft-record { padding: 12px 0; border-top: 1px solid var(--line); }
.report-draft-record h4 { margin: 0 0 10px; font-size: 13px; }
.report-draft-fields .field textarea { min-height: 40px; height: 40px; line-height: 18px; }
.report-draft-split { margin: 0 0 12px; padding: 10px 12px; background: #fff7e6; border: 1px solid #f5d38b; border-radius: 6px; font-size: 13px; }
.report-split-hint { margin-bottom: 8px; }
.report-split-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.report-split-choice { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 12px; background: #fff; border: 1px solid #e3d3ad; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.report-split-choice:hover:not(:disabled) { border-color: #79aa91; }
.report-split-choice.active { border: 2px solid #2f6f58; background: #eef6f1; padding: 9px 11px; }
.report-split-choice:disabled { cursor: not-allowed; opacity: .6; }
.report-split-count { color: #4c5f57; font-size: 12px; }
.report-split-count b { color: #2f6f58; font-size: 14px; }
.report-split-labels { color: #8a978f; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-split-choice { position: relative; transition: border-color .15s, background .15s, opacity .15s; }
.report-split-choice.loading, .report-split-choice.loading:disabled { opacity: 1; cursor: progress; border: 2px dashed #2f6f58; padding: 9px 11px; background: #f6fbf8; }
.report-split-choice.loading::after { content: ""; position: absolute; top: 10px; right: 10px; width: 14px; height: 14px; border: 2px solid #2f6f58; border-right-color: transparent; border-radius: 50%; animation: export-spin .8s linear infinite; }
.report-draft-record, .report-draft-preview { transition: opacity .2s ease, filter .2s ease; }
.report-draft-fields:not(.report-split-switching) .report-draft-record { animation: rise .25s ease; }
.report-split-switching .report-draft-record, .report-draft-preview.report-split-switching { opacity: .35; filter: grayscale(.6); pointer-events: none; }
.report-draft-fields.report-split-switching > h3::after { content: "正在重新拆分报告…"; margin-left: 10px; color: #2f6f58; font-size: 12px; font-weight: normal; animation: fadein .2s ease; }
.report-split-choice.active.loading .report-split-count::after { content: " · 正在生成预览…"; color: #2f6f58; }
.report-confirm.report-generating, .report-confirm.report-generating:disabled { position: relative; opacity: 1; cursor: progress; padding-left: 34px; }
.report-confirm.report-generating::before { content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; margin-top: -9px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: export-spin .8s linear infinite; }
.report-generating .report-draft-split, .report-generating .report-draft-record, .report-draft-preview.report-generating { opacity: .35; filter: grayscale(.6); pointer-events: none; }
.report-draft-fields.report-generating > h3::after { content: "正在生成并保存检测报告，请稍候…"; margin-left: 10px; color: #2f6f58; font-size: 12px; font-weight: normal; animation: fadein .2s ease; }
.report-draft-preview.report-generating { position: relative; }
.report-draft-preview.report-generating::before { content: ""; position: sticky; display: block; top: 40%; z-index: 2; width: 32px; height: 32px; margin: 0 auto -32px; border: 3px solid #2f6f58; border-right-color: transparent; border-radius: 50%; animation: export-spin .8s linear infinite; }
.report-download-list { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.report-download-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #4c5f57; font-size: 13px; }
.report-preview-toolbar .report-download-all { flex: none; color: #fff; background: #157347; border-color: #157347; text-decoration: none; }
.report-preview-toolbar:has(.report-download-list) { position: static; }
.report-download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.report-download-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; color: #1d4f86; background: #f2f7fd; border: 1px solid #c9dcf1; border-radius: 5px; text-decoration: none; font-size: 13px; transition: background .15s, border-color .15s; }
.report-download-item:hover, .report-download-item:focus-visible { background: #e2eefb; border-color: #2463a7; }
.report-download-item b { flex: none; padding: 1px 6px; color: #fff; background: #2463a7; border-radius: 3px; font-size: 12px; font-weight: 600; }
.report-download-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-download-item i { flex: none; font-style: normal; color: #2463a7; }
.report-preview-toolbar .report-close { align-self: flex-start; }
.report-draft-preview.loading { display: flex; flex-direction: column; min-height: 260px; }
.report-draft-preview.loading canvas { opacity: .35; filter: grayscale(.6); }
.report-draft-preview.loading::before { content: ""; order: -2; position: sticky; top: 0; z-index: 1; flex: none; width: 30px; height: 30px; margin: 40px auto 10px; border: 3px solid #c9dcf1; border-top-color: #2463a7; border-radius: 50%; animation: export-spin .8s linear infinite; }
.report-draft-preview.loading::after { content: attr(data-loading); order: -1; position: sticky; top: 42px; z-index: 1; align-self: center; margin-bottom: 16px; padding: 4px 12px; color: #1d4f86; background: rgba(255,255,255,.92); border-radius: 12px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .report-draft-preview.loading::before, .report-confirm.report-generating::before, .report-draft-preview.report-generating::before { animation: none; }
  .report-split-choice.loading::after, .report-draft-fields:not(.report-split-switching) .report-draft-record { animation: none; }
  .report-draft-record, .report-draft-preview, .report-split-choice { transition: none; }
}
.modal-note { background: #f5f8f6; border-left: 3px solid #79aa91; padding: 10px 12px; color: #697b73; font-size: 12px; line-height: 1.7; margin-bottom: 14px; }
.device-credential-warning { background: #fff4e5; border-left-color: #c56a12; color: #87420b; font-size: 13px; }
.device-credential-warning > strong { display: block; margin-bottom: 6px; font-size: 15px; }
.toast { position: fixed; z-index: 1100; right: 24px; bottom: 24px; background: #204e40; color: white; padding: 12px 16px; border-radius: 5px; box-shadow: var(--shadow); font-size: 14px; animation: rise .18s ease; }
.toast.warn { background: #8d562e; }
.prototype-tag { position: fixed; bottom: 13px; left: 259px; z-index: 4; color: #72827a; background: #ffffffd9; border: 1px solid #dfe7e3; border-radius: 3px; padding: 5px 8px; font-size: 11px; pointer-events: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1100px) {
  .app { grid-template-columns: 218px minmax(0,1fr); }
  .content { padding: 23px 22px 38px; }
  .topbar { padding: 0 22px; }
  .overview-grid { grid-template-columns: minmax(0,1.4fr) minmax(250px,.9fr); }
  .prototype-tag { left: 230px; }
}
@media (max-width: 800px) {
  .app { display: block; }
  .sidebar { position: fixed; left: -260px; z-index: 20; width: 246px; transition: left .2s ease; box-shadow: 12px 0 28px #183b3430; }
  .sidebar.open { left: 0; }
  .topbar { height: 58px; padding: 0 14px; }
  .mobile-menu { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); background: white; border-radius: 5px; color: var(--green); margin-right: 10px; }
  .crumb-wrap { display: flex; align-items: center; }
  .top-actions { gap: 6px; }
  .top-select, .top-actions .icon-btn { display: none; }
  .search { width: min(40vw,190px); }
  .content { padding: 21px 15px 52px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  h1 { font-size: 24px; }
  .overview-grid, .device-layout, .report-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .stat { min-height: 101px; padding: 13px; }
  .stat-number { font-size: 27px; }
  .device-status-item { padding: 12px 9px; }
  .device-status-item strong { font-size: 18px; }
  .settings-grid { grid-template-columns: 1fr; }
  .permission-layout { grid-template-columns: 1fr; }
  .permission-list { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; gap: 3px; }
  .settings-link { width: auto; white-space: nowrap; }
  .prototype-tag { bottom: 7px; left: 9px; }
  .chart { height: 173px; }
}
@media (max-width: 430px) {
  .search { width: 36vw; }
  .crumb { display: none; }
  .crumb strong { margin: 0; }
  .stats { gap: 7px; }
  .stat-label { font-size: 12px; }
  .stat-foot { font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .table-controls { padding: 10px; }
  .banner { align-items: flex-start; }
}
:is(#content, #modalRoot) [hidden] { display: none !important; }
.permission-tree { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.permission-tree-tools { display: flex; justify-content: flex-end; gap: 12px; align-items: center; padding: 10px; background: var(--bg); position: sticky; top: 0; z-index: 1; }
.permission-group { border-top: 1px solid var(--line); padding: 8px 10px; }
.permission-group summary { cursor: pointer; font-weight: 600; }
.permission-navigation { margin: 8px 0 8px 20px; }
.permission-module { margin: 8px 0 8px 20px; }
.permission-module-title { font-weight: 600; }
.permission-module-row { display: flex; gap: 16px; margin: 8px 0 8px 20px; overflow-x: auto; }
.permission-module-row .permission-module { flex: 0 0 auto; margin: 0; }
.permission-module-row .permission-operations { flex-wrap: nowrap; padding: 0; }
.permission-module-row label { white-space: nowrap; }
.permission-operations { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0 4px 20px; }
.permission-tree label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.permission-tree input:disabled + span { opacity: .5; }
