/* ============================================
   出海短剧平台 H5 样式 v3 - 暗黑极简风
   移动端优先，自适应 PC
   ============================================ */

:root {
  --bg-dark: #0d0d12;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --primary-rose: #ff4d7a;
  --primary-glow: rgba(255, 77, 122, 0.4);
  --gold-rose: #ffbd7f;
  --text-primary: #ffffff;
  --text-secondary: #71717a;
  --glass-border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container,
.home-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ============================================
   头部
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-dark);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.header .logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff4d7a, #ffbd7f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.header .search-box {
  flex: 1;
  max-width: 300px;
  margin: 0 16px;
  position: relative;
}

.header .search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.header .search-box input:focus {
  border-color: var(--primary-rose);
}

.header .search-box .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 14px;
}

.header .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4d7a, #ffbd7f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
}

/* ============================================
   Hero 轮播 — 动态高度按图片比例
   ============================================ */
.hero-carousel {
  position: relative;
  margin: 0 -12px 16px;
  border-radius: 0;
  overflow: hidden;
}

.hero-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* 初始比例，加载后动态调整 */
  overflow: hidden;
  background: var(--bg-dark);
  transition: aspect-ratio 0.4s ease;
}

.hero-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
}

.hero-item.active {
  opacity: 1;
}

.hero-item .hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: var(--bg-dark);
}

.hero-item .hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(13, 13, 18, 0.85));
  pointer-events: none;
}

.hero-item .hero-info {
  position: relative;
  z-index: 2;
  padding: 24px 16px 20px;
  width: 100%;
}

.hero-item .hero-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.hero-item .hero-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.hero-item .btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  border-radius: 24px;
  border: none;
  background: linear-gradient(135deg, #ff4d7a, #ff3377);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 77, 122, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-item .btn-watch:active {
  transform: scale(0.95);
  box-shadow: 0 2px 12px rgba(255, 77, 122, 0.25);
}

/* 轮播指示器 */
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 4px;
}

.hero-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-dots .dot.active {
  width: 20px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ff4d7a, #ffbd7f);
}

/* ============================================
   分区标题
   ============================================ */
.section {
  margin: 20px 0 16px;
}

.section:first-child {
  margin-top: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 3px solid var(--primary-rose);
}

.section-header .section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.section-header .see-all {
  font-size: 12px;
  color: var(--primary-rose);
  text-decoration: none;
  font-weight: 600;
  padding-right: 4px;
}

/* ============================================
   横向滚动分区
   ============================================ */
.section-hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.section-hscroll::-webkit-scrollbar {
  display: none;
}

/* ============================================
   剧集卡片 (通用)
   ============================================ */
.card-drama {
  flex: 0 0 130px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  border: 1px solid var(--border-subtle);
}

.card-drama:hover,
.card-drama:active {
  transform: scale(1.02);
  border-color: var(--glass-border);
}

.card-drama .cover-wrap {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.card-drama .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  background: var(--bg-dark);
  border-radius: 8px;
  transition: transform 0.3s;
}

.card-drama:active .cover-wrap img {
  transform: scale(1.05);
}

.card-drama .card-info {
  padding: 8px 10px 10px;
}

.card-drama .card-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.card-drama .card-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

/* 角标 — 隐藏 */
.card-drama .badge {
  display: none;
}

/* ============================================
   双列网格 (Binge Worthy / See All)
   ============================================ */
.drama-grid-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card-drama.hero-card {
  flex: none;
}

.card-drama.hero-card .cover-wrap {
  aspect-ratio: 2/3;
}

/* ============================================
   筛选标签
   ============================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-tag {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--glass-border);
}

.filter-tag.active {
  background: linear-gradient(135deg, #ff4d7a, #ff3377);
  color: white;
  border-color: transparent;
}

/* ============================================
   播放页 (保持不变, 仅微调)
   ============================================ */
.player-page {
  min-height: 100vh;
  background: #000;
}

.player-container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.video-player {
  width: 100%;
  aspect-ratio: 9/16;
  background: #000;
  position: relative;
}

.video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drama-header {
  padding: 16px;
}

.drama-header .title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.drama-header .meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.drama-header .tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.drama-header .tag {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.drama-header .description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.6;
}

.episode-list {
  padding: 0 16px 80px;
}

.episode-list .section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.episode-list .episode-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.episode-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.episode-item:active {
  transform: scale(0.92);
}

/* ============================================
   Swipe Player (TikTok-style vertical scroll)
   ============================================ */
/* Background image + blur */
.player-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-color: #000;
  z-index: 0;
}

.player-bg-blur {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.swipe-player {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  overflow: hidden;
  touch-action: none;
  z-index: 1;
}

.swipe-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.video-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  overflow: hidden;
  z-index: 2;
}

/* Back to home button (top-left) */
.player-back-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Episode meta bar (bottom center overlay, single line) */
.episode-meta-bar {
  display: none;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Video progress bar (bottom, draggable) */
.video-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  background: transparent;
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  padding-bottom: 6px;
}

.video-progress-bar::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.video-progress-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 6px;
  width: 0%;
  background: var(--primary-rose);
  border-radius: 3px;
  pointer-events: none;
}

/* Episodes button (bottom-right of video) */
.episodes-btn {
  position: absolute;
  bottom: 50px;
  right: 8px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Play/pause center overlay */
.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.25s ease;
}

.video-play-overlay.show {
  opacity: 1;
}

.video-play-overlay svg {
  width: 24px;
  height: 24px;
}

/* Mute button (bottom-right, left of episodes button) */
.video-mute-btn {
  position: absolute;
  bottom: 50px;
  right: 56px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.video-mute-btn:active {
  color: #fff;
}

.action-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary-rose);
  color: #fff;
  text-align: center;
}

.action-btn.gold {
  background: linear-gradient(135deg, #ff9d6c, #ff6b35);
  color: #fff;
}

.action-btn.outline {
  background: transparent;
  border: 2px solid #ff9d6c;
  color: #ff9d6c;
}

.action-btn.outline:hover {
  background: rgba(255, 157, 108, 0.1);
}

.action-btn:active {
  opacity: 0.8;
}

/* Paywall overlay (covers only video area) */
.paywall-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.paywall-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.paywall-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.paywall-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 240px;
  text-align: center;
}

.paywall-overlay .action-btn {
  max-width: 220px;
}

/* ============================================
   Episodes panel — compact grid, inside video container
   ============================================ */
.episodes-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 11;
  border-radius: inherit;
}

.episodes-panel {
  position: absolute;
  bottom: 40px;
  right: 8px;
  height: auto;
  max-height: 60%;
  width: 78vw;
  max-width: 420px;
  background: #0d0d0f;
  z-index: 12;
  border-radius: 14px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.episodes-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* panel header */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 14px 6px;
  gap: 6px;
  flex-shrink: 0;
}

.panel-header-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.panel-header-sub {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  padding-top: 2px;
}

.panel-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.panel-close:active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* episode count */
.panel-count-row {
  padding: 0 14px 10px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
}

/* grid container */
.panel-list {
  padding: 0 14px 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-content: start;
}

.panel-list::-webkit-scrollbar {
  width: 3px;
}

.panel-list::-webkit-scrollbar-track {
  background: transparent;
}

.panel-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

/* grid episode button */
.panel-episode {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  background: #1a1a1d;
  border: 1px solid #2a2a2d;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.panel-episode:active {
  transform: scale(0.92);
}

/* current playing */
.panel-episode.current {
  background: #3d1a24;
  border: 1.5px solid #ff4d7a;
  color: #fff;
}

/* locked */
.panel-episode.locked {
  background: #161618;
  border: 1px solid #26262a;
  color: #555;
}

/* lock icon — top-right png */
.panel-episode.coins::after,
.panel-episode.locked::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 11px;
  background: url('/static/img/icon_lock_episode.png') center/contain no-repeat;
}

/* coins required — yellow tint but not full locked */
.panel-episode.coins {
  background: #1a1a15;
  border: 1px solid #3a3520;
  color: #e6c40c;
}

.episode-item.active {
  background: var(--primary-rose);
  color: white;
}

.episode-item.locked {
  color: var(--gold-rose);
}

.episode-item.locked::after {
  content: "🔒";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
}

.episode-item.free {
  color: #28a745;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13, 0, 21, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--glass-border);
  z-index: 50;
}

.bottom-bar .coin-balance {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--gold-rose);
}

.btn {
  padding: 10px 24px;
  border-radius: 24px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, #ff4d7a, #ff3377);
  color: white;
  flex: 1;
}

.btn-vip {
  background: linear-gradient(135deg, var(--gold-rose), #ffa066);
  color: #1a0033;
  flex: 1;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--modal-bg-image, none);
  background-size: cover;
  background-position: center;
  filter: blur(30px);
  transform: scale(1.15);
  opacity: 0.45;
  z-index: -1;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: rgba(18, 18, 26, 0.94);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* ---- 弹窗内边距压缩 ---- */
.modal-content.modal-pay {
  padding: 14px 14px 20px;
  max-height: 92vh;
}

/* ---- 顶部行：倒计时 + Hero 文字 ---- */
.pay-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(180, 40, 40, 0.2);
  border: 1px solid rgba(255, 100, 80, 0.12);
  font-size: 12px;
}

.pay-top-deal {
  color: #ffaa6e;
  font-style: italic;
}

.pay-top-deal b {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}

.pay-top-text {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ---- 订阅计划横排三列 ---- */
.plan-list.plan-row {
  flex-direction: row;
  gap: 6px;
  margin-bottom: 6px;
}

.plan-list.plan-row .plan-item {
  flex: 1;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px 6px;
  min-height: 78px;
  border-radius: 10px;
  position: relative;
}

.plan-list.plan-row .plan-item .plan-main {
  flex-direction: column;
  align-items: center;
}

.plan-list.plan-row .plan-left {
  text-align: center;
}

.plan-list.plan-row .plan-price {
  font-size: 16px;
}

.plan-list.plan-row .plan-perday {
  font-size: 11px;
}

.plan-list.plan-row .plan-right {
  text-align: center;
}

.plan-list.plan-row .plan-name {
  font-size: 12px;
  font-weight: 600;
}

.plan-list.plan-row .plan-desc {
  display: none;
}

.plan-list.plan-row .plan-trust {
  display: none;
}

.plan-list.plan-row .plan-discount {
  position: absolute;
  top: -8px;
  right: -4px;
  background: var(--primary-rose);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

/* 覆盖旧 plan-item.selected 的橙色改为 theme 色 */
.plan-list.plan-row .plan-item.selected {
  border-color: var(--primary-rose);
  background: rgba(255, 77, 122, 0.1);
  box-shadow: none;
}

/* ---- 支付方式 + Buy Now 同行 ---- */
.pay-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pay-action-row .pay-method-row {
  display: flex;
  gap: 4px;
  margin: 0;
  flex-shrink: 0;
}

.pay-action-row .pay-method-btn {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 6px;
  min-width: 60px;
  text-align: center;
}

.pay-action-row .pay-method-btn .pm-icon {
  margin-right: 2px;
}

/* 金币包选中时 Card 置灰 */
.pay-action-row .pay-method-row.coin-mode .pay-method-btn {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

/* Buy Now 按钮压缩 */
.pay-action-row #btnPayNow {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: var(--primary-rose);
  color: #fff;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.pay-action-row #btnPayNow:active {
  opacity: 0.85;
}

/* ---- 金币包紧凑网格 ---- */
.coin-pack-grid.compact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.coin-pack-grid.compact-grid .coin-pack-card {
  padding: 6px 4px;
  border-radius: 8px;
  text-align: center;
  overflow: visible;
}

.coin-pack-grid.compact-grid .coin-icon {
  display: none;
}

.coin-pack-grid.compact-grid .coin-label {
  display: none;
}

.coin-pack-grid.compact-grid .coin-amount {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.coin-pack-grid.compact-grid .coin-price {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-rose);
  margin: 0;
  line-height: 1.3;
}

.coin-pack-card .coin-icon-img {
  vertical-align: middle;
  margin-left: 2px;
  margin-top: -1px;
}

/* 金币包赠送比例角标（参照订阅包 plan-discount 风格） */
.coin-pack-card .coin-bonus-pct {
  position: absolute;
  top: -6px;
  right: -4px;
  background: linear-gradient(135deg, #ff8c42, #e83a5c);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(255, 77, 122, 0.3);
  line-height: 1.2;
}

.coin-pack-grid.compact-grid .coin-pack-card.selected {
  border-color: var(--primary-rose);
  background: rgba(255, 77, 122, 0.15);
  box-shadow: none;
  transform: none;
}

/* ---- 分隔线压缩 ---- */
.pay-divider {
  margin: 6px 0;
  font-size: 10px;
  gap: 6px;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-item.selected {
  border-color: var(--primary-rose);
  background: rgba(255, 77, 122, 0.1);
}

/* 支付弹窗内的 plan-list 横排覆盖（仅影响 player.html 的弹窗，不影响首页列表） */
.modal-content .plan-list {
  flex-direction: column;
  gap: 6px;
}

.modal-content .plan-list.plan-row {
  flex-direction: row;
}

.plan-item .plan-info .plan-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.plan-item .plan-info .plan-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.plan-item .plan-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-rose);
}

.plan-item .plan-badge {
  background: var(--primary-rose);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* ============================================
   支付弹窗 — 统一布局新样式
   ============================================ */

/* 支付方式按钮行 */
.pay-method-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.pay-method-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.pay-method-btn .pm-icon {
  margin-right: 4px;
}

.pay-method-btn.active {
  border-color: var(--primary-rose);
  background: rgba(255, 77, 122, 0.12);
  color: #fff;
}

/* 分隔线 */
.pay-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--text-secondary);
  font-size: 12px;
}

.pay-divider::before,
.pay-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* 金币包 2列网格（移动端）*/
.coin-pack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

/* PC 端 ≥768px — 3列 */
@media (min-width: 768px) {
  .coin-pack-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 金币包卡片 — 图片按钮风格 */
.coin-pack-card {
  background: linear-gradient(135deg, rgba(255, 77, 122, 0.08), rgba(255, 140, 0, 0.06));
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.coin-pack-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 77, 122, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.coin-pack-card:hover::before {
  opacity: 1;
}

.coin-pack-card.selected {
  border-color: var(--primary-rose);
  background: linear-gradient(135deg, rgba(255, 77, 122, 0.18), rgba(255, 140, 0, 0.1));
  box-shadow: 0 0 20px rgba(255, 77, 122, 0.25), inset 0 0 20px rgba(255, 77, 122, 0.05);
  transform: translateY(-2px);
}

.coin-pack-card .coin-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.coin-pack-card .coin-amount {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.coin-pack-card .coin-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.coin-pack-card .coin-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-rose);
}

.coin-pack-card .coin-bonus {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--gold-rose);
  color: #1a0033;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ============================================
   计划卡片增强 — 折扣徽章 + 日均价 + 选中发光
   ============================================ */

/* 覆盖 plan-item 默认水平布局为垂直分区 */
.plan-item {
  position: relative;
  overflow: visible;
}

/* 新 DOM 结构样式：.plan-info 已不存在，改用 .plan-left / .plan-right */
.plan-item .plan-left .plan-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-rose);
  line-height: 1.1;
}

.plan-item .plan-right .plan-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.plan-item .plan-right .plan-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.plan-main {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.plan-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 80px;
}

.plan-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

/* 日均价 */
.plan-perday {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1;
}

/* 信任标识 */
.plan-trust {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

/* 折扣徽章 */
.plan-discount {
  position: absolute;
  top: -10px;
  right: -8px;
  background: linear-gradient(135deg, #ff4d7a, #e83a5c);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(255, 77, 122, 0.35);
}

/* 选中态增强 — 橙色边框 + 发光 */
.plan-item.selected {
  border-color: #ff6b3d;
  background: rgba(255, 107, 61, 0.08);
  box-shadow: 0 0 16px rgba(255, 107, 61, 0.2);
}

/* 删除旧的 plan-badge 样式（被 plan-discount 替代） */
.plan-item .plan-badge {
  display: none;
}

/* ============================================
   骨架屏 Skeleton / Shimmer
   ============================================ */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #1a1a25 25%, #252535 50%, #1a1a25 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

/* Hero 骨架 */
.skeleton-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  margin: 0 -12px 16px;
}

/* 骨架卡片 — 横向滚动（2:3） */
.skeleton-scroll {
  display: flex;
  gap: 12px;
  overflow: hidden;
}

.skeleton-card-vert {
  flex: 0 0 130px;
  aspect-ratio: 2/3;
  border-radius: var(--radius);
}

.skeleton-card-vert:nth-child(n+5) {
  display: none;
}

/* 骨架卡片 — 2 列网格（16:9） */
.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.skeleton-card-hori {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
}

.skeleton-card-hori:nth-child(n+5) {
  display: none;
}

@media (min-width: 600px) {
  .skeleton-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .skeleton-card-hori:nth-child(n+5) {
    display: block;
  }

  .skeleton-card-hori:nth-child(n+7) {
    display: none;
  }
}

/* Loading error */
.loading-error {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
}

.payment-result {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.payment-result .icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.payment-result .title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.payment-result .desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  width: 100%;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-rose);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* ============================================
   首页底部
   ============================================ */
.home-footer {
  margin-top: 40px;
  padding: 32px 16px 24px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.home-footer .footer-logo {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff4d7a, #ffbd7f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.home-footer .footer-company {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.policy-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  max-width: 400px;
  margin: 0 auto 20px;
}

.policy-grid a {
  font-size: 11px;
  color: rgba(245, 232, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.policy-grid a:hover {
  color: var(--primary-rose);
}

.home-footer .footer-copy {
  font-size: 10px;
  color: rgba(245, 232, 255, 0.3);
  margin-top: 12px;
}

/* ============================================
   政策页面通用
   ============================================ */
.policy-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  min-height: 100vh;
}

.policy-page h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ff4d7a, #ffbd7f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.policy-page h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.policy-page p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.policy-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-rose);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ============================================
   PC 适配
   ============================================ */
@media (min-width: 768px) {

  .home-content,
  .container {
    max-width: 900px;
  }

  .header {
    padding: 12px calc((100vw - 900px) / 2 + 12px);
  }

  .hero-carousel {
    border-radius: var(--radius-lg);
    margin: 16px 0;
  }

  .drama-grid-2cols {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-drama {
    flex: 0 0 160px;
  }

  .episode-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (min-width: 1200px) {

  .home-content,
  .container {
    max-width: 1200px;
  }

  .drama-grid-2cols {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-drama {
    flex: 0 0 180px;
  }
}

/* ============================================
   Facebook Pixel 隐藏容器
   ============================================ */
#fb-pixel-helper {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}