:root {
  color-scheme: light;
  --ink: #171a1f;
  --muted: #687078;
  --paper: #f4f5f2;
  --surface: #ffffff;
  --line: #d9ddd9;
  --red: #d94b3d;
  --red-dark: #ae332a;
  --cyan: #158b91;
  --amber: #c07818;
  --charcoal: #20252b;
  --shadow: 0 14px 40px rgba(23, 26, 31, 0.09);
  --waveform-track-height: 76px;
  --panel-tint-top: #f7faf9;
  --panel-tint-bottom: #edf3f1;
  --support-tint-top: #e9f0ed;
  --support-tint-bottom: #e1eae6;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(21, 139, 145, 0.24);
  outline-offset: 2px;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
}

.topbar {
  min-height: 78px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--ink);
  border-bottom: 3px solid var(--red);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand h1,
.brand p,
.track-meta h2,
.track-meta p,
.repeat-heading h3,
.empty-list p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.25;
}

.brand-name-en {
  margin-left: 7px;
  color: #78c8c4;
  font-size: 12px;
  font-weight: 700;
}

.brand p {
  margin-top: 3px;
  color: #aeb5bb;
  font-size: 12px;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:active:not(:disabled),
.round-button:active:not(:disabled),
.play-button:active:not(:disabled) {
  transform: translateY(1px);
}

.button.primary {
  color: #fff;
  background: var(--red);
}

.button.primary:hover {
  background: var(--red-dark);
}

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

.topbar-actions .button.secondary {
  color: #e7ecef;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.topbar-actions .button.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.button.secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.button.secondary:hover:not(:disabled) {
  border-color: #969da1;
}

.button.dark {
  color: #fff;
  background: var(--charcoal);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.workspace {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  background:
    radial-gradient(1100px 420px at 78% -8%, rgba(21, 139, 145, 0.06), transparent 70%),
    var(--surface);
}

.playlist-panel {
  position: relative;
  min-height: 0;
  padding: 22px 18px;
  background: linear-gradient(180deg, var(--panel-tint-top) 0%, var(--panel-tint-bottom) 100%);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.playlist-panel::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: 18px;
  width: 290px;
  height: 272px;
  background: url("assets/playlist-watermark.svg") center / contain no-repeat;
  opacity: 0.1;
  pointer-events: none;
}

.playlist-panel > * {
  position: relative;
  z-index: 1;
}

.panel-heading,
.repeat-heading,
.now-playing,
.settings-row,
.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 24px;
  line-height: 1;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.icon-button:hover {
  color: var(--red);
  border-color: var(--red);
}

.search-box {
  height: 42px;
  margin: 18px 0 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.search-box:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(21, 139, 145, 0.1);
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.track-list {
  height: calc(100vh - 212px);
  margin: 0;
  padding: 0 3px 40px 0;
  list-style: none;
  overflow-y: auto;
  scrollbar-width: thin;
}

.track-item {
  width: 100%;
  min-height: 58px;
  margin-bottom: 4px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.track-item:hover {
  background: #fff;
  border-color: var(--line);
}

.track-item.active {
  color: #fff;
  background: var(--charcoal);
  border-color: var(--charcoal);
}

.track-number {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.track-item.active .track-number,
.track-item.active .track-file {
  color: #aeb7bd;
}

.track-copy {
  min-width: 0;
}

.track-word,
.track-file {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-word {
  font-size: 15px;
  font-weight: 750;
}

.track-file {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.track-playing {
  width: 12px;
  height: 14px;
  display: flex;
  align-items: end;
  gap: 2px;
  opacity: 0;
}

.track-item.active .track-playing {
  opacity: 1;
}

.track-playing i {
  width: 2px;
  height: 35%;
  display: block;
  background: var(--red);
}

.track-item.active.is-playing .track-playing i {
  animation: meter 700ms ease-in-out infinite alternate;
}

.track-item.active.is-playing .track-playing i:nth-child(2) {
  animation-delay: -300ms;
}

.track-item.active.is-playing .track-playing i:nth-child(3) {
  animation-delay: -500ms;
}

@keyframes meter {
  from { height: 25%; }
  to { height: 100%; }
}

.empty-list {
  position: absolute;
  inset: 180px 28px auto;
  text-align: center;
  color: var(--muted);
}

.empty-list[hidden] {
  display: none;
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: #e4f1f0;
  border: 1px solid #c6dfdc;
  border-radius: 50%;
  font-size: 26px;
}

.empty-list strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.empty-list p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.player-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2vw, 26px);
}

.now-playing {
  align-items: flex-start;
}

.track-meta {
  min-width: 0;
}

.track-meta h2 {
  max-width: 760px;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 700;
  line-height: 1.04;
}

.track-meta p {
  max-width: 650px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--muted);
  background: #f1f2ef;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}

.mode-status[data-active="true"] {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.detail-heading {
  min-height: 30px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.detail-window-label {
  color: var(--muted);
  font-size: 10px;
}

.zoom-controls {
  height: 28px;
  display: grid;
  grid-template-columns: 28px 40px 28px;
  align-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.zoom-controls button {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
}

.zoom-controls button:hover:not(:disabled) {
  color: var(--red);
  background: #f2f3f0;
}

.zoom-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.zoom-controls output {
  color: var(--ink);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.visual-stage {
  position: relative;
  width: 100%;
  height: var(--waveform-track-height);
  overflow: hidden;
  background: var(--charcoal);
  border-radius: 6px;
  cursor: crosshair;
  touch-action: none;
}

.visual-stage:focus-visible {
  outline: 3px solid rgba(21, 139, 145, 0.3);
  outline-offset: 2px;
}

#visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.detail-selection {
  position: absolute;
  inset-block: 0;
  z-index: 1;
  display: none;
  background: rgba(101, 192, 189, 0.15);
  border-left: 1px solid rgba(101, 192, 189, 0.72);
  border-right: 1px solid rgba(229, 162, 60, 0.76);
  pointer-events: none;
}

.detail-playhead,
.detail-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 2px;
  pointer-events: none;
  transform: translateX(-1px);
}

.detail-playhead {
  left: 0;
  background: var(--red);
}

.detail-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 6px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.detail-marker {
  z-index: 4;
  display: none;
}

.detail-marker::before {
  position: absolute;
  top: 8px;
  left: 5px;
  padding: 2px 4px;
  color: #fff;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 900;
}

.detail-marker-a {
  background: #65c0bd;
}

.detail-marker-a::before {
  content: "A";
  background: var(--cyan);
}

.detail-marker-b {
  background: #e5a23c;
}

.detail-marker-b::before {
  content: "B";
  left: auto;
  right: 5px;
  background: var(--amber);
}

.stage-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #798087;
  font: 700 30px/1 Georgia, serif;
  pointer-events: none;
}

.stage-placeholder[hidden] {
  display: none;
}

.detail-time-row {
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.overview-block {
  margin-bottom: 7px;
}

.overview-heading {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.overview-heading > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.overview-track {
  position: relative;
  width: 100%;
  height: var(--waveform-track-height);
  overflow: hidden;
  background: #eef0ed;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: crosshair;
  touch-action: none;
}

.overview-track:focus-visible {
  outline: 3px solid rgba(21, 139, 145, 0.24);
  outline-offset: 2px;
}

#overviewWaveform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.overview-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  display: none;
  background: rgba(21, 139, 145, 0.12);
  border-left: 1px solid rgba(21, 139, 145, 0.45);
  border-right: 1px solid rgba(192, 120, 24, 0.55);
  pointer-events: none;
}

.overview-viewport {
  position: absolute;
  top: 3px;
  bottom: 3px;
  z-index: 2;
  display: none;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(23, 26, 31, 0.72);
  border-radius: 2px;
  pointer-events: none;
}

.overview-playhead,
.overview-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  pointer-events: none;
  transform: translateX(-1px);
}

.overview-playhead {
  left: 0;
  z-index: 3;
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.overview-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 6px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.overview-marker {
  z-index: 4;
  display: none;
}

.overview-marker::before {
  position: absolute;
  top: 5px;
  left: 4px;
  padding: 2px 4px;
  color: #fff;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 900;
}

.overview-marker-a {
  background: var(--cyan);
}

.overview-marker-a::before {
  content: "A";
  background: var(--cyan);
}

.overview-marker-b {
  background: var(--amber);
}

.overview-marker-b::before {
  content: "B";
  left: auto;
  right: 4px;
  background: var(--amber);
}

.timeline-wrap {
  width: 100%;
}

.timeline {
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
}

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

#progress {
  width: 100%;
  height: 5px;
  margin: 0;
}

.marker {
  position: absolute;
  top: 1px;
  width: 3px;
  height: 24px;
  display: none;
  pointer-events: none;
  transform: translateX(-1px);
}

.marker::before {
  position: absolute;
  top: -7px;
  left: -5px;
  font-size: 10px;
  font-weight: 900;
}

.marker-a {
  background: var(--cyan);
}

.marker-a::before {
  content: "A";
  color: var(--cyan);
}

.marker-b {
  background: var(--amber);
}

.marker-b::before {
  content: "B";
  color: var(--amber);
}

.time-row {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.transport {
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.playback-mode-row {
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.playback-mode-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.playback-mode-controls .mode-status {
  min-height: 33px;
  display: grid;
  place-items: center;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.segmented-control button {
  min-height: 31px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button:hover {
  color: var(--ink);
  background: #f2f3f0;
}

.segmented-control button[aria-pressed="true"] {
  color: #fff;
  background: var(--charcoal);
}

.round-button,
.play-button {
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  line-height: 1;
}

.round-button {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.play-button {
  width: 50px;
  height: 50px;
  padding-left: 4px;
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(217, 75, 61, 0.28);
}

.play-button[data-playing="true"] {
  padding-left: 0;
}

.round-button:hover:not(:disabled) {
  border-color: var(--ink);
}

.round-button:disabled,
.play-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.settings-row {
  width: min(700px, 100%);
  margin: 0 auto 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.compact-control,
.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-control select {
  height: 34px;
  padding: 0 28px 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.volume-control {
  flex: 1 1 210px;
  justify-content: flex-end;
}

.volume-control input {
  width: min(180px, 100%);
}

.repeat-panel {
  padding: 14px 16px;
  background: #f7f8f6;
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: 6px;
}

.repeat-heading h3 {
  margin-top: 3px;
  font-size: 18px;
}

.toggle-button {
  min-height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.toggle-dot {
  width: 9px;
  height: 9px;
  background: #aab0b2;
  border-radius: 50%;
}

.toggle-button[aria-pressed="true"] {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.toggle-button[aria-pressed="true"] .toggle-dot {
  background: #fff;
}

.repeat-readout {
  margin: 10px 0;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(40px, 1.5fr) minmax(110px, 1fr);
  align-items: center;
}

.point-card {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.point-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.point-card strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.point-a strong {
  color: var(--cyan);
}

.point-b strong {
  color: var(--amber);
}

.segment-line {
  height: 1px;
  background: var(--line);
}

.segment-line span {
  width: 8px;
  height: 8px;
  margin: -4px auto 0;
  display: block;
  background: var(--red);
  border-radius: 50%;
}

.repeat-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.repeat-actions .button {
  min-width: 180px;
}

.mark-segment-button {
  color: #fff;
  background: var(--red);
}

.mark-segment-button:hover:not(:disabled) {
  background: var(--red-dark);
}

.repeat-state {
  min-height: 20px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.hotkey-panel {
  margin-top: 8px;
  padding-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.hotkey-title {
  color: var(--ink);
  font-size: 11px;
}

.hotkey-panel span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.hotkey-panel output {
  color: var(--ink);
  font-weight: 800;
}

kbd {
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd0cd;
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 700 10px/1 Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.marked-segments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.marked-segments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.marked-segments-heading h3 {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}

.marked-segments-heading h3 span {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--cyan);
  border-radius: 11px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.marked-segment-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-icon-button {
  width: 34px;
  height: 34px;
}

.text-file-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.sequence-repeat {
  min-height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  background: #f5f6f4;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sequence-repeat select {
  height: 26px;
  padding: 0 4px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.audio-format-select {
  height: 34px;
  padding: 0 28px 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.option-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.generate-audio-button {
  color: #fff;
  background: var(--cyan);
}

.generate-audio-button:hover:not(:disabled) {
  background: #0f7378;
}

.text-file-button.is-active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.text-file-button.is-active:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.audio-export-panel {
  margin-top: 12px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.audio-export-panel progress {
  min-width: 0;
  flex: 1 1 auto;
  height: 8px;
  accent-color: var(--cyan);
}

.audio-export-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.marked-segment-list {
  max-height: 240px;
  margin: 12px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border-top: 1px solid var(--line);
}

.marked-segment-item {
  min-width: 0;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.marked-segment-replay {
  min-width: 0;
  min-height: 58px;
  padding: 8px 10px 8px 6px;
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: 32px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}

.marked-segment-replay:hover {
  background: #f2f5f3;
}

.marked-segment-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.marked-segment-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.marked-segment-copy strong,
.marked-segment-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marked-segment-copy strong {
  font-size: 13px;
}

.marked-segment-copy span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.marked-segment-copy .marked-segment-source {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.marked-segment-play {
  color: var(--red);
  font-size: 12px;
  text-align: center;
}

.marked-segment-remove {
  width: 38px;
  flex: 0 0 38px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  font-size: 21px;
}

.marked-segment-remove:hover {
  color: #fff;
  background: var(--red);
}

.marked-segments-empty {
  margin: 12px 0 0;
  padding: 18px;
  color: var(--muted);
  background: #f7f8f6;
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  color: #fff;
  background: rgba(23, 26, 31, 0.88);
  border: 6px solid var(--cyan);
}

.drop-overlay.active {
  display: grid;
}

.drop-overlay div {
  text-align: center;
}

.drop-overlay span,
.drop-overlay strong {
  display: block;
}

.drop-overlay span {
  margin-bottom: 10px;
  font-size: 52px;
}

.drop-overlay strong {
  font-size: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 14px;
  color: #fff;
  background: var(--ink);
  border-left: 4px solid var(--red);
  border-radius: 5px;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.help-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: min(86vh, 940px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 26px 70px rgba(23, 26, 31, 0.28);
  overflow: hidden;
}

.help-dialog::backdrop {
  background: rgba(23, 26, 31, 0.45);
}

.help-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 15px 18px 15px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.help-head h2 {
  margin: 0;
  font-size: 17px;
}

.help-body {
  max-height: calc(min(86vh, 940px) - 61px);
  padding: 6px 22px 26px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.85;
}

.help-body h3 {
  margin: 20px 0 6px;
  color: var(--cyan);
  font-size: 13.5px;
}

.help-body h3:first-child {
  margin-top: 14px;
}

.help-body p,
.help-body ol,
.help-body ul {
  margin: 0 0 6px;
  color: #3b434a;
}

.help-body ol,
.help-body ul {
  padding-left: 20px;
}

.help-body li {
  margin: 3px 0;
}

.help-body b {
  color: var(--ink);
}

.help-table {
  width: 100%;
  margin: 4px 0 8px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.help-table th,
.help-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.help-table th {
  width: 92px;
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.help-table td {
  color: #3b434a;
}

.help-note {
  margin-top: 10px;
  padding-top: 10px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  font-size: 12px;
}

.help-figure {
  margin: 8px 0 14px;
}

.help-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.help-figure figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

.support-footer {
  padding: 0 24px 34px;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(circle at 1px 1px, rgba(21, 139, 145, 0.09) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--support-tint-top) 0%, var(--support-tint-bottom) 100%);
  border-top: 1px solid #cfdad5;
}

.support-card {
  width: min(1000px, 100%);
  margin-top: 26px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: var(--surface);
  border: 1px solid #d3ddd8;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(23, 26, 31, 0.07);
}

.support-copy {
  min-width: 0;
}

.support-copy .eyebrow {
  position: relative;
  padding-bottom: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
}

.support-copy .eyebrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 3px;
  background: var(--cyan);
  border-radius: 2px;
}

.support-copy p {
  max-width: 540px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.85;
}

.support-copy .support-motto {
  margin-top: 12px;
  padding-top: 12px;
  color: var(--ink);
  border-top: 1px dashed var(--line);
  font-size: 13px;
}

.support-motto strong {
  margin-top: 4px;
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
}

.support-copy .support-links {
  margin-top: 10px;
  font-size: 12px;
}

.support-copy .support-links a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.support-copy .support-links a:hover {
  color: #0f7378;
}

.support-codes {
  display: flex;
  align-items: stretch;
  gap: 16px;
  flex: 0 0 auto;
}

.support-code {
  margin: 0;
  width: 160px;
  padding: 12px 12px 11px;
  display: grid;
  justify-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(23, 26, 31, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.support-code:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(23, 26, 31, 0.1);
}

.support-code img {
  width: 136px;
  height: auto;
  display: block;
  border-radius: 6px;
}

.support-code figcaption {
  padding: 5px 10px;
  color: var(--ink);
  background: #eef3f1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 780px) {
  :root {
    --waveform-track-height: 70px;
  }

  .app-shell {
    min-height: 100svh;
  }

  .topbar {
    min-height: 70px;
    padding: 12px 14px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand-name-en {
    margin-left: 5px;
    font-size: 10px;
  }

  .brand p {
    display: none;
  }

  .topbar .button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .help-dialog {
    width: calc(100vw - 20px);
    max-height: 88vh;
  }

  .help-body {
    max-height: calc(88vh - 61px);
    padding: 4px 16px 22px;
    font-size: 12.5px;
  }

  .help-table th {
    width: 74px;
  }

  .workspace {
    display: block;
  }

  .playlist-panel {
    min-height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .playlist-panel::after {
    right: -26px;
    bottom: -52px;
    width: 210px;
    height: 190px;
    opacity: 0.055;
  }

  .panel-heading {
    display: none;
  }

  .search-box {
    margin: 0 0 8px;
  }

  .track-list {
    height: auto;
    max-height: 190px;
    padding-bottom: 4px;
  }

  .empty-list {
    position: static;
    padding: 20px 10px 14px;
  }

  .empty-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
  }

  .player-panel {
    padding: 22px 14px 34px;
  }

  .track-meta h2 {
    font-size: 30px;
  }

  .mode-status {
    padding: 6px 8px;
    font-size: 10px;
  }

  .visual-stage {
    height: var(--waveform-track-height);
  }

  .detail-heading {
    margin-top: 14px;
  }

  .overview-track {
    height: var(--waveform-track-height);
  }

  .transport {
    margin: 16px 0;
  }

  .playback-mode-row {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

  .playback-mode-controls {
    width: 100%;
  }

  .segmented-control {
    width: auto;
    flex: 1 1 auto;
    grid-template-columns: repeat(3, 1fr);
  }

  .settings-row {
    margin-bottom: 22px;
    flex-wrap: wrap;
  }

  .volume-control {
    justify-content: flex-start;
  }

  .repeat-panel {
    padding: 16px 12px;
  }

  .repeat-readout {
    grid-template-columns: 1fr 36px 1fr;
    margin: 18px 0 14px;
  }

  .point-card {
    padding: 10px;
  }

  .point-card strong {
    font-size: 18px;
  }

  .repeat-actions .button {
    min-width: 0;
    flex: 1 1 auto;
  }

  .hotkey-panel {
    justify-content: flex-start;
    gap: 7px 10px;
  }

  .hotkey-title {
    width: 100%;
  }

  .marked-segments-heading {
    align-items: flex-end;
    flex-wrap: wrap;
  }

  .marked-segment-tools {
    margin-left: auto;
  }

  .audio-export-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }

  .audio-export-actions {
    justify-content: flex-start;
  }

  .marked-segment-list {
    max-height: 300px;
  }

  .support-footer {
    padding: 0 14px 26px;
  }

  .support-card {
    margin-top: 20px;
    padding: 18px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .support-codes {
    width: 100%;
    justify-content: center;
  }

  .support-code {
    width: auto;
    flex: 1 1 0;
    max-width: 170px;
  }

  .support-code img {
    width: 100%;
    max-width: 132px;
  }

  .support-copy .eyebrow {
    font-size: 19px;
    padding-bottom: 9px;
  }
}

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