/* apph5 Template — Mobile H5 App Style */
:root {
  --bg: #0f0f13;
  --bg2: #1a1a22;
  --bg3: #24242f;
  --card: #1e1e28;
  --border: #2a2a38;
  --text: #f0f0f5;
  --text2: #a0a0b8;
  --text3: #606078;
  --accent: #e91e8c;
  --accent2: #9b59b6;
  --tab-h: 58px;
  --top-h: 48px;
  --sub-h: 42px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

/* html 撑满视口，多余部分显示深色侧边背景（桌面端可见） */
html {
  width: 100%; height: 100%; overflow: hidden;
  background:
    radial-gradient(ellipse 55% 45% at 18% 28%, rgba(233,30,140,.13) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 82% 72%, rgba(155,89,182,.10) 0%, transparent 55%),
    #07070b;
}

/* body 窄列居中，最宽 460px，超出部分露出 html 背景 */
body {
  max-width: 460px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 0 auto;         /* 居中 */
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

a { color: inherit; text-decoration: none; }

/* ── Page Container ── */
#app-wrap {
  display: flex; flex-direction: column;
  height: 100vh; height: -webkit-fill-available;
  overflow: hidden;
}

/* ── Tab Sections ── */
.tab-section {
  display: none; flex: 1; overflow: hidden;
  flex-direction: column; position: relative;
}
.tab-section.active { display: flex; }

.section-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 8px);
}

/* ── Bottom Tab Bar ── */
/* left:50%+translateX(-50%)+width:min(460px,100%) 让 tab-bar
   在桌面跟随 460px 窄列，在手机铺满屏幕 */
#tab-bar {
  position: fixed; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, 100%);
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #16161e;
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start;
  z-index: 999;
}

.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: var(--tab-h); gap: 3px;
  cursor: pointer; color: var(--text3);
  transition: color .2s;
  padding-top: 6px;
  -webkit-user-select: none; user-select: none;
}
.tab-item.active { color: var(--accent); }
.tab-item svg, .tab-item .tab-ico { width: 22px; height: 22px; }
.tab-item .tab-label { font-size: 10px; font-weight: 500; }

/* ── Nav Filter Bar (pill tabs) ── */
.nav-filter-bar {
  display: flex; gap: 8px; padding: 10px 12px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; flex-shrink: 0;
}
.nav-filter-bar::-webkit-scrollbar { display: none; }
.nav-pill {
  flex-shrink: 0; padding: 5px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: all .2s;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
}
.nav-pill.active {
  background: linear-gradient(135deg, var(--accent), #c2185b);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 10px rgba(233,30,140,.4);
}

/* ── Notice bar ── */
.nav-notice-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(233,30,140,.08); border-bottom: 1px solid rgba(233,30,140,.15);
  padding: 7px 12px; overflow: hidden;
}
.nav-notice-tag {
  flex-shrink: 0; font-size: 11px; font-weight: 700;
  background: var(--accent); color: #fff;
  padding: 2px 7px; border-radius: 4px;
}
.nav-notice-track {
  flex: 1; overflow: hidden; white-space: nowrap;
}
.nav-notice-track span {
  display: inline-block;
  font-size: 12px; color: var(--text2);
  animation: notice-scroll 28s linear infinite;
}
@keyframes notice-scroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ── Seek control bar (video player page) ── */
.seek-bar {
  display: flex; align-items: center;
  background: #13131a; border-top: 1px solid #1e1e2c;
  border-bottom: 1px solid #1e1e2c; padding: 8px 6px;
  gap: 4px;
}
.seek-btn {
  flex: 1; border: none; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 7px 2px; border-radius: 9px;
  font-size: 9px; font-weight: 600;
  transition: transform .12s, opacity .12s;
  letter-spacing: .02em;
}
.seek-btn:active { transform: scale(.88); opacity: .7; }
.seek-btn svg { width: 16px; height: 16px; }
.seek-btn span { line-height: 1; }
.seek-btn--back {
  background: linear-gradient(160deg, #1a2a4a, #0e1a2e);
  color: #82b4ff; border: 1px solid #1e3054;
}
.seek-btn--back svg { fill: #82b4ff; }
.seek-btn--fwd {
  background: linear-gradient(160deg, #3a0a22, #240614);
  color: #ff82c0; border: 1px solid #4a1030;
}
.seek-btn--fwd svg { fill: #ff82c0; }
.seek-divider {
  width: 1px; align-self: stretch;
  background: #2a2a3c; margin: 4px 2px; flex-shrink: 0;
}

/* ── Section divider ── */
.nav-sec-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 6px;
}
.nav-sec-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border));
}
.nav-sec-hd .nav-sec-line:last-child {
  background: linear-gradient(90deg, var(--border), transparent);
}
.nav-sec-label {
  font-size: 11px; color: var(--text2); white-space: nowrap;
  flex-shrink: 0;
}

/* ── Icon grid (4 columns) ── */
.icon-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2px; padding: 4px 8px 12px;
}

.icon-item {
  display: flex; flex-direction: column;
  align-items: center; padding: 12px 4px 10px;
  gap: 7px; cursor: pointer;
  border-radius: 10px; transition: background .15s, transform .12s;
}
.icon-item:active { transform: scale(.9); background: var(--bg3); }

.icon-img {
  width: 58px; height: 58px; border-radius: 16px;
  background: var(--bg3);
  overflow: hidden; display: flex; align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,.5);
  flex-shrink: 0; position: relative;
  border: 1px solid rgba(255,255,255,.06);
}
.icon-img img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 16px;
}
.icon-emoji {
  font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.icon-fallback {
  font-size: 14px; font-weight: 700;
  color: var(--accent); text-align: center;
  width: 100%; text-align: center;
}
.icon-item .icon-label {
  font-size: 11px; color: var(--text); text-align: center;
  line-height: 1.3; width: 100%; max-width: 62px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* ── Video Tab ── */
#video-section .cat-bar {
  display: flex; overflow-x: auto;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  scrollbar-width: none; position: sticky; top: 0; z-index: 10;
}
#video-section .cat-bar::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0; padding: 0 14px;
  height: var(--sub-h); line-height: var(--sub-h);
  font-size: 13px; color: var(--text2);
  cursor: pointer; white-space: nowrap; position: relative;
  transition: color .2s;
}
.cat-tab.active { color: var(--text); font-weight: 600; }
.cat-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%); width: 20px; height: 2px;
  background: var(--accent); border-radius: 2px;
}

.video-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 10px;
  counter-reset: vrank;
}
.video-card {
  background: var(--card); border-radius: 12px;
  overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  counter-increment: vrank;
  position: relative;
}
.video-card:active { transform: scale(.97); box-shadow: 0 0 0 2px var(--accent); }

/* Featured first card spans full width */
#videoGrid .video-card:first-child {
  grid-column: 1 / -1;
}
#videoGrid .video-card:first-child .video-thumb {
  aspect-ratio: 16/9;
}
#videoGrid .video-card:first-child .video-title {
  font-size: 14px; font-weight: 600; -webkit-line-clamp: 1;
}
#videoGrid .video-card:first-child::after {
  content: 'HOT';
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: linear-gradient(135deg, #ff3d00, #e91e8c);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: .04em;
}
/* Rank number for cards 2+ */
#videoGrid .video-card:not(:first-child)::after {
  content: counter(vrank, decimal-leading-zero);
  position: absolute; top: 0; left: 0; z-index: 2;
  background: rgba(0,0,0,.72); color: rgba(255,255,255,.7);
  font-size: 11px; font-weight: 700;
  padding: 3px 7px 3px 6px;
  border-radius: 0 0 8px 0;
  letter-spacing: .02em;
}

.video-thumb {
  position: relative; aspect-ratio: 16/10;
  overflow: hidden; background: var(--bg3);
}
.video-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: opacity .3s;
}
/* Center play button overlay */
.vcard-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.08);
}
.vcard-play {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(233,30,140,.85);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(233,30,140,.45);
  opacity: 0; transition: opacity .2s;
}
.vcard-play svg { width: 16px; height: 16px; fill: #fff; margin-left: 2px; }
.video-card:hover .vcard-play,
.video-card:active .vcard-play { opacity: 1; }
.play-badge {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(233,30,140,.85); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
}
.thumb-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 6px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  font-size: 11px; color: rgba(255,255,255,.9); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; pointer-events: none;
}
.video-info { padding: 8px 8px 10px; }
.video-title {
  font-size: 12px; color: var(--text); line-height: 1.4;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.video-meta { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* Video list banner top ad */
.banner-ad {
  margin: 10px; border-radius: 10px; overflow: hidden;
  display: block;
}
.banner-ad img { width: 100%; display: block; }

/* ── Dating Tab (约会) ── */
#date-section .section-scroll { background: var(--bg); }

.date-header {
  padding: 14px 14px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.date-header h3 { font-size: 16px; font-weight: 700; }
.date-header span { font-size: 12px; color: var(--text3); }

.date-feed { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 14px; }

.date-card {
  background: var(--card); border-radius: 14px;
  overflow: hidden; cursor: pointer;
  transition: transform .15s;
  border: 1px solid var(--border);
}
.date-card:active { transform: scale(.98); }

.date-row {
  display: flex; align-items: center;
  padding: 14px 12px 10px; gap: 10px;
}
.date-avatar {
  width: 66px; height: 66px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255,255,255,.13);
  background: var(--bg3);
}
.date-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.date-meta { flex: 1; min-width: 0; }
.date-meta .d-name {
  font-size: 18px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.date-dist {
  display: flex; align-items: center; gap: 3px;
  margin-top: 5px; font-size: 12px; color: #22c55e; font-weight: 500;
}
.date-contact-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg,#ff4da6 0%,#bf3fff 100%);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 13px; border-radius: 24px; border: none;
  white-space: nowrap; cursor: pointer; line-height: 1.2;
}
.date-desc {
  padding: 0 14px 12px; font-size: 13px;
  color: rgba(255,255,255,.82); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.date-gallery { display: flex; }
.date-gallery img {
  flex: 1; min-width: 0; aspect-ratio: 3/4;
  object-fit: cover; display: block;
}

/* ── Game Tab (游戏) ── */
#game-section {
  background: var(--bg);
}
#game-section .section-scroll { overflow: hidden; padding: 0; }

.game-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.game-top h3 { font-size: 15px; font-weight: 700; }
.game-top a { font-size: 12px; color: var(--text2); }

.game-frame-wrap {
  width: 100%; height: calc(100vh - var(--tab-h) - 49px - var(--safe-bottom));
  overflow: hidden; position: relative;
}
.game-frame-wrap iframe {
  width: 100%; height: 100%; border: 0; display: block;
}

/* ── 游戏加载遮罩 ── */
.game-loader {
  position: absolute; inset: 0; z-index: 10;
  background: radial-gradient(ellipse at 50% 40%, #1c0f35 0%, #0a0612 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  transition: opacity .4s ease;
}
.game-loader.hidden { opacity: 0; pointer-events: none; }

.gl-coins {
  display: flex; gap: 16px; font-size: 38px;
}
@keyframes glCoinBounce {
  0%, 100% { transform: translateY(0) rotate(0deg);   opacity: 1; }
  50%       { transform: translateY(-14px) rotate(12deg); opacity: .8; }
}
.gl-coin { display: inline-block; }
.gl-coin:nth-child(1) { animation: glCoinBounce 1.1s ease-in-out infinite; }
.gl-coin:nth-child(2) { animation: glCoinBounce 1.1s ease-in-out infinite .22s; }
.gl-coin:nth-child(3) { animation: glCoinBounce 1.1s ease-in-out infinite .44s; }

.gl-bar-wrap {
  width: 160px; height: 4px; border-radius: 4px;
  background: rgba(255,215,0,.15); overflow: hidden;
}
@keyframes glBarSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.gl-bar {
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, #ffd700, #ff9500, transparent);
  border-radius: 4px;
  animation: glBarSlide 1.3s ease-in-out infinite;
}

.gl-txt {
  font-size: 15px; font-weight: 700;
  color: #ffd700; letter-spacing: .5px;
}
.gl-sub {
  font-size: 12px; color: rgba(255,215,0,.4);
  margin-top: -10px;
}

/* ── Shop Tab (情趣商城) ── */
.shop-header {
  padding: 16px 14px 10px; display: flex; align-items: baseline; gap: 8px;
}
.shop-title-cn {
  font-size: 20px; font-weight: 800; color: #22c55e;
}
.shop-title-en {
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,.55); letter-spacing: .04em;
}
.shop-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 0 10px 80px;
}
.shop-card {
  background: var(--card); border-radius: 12px;
  overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); transition: transform .13s;
}
.shop-card:active { transform: scale(.96); }
.shop-img {
  width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--bg3);
}
.shop-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.shop-body { padding: 8px 9px 10px; }
.shop-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.4; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.shop-price {
  margin-top: 6px; font-size: 18px; font-weight: 800; color: #22c55e;
}
.shop-price span { font-size: 13px; font-weight: 600; }
.shop-sales {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
}
.shop-sold { font-size: 11px; color: var(--text3); }
.shop-review { font-size: 11px; color: var(--text3); text-align: right; }

/* ── Live Tab (直播) ── */
.live-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 10px;
}
.live-card {
  background: var(--card); border-radius: 12px;
  overflow: hidden; cursor: pointer; position: relative;
  transition: transform .15s; border: 1px solid var(--border);
}
.live-card:active { transform: scale(.97); }
.live-thumb {
  position: relative; aspect-ratio: 3/4; overflow: hidden;
  background: var(--bg3);
}
.live-thumb img { width: 100%; height: 100%; object-fit: cover; }
.live-badge {
  position: absolute; top: 7px; left: 7px;
  background: #e91e8c; color: #fff; font-size: 10px;
  font-weight: 700; padding: 2px 7px; border-radius: 4px;
  display: flex; align-items: center; gap: 3px;
}
.live-badge::before {
  content: ''; width: 5px; height: 5px; background: #fff;
  border-radius: 50%; animation: blink 1.2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.live-viewers {
  position: absolute; bottom: 7px; right: 7px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 10px;
  padding: 2px 6px; border-radius: 10px;
}
.live-info { padding: 8px 10px 10px; }
.live-name { font-size: 13px; font-weight: 600; color: var(--text); }
.live-sub { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ── Mine Tab (我的) ── */
.mine-hero {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  padding: 32px 20px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.mine-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg,#e91e8c,#9b59b6);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff;
  box-shadow: 0 4px 20px rgba(233,30,140,.4);
  overflow: hidden;
}
.mine-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mine-username { font-size: 18px; font-weight: 700; color: #fff; }
.mine-id { font-size: 12px; color: rgba(255,255,255,.5); }
.mine-stats {
  display: flex; gap: 24px; margin-top: 8px;
}
.mine-stat { text-align: center; }
.mine-stat .num { font-size: 18px; font-weight: 700; color: #fff; }
.mine-stat .lbl { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }

.mine-vip-card {
  margin: 14px; background: linear-gradient(90deg,#e91e8c22,#9b59b622);
  border: 1px solid #e91e8c44; border-radius: 14px;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
}
.mine-vip-card .vip-info h4 { font-size: 14px; font-weight: 700; color: #e91e8c; }
.mine-vip-card .vip-info p { font-size: 12px; color: var(--text3); margin-top: 3px; }
.mine-vip-card .vip-btn {
  background: linear-gradient(90deg,#e91e8c,#9b59b6);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 18px; border-radius: 20px;
}

.mine-menu {
  margin: 0 14px; background: var(--card); border-radius: 14px;
  overflow: hidden; border: 1px solid var(--border);
}
.mine-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.mine-menu-item:last-child { border-bottom: 0; }
.mine-menu-item:active { background: var(--bg3); }
.mine-menu-item .mico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.mine-menu-item .mtxt { flex: 1; }
.mine-menu-item .mtxt h5 { font-size: 14px; font-weight: 600; }
.mine-menu-item .mtxt p { font-size: 12px; color: var(--text3); margin-top: 2px; }
.mine-menu-item .marr { color: var(--text3); font-size: 16px; }

/* ── Video Detail Page ── */
.detail-video-wrap {
  background: #000; position: relative; width: 100%;
  aspect-ratio: 16/9;
}
.detail-video-wrap iframe {
  width: 100%; height: 100%; border: 0;
}
.detail-video-wrap video {
  width: 100%; height: 100%; display: block;
}
.detail-back {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
  font-size: 14px; cursor: pointer;
}
.detail-title-wrap { padding: 14px 14px 10px; }
.detail-title-wrap h2 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.detail-meta-row {
  display: flex; gap: 10px; margin-top: 8px;
  flex-wrap: wrap;
}
.detail-meta-row span { font-size: 12px; color: var(--text3); }

.related-head {
  padding: 14px 14px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.related-head h3 { font-size: 15px; font-weight: 700; }

/* ── Loading skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Toast ── */
#toast {
  position: fixed; bottom: calc(var(--tab-h) + 20px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,40,.95); color: var(--text);
  padding: 10px 18px; border-radius: 24px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s;
  z-index: 9999; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Scrollbar ── */
.section-scroll::-webkit-scrollbar { width: 0; }

/* ── Image lazy load ── */
img[data-src] { opacity: 0; }
img.loaded { opacity: 1; transition: opacity .3s; }

/* ── Video search/list page ── */
.page-top {
  display: flex; align-items: center; padding: 10px 12px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  gap: 10px;
}
.page-top .back-btn {
  font-size: 20px; color: var(--text2); padding: 4px;
  flex-shrink: 0;
}
.page-top h3 { font-size: 16px; font-weight: 700; }

/* Pagination */
.wp-page {
  padding: 14px; display: flex; justify-content: center;
  align-items: center; gap: 8px; flex-wrap: wrap;
}
.wp-page a, .wp-page span {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 13px;
  background: var(--card); color: var(--text2);
  border: 1px solid var(--border);
}
.wp-page a.cur, .wp-page span.cur { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Date/Live top bar ── */
.feed-topbar {
  display: flex; align-items: center; padding: 12px 14px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  gap: 10px; position: sticky; top: 0; z-index: 10;
}
.feed-topbar h3 { font-size: 16px; font-weight: 700; flex: 1; }
.feed-topbar .refresh-btn {
  font-size: 12px; color: var(--text3); cursor: pointer;
  padding: 4px 10px; background: var(--bg3); border-radius: 20px;
}

/* ── 桌面光晕边框（body 比 html 窄时可见） ── */
@media (min-width: 461px) {
  body {
    box-shadow:
      0 0 0 1px rgba(255,255,255,.06),
      0 0 60px rgba(233,30,140,.10),
      0 0 100px rgba(155,89,182,.06);
  }
}

/* ── Tab 图标弹跳动画 ── */
@keyframes tabBounce {
  0%   { transform: scale(.72) translateY(2px); }
  60%  { transform: scale(1.18) translateY(-2px); }
  100% { transform: scale(1)   translateY(0); }
}
.tab-item.active svg,
.tab-item.active .tab-ico { animation: tabBounce .32s cubic-bezier(.34,1.56,.64,1); }

/* ── Tab 点击波纹 ── */
.tab-item { position: relative; overflow: hidden; }
@keyframes tabRipple { to { transform: scale(3.5); opacity: 0; } }
.tab-ripple {
  position: absolute; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(233,30,140,.22);
  transform: scale(0); pointer-events: none;
  animation: tabRipple .42s ease-out forwards;
  margin-left: -14px; margin-top: -14px;
}

/* ── 页面跳转过渡遮罩 ── */
#page-transition {
  position: fixed; inset: 0; z-index: 99999;
  background: #0f0f13; opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
#page-transition.go { opacity: 1; pointer-events: all; }

/* ── 自定义确认弹窗 ── */
#custom-confirm-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 99997; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity .2s;
}
#custom-confirm-mask.show { opacity: 1; }
#custom-confirm-box {
  background: #1e1e28; border-radius: 18px; padding: 26px 20px 20px;
  width: 100%; max-width: 290px; text-align: center;
  transform: scale(.9); transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
#custom-confirm-mask.show #custom-confirm-box { transform: scale(1); }
#custom-confirm-box p { font-size: 15px; color: #f0f0f5; line-height: 1.5; margin-bottom: 20px; }
#custom-confirm-box .cb-row { display: flex; gap: 10px; }
#custom-confirm-box .cb-cancel {
  flex: 1; padding: 12px; background: #2a2a38; border: 0; border-radius: 12px;
  color: #a0a0b8; font-size: 14px; cursor: pointer;
}
#custom-confirm-box .cb-ok {
  flex: 1; padding: 12px;
  background: linear-gradient(90deg,#e91e8c,#9b59b6);
  border: 0; border-radius: 12px; color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
}

/* ── 我的 Tab 签到红点 ── */
.tab-badge {
  position: absolute; top: 4px; right: calc(50% - 16px);
  width: 7px; height: 7px; border-radius: 50%;
  background: #f43f5e; border: 1.5px solid #16161e;
  display: none;
}
.tab-badge.show { display: block; }


/* ── 直播人数刷新动画 ── */
@keyframes numFlash { 0%{opacity:.5;transform:translateY(-4px)} 100%{opacity:1;transform:none} }
.num-flash { animation: numFlash .25s ease; }

/* ── 刷新按钮旋转动画 ── */
@keyframes spinOnce { to { transform: rotate(360deg); } }
.refresh-spinning { display: inline-block; animation: spinOnce .45s ease; }

/* ── 我的页 - 视频列表横滚 ── */
.mine-video-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding: 6px 14px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mine-video-scroll::-webkit-scrollbar { display: none; }
.mine-vc {
  flex: 0 0 110px; cursor: pointer; user-select: none;
  border-radius: 8px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
}
.mine-vc-thumb {
  width: 110px; height: 72px; position: relative;
  background: var(--bg3);
}
.mine-vc-thumb .play-badge {
  position: absolute; bottom: 50%; right: 50%;
  transform: translate(50%,50%);
  font-size: 13px; color: rgba(255,255,255,.8);
}
.mine-vc-name {
  font-size: 11px; color: var(--text2); padding: 5px 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4;
}

/* ══════════════════════════════════════
   Video Conter Page — All New Components
   ══════════════════════════════════════ */

/* ── Skeleton pulse ── */
@keyframes pulse {
  0%,100% { opacity: .4; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.08); }
}

/* ── Speed bar ── */
.speed-bar {
  display: flex; align-items: center; gap: 5px;
  background: #0f0f13; border-bottom: 1px solid #1e1e2c;
  padding: 6px 10px;
}
.speed-label {
  font-size: 11px; color: #606078; flex-shrink: 0;
  margin-right: 4px;
}
.speed-btn {
  flex: 1; border: 1px solid #2a2a38; background: #1a1a24;
  color: #a0a0b8; font-size: 11px; font-weight: 600;
  padding: 5px 2px; border-radius: 6px; cursor: pointer;
  transition: all .15s;
}
.speed-btn.active {
  background: linear-gradient(135deg, #e91e8c, #9b59b6);
  color: #fff; border-color: transparent;
}

/* ── Video info block ── */
.vd-info { padding: 12px 14px 8px; }
.vd-title {
  font-size: 15px; font-weight: 700; line-height: 1.45;
  color: var(--text);
}
.vd-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12px; color: #a0a0b8;
}
.vd-meta-link { color: #a0a0b8; }

/* ── Tags ── */
.vd-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.vd-tag {
  font-size: 11px; color: var(--accent);
  background: rgba(233,30,140,.1); border: 1px solid rgba(233,30,140,.2);
  padding: 3px 9px; border-radius: 20px; cursor: pointer;
}

/* ── Action row ── */
.vd-actions {
  display: flex; gap: 6px; margin-top: 12px;
}
.vd-act-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 8px 2px; border-radius: 10px; cursor: pointer;
  border: 1px solid #2a2a38; background: #1a1a24;
  font-size: 0; transition: background .15s, transform .12s;
  text-decoration: none; position: relative; overflow: visible;
}
.vd-act-btn:active { transform: scale(.93); }
.vd-act-btn.active { background: #2a1a2a; border-color: var(--accent); }
.vd-act-ico { font-size: 18px; line-height: 1; }
.vd-act-lbl { font-size: 10px; color: #a0a0b8; font-weight: 500; }
.vd-act-btn--casino {
  background: linear-gradient(135deg, #2a1060, #4a0a2a);
  border-color: transparent;
}
.vd-act-btn--casino .vd-act-lbl { color: #e0b0ff; }

/* ── Like heart burst ── */
@keyframes heartPop {
  0%   { opacity: 1; transform: translateY(0) translateX(var(--dx, 0)) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) translateX(var(--dx, 0)) scale(.5); }
}

/* ── Limit notice ── */
.vd-limit-notice {
  margin: 0 14px 10px;
  background: rgba(233,30,140,.08); border: 1px solid rgba(233,30,140,.2);
  border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #ccc; gap: 8px;
}
.vd-limit-link { color: #e91e8c; font-weight: 600; white-space: nowrap; }

/* ── Jackpot divider ── */
.jp-divider {
  height: 2px; margin: 8px 0;
  background: linear-gradient(90deg,transparent 0%,#b04000 15%,#ffd700 50%,#b04000 85%,transparent 100%);
  background-size: 200%; animation: jpShine 2s linear infinite;
}

/* ── Comment section ── */
.cmt-section {
  margin: 8px 0; border-top: 1px solid #1e1e2c;
  padding: 12px 14px 4px;
}
.cmt-hd {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.cmt-hd-title { font-size: 14px; font-weight: 700; }
.cmt-hd-count {
  font-size: 12px; color: #606078; background: #1a1a24;
  padding: 1px 8px; border-radius: 10px;
}
.cmt-input-wrap {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.cmt-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #1e1e28; display: flex; align-items: center;
  justify-content: center; font-size: 16px; flex-shrink: 0;
}
.cmt-input {
  flex: 1; background: #1a1a24; border: 1px solid #2a2a38;
  border-radius: 20px; padding: 8px 14px; color: #f0f0f5;
  font-size: 13px; outline: none;
}
.cmt-input:focus { border-color: var(--accent); }
.cmt-send {
  background: linear-gradient(135deg, #e91e8c, #9b59b6);
  color: #fff; border: none; border-radius: 16px;
  padding: 7px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.cmt-item {
  padding: 10px 0; border-bottom: 1px solid #1a1a24;
}
.cmt-item:last-child { border-bottom: none; }
.cmt-item-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.cmt-emo {
  width: 30px; height: 30px; border-radius: 50%;
  background: #1e1e28; display: flex; align-items: center;
  justify-content: center; font-size: 14px; flex-shrink: 0;
}
.cmt-name { font-size: 12px; font-weight: 600; color: #c0c0d8; }
.cmt-time { font-size: 10px; color: #606078; margin-top: 1px; }
.cmt-text { font-size: 13px; color: #d0d0e8; line-height: 1.5; padding-left: 38px; }

/* ── Related horizontal scroll ── */
.rel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
}
.rel-hd-title { font-size: 14px; font-weight: 700; }
.rel-hd-more { font-size: 12px; color: #a0a0b8; }
.rel-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 0 14px 12px; scrollbar-width: none;
}
.rel-scroll::-webkit-scrollbar { display: none; }
.rel-card {
  flex-shrink: 0; width: 130px; cursor: pointer;
  border-radius: 10px; overflow: hidden;
  background: var(--card);
  transition: transform .15s;
}
.rel-card:active { transform: scale(.95); }
.rel-thumb {
  position: relative; aspect-ratio: 16/10;
  background: var(--bg3); overflow: hidden;
}
.rel-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.rel-play-ico {
  position: absolute; bottom: 4px; right: 5px;
  font-size: 9px; color: #fff;
  background: rgba(233,30,140,.82);
  padding: 1px 5px; border-radius: 3px;
}
.rel-watched {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.7);
  letter-spacing: .05em;
}
.rel-name {
  font-size: 11px; color: var(--text); padding: 5px 6px;
  line-height: 1.4; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Danmu ── */
.danmu-item {
  position: absolute; right: -200px; white-space: nowrap;
  font-size: 13px; font-weight: 600; pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.8), 0 0 8px rgba(0,0,0,.6);
  animation: danmuSlide 13s linear forwards;
}
@keyframes danmuSlide {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-100vw - 400px)); }
}

/* ── Mid-play floating banner ── */
.mid-banner {
  position: fixed; bottom: 66px; left: 50%;
  transform: translateX(-50%); width: min(440px,calc(100% - 24px));
  background: linear-gradient(135deg, #1a1060, #2a0a30);
  border: 1px solid rgba(233,30,140,.35);
  border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,.6);
  animation: slideUp .4s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
