:root {
  color-scheme: light;
  --bg: oklch(96.6% .005 145);
  --surface: oklch(99.3% .003 145);
  --ink: oklch(25% .018 160);
  --muted: oklch(47% .018 157);
  --line: oklch(88.5% .01 145);
  --subtle: oklch(95% .009 145);
  --green: oklch(45.5% .088 157);
  --green-soft: oklch(94% .022 155);
  --header: oklch(24% .022 163);
  --header-text: oklch(97% .006 145);
  --header-muted: oklch(77% .018 150);
  --lime: oklch(89.7% .127 120);
  --red: oklch(45% .15 25);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; }
button, input, select { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
button { padding: 8px 13px; cursor: pointer; }
button:hover:not(:disabled) { background: var(--green-soft); border-color: var(--green); }
button:active:not(:disabled) { background: var(--subtle); }
button:disabled { cursor: default; color: var(--muted); opacity: .55; }
input, select { padding: 8px 10px; width: 100%; }
input[aria-invalid="true"] { border-color: var(--red); }
a { color: var(--green); text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.site-header :focus-visible, .skip-link:focus-visible { outline-color: var(--lime); }
.skip-link { position: absolute; z-index: 10; left: 16px; top: -80px; background: var(--header); color: var(--header-text); padding: 10px 16px; }
.skip-link:focus { top: 12px; }
.site-header { background: var(--header); color: var(--header-text); }
.header-inner { max-width: 1320px; margin: auto; padding: 24px 22px 27px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.back-link { color: var(--header-muted); font-size: 13px; text-decoration: none; }
.back-link:hover { color: var(--header-text); text-decoration: underline; }
.title-line { display: flex; align-items: center; gap: 13px; margin-top: 15px; }
h1 { margin: 0; font-size: 34px; line-height: 1.35; letter-spacing: .02em; }
.readonly-badge { color: var(--lime); border: 1px solid oklch(48% .03 150); border-radius: 5px; padding: 1px 7px; font-size: 12px; }
.header-inner p { color: var(--header-muted); margin: 6px 0 0; }
.archive-stamp { padding-bottom: 3px; flex-shrink: 0; }
.archive-stamp span, .archive-stamp strong { display: block; }
.archive-stamp span { color: var(--header-muted); font-size: 12px; }
.archive-stamp strong { margin-top: 5px; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.header-actions { display: flex; align-items: flex-end; gap: 20px; }
.header-actions > button { border-color: oklch(48% .03 150); color: var(--header-text); background: transparent; font-size: 12px; }
.header-actions > button:hover:not(:disabled) { color: var(--header-text); background: oklch(32% .03 150); border-color: var(--header-muted); }
.mode-nav { max-width: 1320px; padding: 0 22px; margin: auto; display: flex; gap: 28px; }
.mode-nav a { display: inline-block; color: var(--header-muted); padding: 10px 0 12px; border-bottom: 3px solid transparent; text-decoration: none; }
.mode-nav a[aria-current="page"] { color: var(--header-text); border-bottom-color: var(--lime); }
.mode-nav a:hover { color: var(--header-text); }
.login-panel { max-width: 470px; margin: 26px auto 60px; padding: 28px 30px 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.login-kicker { display: block; color: var(--green); font-size: 12px; margin-bottom: 9px; }
.login-panel > p { color: var(--muted); margin: 11px 0 23px; font-size: 13px; }
.login-panel form { display: flex; flex-direction: column; gap: 15px; }
.login-panel label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.login-panel input { font-size: 16px; }
.login-panel button { background: var(--green); border-color: var(--green); color: var(--header-text); }
.login-panel button:hover:not(:disabled) { background: oklch(39% .07 157); color: var(--header-text); }
.login-panel .login-message { color: var(--red); margin: 12px 0 0; min-height: 21px; }
main { max-width: 1320px; padding: 0 22px; margin: auto; }
.archive-context { padding: 20px 0 23px; }
.archive-context p { margin: 0; color: var(--muted); font-size: 13px; }
.archive-context p:first-child { color: var(--ink); margin-bottom: 4px; }
.archive-context strong { margin-right: 12px; font-weight: 600; }
.archive-context span { font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { flex-shrink: 0; border: 0; border-bottom: 3px solid transparent; background: transparent; border-radius: 0; padding: 12px 1px 13px; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); font-weight: 650; }
.tabs button:hover { background: transparent; color: var(--green); }
.tab-count { display: inline-block; margin-left: 4px; font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding-top: 21px; }
.filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.filters input, .filters select { color: var(--ink); font-size: 14px; }
.date-filter { display: flex; gap: 12px; }
.date-filter label { width: 157px; }
.track-filter { width: 132px; }
.keyword-filter { flex: 1; min-width: 205px; }
.filters > button { flex-shrink: 0; }
.error-text { color: var(--red); margin: 9px 0 0; font-size: 13px; }
.view-note { margin: 12px 0 24px; color: var(--muted); font-size: 12px; max-width: 95ch; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h2 { font-size: 18px; line-height: 1.4; margin: 0; }
.results-heading p { color: var(--muted); margin: 4px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.table-hint { color: var(--muted); font-size: 12px; margin: 14px 0 7px; }
.table-scroll { width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; min-width: 1010px; text-align: left; }
thead { background: var(--subtle); }
th { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
th, td { padding: 12px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: oklch(97.4% .009 145); }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.person-name { font-weight: 600; white-space: nowrap; }
.secondary { color: var(--muted); font-size: 12px; margin-top: 3px; }
.record-subject { min-width: 150px; max-width: 270px; overflow-wrap: anywhere; }
.file-cell { min-width: 230px; max-width: 320px; overflow-wrap: anywhere; }
.pill { display: inline-block; border-radius: 5px; padding: 1px 6px; font-size: 12px; background: var(--subtle); color: var(--muted); white-space: nowrap; }
.pill.active { background: var(--green-soft); color: var(--green); }
.note-cell { min-width: 175px; max-width: 240px; }
.note-preview { max-width: 29ch; white-space: pre-wrap; overflow-wrap: anywhere; }
details { min-width: 90px; }
summary { cursor: pointer; color: var(--green); white-space: nowrap; width: fit-content; text-underline-offset: 4px; }
summary:hover { text-decoration: underline; }
details[open] > summary { margin-bottom: 11px; }
.record-details { min-width: 250px; max-width: 470px; margin: 0; }
.record-details > div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.record-details > div:last-child { border-bottom: 0; }
.record-details dt { font-size: 12px; color: var(--muted); }
.record-details dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff { min-width: 330px; max-width: 540px; }
.diff-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.diff-item:last-child { border-bottom: 0; }
.diff-label { font-weight: 600; margin-bottom: 5px; }
.diff-values { display: grid; grid-template-columns: 32px 1fr; gap: 5px 9px; }
.diff-side { color: var(--muted); font-size: 12px; }
.diff-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-value.after { color: var(--green); }
.diff-empty { max-width: 38ch; color: var(--muted); margin: 0; }
.record-id { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; max-width: 34ch; margin-top: 11px; }
.pagination { padding: 16px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.page-buttons { display: flex; align-items: center; gap: 11px; }
.page-buttons button { font-size: 13px; }
.empty-state, .load-state { text-align: center; padding: 52px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.empty-state strong, .load-state strong { display: block; font-size: 16px; font-weight: 600; }
.empty-state p, .load-state p { color: var(--muted); margin: 7px auto 17px; max-width: 65ch; }
.loading-lines { max-width: 360px; margin: 23px auto 0; }
.loading-lines i { display: block; height: 13px; background: var(--subtle); border-radius: 4px; margin: 10px 0; }
.loading-lines i:last-child { width: 70%; }
.download-status { font-size: 12px; color: var(--green); min-height: 20px; margin: 12px 0 0; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 18px 0 22px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 780px) {
  .header-inner { align-items: flex-start; }
  .archive-stamp { padding-top: 41px; }
  .header-actions { align-items: flex-start; flex-direction: column; gap: 9px; }
  .filters { gap: 12px 10px; }
  .date-filter { flex: 1 0 calc(100% - 152px); }
  .date-filter label { width: calc((100% - 12px)/2); }
  .keyword-filter { min-width: 0; }
  .tabs { gap: 20px; }
}
@media (max-width: 520px) {
  .header-inner { padding: 20px 16px 23px; flex-direction: column; gap: 17px; }
  h1 { font-size: 30px; }
  .title-line { margin-top: 13px; }
  .archive-stamp { padding: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; }
  .archive-stamp strong { margin: 0; font-size: 13px; }
  .header-inner p { font-size: 12px; }
  .header-actions { width: 100%; }
  .mode-nav { padding: 0 16px; }
  .login-panel { margin: 15px 0 40px; padding: 25px 20px 16px; }
  main { padding: 0 14px; }
  .archive-context { padding: 17px 0 19px; }
  .archive-context p { font-size: 12px; }
  .archive-context strong { margin-right: 7px; }
  .tabs { gap: 19px; }
  .tabs button { font-size: 13px; }
  .date-filter { flex-basis: 100%; }
  .track-filter { width: 125px; }
  .keyword-filter { width: calc(100% - 135px); }
  .filters > button { margin-left: auto; }
  .view-note { margin-bottom: 21px; }
  .results-heading { align-items: flex-start; flex-direction: column; gap: 11px; }
  .results-heading > button { min-height: 38px; font-size: 12px; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .page-buttons { width: 100%; justify-content: space-between; }
  .empty-state, .load-state { padding: 35px 17px; }
}
