:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #172033;
  background: #f4f7fb;
  --blue: #1f4e78;
  --mid: #3979ad;
  --line: #dce5ee;
  --control-line: #7a8b9e;
  --muted: #5b6b7e;
  --green: #256b48;
  --red: #b42318;
  --amber: #8a5200;
  --surface: #ffffff;
  --wash: #f4f7fb;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 28px 20px 64px; color: white; background: linear-gradient(180deg, #173d5e, #102e49); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.brand span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #4ba3d3; font-weight: 700; }
nav, .nav-area { display: grid; gap: 5px; }
nav { margin-top: 32px; }
.mobile-menu-button { display: none; }
.nav-area + .nav-area { margin-top: 10px; }
.nav-label { margin: 19px 12px 5px; color: #a8c0d4; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.nav-label:first-child { margin-top: 0; }
nav a { display: block; position: relative; color: #c8d8e7; text-decoration: none; padding: 10px 14px; border-radius: 9px; }
nav a:hover, nav a.active { color: white; background: rgb(255 255 255 / 10%); }
nav a.active::before { position: absolute; top: 9px; bottom: 9px; left: 0; width: 3px; border-radius: 3px; background: #63c1ef; content: ""; }
.nav-group summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 9px; color: #c8d8e7; cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker, .create-panel summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "›"; font-size: 19px; transform: rotate(0); transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group summary:hover, .nav-group.contains-active > summary { color: white; background: rgb(255 255 255 / 7%); }
.nav-children { display: grid; gap: 3px; padding: 5px 0 8px 12px; }
.nav-children a { padding: 9px 12px; font-size: 13px; }
nav a:focus-visible, .nav-group summary:focus-visible, .create-panel summary:focus-visible { outline: 2px solid #63c1ef; outline-offset: 2px; }
.version { margin: 28px 14px 0; color: #8eabc2; font-size: 12px; }
main { width: 100%; max-width: 1680px; padding: 30px clamp(24px, 4vw, 64px) 80px; min-width: 0; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions button { padding: 8px 12px; color: var(--blue); background: #edf4fa; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; }
h2 { margin-bottom: 6px; font-size: 21px; }
h3 { font-size: 16px; }
.eyebrow { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.page-breadcrumb { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.status { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 13px; }
.status.ok { color: var(--green); border-color: #b8dbc8; background: #effaf4; }
.workspace-section { display: none; margin-bottom: 44px; }
.workspace-section.active { display: block; animation: workspace-in .18s ease-out; }
@keyframes workspace-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
.section-title p { margin-bottom: 0; color: var(--muted); }
.section-actions { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 14px; }
.metric, .center, .panel { border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 30px rgb(31 78 120 / 5%); }
.metric { padding: 18px; }
.metric b { display: block; margin-top: 9px; color: var(--blue); font-size: 27px; }
.metric span { color: var(--muted); font-size: 13px; }
.centers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.center { padding: 18px; }
.center div { display: flex; justify-content: space-between; gap: 8px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-top: 18px; }
.quick-actions a { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 14px; color: #172033; background: white; text-decoration: none; box-shadow: 0 8px 30px rgb(31 78 120 / 5%); }
.quick-actions a:hover { border-color: #9fc7e2; box-shadow: 0 12px 34px rgb(31 78 120 / 10%); transform: translateY(-1px); }
.quick-actions span { grid-row: 1 / 3; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--blue); background: #edf4fa; font-size: 12px; font-weight: 700; }
.quick-actions strong { font-size: 14px; }
.quick-actions small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.badge { padding: 4px 8px; border-radius: 999px; background: #eef4f9; color: var(--blue); font-size: 11px; white-space: nowrap; }
/* 状态标记：按业务严重度着色，运维人员不必逐字读优先级。 */
.status-tag { display: inline-block; padding: 2px 9px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.status-tag.sev-ok { color: #1c5638; background: #eaf6ef; border-color: #b8dbc8; }
.status-tag.sev-warn { color: var(--amber); background: #fdf4e6; border-color: #eccf9c; }
.status-tag.sev-danger { color: var(--red); background: #fdf3f2; border-color: #e0b3ae; }
.status-tag.sev-info { color: var(--blue); background: #edf4fa; border-color: #bcd7ec; }
.status-tag.sev-neutral { color: #4c5b6d; background: #eef1f5; border-color: #d5dde6; }
.panel { padding: 22px; }
.workspace-section > .panel, .create-panel { margin-bottom: 16px; }
.single-form { max-width: 920px; }
.create-panel summary { color: var(--blue); cursor: pointer; font-weight: 700; list-style: none; }
.create-panel summary::before { content: "+"; display: inline-block; margin-right: 9px; font-size: 18px; }
.create-panel[open] summary::before { content: "−"; }
.create-panel > form { max-width: 920px; margin-top: 20px; }
.create-panel > form > h3 { display: none; }
.export-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.export-form > select { width: auto; min-width: 200px; }
.export-form label { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.form-grid > form, .form-grid > .panel { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 30px rgb(31 78 120 / 5%); }
.form-grid.two { grid-template-columns: repeat(2, minmax(340px, 1fr)); }
.compact { box-shadow: none; }
.split { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr); gap: 34px; }
label { display: grid; gap: 7px; margin-bottom: 14px; color: #3d4c5d; font-size: 13px; }
input, select { width: 100%; min-height: 41px; padding: 10px 11px; border: 1px solid var(--control-line); border-radius: var(--radius-sm); background: white; font: inherit; }
select[multiple] { min-height: 118px; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
button { padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); color: white; background: var(--blue); font: inherit; cursor: pointer; }
button:hover:not(:disabled) { background: #173d5e; }
button:focus-visible, .button-link:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button:disabled, .button-link[aria-disabled="true"] { color: #5b6b7e; background: #e4ebf2; border-color: #ccd8e3; cursor: not-allowed; opacity: 1; }
button.secondary { color: var(--blue); background: white; border-color: #9fc7e2; }
button.secondary:hover:not(:disabled) { background: #edf4fa; }
button.danger { color: var(--red); background: white; border-color: #e0b3ae; }
button.danger:hover:not(:disabled) { background: #fdf3f2; }
.message { min-height: 22px; margin: 10px 0 0; color: var(--green); font-size: 13px; }
.record-list { display: grid; gap: 9px; }
.record { display: flex; justify-content: space-between; gap: 20px; padding: 12px 14px; border: 1px solid #e3eaf1; border-radius: 9px; }
.record strong { display: block; margin-bottom: 3px; }
.record small, .muted { color: var(--muted); }
.empty { padding: 32px 12px; color: var(--muted); text-align: center; border: 1px dashed #ced9e4; border-radius: 9px; }
.error { color: #b42318; }
.data-table { overflow-x: auto; }
.data-table table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid #e7edf3; text-align: left; vertical-align: top; }
.data-table th { color: #4c5b6d; background: #f7f9fc; font-weight: 600; white-space: nowrap; }
.data-table td { white-space: normal; overflow-wrap: break-word; }
.data-table tbody tr:hover { background: #f7fafd; }
.table-actions, .dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-actions button { padding: 6px 9px; font-size: 12px; white-space: nowrap; color: var(--blue); background: white; border-color: #9fc7e2; }
.table-actions button:hover:not(:disabled) { background: #edf4fa; }
.table-actions button[data-next-status="disabled"] { color: var(--red); border-color: #e0b3ae; }
.table-actions button[data-next-status="disabled"]:hover:not(:disabled) { background: #fdf3f2; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.export-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.export-row a { padding: 9px 13px; border-radius: 8px; color: var(--blue); background: #edf4fa; text-decoration: none; }
.button-link { padding: 9px 13px; border-radius: 8px; color: var(--blue); background: #edf4fa; text-decoration: none; font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.stat-card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); }
.warning-open { border-left: 4px solid #d97706; }
dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgb(0 0 0 / 25%); overflow: auto; }
dialog::backdrop { background: rgb(15 32 50 / 55%); backdrop-filter: blur(3px); }
dialog form { padding: 28px; }
#detail-dialog { overflow: hidden; }
#detail-dialog[open] { display: flex; flex-direction: column; }
.detail-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.detail-dialog-header strong { min-width: 0; overflow-wrap: anywhere; }
.detail-dialog-header button { flex: 0 0 auto; }
#maintenance-detail { padding: 28px; overflow-y: auto; min-height: 0; }
#maintenance-detail p { color: #536477; line-height: 1.7; }
.integration-panel { margin-top: 16px; }
#reporting-detail dl { margin: 0; }
#reporting-detail dl div { display: grid; grid-template-columns: minmax(100px, 180px) 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
#reporting-detail dt { color: var(--muted); }
#reporting-detail dd { margin: 0; overflow-wrap: anywhere; }
#reporting-current, #reporting-config { overflow-wrap: anywhere; line-height: 1.7; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.table-filter { display: flex; flex: 1; gap: 8px; }
.table-filter input { max-width: 360px; min-width: 0; min-height: 36px; }
.table-filter button, .pager button { padding: 8px 12px; flex-shrink: 0; white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.task-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.task-summary p { margin: 5px 0 0; }
.compact-metrics { grid-template-columns: repeat(5, minmax(100px, 1fr)); margin-bottom: 16px; }
.settings-form { max-width: 720px; }
.rule-management { margin-top: 18px; }
.rule-management td { white-space: normal; overflow-wrap: anywhere; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 9px; object-fit: cover; }
.timeline { display: grid; gap: 9px; margin-bottom: 20px; }
.timeline div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 20px; }
  .mobile-menu-button { display: block; background: rgb(255 255 255 / 12%); }
  #navigation-toggle[aria-expanded="false"] + nav { display: none; }
  nav { grid-column: 1 / -1; }
  nav { grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
  .nav-area { display: contents; }
  .nav-label { grid-column: 1 / -1; margin: 14px 4px 2px; }
  .version { display: none; }
  .metrics, .centers, .quick-actions, .form-grid, .form-grid.two, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}

.task-job-list { display: grid; gap: 10px; margin-top: 16px; }
.task-job { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.task-job small { display: block; color: var(--muted); margin-top: 5px; }
.notification-unread { background: #f0f8f5; border-left: 3px solid var(--blue); }
.report-panel { margin-top: 18px; }
.report-panel .section-title { align-items: center; }
.trend-chart { display: flex; height: 155px; gap: 8px; overflow-x: auto; padding-top: 12px; }
.trend-column { flex: 1; min-width: 36px; text-align: center; }
.trend-column small { font-size: 11px; color: var(--muted); }
.trend-bars { display: flex; align-items: flex-end; justify-content: center; height: 115px; gap: 3px; border-bottom: 1px solid var(--line); }
.trend-bars span { width: 12px; min-height: 0; border-radius: 3px 3px 0 0; }
.trend-bars .new-install { background: var(--blue); }
.trend-bars .replacement { background: #22a479; }
#export-list td { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 620px) {
  nav { grid-template-columns: 1fr 1fr; }
  header { flex-direction: column; align-items: stretch; gap: 14px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-start; }
  .metrics, .centers, .quick-actions, .form-grid, .form-grid.two, .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .table-toolbar, .task-summary { align-items: stretch; flex-direction: column; }
  .pager { justify-content: space-between; }
  .photo-grid, .timeline div { grid-template-columns: 1fr; }
  .task-job { align-items: stretch; flex-direction: column; }
  #reporting-detail dl div { grid-template-columns: 1fr; gap: 5px; }
  .section-title { flex-direction: column; align-items: stretch; gap: 10px; }
  .section-title button { align-self: flex-start; }
}

/* 备份通过系统管理的独立页面进入。 */
.backup-panel { margin-top: 20px; }
.correction-confirm { display: flex; gap: 8px; align-items: center; }
.correction-confirm input[type="checkbox"] { width: auto; flex: none; }
.workspace-load-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px;color:var(--muted);font-size:13px}.workspace-load-bar p{margin:0;overflow-wrap:anywhere}.workspace-load-bar .error{color:#b42318}.workspace-load-bar button{white-space:nowrap}.data-table td{overflow-wrap:break-word}.preview-pager{display:flex;gap:10px;align-items:center;justify-content:center;margin:16px 0}
.bulk-lines { display:grid; gap:14px; margin:14px 0; }
.bulk-line { padding:16px; border:1px solid var(--line, #dce3ea); border-radius:10px; min-width:0; }
.bulk-line-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.bulk-line .form-row { margin-bottom:8px; }
#filter-bulk-result { overflow-wrap:anywhere; }
