/* RotorScope — 转子敲击试验分析
   视觉方向：测振工作台（Signal Bench）。石墨机身 + 细线结构，
   青色代表信号迹线、橙色专用于共振峰，克制留白、可读字号。 */

:root {
  color-scheme: dark;

  /* 石墨基底，带轻微冷偏——不是纯黑 */
  --bg: #0e141a;
  --bg-2: #121a22;
  --panel: #161f29;
  --panel-strong: #1b2632;
  --panel-soft: #1e2a37;

  --line: rgba(151, 178, 198, 0.13);
  --line-strong: rgba(151, 178, 198, 0.26);

  --text: #e9f1f6;
  --muted: #9bacb9;
  --dim: #6d7f8d;

  /* 信号迹线 / 共振峰 / 第三轴——与图表内配色一致，勿改色值 */
  --teal: #18dbc5;
  --teal-ink: #063b35;
  --teal-soft: rgba(24, 219, 197, 0.1);
  --teal-line: rgba(24, 219, 197, 0.34);
  --orange: #ff6b35;
  --orange-soft: rgba(255, 107, 53, 0.12);
  --blue: #4fa8ff;
  --yellow: #ffd166;
  --danger: #ff5c75;

  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
  --radius: 14px;
  --radius-sm: 10px;

  --font-sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  font-family: var(--font-sans);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #e7ebee;
  --bg-2: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #eef2f5;

  --line: rgba(23, 51, 68, 0.13);
  --line-strong: rgba(23, 51, 68, 0.22);

  --text: #16232d;
  --muted: #566873;
  --dim: #83949f;

  --teal: #0a897c;
  --teal-ink: #ffffff;
  --teal-soft: rgba(10, 137, 124, 0.1);
  --teal-line: rgba(10, 137, 124, 0.32);
  --orange: #d9531f;
  --orange-soft: rgba(217, 83, 31, 0.1);

  --shadow: 0 18px 40px rgba(27, 54, 71, 0.12);
  --shadow-soft: 0 6px 18px rgba(27, 54, 71, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  background-image:
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
label[for="fileInput"],
.drop-zone {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.drop-zone:focus-visible,
label[for="fileInput"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.app-shell {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
}

/* ── Top bar ───────────────────────────────────────────── */
.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid var(--teal-line);
  border-radius: 10px;
  background: var(--teal-soft);
}

.brand-mark::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.brand-mark span {
  position: absolute;
  left: 7px;
  right: 7px;
  height: 1px;
  background: var(--teal);
  opacity: 0.7;
  transform-origin: 50% 50%;
}

.brand-mark span:nth-child(1) {
  transform: rotate(0deg);
}

.brand-mark span:nth-child(2) {
  transform: rotate(60deg);
}

.brand-mark span:nth-child(3) {
  transform: rotate(120deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.privacy-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--teal-line);
}

/* ── Panels ────────────────────────────────────────────── */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  margin-top: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.74fr);
  overflow: hidden;
}

.hero-copy {
  padding: 52px 44px 48px 50px;
  position: relative;
  z-index: 2;
  align-self: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--teal);
}

.hero h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(34px, 3.6vw, 56px);
  font-weight: 640;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero h1 em {
  color: var(--teal);
  font-style: normal;
}

.hero p {
  max-width: 540px;
  margin: 20px 0 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.primary-button {
  min-width: 178px;
  padding: 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  color: var(--teal-ink);
  background: var(--teal);
  border: 1px solid var(--teal);
  font-weight: 650;
}

.primary-button small {
  opacity: 0.72;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.secondary-button {
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
  font-weight: 550;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button:hover {
  border-color: var(--teal-line);
}

/* ── Hero workflow guide ───────────────────────────────── */
.hero-guide {
  padding: 46px 44px 42px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-soft), transparent 78%);
}

.guide-title {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.guide-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 15px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.guide-steps li:first-child {
  border-top: 0;
  padding-top: 2px;
}

.guide-index {
  align-self: start;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.guide-steps strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.guide-steps small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.guide-note {
  margin: 2px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  line-height: 1.65;
}

/* ── Workspace grid ────────────────────────────────────── */
.workflow {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.step-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-heading > span {
  display: none;
}

.step-heading h2,
.section-header h2,
.info-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.step-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.drop-zone {
  min-height: 96px;
  margin: 18px 0 12px;
  padding: 16px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  border: 1px dashed var(--teal-line);
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.drop-zone::before {
  content: "＋";
  color: var(--teal);
  font-size: 20px;
  line-height: 1;
}

.drop-zone strong {
  font-size: 13px;
  font-weight: 600;
}

.drop-zone span {
  color: var(--muted);
  font-size: 11px;
}

.drop-zone.dragging,
.drop-zone:hover {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal-soft) 70%, transparent);
  transform: translateY(-1px);
}

.sidebar-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.search-box {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.search-box span {
  color: var(--dim);
  font-size: 13px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.sidebar-toolbar button,
.text-button {
  padding: 0 9px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-toolbar button:hover,
.text-button:hover {
  color: var(--teal);
  background: var(--teal-soft);
}

.text-button {
  height: auto;
  padding: 4px 8px;
}

.channel-list {
  min-height: 176px;
  margin: 14px -6px 0 0;
  padding-right: 6px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.channel-item {
  min-height: 46px;
  margin-bottom: 6px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  transition: border-color 0.15s ease;
}

.channel-item:hover {
  border-color: var(--teal-line);
}

.channel-item input[type="checkbox"] {
  accent-color: var(--teal);
  width: 15px;
  height: 15px;
}

.channel-item strong,
.channel-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-item strong {
  font-size: 12px;
  font-weight: 550;
}

.channel-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.channel-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.empty-state {
  min-height: 176px;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  color: var(--dim);
}

.empty-state.compact {
  min-height: 96px;
}

.empty-state p {
  margin: 0;
  font-size: 12px;
}

.empty-icon {
  font-size: 24px;
  opacity: 0.7;
}

.data-quality {
  margin-top: 16px;
  padding-top: 14px;
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
}

.data-quality div {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.data-quality strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Content column ────────────────────────────────────── */
.content-column {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 104px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.metric-card.accent {
  border-color: var(--teal-line);
  background:
    linear-gradient(180deg, var(--teal-soft), transparent 70%),
    var(--panel);
}

.metric-card > span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.metric-card > strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 28px;
  font-weight: 640;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.metric-card strong b {
  font: inherit;
}

.metric-card strong i {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  font-style: normal;
}

.metric-card small {
  margin-top: auto;
  color: var(--dim);
  font-size: 11px;
}

/* ── Section cards ─────────────────────────────────────── */
.chart-card,
.mode-card {
  padding: 22px 24px 18px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-header .eyebrow,
.info-card .eyebrow {
  margin-bottom: 6px;
}

.control-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.control-row label,
.mode-frequency-control label {
  display: grid;
  gap: 5px;
}

.control-row label span,
.mode-frequency-control label span,
.frequency-range-controls label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

select,
input[type="number"] {
  height: 36px;
  padding: 0 10px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  outline: 0;
  transition: border-color 0.15s ease;
}

select:hover,
input[type="number"]:hover {
  border-color: var(--teal-line);
}

select {
  min-width: 100px;
  font-size: 12px;
}

input[type="number"] {
  width: 90px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.small-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: var(--teal-ink);
  background: var(--teal);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.small-button:hover {
  transform: translateY(-1px);
}

.small-button.ghost {
  color: var(--muted);
  border-color: var(--line-strong);
  background: transparent;
}

.small-button.ghost:hover {
  color: var(--text);
  border-color: var(--teal-line);
}

.frequency-range-controls {
  margin-top: 16px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.frequency-range-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.frequency-range-controls input {
  width: 76px;
  height: 30px;
}

.plot {
  width: 100%;
  position: relative;
}

.plot-frf {
  height: 480px;
  margin-top: 10px;
}

.plot-mode {
  height: 440px;
}

.chart-loading {
  height: 480px;
  display: grid;
  place-content: center;
  color: var(--muted);
  font-size: 13px;
}

.peak-strip {
  min-height: 46px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.peak-strip > span {
  color: var(--dim);
  font-size: 12px;
}

.peak-chip {
  padding: 7px 11px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  color: var(--orange);
  background: var(--orange-soft);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  transition: transform 0.12s ease;
}

.peak-chip:hover {
  transform: translateY(-1px);
}

.peak-chip.active {
  color: #fff;
  border-color: var(--orange);
  background: var(--orange);
}

/* ── Mode reconstruction ───────────────────────────────── */
.mode-frequency-control {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.mode-frequency-control > input[type="range"] {
  width: 180px;
  margin-bottom: 9px;
}

input[type="range"] {
  accent-color: var(--teal);
}

.mode-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: 18px;
}

.mode-main {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel-soft);
}

.mode-tabs {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.mode-tabs button {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  transition: color 0.15s ease, background 0.15s ease;
}

.mode-tabs button:hover {
  color: var(--text);
}

.mode-tabs button.active {
  color: var(--teal);
  background: var(--teal-soft);
}

.mode-table-wrap {
  height: 440px;
  overflow: auto;
  padding: 12px;
}

.mode-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mode-table-wrap th,
.mode-table-wrap td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.mode-table-wrap th {
  position: sticky;
  top: 0;
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-strong);
}

.animation-bar {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.animation-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.animation-bar label input {
  width: 92px;
}

.play-button {
  min-height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  color: #fff;
  background: var(--orange);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.15s ease;
}

.play-button:hover {
  transform: translateY(-1px);
}

.mode-settings {
  min-width: 0;
}

.mode-settings h3 {
  margin: 2px 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.mode-settings > p,
.mode-settings details p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.coordinate-table {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.coordinate-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.coordinate-row:last-child {
  border-bottom: 0;
}

.coordinate-row label {
  min-width: 0;
}

.coordinate-row label strong,
.coordinate-row label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordinate-row label strong {
  font-size: 12px;
  font-weight: 550;
}

.coordinate-row label small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
}

.coordinate-row input {
  width: 100%;
  height: 30px;
  font-variant-numeric: tabular-nums;
}

.coordinate-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.coordinate-actions button {
  padding: 0 8px;
}

.mode-settings details {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.mode-settings summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.mode-settings summary:hover {
  color: var(--teal);
}

.mode-settings details p {
  margin-top: 10px;
}

/* ── Bottom cards ──────────────────────────────────────── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.info-card {
  min-height: 176px;
  padding: 22px 24px;
}

.analysis-log {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.analysis-log p {
  margin: 7px 0;
  padding-left: 16px;
  position: relative;
}

.analysis-log p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 1px;
  background: var(--teal);
}

.analysis-log .warning::before {
  background: var(--yellow);
}

.analysis-log .error::before {
  background: var(--danger);
}

.export-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.export-grid button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel-soft);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.export-grid button:hover {
  border-color: var(--teal-line);
  transform: translateY(-1px);
}

.export-grid button span {
  flex: 0 0 auto;
  min-width: 32px;
  padding: 3px 6px;
  color: var(--teal);
  border: 1px solid var(--teal-line);
  border-radius: 5px;
  background: var(--teal-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

/* ── Footer ────────────────────────────────────────────── */
footer {
  min-height: 92px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--dim);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

/* ── Toasts ────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 0.2s ease;
}

.toast.success {
  border-color: var(--teal-line);
}

.toast.error {
  border-color: rgba(255, 92, 117, 0.5);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto;
  }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  }

  .hero-copy {
    padding-left: 38px;
  }

  .workflow {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .mode-layout {
    grid-template-columns: 1fr;
  }

  .mode-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
  }

  .mode-settings h3,
  .mode-settings > p,
  .mode-settings details {
    grid-column: 1 / -1;
  }

  .coordinate-table {
    max-height: 235px;
  }

  .coordinate-actions {
    grid-template-columns: 1fr;
    align-content: start;
    margin: 0;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 28px, 760px);
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 44px 30px 32px;
  }

  .hero-guide {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 32px 30px 30px;
  }

  .workflow {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .channel-list {
    max-height: 245px;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-header {
    display: block;
  }

  .control-row,
  .mode-frequency-control {
    margin-top: 16px;
    justify-content: flex-start;
  }

  .plot-frf {
    height: 420px;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 540px);
  }

  .topbar {
    min-height: 62px;
  }

  .privacy-badge {
    display: none;
  }

  .hero {
    margin-top: 16px;
  }

  .hero-copy {
    padding: 34px 20px 26px;
  }

  .hero h1 {
    font-size: 33px;
  }

  .hero-actions {
    display: grid;
  }

  .hero-guide {
    padding: 26px 20px 24px;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: 96px;
    padding: 14px;
  }

  .metric-card > strong {
    font-size: 23px;
  }

  .chart-card,
  .mode-card,
  .info-card {
    padding: 18px 16px;
  }

  .frequency-range-controls {
    align-items: flex-end;
  }

  .mode-frequency-control {
    align-items: flex-end;
    flex-wrap: wrap;
  }

  .mode-frequency-control > input[type="range"] {
    width: 100%;
    order: 3;
  }

  .plot-frf,
  .plot-mode,
  .mode-table-wrap {
    height: 360px;
  }

  .animation-bar {
    align-items: flex-start;
  }

  .mode-settings {
    display: block;
  }

  .coordinate-actions {
    margin-top: 8px;
    grid-template-columns: 1fr 1fr;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  footer {
    padding: 26px 0;
    display: grid;
    gap: 6px;
  }
}
