:root {
  --navy: #102738;
  --ink: #1b3342;
  --muted: #6d818d;
  --line: #d4e0e5;
  --soft: #f3f7f8;
  --teal: #0d9eae;
  --teal-dark: #087b89;
  --blue: #12638f;
  --green: #397a5b;
  --orange: #be7223;
  --red: #b34e47;
  --white: #ffffff;
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--ink);
  background: #f7f9fa;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: #f7f9fa; }
body { margin: 0; min-width: 320px; font-size: 14px; line-height: 1.5; letter-spacing: 0; background: #f7f9fa; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.app-header { background: var(--white); color: var(--navy); border-top: 5px solid var(--navy); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1320px; margin: 0 auto; min-height: 66px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 100px; height: 32px; object-fit: contain; object-position: left center; }
.brand span { display: grid; gap: 0; line-height: 1.1; }
.brand strong { font-size: 14px; font-weight: 700; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 5px; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-link { min-height: 38px; padding: 6px 10px; color: var(--blue); display: inline-flex; align-items: center; gap: 6px; border-radius: 5px; font-size: 12px; }
.icon-link:hover, .icon-link:focus-visible { background: #eaf3f6; }
.icon-link svg, .data-badge svg, .micro-note svg, .button svg, .icon-button svg, .empty-symbol svg, .notes-panel svg { width: 16px; height: 16px; stroke-width: 1.8; }

.layout { max-width: 1320px; margin: 0 auto; padding: 36px 28px 46px; display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(420px, .94fr); gap: 48px; align-items: start; }
.form-column { min-width: 0; }
.result-column { min-width: 0; position: sticky; top: 18px; }
.section-heading, .result-topline { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.eyebrow { display: block; color: var(--teal-dark); font-size: 11px; line-height: 1.1; font-weight: 700; letter-spacing: .08em; }
h1, h2, h3, p { margin: 0; }
h1 { color: var(--navy); font-size: 30px; line-height: 1.22; font-weight: 700; margin-top: 10px; }
h2 { color: var(--navy); font-size: 22px; line-height: 1.3; font-weight: 700; margin-top: 8px; }
h3 { font-size: 16px; line-height: 1.35; }
.lead { color: var(--muted); font-size: 13px; margin-top: 9px; max-width: 480px; }
.data-badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; color: var(--blue); background: #eaf3f6; border: 1px solid #cbdfe7; border-radius: 5px; font-size: 12px; margin-top: 6px; }
.data-badge svg { color: var(--teal-dark); }

.form-section { padding: 26px 0 24px; border-bottom: 1px solid var(--line); }
.section-label { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.section-label > span { color: var(--teal); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.section-label h2 { margin: 0; font-size: 16px; }
.field-grid { display: grid; gap: 15px 18px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.field > span { display: flex; gap: 6px; align-items: baseline; }
.field b { color: var(--teal-dark); font-size: 11px; font-weight: 700; }
.field em { color: #93a1a8; font-style: normal; font-size: 11px; }
.field input, .field select { width: 100%; height: 42px; padding: 8px 11px; color: var(--ink); background: var(--white); border: 1px solid #c8d7de; border-radius: 4px; outline: none; }
.field input:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,158,174,.12); }
.field input::placeholder { color: #a9b5ba; }
.segmented { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); border: 1px solid #c8d7de; border-radius: 4px; overflow: hidden; background: var(--white); }
.segmented label { position: relative; min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 40px; display: grid; place-items: center; padding: 4px 8px; color: #56717d; background: var(--white); border-right: 1px solid #d9e4e8; font-size: 12px; cursor: pointer; }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { color: var(--white); background: var(--blue); font-weight: 700; }
.micro-note { display: flex; align-items: flex-start; gap: 8px; color: #71858e; font-size: 11px; line-height: 1.6; margin-top: 1px; }
.micro-note svg { flex: 0 0 auto; color: var(--teal-dark); margin-top: 2px; }
.form-actions { display: flex; align-items: center; gap: 10px; padding-top: 23px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 700; }
.button.primary { color: var(--white); background: var(--navy); }
.button.primary:hover, .button.primary:focus-visible { background: #1c465d; }
.button:disabled { cursor: wait; opacity: .68; }
.button.secondary { color: var(--blue); background: var(--white); border-color: #c5d8e0; }
.button.secondary:hover, .button.secondary:focus-visible { background: #edf4f6; }
.action-status { color: var(--muted); font-size: 11px; margin-left: 5px; }
.form-error { padding: 10px 12px; color: #8b3d38; background: #fff3f1; border: 1px solid #efc8c4; border-radius: 4px; font-size: 12px; margin-top: 16px; }

.result-column { padding-top: 4px; }
.result-topline { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.result-tools { display: flex; gap: 4px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; color: var(--blue); background: var(--white); border: 1px solid #c5d8e0; border-radius: 4px; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { background: #eaf3f6; }
.empty-result { min-height: 340px; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 42px 28px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.empty-symbol { width: 52px; height: 52px; display: grid; place-items: center; color: var(--teal-dark); background: #e8f4f5; border-radius: 50%; margin-bottom: 7px; }
.empty-result strong { color: var(--ink); font-size: 16px; }
.empty-result span { max-width: 300px; font-size: 12px; line-height: 1.65; }
.result-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; padding: 14px 0 10px; }
.calculation-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; border: 1px solid var(--line); background: var(--white); border-radius: 5px; overflow: hidden; }
.calc-item { padding: 12px 10px; border-right: 1px solid var(--line); }
.calc-item:last-child { border-right: 0; }
.calc-item span { display: block; color: var(--muted); font-size: 11px; }
.calc-item strong { display: block; color: var(--navy); font-size: 19px; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.calc-item small { color: var(--teal-dark); font-size: 11px; }
.recommendation { padding: 17px 18px; color: var(--white); background: var(--navy); border-radius: 5px; margin-bottom: 18px; }
.recommendation .recommendation-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.recommendation .eyebrow { color: #7bd2d8; }
.recommendation h3 { color: var(--white); font-size: 22px; margin-top: 3px; }
.recommendation .recommendation-right { text-align: right; }
.recommendation .pressure { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recommendation .pressure-label { color: #b7d0d8; font-size: 11px; }
.recommendation .subline { color: #c6d5da; font-size: 12px; margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.series-thumb { width: 66px; height: 34px; object-fit: contain; object-position: center; background: #fff; border-radius: 3px; }
.candidate-list { display: grid; gap: 9px; }
.candidate { padding: 13px 14px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 4px; }
.candidate.series-ABS { border-left-color: var(--blue); }
.candidate.series-GBS { border-left-color: var(--green); }
.candidate.caution { border-left-color: var(--orange); }
.candidate-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.candidate h3 { color: var(--navy); font-size: 16px; }
.candidate-type { color: var(--muted); font-size: 11px; margin-top: 2px; }
.status { flex: 0 0 auto; padding: 3px 7px; color: var(--green); background: #edf7f1; border-radius: 3px; font-size: 11px; }
.status.caution { color: var(--orange); background: #fff5e9; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e6eef0; }
.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; color: var(--ink); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.candidate-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.candidate-foot a { color: var(--blue); font-weight: 700; }
.candidate-foot a:hover { text-decoration: underline; }
.checks { color: var(--orange); }
.notes-panel { padding: 14px 15px; margin-top: 17px; color: #647781; background: #f4f8f9; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; line-height: 1.7; }
.notes-panel div { display: flex; gap: 8px; align-items: flex-start; }
.notes-panel div + div { margin-top: 5px; }
.notes-panel svg { flex: 0 0 auto; color: var(--teal-dark); margin-top: 2px; }
.app-footer { max-width: 1320px; margin: 0 auto; padding: 15px 28px 25px; display: flex; justify-content: space-between; gap: 14px; color: #82929a; font-size: 10px; border-top: 1px solid var(--line); }

.admin-layout { max-width: 1320px; margin: 0 auto; padding: 34px 28px 50px; }
.admin-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin: 25px 0 16px; }
.admin-tools { display: flex; gap: 8px; align-items: center; }
.admin-tools input { height: 38px; padding: 8px 10px; border: 1px solid #c8d7de; border-radius: 4px; }
.records-table-wrap { overflow: auto; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.records-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 12px; }
.records-table th { color: var(--muted); background: #f4f8f9; font-size: 11px; font-weight: 700; text-align: left; }
.records-table th, .records-table td { padding: 11px 12px; border-bottom: 1px solid #e6eef0; white-space: nowrap; }
.records-table tr:last-child td { border-bottom: 0; }
.records-table tbody tr:hover { background: #f8fbfb; }
.records-table button { color: var(--blue); background: transparent; border: 0; cursor: pointer; font-weight: 700; }
.admin-login { max-width: 360px; margin: 76px auto; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.admin-login h2 { margin-bottom: 16px; }
.admin-login .field { margin-bottom: 16px; }
.admin-message { color: var(--red); font-size: 12px; margin-bottom: 10px; }
.detail-modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16,39,56,.35); z-index: 10; }
.detail-modal[hidden] { display: none; }
.detail-dialog { width: min(720px, 100%); max-height: min(80vh, 720px); overflow: auto; padding: 22px; background: var(--white); border-radius: 5px; }
.detail-dialog pre { padding: 13px; color: #334a56; background: #f4f8f9; overflow: auto; font-size: 11px; line-height: 1.55; }
.detail-dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

.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; }
[hidden] { display: none !important; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; }
  .result-column { position: static; }
  .result-column { border-top: 1px solid var(--line); padding-top: 28px; }
}

@media (max-width: 600px) {
  .header-inner { min-height: 60px; padding: 0 16px; }
  .brand img { width: 88px; }
  .brand small { font-size: 10px; }
  .icon-link { padding: 6px; }
  .icon-link span { display: none; }
  .layout { padding: 25px 16px 32px; gap: 24px; }
  .section-heading { display: block; }
  .data-badge { margin-top: 18px; }
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  .field-grid.two { grid-template-columns: 1fr; gap: 0; }
  .segmented { grid-template-columns: repeat(4, 1fr); }
  .segmented span { padding-left: 4px; padding-right: 4px; font-size: 11px; }
  .form-actions { flex-wrap: wrap; }
  .button.primary { flex: 1 1 190px; }
  .action-status { flex-basis: 100%; margin: 0; }
  .result-meta { display: block; line-height: 1.8; }
  .calculation-strip { grid-template-columns: 1fr; }
  .calc-item { border-right: 0; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
  .calc-item:last-child { border-bottom: 0; }
  .calc-item strong { margin-top: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recommendation .recommendation-head { align-items: start; }
  .recommendation h3 { font-size: 19px; }
  .recommendation .pressure { font-size: 17px; }
  .app-footer { padding: 14px 16px 22px; display: block; line-height: 1.8; }
  .admin-layout { padding: 25px 16px 32px; }
  .admin-toolbar { display: block; }
  .admin-tools { margin-top: 14px; }
  .admin-tools input { width: 100%; }
}

@media print {
  .app-header, .form-column, .result-tools, .app-footer { display: none !important; }
  body, html { background: #fff; }
  .layout { display: block; padding: 0; max-width: none; }
  .result-column { padding: 0; }
  .result-topline { border-bottom-color: #222; }
  .candidate { break-inside: avoid; }
}
