:root {
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  background: #f2f5f9;
  color: #1a293a;
  line-height: 1.55;
  --line: #dbe4ee;
  --muted: #4d6177;
  --blue: #19537e;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); }
button, input, select { font: inherit; }
button, input, select { min-height: 42px; border-radius: 6px; }
input, select { width: 100%; border: 1px solid #9db1c5; background: white; padding: 8px 10px; color: inherit; }
button { padding: 7px 17px; border: 1px solid transparent; background: var(--blue); color: #fff; font-weight: 600; cursor: pointer; }
button:hover { background: #0b3d61; }
:focus-visible { outline: 2px solid #176eae; outline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; }
h1 { margin: 0; font-size: clamp(24px, 4vw, 36px); letter-spacing: -.025em; }
h2 { margin: 0 0 16px; font-size: 19px; }
h3 { margin: 16px 0 7px; font-size: 15px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-panel { width: min(100%, 430px); background: white; border: 1px solid var(--line); border-radius: 12px; padding: 30px; }
.login-panel p { margin: 12px 0 20px; color: var(--muted); }
.login-form { display: grid; gap: 15px; }
label { display: grid; gap: 4px; color: #384c61; font-size: 14px; font-weight: 600; }

.top-bar { background: #162b41; color: #f3f7fc; }
.top-content { width: min(1180px, 100% - 32px); margin: auto; min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.top-content > span { font-weight: 700; }
.quiet { background: transparent; padding: 5px 10px; border: 1px solid #6e899f; font-size: 14px; }
.quiet:focus-visible { outline-color: white; }
.dashboard { width: min(1180px, 100% - 32px); margin: 30px auto 48px; }
.scope, .empty { color: var(--muted); }
.scope { margin: 8px 0 20px; font-size: 14px; }
.empty { margin: 5px 0; }
.error-message, .login-panel p.error-message { color: #8c2118; background: #fff0ed; padding: 10px; border-radius: 6px; }

.filters { display: grid; grid-template-columns: minmax(135px, 1.15fr) minmax(120px, .9fr) minmax(180px, 1.3fr) 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 22px; }
.filter-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.panel { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 13px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 610px; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 9px; vertical-align: top; }
thead th { color: #3c5369; background: #edf3f8; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
code { font-size: .88em; color: #435970; overflow-wrap: anywhere; }

.entry + .entry { border-top: 1px solid var(--line); }
.entry summary { cursor: pointer; padding: 10px 0; }
.entry summary small { color: var(--muted); margin-inline: 8px; }
.entry-time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.entry[open] summary { color: var(--blue); }
.entry-content { background: #f3f7fb; border-radius: 6px; padding: 13px; margin-bottom: 10px; }
.measurements { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 8px 13px; margin: 0; }
.measurements dt { color: var(--muted); font-size: 13px; }
.measurements dd { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .login-panel, .panel { padding: 14px; }
  .entry summary small { display: block; margin: 0; }
}
