:root {
  color-scheme: dark;
  --accent: #ff4668;
  --accent-soft: #ff8a5c;
  --bg: #08080b;
  --panel: #16161b;
  --muted: rgba(255, 255, 255, 0.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: #fff; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font-family: inherit; }
button { border: 0; background: none; color: inherit; padding: 0; cursor: pointer; }
img, video { display: block; }

.page { position: relative; height: 100vh; overflow-y: auto; padding-bottom: calc(84px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #17131d 0%, var(--bg) 42%); }
.header { padding: calc(44px + env(safe-area-inset-top)) 18px 14px; }
.title { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.subtitle { margin-top: 6px; font-size: 12px; color: var(--muted); }

.hero { position: relative; height: 240px; margin: 12px 16px 0; border-radius: 16px; overflow: hidden; box-shadow: 0 14px 36px rgba(0,0,0,.35); }
.hero-video, .hero-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.92), rgba(0,0,0,.04) 72%); }
.hero-content { position: absolute; left: 18px; right: 18px; bottom: 18px; }
.hero-tag { display: inline-block; padding: 3px 9px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); font-size: 11px; font-weight: 700; }
.hero-title { margin-top: 9px; font-size: 24px; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.hero-desc { margin-top: 6px; font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.78); }
.hero-meta { margin-top: 7px; font-size: 11px; color: rgba(255,255,255,.58); }
.play-btn { display: inline-flex; align-items: center; justify-content: center; margin-top: 12px; padding: 8px 20px; border-radius: 999px; background: #fff; color: #111; font-size: 12px; font-weight: 700; }

.section-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 18px 12px; }
.section-title { font-size: 17px; font-weight: 700; }
.section-more { font-size: 11px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 12px; }
.card { border-radius: 12px; overflow: hidden; background: var(--panel); }
.cover { position: relative; height: 132px; background: #222; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.5), transparent); }
.cover-tag { position: absolute; z-index: 1; left: 8px; top: 8px; padding: 2px 7px; border-radius: 4px; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); font-size: 10px; font-weight: 700; }
.card-title { padding: 9px 10px 2px; font-size: 14px; font-weight: 700; }
.card-meta { padding: 0 10px 11px; font-size: 10px; color: var(--muted); }
.footer-note { padding: 26px 0 10px; text-align: center; font-size: 10px; color: rgba(255,255,255,.32); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: #fff; border-top: 1px solid rgba(0,0,0,.08); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #8a8a8f; }
.tab.active { color: var(--accent); }
.tab-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.tab-label { font-size: 10px; line-height: 1; }
.play-ring { width: 19px; height: 19px; border: 2px solid currentColor; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.play-tri { width: 0; height: 0; margin-left: 2px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 7px solid currentColor; }
.grid-icon { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; width: 19px; height: 19px; }
.grid-icon i { border-radius: 2px; background: currentColor; }
.image-icon { position: relative; width: 20px; height: 16px; border: 2px solid currentColor; border-radius: 3px; }
.image-icon i { position: absolute; right: 2px; bottom: 1px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 8px solid currentColor; }
.user-icon { position: relative; width: 20px; height: 20px; }
.user-icon .head { position: absolute; left: 6px; top: 1px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.user-icon .body { position: absolute; left: 2px; bottom: 0; width: 16px; height: 9px; border-radius: 8px 8px 0 0; background: currentColor; }

.wall-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px; }
.wall-item { position: relative; height: 210px; border-radius: 10px; overflow: hidden; background: var(--panel); }
.wall-item img { width: 100%; height: 100%; object-fit: cover; }
.wall-item::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.6), transparent); }
.wall-name { position: absolute; z-index: 1; left: 10px; bottom: 10px; font-size: 13px; font-weight: 700; }

.profile { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 16px; border-radius: 14px; background: rgba(255,255,255,.06); }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.nickname { font-size: 17px; font-weight: 700; }
.profile-sub { margin-top: 4px; font-size: 11px; color: var(--muted); }
.stats { display: flex; margin: 12px 16px 0; padding: 14px 0; border-radius: 14px; background: rgba(255,255,255,.06); }
.stat { flex: 1; text-align: center; }
.stat b { display: block; font-size: 19px; }
.stat span { font-size: 10px; color: var(--muted); }
.menu { margin: 18px 16px 0; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.06); }
.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid rgba(255,255,255,.05); }
.menu-item:last-child { border-bottom: 0; }
.menu-title { font-size: 14px; font-weight: 600; }
.menu-desc { margin-top: 3px; font-size: 10px; color: var(--muted); }
.menu-arrow { width: 8px; height: 8px; border-top: 2px solid rgba(255,255,255,.35); border-right: 2px solid rgba(255,255,255,.35); transform: rotate(45deg); }

.player-page { position: relative; height: 100vh; overflow: hidden; background: #000; }
.player-page video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.9), transparent 45%), linear-gradient(to bottom, rgba(0,0,0,.65), transparent 25%); pointer-events: none; }
.player-top { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; align-items: center; gap: 10px; }
.back-btn { width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.back-arrow { width: 9px; height: 9px; margin-left: 2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }
.player-brand { font-size: 14px; font-weight: 700; }
.player-copyright { margin-left: auto; font-size: 10px; color: rgba(255,255,255,.65); }
.player-copyright-bottom { margin-top: 8px; font-size: 10px; color: rgba(255,255,255,.5); }
.center-toggle { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; transform: translate(-50%,-50%); border-radius: 50%; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; }
.center-toggle .play-tri { border-top-width: 11px; border-bottom-width: 11px; border-left-width: 18px; }
.side-actions { position: absolute; right: 12px; bottom: 132px; display: flex; flex-direction: column; gap: 14px; }
.side-action { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; }
.action-circle { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.action-circle.active { background: linear-gradient(135deg, var(--accent-soft), var(--accent)); border-color: transparent; }
.action-circle svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action-circle.active svg { fill: #fff; }
.player-info { position: absolute; left: 18px; right: 74px; bottom: 52px; }
.player-info .drama { font-size: 14px; font-weight: 700; }
.player-info .episode { margin-top: 6px; font-size: 18px; font-weight: 700; }
.player-info .desc { margin-top: 6px; font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.8); }
.progress-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.progress-row span { width: 38px; font-size: 10px; color: rgba(255,255,255,.7); }
.progress-row input { flex: 1; accent-color: var(--accent); }
.episode-mask, .lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: none; }
.episode-mask.show, .lightbox.show { display: block; }
.episode-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 56vh; overflow-y: auto; padding: 18px 16px 24px; border-radius: 16px 16px 0 0; background: var(--panel); display: none; }
.episode-sheet.show { display: block; }
.sheet-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.episode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.episode-cell { height: 42px; border-radius: 7px; background: rgba(255,255,255,.07); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.episode-cell.active { background: linear-gradient(135deg, var(--accent-soft), var(--accent)); font-weight: 700; }
.lightbox img { width: 100%; height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 18px; font-size: 28px; }
.toast { position: fixed; left: 50%; bottom: 90px; z-index: 90; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,.78); font-size: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
