:root {
  color-scheme: light;
  --navy: #152b3d; --ink: #182c3d; --muted: #506678; --line: #d8e3e9;
  --paper: #ffffff; --surface: #f1f6f8; --teal: #00695f; --teal-soft: #e1f2ee;
  --amber: #7e4c0a; --amber-soft: #fff0d5; --red: #a22b31; --red-soft: #fff0ef;
  font: 16px/1.5 system-ui, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.top-bar { background: var(--navy); color: white; }
.top-inner { max-width: 990px; margin: auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { color: white; text-decoration: none; font-size: 1.17rem; font-weight: 750; white-space: nowrap; }
.en { display: block; font-size: .8em; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.brand .en { color: #a4e6db; }
.connection, .top-inner > * { min-width: 0; }
.connection { font-size: .82rem; color: #d5e5ec; text-align: right; }
main { max-width: 990px; margin: auto; padding: 24px 24px 48px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 5vw, 2.4rem); line-height: 1.2; letter-spacing: -.02em; }
h1 > .en { font-size: .56em; margin-top: 4px; }
h2 { font-size: 1.19rem; }
h3 { font-size: 1rem; }
.intro { margin: 8px 0 22px; }
.intro p, .muted { color: var(--muted); margin-top: 7px; }
.panel, .node { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.panel { padding: 20px; margin: 14px 0; }
.section-head, .flight-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.section-head { margin-bottom: 12px; }
.fields, .role-grid, .signature-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.role-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.role-select { border: 0; margin: 15px 0; padding: 0; }
.role-select legend { padding: 0; margin-bottom: 7px; font-weight: 650; }
label { display: grid; gap: 5px; font-weight: 600; min-width: 0; }
input:not([type=radio]):not([type=file]), textarea { width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; font: inherit; color: var(--ink); border: 1px solid #a9bdc8; background: white; border-radius: 7px; }
textarea { resize: vertical; }
input[readonly] { background: #f4f7f8 !important; }
button, .button { font: inherit; min-height: 44px; max-width: 100%; padding: 8px 15px; border-radius: 8px; border: 1px solid #aec2cc; background: white; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; font-weight: 620; overflow-wrap: anywhere; }
button.primary, .button.primary { background: var(--teal); color: white; border-color: var(--teal); }
button[disabled], fieldset[disabled] button { opacity: .58; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, canvas:focus-visible { outline: 3px solid #219987; outline-offset: 2px; }
.role, .choice { position: relative; }
.role input + span, .choice input + span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; min-height: 48px; line-height: 1.25; text-align: center; padding: 6px; cursor: pointer; overflow-wrap: anywhere; }
.role input, .choice input, .file-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.role input:focus-visible + span, .choice input:focus-visible + span, .file-picker:focus-within { outline: 3px solid #219987; outline-offset: 2px; }
.role input:checked + span, .choice input:checked + span { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.choice input[value=fail]:checked + span { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.choice input[value=na]:checked + span { background: #e8eef3; color: #384f62; border-color: #6e8698; }
.role input:disabled + span { background: #f1f5f7; color: var(--muted); cursor: default; }
.saved { margin-top: 25px; }
.records-list { display: grid; gap: 7px; margin-top: 10px; }
.record-link { justify-content: space-between; text-align: left; gap: 8px; }
.record-link > span:first-child { min-width: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.notice { border: 1px solid #93cbbf; background: var(--teal-soft); color: #144d44; padding: 11px 14px; border-radius: 8px; margin: 0 0 16px; overflow-wrap: anywhere; }
.notice.error { border-color: #d69696; background: var(--red-soft); color: var(--red); }
.flight-heading { margin: 13px 0; }
.progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; margin: 11px 0 0; color: var(--muted); }
progress { height: 8px; width: 110px; accent-color: var(--teal); }
.timeline-title { margin: 24px 0 9px; }
.node { margin-bottom: 11px; overflow: clip; }
.node summary, .header-details summary { cursor: pointer; list-style: none; }
.node summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 14px 16px; min-height: 65px; }
.node summary::-webkit-details-marker, .header-details summary::-webkit-details-marker { display: none; }
.node-title::before, .header-details summary::before { content: '›'; color: var(--teal); margin-right: 8px; display: inline-block; font-weight: 800; }
.node[open] .node-title::before, .header-details[open] summary::before { transform: rotate(90deg); }
.node-title { display: block; font-weight: 740; }
.timing { display: block; color: var(--muted); margin-top: 3px; font-size: .86rem; }
.actual-time { display: block; }
.tag { display: inline-block; align-self: center; border-radius: 999px; white-space: nowrap; padding: 3px 10px; background: #eaf0f3; color: #425969; font-size: .82rem; font-weight: 690; }
.tag.active { background: var(--amber-soft); color: var(--amber); }
.tag.done { background: var(--teal-soft); color: var(--teal); }
.node-body { padding: 0 16px 16px; }
.item { border-top: 1px solid var(--line); padding: 14px 0; }
.item h3 { display: flex; gap: 9px; }
.item-copy { min-width: 0; overflow-wrap: anywhere; }
.item-copy .en { font-size: .875em; color: var(--muted); margin-top: 3px; }
.item-id { color: var(--muted); font-variant-numeric: tabular-nums; }
.status-options { border: 0; padding: 0; margin: 8px 0; min-width: 0; }
.choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.choice[aria-disabled=true] span { cursor: default; }
.note-label { font-size: .9rem; }
.time { color: var(--muted); font-size: .85rem; min-height: 1.5em; margin-bottom: 5px; }
.photo-strip { padding: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.photo { display: grid; gap: 4px; }
.photo img { display: block; width: 86px; height: 64px; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; }
.photo button { padding: 4px 8px; font-size: .83rem; min-height: 36px; }
.file-picker { cursor: pointer; position: relative; }
.file-picker span { pointer-events: none; }
.attachments summary { cursor: pointer; font-size: .9rem; color: var(--teal); margin-top: 6px; min-height: 36px; display: flex; align-items: center; }
.canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; background: #fcfdfd; border: 1px dashed #899fac; border-radius: 8px; margin-top: 7px; touch-action: none; }
.header-details .fields { margin-top: 13px; }
.signature-box { min-width: 0; }
.signature-box h3 { margin-bottom: 8px; }
.sign-heading { margin-bottom: 12px; }
.save-state { color: var(--muted); font-size: .85rem; margin-top: 6px; }
dialog { width: min(620px, calc(100% - 24px)); max-height: 92dvh; padding: 17px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; }
dialog::backdrop { background: #142a3bbb; }
dialog img[data-preview] { width: 100%; display: block; margin-top: 10px; border: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 600px) {
  .top-inner { padding-inline: 15px; }
  main { padding: 15px 12px 33px; }
  .intro h1 { font-size: clamp(1.35rem, 6vw, 1.65rem); text-wrap: balance; }
  .intro h1 > .en { font-size: max(.56em, .875rem); }
  .panel { padding: 14px; }
  .role-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .signature-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .fields { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .node summary { padding: 12px; }
  .node-body { padding: 0 12px 12px; }
}
