* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root{
  --bg:#0b0d12; --panel:#141821; --panel2:#1b202c; --line:#232a38;
  --text:#eef1f7; --muted:#8b93a5; --gold:#ffc23c; --gold2:#ff9d2e;
  --green:#37c981; --red:#ff5566; --radius:14px;
}
html,body{ height:100%; }
body{
  background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px; overflow:hidden; overscroll-behavior:none;
}
.vr{ direction:rtl; text-align:right; }
.hidden{ display:none !important; }
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
input{ font-family:inherit; }

/* ===== 启动屏 ===== */
.splash{
  position:fixed; inset:0; z-index:100; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  background:radial-gradient(circle at 50% 35%,#1d2333 0%,#0b0d12 60%);
}
.splash-logo{ font-size:52px; font-weight:900; letter-spacing:4px; color:var(--gold);
  text-shadow:0 4px 30px rgba(255,194,60,.4); }
.splash-sub{ color:var(--muted); margin-top:10px; letter-spacing:2px; }
.splash-bar{ width:120px; height:3px; background:#2a3040; border-radius:3px; margin-top:28px; overflow:hidden; }
.splash-bar i{ display:block; height:100%; width:40%; background:var(--gold); border-radius:3px;
  animation:slide 1.1s infinite ease-in-out; }
@keyframes slide{ 0%{transform:translateX(-100%)} 100%{transform:translateX(350%)} }

/* ===== 通用弹窗 ===== */
.modal-mask{ position:fixed; inset:0; z-index:90; background:rgba(0,0,0,.85);
  display:flex; align-items:center; justify-content:center; padding:28px; }
.update-box{ width:100%; max-width:340px; background:var(--panel); border:1px solid var(--line);
  border-radius:20px; padding:28px 24px; text-align:center; }
.update-icon{ width:56px; height:56px; margin:0 auto 14px; border-radius:50%;
  background:linear-gradient(135deg,var(--gold),var(--gold2)); color:#1a1200;
  font-size:28px; font-weight:900; display:flex; align-items:center; justify-content:center; }
.update-title{ font-size:18px; font-weight:700; }
.update-ver{ color:var(--gold); margin:6px 0 14px; font-size:13px; }
.update-content{ color:var(--muted); line-height:1.7; font-size:13px; text-align:left;
  background:var(--panel2); padding:14px; border-radius:10px; margin-bottom:20px; white-space:pre-wrap; }

.btn-primary{ width:100%; background:linear-gradient(135deg,var(--gold),var(--gold2));
  color:#1a1200; font-weight:800; font-size:15px; padding:14px; border-radius:12px; }
.btn-primary:active{ transform:scale(.98); }
.btn-ghost{ width:calc(100% - 32px); margin:16px; background:var(--panel2); color:var(--muted);
  padding:13px; border-radius:12px; border:1px solid var(--line); }

/* ===== 卡密门 ===== */
.gate{ position:fixed; inset:0; z-index:80; display:flex; align-items:center; justify-content:center; padding:24px; }
.gate-bg{ position:absolute; inset:0; background:radial-gradient(circle at 50% 20%,#1c2233,#0b0d12 65%); }
.gate-card{ position:relative; width:100%; max-width:380px; background:rgba(20,24,33,.9);
  border:1px solid var(--line); border-radius:22px; padding:34px 26px; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.5); }
.gate-logo{ font-size:38px; font-weight:900; color:var(--gold); letter-spacing:3px; }
.gate-title{ font-size:20px; font-weight:700; margin-top:14px; }
.gate-desc{ color:var(--muted); font-size:13px; margin:8px 0 24px; }
.gate-input{ width:100%; background:var(--panel2); border:1px solid var(--line); color:var(--text);
  padding:15px 14px; border-radius:12px; font-size:15px; text-align:center; letter-spacing:1px; outline:none; }
.gate-input:focus{ border-color:var(--gold); }
.gate-btn{ margin-top:14px; }
.gate-msg{ min-height:20px; margin-top:12px; font-size:13px; color:var(--red); }
.gate-service{ margin-top:16px; color:var(--muted); font-size:12px; line-height:1.8; }
.gate-service a{ color:var(--gold); text-decoration:none; }

/* ===== 主应用 ===== */
.app{ height:100%; display:flex; flex-direction:column; }
.topbar{ height:52px; flex:0 0 52px; display:flex; align-items:center; justify-content:space-between;
  padding:0 16px; padding-top:env(safe-area-inset-top); background:var(--bg); }
.brand{ font-size:22px; font-weight:900; color:var(--gold); letter-spacing:2px; }
.top-actions{ display:flex; gap:8px; }
.ic-btn{ width:36px; height:36px; border-radius:10px; background:var(--panel); font-size:17px;
  display:flex; align-items:center; justify-content:center; }
.notice-bar{ flex:0 0 auto; background:linear-gradient(90deg,#2a2410,#1a1c14); color:var(--gold);
  font-size:12px; padding:8px 14px; border-bottom:1px solid #332c14; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.notice-bar:empty{ display:none; }

#pages{ flex:1 1 auto; position:relative; overflow:hidden; }
.page{ position:absolute; inset:0; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding-bottom:70px; display:none; }
.page.active{ display:block; }

/* 首页 banner */
.banner{ height:180px; margin:12px; border-radius:16px; overflow:hidden; position:relative;
  background:var(--panel); }
.banner-placeholder{ color:var(--muted); display:flex; align-items:center; justify-content:center; height:100%; }
.banner-slide{ position:absolute; inset:0; opacity:0; transition:opacity .5s; }
.banner-slide.active{ opacity:1; }
.banner-slide img{ width:100%; height:100%; object-fit:cover; }
.banner-slide .bs-mask{ position:absolute; inset:0;
  background:linear-gradient(0deg,rgba(0,0,0,.85),transparent 55%); }
.banner-slide .bs-name{ position:absolute; bottom:14px; left:14px; right:14px; font-size:17px;
  font-weight:700; text-shadow:0 2px 6px #000; }
.banner-dots{ position:absolute; bottom:10px; right:14px; display:flex; gap:5px; z-index:3; }
.banner-dots i{ width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,.4); }
.banner-dots i.on{ background:var(--gold); width:16px; border-radius:4px; }

/* 分类 bar */
.cat-bar{ display:flex; gap:8px; overflow-x:auto; padding:4px 12px 10px; scrollbar-width:none; }
.cat-bar::-webkit-scrollbar{ display:none; }
.cat{ flex:0 0 auto; padding:8px 16px; border-radius:20px; background:var(--panel);
  color:var(--muted); font-size:13px; border:1px solid var(--line); }
.cat.on{ background:var(--gold); color:#1a1200; font-weight:700; border-color:var(--gold); }

.section-head{ display:flex; align-items:center; justify-content:space-between; padding:6px 14px 12px; }
.sh-title{ font-size:16px; font-weight:700; }
.sh-title::before{ content:''; display:inline-block; width:4px; height:15px; background:var(--gold);
  border-radius:2px; margin-right:8px; vertical-align:-2px; }
.sh-more{ color:var(--muted); font-size:12px; }

/* 海报网格 */
.grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; padding:0 12px; }
.card{ background:var(--panel); border-radius:12px; overflow:hidden; position:relative; }
.card .poster{ width:100%; aspect-ratio:3/4; object-fit:cover; background:var(--panel2); display:block; }
.card .badge{ position:absolute; top:6px; right:6px; background:rgba(0,0,0,.7); color:var(--gold);
  font-size:11px; padding:2px 6px; border-radius:6px; max-width:80%; overflow:hidden; white-space:nowrap; }
.card .cname{ padding:8px 8px 10px; font-size:12px; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; height:44px; }
.card:active{ transform:scale(.96); }

/* 分页 */
.pager{ display:flex; justify-content:center; align-items:center; gap:12px; padding:20px 12px; }
.pager button{ background:var(--panel2); border:1px solid var(--line); color:var(--text);
  padding:9px 18px; border-radius:10px; font-size:13px; }
.pager button:disabled{ opacity:.4; }
.pager .pg-num{ color:var(--muted); font-size:12px; }

/* 搜索 */
.search-box{ display:flex; gap:8px; padding:12px; }
.search-box input{ flex:1; background:var(--panel); border:1px solid var(--line); color:var(--text);
  padding:12px 14px; border-radius:12px; outline:none; font-size:14px; }
.search-box input:focus{ border-color:var(--gold); }
.search-box button{ background:var(--gold); color:#1a1200; font-weight:700; padding:0 20px; border-radius:12px; }
.hot-words{ padding:0 12px 8px; display:flex; flex-wrap:wrap; gap:8px; }
.hot-words .hw{ background:var(--panel); color:var(--muted); font-size:12px; padding:6px 12px; border-radius:16px; }
.search-result{ padding:0 12px; color:var(--muted); font-size:13px; }
.list-row{ display:flex; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); align-items:center; }
.list-row .lr-poster{ width:70px; height:96px; object-fit:cover; border-radius:8px; background:var(--panel2); flex:0 0 70px; }
.list-row .lr-body{ flex:1; min-width:0; }
.list-row .lr-name{ font-size:14px; font-weight:600; line-height:1.4; }
.list-row .lr-meta{ color:var(--muted); font-size:12px; margin-top:6px; line-height:1.6;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }

/* 客服 */
.svc-card{ margin:16px; background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:22px; }
.svc-head{ font-size:18px; font-weight:700; text-align:center; margin-bottom:20px; color:var(--gold); }
.svc-item{ background:var(--panel2); border-radius:12px; padding:15px; margin-bottom:12px;
  display:flex; justify-content:space-between; align-items:center; font-size:14px; }
.svc-item .sv{ color:var(--gold); font-weight:600; }
.svc-qr-wrap{ text-align:center; padding:16px; background:var(--panel2); border-radius:14px; margin-top:6px; }
.svc-qr-title{ font-size:13px; color:var(--muted); margin-bottom:12px; }
.svc-qr{ width:200px; height:200px; object-fit:contain; background:#fff; border-radius:10px; padding:8px; }
.svc-qr-tip{ font-size:12px; color:var(--muted); margin-top:10px; }
.svc-note{ color:var(--muted); font-size:12px; text-align:center; margin-top:18px; line-height:1.6; }

/* 我的 */
.mine-head{ display:flex; align-items:center; gap:14px; padding:20px 16px; }
.mine-avatar{ width:56px; height:56px; border-radius:50%; background:linear-gradient(135deg,var(--gold),var(--gold2));
  color:#1a1200; font-size:26px; font-weight:900; display:flex; align-items:center; justify-content:center; }
.mine-name{ font-size:17px; font-weight:700; }
.mine-status{ color:var(--green); font-size:12px; margin-top:4px; }
.mine-list{ margin:0 16px; background:var(--panel); border-radius:14px; overflow:hidden; }
.mine-row{ display:flex; justify-content:space-between; align-items:center; padding:15px 16px;
  border-bottom:1px solid var(--line); font-size:14px; }
.mine-row:last-child{ border-bottom:none; }
.mr-val{ color:var(--muted); font-size:13px; }
.mr-arrow{ color:var(--muted); font-size:20px; }

/* 详情 */
.detail-page{ padding-bottom:70px; }
.detail-hero{ height:300px; position:relative; background:var(--panel); }
.detail-hero img{ width:100%; height:100%; object-fit:cover; }
.detail-hero .dh-mask{ position:absolute; inset:0; background:linear-gradient(0deg,var(--bg),transparent 60%); }
.detail-hero .dh-back{ position:absolute; top:12px; left:12px; background:rgba(0,0,0,.5);
  padding:7px 12px; border-radius:9px; font-size:14px; z-index:2; }
.detail-info{ padding:0 16px 12px; margin-top:-40px; position:relative; z-index:2; }
.detail-info .di-name{ font-size:20px; font-weight:800; line-height:1.4; }
.detail-info .di-en{ color:var(--muted); font-size:13px; margin-top:4px; }
.detail-info .di-meta{ display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.detail-info .di-tag{ background:var(--panel2); color:var(--muted); font-size:12px; padding:4px 10px; border-radius:8px; }
.detail-info .di-score{ background:var(--gold); color:#1a1200; font-weight:800; }
.detail-info .di-content{ color:#aab1c0; font-size:13px; line-height:1.8; margin-top:8px; }
.play-big-btn{ width:100%; background:linear-gradient(135deg,var(--gold),var(--gold2)); color:#1a1200;
  font-weight:800; font-size:16px; padding:14px; border-radius:12px; margin-top:16px; }
.episodes{ padding:8px 16px 20px; }
.ep-title{ font-size:16px; font-weight:700; margin:6px 0 12px; }
.ep-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(64px,1fr)); gap:9px; }
.ep{ background:var(--panel2); border:1px solid var(--line); padding:11px 4px; border-radius:9px;
  text-align:center; font-size:13px; color:var(--muted); }
.ep.on{ background:var(--gold); color:#1a1200; font-weight:700; border-color:var(--gold); }

/* 播放 */
.play-page{ padding:0; background:#000; }
.player-wrap{ position:sticky; top:0; width:100%; background:#000; z-index:5; }
.player-wrap video{ width:100%; aspect-ratio:16/9; display:block; background:#000; }
.player-loading{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:13px; pointer-events:none; }
.player-back{ position:absolute; top:10px; left:10px; background:rgba(0,0,0,.6); color:#fff;
  padding:6px 12px; border-radius:8px; font-size:14px; z-index:6; }
.play-title{ padding:14px 16px 6px; font-size:15px; font-weight:600; }
.play-episodes{ padding:0 16px 20px; }

/* 底部导航 */
.tabbar{ flex:0 0 auto; height:56px; display:flex; background:#0e1118; border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom); }
.tab{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  color:var(--muted); font-size:11px; }
.tab .tab-ic{ font-size:19px; }
.tab.active{ color:var(--gold); }

/* toast */
.toast{ position:fixed; bottom:90px; left:50%; transform:translateX(-50%) translateY(20px);
  background:rgba(30,35,48,.96); color:#fff; padding:11px 20px; border-radius:24px; font-size:13px;
  z-index:200; opacity:0; transition:.25s; pointer-events:none; border:1px solid var(--line); max-width:80%; text-align:center; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
