:root {
  color-scheme: light;
  --paper: #f6f4e8;
  --panel: #fffdf4;
  --ink: #172921;
  --muted: #52665b;
  --green: #37644b;
  --line: #cbd2c3;
  --orange: #ed6c39;
  font: 15px/1.55 system-ui, "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.topbar { border-bottom: 2px solid var(--ink); background: var(--panel); }
.topbar-inner, .top-actions, .page-head, .section-head, .toolbar, .pager {
  display: flex; align-items: center; gap: 12px;
}
.topbar-inner, .page-head, .section-head { justify-content: space-between; }
.topbar-inner { min-height: 68px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.brand span { width: 9px; height: 9px; background: var(--orange); }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: #a24021; }
main { padding-block: 34px 64px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 4vw, 38px); line-height: 1.2; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
button, select, input { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 1px solid var(--line); border-radius: 5px; background: var(--panel); padding: 7px 12px; }
button:hover:not(:disabled) { border-color: var(--green); }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid #a24021; outline-offset: 3px; }
.primary { background: var(--green); border-color: var(--green); color: white; font-weight: 650; }
.primary:hover:not(:disabled) { background: #244b37; }
.subtle { color: var(--green); white-space: nowrap; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.auth { width: min(100%, 430px); margin: 44px auto; padding: 26px; }
.auth h1 { margin-bottom: 16px; font-size: 26px; }
.auth p { margin: 0 0 14px; color: var(--muted); }
form label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input, select { border: 1px solid var(--line); border-radius: 5px; background: white; padding: 8px 10px; min-width: 0; }
input { width: 100%; }
.auth form { display: grid; gap: 12px; }
.auth form button { justify-self: start; }
.status { color: var(--green); font-size: 13px; }
.status:empty { display: none; }
.status.error { color: #a23424; }
.page-head { margin-bottom: 24px; align-items: flex-end; flex-wrap: wrap; }
.view-switch { display: flex; gap: 4px; padding: 3px; background: #e4e8da; border-radius: 6px; }
.view-switch button { background: transparent; border-color: transparent; }
.view-switch [aria-pressed="true"] { background: var(--panel); border-color: var(--line); font-weight: 700; }
.section-head { margin-block: 0 10px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 12px 0 18px; }
.kpi { padding: 14px 18px; color: var(--muted); font-size: 13px; }
.kpi strong { display: block; color: var(--ink); font-size: clamp(23px, 4vw, 36px); line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }
.reports { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.report { padding: 16px; min-width: 0; }
.report h2 { margin-bottom: 10px; }
.table-wrap { overflow: auto; max-height: 490px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; background: #e9eddf; font-weight: 650; }
td, th { padding: 9px 10px; border-bottom: 1px solid #e3e7dc; }
.log-table table { min-width: 465px; }
.log-table td { overflow-wrap: anywhere; }
.log-table td:first-child { white-space: nowrap; }
.metric-section { display: block; color: var(--muted); font-size: 11px; }
progress { display: block; width: 100%; min-width: 45px; height: 6px; accent-color: var(--green); }
.pager { justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.edit-group { margin-top: 10px; padding: 0 15px; }
.edit-group summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 14px; }
.entry { min-width: 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #faf9ef; }
.entry.simple { grid-template-columns: 1fr; }
.entry img, .cover-placeholder { width: 100%; aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: 3px; object-fit: cover; }
.cover-placeholder { display: grid; place-items: center; font-size: 11px; color: var(--muted); background: #e8ebde; }
.entry-fields { min-width: 0; display: grid; gap: 7px; }
.entry-fields input { font-size: 13px; }
.entry-fields input[type="file"] { padding: 5px; font-size: 12px; }
.entry-submit { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 900px) {
  .reports { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  .shell { width: calc(100% - 28px); }
  .edit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  main { padding-top: 22px; }
  .topbar-inner { min-height: 56px; }
  .top-actions { gap: 7px; font-size: 12px; }
  .kpis { gap: 6px; }
  .kpi { padding: 9px; }
  .report { padding: 12px; }
  .entry { grid-template-columns: 64px minmax(0, 1fr); }
}
