  :root { color-scheme: dark; --page:#0d0d0d; --surface:#171717; --panel:#232323; --raised:#2b2b2b; --line:#373737; --ink:#f2f2f2; --muted:#b4b4b4; font:16px/1.45 system-ui,"PingFang SC","Microsoft YaHei",sans-serif; }
  *,*::before,*::after { box-sizing:border-box; }
  body { margin:0; background:var(--page); color:var(--ink); }
  button,input,select { font:inherit; }
  button,summary { cursor:pointer; }
  button { color:inherit; }
  :focus-visible { outline:2px solid #c8c8c8; outline-offset:2px; }
  [hidden] { display:none !important; }
  h1,h2,p { margin:0; }
  h1 { font-size:1.3rem; letter-spacing:.015em; }
  h2 { font-size:1.04rem; font-weight:650; }
  .shell { max-width:550px; min-height:100dvh; margin:auto; padding:0 23px 28px; background:var(--surface); }
  .masthead,.row,.document,.actions { display:flex; align-items:center; gap:12px; }
  .masthead { justify-content:space-between; padding:17px 0; border-bottom:1px solid var(--line); }
  .muted,.meta { color:var(--muted); }
  .meta,.pill,.text-button,thead { font-size:.875rem; }
  .pill { display:inline-block; padding:3px 8px; border:1px solid var(--line); border-radius:6px; background:var(--raised); white-space:nowrap; }
  .pill.done { background:transparent; }
  main section { margin-top:23px; }
  .tabs { display:flex; gap:6px; margin:8px 0 12px; }
  .tab { flex:1; min-height:43px; padding:6px 4px; background:none; border:0; border-bottom:2px solid transparent; color:var(--muted); white-space:nowrap; font-size:.9rem; }
  .tab[aria-pressed="true"] { border-color:#ddd; color:var(--ink); font-weight:650; }
  .sheet { border:1px solid var(--line); border-radius:9px; overflow:hidden; }
  .document { min-height:47px; padding:0 12px; background:var(--raised); }
  .document strong { flex:1; min-width:0; overflow-wrap:anywhere; font-size:.91rem; }
  .sheet-icon { width:18px; height:17px; border:1px solid var(--muted); border-radius:3px; flex:none; background:linear-gradient(90deg,transparent 46%,var(--muted) 46%,var(--muted) 53%,transparent 53%),linear-gradient(transparent 46%,var(--muted) 46%,var(--muted) 53%,transparent 53%); }
  .text-button { padding:9px 0; min-height:39px; border:0; background:transparent; text-decoration:underline; text-underline-offset:4px; white-space:nowrap; }
  table { width:100%; border-collapse:collapse; font-size:.875rem; }
  th,td { padding:8px 12px; border-bottom:1px solid var(--line); text-align:left; }
  th { color:var(--muted); font-weight:500; }
  td:nth-last-child(1),th:nth-last-child(1) { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
  tbody tr:last-child td { border-bottom:0; }
  .upload { margin-top:10px; justify-content:space-between; width:100%; min-height:62px; padding:10px 13px; text-align:left; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
  .upload-mark { display:grid; place-items:center; width:31px; height:31px; border:1px solid #666; border-radius:7px; font-size:1.25rem; flex:none; }
  .upload-label { flex:1; }
  .upload-label span { display:block; }
  .progress { min-height:42px; justify-content:space-between; flex-wrap:wrap; column-gap:12px; }
  .feedback { margin-top:4px; }
  .history { border-top:1px solid var(--line); padding-top:16px; }
  .records { margin:7px 0 0; padding:0; list-style:none; }
  .record-button { display:grid; grid-template-columns:1fr auto auto; gap:12px; align-items:center; min-height:64px; width:100%; padding:7px 0; text-align:left; border:0; border-bottom:1px solid var(--line); background:none; }
  .record-button strong,.record-button time { display:block; overflow-wrap:anywhere; }
  .chevron { width:6px; height:6px; margin-right:4px; transform:rotate(45deg); border-top:1px solid #ddd; border-right:1px solid #ddd; }
  .record-button:hover,.tab:hover { background:var(--panel); }
  dialog { margin:auto; width:min(100% - 24px, 550px); max-width:none; max-height:90dvh; padding:0; border:1px solid var(--line); border-radius:11px; background:var(--surface); color:var(--ink); }
  dialog::backdrop { background:#000b; }
  .dialog-inner { padding:0 20px 20px; }
  .dialog-title { display:flex; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid var(--line); padding:8px 0; }
  .dialog-title button { background:none; border:0; font-size:1.35rem; min-width:44px; min-height:44px; }
  .detail-heading { justify-content:space-between; margin-top:14px; }
  .attachment,.details,.keys,.actions { margin-top:15px; }
  .attachment { border-radius:8px; }
  .attachment img { width:100%; max-height:52dvh; object-fit:contain; }
  .attachment iframe { width:100%; height:48dvh; border:0; }
  .receipt { margin-top:8px; padding:14px; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
  .keys { margin-bottom:0; }
  .keys div { display:grid; grid-template-columns:86px 1fr; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
  dt { color:var(--muted); }
  dd { margin:0; overflow-wrap:anywhere; }
  .details { background:var(--panel); border-radius:8px; }
  .details summary { padding:10px 12px; }
  .details p { padding:0 12px 12px; white-space:pre-line; overflow-wrap:anywhere; }
  .actions { justify-content:flex-end; flex-wrap:wrap; }
  .button { padding:10px 12px; border:1px solid #515151; border-radius:7px; background:transparent; font-size:.9rem; }
  .button.primary { background:#535353; border-color:#626262; font-weight:650; }
  .button:disabled { opacity:.55; cursor:default; }
  .feedback:not(:empty),.error:not(:empty) { margin-top:7px; }
  .editor { display:grid; gap:10px; margin-top:12px; }
  .editor label { display:grid; gap:4px; }
  input,select { width:100%; min-height:42px; padding:7px 9px; border:1px solid #555; border-radius:6px; background:var(--panel); }
  #full-sheet { margin-top:12px; overflow-x:auto; }
  @media (max-width:560px) { .shell { padding-inline:16px; } #record-dialog { width:100%; max-height:100dvh; min-height:100dvh; margin:0; border:0; border-radius:0; } }

a { color:inherit; }
#gate { padding-top:30px; }
#gate p { margin:10px 0 20px; }
#gate .button { display:inline-block; text-decoration:none; }
#message:not(:empty) { padding:12px 0; }
.sheet-group + .sheet-group { border-top:1px solid var(--line); }
.sheet-group summary { padding:9px 12px; color:var(--muted); }
.sheet-group[open] summary { color:var(--ink); }
.empty { padding:10px 12px; }
#record-name { min-width:0; overflow-wrap:anywhere; }
#draft-fields { padding:0; margin:0; border:0; min-width:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#draft-fields label:last-child { grid-column:1/-1; }
#review-status { margin:0; }
@media (max-width:560px) {
  #review { width:100%; max-height:100dvh; min-height:100dvh; margin:0; border:0; border-radius:0; }
}
