:root{--navy:#04354A;--navy2:#0B4F6B;--blue:#12A5CC;--sky:#DDF1F8;--sky2:#EEF8FC;--yellow:#FFC619;--ysoft:#FFF4CF;--paper:#F6FAFC;--muted:#58727E;--rule:#D3E4EB;--white:#fff}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{font-family:Onest,system-ui,sans-serif;color:var(--navy);background:var(--paper);-webkit-font-smoothing:antialiased}
a{color:var(--navy2)}
.top{display:flex;justify-content:space-between;align-items:center;padding:14px 28px;background:var(--white);border-bottom:1px solid var(--rule);position:sticky;top:0;z-index:5}
.logo{height:22px}
.top-actions{display:flex;gap:8px}
.btn{display:inline-flex;align-items:center;justify-content:center;height:38px;padding:0 16px;border-radius:99px;border:0;background:var(--navy);color:#fff;font:600 14px Onest,sans-serif;text-decoration:none;cursor:pointer}
.btn.ghost{background:var(--sky2);color:var(--navy);border:1px solid var(--rule)}
.btn:hover{filter:brightness(1.08)}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:28px;max-width:1440px;margin:0 auto;padding:24px 28px 40px;align-items:start}
.kicker{font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--blue);margin-bottom:8px}
h1{font-size:clamp(24px,2.6vw,36px);font-weight:800;letter-spacing:-.02em;line-height:1.1;margin-bottom:16px}
.player{border-radius:16px;overflow:hidden;background:#000;box-shadow:0 12px 30px rgba(4,53,74,.16)}
video{display:block;width:100%;aspect-ratio:1512/982;background:#000}
.under{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:12px 0 18px;flex-wrap:wrap}
.now{font-size:15px;color:var(--muted)}.now b{color:var(--navy)}
.speed{display:flex;align-items:center;gap:4px;font-size:13px;color:var(--muted)}
.speed span{margin-right:4px}
.speed button{border:1px solid var(--rule);background:#fff;border-radius:99px;padding:5px 10px;font:600 13px Onest,sans-serif;color:var(--navy);cursor:pointer}
.speed button.on{background:var(--yellow);border-color:var(--yellow)}
.tabs{display:none}
.panel.chapters{background:#fff;border:1px solid var(--rule);border-radius:16px;padding:14px 8px 8px}
.hint{font-size:13px;color:var(--muted);padding:0 12px 8px}
#chapList{list-style:none;display:grid;grid-template-columns:1fr 1fr;column-gap:8px}
#chapList li{display:flex;gap:10px;align-items:baseline;padding:8px 12px;border-radius:10px;cursor:pointer;font-size:15px;line-height:1.35}
#chapList li:hover{background:var(--sky2)}
#chapList li.on{background:var(--ysoft)}
#chapList .t{flex:none;font:600 13px Unbounded,sans-serif;color:var(--blue);min-width:44px}
#chapList .sec{grid-column:1/-1;font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding:12px 12px 4px;cursor:default}
#chapList .sec:hover{background:none}

.right{position:sticky;top:84px;height:calc(100vh - 108px);min-height:520px;display:flex;flex-direction:column;background:#fff;border:1px solid var(--rule);border-radius:18px;overflow:hidden}
.bot-head{display:flex;gap:12px;align-items:center;padding:14px 16px;background:var(--navy);color:#fff}
.bot-head img{width:42px;height:42px;object-fit:contain;background:var(--sky);border-radius:50%;padding:3px}
.bot-head b{display:block;font-size:16px}.bot-head small{color:#B9D3DE;font-size:12.5px}
.chat{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:10px;background:var(--paper)}
.msg{max-width:88%;padding:10px 13px;border-radius:16px;font-size:15px;line-height:1.5;word-wrap:break-word;overflow-wrap:anywhere}
.msg.user{align-self:flex-end;background:var(--navy);color:#fff;border-bottom-right-radius:5px}
.msg.bot{align-self:flex-start;background:#fff;border:1px solid var(--rule);border-bottom-left-radius:5px}
.msg.err{background:#FBEAE7;border-color:#F0C7BF}
.msg p{margin:0 0 6px}.msg p:last-child{margin:0}
.msg ul,.msg ol{margin:4px 0 6px 20px}.msg li{margin:2px 0}
.msg a{color:var(--blue);font-weight:600}
.msg.user a{color:var(--yellow)}
.msg code{background:var(--sky2);padding:1px 5px;border-radius:5px;font-size:.92em}
.msg .ts{background:var(--ysoft);color:var(--navy);border:0;border-radius:6px;padding:0 5px;font:600 .92em Onest,sans-serif;cursor:pointer}
.msg img{display:block;max-width:180px;max-height:180px;border-radius:10px;margin:0 0 6px}
.msg .imgs{display:flex;gap:6px;flex-wrap:wrap}
.typing{align-self:flex-start;color:var(--muted);font-size:14px;padding:6px 12px}
.typing i{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--blue);margin-left:3px;animation:b 1s infinite}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes b{50%{opacity:.25}}
.welcome{background:var(--ysoft);border:1px solid #F3DD8E;border-radius:14px;padding:12px 14px;font-size:14.5px;line-height:1.5}
.gate{display:none;padding:18px 16px;border-top:1px solid var(--rule)}
.gate h3{font-size:18px;margin-bottom:4px}.gate p{font-size:14px;color:var(--muted);margin-bottom:10px}
.gate form{display:flex;gap:8px}
.gate input{flex:1;height:42px;border:1px solid var(--rule);border-radius:12px;padding:0 12px;font:16px Onest,sans-serif}
.need-name .gate{display:block}.need-name .composer,.need-name .suggest{display:none}
.suggest{display:flex;gap:6px;overflow-x:auto;padding:8px 12px 0;scrollbar-width:none}
.suggest::-webkit-scrollbar{display:none}
.suggest button{flex:none;border:1px solid var(--rule);background:var(--sky2);border-radius:99px;padding:6px 11px;font:500 13px Onest,sans-serif;color:var(--navy);cursor:pointer}
.composer{padding:10px 12px 12px;border-top:1px solid var(--rule);background:#fff}
.composer .row{display:flex;gap:8px;align-items:flex-end}
.attach,.send{flex:none;width:42px;height:42px;border-radius:12px;display:grid;place-items:center;cursor:pointer}
.attach{background:var(--sky2);color:var(--navy);border:1px solid var(--rule)}
.send{background:var(--yellow);border:0;color:var(--navy)}
.send:disabled{opacity:.5}
.attach svg,.send svg{width:21px;height:21px}
textarea{flex:1;resize:none;min-height:42px;max-height:140px;border:1px solid var(--rule);border-radius:12px;padding:10px 12px;font:16px/1.4 Onest,sans-serif;color:var(--navy)}
textarea:focus,.gate input:focus{outline:2px solid var(--blue);border-color:transparent}
.thumbs{display:flex;gap:6px;margin-bottom:8px}
.thumbs:empty{display:none}
.thumbs div{position:relative}
.thumbs img{width:56px;height:56px;object-fit:cover;border-radius:10px;border:1px solid var(--rule)}
.thumbs button{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;border:0;background:var(--navy);color:#fff;font-size:12px;cursor:pointer}
.left-count{font-size:12px;color:var(--muted);margin-top:6px;text-align:right}

@media (max-width:1000px){
  .layout{grid-template-columns:1fr;padding:12px 12px 0;gap:0}
  .top{padding:10px 14px}.logo{height:18px}
  .btn{height:34px;padding:0 12px;font-size:13px}
  h1{font-size:22px;margin-bottom:10px}
  .player{border-radius:12px}
  .tabs{display:flex;gap:6px;margin-bottom:10px;position:sticky;top:55px;z-index:3;background:var(--paper);padding:6px 0}
  .tabs button{flex:1;height:40px;border-radius:12px;border:1px solid var(--rule);background:#fff;font:600 15px Onest,sans-serif;color:var(--navy)}
  .tabs button.on{background:var(--navy);color:#fff;border-color:var(--navy)}
  .panel{display:none}.panel.on{display:flex}
  .panel.chapters.on{display:block}
  #chapList{grid-template-columns:1fr}
  .right{position:static;height:auto;min-height:0;border-radius:14px;margin-bottom:12px}
  .right .chat{min-height:46vh;max-height:62vh}
  .top-actions .btn:last-child{display:none}
}
