:root {
  --bg: #1a1410;
  --paper: #241c16;
  --ink: #f4e6d4;
  --muted: #b9a48a;
  --line: #3a2d24;
  --gold: #e0a45a;
  --gold-dim: #c4843a;
  --danger: #e07a5f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 20% -10%, #3a2618 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 80px;
}

.top h1 {
  margin: 4px 0 8px;
  font-size: 32px;
  letter-spacing: 0.12em;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.28em;
}

.hint, .muted {
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  margin-top: 18px;
  padding: 18px;
  background: color-mix(in srgb, var(--paper) 88%, black);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.hidden { display: none; }

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.tab {
  flex: 1;
  min-height: 40px;
  border-radius: 999px;
  background: #2c211a;
  color: var(--muted);
  font-size: 15px;
}

.tab.active {
  background: var(--gold);
  color: #1a120c;
  font-weight: 700;
}

input[type="url"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #120e0b;
  color: var(--ink);
  font-size: 16px;
}

.file-box {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px dashed var(--gold-dim);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
}

.file-box input {
  display: none;
}

.toc {
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
}

.toc-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 8px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.toc-item.active,
.toc-item:hover {
  background: #33261d;
}

.toc-item.ready {
  color: var(--gold);
}

.chapter-now {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.12em;
}

#lock-tip {
  margin: 8px 0 12px;
}

audio {
  display: none;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.16em;
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #120e0b;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  resize: vertical;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.between { justify-content: space-between; }
.center { text-align: center; }
.block { width: 100%; }
.tiny { font-size: 12px; color: var(--muted); }

button {
  font-family: inherit;
  border: 0;
  cursor: pointer;
}

.primary, .ghost, .icon {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 16px;
}

.primary {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  color: #1a120c;
  font-weight: 700;
}

.ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.icon {
  flex: 1;
  background: #2c211a;
  color: var(--ink);
}

.icon.play {
  background: var(--gold);
  color: #1a120c;
  font-weight: 700;
}

#count { color: var(--muted); font-size: 13px; }

.cast-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.who-name {
  font-size: 17px;
}

select {
  max-width: 58%;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #120e0b;
  color: var(--ink);
  font-size: 14px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.now {
  min-height: 110px;
}

.who {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.18em;
}

.line {
  margin: 0;
  font-size: 20px;
  line-height: 1.7;
}

.progress {
  height: 6px;
  margin: 16px 0 8px;
  background: #120e0b;
  border-radius: 99px;
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0;
  background: var(--gold);
}

.controls {
  display: flex;
  gap: 10px;
  margin: 14px 0 18px;
}

.script {
  max-height: 280px;
  overflow: auto;
  padding-right: 6px;
}

.seg {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.seg.active {
  background: #33261d;
  color: var(--ink);
}

.status {
  min-height: 24px;
  color: var(--danger);
  text-align: center;
}

@media (min-width: 720px) {
  .app { padding-top: 48px; }
}
