/* ===== 短剧平台 全站样式（原创实现，暗色流媒体风格） ===== */
:root {
  --bg: #0d0d17;
  --bg-soft: #14141f;
  --card: #1b1b2a;
  --card-2: #222234;
  --line: rgba(255, 255, 255, .08);
  --text: #f4f4f8;
  --muted: #9494ab;
  --accent: #ff2f6a;
  --accent-2: #8b5cf6;
  --gold: #ffc94d;
  --grad: linear-gradient(96deg, #ff2f6a 0%, #c026d3 55%, #8b5cf6 100%);
  --radius: 12px;
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #33334a; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.container { width: min(1240px, 94vw); margin: 0 auto; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(13, 13, 23, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 100%; }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo svg { height: 30px; }
.logo-text { font-size: 22px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .3px; }
.main-nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; }
.main-nav a { color: var(--muted); padding: 6px 2px; position: relative; transition: color .2s; }
.main-nav a:hover, .main-nav a.active { color: #fff; }
.main-nav a.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -4px; width: 22px; height: 3px; border-radius: 2px; background: var(--grad);
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; width: 230px;
  transition: border-color .2s, width .25s;
}
.search-box:focus-within { border-color: var(--accent); width: 280px; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 14px; flex: 1; }
.search-box input::placeholder { color: var(--muted); }
.search-box svg { width: 16px; height: 16px; stroke: var(--muted); flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--card-2); transition: transform .15s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad); box-shadow: 0 6px 18px rgba(255, 47, 106, .35); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(255, 47, 106, .5); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-lg { padding: 13px 30px; font-size: 16px; }
.hamburger { display: none; background: none; }
.hamburger svg { width: 26px; height: 26px; stroke: #fff; }

/* 移动端菜单 */
.mobile-menu { display: none; }
.mobile-menu.open {
  display: flex; flex-direction: column; gap: 4px;
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
  background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 12px 5vw 18px;
}
.mobile-menu a { padding: 12px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.mobile-menu a:hover { background: var(--card); color: #fff; }

/* ---------------- Hero 轮播 ---------------- */
.hero { position: relative; overflow: hidden; }
.hero-viewport { position: relative; height: clamp(380px, 56vh, 600px); }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .7s ease;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide .backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,10,20,.92) 8%, rgba(10,10,20,.45) 48%, rgba(10,10,20,.05) 75%),
              linear-gradient(0deg, var(--bg) 0%, transparent 26%);
}
.hero-content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  gap: 16px; max-width: 560px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold);
}
.hero-tag::before { content: ""; width: 26px; height: 2px; background: var(--gold); }
.hero-title { font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; line-height: 1.12; text-shadow: 0 4px 24px rgba(0,0,0,.5); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: #d4d4e4; }
.hero-meta .chip { padding: 4px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; backdrop-filter: blur(4px); }
.hero-meta .dot { opacity: .5; }
.hero-desc {
  font-size: 14.5px; color: #c9c9dc; line-height: 1.65; max-width: 470px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 14px; margin-top: 6px; }

.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(20, 20, 32, .55); border: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.hero-arrow:hover { background: rgba(255,47,106,.75); }
.hero-arrow svg { width: 20px; height: 20px; stroke: #fff; }
.hero-arrow.prev { left: 22px; }
.hero-arrow.next { right: 22px; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 108px; z-index: 4; display: flex; gap: 8px; }
.hero-dots span { width: 22px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); cursor: pointer; transition: background .2s; }
.hero-dots span.active { background: var(--accent); }

/* 缩略图条 */
.hero-thumbs { border-bottom: 1px solid var(--line); background: var(--bg); }
.thumbs-inner { display: flex; gap: 12px; padding: 14px 0; overflow-x: auto; scrollbar-width: none; }
.thumbs-inner::-webkit-scrollbar { display: none; }
.thumb {
  flex: 0 0 150px; border-radius: 10px; overflow: hidden; position: relative;
  border: 2px solid transparent; opacity: .55; cursor: pointer; transition: opacity .2s, border-color .2s, transform .2s;
}
.thumb img { width: 100%; height: 84px; object-fit: cover; }
.thumb .t-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px;
  font-size: 12px; font-weight: 600;
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb:hover { opacity: .85; }
.thumb.active { border-color: var(--accent); opacity: 1; transform: translateY(-2px); }

/* ---------------- 区块 ---------------- */
.section { margin: 44px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-title .bar { width: 5px; height: 22px; border-radius: 3px; background: var(--grad); }
.section-more { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 4px; transition: color .2s; }
.section-more:hover { color: var(--accent); }

/* 横向滚动行 */
.row-scroller { position: relative; }
.row-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 152px; gap: 16px;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px 10px;
}
.row-track::-webkit-scrollbar { display: none; }
.row-arrow {
  position: absolute; top: 42%; transform: translateY(-50%); z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(27,27,42,.9); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s;
}
.row-scroller:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: var(--accent); }
.row-arrow svg { width: 16px; height: 16px; stroke: #fff; }
.row-arrow.prev { left: -14px; }
.row-arrow.next { right: -14px; }

/* 剧集卡片 */
.drama-card { position: relative; display: block; }
.poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: 0 4px 14px rgba(0,0,0,.35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.drama-card:hover .poster { transform: scale(1.045); box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 999px; color: #fff;
}
.badge.hot { background: linear-gradient(96deg, #ff2f6a, #ff7a3d); }
.badge.new { background: linear-gradient(96deg, #06b6d4, #34d399); }
.badge.end { background: rgba(20,20,32,.85); border: 1px solid rgba(255,255,255,.3); }
.poster .play-hint {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.28); opacity: 0; transition: opacity .25s;
}
.drama-card:hover .play-hint { opacity: 1; }
.play-hint span {
  width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
}
.play-hint svg { width: 18px; height: 18px; fill: #d01246; margin-left: 2px; }
.card-title { margin-top: 10px; font-size: 14px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin-top: 4px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.card-sub svg { width: 13px; height: 13px; fill: var(--gold); }

/* TOP 10 榜单 */
.top-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 26px 18px; }
.top-item { position: relative; padding-left: 34px; }
.top-item .rank {
  position: absolute; left: -6px; bottom: -6px; z-index: 3;
  font-size: 72px; font-weight: 900; font-style: italic; line-height: 1;
  color: transparent; -webkit-text-stroke: 2px var(--gold);
  text-shadow: 0 6px 18px rgba(0,0,0,.55);
  pointer-events: none;
}
.top-item:nth-child(-n+3) .rank { color: var(--gold); -webkit-text-stroke: 0; }
.top-item .poster { border: 1px solid rgba(255,255,255,.06); }
.top-item .card-title { font-size: 13.5px; }
.top-item .card-sub { font-size: 11.5px; }

/* 分类行 */
.cat-row .row-track { grid-auto-columns: 148px; }

/* ---------------- 分类页 ---------------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.cat-chip {
  padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); transition: all .2s;
}
.cat-chip:hover { color: #fff; border-color: var(--accent); }
.cat-chip.active { background: var(--grad); color: #fff; border-color: transparent; font-weight: 600; }
.grid-series { display: grid; grid-template-columns: repeat(6, 1fr); gap: 22px 16px; margin-top: 26px; }
.empty-tip { padding: 70px 0; text-align: center; color: var(--muted); font-size: 15px; }
.empty-tip svg { width: 52px; height: 52px; stroke: var(--muted); margin: 0 auto 16px; display: block; }

/* ---------------- 详情页 ---------------- */
.detail-hero { position: relative; padding: 40px 0 34px; overflow: hidden; }
.detail-hero .bg-blur {
  position: absolute; inset: -40px; z-index: 0;
  background-size: cover; background-position: center 20%;
  filter: blur(60px) brightness(.4); transform: scale(1.2);
}
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 4%, rgba(13,13,23,.35) 60%); }
.detail-inner { position: relative; z-index: 1; display: flex; gap: 34px; }
.detail-poster { flex: 0 0 240px; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.6); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.detail-info h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; line-height: 1.2; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.detail-tags .chip { padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: #d8d8ea; }
.detail-tags .chip.hl { background: var(--grad); border-color: transparent; font-weight: 600; }
.detail-desc { color: #c5c5da; font-size: 14.5px; line-height: 1.75; max-width: 640px; }
.detail-actions { display: flex; gap: 14px; margin-top: auto; padding-top: 10px; }
.ep-count-row { color: var(--muted); font-size: 13.5px; display: flex; gap: 18px; }
.ep-count-row b { color: var(--gold); }

.episode-section { margin: 26px 0 50px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.ep-btn {
  position: relative; padding: 14px 8px; border-radius: 10px; text-align: center;
  background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
  transition: all .18s; color: var(--text); display: block;
}
.ep-btn small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.ep-btn.current { background: var(--grad); border-color: transparent; }
.ep-btn.current small { color: rgba(255,255,255,.8); }

/* ---------------- 播放页 ---------------- */
.watch-wrap { display: flex; gap: 26px; align-items: flex-start; padding: 26px 0 60px; }
.player-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.player-shell {
  position: relative; width: min(430px, 92vw); aspect-ratio: 9 / 16;
  background: #000; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 60px rgba(0,0,0,.65);
}
.player-shell video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px; padding: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.65), transparent);
}
.player-top .back-btn { background: rgba(255,255,255,.14); border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.player-top .back-btn svg { width: 17px; height: 17px; stroke: #fff; }
.player-top .v-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-top .ep-chip { margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 700; background: var(--grad); padding: 4px 12px; border-radius: 999px; }
.player-fallback {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; color: var(--muted); font-size: 13.5px; text-align: center; padding: 20px;
  background: radial-gradient(circle at 50% 30%, #23233a, #0c0c16);
}
.player-fallback svg { width: 46px; height: 46px; stroke: var(--accent-2); }
.watch-nav { display: flex; gap: 12px; }
.watch-side {
  flex: 0 0 330px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 80px); position: sticky; top: calc(var(--header-h) + 20px);
}
.watch-side .side-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.watch-side .side-head h3 { font-size: 16px; font-weight: 700; }
.watch-side .side-head span { font-size: 12px; color: var(--muted); }
.ep-list { overflow-y: auto; padding: 8px; }
.ep-list a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  font-size: 13.5px; transition: background .15s;
}
.ep-list a:hover { background: var(--card-2); }
.ep-list a.current { background: var(--grad); font-weight: 600; }
.ep-list .num { flex: 0 0 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.07); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; }
.ep-list a.current .num { background: rgba(255,255,255,.22); }
.ep-list .e-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-list .dur { font-size: 11.5px; color: var(--muted); }

/* ---------------- App 推广条 ---------------- */
.app-banner {
  margin: 56px 0; border-radius: 20px; padding: 44px 50px;
  background: var(--grad); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
}
.app-banner::before, .app-banner::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.14);
}
.app-banner::before { width: 260px; height: 260px; right: -60px; top: -110px; }
.app-banner::after { width: 170px; height: 170px; right: 180px; bottom: -90px; }
.app-banner h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; }
.app-banner p { margin-top: 8px; font-size: 14.5px; opacity: .92; max-width: 520px; line-height: 1.6; }
.app-banner .store-btns { display: flex; gap: 14px; z-index: 1; }
.store-badge {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.35); border-radius: 12px; transition: background .2s;
}
.store-badge:hover { background: rgba(0,0,0,.45); }
.store-badge svg { width: 24px; height: 24px; fill: #fff; }
.store-badge .s1 { display: block; font-size: 10.5px; opacity: .85; }
.store-badge .s2 { display: block; font-size: 15px; font-weight: 700; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; padding: 48px 0 34px; }
.footer-brand p { color: var(--muted); font-size: 13px; line-height: 1.7; margin-top: 14px; max-width: 300px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; letter-spacing: .5px; }
.footer-col a { display: block; color: var(--muted); font-size: 13.5px; padding: 6px 0; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.social-row { display: flex; gap: 12px; margin-top: 18px; }
.social-row a {
  width: 38px; height: 38px; border-radius: 50%; background: var(--card);
  display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s;
}
.social-row a:hover { background: var(--grad); transform: translateY(-2px); }
.social-row svg { width: 17px; height: 17px; fill: #fff; }
.footer-bottom { border-top: 1px solid var(--line); padding: 18px 0; }
.footer-bottom .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.footer-bottom .links { display: flex; gap: 20px; }
.footer-bottom a:hover { color: #fff; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(25, 25, 40, .96); border: 1px solid var(--line); color: #fff;
  padding: 12px 22px; border-radius: 12px; font-size: 14px; z-index: 999;
  opacity: 0; pointer-events: none; transition: all .3s; box-shadow: 0 10px 34px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255, 47, 106, .6); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .grid-series { grid-template-columns: repeat(5, 1fr); }
  .top-grid { grid-template-columns: repeat(4, 1fr); }
  .watch-side { flex-basis: 280px; }
}
@media (max-width: 860px) {
  .main-nav, .search-box, .header-right .btn-primary { display: none; }
  .hamburger { display: block; }
  .hero-viewport { height: 460px; }
  .hero-dots { bottom: 128px; }
  .detail-inner { flex-direction: column; align-items: center; text-align: center; }
  .detail-poster { flex-basis: auto; width: 200px; }
  .detail-tags, .detail-actions, .detail-info { justify-content: center; align-items: center; }
  .detail-desc { margin: 0 auto; }
  .grid-series { grid-template-columns: repeat(3, 1fr); }
  .top-grid { grid-template-columns: repeat(3, 1fr); gap: 20px 14px; }
  .top-item { padding-left: 26px; }
  .top-item .rank { font-size: 54px; }
  .watch-wrap { flex-direction: column; }
  .watch-side { position: static; max-height: none; width: 100%; flex-basis: auto; }
  .app-banner { flex-direction: column; text-align: center; padding: 36px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .grid-series { grid-template-columns: repeat(2, 1fr); }
  .top-grid { grid-template-columns: repeat(2, 1fr); }
  .row-track { grid-auto-columns: 128px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; padding: 34px 0 20px; }
}
