/* 睡前故事 · 夜间暖调 UI
   设计约束：睡前场景，低亮度 + 暖色，避免蓝光刺激；按钮要大，迷糊时也能点中 */

:root {
  --bg: #16110D;
  --bg-glow: #241A12;
  --card: #241D17;
  --card-hi: #2C241C;
  --line: rgba(255, 236, 214, 0.09);
  --line-hi: rgba(255, 236, 214, 0.16);
  --text: #F3E9DD;
  --text-2: #A79784;
  --text-3: #7A6A5A;
  --accent: #E39B57;
  --accent-deep: #C2542F;
  --r: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -80px, var(--bg-glow) 0%, transparent 70%),
    var(--bg);
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 18px 20px;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
}
.icon-btn:active { background: var(--card-hi); }

/* ---------- 系列 tab ---------- */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.tab.active {
  color: var(--accent);
  border-color: rgba(227, 155, 87, 0.45);
  background: rgba(227, 155, 87, 0.1);
}

/* ---------- 系列大卡 ---------- */

.series-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 6px 14px;
  text-align: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.series-cover {
  position: relative;
  border-radius: calc(var(--r) - 4px);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--bg);
  margin-bottom: 12px;
}

.series-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.series-cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 18px 14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.25) 45%, rgba(0,0,0,0) 70%);
  text-align: center;
}

.series-emoji { font-size: 34px; line-height: 1; margin-bottom: 6px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }

.series-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 4px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.series-tagline {
  font-size: 12px;
  color: rgba(255, 236, 214, 0.92);
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.series-meta {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: rgba(227, 155, 87, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
}

/* ---------- 生成区 ---------- */

.make {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 20px;
}

.make-label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
}
.make-label .hint { color: var(--text-3); font-size: 12px; }

.wish-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}
.wish-input::placeholder { color: var(--text-3); }
.wish-input:focus { border-color: rgba(227, 155, 87, 0.5); }

.gen-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #24160A;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.gen-btn:active { transform: scale(0.985); }
.gen-btn:disabled { opacity: 0.45; cursor: default; }

.progress-box { margin-top: 14px; }

.progress-track {
  height: 4px;
  background: rgba(255, 236, 214, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .4s ease;
}
.progress-text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------- 剧集列表 ---------- */

.sec-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  margin: 0 0 10px 2px;
  letter-spacing: 0.5px;
}

.ep-list { list-style: none; margin: 0; padding: 0; }

.ep-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s;
}
.ep-item:active { background: var(--card-hi); }
.ep-item.playing { border-color: rgba(227, 155, 87, 0.4); }

.ep-cover {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.ep-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ep-no {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-3);
  background: rgba(255, 236, 214, 0.06);
  padding: 3px 7px;
  border-radius: 6px;
}

.ep-main { flex: 1; min-width: 0; }
.ep-title {
  font-size: 15px;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ep-wish {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ep-play {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-hi);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 24px 0;
  margin: 0;
}

.foot {
  margin-top: 22px;
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
}

/* ---------- 播放条 ---------- */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(32, 25, 19, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  z-index: 50;
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.player-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 10px;
}
.close-player {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
}

.player-ctrl { display: flex; align-items: center; gap: 14px; }

.play-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #24160A;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
}
.play-btn.playing { padding-left: 0; }

.seek { flex: 1; min-width: 0; }

.seek-bar {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 236, 214, 0.14);
  border-radius: 999px;
  outline: none;
  margin: 0;
}
.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.seek-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.seek-time {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.player-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
}

.lang-switch, .timer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn, .timer-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-btn.active, .timer-btn.active {
  color: var(--accent);
  border-color: rgba(227, 155, 87, 0.45);
  background: rgba(227, 155, 87, 0.1);
}

.timer-label { font-size: 11px; color: var(--text-3); margin-right: 2px; }

/* ---------- 档案面板 ---------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
}

.sheet-title { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.sheet-desc { margin: 0 0 18px; font-size: 12px; color: var(--text-3); line-height: 1.5; }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-hi);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.field input:focus { border-color: rgba(227, 155, 87, 0.5); }

.sheet-btns { display: flex; gap: 10px; margin-top: 18px; }

.btn-ghost, .btn-solid {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
}
.btn-ghost {
  border: 1px solid var(--line-hi);
  background: transparent;
  color: var(--text-2);
}
.btn-solid {
  border: none;
  background: var(--accent);
  color: #24160A;
  font-weight: 600;
}

/* ===== 公开模式（陌生人看到的首屏） ==========================
   目标：62 秒示例音频听得见 + 登录 CTA 够大，其他一律收起 */

.demo { padding: 4px 0 8px; }

.demo-hero { text-align: center; padding: 22px 8px 26px; }
.demo-emoji { font-size: 54px; line-height: 1; margin-bottom: 14px; }
.demo-title {
  margin: 0 0 10px; font-size: 23px; font-weight: 700;
  letter-spacing: .3px; color: var(--text);
}
.demo-desc {
  margin: 0 auto; max-width: 430px; font-size: 14.5px; line-height: 1.75;
  color: var(--text-2);
}

/* 示例音频卡 */
.demo-audio {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 16px 14px;
  margin-bottom: 18px;
}
.demo-audio-label {
  font-size: 11.5px; color: var(--text-3);
  letter-spacing: .6px; margin-bottom: 8px;
}
.demo-audio-title {
  font-size: 15.5px; font-weight: 600; color: var(--text);
  margin-bottom: 13px;
}
.demo-audio-ctrl { display: flex; align-items: center; gap: 13px; }
.demo-play {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  border: none; background: var(--accent); color: #241A12;
  font-size: 17px; cursor: pointer; padding-left: 3px;
  display: flex; align-items: center; justify-content: center;
}
.demo-play:active { transform: scale(.94); }
.demo-seek { flex: 1; min-width: 0; }
.demo-seek input[type=range] {
  width: 100%; height: 3px; -webkit-appearance: none; appearance: none;
  background: var(--line-hi); border-radius: 2px; outline: none;
}
.demo-seek input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
.demo-time {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--text-3); margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.demo-tip {
  margin: 12px 0 0; font-size: 12px; color: var(--text-3);
  line-height: 1.6;
}

/* 登录 CTA */
.demo-cta {
  width: 100%; min-height: 54px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #2A1A0C; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer; margin-bottom: 22px;
  box-shadow: 0 6px 20px rgba(227, 155, 87, .18);
}
.demo-cta:active { transform: scale(.985); }
.demo-cta-icon { font-size: 19px; }

/* 三个卖点 */
.demo-points { display: flex; flex-direction: column; gap: 13px; margin-bottom: 22px; }
.demo-point {
  font-size: 13.5px; line-height: 1.65; color: var(--text-2);
  padding-left: 15px; border-left: 2px solid var(--line-hi);
}
.demo-point b {
  display: block; font-size: 14.5px; color: var(--text);
  font-weight: 600; margin-bottom: 3px;
}

.demo-privacy {
  text-align: center; font-size: 12px; color: var(--text-3); margin: 0;
}
.demo-privacy a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line-hi); }
