:root {
  color-scheme: dark;
  --ink: #f4f8f6;
  --muted: #8fa29c;
  --surface: rgba(19, 30, 28, .84);
  --line: rgba(190, 232, 216, .14);
  --accent: #67f0ba;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 12% -10%, rgba(40, 141, 111, .3), transparent 35%), radial-gradient(circle at 94% 5%, rgba(46, 98, 139, .25), transparent 30%), #07110f;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.shell { width: min(1480px, calc(100% - 40px)); margin: auto; padding: 40px 0 64px; }
header, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
header { margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font: 700 11px/1.2 monospace; letter-spacing: .22em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 52px); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stats article, .panel, .record-card { border: 1px solid var(--line); background: var(--surface); box-shadow: 0 20px 50px rgba(0, 0, 0, .16); }
.stats article { min-height: 116px; padding: 20px; border-radius: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.stats span, label, dt, .result-heading p { color: var(--muted); font-size: 13px; }
.stats strong { font-size: clamp(21px, 2.5vw, 31px); }
.panel { border-radius: 16px; padding: 16px; }
.filters { display: grid; grid-template-columns: 1.3fr .8fr 1fr 1fr auto; gap: 12px; align-items: end; }
label { display: grid; gap: 7px; }
input, select { width: 100%; height: 42px; padding: 0 12px; color: var(--ink); background: #0a1513; border: 1px solid var(--line); border-radius: 10px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
.primary, .quiet { min-height: 42px; padding: 0 18px; border-radius: 10px; }
.primary { border: 0; color: #09231a; background: var(--accent); font-weight: 750; }
.quiet { color: var(--ink); border: 1px solid var(--line); background: rgba(255, 255, 255, .035); }
button:disabled { opacity: .45; }

.result-heading { margin: 34px 0 16px; }
.pages { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.records-scroll { overflow-x: auto; padding-bottom: 8px; }
.records-stage { min-width: 1040px; }
.slot-headings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 10px; }
.slot-headings span { padding: 10px 14px; color: var(--accent); border: 1px solid var(--line); border-radius: 10px; background: rgba(103, 240, 186, .055); font: 750 13px/1 monospace; text-align: center; }
.record-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; }
.record-card { min-width: 0; overflow: hidden; border-radius: 16px; }
.image-link { position: relative; display: block; height: 220px; overflow: hidden; background: #10201c; }
.image-link img { width: 100%; height: 100%; object-fit: cover; }
.image-error::after { content: "OSS 图片暂不可访问"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.image-error img { display: none; }
.badge { position: absolute; top: 12px; left: 12px; padding: 5px 9px; border-radius: 7px; color: #07110f; background: var(--accent); font: 800 12px/1 monospace; }
.body { padding: 17px; }
.title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.title time { color: var(--muted); font-size: 12px; text-align: right; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }
dt { margin-bottom: 4px; }
dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.record-id { display: block; margin-top: 16px; padding-top: 13px; overflow: hidden; color: #8fbfad; border-top: 1px solid var(--line); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.empty { padding: 72px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 16px; }

dialog { width: min(440px, calc(100% - 32px)); padding: 0; color: var(--ink); background: #101d1a; border: 1px solid var(--line); border-radius: 18px; }
dialog::backdrop { background: rgba(2, 8, 7, .82); }
dialog form { display: grid; gap: 16px; padding: 28px; }
dialog p, dialog h2 { margin-bottom: 0; }
.login-help { color: var(--muted); font-size: 13px; }
.error { color: #ff8e8e; }

@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .records-stage { min-width: 920px; }
}

@media (max-width: 680px) {
  .shell { width: calc(100% - 24px); padding-top: 24px; }
  header, .result-heading { align-items: flex-start; flex-direction: column; }
  .stats, .filters { grid-template-columns: 1fr; }
  .image-link { height: 200px; }
}
