:root {
  font-family: "Research SC", "Atlas SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: #20333b;
  background: #eff2f1;
  font-size: 15px;
  line-height: 1.6;
  --ink: #20333b;
  --blue: #2e657b;
  --warm: #a65036;
  --line: #ccd7d8;
  --muted: #4c6068;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
.upload {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #9bb0b8;
  border-radius: 3px;
  background: white;
  cursor: pointer;
}
button:hover,
.upload:hover {
  background: #e8eff0;
  border-color: #557482;
}
button:disabled {
  color: #687b84;
  background: #edf0ef;
  cursor: default;
  border-color: #c6d1d4;
}
button.primary {
  background: #244b5d;
  color: #fff;
  border-color: #244b5d;
}
button.primary:hover {
  background: #173d50;
}
button.primary:disabled {
  background: #d6e0e1;
  color: #52666e;
  border-color: #c6d1d4;
}
input,
select {
  min-height: 40px;
  width: 100%;
  min-width: 0;
  border: 1px solid #9bb0b8;
  border-radius: 3px;
  padding: 7px 9px;
  background: white;
}
input {
  font-variant-numeric: tabular-nums;
  caret-color: var(--warm);
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #17617b;
  outline-offset: 3px;
}
::selection {
  background: #b7d7e2;
  color: #162a33;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 2.7vw, 42px);
  line-height: 1.23;
  letter-spacing: -0.025em;
  font-weight: 600;
}
h2 {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}
label {
  display: grid;
  gap: 5px;
  font-size: 14px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input {
  width: 17px;
  height: 17px;
  min-height: 0;
  accent-color: var(--blue);
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.skip {
  position: fixed;
  left: 15px;
  top: -100px;
  z-index: 100;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
.lab-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-size: 21px;
  font-weight: 600;
  white-space: nowrap;
}
.brand svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--warm);
  stroke-width: 1.7;
}
.lab-header nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.lab-header nav a {
  text-decoration: none;
  font-size: 15px;
}
.lab-header nav a[aria-current] {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 10px;
}
#engine-status {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
#engine-status.ready:before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 100%;
  background: #297355;
  margin-right: 8px;
}
.lab-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  max-width: 1920px;
  margin: auto;
}
.lab-rail {
  padding: 18px 18px 32px;
  background: #f8faf9;
  border-right: 1px solid var(--line);
}
.rail-section {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.rail-section:first-child {
  padding-top: 0;
}
.rail-section summary {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
}
.rail-content {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}
.upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #edf3f4;
  font-weight: 600;
  border-style: dashed;
}
.upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload:focus-within {
  outline: 3px solid #17617b;
  outline-offset: 3px;
}
.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-height: 140px;
  overflow: auto;
  word-break: break-all;
}
.file-list li {
  padding: 5px 0;
  border-bottom: 1px solid #e4e9e8;
}
.essential-note {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 85ch;
}
.window-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.window-row {
  display: grid;
  grid-template-columns: 38px 1fr 1fr;
  align-items: center;
  gap: 7px;
}
.window-row strong {
  font-size: 14px;
}
.phase-p strong {
  color: var(--warm);
}
.phase-s strong {
  color: var(--blue);
}
#lab-main {
  min-width: 0;
  padding: 32px clamp(20px, 2.6vw, 50px) 0;
  background:
    radial-gradient(ellipse at 95% 0, #e0e9e9 0, transparent 36%),
    linear-gradient(130deg, #faf9f4, #f7f9f8 60%);
  overflow: hidden;
}
.lab-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}
.lab-title p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 11px;
}
.run-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.run-actions .primary {
  min-width: 128px;
}
.message,
.engine-help {
  padding: 14px 17px;
  background: #f9ede7;
  color: #6d3425;
  margin: 16px 0;
  border: 1px solid #d7aea0;
  line-height: 1.8;
}
.message.success {
  color: #244b5d;
  background: #e7f0f1;
  border-color: #a7c2c9;
}
.engine-help p {
  font-size: 14px;
  margin: 7px 0;
}
.result-status {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}
.result-status strong {
  font-weight: 500;
  padding: 3px 8px;
  background: #e5eeeb;
  color: #32604b;
}
.result-status strong.stale {
  background: #f8e6d7;
  color: #7d4427;
}
.result-status button {
  margin-left: auto;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
}
.plot-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
.plot-heading {
  padding-bottom: 14px;
}
.plot-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.plot-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.plot-tools select {
  width: auto;
  max-width: 125px;
  min-height: 34px;
  padding: 4px 7px;
}
.plot-tools button,
.section-heading button {
  font-size: 13px;
  padding: 5px 10px;
  min-height: 34px;
}
.plot {
  background: #fff;
  min-height: 280px;
  width: 100%;
  overflow: hidden;
}
.plot svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 880px;
}
.plot { overflow-x:auto; scrollbar-width:thin; scrollbar-color:#a5b7bd transparent; }
.wave-plot {
  min-height: 290px;
  border: 1px solid #d6dfe0;
  cursor: crosshair;
}
.plot-empty {
  height: 300px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 15px;
  padding: 24px;
  text-align: center;
}
.plot-empty svg {
  width: min(430px, 90%);
  height: auto;
  fill: none;
  stroke: #aec0c5;
  stroke-width: 1.4;
}
.cursor-readout {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.analysis-tabs {
  display: flex;
  border-bottom: 1px solid #b8c9ce;
  gap: 6px;
  margin-top: 28px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #a5b7bd transparent;
}
.analysis-tabs button {
  background: transparent;
  border: 0;
  border-radius: 0;
  white-space: nowrap;
  min-height: 50px;
  padding: 12px 17px;
  font-weight: 500;
}
.analysis-tabs button[aria-selected="true"] {
  color: var(--blue);
  box-shadow: inset 0 -3px var(--blue);
}
[role="tabpanel"] {
  padding-top: 26px;
  min-height: 370px;
}
.section-heading {
  margin-bottom: 22px;
}
.section-heading > span {
  color: var(--muted);
  font-size: 14px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
th {
  color: var(--muted);
  font-weight: 500;
  background: #eaf0ef;
  font-size: 13px;
}
th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #d6dfe0;
}
td:first-child {
  font-weight: 600;
}
tbody button {
  font-size: 12px;
  min-height: 30px;
  padding: 3px 8px;
}
.method-strip {
  margin-top: 22px;
  padding: 18px 0;
  display: grid;
  gap: 5px;
  border-top: 1px solid #d6dfe0;
  color: var(--muted);
  font-size: 13px;
}
.method-details {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}
.method-details summary {
  cursor: pointer;
}
.method-details pre {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  background: #edf1f0;
  white-space: pre-wrap;
  word-break: break-word;
}
.lab-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 42px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.lab-footer button {
  min-height: 32px;
  font-size: 13px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.travel-table {
  font-size: 12px;
}
.travel-table td,
.travel-table th {
  padding: 5px 4px;
}
#travel-result {
  overflow: auto;
  max-height: 250px;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1700px) {
  .lab-layout {
    grid-template-columns: 320px 1fr;
  }
  .lab-rail {
    padding: 24px;
  }
}
@media (max-width: 1100px) {
  .lab-header {
    padding: 16px 22px;
    gap: 15px;
  }
  .lab-header nav {
    gap: 15px;
  }
  .lab-header nav a {
    font-size: 14px;
  }
  .lab-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  #lab-main {
    padding: 24px 22px 0;
  }
  .lab-title {
    align-items: flex-start;
  }
  .run-actions {
    max-width: 148px;
  }
  .lab-title h1 {
    font-size: 29px;
  }
  .analysis-tabs button {
    padding: 12px 10px;
    font-size: 13px;
  }
  .plot-tools label {
    display: none;
  }
}
@media (max-width: 800px) {
  .plot svg { min-width:0; }
  .plots-expanded .plot svg { min-width:880px; }
  .lab-header {
    flex-wrap: wrap;
    gap: 14px;
  }
  .lab-header nav {
    order: 3;
    width: 100%;
    gap: 20px;
  }
  .lab-header nav a[aria-current] {
    text-underline-offset: 5px;
  }
  .lab-layout {
    display: flex;
    flex-direction: column;
  }
  .lab-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 22px;
    padding: 18px 22px;
  }
  .rail-section {
    padding: 12px 0;
  }
  .rail-section:first-child {
    padding-top: 12px;
  }
  .rail-section summary {
    font-size: 15px;
  }
  #lab-main {
    padding: 25px 20px 0;
  }
  .lab-title h1 {
    font-size: 30px;
  }
  .lab-title p {
    font-size: 13px;
  }
  .analysis-tabs {
    margin-top: 20px;
  }
  .plot {
    min-height: 180px;
  }
  .wave-plot {
    min-height: 210px;
  }
  .plot-heading h2 {
    font-size: 18px;
  }
  .plot-tools button {
    font-size: 12px;
    min-height: 32px;
    padding: 5px 8px;
  }
  h2 {
    font-size: 20px;
  }
  .section-heading {
    margin-bottom: 17px;
  }
  th,
  td {
    padding: 12px;
  }
  .lab-footer {
    margin-top: 24px;
  }
}
@media (max-width: 470px) {
  .brand {
    font-size: 19px;
  }
  .lab-header {
    padding: 13px 17px;
  }
  .lab-header nav {
    gap: 16px;
  }
  .lab-header nav a {
    font-size: 12px;
  }
  #engine-status {
    font-size: 13px;
  }
  .lab-rail {
    display: block;
    padding: 10px 18px;
  }
  .rail-section[open] .rail-content {
    padding-bottom: 8px;
  }
  .lab-title {
    gap: 12px;
  }
  .lab-title h1 {
    font-size: 26px;
  }
  .run-actions {
    max-width: 126px;
    gap: 7px;
  }
  .run-actions button {
    min-width: 0;
    font-size: 13px;
    padding: 8px 11px;
    width: 126px;
  }
  .run-actions .primary {
    min-width: 0;
  }
  .lab-title p {
    font-size: 13px;
  }
  .plot-heading {
    gap: 10px;
  }
  .wave-plot {
    min-height: 0;
  }
  .plot-empty {
    height: 215px;
  }
  .analysis-tabs {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 10px;
  }
  .analysis-tabs button {
    padding: 12px 10px;
    font-size: 12px;
  }
  #result-status {
    gap: 8px;
  }
  .result-status button {
    margin-left: 0;
  }
  .method-strip {
    font-size: 12px;
  }
  .section-heading h2 {
    font-size: 19px;
  }
  .lab-footer span {
    display: none;
  }
}
@media print {
  #plot-scale { display:none!important; }
  .lab-header,
  .lab-rail,
  .run-actions,
  .plot-tools,
  .analysis-tabs,
  .lab-footer,
  .cursor-readout,
  .result-status button,
  .section-heading button,
  .message,
  .engine-help {
    display: none !important;
  }
  .lab-layout {
    display: block;
  }
  #lab-main {
    padding: 0;
    background: #fff;
  }
  [role="tabpanel"][hidden] {
    display: block !important;
  }
  [role="tabpanel"] {
    min-height: 0;
    break-inside: avoid;
  }
  .lab-title h1 {
    font-size: 22px;
  }
  .lab-title p {
    font-size: 12px;
  }
  .plot {
    min-height: 0;
  }
  table {
    font-size: 13px;
  }
  th,
  td {
    padding: 7px;
  }
  .method-details {
    display: block;
  }
  .method-details pre {
    max-height: none;
  }
  .section-heading {
    margin-top: 20px;
  }
  svg {
    break-inside: avoid;
  }
  @page {
    size: A4 landscape;
    margin: 14mm;
  }
}

#run-progress{width:90px;height:8px;accent-color:#2e657b}#run-progress[value="0"]{visibility:hidden}#view-quality table{width:100%;border-collapse:collapse;margin:18px 0 28px}#view-quality td{padding:10px;border-bottom:1px solid var(--line)}
