:root{
  --paper:#FAF5EC; --paper2:#F3EBD9; --card:#FFFFFF; --ink:#211D19; --ink2:#6F6659;
  --line:#E7DCC6; --red:#B3352B; --red-dark:#932A23; --gold:#C99B3F; --sage:#5F7161;
  --radius:18px; --shadow:0 10px 28px rgba(60,45,20,.10);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{margin:0; padding:0}
body{background:var(--paper); color:var(--ink); font-family:"Plus Jakarta Sans",system-ui,sans-serif; padding-bottom:86px}
a{color:inherit; text-decoration:none}
img{display:block}
.topbar{position:sticky; top:0; z-index:40; display:flex; align-items:center; gap:12px; padding:12px 16px; background:rgba(250,245,236,.94); backdrop-filter:blur(8px); border-bottom:1px solid var(--line)}
.brand{display:flex; align-items:center; gap:9px; flex-shrink:0}
.brand-mark{display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--red); color:#FFF7EA; font-family:"Fraunces",serif; font-weight:800; font-size:15px; letter-spacing:.5px}
.brand-text{font-family:"Fraunces",serif; font-weight:800; font-size:19px}
.brand-text em{color:var(--red); font-style:normal}
.searchbox{flex:1; display:flex; align-items:center; gap:8px; background:var(--card); border:1px solid var(--line); border-radius:999px; padding:9px 14px; color:var(--ink2)}
.searchbox input{flex:1; border:0; outline:0; background:transparent; font:inherit; font-size:14px; color:var(--ink); min-width:0}
.app{max-width:1060px; margin:0 auto; padding:18px 16px 8px}
.hero{position:relative; border-radius:24px; overflow:hidden; background:#171310; color:#FFF7EA; box-shadow:var(--shadow); margin-bottom:26px}
.hero img.bg{width:100%; height:340px; object-fit:cover; opacity:.55}
.hero .shade{position:absolute; inset:0; background:linear-gradient(90deg, rgba(15,10,6,.88) 22%, rgba(15,10,6,.25) 70%)}
.hero .inner{position:absolute; inset:0; display:flex; flex-direction:column; justify-content:flex-end; padding:22px}
.kicker{display:inline-flex; align-items:center; gap:7px; font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#FFD9A8}
.kicker::before{content:""; width:22px; height:2px; background:var(--gold)}
.hero h1{font-family:"Fraunces",serif; font-size:clamp(24px,5.4vw,40px); line-height:1.08; margin:8px 0 8px; max-width:560px}
.hero p{margin:0 0 14px; color:#EDE3D2; font-size:13.5px; max-width:480px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
.btn{display:inline-flex; align-items:center; gap:8px; border:0; cursor:pointer; font:inherit; font-weight:800; font-size:14px; border-radius:999px; padding:12px 20px; background:var(--red); color:#FFF7EA; width:fit-content}
.btn:active{background:var(--red-dark)}
.btn.ghost{background:var(--card); color:var(--ink); border:1px solid var(--line)}
.btn.small{padding:9px 16px; font-size:13px}
.section{margin-bottom:28px}
.section-head{display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:12px}
.section-head h2{font-family:"Fraunces",serif; font-size:21px; margin:0}
.section-head a{font-size:13px; font-weight:700; color:var(--red)}
.row{display:grid; grid-auto-flow:column; grid-auto-columns:132px; gap:12px; overflow-x:auto; padding-bottom:6px; scroll-snap-type:x mandatory; scrollbar-width:none}
.row::-webkit-scrollbar{display:none}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(108px,1fr)); gap:14px 12px}
.card{scroll-snap-align:start}
.card .poster{position:relative; border-radius:14px; overflow:hidden; background:var(--paper2); aspect-ratio:3/4; border:1px solid var(--line)}
.card .poster img{width:100%; height:100%; object-fit:cover}
.card .eps{position:absolute; left:8px; bottom:8px; background:rgba(20,14,8,.82); color:#FFF3DC; font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px}
.card h3{font-size:13px; line-height:1.35; margin:8px 2px 0; font-weight:700; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
.chips{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px}
.chip{border:1px solid var(--line); background:var(--card); color:var(--ink); font:inherit; font-size:13px; font-weight:700; padding:8px 14px; border-radius:999px; cursor:pointer}
.chip.on{background:var(--ink); color:#FFF7EA; border-color:var(--ink)}
.chip.red.on{background:var(--red); border-color:var(--red)}
.subhead{font-family:"Fraunces",serif; font-size:17px; margin:18px 0 10px}
.loading,.empty,.errorbox{text-align:center; color:var(--ink2); padding:44px 16px; font-size:14px}
.errorbox{color:var(--red-dark)}
.spinner{width:34px; height:34px; margin:0 auto 12px; border-radius:50%; border:3.5px solid var(--line); border-top-color:var(--red); animation:spin 0.8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.detail{display:grid; grid-template-columns:150px 1fr; gap:18px; margin-bottom:20px}
.detail .poster{border-radius:16px; overflow:hidden; border:1px solid var(--line); aspect-ratio:3/4; background:var(--paper2)}
.detail .poster img{width:100%; height:100%; object-fit:cover}
.detail h1{font-family:"Fraunces",serif; font-size:clamp(21px,4.6vw,30px); line-height:1.15; margin:2px 0 10px}
.badge{display:inline-block; background:var(--paper2); border:1px solid var(--line); color:var(--ink2); font-size:12px; font-weight:700; padding:4px 10px; border-radius:999px; margin:0 6px 8px 0}
.badge.src{background:#F7E8E6; border-color:#EBC9C4; color:var(--red-dark)}
.desc{font-size:14px; line-height:1.65; color:#453D33; white-space:pre-line}
.epgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(56px,1fr)); gap:9px}
.epbtn{position:relative; border:1px solid var(--line); background:var(--card); border-radius:13px; padding:12px 4px; font:inherit; font-weight:800; font-size:15px; cursor:pointer; text-align:center}
.epbtn small{display:block; font-size:10px; font-weight:600; color:var(--ink2); margin-top:2px}
.epbtn.locked{opacity:.45; cursor:not-allowed}
.epbtn.now{border-color:var(--red); color:var(--red); background:#FBEEEC}
.watchwrap{background:#14100C; border-radius:22px; padding:14px; margin-bottom:18px; box-shadow:var(--shadow)}
.playerbox{display:flex; justify-content:center}
video{width:min(400px,100%); max-height:74vh; aspect-ratio:9/16; background:#000; border-radius:14px}
.watchmeta{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; flex-wrap:wrap}
.watchmeta .t{color:#FFF3DC; font-weight:800; font-size:14px}
.navrow{display:flex; gap:8px}
.pbtn{border:1px solid #4A4036; background:#241D16; color:#FFF3DC; font:inherit; font-size:13px; font-weight:700; padding:9px 14px; border-radius:999px; cursor:pointer}
.pbtn:disabled{opacity:.4}
.histitem{display:flex; gap:12px; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:10px; margin-bottom:10px; align-items:center}
.histitem img{width:52px; height:70px; object-fit:cover; border-radius:10px}
.histitem .h-t{font-weight:800; font-size:14px; margin-bottom:3px}
.histitem .h-s{font-size:12px; color:var(--ink2)}
.progress{height:5px; background:var(--paper2); border-radius:99px; margin-top:7px; overflow:hidden}
.progress i{display:block; height:100%; background:var(--red); border-radius:99px}
.bottomnav{position:fixed; left:0; right:0; bottom:0; z-index:40; display:flex; background:rgba(255,253,248,.97); border-top:1px solid var(--line); padding:8px 10px calc(8px + env(safe-area-inset-bottom))}
.bottomnav a{flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; font-size:11px; font-weight:700; color:var(--ink2); padding:5px 0}
.bottomnav a.on{color:var(--red)}
.foot{color:var(--ink2); font-size:12px; text-align:center; padding:18px 8px 4px; line-height:1.7}
@media (max-width:560px){
  .detail{grid-template-columns:112px 1fr; gap:14px}
  .hero img.bg{height:290px}
  .grid{grid-template-columns:repeat(3,1fr)}
}
