:root {
  --primary: #ff2e4d;
  --primary-dark: #e01836;
  --primary-grad: linear-gradient(135deg, #ff4d5e 0%, #ff2442 100%);
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #999aa3;
  --border: #eef0f3;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; font-size: 14px;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: 14px; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { display: block; }
::-webkit-scrollbar { width: 0; height: 0; }

/* 一行 2 个，容器收窄居中 */
.container { max-width: 720px; margin: 0 auto; padding: 0 14px 40px; }

/* ===== 顶部栏 ===== */
.topbar { background: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 720px; margin: 0 auto; padding: 10px 14px; display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; white-space: nowrap; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--primary-grad);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px;
  box-shadow: 0 4px 10px rgba(255, 46, 77, .35);
}
.logo b { color: var(--primary); }
/* 后台上传的站点 LOGO（替换默认 ▶ 图标） */
.logo .logo-img { height: 32px; max-width: 190px; object-fit: contain; display: block; }
.logo.has-logo .logo-mark { display: none; }

/* ===== 语言切换 ===== */
.lang-switch {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  background: #f2f3f5; border-radius: 18px; padding: 0 10px 0 12px; height: 34px;
}
.lang-switch .ls-globe { width: 15px; height: 15px; color: #b3b5bd; flex-shrink: 0; }
.lang-switch select {
  border: none; outline: none; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  cursor: pointer; max-width: 96px;
  -webkit-appearance: none; appearance: none;
  padding-right: 2px;
}
.lang-switch:focus-within { background: #fff; box-shadow: 0 0 0 2px rgba(255, 46, 77, .18); }

/* ===== 分类标签栏 ===== */
.tabbar { background: #fff; position: sticky; top: 57px; z-index: 49; border-bottom: 1px solid var(--border); }
.tabbar-inner {
  max-width: 720px; margin: 0 auto; padding: 0 8px;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.tabbar-inner a {
  position: relative; flex-shrink: 0; padding: 12px 14px; font-size: 14.5px; color: #55555e; white-space: nowrap;
  transition: color .2s;
}
.tabbar-inner a.active { color: var(--primary); font-weight: 700; }
.tabbar-inner a.active::after {
  content: ''; position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 2px; background: var(--primary);
}

/* ===== 区块标题 ===== */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 14px; }
.section-head .bar { width: 4px; height: 17px; border-radius: 2px; background: var(--primary); align-self: center; }
.section-head h2 { font-size: 17px; font-weight: 800; }

/* ===== 分类内筛选标签条 ===== */
.tagbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.tagbar .flt-pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: #fff; color: #55555e; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: all .18s; user-select: none;
}
.tagbar .flt-pill:active { transform: scale(.96); }
.tagbar .flt-pill.active {
  background: var(--primary-grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 46, 77, .3);
}
/* 分类一句话介绍 */
.cat-intro {
  margin-top: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.75;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 13px; box-shadow: var(--shadow);
}

/* ===== 卡片网格：固定一行 2 个 ===== */
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }

.video-card { cursor: pointer; }
.video-card:active { transform: scale(0.98); transition: transform .1s; }
.poster {
  position: relative; aspect-ratio: 3 / 4; border-radius: 11px; overflow: hidden;
  background: #e9eaee; box-shadow: var(--shadow);
}
.poster .noimg {
  position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center;
  padding: 12px; text-align: center; color: #fff; font-weight: 700; font-size: 16px;
  background: linear-gradient(160deg, #ff6b7a, #ff2442);
}
.poster img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.poster .shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(0,0,0,.02) 55%, rgba(0,0,0,.72) 100%); }
.poster .badge-hot {
  position: absolute; left: 8px; bottom: 8px; z-index: 3;
  color: #fff; font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.poster .badge-tag {
  position: absolute; right: 8px; bottom: 8px; z-index: 3; color: #fff; font-size: 11.5px; font-weight: 600;
  background: rgba(0,0,0,.4); padding: 2px 8px; border-radius: 10px; backdrop-filter: blur(3px);
}
.video-card .v-title {
  margin-top: 8px; font-size: 14px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.video-card .v-tags { margin-top: 2px; color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.empty { text-align: center; color: var(--muted); padding: 80px 0; font-size: 14px; }

/* ===== 卡密分类范围提示 ===== */
.scope-notice {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: rgba(255, 46, 77, .08); color: var(--primary);
  font-size: 13px; font-weight: 600; border: 1px solid rgba(255, 46, 77, .15);
}

/* ===== 前台轻提示 ===== */
#frontToast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 24, .92); color: #fff; padding: 11px 20px; border-radius: 22px;
  font-size: 13.5px; font-weight: 600; z-index: 120; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  max-width: 88vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#frontToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 全屏滑动播放器（横竖屏自适应 + 分类内上下滑连播） ===== */
.player-overlay {
  position: fixed; inset: 0; z-index: 90; background: #000;
  animation: maskIn .2s ease; overflow: hidden;
}
.ov-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 12;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(rgba(0,0,0,.6), transparent);
}
.ov-title {
  flex: 1; color: #fff; font-size: 15px; font-weight: 700; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ov-pos { color: rgba(255,255,255,.85); font-size: 12.5px; flex-shrink: 0; }
.ov-close {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ov-close:active { transform: scale(.92); }

/* 竖向滑动列表：一屏一视频，滑动吸附 */
.sp-list {
  position: absolute; inset: 0; overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; overscroll-behavior: contain;
}
.sp-list::-webkit-scrollbar { display: none; }
.sp-slide {
  position: relative; width: 100%; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  background: #000; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* 视频自适应：不锁 16:9 —— object-fit:contain 按视频自身方向等比填充，
   竖屏视频在竖屏手机上近乎满屏，横屏视频横满屏，不拉伸不变形 */
.sp-video-box { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.sp-video-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* 视频信息条（覆盖在底部） */
.sp-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; color: #fff;
  padding: 46px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  pointer-events: none;
}
.sp-title { font-size: 16px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-sub { margin-top: 4px; font-size: 12px; opacity: .75; }

/* 右侧 上/下一个 按钮 */
.sp-side {
  position: absolute; right: 8px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 12;
  display: flex; flex-direction: column; gap: 10px;
}
.sp-nav-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.16); color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: pointer;
}
.sp-nav-btn:active { transform: scale(.9); }

/* ===== 水印 ===== */
.wm { position: absolute; pointer-events: none; color: #fff; z-index: 10; text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; }
.wm-fixed.top-left { top: 16px; left: 16px; }
.wm-fixed.top-right { top: 16px; right: 16px; }
.wm-fixed.bottom-left { bottom: 16px; left: 16px; }
.wm-fixed.bottom-right { bottom: 16px; right: 16px; }
.wm-fixed.center { top: 50%; left: 50%; transform: translate(-50%,-50%); }
.wm-marquee { position: absolute; left: 0; right: 0; overflow: hidden; pointer-events: none; z-index: 10; }
.wm-marquee.top { top: 20px; transform: translateY(var(--off, 0px)); }
.wm-marquee.middle { top: 50%; transform: translateY(calc(-50% + var(--off, 0px))); }
.wm-marquee.bottom { bottom: 20px; transform: translateY(var(--off, 0px)); }
/* 斜向：滚动轨道整体旋转，文字沿对角线斜着跑；支持多条斜带（用 --off 纵向错开） */
.wm-marquee.diag {
  top: 50%; left: -55%; right: -55%; width: 210%;
  transform: translateY(calc(-50% + var(--off, 0px))) rotate(-18deg);
  will-change: transform;
}
.wm-marquee .inner { display: inline-block; white-space: nowrap; padding-left: 100%; animation: marquee linear infinite; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ===== 卡密/模态框 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 100; animation: maskIn .2s ease; }
.modal { background: #fff; border-radius: 18px; padding: 28px 26px; width: 360px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: modalIn .28s cubic-bezier(.2,.8,.3,1.15); }
.modal h3 { margin-bottom: 6px; font-size: 18px; font-weight: 700; }
.modal .modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.modal input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; outline: none; margin-bottom: 12px;
  font-size: 16px; letter-spacing: 4px; text-transform: uppercase; text-align: center; font-weight: 700;
}
.modal input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,46,77,.12); }
.modal .err { color: var(--danger); font-size: 13px; margin-bottom: 10px; min-height: 18px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; }

.btn { display: inline-block; padding: 10px 20px; border-radius: 10px; background: var(--primary-grad); color: #fff; font-size: 14px; font-weight: 600; min-height: 44px; }
.btn:active { transform: scale(0.97); transition: transform .1s; }
.btn.ghost { background: #f2f3f5; color: var(--text); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(12px); } to { opacity: 1; transform: none; } }

/* ===== 骨架屏 ===== */
.skel { background: linear-gradient(90deg, #eef0f3 0%, #f6f7f9 50%, #eef0f3 100%); background-size: 200% 100%; animation: skelShine 1.4s ease-in-out infinite; border-radius: 8px; }
@keyframes skelShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; margin-top: 16px; }
.skel-card .skel-poster { aspect-ratio: 3 / 4; border-radius: 11px; }
.skel-card .skel-line { height: 14px; margin-top: 10px; border-radius: 4px; }
.skel-card .skel-line.s { width: 55%; height: 11px; margin-top: 7px; border-radius: 4px; }

/* ===== 卡片入场动画 ===== */
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.video-card { animation: cardIn .4s cubic-bezier(.2,.8,.3,1) both; }
.video-card:nth-child(2) { animation-delay: 40ms; }
.video-card:nth-child(n+3) { animation-delay: 80ms; }

/* ===== 页脚 ===== */
.footer {
  max-width: 720px; margin: 0 auto; padding: 24px 14px calc(28px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 20px;
  color: var(--muted); font-size: 13px; border-top: 1px solid var(--border);
}
.footer a:hover { color: var(--primary); }

.hidden { display: none !important; }

/* ===== 整站锁（未激活卡密时覆盖整个页面） ===== */
.site-lock {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, #1b1220 0%, #0d0d13 55%, #09090d 100%);
  transition: opacity .4s ease;
}
.site-lock.leaving { opacity: 0; pointer-events: none; }
.sl-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(480px 300px at 12% 8%, rgba(255,46,77,.16), transparent 65%),
    radial-gradient(520px 360px at 88% 92%, rgba(255,46,77,.12), transparent 60%);
}
.sl-glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; animation: slPulse 5s ease-in-out infinite; }
.sl-glow-1 { width: 260px; height: 260px; left: 50%; top: 8%; margin-left: -130px; background: rgba(255,46,77,.35); }
.sl-glow-2 { width: 200px; height: 200px; right: 6%; bottom: 4%; background: rgba(255,120,66,.22); animation-delay: 2.5s; }
@keyframes slPulse { 0%, 100% { opacity: .35; } 50% { opacity: .65; } }

.sl-panel {
  position: relative; z-index: 1;
  width: 400px; max-width: 100%;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 24px;
  padding: 38px 30px 26px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  animation: slPanelIn .5s cubic-bezier(.2,.85,.3,1.1);
}
/* 锁屏面板内语言切换（面板右上角，顶栏被遮罩盖住时仍可切换） */
.sl-lang {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px 0 12px; height: 30px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  color: rgba(255, 255, 255, .85);
}
.sl-lang .ls-globe { width: 13px; height: 13px; color: rgba(255,255,255,.55); flex-shrink: 0; }
.sl-lang select {
  border: none; outline: none; background: transparent;
  color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer;
  -webkit-appearance: none; appearance: none; padding-right: 2px;
}
.sl-lang select option { color: #222; } /* 下拉展开时选项在浅色列表上需深色文字 */
@keyframes slPanelIn { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }

.sl-mark {
  width: 66px; height: 66px; margin: 0 auto 18px;
  border-radius: 19px;
  background: linear-gradient(135deg, #ff5a6c 0%, #ff2442 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; padding-left: 4px;
  box-shadow: 0 12px 30px rgba(255, 46, 77, .45), 0 2px 0 rgba(255,255,255,.25) inset;
  overflow: hidden;
}
.sl-mark.with-logo { padding-left: 0; background: transparent; box-shadow: none; }
.sl-mark .sl-logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; background: #fff; padding: 4px; }
.sl-title { color: #fff; font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.sl-sub { color: rgba(255,255,255,.55); font-size: 13.5px; margin: 10px 0 22px; line-height: 1.6; }
.sl-input {
  width: 100%; height: 54px;
  background: rgba(255, 255, 255, .07);
  border: 1.5px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  color: #fff; font-size: 24px; font-weight: 800;
  letter-spacing: 12px; text-indent: 12px; text-align: center; text-transform: uppercase;
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
  caret-color: #ff4d5e;
}
.sl-input::placeholder { color: rgba(255,255,255,.22); font-size: 15px; font-weight: 400; letter-spacing: 2px; text-indent: 0; }
.sl-input:focus { border-color: #ff4d5e; background: rgba(255,255,255,.1); box-shadow: 0 0 0 4px rgba(255,46,77,.18); }
.sl-btn {
  width: 100%; height: 52px; margin-top: 14px;
  border-radius: 14px; border: none;
  background: linear-gradient(135deg, #ff5a6c 0%, #ff2442 100%);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 3px;
  box-shadow: 0 12px 26px rgba(255, 46, 77, .35);
  transition: transform .12s, box-shadow .2s, opacity .2s;
}
.sl-btn:active { transform: scale(.97); }
.sl-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.sl-err { color: #ff8792; font-size: 13.5px; font-weight: 600; margin-top: 12px; min-height: 20px; }
.sl-hint { margin-top: 22px; color: rgba(255,255,255,.32); font-size: 12px; line-height: 1.9; }
.sl-hint::before {
  content: ''; display: block; width: 34px; height: 1px; margin: 0 auto 14px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
}
