:root {
  --bg: #0f1115;
  --bg-soft: #171a21;
  --card: #1c2029;
  --text: #e8eaed;
  --text-dim: #9aa0ac;
  --accent: #e50914;
  --accent-2: #f5c518;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  padding-top: 64px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== 顶部导航 ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 100;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.logo-mark {
  background: var(--accent);
  color: #fff;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 18px;
}
.nav-links {
  display: flex;
  gap: 22px;
  font-size: 15px;
}
.nav-links a {
  color: var(--text-dim);
  padding: 6px 2px;
  transition: color .2s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.search-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
}
.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  width: 180px;
  font-size: 14px;
}
.search-box button {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
}

/* ===== 轮播大图 ===== */
.hero {
  position: relative;
  max-width: 1280px;
  margin: 24px auto 0;
  padding: 0 24px;
  height: 420px;
}
.hero-slides {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
  display: flex;
  align-items: flex-end;
  padding: 48px;
}
.hero-slide.active { opacity: 1; }
.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.1) 100%);
}
.hero-info { position: relative; max-width: 540px; }
.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.hero-title { font-size: 38px; font-weight: 800; margin-bottom: 12px; }
.hero-meta { color: var(--text-dim); margin-bottom: 14px; font-size: 14px; }
.hero-desc {
  color: #cfd3da;
  font-size: 14px;
  margin-bottom: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  transition: transform .15s, background .2s;
}
.btn-play:hover { background: #ff1019; transform: translateY(-2px); }
.hero-dots {
  position: absolute;
  bottom: 18px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hero-dots span {
  width: 9px; height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.4);
  cursor: pointer;
}
.hero-dots span.active { background: var(--accent); width: 22px; }

/* ===== 内容区 ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 36px 24px 60px; }
.section { margin-bottom: 44px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 4px; height: 20px;
  background: var(--accent);
  border-radius: 2px;
}
.section-more { color: var(--text-dim); font-size: 14px; }
.section-more:hover { color: var(--accent); }

/* 海报墙网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* 海报卡片 */
.card { cursor: pointer; }
.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  transition: transform .2s;
}
.card:hover .poster { transform: translateY(-6px); }
.poster::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.75) 100%);
}
.poster-name {
  position: relative;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}
.rating {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,.65);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
}
.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  background: rgba(0,0,0,.35);
  transition: opacity .2s;
  z-index: 2;
}
.card:hover .play-overlay { opacity: 1; }
.play-overlay span {
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 22px;
  padding-left: 4px;
}
.card-info { padding: 10px 2px 0; }
.card-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
  font-size: 16px;
}

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 30px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ===== 播放页 ===== */
.player-wrap {
  position: relative;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player-wrap video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }

/* 续播小提示：浮在画面左下角，几秒后淡出 */
.resume-toast {
  position: absolute; left: 16px; bottom: 64px;
  background: rgba(0,0,0,.78); color: #fff; font-size: 14px;
  padding: 8px 14px; border-radius: 8px; max-width: 80%;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.resume-toast.show { opacity: 1; transform: translateY(0); }

.play-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  margin-top: 24px;
}
.detail-title { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
.detail-meta { color: var(--text-dim); font-size: 14px; margin-bottom: 8px; }
.detail-meta .score { color: var(--accent-2); font-weight: 700; font-size: 18px; margin-right: 10px; }
.detail-row { font-size: 14px; color: #cfd3da; margin: 6px 0; }
.detail-row b { color: var(--text-dim); font-weight: 400; margin-right: 6px; }
.detail-desc { font-size: 14px; color: #cfd3da; margin-top: 12px; line-height: 1.8; }

.episodes-box { margin-top: 26px; }
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.ep-btn {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text);
  padding: 10px 6px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.ep-btn:hover { border-color: var(--accent); color: #fff; }
.ep-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.side-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.side-title::before { content: ""; width: 4px; height: 18px; background: var(--accent); border-radius: 2px; }
.side-list { display: flex; flex-direction: column; gap: 14px; }
.side-item { display: flex; gap: 12px; cursor: pointer; }
.side-poster {
  width: 64px; flex: none; aspect-ratio: 2/3; border-radius: 8px;
  display: flex; align-items: flex-end; padding: 6px; font-size: 11px; font-weight: 700;
}
.side-meta { font-size: 13px; }
.side-meta .nm { font-weight: 600; margin-bottom: 4px; }
.side-meta .sb { color: var(--text-dim); font-size: 12px; }
.back-link { display: inline-block; color: var(--text-dim); margin-bottom: 16px; font-size: 14px; }
.back-link:hover { color: var(--accent); }

/* ===== 右上角 登录 / 用户 ===== */
.nav-login, .nav-user {
  flex: none;
  margin-left: 4px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-user { background: var(--bg-soft); border: 1px solid rgba(255,255,255,.12); }
.nav-login:hover { background: #ff1019; }

/* 手机端汉堡菜单按钮 + 抽屉，默认隐藏 */
.nav-toggle {
  display: none;
  background: transparent; border: none; color: var(--text);
  font-size: 24px; cursor: pointer; margin-left: 6px;
}
.nav-drawer { display: none; flex-direction: column; }
.nav-drawer.open {
  display: flex;
  background: var(--bg-soft);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 10px 24px;
}
.nav-drawer a { padding: 12px 0; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,.05); }
.nav-drawer a:last-child { border-bottom: none; }
.drawer-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px; padding: 4px 6px 4px 16px; margin: 6px 0 10px;
}
.drawer-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px; min-width: 0;
}
.drawer-search button {
  flex: none; background: var(--accent); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 999px; cursor: pointer; font-size: 15px;
}

/* ===== 列表页 ===== */
.page-title { font-size: 26px; font-weight: 800; margin-bottom: 20px; }
.filters {
  background: var(--bg-soft);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 8px 18px;
  margin-bottom: 26px;
}
.filter-row { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; }
.filter-row + .filter-row { border-top: 1px dashed rgba(255,255,255,.08); }
.filter-label { color: var(--text-dim); font-size: 14px; flex: none; width: 44px; padding-top: 6px; }
.filter-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-opts button {
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  padding: 5px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; transition: all .15s;
}
.filter-opts button:hover { color: var(--text); }
.filter-opts button.on { background: var(--accent); color: #fff; }

/* 翻页 */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 36px; }
.pager button {
  background: var(--card); border: 1px solid rgba(255,255,255,.08); color: var(--text);
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); }
.pager button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 收藏按钮（播放页）===== */
.action-row { display: flex; gap: 12px; margin: 16px 0 4px; }
.btn-fav {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid rgba(255,255,255,.12); color: var(--text);
  padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 15px; transition: all .15s;
}
.btn-fav:hover { border-color: var(--accent); }
.btn-fav.on { background: rgba(229,9,20,.15); border-color: var(--accent); color: #ff5560; }

.action-row { align-items: center; flex-wrap: wrap; }
/* 倍速控制 */
.speed-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.speed-ctrl .sp-label { color: var(--text-dim); font-size: 13px; margin-right: 2px; }
.sp-btn {
  background: var(--card); border: 1px solid rgba(255,255,255,.12); color: var(--text-dim);
  padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all .15s;
}
.sp-btn:hover { color: var(--text); border-color: rgba(255,255,255,.3); }
.sp-btn.active { background: rgba(229,9,20,.15); border-color: var(--accent); color: #ff5560; }
/* 自动连播开关 */
.autonext {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 14px; cursor: pointer; user-select: none;
}
.autonext input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ===== 登录 / 注册 ===== */
.auth-wrap { max-width: 400px; margin: 40px auto; background: var(--bg-soft);
  border: 1px solid rgba(255,255,255,.07); border-radius: 16px; padding: 36px 32px; }
.auth-tabs { display: flex; margin-bottom: 26px; border-bottom: 1px solid rgba(255,255,255,.08); }
.auth-tabs button {
  flex: 1; background: none; border: none; color: var(--text-dim);
  font-size: 17px; padding: 12px 0; cursor: pointer; position: relative;
}
.auth-tabs button.on { color: var(--text); font-weight: 700; }
.auth-tabs button.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: var(--accent); border-radius: 2px;
}
.auth-field { margin-bottom: 18px; }
.auth-field label { display: block; font-size: 14px; color: var(--text-dim); margin-bottom: 8px; }
.auth-field input {
  width: 100%; background: var(--bg); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 12px 14px; color: var(--text); font-size: 15px; outline: none;
}
.auth-field input:focus { border-color: var(--accent); }
.cap-row { display: flex; gap: 10px; align-items: stretch; }
.cap-row input { flex: 1; }
.cap-img {
  width: 130px; min-height: 46px; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.1); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-dim); background: #1a1f2b;
}
.cap-img svg { width: 100%; height: 100%; display: block; }
.auth-title { text-align: center; margin: 0 0 24px; font-size: 22px; }
.auth-btn {
  width: 100%; background: var(--accent); color: #fff; border: none;
  padding: 13px; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 6px;
}
.auth-btn:hover { background: #ff1019; }
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-msg { color: #ff5560; font-size: 14px; min-height: 20px; margin-top: 12px; text-align: center; }
.auth-foot { text-align: center; margin-top: 16px; }
.auth-foot a { color: var(--text-dim); font-size: 14px; text-decoration: none; }
.auth-foot a:hover { color: var(--accent); }

/* ===== 我的页面 ===== */
.user-head { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
.user-avatar { width: 64px; height: 64px; border-radius: 999px; background: var(--accent);
  display: grid; place-items: center; font-size: 28px; }
.user-name { font-size: 22px; font-weight: 700; }
.user-logout { margin-left: auto; background: var(--card); border: 1px solid rgba(255,255,255,.12);
  color: var(--text-dim); padding: 9px 18px; border-radius: 8px; cursor: pointer; }
.user-logout:hover { color: var(--text); border-color: var(--accent); }
.tab-bar { display: flex; gap: 24px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 24px; }
.tab-bar button { background: none; border: none; color: var(--text-dim); font-size: 16px;
  padding: 10px 0; cursor: pointer; position: relative; }
.tab-bar button.on { color: var(--text); font-weight: 700; }
.tab-bar button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 3px; background: var(--accent); border-radius: 2px; }

@media (max-width: 900px) { .play-layout { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .nav-links, .search-box { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav-login, .nav-user { margin-left: 0; }
  .hero { height: 300px; }
  .hero-title { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
}

/* ===== 真海报图 / 真背景图 ===== */
.poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.poster::after { z-index: 1; }
.poster .rating, .poster .remarks, .poster .play-overlay, .poster-name { z-index: 2; }
.poster-name { position: relative; }
.remarks {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,.7); color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 6px;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-slide::before { z-index: 1; }
.hero-info { z-index: 2; }
.side-poster { position: relative; overflow: hidden; }
.side-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.side-poster span { position: relative; z-index: 1; }

/* 加载中 / 翻页省略号 */
.loading { grid-column: 1 / -1; text-align: center; color: var(--text-dim); padding: 50px 0; font-size: 15px; }
.pager .gap { color: var(--text-dim); align-self: center; padding: 0 4px; }
