/* 人教版小学英语（PEP）三年级上册 听力镜像站 — 样式
 * 内容区样式还原官网原版（container_title / bg_title / 下载按钮等），
 * 并新增顶部控制条（连读 / 循环 / 语速）。纯静态、无外部依赖。 */

:root {
  --pep-green: #00a069;
  --pep-green-d: #00925f;
  --ink: #333;
  --muted: #666;
  --line: #ebebeb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #f3f5f4;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 14px 60px;
}

/* ---------- 顶部标题 ---------- */
.lb-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 14px 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.lb-header img.logo {
  height: 54px;
  width: auto;
}
.lb-header .titles h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--pep-green-d);
  letter-spacing: 1px;
}
.lb-header .titles .sub {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 单元快速导航 ---------- */
.lb-nav {
  max-width: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lb-nav a {
  font-size: 13px;
  color: var(--pep-green-d);
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 4px 12px;
}
.lb-nav a:hover { background: #f0fbf7; }

/* ---------- 顶部控制条（新增功能） ---------- */
.lb-controls {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 2px solid var(--pep-green);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.lb-btn {
  border: 1px solid var(--pep-green);
  background: #fff;
  color: var(--pep-green-d);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.lb-btn:hover { background: #f0fbf7; }
.lb-btn.active {
  background: var(--pep-green);
  color: #fff;
}
.lb-seg {
  display: inline-flex;
  gap: 6px;
}
.lb-seg .lb-btn { border-radius: 16px; }
.lb-rate {
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lb-rate select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 13px;
  background: #fff;
}
.lb-now {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 单元标题（还原官网） ---------- */
.container_title_ptptzy2024 {
  position: relative;
  margin: 22px 0 6px;
  height: 2em;
  line-height: 2em;
  padding-left: 2.5em;
  background: url(assets/img/icon_title_typtzy2024.png) left center no-repeat;
  background-size: auto 2em;
}
.container_title_ptptzy2024 h4 {
  margin: 0;
  position: relative;
  font-weight: 700;
  font-size: 1.25em;
}
.container_title_ptptzy2024 h4 span {
  position: relative;
  z-index: 2;
}
.bg_title_ptptzy2024 {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0.4em;
  height: 10px;
  width: 100%;
  background: linear-gradient(to right, #e1f6f2, #fff);
  background-position: bottom;
}

/* ---------- 单元列表 / 条目（还原官网） ---------- */
.container_list_ptptzy2024 .list_rjyyptzy2024 {
  margin-top: 18px;
  padding: 10px 12px 18px;
  border-bottom: 1px solid #fafafa;
  border-radius: 10px;
  transition: background .15s;
}
.container_list_ptptzy2024 .list_rjyyptzy2024.lb-playing {
  background: #f0fbf7;
  box-shadow: inset 3px 0 0 var(--pep-green);
}
.list_rjyyptzy2024 h5 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
}

/* 音频 + 下载 一行 */
.lb-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.lb-item-row audio {
  flex: 1 1 320px;
  min-width: 260px;
  height: 40px;
}
.btn_download_ptptzy2024 {
  display: inline-block;
  width: 120px;
  border-radius: 8px;
  height: 36px;
  line-height: 36px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  background: url(assets/img/icon_download.png) 10px center no-repeat var(--pep-green);
  background-size: 18px 18px;
}
.btn_download_ptptzy2024:hover { background-color: var(--pep-green-d); }

/* ---------- 双栏布局：侧边栏 + 内容 ---------- */
.lb-layout {
  max-width: 1280px;
  margin: 14px auto 0;
  padding: 0 14px 60px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.lb-main {
  flex: 1 1 auto;
  min-width: 0;
}
.lb-loading {
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
}

/* ---------- 侧边栏（还原官网教材目录） ---------- */
.lb-sidebar {
  flex: 0 0 262px;
  width: 262px;
  position: sticky;
  top: 70px;
  background: #fff;
  border-left: 6px solid var(--pep-green);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
  overflow: hidden;
}
.lb-group + .lb-group {
  border-top: 1px solid var(--line);
}
.lb-group-title {
  margin: 0;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lb-group-title:hover { color: var(--pep-green-d); }
.lb-group.open > .lb-group-title { color: var(--pep-green-d); }
/* 圆形 − / + 图标 */
.lb-toggle {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--pep-green);
  border-radius: 50%;
  position: relative;
}
.lb-toggle::before,
.lb-toggle::after {
  content: "";
  position: absolute;
  background: var(--pep-green);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.lb-toggle::before { width: 10px; height: 2px; }
.lb-toggle::after { width: 2px; height: 10px; }
.lb-group.open .lb-toggle::after { display: none; }

.lb-book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}
.lb-group.open .lb-book-list { display: block; }
.lb-book-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px 13px 48px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid #f2f2f2;
}
.lb-book-list li a:hover { color: var(--pep-green-d); background: #f7fcfa; }
.lb-book-list li a.active {
  color: var(--pep-green-d);
  font-weight: 700;
  background: #f0fbf7;
}
.lb-book-list li a .lb-arrow {
  font-style: normal;
  font-size: 20px;
  color: var(--pep-green);
  opacity: 0;
  transition: opacity .15s;
}
.lb-book-list li a.active .lb-arrow { opacity: 1; }

/* 移动端：目录按钮（放在吸顶控制条内，滚动时始终可达） + 抽屉式侧边栏 */
.lb-menu-toggle {
  display: none;
  border: 1px solid var(--pep-green);
  background: #fff;
  color: var(--pep-green-d);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.lb-sidebar-mask {
  display: none;
}
@media (max-width: 900px) {
  .lb-layout { display: block; }
  .lb-menu-toggle { display: inline-block; }
  .lb-sidebar {
    position: fixed;
    z-index: 200;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 84vw;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  body.lb-sidebar-open { overflow: hidden; }
  body.lb-sidebar-open .lb-sidebar { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.18); }
  body.lb-sidebar-open .lb-sidebar-mask {
    display: block;
    position: fixed;
    z-index: 150;
    inset: 0;
    background: rgba(0, 0, 0, .35);
  }
}

/* 抽屉标题栏（移动端抽屉内顶部：标题 + 关闭按钮） */
.lb-drawer-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--pep-green);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.lb-drawer-head .lb-drawer-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
}
.lb-drawer-close {
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-drawer-close:hover { background: rgba(255, 255, 255, .32); }
@media (max-width: 900px) {
  .lb-drawer-head { display: flex; }
}

/* ---------- 页脚 ---------- */
.lb-footer {
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.lb-footer img { height: 36px; opacity: .8; margin-bottom: 8px; }

@media (max-width: 600px) {
  .lb-header .titles h1 { font-size: 20px; }
  .lb-now { max-width: 100%; margin-left: 0; width: 100%; }
  .lb-item-row audio { flex-basis: 100%; }
}
