/* CASTecho shared player: one component, responsive presentation variants. */
:root{--p-accent:#d80b24;--player-mini-height:68px}
body.has-player.player-host-mobile{padding-bottom:76px;padding-bottom:calc(76px + env(safe-area-inset-bottom))}
body.has-player.player-host-agent{padding-bottom:0}
body.has-player.player-host-agent .composer-wrap{padding-bottom:calc(var(--player-mini-height) + env(safe-area-inset-bottom) + 8px)}
body.has-player.player-host-agent .context-cards,
body.has-player.player-host-agent .ctl-list,
body.has-player.player-host-agent .channel-members-panel{padding-bottom:calc(var(--player-mini-height) + 15px)}
body.has-player.player-host-agent .context-usage-footer{margin-bottom:calc(var(--player-mini-height) + env(safe-area-inset-bottom))}
/* mini 播放条全宽贴底：侧栏底部（登录/账号、连接状态）同样要让位，避免被遮挡 */
body.has-player.player-host-agent .app-sidebar{padding-bottom:calc(var(--player-mini-height) + env(safe-area-inset-bottom) + 12px)}

.castecho-player button{
  appearance:none;-webkit-appearance:none;margin:0;padding:0;border:0;font:inherit;line-height:1;color:inherit;
  cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;
}
.castecho-player button:focus-visible{outline:2px solid var(--p-accent,var(--accent));outline-offset:2px}
.anticon{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:0;vertical-align:-.125em;pointer-events:none}
.anticon svg{display:block;width:1em;height:1em;fill:currentColor;stroke:none;overflow:visible}
.castecho-player img{display:block}
.castecho-player .mini-player{
  position:fixed;left:0;right:0;bottom:0;z-index:80;
  background:#fff;color:var(--ink);
  border-top:1px solid var(--hairline);
  box-shadow:0 -8px 30px rgba(0,0,0,.10);
}
.castecho-player .mini-player[hidden],
.castecho-player .full-player[hidden],
.castecho-player .player-playlist[hidden]{display:none}
.castecho-player .mp-progress{position:relative;height:2px;background:#ececec;cursor:pointer}
.castecho-player .mp-fill{position:absolute;left:0;top:0;bottom:0;width:0;background:var(--p-accent,var(--accent))}
.castecho-player .mp-knob{display:none}
.castecho-player .mp-body{display:flex;align-items:center;gap:12px;padding:10px 12px calc(10px + env(safe-area-inset-bottom))}
.castecho-player .mp-cover{
  position:relative;width:44px;height:44px;border-radius:10px;flex:none;overflow:hidden;
  background:var(--p-accent,var(--accent));display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:700;font-size:16px;cursor:default;transition:transform .16s ease,box-shadow .16s ease;
}
.castecho-player .mp-cover.is-link,.castecho-player .fp-cover.is-link,.castecho-player .ppl-cover[data-podcast-id]{cursor:pointer}
@media(hover:hover){
  .castecho-player .mp-cover.is-link:hover,.castecho-player .fp-cover.is-link:hover,.castecho-player .ppl-cover[data-podcast-id]:hover{transform:translateY(-1px);box-shadow:0 3px 8px rgba(0,0,0,.16)}
}
.castecho-player .mp-cover img{width:100%;height:100%;object-fit:cover}
.castecho-player .mp-meta{min-width:0;flex:1}
.castecho-player .mp-title{font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.castecho-player .mp-sub{font-size:12px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.castecho-player .mp-btn{
  width:40px;height:40px;border-radius:50%;border:0;flex:none;
  display:flex;align-items:center;justify-content:center;
  color:var(--p-accent,var(--accent));background:color-mix(in srgb,var(--p-accent,var(--accent)) 10%,transparent);
}
.castecho-player .mp-btn.play{width:44px;height:44px;background:var(--p-accent,var(--accent));color:#fff}
.castecho-player .mp-btn:active{transform:scale(.94)}
.castecho-player .mp-time{display:none}

.castecho-player .full-player{position:fixed;inset:0;z-index:90}
.castecho-player .fp-scrim{position:absolute;inset:0;background:rgba(0,0,0,.4);opacity:0;transition:opacity .25s ease}
.castecho-player .fp-sheet{
  position:absolute;left:0;right:0;bottom:0;top:0;
  background:#fff;color:var(--ink);display:flex;flex-direction:column;
  padding:0 20px calc(12px + env(safe-area-inset-bottom));
  transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);
}
.castecho-player .full-player.open .fp-sheet{transform:none}
.castecho-player .full-player.open .fp-scrim{opacity:1}
.castecho-player .fp-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:10px}
.castecho-player .fp-collapse,
.castecho-player .fp-list,
.castecho-player .fp-timeline{
  width:36px;height:36px;border-radius:50%;border:0;background:#f2f3f5;color:var(--ink-soft);
  display:flex;align-items:center;justify-content:center;flex:none;
}
.castecho-player .fp-actions{display:flex;align-items:center;gap:4px}
.castecho-player .fp-label{flex:1;min-width:0;font-size:13px;font-weight:700;color:var(--muted);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.castecho-player .fp-info{
  width:min(100%,520px);margin:18px auto 0;display:grid;
  grid-template-columns:64px minmax(0,1fr);gap:13px;align-items:center;
}
.castecho-player .fp-cover{
  position:relative;width:64px;height:64px;border-radius:11px;overflow:hidden;
  background:var(--p-accent,var(--accent));display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:800;font-size:22px;box-shadow:0 8px 20px -10px rgba(0,0,0,.32);cursor:default;transition:transform .16s ease,box-shadow .16s ease;
}
.castecho-player .fp-cover img{width:100%;height:100%;object-fit:cover}
.castecho-player .mp-cover::before,.castecho-player .fp-cover::before{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:rgba(17,24,39,.32);opacity:0;transition:opacity .15s ease;
}
.castecho-player .mp-cover::after,.castecho-player .fp-cover::after{
  content:"";position:absolute;left:50%;top:50%;z-index:3;pointer-events:none;
  width:17px;height:17px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;
  opacity:0;transform:translate(-50%,-50%);transition:opacity .15s ease;
}
.castecho-player .fp-cover::after{width:21px;height:21px;border-width:2.5px}
.castecho-player.is-loading .mp-cover::before,.castecho-player.is-loading .fp-cover::before,
.castecho-player.is-loading .mp-cover::after,.castecho-player.is-loading .fp-cover::after{opacity:1}
.castecho-player.is-loading .mp-cover::after,.castecho-player.is-loading .fp-cover::after{animation:castecho-player-spin .78s linear infinite}
@keyframes castecho-player-spin{to{transform:translate(-50%,-50%) rotate(360deg)}}
.castecho-player .fp-titles{text-align:left;min-width:0}
.castecho-player .fp-episode{font-size:17px;font-weight:800;line-height:1.4;word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.castecho-player .fp-podcast{font-size:13px;color:var(--muted);margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.castecho-player .fp-range{font-size:12px;color:var(--p-accent,var(--accent));font-weight:700;margin-top:5px;font-variant-numeric:tabular-nums}
.castecho-player .fp-scrub{position:relative;height:28px;margin-top:14px;cursor:pointer;touch-action:none}
.castecho-player .fp-line{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:4px;background:#e9eaec;border-radius:99px}
.castecho-player .fp-fill{position:absolute;left:0;top:50%;transform:translateY(-50%);height:4px;width:0;background:var(--p-accent,var(--accent));border-radius:99px}
.castecho-player .fp-knob{position:absolute;top:50%;left:0;width:16px;height:16px;border-radius:50%;background:#fff;border:4px solid var(--p-accent,var(--accent));transform:translate(-50%,-50%);box-shadow:0 1px 4px rgba(0,0,0,.15)}
.castecho-player .fp-times{display:flex;justify-content:space-between;font-family:"IBM Plex Mono",monospace;font-size:11.5px;color:var(--muted);margin-top:2px;font-variant-numeric:tabular-nums}
.castecho-player .fp-controls{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:10px}
.castecho-player .fp-skip{
  min-width:58px;height:44px;padding:0 10px;border-radius:999px;border:0;background:#f2f3f5;color:var(--ink-soft);
  font-size:13px;display:flex;align-items:center;justify-content:center;gap:5px;font-weight:700;
}
.castecho-player .fp-play{
  width:66px;height:66px;border-radius:50%;border:0;background:var(--p-accent,var(--accent));color:#fff;
  display:flex;align-items:center;justify-content:center;flex:none;box-shadow:0 10px 24px -10px rgba(0,0,0,.4);
}
.castecho-player .fp-skip:active,.castecho-player .fp-play:active{transform:scale(.94)}
.castecho-player .mini-player svg,.castecho-player .full-player svg{display:block;flex:none;pointer-events:none}
.castecho-player .anticon svg{fill:currentColor;stroke:none}
.castecho-player .mp-btn svg{width:19px;height:19px}
.castecho-player .mp-btn.play svg{width:22px;height:22px}
.castecho-player .mp-seek{gap:2px;border-radius:999px}
.castecho-player .mp-seek svg{width:15px;height:15px}
.castecho-player .seek-seconds{font-size:8px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.castecho-player .mp-list{width:38px;height:38px}
.castecho-player .mp-list svg{width:18px;height:18px}
.castecho-player .fp-collapse svg,.castecho-player .fp-list svg,.castecho-player .fp-timeline svg{width:20px;height:20px}
.castecho-player .fp-seek svg{width:20px;height:20px}
.castecho-player .fp-seek .seek-seconds{font-size:10px}
.castecho-player .fp-play svg{width:28px;height:28px}
.castecho-player .mp-cover svg{width:20px;height:20px}
.castecho-player .fp-cover svg{width:25px;height:25px}
.castecho-player .fp-lyrics{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;margin-top:16px;border-top:1px solid var(--hairline);padding-top:10px}
.castecho-player .fp-ly-head{display:flex;align-items:center;gap:6px;padding:0 2px 6px;flex:none}
.castecho-player .fp-ly-head .dot{width:7px;height:7px;border-radius:50%;background:var(--p-accent,var(--accent));flex:none}
.castecho-player .fp-ly-head .tt{font-size:12.5px;font-weight:800;color:var(--ink)}
.castecho-player .fp-ly-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:9px;padding:2px 4px 10px;scrollbar-width:thin;scrollbar-color:rgba(23,23,23,.16) transparent}
.castecho-player .fp-ly-line{font-size:15px;line-height:1.75;color:var(--faint);opacity:.55;transition:color .35s ease,opacity .35s ease;word-break:break-word}
.castecho-player .fp-ly-line.active{color:var(--p-accent,var(--accent));opacity:1;font-weight:700;font-size:19px;line-height:1.5}
.castecho-player .fp-ly-empty{font-size:12px;line-height:1.7;color:var(--faint);text-align:center;padding:16px 8px}

/* Agent keeps its compact full-player presentation without duplicating component CSS. */
body.player-host-agent .castecho-player .fp-sheet{background:var(--paper);padding:14px 20px calc(18px + env(safe-area-inset-bottom));transition-timing-function:cubic-bezier(.2,.7,.2,1);max-width:640px;margin:0 auto}
body.player-host-agent .castecho-player .fp-collapse,
body.player-host-agent .castecho-player .fp-list,
body.player-host-agent .castecho-player .fp-timeline{width:38px;height:38px;background:#f4f3f0;color:var(--ink)}
body.player-host-agent .castecho-player .fp-play{width:60px;height:60px;box-shadow:none}
body.player-host-agent .castecho-player .mp-cover{border-radius:8px}
body.player-host-agent .castecho-player .mp-btn:not(.play){background:#f4f3f0;color:var(--ink)}

/* Desktop keeps the current column-aligned compact bar, driven by the same component. */
.castecho-player[data-variant="desktop"] .mini-player{
  right:auto;z-index:70;border:1px solid var(--hairline);border-bottom:0;border-radius:16px 16px 0 0;
  overflow:hidden;transition:left .25s ease,width .25s ease;
}
.castecho-player[data-variant="desktop"] .mp-progress{height:20px;margin:0 14px;background:transparent;display:flex;align-items:center}
.castecho-player[data-variant="desktop"] .mp-progress::before{content:"";position:absolute;left:0;right:0;top:50%;height:4px;border-radius:99px;background:#e5e7eb;transform:translateY(-50%)}
.castecho-player[data-variant="desktop"] .mp-fill{top:50%;height:4px;border-radius:99px;transform:translateY(-50%)}
.castecho-player[data-variant="desktop"] .mp-knob{display:block;position:absolute;top:50%;left:0;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--p-accent,var(--accent));transform:translate(-50%,-50%);box-shadow:0 1px 4px rgba(0,0,0,.15)}
.castecho-player[data-variant="desktop"] .mp-body{gap:12px;padding:0 16px 12px}
.castecho-player[data-variant="desktop"] .mp-cover{width:42px;height:42px}
.castecho-player[data-variant="desktop"] .mp-play{order:2;width:42px;height:42px}
.castecho-player[data-variant="desktop"] .mp-back10{order:3}
.castecho-player[data-variant="desktop"] .mp-fwd10{order:4}
.castecho-player[data-variant="desktop"] .mp-meta{order:5}
.castecho-player[data-variant="desktop"] .mp-time{display:block;order:6;font-family:"IBM Plex Mono",monospace;font-size:12px;color:var(--muted);white-space:nowrap}
.castecho-player[data-variant="desktop"] .mp-timeline{order:7}
.castecho-player[data-variant="desktop"] .mp-list{order:8}
.castecho-player[data-variant="desktop"] .mp-btn:not(.play){width:30px;height:30px}
.castecho-player[data-variant="desktop"] .mp-seek{width:42px}

/* Playlist drawer is built into the shared player and works on every route. */
.castecho-player .player-playlist{position:fixed;inset:0;z-index:105}
.castecho-player .ppl-scrim{position:absolute;inset:0;background:rgba(23,23,23,.38)}
.castecho-player .ppl-sheet{
  position:absolute;right:0;top:0;bottom:0;width:min(430px,100%);background:var(--paper,#fff);color:var(--ink,#171717);
  display:flex;flex-direction:column;box-shadow:-18px 0 50px rgba(0,0,0,.18);
}
.castecho-player .ppl-head{height:62px;padding:0 14px 0 18px;border-bottom:1px solid var(--hairline);display:flex;align-items:center;gap:10px;flex:none}
.castecho-player .ppl-head h2{margin:0;min-width:0;flex:1;font-size:17px}
.castecho-player .ppl-head button{height:34px;border:0;border-radius:8px;background:#f4f3f0;color:var(--ink-soft);padding:0 10px;font-size:12px;font-weight:700}
.castecho-player .ppl-head #pplClose{width:34px;padding:0;display:grid;place-items:center}
.castecho-player .ppl-head #pplClose svg{width:16px;height:16px}
.castecho-player .ppl-list{min-height:0;flex:1;overflow:auto;padding:4px 14px calc(18px + env(safe-area-inset-bottom))}
.castecho-player .ppl-empty{padding:50px 12px;color:var(--muted);text-align:center;font-size:13px}
.castecho-player .ppl-item{display:grid;grid-template-columns:48px minmax(0,1fr) 36px;gap:11px;align-items:center;padding:12px 2px;border-bottom:1px solid var(--hairline);cursor:pointer}
.castecho-player .ppl-cover{width:48px;height:48px;border-radius:9px;overflow:hidden;background:var(--item-accent,var(--p-accent));color:#fff;display:grid;place-items:center;cursor:default;transition:transform .16s ease,box-shadow .16s ease}
.castecho-player .ppl-cover img{width:100%;height:100%;object-fit:cover}
.castecho-player .ppl-copy{min-width:0}
.castecho-player .ppl-podcast{color:var(--item-accent,var(--p-accent));font-size:10px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.castecho-player .ppl-title{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.castecho-player .ppl-progress{display:flex;align-items:center;gap:7px;margin-top:6px}
.castecho-player .ppl-bar{height:3px;min-width:0;flex:1;border-radius:99px;background:#ececec;overflow:hidden}
.castecho-player .ppl-bar i{display:block;height:100%;background:var(--item-accent,var(--p-accent))}
.castecho-player .ppl-pos{color:var(--muted);font-family:"IBM Plex Mono",monospace;font-size:9px;white-space:nowrap}
.castecho-player .ppl-remove{width:32px;height:32px;border:0;border-radius:50%;background:#f4f3f0;color:var(--muted);display:grid;place-items:center}
.castecho-player .ppl-remove svg{width:14px;height:14px}

@media (max-width:520px){
  .castecho-player .mp-body{gap:8px;padding-left:9px;padding-right:9px}
  .castecho-player .mp-cover{width:40px;height:40px}
  .castecho-player .mp-btn{width:36px;height:36px}
  .castecho-player .mp-btn.play{width:40px;height:40px}
  .castecho-player .mp-list{display:none}
}
@media (prefers-reduced-motion:reduce){
  .castecho-player *{animation-duration:.01ms!important;transition-duration:.01ms!important}
  .castecho-player.is-loading .mp-cover::after,.castecho-player.is-loading .fp-cover::after{animation:none}
}
