/* ============================================================
   短剧星球 - 整站样式（移动优先深色主题）
   ============================================================ */

:root {
  --bg: #0e0e14;
  --bg2: #14141d;
  --card: #1b1b27;
  --card2: #232333;
  --line: #2b2b3d;
  --text: #f2f2f7;
  --sub: #8f8fa3;
  --accent: #ff3b5c;
  --accent2: #ff7a3d;
  --grad: linear-gradient(135deg, #ff3b5c, #ff7a3d);
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

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

html { font-size: 14px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }
img { display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; outline: none; }

/* 页面容器：手机宽度居中，桌面两侧留黑 */
.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ==================== 顶部导航 ==================== */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 14, 20, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo img { width: 34px; height: 34px; }
.logo-text {
  font-size: 18px; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}
.search-box {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 8px 14px; color: var(--sub);
  min-width: 0;
}
.search-box svg { width: 16px; height: 16px; flex-shrink: 0; }
.search-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* 子页头部 */
.sub-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 14, 20, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
.sub-header .back-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--card); flex-shrink: 0;
}
.sub-header .back-btn svg { width: 18px; height: 18px; }
.sub-header h1 { font-size: 17px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== 轮播图 ==================== */
.banner { position: relative; margin: 12px 14px 0; border-radius: 14px; overflow: hidden; }
.banner-track { position: relative; aspect-ratio: 750 / 320; }
.banner-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .6s; display: block;
}
.banner-slide.on { opacity: 1; }
.banner-title {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px);
  padding: 4px 10px; border-radius: 8px;
  font-size: 12px; color: #fff;
}
.banner-dots { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 5px; }
.banner-dots .dot { width: 6px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.4); transition: .3s; }
.banner-dots .dot.on { background: #fff; width: 14px; }

/* ==================== 区块标题 ==================== */
.section { margin-top: 22px; padding: 0 14px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title h2 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.section-title h2::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: var(--grad); display: inline-block;
}
.section-title .more { font-size: 12px; color: var(--sub); }

/* ==================== 分类入口 ==================== */
.cat-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 14px 6px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 58px; padding: 8px 0;
}
.cat-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
}
.cat-chip span:last-child { font-size: 12px; color: var(--sub); }

/* ==================== 视频网格 ==================== */
.video-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px 10px; padding: 0 14px;
}
.video-card { display: block; min-width: 0; }
.poster {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius);
  background: linear-gradient(160deg, #262638, #171722) center/cover no-repeat;
  overflow: hidden;
}
.poster .poster-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.35); font-size: 30px;
}
.poster .poster-play svg { width: 44px; height: 44px; }
.poster[style*="background-image"] .poster-play { opacity: 0; transition: .25s; }
.video-card:hover .poster[style*="background-image"] .poster-play { opacity: 1; }
.vip-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--grad); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
}
.ep-num {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
}
.v-title {
  margin-top: 8px; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v-meta { margin-top: 3px; font-size: 11px; color: var(--sub); }

/* 骨架屏 */
.skeleton .poster { background: linear-gradient(100deg, #1d1d2a 40%, #26263a 50%, #1d1d2a 60%); background-size: 200% 100%; animation: sk 1.2s infinite; }
.skeleton .v-title { height: 14px; border-radius: 4px; background: var(--card); margin-top: 8px; }
.skeleton .v-meta { height: 10px; border-radius: 4px; background: var(--card); margin-top: 5px; width: 60%; }
@keyframes sk { to { background-position: -200% 0; } }

/* ==================== 分类页横向标签 ==================== */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 15px; border-radius: 18px;
  background: var(--card); color: var(--sub); font-size: 13px;
  border: 1px solid transparent;
}
.chip.active { background: var(--grad); color: #fff; font-weight: 700; }

/* ==================== 底部导航 ==================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(18, 18, 26, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav .nav-inner { max-width: 520px; margin: 0 auto; display: flex; }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; color: var(--sub);
}
.nav-item .nav-ico svg { width: 22px; height: 22px; }
.nav-item .nav-name { font-size: 11px; }
.nav-item.active { color: var(--accent); }

/* ==================== 通用按钮 ==================== */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border: none; border-radius: 24px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; width: 100%; transition: opacity .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 7px 16px; font-size: 13px; width: auto; border-radius: 18px; }

/* ==================== 表单 ==================== */
.form-page { padding: 30px 20px 20px; }
.form-title { text-align: center; margin-bottom: 26px; }
.form-title .logo { justify-content: center; margin-bottom: 10px; }
.form-title h1 { font-size: 20px; font-weight: 800; }
.form-title p { color: var(--sub); font-size: 13px; margin-top: 6px; }
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; color: var(--sub); margin-bottom: 7px; display: block; }
.form-input {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 15px; font-size: 15px;
}
.form-input:focus { border-color: var(--accent); }
.form-hint { font-size: 12px; color: var(--sub); margin-top: 6px; }
.form-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--sub); }
.form-switch a { color: var(--accent); font-weight: 700; }
.form-submit { margin-top: 24px; }

/* ==================== Toast ==================== */
.toast {
  position: fixed; left: 50%; top: 40%; z-index: 999;
  transform: translate(-50%, -50%) scale(.9);
  background: rgba(30, 30, 44, .95); color: #fff;
  padding: 11px 22px; border-radius: 22px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.warn { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.toast.ok { background: rgba(34, 197, 94, .18); color: #86efac; }

/* ==================== 空状态 ==================== */
.empty { text-align: center; padding: 60px 20px; color: var(--sub); }
.empty .empty-ico { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; color: #3f3f55; }
.empty .empty-ico svg { width: 28px; height: 28px; }
.empty p { font-size: 14px; }

/* ==================== 会员中心 ==================== */
.user-card {
  margin: 14px; padding: 20px 16px; border-radius: 16px;
  background: linear-gradient(135deg, #232038, #181826);
  border: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--card2); display: flex; align-items: center; justify-content: center;
  color: var(--sub);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 30px; height: 30px; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.user-name .vip-tag { position: static; }
.user-sub { font-size: 12px; color: var(--sub); margin-top: 4px; }

.stats-row { display: flex; margin: 0 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.stat-item { flex: 1; text-align: center; padding: 14px 0; background: var(--card); }
.stat-item + .stat-item { border-left: 1px solid var(--line); }
.stat-num { font-size: 18px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--sub); margin-top: 2px; }

.menu-list { margin: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); padding: 15px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--card2); display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; }
.menu-ico svg { width: 18px; height: 18px; }
.menu-text { flex: 1; font-size: 15px; }
.menu-arrow { color: var(--sub); font-size: 14px; }

.logout-btn { margin: 14px; }

/* 未登录提示 */
.login-tip { text-align: center; padding: 80px 30px; }
.login-tip .big-logo { width: 84px; height: 84px; margin: 0 auto 18px; }
.login-tip h2 { font-size: 19px; }
.login-tip p { color: var(--sub); font-size: 13px; margin: 8px 0 26px; }

/* ==================== 开通会员 ==================== */
.vip-hero {
  margin: 14px; padding: 24px 18px; border-radius: 16px; text-align: center;
  background: linear-gradient(135deg, #3a1a2e, #241830 55%, #161626);
  border: 1px solid #4a2540; position: relative; overflow: hidden;
}
.vip-hero::before {
  content: ''; position: absolute; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255, 59, 92, .25), transparent 70%);
  top: -70px; right: -50px;
}
.vip-hero .crown { color: #ffd76a; width: 44px; height: 44px; margin: 0 auto 8px; }
.vip-hero .crown svg { width: 44px; height: 44px; }
.vip-hero h2 { font-size: 22px; font-weight: 800; }
.vip-hero p { color: #c9a9b6; font-size: 13px; margin-top: 6px; }

.plan-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px; }
.plan-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 16px 10px; text-align: center; cursor: pointer; transition: .2s; position: relative;
}
.plan-card.active { border-color: var(--accent); background: rgba(255, 59, 92, .08); }
.plan-card .p-name { font-size: 13px; font-weight: 700; color: var(--sub); }
.plan-card.active .p-name { color: var(--accent); }
.plan-card .p-price { font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.plan-card .p-price small { font-size: 12px; font-weight: 400; color: var(--sub); }
.plan-card .p-days { font-size: 11px; color: var(--sub); }
.plan-card .p-desc { font-size: 11px; color: var(--sub); margin-top: 6px; min-height: 28px; }
.plan-card .hot-tag {
  position: absolute; top: -8px; right: 8px;
  background: var(--grad); color: #fff; font-size: 10px;
  padding: 2px 8px; border-radius: 8px; font-weight: 700;
}

.vip-benefits { margin: 14px; }
.benefit-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14px; }
.benefit-item .ok-ico { color: var(--ok); }
.benefit-item svg { width: 18px; height: 18px; }

.pay-ways { display: flex; gap: 10px; margin: 0 14px 14px; }
.pay-way {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px; font-size: 14px; cursor: pointer;
}
.pay-way.active { border-color: var(--ok); background: rgba(34, 197, 94, .08); }
.pay-way .w-ico { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800; }
.pay-way .w-ico.wechat { background: #07c160; }
.pay-way .w-ico.alipay { background: #1677ff; }

.vip-footer { padding: 0 14px 14px; }

/* ==================== 支付弹窗 ==================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 360px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 18px; padding: 22px; text-align: center;
}
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.pay-qr {
  width: 170px; height: 170px; margin: 10px auto; border-radius: 14px;
  background: #fff; display: flex; align-items: center; justify-content: center;
}
.pay-qr img { width: 150px; height: 150px; }
.pay-qr .qr-fake {
  width: 150px; height: 150px; border-radius: 8px;
  background: repeating-conic-gradient(#333 0% 25%, #fff 0% 50%) 0 0/22px 22px;
  opacity: .9;
}
.pay-order { font-size: 12px; color: var(--sub); margin-bottom: 16px; word-break: break-all; }
.pay-tip { font-size: 12px; color: var(--sub); margin: 12px 0; }

/* ==================== 播放页 ==================== */
.player-wrap { position: relative; background: #000; }
.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vip-lock {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 59, 92, .15), #000 75%);
}
.vip-lock .lock-ico { color: #ffd76a; width: 48px; height: 48px; }
.vip-lock .lock-ico svg { width: 48px; height: 48px; }
.vip-lock h3 { font-size: 18px; font-weight: 800; }
.vip-lock p { color: var(--sub); font-size: 13px; }

.player-info { padding: 14px; }
.player-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.player-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--sub); font-size: 12px; margin-top: 8px; }
.player-actions { display: flex; gap: 10px; margin-top: 14px; }
.player-actions .btn { width: auto; flex: 1; }
.player-actions .btn.like { background: var(--card); border: 1px solid var(--line); color: var(--text); }
.player-actions .btn.like.active { background: rgba(255, 59, 92, .15); border-color: var(--accent); color: var(--accent); }

.ep-strip { display: flex; gap: 8px; overflow-x: auto; padding: 6px 14px 12px; scrollbar-width: none; }
.ep-strip::-webkit-scrollbar { display: none; }
.ep-chip {
  flex-shrink: 0; min-width: 46px; text-align: center;
  padding: 8px 12px; border-radius: 10px; background: var(--card);
  font-size: 13px; color: var(--sub); cursor: pointer; border: 1px solid transparent;
}
.ep-chip.active { background: var(--grad); color: #fff; font-weight: 700; }
.ep-chip .ep-free-tag {
  display: block; margin-top: 3px; font-size: 10px; color: var(--accent); font-weight: 700;
}
.ep-chip.active .ep-free-tag { color: #fff; }

/* 免费试看提示条 */
.preview-tip {
  margin: 8px 14px 0; padding: 9px 14px; border-radius: 10px;
  background: rgba(255, 59, 92, .12); border: 1px solid rgba(255, 59, 92, .35);
  color: #ffb3c1; font-size: 13px; text-align: center;
}

.desc-block { margin: 4px 14px 14px; }
.desc-block h4 { font-size: 14px; margin-bottom: 8px; }
.desc-text { color: var(--sub); font-size: 13px; line-height: 1.8; }

/* ==================== 记录列表 ==================== */
.record-item {
  display: flex; gap: 12px; padding: 12px 14px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.record-item .poster { width: 72px; aspect-ratio: 3 / 4; border-radius: 10px; flex-shrink: 0; }
.record-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.record-title { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-ep { font-size: 12px; color: var(--sub); margin-top: 4px; }
.progress-track { height: 5px; border-radius: 3px; background: var(--line); margin-top: 9px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--grad); border-radius: 3px; }
.record-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; flex-shrink: 0; }
.record-side .del { color: var(--sub); padding: 6px; cursor: pointer; }
.record-side .del svg { width: 17px; height: 17px; }

.clear-bar { display: flex; justify-content: flex-end; padding: 12px 14px; }
.clear-btn { font-size: 13px; color: var(--sub); display: flex; align-items: center; gap: 5px; cursor: pointer; background: none; border: none; }
.clear-btn svg { width: 15px; height: 15px; }

/* ==================== 搜索页 ==================== */
.search-page .search-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg2); border-bottom: 1px solid var(--line);
}
.search-bar input {
  flex: 1; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 9px 15px; font-size: 14px;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar .go-btn {
  background: var(--grad); color: #fff; border: none; border-radius: 18px;
  padding: 8px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.hot-words { padding: 16px 14px 6px; }
.hot-words h3 { font-size: 14px; margin-bottom: 12px; color: var(--sub); display: flex; align-items: center; gap: 7px; }
.hot-words .hot-ico { color: var(--accent); }
.hot-words .hot-ico svg { width: 16px; height: 16px; }
.hot-list { display: flex; flex-wrap: wrap; gap: 9px; }
.hot-item {
  padding: 7px 14px; border-radius: 18px; background: var(--card);
  font-size: 13px; color: var(--text); cursor: pointer;
}
.search-result-tip { padding: 12px 14px 4px; font-size: 13px; color: var(--sub); }

/* ==================== 加载更多 ==================== */
.load-more { text-align: center; padding: 18px 0 8px; }
.load-more .btn { width: auto; padding: 9px 34px; font-size: 13px; }
.loading-tip { text-align: center; color: var(--sub); font-size: 13px; padding: 18px 0; }

/* 会员徽标（信息区用） */
.vip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #d4af37, #ffd76a 60%, #f5c542);
  color: #3a2c00; font-size: 11px; font-weight: 800;
  padding: 2px 9px; border-radius: 10px;
}
.vip-badge svg { width: 13px; height: 13px; }
