/* 听故事栏目样式 —— 复用站点奶油/青绿配色，独立文件避免动 style.css */
:root {
  --st-cream: #fbf6ea;
  --st-brown: #4a3b2f;
  --st-muted: #8a7a66;
  --st-line: #e6dcc9;
  --st-teal: #0f766e;
  --st-teal-2: #14b8a6;
}

/* ---------- 首页入口 ---------- */
.stories-promo {
  margin: 22px 0;
  padding: 18px 18px 14px;
  background: var(--st-cream);
  border: 2px solid var(--st-line);
  border-radius: 18px;
}
.stories-promo .section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.story-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.story-pill {
  flex: 1 1 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 2px solid var(--st-line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--st-brown);
  transition: transform .12s ease, box-shadow .12s ease;
}
.story-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(74, 59, 47, .12); }
.story-pill-emoji { font-size: 24px; line-height: 1; }
.story-pill-main b { display: block; font-size: 15px; }
.story-pill-main small { color: var(--st-muted); font-size: 12px; }
.story-more { display: inline-block; margin-top: 10px; color: var(--st-teal); font-weight: 700; font-size: 14px; text-decoration: none; }

/* ---------- 专辑列表页 ---------- */
.stories-home { max-width: 820px; margin: 0 auto; padding: 20px 16px 80px; }
.stories-head { text-align: center; margin: 10px 0 26px; }
.stories-head h1 { font-size: 30px; color: var(--st-brown); margin: 0 0 6px; }
.stories-head p { color: var(--st-muted); margin: 0; font-size: 14px; }
.album-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .album-grid { grid-template-columns: 1fr 1fr; } }
.album-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 2px solid var(--st-line);
  border-radius: 18px;
  text-decoration: none;
  color: var(--st-brown);
  transition: transform .12s ease, box-shadow .12s ease;
}
.album-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(74, 59, 47, .12); }
.album-card.locked { opacity: .9; }
.album-emoji { font-size: 40px; line-height: 1; }
.album-main { flex: 1; min-width: 0; }
.album-main b { display: block; font-size: 17px; }
.album-main small { color: var(--st-teal); font-size: 12.5px; font-weight: 700; }
.album-blurb { display: block; color: var(--st-muted); font-size: 12.5px; margin-top: 3px; }
.album-arrow { font-size: 22px; color: var(--st-teal); }
.stories-empty { text-align: center; color: var(--st-muted); padding: 40px 0; }
.stories-start { margin-top: 26px; }

/* ---------- 专辑分集页 ---------- */
.stories-album { max-width: 820px; margin: 0 auto; padding: 8px 14px 120px; }
.album-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 8px 8px;
  gap: 4px;
}
.album-head-emoji { font-size: 56px; line-height: 1; }
.album-head h1 { margin: 4px 0 0; font-size: 26px; color: var(--st-brown); }
.album-head h1 small { display: block; font-size: 13px; color: var(--st-muted); font-weight: 500; margin-top: 4px; }
.album-head p { color: var(--st-muted); font-size: 13.5px; margin: 6px 0 0; }
.stories-hint {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fff7e8;
  border: 1px dashed var(--st-line);
  border-radius: 12px;
  color: var(--st-brown);
  font-size: 13px;
}
.stories-hint a { color: var(--st-teal); font-weight: 700; }
.ep-section { margin: 18px 0; }
.ep-group-title {
  font-size: 16px;
  color: var(--st-teal);
  margin: 14px 4px 8px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.ep-group-title small { color: var(--st-muted); font-size: 12px; font-weight: 500; }
.ep-list { list-style: none; margin: 0; padding: 0; }
.ep-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: #fff;
  border: 2px solid var(--st-line);
  border-radius: 14px;
  margin-bottom: 8px;
  transition: background .12s ease, border-color .12s ease;
}
.ep-row:hover { border-color: var(--st-teal-2); }
.ep-row.playing { background: #e6faf6; border-color: var(--st-teal-2); }
.ep-row.locked { background: #faf7f0; }
.ep-play, .ep-lock {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--st-teal);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.ep-lock { background: #d8ccb4; }
.ep-no { flex: 0 0 auto; width: 46px; text-align: right; color: var(--st-muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.ep-title { flex: 1; min-width: 0; color: var(--st-brown); font-size: 15px; cursor: pointer; }
.ep-row.locked .ep-title { color: var(--st-muted); cursor: default; }
.ep-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-style: normal;
  border-radius: 8px;
  background: #eef6f4;
  color: var(--st-teal);
}
.ep-tag.ep-part { background: #f3eee2; color: var(--st-muted); }
.ep-flag { flex: 0 0 auto; font-size: 12px; color: var(--st-muted); }
.ep-flag.free { color: var(--st-teal); font-weight: 700; }

/* ---------- 单集页 ---------- */
.stories-episode { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; text-align: center; }
.ep-head-emoji { font-size: 46px; }
.ep-head-album { color: var(--st-muted); font-size: 13px; margin: 6px 0 2px; }
.ep-head h1 { font-size: 24px; color: var(--st-brown); margin: 4px 0 18px; }
.ep-player-box { margin: 10px auto 18px; max-width: 560px; }
#story-audio { width: 100%; }
.ep-locked-msg { padding: 20px; background: #faf7f0; border: 2px dashed var(--st-line); border-radius: 14px; color: var(--st-brown); }
.ep-locked-msg a { color: var(--st-teal); font-weight: 700; }
.ep-back a { color: var(--st-teal); text-decoration: none; font-weight: 700; }

/* ---------- 底部播放条 ---------- */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(251, 246, 234, .97);
  border-top: 2px solid var(--st-line);
  box-shadow: 0 -6px 20px rgba(74, 59, 47, .10);
  backdrop-filter: blur(6px);
}
.player-bar[hidden] { display: none; }
.player-info { flex: 0 0 34%; min-width: 0; }
.player-info b { display: block; font-size: 14px; color: var(--st-brown); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-info small { color: var(--st-muted); font-size: 11.5px; }
.player-audio { flex: 1; min-width: 0; }
.player-audio audio { width: 100%; height: 36px; }
.player-ctrls { display: flex; gap: 6px; }
.player-ctrls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--st-line);
  background: #fff;
  color: var(--st-teal);
  font-size: 14px;
  cursor: pointer;
}
@media (max-width: 520px) {
  .player-info { flex-basis: 40%; }
  .player-ctrls { display: none; }
}

/* ---------- 解锁弹窗 ---------- */
.ep-row.locked { cursor: pointer; }
.unlock-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(31, 41, 55, .45);
}
.unlock-modal[hidden] { display: none; }
.unlock-modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 24px 20px 18px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  text-align: center;
}
.unlock-modal-card h3 { margin: 0 0 6px; color: var(--st-brown); font-size: 20px; }
.unlock-modal-sub { margin: 0 0 14px; color: var(--st-muted); font-size: 13px; }
.unlock-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--st-muted);
  cursor: pointer;
}
#unlock-form { display: flex; flex-direction: column; gap: 10px; }
#unlock-form #unlock-code {
  padding: 12px 14px;
  border: 2px solid var(--st-line);
  border-radius: 12px;
  font-size: 15px;
  text-align: center;
  letter-spacing: .5px;
}
#unlock-form #unlock-code:focus { outline: none; border-color: var(--st-teal-2); }
#unlock-form button {
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--st-teal);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.unlock-msg { min-height: 18px; margin: 10px 0 0; color: #b45309; font-size: 13px; }

/* ---------- 故事搜索 ---------- */
.stories-search { display: flex; gap: 8px; margin: 0 0 18px; }
.stories-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 2px solid var(--st-line);
  border-radius: 14px;
  font-size: 15px;
  background: #fff;
  color: var(--st-brown);
}
.stories-search input:focus { outline: none; border-color: var(--st-teal-2); }
.stories-search button {
  flex: 0 0 auto;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: var(--st-teal);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.search-info { margin: 0 0 10px; color: var(--st-muted); font-size: 13px; }
.search-info a { color: var(--st-teal); font-weight: 700; }
.result-list { display: flex; flex-direction: column; gap: 8px; }
.story-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 2px solid var(--st-line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--st-brown);
  transition: border-color .12s ease;
}
.story-result:hover { border-color: var(--st-teal-2); }
.sr-emoji { font-size: 24px; line-height: 1; }
.sr-main { flex: 1; min-width: 0; }
.sr-main b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-main small { color: var(--st-muted); font-size: 12px; }
.sr-flag { flex: 0 0 auto; font-size: 12px; color: var(--st-muted); }
.sr-flag.free { color: var(--st-teal); font-weight: 700; }
