:root {
  --ink: #182936;
  --night: #102e68;
  --accent: #003298;
  --accent-ink: #002575;
  --leaf: #68a835;
  --soft-blue: #edf3fc;
  --focus: #235ac2;
  --control: #8496ad;
  --paper: #f5f7fa;
  --white: #fff;
  --line: #d7dfe8;
  --muted: #465663;
  --danger: #9a271b;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--ink);
  background: var(--paper);
  font: 100%/1.55 var(--body);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-ink); text-underline-offset: .2em; }
button, input, textarea { font: inherit; }
button, a.button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; z-index: 8; top: -100px; left: 1rem; padding: .6rem; background: white; }
.skip:focus { top: .5rem; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { line-height: 1.15; font-weight: 650; }
h1 { font-size: clamp(2.1rem,5vw,3.8rem); letter-spacing: -.055em; }
h2 { font-size: 1.55rem; letter-spacing: -.035em; }
h3 { font-size: 1.16rem; letter-spacing: -.025em; }
header { background: var(--white); border-bottom: 1px solid var(--line); }
.wrap { width: min(1120px, calc(100% - 4rem)); margin: 0 auto; }
.head { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand-lockup { display:flex; align-items:center; flex:0 0 auto; }
.brand { display:inline-flex; align-items:center; min-height:44px; text-decoration:none; }
.brand-logo { display:block; width:10.6rem; height:auto; }
.brand-title { border-left:1px solid var(--line); padding-left:1.1rem; margin-left:1.1rem; font-size:.94rem; font-weight:550; color:var(--muted); }
.head nav { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:.45rem; }
.icon { display:inline-block; width: 1.22rem; height: 1.22rem; flex:0 0 auto; vertical-align: middle; fill:none; stroke: currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.linkbtn,.button { background: transparent; border: 0; color: var(--ink); display: inline-flex; justify-content: center; align-items:center; gap:.55rem; text-decoration: none; white-space: normal; line-height:1.25; font-weight: 600; }
.linkbtn { min-height: 40px; padding: .4rem .62rem; font-size:.9rem; border-radius:.35rem; }
.linkbtn:hover { background: var(--paper); }
.button { padding:.82rem 1rem; min-height:46px; background:var(--white); border:1px solid var(--control); border-radius:.42rem; font-size:.95rem; }
.button:hover { background:var(--soft-blue); }
.button.primary { background:var(--accent); color:white; border-color:var(--accent); }
.button.primary:hover { background:var(--accent-ink); }
.button.outline { color:var(--accent-ink); }
main { flex: 1 0 auto; }
main .wrap { padding: 3.2rem 0 4rem; }
#main:focus { outline:none; }
.lookup-shell { background: var(--white); border:1px solid var(--line); border-radius:.95rem; overflow:hidden; display:grid; grid-template-columns:.98fr 1.02fr; }
.lookup-hero { padding: clamp(1.75rem,3.5vw,3.15rem); background:linear-gradient(115deg, var(--night), var(--accent)); color:white; display:flex; flex-direction:column; justify-content:space-between; gap:2.9rem; position:relative; overflow:hidden; }
.lookup-hero h1 { max-width:8em; font-size:clamp(2.5rem,5.3vw,4.4rem); line-height:1.04; }
.lookup-hero p { color: #e0e9ff; margin-top:.95rem; max-width:30em; }
.label-figure { width:max-content; max-width:100%; display:inline-flex; align-items:center; gap: .77rem; padding:.73rem .9rem; background:#f4f7ff; color:#183b77; border-left:3px solid var(--leaf); border-radius:.23rem; font-family:var(--mono); font-size:clamp(.87rem,1.8vw,1.05rem); letter-spacing:.02em; }
.label-figure .icon { width:1.55rem; height:1.55rem; }
.lookup-form { padding:clamp(1.65rem,3.6vw,3.25rem); display:flex; flex-direction:column; align-self:center; }
.lookup-form h2 { margin-bottom:1.55rem; }
label.field { display:block; margin-bottom:.4rem; font-weight:650; font-size:.95rem; }
input[type=text],input[type=password],input[type=search],input[type=date],input[type=number],textarea {
  display:block; width:100%; min-width:0; color: var(--ink); background:white; min-height:48px; border:1px solid var(--control); border-radius:.35rem; padding:.67rem .82rem;
}
input::placeholder,textarea::placeholder { color:#5b6c80; opacity:1; }
#serial { font-family:var(--mono); font-size:1rem; letter-spacing:.02em; }
.hint,.small { font-size:.9rem; color:var(--muted); }
.hint { margin:.42rem 0 0; }
.stack > *+* { margin-top:1rem; }
.row-actions { margin-top:1.18rem; display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; }
.row-actions .button { flex: 1 1 auto; }
.lookup-form .row-actions { margin-top:1.35rem; }
.advice { display:grid; grid-template-columns:1.18fr .82fr; gap:2.5rem; margin-top:2.55rem; align-items:start; }
.advice h2 { font-size:1.27rem; margin:0 0 .8rem; }
.advice details { border-bottom:1px solid var(--line); }
.advice summary { cursor:pointer; padding:.9rem 1.8rem .9rem 0; font-weight:550; position:relative; list-style:none; }
summary::-webkit-details-marker { display:none; }
.advice summary::after { position:absolute; right:.25rem; content:"+"; font:1.45rem/1 var(--body); color:var(--accent); }
.advice details[open] summary::after { content:"−"; }
.advice details p { color:var(--muted); padding:0 1.5rem .95rem 0; }
.partner { padding:.1rem 0 .2rem 1.65rem; border-left:3px solid var(--leaf); }
.partner p { color:var(--muted); margin:.5rem 0 .8rem; }
.partner a { font-weight:600; }
footer { border-top:1px solid var(--line); padding:1.12rem 0; }
.foot { display:flex; justify-content:space-between; gap:1rem; color:var(--muted); font-size:.85rem; }
.breadcrumb { display:inline-flex; align-items:center; gap:.4rem; font-size:.92rem; margin-bottom:1.45rem; text-decoration:none; font-weight:600; }
.breadcrumb:hover { text-decoration:underline; }
.sheet { background:white; border:1px solid var(--line); border-radius:.75rem; overflow:hidden; }
.record-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; flex-wrap:wrap; background:var(--night); color:white; padding:clamp(1.55rem,3vw,2.65rem); }
.record-head h1 { font-family:var(--mono); font-size:clamp(1.45rem,3.5vw,2.6rem); letter-spacing:-.045em; overflow-wrap:anywhere; }
.record-head p { color:#e2eaff; font-size:.94rem; margin-bottom:.45rem; }
.status { font-size:.85rem; font-weight:600; display:inline-flex; align-items:center; padding:.3rem .7rem; color:#304f19; background:#e4f2d9; border-radius:.3rem; max-width:100%; }
.status.pilot { color:#593f1f; background:#fbecd1; }
.status.draft { color:#374863; background:#e9eef6; }
.sheet-body { padding:clamp(1.4rem,3vw,2.6rem); }
.sheet-body section+section { margin-top:2rem; }
.sheet-body h2,.admin-box h2 { margin-bottom:1rem; font-size:1.32rem; }
.facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 2rem; margin:0; }
.facts > div { padding:.75rem 0; border-bottom:1px solid var(--line); }
.facts dt { font-size:.9rem; color:var(--muted); }
.facts dd { font-size:1.04rem; margin:.17rem 0 0; font-weight:580; overflow-wrap:anywhere; white-space:pre-wrap; }
.notice { border-left:3px solid #8eabdb; background:var(--soft-blue); padding:.82rem 1rem; color:#233f6c; }
.notice.pilot { border-left-color:#c6a268; background:#fbf7ec; color:#604b2e; }
.notice.error, .message.error { border-left-color:#d49b93; background:#fff0eb; color:var(--danger); }
.message { margin-top:.9rem; border-radius:.3rem; padding:.68rem .84rem; background:var(--soft-blue); color:var(--accent-ink); overflow-wrap:anywhere; }
.message:empty { display:none; }
.login-box,.error-box { padding:clamp(1.5rem,4vw,3rem); max-width:34rem; margin:1.25rem auto; background:white; border:1px solid var(--line); border-radius:.75rem; }
.login-box h1,.error-box h1 { font-size:clamp(2rem,4vw,2.7rem); }
.login-box > p,.error-box > p,.admin-intro { margin:.65rem 0 1.55rem; color:var(--muted); }
.login-box .button { width:100%; }
.login-box .stack label { margin-top:0; }
.sheet .button { flex:0 1 auto; }
.admin-title { display:flex; align-items:end; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.admin-title h1 { font-size:clamp(2rem,4vw,3rem); }
.admin-intro { margin:.4rem 0 0; }
.admin-box { background:white; border:1px solid var(--line); border-radius:.65rem; padding:clamp(1.2rem,2.5vw,2rem); margin-top:1.5rem; }
.admin-grid { display:grid; grid-template-columns:1fr; }
.admin-box summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; cursor:pointer; font-size:1.28rem; font-weight:650; }
.admin-box summary::after { content:"+"; color:var(--accent); }
.admin-box[open] summary::after { content:"−"; }
.import-form { margin-top:1.2rem; }
.import-form textarea { resize:vertical; min-height:6.3rem; font-family:var(--mono); font-size:.9rem; }
.import-form input[type=file] { display:block; max-width:100%; }
.check { display:flex; gap:.65rem; align-items:start; color:var(--ink); }
.check input { width:1.12rem; height:1.12rem; margin:.2rem 0 0; accent-color:var(--accent); flex:0 0 auto; }
.search-form { display:flex; gap:.65rem; max-width:32rem; align-items:center; margin-bottom:1rem; flex-wrap:wrap; }
.search-form input { flex:1 1 13rem; }
.table-scroll { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:.94rem; }
th { background:var(--paper); text-align:left; font-weight:600; color:var(--muted); }
td,th { padding:.75rem .85rem; border-bottom:1px solid var(--line); vertical-align:top; }
td:first-child { white-space:nowrap; font-family:var(--mono); }
td { overflow-wrap:anywhere; }
.paging { display:flex; gap:.75rem; flex-wrap:wrap; align-items:center; justify-content:space-between; margin-top:.9rem; }
.paging .page-actions { display:flex; gap:.45rem; }
.loading { padding:2rem; text-align:center; color:var(--muted); }
[hidden] { display:none !important; }
@media(max-width:760px) {
  .wrap { width:calc(100% - 2rem); }
  .head { min-height:67px; }
  .brand-logo { width:8.1rem; }
  .brand-title { display:none; }
  main .wrap { padding:1.45rem 0 2.3rem; }
  .lookup-shell,.advice { grid-template-columns:1fr; }
  .lookup-hero { gap:1.15rem; padding:1.6rem; }
  .lookup-hero h1 { font-size:clamp(2.45rem,9vw,3.4rem); max-width:100%; }
  .lookup-hero p { margin-top:.65rem; }
  .label-figure { display:none; }
  .lookup-form { padding:1.6rem; }
  .lookup-form h2 { font-size:1.3rem; margin-bottom:1rem; }
  .advice { gap:1.75rem; margin-top:1.85rem; }
  .partner { padding-left:1rem; }
  .facts { gap:0 1.2rem; }
}
@media(max-width:480px) {
  .head { gap:.25rem; }
  .head nav { gap:.12rem; }
  .brand-logo { width:clamp(6.7rem,32vw,8.1rem); }
  .linkbtn { font-size:.85rem; padding:.4rem; min-height:44px; }
  .head nav .icon { display:none; }
  .row-actions .button { flex-basis:100%; }
  .facts { grid-template-columns:1fr; }
  .advice { margin-top:1.5rem; }
  .foot { flex-wrap:wrap; }
}

.sheet-body section > details { margin: 1rem 0; }
.sheet-body section details > form { margin: 1rem 0; }
