/* 前站深色主题 - 参考移动端视频站布局 */
:root {
  --theme: #e94560;
  --theme2: #ff6b81;
  --bg: #0a0a0f;
  --card: #16161f;
  --card2: #1e1e2a;
  --text: #f5f5f7;
  --muted: #8b8b9a;
  --border: #2a2a38;
  --radius: 10px;
  --header-h: 56px;
  --ratio-ad-bar: 350 / 80;
  --ratio-hero: 356 / 152;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { border: none; background: none; cursor: pointer; color: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, #161622 0%, rgba(15,15,20,.95) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px 8px;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--theme);
  white-space: nowrap;
}
.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 20px;
  padding: 0 4px 0 12px;
  height: 36px;
  border: 1px solid var(--border);
  gap: 6px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}
.btn-search {
  flex-shrink: 0;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--theme), var(--theme2));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: opacity .2s ease, transform .2s ease;
}
.btn-search:active {
  opacity: .85;
  transform: scale(.96);
}
.stat-badge {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.cat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  scrollbar-width: none;
  transition: background .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}
.page-home .cat-nav-float,
.page-list .cat-nav-float,
.page-detail .cat-nav-float {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: rgba(10, 10, 15, .5);
  backdrop-filter: blur(8px);
}
.page-home .cat-nav-float.is-floating,
.page-list .cat-nav-float.is-floating,
.page-detail .cat-nav-float.is-floating {
  background: rgba(10, 10, 15, .92);
  backdrop-filter: blur(16px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-item {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  border: 1px solid transparent;
}
.cat-item.active {
  background: rgba(233,69,96,.15);
  color: var(--theme);
  border-color: rgba(233,69,96,.35);
  font-weight: 600;
}

.banner-wrap {
  padding: 0 12px 10px;
}
.banner-slide {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: var(--ratio-hero);
  background: var(--card);
}
.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.banner-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #444;
}
.banner-dots span.on { background: var(--theme); }

.ad-block {
  margin: 8px 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.ad-block img {
  width: 100%;
  display: block;
  aspect-ratio: var(--ratio-ad-bar);
  object-fit: cover;
}

.section-title {
  padding: 14px 12px 10px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.section-label::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--theme), transparent);
}
.section-label.hot::after { background: linear-gradient(90deg, #ff6b35, transparent); }
.section-label.new::after { background: linear-gradient(90deg, #4facfe, transparent); }
.section-title small { color: var(--muted); font-size: 12px; font-weight: 400; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 12px 20px;
}
.video-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.video-cover {
  position: relative;
  aspect-ratio: 16/10;
  background: #111;
}
.video-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.video-type-tag {
  position: absolute;
  left: 6px;
  top: 6px;
  background: linear-gradient(135deg, var(--theme), #c73659);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-info { padding: 8px; }
.video-title {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.video-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.load-more {
  display: block;
  width: calc(100% - 24px);
  margin: 0 auto 24px;
  padding: 10px;
  text-align: center;
  background: var(--card2);
  border-radius: var(--radius);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* 详情页 */
.player-wrap {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16/9;
}
.player-wrap video {
  width: 100%;
  height: 100%;
  background: #000;
}
.detail-body { padding: 12px; }
.detail-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.detail-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}
.detail-desc {
  color: #bbb;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
}
.resume-tip {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.8);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 10;
  display: none;
}
.resume-tip.show { display: flex; gap: 12px; align-items: center; }
.resume-tip button {
  background: var(--theme);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.back-bar .back {
  color: var(--theme);
  font-size: 14px;
}

.empty-tip {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

/* 弹窗广告 */
.popup-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.popup-mask.show { display: flex; }
.popup-box {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--card);
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}
.popup-close {
  position: absolute;
  right: 0;
  top: -44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  z-index: 3;
  transition: transform .2s ease;
}
.popup-close:active { transform: scale(.94); }
.popup-close-x {
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
}
.popup-close-txt { font-size: 13px; }
.popup-box img { max-height: 70vh; object-fit: contain; border-radius: 14px; }
.popup-link { display: block; }
.popup-content { padding: 16px; max-width: 320px; }

/* 首页顶部轮播 */
.hero-banner {
  position: relative;
  width: calc(100% - 24px);
  max-width: 100%;
  margin: 10px auto 14px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .06);
}
.hero-inner {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio-hero);
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .65s ease, transform 4.5s ease;
  z-index: 1;
}
.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}
.hero-slide a,
.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-slide img { object-fit: cover; }
.hero-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, .12) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  animation: heroShine 5s ease-in-out infinite;
}
@keyframes heroShine {
  0%, 75% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
.hero-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .35);
  border: none;
  padding: 0;
  transition: width .3s ease, background .3s ease;
}
.hero-dot.is-active {
  width: 18px;
  background: var(--theme);
}
.hero-progress {
  height: 2px;
  background: rgba(255, 255, 255, .15);
  border-radius: 2px;
  overflow: hidden;
}
.hero-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--theme), var(--theme2));
  animation: heroProgress 4.5s linear infinite;
}
@keyframes heroProgress {
  from { width: 0; }
  to { width: 100%; }
}

/* 首页快捷入口（两排） */
.ad-grid-9 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 10px;
  padding: 4px 12px 18px;
}
.ad-grid9-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  transition: transform .2s ease;
}
.ad-grid9-item.anim-in {
  animation: gridFadeIn .45s ease backwards;
  animation-delay: calc(var(--i, 0) * 0.04s);
}
@keyframes gridFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ad-grid9-item:active { transform: scale(.94); }
.ad-grid9-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.ad-grid9-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.ad-grid9-item:active .ad-grid9-thumb img { transform: scale(1.05); }
.ad-grid9-name {
  width: 100%;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1px;
}
.ad-grid9-item:active .ad-grid9-name { color: var(--text); }

.home-block { margin-bottom: 4px; }
.section-icon { font-size: 15px; }
.section-more {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: color .2s, border-color .2s;
}
.section-more:active {
  color: var(--theme);
  border-color: rgba(233, 69, 96, .35);
}
.video-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 12px;
}
.video-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-bottom: 14px;
}
.video-grid-3 .video-card,
.video-grid-2 .video-card {
  transition: transform .2s ease;
}
.video-grid-3 .video-card:active,
.video-grid-2 .video-card:active { transform: scale(.97); }
.video-grid-3 .video-title,
.video-grid-2 .video-title {
  font-size: 12px;
  min-height: 32px;
}
.video-grid-3 .video-info,
.video-grid-2 .video-info { padding: 6px; }
.video-grid-3 .video-cover,
.video-grid-2 .video-cover { aspect-ratio: 16 / 11; }

.ad-section-bar {
  display: block;
  margin: 8px 12px 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  transition: transform .2s ease;
}
.ad-section-bar:active { transform: scale(.98); }
.ad-section-bar img {
  width: 100%;
  display: block;
  aspect-ratio: var(--ratio-ad-bar);
  object-fit: cover;
}

.page-spacer { height: 110px; }

/* 底部浮动条 */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  padding: 0 12px calc(8px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 15, .75) 40%, rgba(10, 10, 15, .95) 100%);
}
.bottom-bar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 16px 16px 0 0;
  background: rgba(22, 22, 31, .96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-bottom: none;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.bottom-contact {
  pointer-events: auto;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 14px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  background: rgba(22, 22, 31, .96);
  border: 1px solid rgba(255, 255, 255, .08);
  border-top: none;
  border-radius: 0 0 16px 16px;
  backdrop-filter: blur(20px);
}
.bottom-contact a {
  color: var(--theme2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.page-footer-info {
  max-width: 520px;
  margin: 0 auto 20px;
  padding: 0 12px;
}
.page-footer-info .bottom-contact {
  position: static;
  border-radius: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.bottom-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.bottom-logo {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--theme), #9b59b6);
  box-shadow: 0 4px 12px rgba(233, 69, 96, .35);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(233, 69, 96, .35); }
  50% { box-shadow: 0 4px 20px rgba(233, 69, 96, .55); }
}
.bottom-bar-info { min-width: 0; }
.bottom-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bottom-url {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-download {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--theme) 0%, var(--theme2) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(233, 69, 96, .45);
  animation: btnGlow 2.5s ease-in-out infinite;
  transition: transform .2s ease;
}
.btn-download:active { transform: scale(.95); }
.btn-download-icon {
  font-size: 14px;
  animation: btnBounce 2s ease-in-out infinite;
}
@keyframes btnGlow {
  0%, 100% { box-shadow: 0 4px 16px rgba(233, 69, 96, .45); }
  50% { box-shadow: 0 4px 24px rgba(233, 69, 96, .65); }
}
@keyframes btnBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

/* 回到顶部 */
button.back-top-btn {
  position: fixed;
  right: 16px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(233, 69, 96, .35);
  background: rgba(22, 22, 32, .78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-home button.back-top-btn {
  bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}
button.back-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
button.back-top-btn:active {
  background: rgba(233, 69, 96, .55);
  transform: scale(.92);
}
.back-top-icon {
  display: block;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}
