/* ══════════════════════════════════════════════════════════
   音频处理工具 · 样式表
   ══════════════════════════════════════════════════════════ */

:root {
  --bg:        #0d0f14;
  --bg-2:      #14171f;
  --bg-3:      #1b1f2a;
  --bg-4:      #222735;
  --line:      #262c3a;
  --line-2:    #333b4f;
  --fg:        #e8ecf4;
  --fg-2:      #9aa4b8;
  --fg-3:      #6b7488;
  --accent:    #4d8dff;
  --accent-2:  #7b5cff;
  --ok:        #34d399;
  --warn:      #fbbf24;
  --danger:    #f87171;
  --radius:    10px;
  --radius-sm: 7px;
  --shadow:    0 8px 28px rgba(0, 0, 0, .45);
  --wave-bg:   #0a0c11;
}

* { box-sizing: border-box; }

/* 必须放在最前面：本页大量元素用 display:flex/grid，
   会盖掉 UA 样式表里 [hidden] 的 display:none，所以这里强制一下 */
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.5 "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
b { font-weight: 600; }
code {
  font: 11.5px ui-monospace, Menlo, Consolas, monospace;
  background: var(--bg-4);
  border-radius: 4px;
  padding: 1px 5px;
  color: #9dc2ff;
}
svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #47506a; }

/* ─────────── 顶栏 ─────────── */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.logo {
  width: 30px; height: 30px;
  color: var(--accent);
  background: linear-gradient(140deg, rgba(77,141,255,.18), rgba(123,92,255,.18));
  border: 1px solid rgba(77,141,255,.35);
  border-radius: 9px;
  padding: 5px;
}
.brand-text h1 { font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.brand-text p { font-size: 11px; color: var(--fg-3); }

.src-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  overflow: hidden;
  max-height: 46px;
}
.src-name {
  max-width: 300px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; font-size: 12.5px;
}
.chip {
  padding: 2px 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11px;
  color: var(--fg-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip.hl { color: var(--accent); border-color: rgba(77,141,255,.4); background: rgba(77,141,255,.09); }
.chip.warn { color: var(--warn); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.09); }

.topbar-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px;
  border-radius: 20px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--fg-2);
  white-space: nowrap;
  cursor: default;
}
.status-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52,211,153,.15);
}
.status-chip.busy .dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(251,191,36,.15);
  animation: pulse 1.4s ease-in-out infinite;
}
.status-chip.err .dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(248,113,113,.15); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ─────────── 按钮 ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--fg);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s, border-color .13s, opacity .13s, transform .06s;
  -webkit-user-select: none; user-select: none;
}
.btn:hover:not(:disabled) { background: var(--bg-4); border-color: #3f4a63; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 3px 14px rgba(77,141,255,.28);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.09); }
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--bg-3); }
.btn.tiny { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; padding: 10px; font-size: 13.5px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: 0 0 auto;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--fg-2);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--bg-4); color: var(--fg); }
.icon-btn.big { width: 40px; height: 40px; color: var(--fg); background: var(--accent); border-color: transparent; }
.icon-btn.big:hover { background: #5f9bff; color: #fff; }
.icon-btn.big svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.sm svg { width: 14px; height: 14px; }

.link {
  background: none; border: none; padding: 0;
  color: var(--accent); cursor: pointer; font-size: inherit;
  text-decoration: underline; text-underline-offset: 3px;
}
.link:hover { color: #7aaaff; }

/* ─────────── 拖放区 ─────────── */
.dropzone {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 30px;
  overflow: auto;
}
.dropzone.dragover .dz-inner {
  border-color: var(--accent);
  background: rgba(77,141,255,.07);
  transform: scale(1.012);
}
.dz-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: min(620px, 100%);
  padding: 58px 40px;
  border: 2px dashed var(--line-2);
  border-radius: 18px;
  background: var(--bg-2);
  text-align: center;
  transition: border-color .16s, background .16s, transform .16s;
}
.dz-icon { width: 50px; height: 50px; color: var(--accent); margin-bottom: 4px; }
.dz-inner h2 { font-size: 19px; font-weight: 600; }
.dz-inner p { color: var(--fg-2); font-size: 13px; }
.dz-hint { font-size: 11.5px !important; color: var(--fg-3) !important; margin-top: 8px; line-height: 1.7; }
.dz-hint b { color: var(--fg-2); }

/* ─────────── 工作区布局 ─────────── */
.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}
.col-left, .col-right { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.col-right { overflow-y: auto; overflow-x: hidden; padding-right: 2px; }

/* 右栏面板一律按内容高度排布、不参与压缩，整栏由 overflow-y 滚动。
   如果放任 flex 压缩它们，内容会溢出面板盒子，
   然后被后面那个面板盖住 —— 表现就是「按钮看得见但点不动」。 */
.col-right > .panel { flex: 0 0 auto; }

/* ─────────── 面板 ─────────── */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  min-height: 43px;
}
.panel-title { font-size: 12.5px; font-weight: 600; letter-spacing: .3px; color: var(--fg); flex: 0 0 auto; }
.panel-hint { margin-left: auto; font-size: 11px; color: var(--fg-3); }
.panel-body { padding: 13px; display: flex; flex-direction: column; gap: 13px; }

/* ─────────── 波形面板 ─────────── */
.wave-panel { flex: 1 1 auto; min-height: 260px; }

.wave-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.sep-v { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }

/* 原声 / 结果 视图切换 */
.view-toggle {
  display: inline-flex;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.view-toggle .seg {
  padding: 3px 11px;
  border: none;
  background: transparent;
  color: var(--fg-3);
  font-size: 11.5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .13s, color .13s;
  white-space: nowrap;
}
.view-toggle .seg:hover { color: var(--fg-2); }
.view-toggle .seg.on {
  background: var(--bg-4);
  color: #9dc2ff;
  font-weight: 600;
}

.wave-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 150px;
  background: var(--wave-bg);
}
.wave-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;          /* 触摸拖拽选区时不要触发页面滚动 */
  cursor: crosshair;
}

.overview-strip {
  flex: 0 0 auto;
  padding: 0 1px;              /* 让概览条的边框对齐波形 */
  border-top: 1px solid var(--line);
}
.overview-canvas {
  display: block;
  width: 100%;
  height: 34px;
  cursor: pointer;
  touch-action: none;
}

.player-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.spacer { flex: 1 1 auto; }
.time-readout {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--fg-3);
  margin-left: 4px;
}
.time-readout b { color: var(--fg); font-size: 14px; }
.time-readout .sep { color: var(--line-2); }

.mini-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  color: var(--fg-2);
  cursor: pointer;
  white-space: nowrap;
  -webkit-user-select: none; user-select: none;
}
.mini-check.block { white-space: normal; line-height: 1.5; align-items: flex-start; }
.mini-check input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; margin: 0; flex: 0 0 auto; }
.mini-check em { display: block; font-style: normal; font-size: 10.5px; color: var(--fg-3); margin-top: 3px; }
.mini-check:hover { color: var(--fg); }

/* ─────────── 选区读数 ─────────── */
.sel-panel { flex: 0 0 auto; padding: 11px 13px; }
.sel-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.sel-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sel-label { font-size: 10.5px; color: var(--fg-3); }
.sel-sub { font-size: 10.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.sel-big { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ─────────── 模式 Tab ─────────── */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.tab {
  padding: 9px 11px;
  border: none;
  background: transparent;
  color: var(--fg-3);
  font-size: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .13s, border-color .13s;
  white-space: nowrap;
}
.tab:hover { color: var(--fg-2); }
.tab.on { color: #9dc2ff; border-bottom-color: var(--accent); font-weight: 600; }

.tab-body { padding: 13px; }
.pane { display: flex; flex-direction: column; gap: 13px; }
.pane-desc { font-size: 11.5px; color: var(--fg-2); line-height: 1.75; }
.pane-desc b { color: var(--fg); }
.pane-foot { font-size: 10.5px; color: var(--fg-3); line-height: 1.6; }

/* ─────────── 表单 ─────────── */
.group { display: flex; flex-direction: column; gap: 9px; }
.group-label {
  font-size: 11.5px; font-weight: 600; color: var(--fg-2);
  letter-spacing: .3px;
  display: flex; align-items: baseline; gap: 4px 8px;
  flex-wrap: wrap;   /* 说明文字较长时要能换行，否则在窄栏里溢出 */
}
.gl-note { font-weight: 400; font-size: 10.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; line-height: 1.5; }

.field-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.field-row .lbl { flex: 0 0 58px; color: var(--fg-3); font-size: 11.5px; }
.field-row .unit { color: var(--fg-3); font-size: 11px; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.unit { color: var(--fg-3); font-size: 11px; white-space: nowrap; }

.field { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--fg-3); }
.field.compact { gap: 6px; }
.field .unit { font-variant-numeric: tabular-nums; min-width: 38px; }

.num, .sel {
  padding: 6px 9px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  font-size: 12.5px;
  outline: none;
  transition: border-color .13s, background .13s;
  min-width: 0;
}
.num { font-variant-numeric: tabular-nums; }
.num:focus, .sel:focus { border-color: var(--accent); background: var(--bg-4); }
.num:disabled, .sel:disabled { opacity: .42; cursor: not-allowed; }
.grow { flex: 1 1 auto; }
.w80 { width: 78px; flex: 0 0 auto; }
.sel {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
  cursor: pointer;
}
.sel option { background: var(--bg-3); color: var(--fg); }

.range { accent-color: var(--accent); height: 4px; cursor: pointer; min-width: 60px; }

/* ─────────── 循环指标 ─────────── */
.loop-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  padding: 9px 11px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  color: var(--fg-3);
  min-height: 42px;
}
.loop-stats .k { display: flex; justify-content: space-between; gap: 8px; }
.loop-stats .v { color: var(--fg-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.loop-stats .v.ok { color: var(--ok); }
.loop-stats .v.warn { color: var(--warn); }
.loop-stats .v.bad { color: var(--danger); }

.hint-warn {
  font-size: 11px;
  color: var(--warn);
  background: rgba(251,191,36,.09);
  border: 1px solid rgba(251,191,36,.25);
  border-radius: 7px;
  padding: 7px 10px;
  line-height: 1.6;
}
.hint-ok {
  font-size: 11px;
  color: var(--fg-2);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  line-height: 1.6;
}
.peak-readout {
  font-size: 11px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}
.peak-readout b { color: var(--fg-2); }
.peak-readout .warn { color: var(--warn); }

/* ─────────── 拼接列表 ─────────── */
.join-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
}
.join-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11.5px;
}
.join-list .idx {
  flex: 0 0 18px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
}
.join-list .nm {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.join-list .du { flex: 0 0 auto; color: var(--fg-3); font-variant-numeric: tabular-nums; font-size: 10.5px; }
.join-list .rm {
  flex: 0 0 auto;
  border: none; background: transparent;
  color: var(--fg-3); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 2px 4px;
  border-radius: 4px;
}
.join-list .rm:hover { color: var(--danger); background: rgba(248,113,113,.1); }
.join-list .empty { color: var(--fg-3); font-size: 11px; padding: 4px 2px; }

/* ─────────── 导出 / 体积预估 ─────────── */
.fmt-note { font-size: 10.5px; color: var(--fg-3); line-height: 1.6; margin-top: -6px; }

/* 导出面板内部的分组分隔线 */
.divider { height: 1px; background: var(--line); margin: 1px 0; }

.estimate {
  display: flex; flex-direction: column; gap: 7px;
  padding: 11px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.est-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--fg-3);
}
.est-row b { font-size: 14px; color: var(--fg); font-variant-numeric: tabular-nums; }
.est-bar {
  position: relative;
  height: 6px;
  background: var(--bg-4);
  border-radius: 5px;
  overflow: hidden;
}
.est-fill {
  height: 100%;
  width: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .22s ease, background .22s;
}
.est-fill.over { background: linear-gradient(90deg, #f59e0b, var(--danger)); }
.est-delta {
  font-size: 11.5px;
  text-align: center;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.est-delta.down { color: var(--ok); }
.est-delta.up { color: var(--warn); }

/* ─────────── 进度 ─────────── */
.progress { display: flex; flex-direction: column; gap: 7px; }
.p-bar { height: 6px; background: var(--bg-4); border-radius: 5px; overflow: hidden; }
.p-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 5px;
  transition: width .18s linear;
}
.p-meta {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.p-meta #pPct { color: var(--fg); font-weight: 600; }

/* ─────────── 结果 ─────────── */
.result { display: flex; flex-direction: column; gap: 9px; }
.res-head { font-size: 13px; font-weight: 600; color: var(--ok); display: flex; align-items: center; gap: 7px; }
.res-head::before {
  content: '✓';
  display: inline-grid; place-items: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: rgba(52,211,153,.16); font-size: 11px;
}
.res-head.warn { color: var(--warn); }
.res-head.warn::before { content: '!'; background: rgba(251,191,36,.16); }
.res-compare {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.res-compare > div { display: flex; flex-direction: column; gap: 2px; }
.res-compare span { font-size: 10.5px; color: var(--fg-3); }
.res-compare b { font-size: 15px; font-variant-numeric: tabular-nums; }
.res-compare .arrow { color: var(--fg-3); font-size: 15px; }
.res-delta { font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.res-delta.down { color: var(--ok); }
.res-delta.up { color: var(--warn); }
.res-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px;
  font-size: 11px; color: var(--fg-3);
  padding: 9px 11px;
  background: var(--bg-3);
  border-radius: 8px;
}
.res-stats span { color: var(--fg-2); font-variant-numeric: tabular-nums; }

.license-note {
  flex: 0 0 auto;
  padding: 10px 13px;
  font-size: 10.5px;
  color: var(--fg-3);
  line-height: 1.7;
}
.license-note b { color: var(--fg-2); }

/* ─────────── Toast ─────────── */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 20px;
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  z-index: 999;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  max-width: 76vw;
  text-align: center;
  white-space: pre-line;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(248,113,113,.5); color: #ffb4b4; }
.toast.ok { border-color: rgba(52,211,153,.5); color: #8ef0c8; }

/* ─────────── 响应式 ─────────── */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 336px; }
}

@media (max-width: 940px) {
  /* 关键：小屏改为整页滚动。
     如果 body 仍是 height:100%，grid 行会被 flex 高度压扁，
     子面板就互相重叠、播放条会被挤没。 */
  html, body { height: auto; }
  body {
    min-height: 100%;
    overflow: auto;
    overflow-x: hidden;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: min-content;
    flex: 0 0 auto;
    height: auto;
    overflow: visible;
    padding: 10px;
    gap: 10px;
  }
  .col-left, .col-right { overflow: visible; min-height: 0; gap: 10px; }

  .src-info { display: none; }
  .wave-panel { flex: 0 0 auto; min-height: 0; }
  .wave-wrap { min-height: 190px; }

  /* 顶栏换行，避免横向溢出 */
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 12px;
  }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-text h1 { font-size: 13px; }
  .brand-text p { display: none; }
  .topbar-actions {
    flex: 1 1 100%;
    justify-content: space-between;
    min-width: 0;
  }
  .status-chip { font-size: 10.5px; padding: 3px 9px; min-width: 0; }
  .status-chip #statusText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 44vw;
  }

  /* 拖放区在小屏上收窄内边距 */
  .dropzone { padding: 16px; }
  .dz-inner { padding: 38px 20px; gap: 10px; }
  .dz-inner h2 { font-size: 17px; }
  .dz-icon { width: 40px; height: 40px; }

  /* 面板头部换行，工具条左对齐铺满 */
  .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .wave-tools { margin-left: 0; width: 100%; }

  /* 播放条换行 */
  .player-bar { gap: 7px; }
  .time-readout { font-size: 11.5px; margin-left: 0; }
  .time-readout b { font-size: 12.5px; }
  .spacer { flex: 1 1 100%; height: 0; }
  .field.compact { flex: 1 1 100%; }

  /* 选区读数改成两列，避免时间被压窄 */
  .sel-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sel-big { font-size: 14px; }

  .tabs { overflow-x: auto; padding: 0 4px; }
  .tab { padding: 9px 10px; font-size: 11.5px; }

  .field-row .lbl { flex: 0 0 50px; }
  .join-list { max-height: 140px; }
}
