:root {
  color-scheme: light;
  --paper: #f4f6f8;
  --surface: #fff;
  --text: #172522;
  --muted: #51625d;
  --line: #d9e2df;
  --accent: #11634f;
  --accent-hover: #084c3b;
  --danger: #a82c35;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--paper); }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; }
button, a, input, select, summary { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #187c62; }
form, dl, dd { margin: 0; }
h1, h2, p { margin: 0 0 1rem; }
h1 { font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.025em; line-height: 1.25; }
h2 { font-size: 1.125rem; }
code { font-family: Consolas, "SFMono-Regular", monospace; unicode-bidi: isolate; }

.wrap { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.masthead { background: #102723; color: #f7fcfa; }
.nav { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: inherit; text-decoration: none; font-weight: 700; }
.brand:hover { color: #d1f9eb; }
main.wrap { padding-block: 32px 60px; }
main.narrow { width: min(540px, calc(100% - 40px)); padding-top: clamp(40px, 9vw, 100px); }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-heading h1, .section-heading h2, .page-heading p { margin-bottom: 0; }
.page-heading p { margin-top: 8px; }
.dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.panel { min-width: 0; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.records { margin-top: 18px; }
.stack { display: grid; gap: 15px; justify-items: start; }
.stack label, .two-fields { width: 100%; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: .9rem; font-weight: 600; }
label input, label select { display: block; width: 100%; margin-top: 5px; }
input, select { min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #b7c8c0; border-radius: 6px; color: var(--text); background: white; }
input::placeholder { color: #657570; }
button, .button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; color: white; background: var(--accent); text-decoration: none; font-weight: 650; cursor: pointer; }
button:hover, .button:hover { color: white; background: var(--accent-hover); }
.secondary { color: var(--accent); background: #f1f8f5; border-color: #bbd0c8; }
.secondary:hover { color: var(--accent-hover); background: #e4f2ec; }
.quiet { background: transparent; color: #d3ebe3; padding-inline: 8px; }
.quiet:hover { background: #25423b; }
.danger { color: white; background: var(--danger); }
.danger:hover { background: #861f28; }
.hint, .muted, .empty, .subline, dt, time { color: var(--muted); }
.hint, .subline { display: block; margin-top: 4px; font-size: .83rem; font-weight: 400; }
.product-list, .event-list { list-style: none; padding: 0; margin: 18px 0 0; }
.product-list li, .event-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 14px; padding: 9px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.product-list code, .event-list time { font-size: .85rem; }
.filters, .actions, .pager { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.actions, .pager { margin-top: 18px; gap: 16px; }
.filters input { min-width: 180px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .9rem; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #354740; background: #f3f7f5; white-space: nowrap; }
td:not(.note) { white-space: nowrap; }
td.note { min-width: 105px; max-width: 260px; overflow-wrap: anywhere; }
.empty { margin-bottom: 0; padding-top: 8px; }
.status { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: .84rem; font-weight: 650; white-space: nowrap; }
.status.active { background: #dff3e9; color: #13523d; }
.status.stopped { background: #fbeaec; color: #8d202a; }
.back { display: inline-block; margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.facts dt { font-size: .84rem; margin-bottom: 2px; }
.facts dd { overflow-wrap: anywhere; }
.confirm { margin-top: 14px; font-size: .9rem; }
.confirm summary { cursor: pointer; color: var(--danger); }
.confirm p, .confirm form { margin: 8px 0 0; }
td .confirm { margin-top: 0; }
.code-input { font-family: Consolas, monospace; color: #124637; background: #eff8f3; }
.error { color: var(--danger); margin: 0; }

@media (max-width: 720px) {
  .dashboard-grid, .facts { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; }
  .filters input { flex: 1; min-width: 130px; }
  .responsive-table table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-table tbody tr { margin-top: 10px; padding: 8px 0; border: 1px solid var(--line); border-radius: 6px; }
  .responsive-table tbody tr:first-child { margin-top: 0; }
  .responsive-table td { position: relative; max-width: none; min-height: 32px; padding: 5px 10px 5px 6.25rem; border: 0; overflow-wrap: anywhere; }
  .responsive-table td:not(.note) { white-space: normal; }
  .responsive-table td::before { position: absolute; left: 10px; content: attr(data-label); color: var(--muted); }
}

@media (max-width: 390px) {
  .wrap, main.narrow { width: calc(100% - 24px); }
  .filters input { flex-basis: 100%; }
}
