:root {
  --paper: #eef2f1;
  --surface: #fff;
  --ink: #20333b;
  --muted: #4c6068;
  --line: #d5e0e0;
  --blue: #2e657b;
  --ochre: #a65036;
  --focus: #17617b;
  font-family: "Research SC", "Atlas SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
.file-button {
  border: 1px solid #a3b5bb;
  min-height: 42px;
  background: #fff;
  border-radius: 3px;
  padding: 9px 14px;
  cursor: pointer;
}
button:hover,
.file-button:hover {
  background: #edf4f4;
  border-color: #557482;
}
button:disabled {
  background: #eef1f0;
  color: #71828a;
  border-color: #d1dada;
  cursor: default;
}
.primary {
  background: #244b5d;
  color: #fff;
  border-color: #244b5d;
}
.primary:hover {
  background: #173d50;
  color: #fff;
}
.file-button {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
}
.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid #a7b8bf;
  border-radius: 3px;
  padding: 8px 10px;
  background: #fff;
  caret-color: var(--blue);
}
input::placeholder,
textarea::placeholder {
  color: #637881;
  opacity: 1;
}
label {
  display: block;
  font-size: 13px;
}
label > input,
label > select,
label > textarea {
  margin-top: 5px;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
}
textarea {
  resize: vertical;
}
a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.file-button:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
::selection {
  background: #cadfe5;
  color: #20333b;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -0.025em;
  font-weight: 600;
}
h2 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
.skip {
  position: absolute;
  top: -80px;
  left: 12px;
  background: #fff;
  padding: 12px;
  z-index: 50;
}
.skip:focus {
  top: 12px;
}
[hidden] {
  display: none !important;
}
.ops-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 28px;
  background: #fcfcf8;
  border-bottom: 1px solid var(--line);
}
.ops-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.ops-brand svg {
  width: 28px;
  height: 28px;
  stroke: var(--blue);
  stroke-width: 1.8;
  fill: none;
}
.ops-header nav {
  display: flex;
  gap: 22px;
  align-items: center;
}
.ops-header nav a {
  font-size: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.ops-header nav [aria-current] {
  color: var(--blue);
  font-weight: 600;
}
.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.header-actions button,
.header-actions .file-button {
  font-size: 13px;
  padding: 9px 12px;
}
.ops-frame {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  max-width: 2000px;
  margin: auto;
}
.station-rail {
  background: linear-gradient(170deg, #e3eceb, #eeeae2);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  min-height: calc(100vh - 78px);
}
.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.rail-heading span {
  font-variant-numeric: tabular-nums;
}
.rail-import {
  width: 100%;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.rail-import:hover {
  background: #214c60;
  color: #fff;
}
.station-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0 20px;
}
.station-actions button {
  font-size: 12px;
  min-height: 38px;
  padding: 8px 10px;
  flex: 1;
}
.station-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}
.station-item {
  width: 100%;
  text-align: left;
  background: #ffffff90;
  padding: 12px;
  border-color: #c0cece;
}
.station-item[aria-pressed="true"] {
  background: #fff;
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.station-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.station-item span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.empty {
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
}
details form {
  display: grid;
  gap: 12px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.import-settings {
  margin-top: 8px;
  border-top: 1px solid #ccd7d5;
}
.import-settings label {
  margin-bottom: 12px;
}
.rail-method {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 20px;
  font-size: 13px;
}
#ops-main {
  padding: 28px 28px 0;
  min-width: 0;
  background: linear-gradient(140deg, #f3f5f1, #edf3f4);
}
.ops-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}
.ops-heading p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
.data-state {
  font-size: 14px;
  text-align: right;
  max-width: 40ch;
}
.ops-message {
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #e3edf0;
  border: 1px solid #b2cbd4;
  overflow-wrap: anywhere;
}
.ops-message[data-error="true"] {
  background: #fff0e9;
  border-color: #d9b7a7;
  color: #823e28;
}
.rescue {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  background: #f8e8de;
}
.ops-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid #becfd3;
  margin-bottom: 24px;
}
.ops-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 12px 2px;
  font-size: 16px;
  min-height: 48px;
}
.ops-tabs button[aria-selected="true"] {
  border-bottom-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}
.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(175px, 1.3fr) minmax(
      160px,
      1.4fr
    ) 82px 110px auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
}
.search-label {
  min-width: 0;
}
.catalog-toolbar .file-button {
  height: 42px;
}
.catalog-toolbar input,
.catalog-toolbar select {
  min-width: 0;
}
.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px;
  min-width: 0;
  border-radius: 4px;
}
.panel-heading {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.panel-heading > span {
  font-size: 13px;
  color: var(--muted);
}
.table-scroll {
  overflow: auto;
  scrollbar-color: #9bb4bd #eef3f3;
  scrollbar-width: thin;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
  min-width: 470px;
}
th {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-align: right;
  padding: 0 12px 12px 0;
  white-space: nowrap;
}
th:first-child {
  text-align: left;
}
td {
  padding: 0 12px 0 0;
  border-top: 1px solid #e0e8e9;
  text-align: right;
  vertical-align: middle;
}
td:first-child {
  text-align: left;
}
td:last-child,
th:last-child {
  padding-right: 0;
}
.event-row-button {
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  padding: 10px 0;
  border-radius: 0;
  display: grid;
  gap: 2px;
  min-height: 60px;
}
.event-row-button span {
  font-size: 12px;
  color: var(--muted);
}
tr[aria-selected="true"] {
  background: #edf5f7;
}
tr[aria-selected="true"] .event-row-button {
  color: #1c5f7a;
}
.event-table-panel {
  padding-bottom: 12px;
}
.table-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.table-pagination button {
  font-size: 12px;
  min-height: 36px;
  padding: 7px 10px;
}
.table-pagination span {
  font-size: 12px;
  color: var(--muted);
}
.table-pagination button:last-child {
  margin-left: auto;
}
.event-detail {
  margin: 20px 0 4px;
  overflow-wrap: anywhere;
}
.event-detail h3 {
  font-size: 17px;
  margin-bottom: 12px;
}
.event-detail dl,
.measurement-panel dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  font-variant-numeric: tabular-nums;
  margin: 14px 0;
}
.event-detail dt,
.measurement-panel dt {
  color: var(--muted);
  font-size: 13px;
}
.event-detail dd,
.measurement-panel dd {
  margin: 0;
  text-align: right;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.event-detail .event-id {
  font-size: 13px;
  color: var(--blue);
}
#station-map {
  width: 100%;
  height: 190px;
  background: linear-gradient(135deg, #f4f8f7, #e9f1f3);
  border-radius: 3px;
}
.model-controls {
  margin-top: 12px;
}
.inspector-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.inspector-actions button {
  font-size: 13px;
  flex: 1;
  padding-inline: 10px;
}
.wave-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.wave-toolbar span {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.wave-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}
.wave-canvas-column {
  display: grid;
  gap: 20px;
}
.waveform-panel canvas,
.spectrum-panel canvas {
  display: block;
  width: 100%;
  height: 270px;
  background: #f8fbfa;
}
.spectrum-panel canvas {
  height: 180px;
}
.phase-mode {
  display: flex;
  gap: 6px;
}
.phase-mode button {
  font-size: 12px;
  min-height: 34px;
  padding: 6px 12px;
}
.phase-mode [aria-pressed="true"] {
  color: var(--blue);
  border-color: var(--blue);
  background: #edf5f7;
}
.window-controls {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}
.window-controls button {
  font-size: 13px;
  white-space: nowrap;
}
.measurement-panel h3 {
  margin: 24px 0 10px;
}
.measurement-panel #apply-picks {
  margin-top: 12px;
  width: 100%;
}
.binding-state {
  font-size: 13px;
  overflow-wrap: anywhere;
  margin: 18px 0;
  color: var(--muted);
}
.binding-state[data-bound="true"] {
  color: var(--blue);
}
.measurement-actions {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}
.measurement-actions button {
  font-size: 13px;
}
.measurement-panel details dl {
  grid-template-columns: 1fr;
  gap: 3px;
}
.measurement-panel details dd {
  text-align: left;
  margin-bottom: 8px;
}
.handover-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.7fr);
  gap: 24px;
  align-items: start;
}
#handover-form {
  display: grid;
  gap: 16px;
}
.handover-entry {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.handover-entry:first-child {
  padding-top: 0;
  border-top: 0;
}
.handover-entry header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.handover-entry .handover-tag {
  font-size: 13px;
  color: var(--blue);
  white-space: nowrap;
}
.handover-entry p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0;
}
.handover-entry small {
  font-size: 12px;
  color: var(--muted);
}
.handover-entry select {
  min-height: 36px;
  font-size: 13px;
  width: auto;
  max-width: 150px;
}
.handover-list-panel .panel-heading {
  align-items: start;
}
footer {
  display: flex;
  gap: 24px;
  justify-content: flex-end;
  font-size: 13px;
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
@media (min-width: 1700px) {
  .ops-frame {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .event-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .wave-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .ops-header,
  #ops-main {
    padding-left: 36px;
    padding-right: 36px;
  }
}
@media (max-width: 1250px) {
  .ops-header {
    gap: 20px;
    flex-wrap: wrap;
  }
  .ops-header nav {
    gap: 18px;
  }
  .header-actions {
    gap: 8px;
  }
  .ops-frame {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .station-rail {
    padding: 24px 14px;
  }
  #ops-main {
    padding: 24px 20px 0;
  }
  .catalog-toolbar {
    grid-template-columns: minmax(170px, 1fr) minmax(140px, 1fr) 80px 110px;
  }
  .catalog-toolbar > .file-button {
    grid-column: 1;
  }
  .event-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
  }
  .panel {
    padding: 18px;
  }
  .wave-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 16px;
  }
  .window-controls {
    grid-template-columns: 1fr 1fr;
  }
  .handover-layout {
    gap: 18px;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 1.3fr);
  }
}
@media (max-width: 1000px) {
  .ops-frame {
    grid-template-columns: 1fr;
  }
  .station-rail {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 120px 170px 1fr;
    gap: 12px 18px;
    align-items: start;
    padding: 18px 24px;
  }
  .rail-heading {
    margin: 8px 0;
  }
  .station-actions {
    margin: 0;
  }
  .station-list {
    grid-column: 1/-1;
    display: flex;
    overflow: auto;
    max-height: 160px;
  }
  .station-item {
    min-width: 190px;
    width: auto;
  }
  .station-rail > details {
    max-width: 400px;
  }
  .rail-method {
    margin: 0;
  }
  .ops-heading h1 {
    font-size: 26px;
  }
  .station-rail .empty {
    padding: 0;
  }
  .event-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
  .ops-header {
    padding: 14px 24px;
  }
  .header-actions {
    margin-left: auto;
  }
  .ops-header nav a {
    font-size: 13px;
  }
}
@media (max-width: 760px) {
  .ops-header {
    gap: 14px;
  }
  .ops-header nav {
    order: 3;
    width: 100%;
    gap: 22px;
    overflow: auto;
  }
  .ops-header nav a {
    min-height: 36px;
  }
  .ops-brand {
    font-size: 21px;
  }
  .header-actions {
    width: 100%;
    order: 2;
    flex-wrap: wrap;
    margin: 0;
  }
  .header-actions button,
  .header-actions .file-button {
    min-height: 44px;
    font-size: 13px;
  }
  .station-rail {
    grid-template-columns: 1fr 1fr;
    padding: 18px 16px;
    gap: 12px;
  }
  .rail-heading {
    grid-column: 1;
  }
  .rail-import {
    grid-column: 2;
  }
  .station-actions {
    grid-column: 1/-1;
    max-width: 320px;
  }
  .station-rail > details {
    max-width: none;
  }
  .rail-method {
    grid-column: 1/-1;
  }
  .ops-header {
    padding: 14px 16px;
  }
  #ops-main {
    padding: 24px 16px 0;
  }
  .ops-heading {
    display: block;
    margin-bottom: 18px;
  }
  .data-state {
    text-align: left;
    margin-top: 12px;
  }
  .ops-tabs {
    gap: 26px;
    margin-bottom: 20px;
  }
  .ops-tabs button {
    font-size: 15px;
    min-height: 46px;
  }
  .catalog-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }
  .catalog-toolbar > label {
    font-size: 13px;
  }
  .catalog-toolbar > label:first-child {
    grid-column: 1/-1;
  }
  .catalog-toolbar > .search-label {
    grid-column: 1/-1;
  }
  .catalog-toolbar input,
  .catalog-toolbar select {
    font-size: 16px;
    min-height: 44px;
  }
  .catalog-toolbar > .file-button {
    grid-column: auto;
  }
  .event-layout,
  .wave-layout,
  .handover-layout {
    grid-template-columns: 1fr;
  }
  .event-inspector {
    order: 2;
  }
  table {
    min-width: 450px;
  }
  .panel {
    padding: 18px 14px;
  }
  .event-inspector #station-map {
    height: 230px;
    max-width: 500px;
  }
  .event-detail dl {
    grid-template-columns: 140px 1fr;
  }
  .wave-toolbar {
    gap: 10px;
  }
  .wave-toolbar button,
  .wave-toolbar .file-button {
    font-size: 13px;
    min-height: 44px;
  }
  .wave-toolbar span {
    width: 100%;
  }
  .waveform-panel canvas {
    height: 240px;
  }
  .spectrum-panel canvas {
    height: 160px;
  }
  .window-controls {
    gap: 10px;
  }
  .window-controls input {
    font-size: 16px;
  }
  .measurement-panel dl {
    max-width: 600px;
  }
  .measurement-panel > .pair {
    max-width: 440px;
  }
  .measurement-panel #apply-picks {
    width: auto;
    min-width: 150px;
  }
  .measurement-actions {
    display: flex;
    flex-wrap: wrap;
  }
  .handover-layout input,
  .handover-layout select,
  .handover-layout textarea {
    font-size: 16px;
  }
  .panel-heading > button {
    font-size: 13px;
  }
  footer {
    justify-content: flex-start;
    gap: 18px;
    flex-wrap: wrap;
  }
  .rescue {
    align-items: start;
  }
  .rescue button {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media print {
  .ops-header nav,
  .header-actions,
  .station-rail,
  .ops-tabs,
  .catalog-toolbar,
  button,
  .file-button,
  footer {
    display: none !important;
  }
  .ops-frame {
    display: block;
  }
  #ops-main {
    padding: 0;
    background: white;
  }
  .event-layout,
  .wave-layout,
  .handover-layout {
    display: block;
  }
  .panel {
    border: 0;
    border-top: 1px solid #aaa;
    padding: 16px 0;
    break-inside: avoid;
  }
  .table-scroll {
    overflow: visible;
  }
  .ops-heading {
    margin: 0 0 20px;
  }
  .ops-message {
    display: none;
  }
}

.compare-protocol {
  margin-bottom: 22px;
}
.compare-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(78px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}
.compare-results table {
  min-width: 780px;
}
.compare-results td {
  padding: 18px 12px 18px 0;
}
.compare-results td:first-child {
  font-weight: 600;
}
.compare-results .panel-heading button {
  font-size: 13px;
}
.embedded .ops-header nav {
  display: none;
}
.embedded .ops-header {
  min-height: 65px;
}
@media (max-width: 1100px) {
  .compare-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .compare-controls button {
    grid-column: 1/-1;
  }
  .ops-tabs {
    gap: 24px;
  }
}
@media (max-width: 760px) {
  .compare-controls {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .compare-controls input {
    font-size: 16px;
  }
  .ops-tabs {
    gap: 20px;
    overflow: auto;
    white-space: nowrap;
  }
  .ops-tabs button {
    flex-shrink: 0;
  }
  .compare-results .panel-heading {
    display: block;
  }
  .compare-results .panel-heading button {
    margin-top: 12px;
  }
}
