:root {
  --bg: #f3eee6;
  --paper: #fffdf9;
  --ink: #1c1917;
  --muted: #6f675e;
  --line: #e4d9c8;
  --accent: #184e86;
  --accent-soft: #e8eef6;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --shadow: 0 12px 32px rgba(28, 25, 23, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 400px at 50% -120px, #e7e1d4 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

body { min-height: 100dvh; }

.wrap {
  width: min(720px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.logo {
  color: var(--accent);
  flex: none;
  display: flex;
}

h1 {
  font-size: 22px;
  letter-spacing: 0.02em;
  margin: 0;
  font-weight: 720;
  line-height: 1.2;
}

.lede {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1.5px dashed #cbbca8;
  border-radius: 16px;
  padding: 28px 18px 22px;
  text-align: center;
  background: #faf6ef;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-icon {
  display: block;
  color: var(--accent);
  margin-bottom: 10px;
  line-height: 0;
}

.drop-icon svg {
  display: block;
  margin: 0 auto;
}

.drop b {
  display: block;
  font-size: 17px;
  margin-bottom: 6px;
}

.drop span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

.file-btn input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}

.drop:hover,
.drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.hidden { display: none !important; }

.work,
.result { margin-top: 2px; }

.work-top,
.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filemeta {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  padding: 6px 0;
  cursor: pointer;
  flex: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

button {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.cue:hover,
button.cue.active {
  color: inherit;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.progress { margin-top: 10px; }

.step {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}

.bar {
  height: 7px;
  background: #efe6d8;
  border-radius: 99px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.error {
  margin-top: 12px;
  color: var(--bad);
  background: var(--bad-bg);
  border-radius: 12px;
  padding: 12px 14px;
  display: none;
}

.error.show { display: block; }

.player-dock {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  padding: 10px 0 8px;
}

audio {
  width: 100%;
  height: 40px;
}

.cues {
  margin-top: 4px;
  max-height: min(58vh, 560px);
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 6px 0 4px;
}

.cue {
  appearance: none;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  font: inherit;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 12px;
  cursor: pointer;
  border: 0;
  border-left: 3px solid transparent;
}

.cue:hover { background: #f6f1e8; }

.cue.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.cue time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  padding-top: 2px;
}

.cue.active time { color: var(--accent); font-weight: 650; }

.cue p {
  margin: 0;
  font-size: 16px;
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 16px, 720px); padding-top: 16px; }
  h1 { font-size: 20px; }
  .card { padding: 14px; border-radius: 16px; }
  .cue { grid-template-columns: 48px 1fr; padding: 12px 8px; }
  button, .file-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar > i, .drop { transition: none; }
}
