/* ============================================================
   学习台 / 学习电台 · 章节收听 · AI 讲解 · 播客
   与 site.css 共用配色变量（绛红 / 鎏金 / 墨绿 / 米白）
   ============================================================ */

/* ---------------- 学习台：双栏 ---------------- */
.st-grid{ display:grid; grid-template-columns:1.02fr .98fr; gap:18px; align-items:start }
.st-card{
  background:var(--surface); border:1px solid var(--border); border-radius:12px;
  padding:20px 20px 18px; box-shadow:var(--shadow-sm);
}
.st-card.tint{ background:linear-gradient(180deg,#FFFDF8,#FBF7EE); border-color:#EADFC8 }
.st-card h3{
  font-family:var(--serif); font-size:17.5px; color:var(--red-deep);
  margin:0 0 4px; letter-spacing:.04em;
}
.st-card .hint{ font-size:12.8px; color:var(--text-3); line-height:1.65; margin:0 0 12px }
.st-label{ font-size:12.5px; color:var(--ink-3); margin:0 0 6px; letter-spacing:.04em }

.st-select{
  width:100%; padding:9px 10px; font-size:13.5px; font-family:inherit;
  border:1px solid var(--border-2); border-radius:7px; background:#fff; color:var(--text);
}
.st-select:focus{ outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(184,134,47,.12) }

.st-chaps{ margin-top:12px; max-height:372px; overflow-y:auto; border-top:1px dashed var(--border) }
.st-chaps::-webkit-scrollbar{ width:5px }
.st-chaps::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:4px }
.st-chap{
  display:flex; align-items:center; gap:9px; width:100%; text-align:left;
  padding:9px 10px; border:none; border-bottom:1px solid #F0EADF; background:none;
  font-family:inherit; font-size:13.8px; color:var(--text); cursor:pointer;
  border-left:3px solid transparent; transition:background .15s, border-color .15s;
}
.st-chap:hover{ background:rgba(184,134,47,.08) }
.st-chap.on{ background:rgba(139,0,0,.055); border-left-color:var(--red); color:var(--red-deep); font-weight:600 }
.st-chap .n{
  flex:none; width:20px; height:20px; border-radius:50%; background:var(--bg-2);
  color:var(--gold); font-family:var(--serif); font-size:11.5px;
  display:flex; align-items:center; justify-content:center;
}
.st-chap .m{ margin-left:auto; flex:none; font-size:11.5px; color:var(--text-3); font-weight:400 }
.st-chaps .st-empty{ padding:16px 8px; font-size:13px; color:var(--text-3) }

.st-ta{
  width:100%; min-height:88px; resize:vertical; padding:11px 12px;
  border:1px solid var(--border-2); border-radius:8px; background:#fff;
  font-family:inherit; font-size:14px; line-height:1.75; color:var(--text);
}
.st-ta:focus{ outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(184,134,47,.12) }
.st-ta::placeholder{ color:#B4AC9E }

.st-chips{ display:flex; flex-wrap:wrap; gap:7px; margin:10px 0 12px }
.st-chip{
  border:1px solid var(--border-2); background:#fff; border-radius:20px;
  padding:5px 11px; font-size:12.3px; color:var(--ink-2); cursor:pointer;
  font-family:inherit; transition:all .15s; line-height:1.4;
}
.st-chip:hover{ border-color:var(--gold); color:var(--red-deep); background:rgba(184,134,47,.07) }

.st-actions{ display:flex; flex-wrap:wrap; gap:8px; align-items:center }
.st-btn{
  border:1px solid var(--border-2); background:#fff; border-radius:8px;
  padding:9px 15px; font-size:13.5px; font-family:inherit; color:var(--ink);
  cursor:pointer; transition:all .15s;
}
.st-btn:hover{ border-color:var(--gold); color:var(--red-deep); background:rgba(184,134,47,.06) }
.st-btn.primary{
  background:var(--red-deep); border-color:var(--red-deep); color:#FBEED2; font-weight:600;
}
.st-btn.primary:hover{ background:#A31515; color:#fff }
.st-btn[disabled]{ opacity:.45; cursor:not-allowed }
.st-btn.sm{ padding:6px 11px; font-size:12.5px }

.st-depth{ display:flex; gap:0; border:1px solid var(--border-2); border-radius:8px; overflow:hidden }
.st-depth button{
  border:none; background:#fff; padding:7px 13px; font-size:12.5px; cursor:pointer;
  font-family:inherit; color:var(--text-2);
}
.st-depth button.on{ background:var(--red-deep); color:#FBEED2 }

.st-script{ margin-top:14px; border-top:1px solid var(--border); padding-top:12px; max-height:340px; overflow-y:auto }
.st-script::-webkit-scrollbar{ width:5px }
.st-script::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:4px }
.st-script .st-sub{
  font-size:11.8px; color:var(--text-3); margin-bottom:10px; letter-spacing:.03em;
}
.st-script h4{
  font-family:var(--serif); font-size:15px; color:var(--ink);
  margin:14px 0 6px; padding-left:9px; border-left:3px solid var(--gold);
}
.st-script h4:first-of-type{ margin-top:0 }
.st-script p{ font-size:14px; line-height:1.95; color:var(--text-2); margin:0 0 8px }
.st-script .st-memo{
  margin-top:12px; padding:11px 13px; border-radius:8px;
  background:rgba(139,0,0,.045); border-left:3px solid var(--red);
  font-family:var(--serif); font-size:14.5px; color:var(--red-deep); line-height:1.8;
}
.st-script .st-src{ margin-top:10px; font-size:12.3px; color:var(--text-3) }
.st-script .st-src a{ color:var(--ink-2); text-decoration:none; border-bottom:1px dotted var(--border-2) }
.st-script .st-src a:hover{ color:var(--red-deep); border-color:var(--red) }
.st-empty{ font-size:13px; color:var(--text-3); line-height:1.8 }

/* 表格与键帽（本页独立使用） */
.kv td{ vertical-align:top; line-height:1.8; color:var(--text-2); font-size:13.8px }
.kv td:first-child{ width:22%; font-weight:600; color:var(--ink); white-space:nowrap }
.kv a{ color:var(--ink-2); text-decoration:none; border-bottom:1px dotted var(--border-2) }
.kv a:hover{ color:var(--red-deep); border-color:var(--red) }
.kbd{
  display:inline-block; padding:1px 7px; border:1px solid var(--border-2); border-bottom-width:2px;
  border-radius:5px; background:#fff; font-size:12.5px; color:var(--ink);
  font-family:ui-monospace,monospace;
}

/* ---------------- 播客 ---------------- */
.pod-hero{
  background:linear-gradient(135deg,#5E0B0B,#8B0000 58%,#A31515);
  border-radius:14px; padding:26px 26px 22px; color:#FBEED2; position:relative; overflow:hidden;
  box-shadow:0 14px 34px rgba(90,10,10,.22);
}
.pod-hero::after{
  content:""; position:absolute; right:-70px; top:-80px; width:240px; height:240px; border-radius:50%;
  background:radial-gradient(circle,rgba(243,217,164,.2),transparent 68%);
}
.pod-hero h3{ font-family:var(--serif); color:#F3D9A4; font-size:22px; margin:0 0 8px; letter-spacing:.06em }
.pod-hero p{ font-size:14px; line-height:1.85; color:rgba(251,238,210,.88); margin:0 0 16px; max-width:760px }
.pod-hero .st-actions{ position:relative; z-index:1 }
.pod-hero .big-btn{
  border:none; border-radius:10px; padding:12px 22px; cursor:pointer;
  background:#F3D9A4; color:#7A0000; font-size:15px; font-weight:700; font-family:inherit;
  box-shadow:0 4px 14px rgba(0,0,0,.18); transition:transform .16s;
}
.pod-hero .big-btn:hover{ transform:translateY(-1px) }
.pod-hero .ghost-btn{
  border:1px solid rgba(243,217,164,.5); border-radius:10px; padding:11px 16px;
  background:rgba(255,255,255,.06); color:#F3D9A4; font-size:13.5px; cursor:pointer; font-family:inherit;
}
.pod-hero .ghost-btn:hover{ background:rgba(243,217,164,.18) }
.pod-hero .ghost-btn[disabled]{ opacity:.4; cursor:not-allowed }
.pod-now{ margin-top:14px; padding-top:12px; border-top:1px solid rgba(243,217,164,.22); font-size:12.8px; color:rgba(251,238,210,.8); position:relative; z-index:1 }
.pod-now b{ color:#F3D9A4 }

.pod-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:16px }
.pod-card{
  background:var(--surface); border:1px solid var(--border); border-radius:12px;
  padding:16px 17px 14px; position:relative; transition:box-shadow .18s, transform .18s, border-color .18s;
}
.pod-card:hover{ box-shadow:var(--shadow); transform:translateY(-2px); border-color:#E2D6BE }
.pod-card.on{ border-color:var(--red); box-shadow:0 0 0 2px rgba(139,0,0,.08) }
.pod-no{
  font-family:var(--serif); font-size:12px; color:var(--gold); letter-spacing:.12em; margin-bottom:6px;
}
.pod-card h4{
  font-family:var(--serif); font-size:16.5px; color:var(--red-deep); margin:0 0 6px; line-height:1.5;
}
.pod-card .sub{ font-size:13px; color:var(--text-2); line-height:1.75; margin:0 0 10px; min-height:44px }
.pod-meta{ display:flex; flex-wrap:wrap; gap:10px; font-size:11.8px; color:var(--text-3); margin-bottom:10px }
.pod-meta span{ display:inline-flex; align-items:center; gap:4px }
.pod-card .st-actions{ gap:7px }
.pod-tag{
  display:inline-block; font-size:11px; padding:2px 8px; border-radius:20px;
  background:rgba(184,134,47,.12); color:#8A6412; margin-bottom:8px;
}

/* 文稿与章节 */
.pod-chips{ display:flex; flex-wrap:wrap; gap:7px; margin:12px 0 4px }
.pod-chip{
  border:1px solid var(--border-2); background:#fff; border-radius:7px;
  padding:6px 11px; font-size:12.5px; font-family:inherit; color:var(--ink-2); cursor:pointer;
  transition:all .15s;
}
.pod-chip:hover{ border-color:var(--gold); color:var(--red-deep) }
.pod-chip.on{ background:var(--red-deep); border-color:var(--red-deep); color:#FBEED2 }
.pod-trans{ margin-top:10px; max-height:460px; overflow-y:auto; padding-right:4px }
.pod-trans::-webkit-scrollbar{ width:5px }
.pod-trans::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:4px }
.pod-line{
  display:flex; gap:10px; padding:8px 10px; border-radius:8px; cursor:pointer;
  font-size:14.2px; line-height:1.9; color:var(--text-2); transition:background .14s;
}
.pod-line:hover{ background:rgba(184,134,47,.07) }
.pod-line.on{ background:rgba(139,0,0,.06); color:var(--text) }
.pod-line .who{
  flex:none; width:52px; font-size:11.5px; letter-spacing:.06em; padding-top:4px;
  color:var(--text-3);
}
.pod-line.host .who{ color:var(--gold) }
.pod-line.guest .who{ color:var(--red-deep) }
.pod-line .tx{ flex:1 }
.pod-line.on .tx{ font-weight:500 }

/* 电台播放条 */
.pod-bar{
  position:fixed; left:0; right:0; bottom:0; z-index:9996;
  display:flex; align-items:center; gap:10px; padding:9px 16px;
  background:linear-gradient(180deg, rgba(94,11,11,.97), rgba(74,6,6,.99));
  border-top:1px solid rgba(243,217,164,.28);
  box-shadow:0 -6px 22px rgba(60,10,10,.28);
  color:#F3D9A4; font-family:inherit;
  transform:translateY(112%); transition:transform .28s ease;
}
.pod-bar.show{ transform:translateY(0) }
body.pod-hasbar{ padding-bottom:78px }
.pb-btn{
  flex:none; width:32px; height:32px; padding:0; border-radius:50%;
  border:1px solid rgba(243,217,164,.32); background:rgba(255,255,255,.06);
  color:#F3D9A4; cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:all .16s;
}
.pb-btn:hover{ background:rgba(243,217,164,.18); border-color:rgba(243,217,164,.6) }
.pb-btn svg{ width:14px; height:14px; fill:currentColor }
.pb-play{
  flex:none; width:42px; height:42px; padding:0; border-radius:50%;
  border:1.5px solid #F3D9A4; background:#F3D9A4; color:#7A0000; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:transform .16s;
}
.pb-play:hover{ transform:scale(1.04); background:#fff }
.pb-play svg{ width:18px; height:18px; fill:#7A0000 }
.pb-info{ flex:1 1 auto; min-width:0; margin:0 4px }
.pb-src{ font-size:13.5px; font-weight:600; color:#FBEED2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.pb-meta{ font-size:11.5px; color:rgba(243,217,164,.72); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.pb-bar{ flex:0 0 22%; height:5px; background:rgba(243,217,164,.22); border-radius:3px; cursor:pointer; overflow:hidden }
.pb-bar i{ display:block; height:100%; width:0; background:#F3D9A4; border-radius:3px; transition:width .2s }
.pb-pct{ flex:none; width:38px; text-align:right; font-size:11.5px; color:rgba(243,217,164,.8) }
.pb-speed{
  flex:none; border:1px solid rgba(243,217,164,.32); background:rgba(255,255,255,.06);
  color:#F3D9A4; border-radius:6px; padding:5px 9px; font-size:12px; cursor:pointer; font-family:inherit;
}
.pb-speed:hover{ background:rgba(243,217,164,.18) }

/* 播放中的整集信息卡 */
.pod-live{
  margin-top:16px; border:1px solid var(--border); border-radius:12px; background:var(--surface);
  padding:18px 20px 16px;
}
.pod-live .hd{ display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; margin-bottom:4px }
.pod-live .hd b{ font-family:var(--serif); font-size:18px; color:var(--red-deep) }
.pod-live .hd span{ font-size:12.3px; color:var(--text-3) }
.pod-live .desc{ font-size:13.4px; color:var(--text-2); line-height:1.85; margin:6px 0 0 }

@media (max-width:900px){
  .st-grid{ grid-template-columns:1fr }
  .pod-grid{ grid-template-columns:1fr }
  .pod-card .sub{ min-height:0 }
  .pb-bar{ display:none }
  body.pod-hasbar{ padding-bottom:96px }
  .pod-bar{ flex-wrap:wrap; row-gap:7px; padding:8px 10px }
  .pb-info{ order:-1; flex:1 0 100% }
  .pod-trans{ max-height:none }
}
/* 播客页已用自己的播放条：隐藏统一内核的全局条，避免两条并存 */
body.xr-podpage .sp-player,
body.xr-podpage .sp-launcher,
body.xr-podpage .sp-panel{ display:none !important }
body.xr-podpage.sp-hasbar{ padding-bottom:0 }

/* 移动端触摸优化：消除 300ms 延迟、禁双击缩放、文稿/章节项大触达 */
.pod-chip, .pod-line, .st-chap, .st-btn, .pod-bar button, .pod-bar .pb-bar{
  -webkit-tap-highlight-color:transparent; touch-action:manipulation;
}
.pod-line{ cursor:pointer }
@media (max-width:900px){
  .pod-chip{ padding:9px 14px; font-size:13px }
  .pod-line{ padding:10px 12px }
  .st-chap{ padding:13px 12px; font-size:14px; min-height:46px }
  .st-btn{ padding:11px 15px; font-size:13.5px }
  .st-chip{ padding:8px 13px; font-size:12.8px }
}

/* 修复：移动端 .layout 用 1fr（=minmax(auto,1fr)），main 的 auto 最小值不收缩，
   会被讲解台的长 select 撑宽导致横向溢出。显式 min-width:0 让主栏严格受限于容器。 */
.layout > main{ min-width:0; max-width:100% }

/* ===== 播客讲解台（bookcast） ===== */
.bc-wrap{ border:1px solid var(--border); border-radius:14px; background:var(--surface); overflow:hidden;
  max-width:100%; min-width:0; box-sizing:border-box }
.bc-bar{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; min-width:0; max-width:100%; box-sizing:border-box;
  padding:14px 16px; background:linear-gradient(135deg,#7A0000,#A31515); }
.bc-modes{ display:flex; gap:6px; min-width:0; max-width:100% }
.bc-mode{ border:1px solid rgba(243,217,164,.4); background:rgba(255,255,255,.06); color:#F3D9A4;
  padding:8px 14px; border-radius:20px; font-size:13px; cursor:pointer; font-family:inherit; white-space:nowrap;
  min-width:0 }
.bc-mode.on{ background:#F3D9A4; color:#7A0000; font-weight:700 }
.bc-pick{ display:flex; align-items:center; gap:8px; margin-left:auto; min-width:0; max-width:100% }
.bc-pick label{ color:#F3D9A4; font-size:12.5px; white-space:nowrap; flex:none }
.bc-pick .st-select{ max-width:260px; min-width:0; flex:1 1 auto }
.bc-actions{ display:flex; gap:8px; flex:1 0 100%; min-width:0; max-width:100% }
.bc-actions .st-btn{ flex:1 1 0; min-width:0 }
.bc-now{ padding:11px 16px; font-size:13px; color:var(--text-2); background:var(--bg-2); border-bottom:1px solid var(--border) }
.bc-list{ max-height:560px; overflow:auto; padding:8px }
.bc-seg{ display:block; width:100%; text-align:left; border:1px solid transparent; border-radius:9px;
  padding:11px 13px; cursor:pointer; background:transparent; font-family:inherit; transition:all .15s }
.bc-seg:hover{ background:var(--bg-2) }
.bc-seg.on{ border-color:var(--gold,#B8862F); background:rgba(184,134,47,.08) }
.bc-seg-h{ display:flex; align-items:center; gap:10px }
.bc-no{ flex:none; width:26px; height:26px; border-radius:50%; background:var(--red-deep,#8B0000); color:#fff;
  font-size:12px; display:flex; align-items:center; justify-content:center }
.bc-t{ flex:1; font-size:14px; font-weight:600; color:var(--ink); line-height:1.5 }
.bc-m{ flex:none; font-size:11.5px; color:var(--text-3) }
.bc-seg-sub{ font-size:11.5px; color:var(--text-3); margin:5px 0 0 36px }
.bc-empty{ padding:26px; text-align:center; color:var(--text-3); font-size:13px }
@media (max-width:900px){
  .bc-pick{ margin-left:0; flex:1 0 100% }
  .bc-pick .st-select{ max-width:none; flex:1 1 0; width:100%; min-width:0 }
  .bc-modes{ flex:1 0 100% }
  .bc-mode{ flex:1 1 0; padding:10px 6px; font-size:12px; white-space:normal;
    text-align:center; line-height:1.35; min-width:0 }
  .bc-seg{ padding:12px 10px }
  .bc-t{ font-size:13.6px }
  .bc-seg-sub{ margin-left:0 }
}

@media print{
  .pod-bar{ display:none !important }
  .bc-bar, .bc-list{ display:none !important }
}
