/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:root {
  --bg: #0c0c18;
  --bg-card: rgba(22, 22, 40, 0.75);
  --bg-card2: rgba(35, 35, 60, 0.6);
  --accent: #6366f1;
  --accent2: #ec4899;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-dim2: #64748b;
  --border: rgba(148, 163, 184, 0.15);
  --radius: 12px;
  --nav-h: 58px;
  --capsule-h: 36px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.15);
  --shadow-md: 0 4px 16px rgba(0,0,0,.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.25);
  --card-blur: blur(16px) saturate(180%);
  color-scheme: dark;
}
html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  overflow: hidden;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  display: flex; justify-content: center;
}
#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ========== 顶部导航栏 ========== */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 12, 24, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.top-bar .top-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.top-bar .top-logo-wrap {
  display: flex; align-items: center; gap: 8px;
}
.top-bar .logo {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 0.5px;
}
.top-bar .logo-img {
  height: 40px; width: auto; border-radius: 8px; object-fit: contain;
}
.top-bar .top-actions { display: flex; gap: 10px; align-items: center; }
.top-bar .top-actions .icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-card2); display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; border: 1px solid var(--border);
  transition: all .2s;
}
.top-bar .top-actions .icon-btn:active { transform: scale(.92); }
.top-bar .top-actions .download-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 20px;
  padding: 7px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
  transition: all .2s;
}
.top-bar .top-actions .download-btn:active { transform: scale(.95); box-shadow: 0 2px 6px rgba(99, 102, 241, .3); }
.top-nav-scroll {
  display: flex; overflow-x: auto; scroll-behavior: smooth;
  padding: 4px 12px 12px; gap: 8px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.top-nav-scroll::-webkit-scrollbar { display: none; }
.top-nav-item {
  flex-shrink: 0; padding: 6px 16px; border-radius: 20px;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
  background: var(--bg-card2); white-space: nowrap;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  border: 1px solid transparent;
}
.top-nav-item:active { transform: scale(.95); }
.top-nav-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
}

/* ========== 内容区 ========== */
.page-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 10px 0 calc(var(--nav-h) + var(--capsule-h) + 16px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: pageFadeIn .3s ease;
}
.page-content::-webkit-scrollbar { display: none; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 下拉刷新 ========== */
.pull-to-refresh {
  position: absolute;
  top: var(--top-bar-h, 48px);
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
  z-index: 5;
  transform: translateY(-50px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.pull-to-refresh .ptr-icon {
  font-size: 16px;
  transition: transform 0.2s;
}
.pull-to-refresh.refreshing .ptr-icon {
  animation: ptr-spin 1s linear infinite;
}
@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== 轮播广告 ========== */
.carousel {
  position: relative; width: calc(100% - 16px);
  height: 170px;
  overflow: hidden;
  margin: 8px 8px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.carousel-track {
  display: flex; height: 100%;
  transition: transform .4s ease;
}
.carousel-slide {
  flex: 0 0 100%; height: 100%; position: relative;
  text-decoration: none; color: inherit;
}
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-slide .caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 14px 10px;
  background: linear-gradient(0deg, rgba(0,0,0,.7), transparent);
  color: #fff; font-size: 14px; font-weight: 600;
}
.carousel-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.carousel-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.4); transition: all .3s;
}
.carousel-dots span.active { background: var(--accent); width: 18px; border-radius: 3px; }

/* ========== 九宫格广告（6个一行） ========== */
.grid9 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 12px 10px;
  background: var(--bg-card);
  margin-bottom: 8px;
  border-radius: 8px;
}
.grid9-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: transform .2s;
  text-decoration: none; color: inherit;
}
.grid9-item:active { transform: scale(.92); }
.grid9-item img {
  width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover;
  background: var(--bg-card2);
}
.grid9-item span {
  font-size: 11px; color: var(--text-dim); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}

/* ========== 横幅广告 70px ========== */
.banner-ad {
  height: 70px; width: 100%; overflow: hidden;
  margin-bottom: 8px; cursor: pointer; border-radius: 8px;
  display: block; text-decoration: none; color: inherit;
}
.banner-ad img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px; }

/* ========== 分类广告（左图+下方标题，右侧多个两行文字广告） ========== */
.category-ad {
  display: flex; gap: 12px; padding: 2px 12px;
  background: var(--bg-card);
  backdrop-filter: var(--card-blur, none);
  -webkit-backdrop-filter: var(--card-blur, none);
  margin-bottom: 10px;
  cursor: pointer; border-radius: var(--radius);
  align-items: stretch;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.category-ad:active { transform: scale(.98); box-shadow: var(--shadow-xs); }
.category-ad .cat-ad-left {
  width: 60px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px;
}
.category-ad .cat-ad-img {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden;
}
.category-ad .cat-ad-img img { width: 100%; height: 100%; object-fit: cover; }
.category-ad .cat-ad-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.category-ad .cat-ad-right {
  flex: 1; display: grid;
  gap: 5px; min-width: 0;
  align-content: center;
  grid-template-columns: repeat(1, 1fr);
}
.category-ad .cat-ad-text {
  padding: 5px; background: var(--bg-card2); border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: 12px;
  text-align: center;
  text-decoration: none; color: inherit;
}
.category-ad .cat-ad-text-line1 {
  font-size: 12px; color: var(--text); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.category-ad .cat-ad-text-line2 {
  font-size: 11px; color: var(--text-dim); margin-top: 3px;
}

/* ========== 视频板块 ========== */
.section {
  margin-bottom: 10px; background: var(--bg-card); padding: 10px 8px;
  overflow: hidden; border-radius: 8px;
}
.section {
  margin-bottom: 18px;
}
.section-header {
  display: flex; align-items: center; justify-content: flex-start;
  margin-bottom: 12px; padding: 0 4px; gap: 14px;
}
.section-title {
  font-size: 17px; font-weight: 800; position: relative; padding: 5px 18px 5px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
  border-radius: 4px 0 4px 0;
  box-shadow: 0 3px 10px rgba(99, 102, 241, .35);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.section-title::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: rgba(255,255,255,.35);
  border-radius: 2px;
}
/* 标题右侧文字广告 */
.title-text-ads {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-left: 8px;
}
.title-text-ad {
  font-size: 11px; cursor: pointer;
  padding: 4px 4px;
  border-radius: 5px; display: inline-flex; align-items: center; gap: 5px;
  max-width: calc(6em + 8px);
  word-break: break-all; overflow-wrap: anywhere;
  color: #fff; position: relative;
  background: var(--bg-card2);
  box-shadow: 0 2px 8px rgba(99,102,241,.35), 0 0 0 1px rgba(255,255,255,.08) inset;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  animation: adPulse 2.5s ease-in-out infinite;
  text-decoration: none;
}
@keyframes adPulse {
  0%,100% { box-shadow: 0 2px 8px rgba(99,102,241,.35), 0 0 0 1px rgba(255,255,255,.08) inset; }
  50% { box-shadow: 0 3px 14px rgba(236,72,153,.5), 0 0 0 1px rgba(255,255,255,.15) inset; }
}
.title-text-ad:active { transform: scale(.9); }
.title-text-ad:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(236,72,153,.55), 0 0 0 1px rgba(255,255,255,.2) inset;
  animation-play-state: paused;
}
/* 查看更多/换一换按钮 */
.video-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.video-actions button {
  padding: 6px 20px; font-size: 12px; border: none; border-radius: 16px;
  cursor: pointer; transition: all .2s;
  font-weight: 500;
}
.video-actions .btn-more {
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border);
}
.video-actions .btn-more:active { transform: scale(.95); background: var(--bg-card2); }
.video-actions .btn-shuffle {
  background: rgba(99, 102, 241, .12); color: var(--accent);
  border: 1px solid rgba(99, 102, 241, .3);
}
.video-actions .btn-shuffle:active { transform: scale(.95); }
.video-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  overflow: hidden;
  padding: 0 4px;
}
.video-grid-section .video-featured {
  grid-column: 1 / -1;
}
.video-cover-featured {
  aspect-ratio: 16/9 !important;
  height: 0 !important;
  padding-bottom: 56.25% !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-md);
}
.video-cover-featured img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  width: 100% !important;
  height: 100% !important;
}
.video-cover-featured .featured-title {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff; font-size: 14px; font-weight: 700;
  padding: 24px 12px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.video-card {
  cursor: pointer; overflow: hidden;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.video-card:active { transform: scale(.96); }
.video-card:active .video-cover { filter: brightness(1.1); }
.video-cover {
  position: relative; width: 100%; border-radius: 8px; overflow: hidden;
  background: var(--bg-card2);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s;
  /* 双重保险：aspect-ratio 为主，padding-bottom hack 兼容老移动端浏览器 */
  aspect-ratio: 2/3;
  height: 0;
  padding-bottom: 150%;
}
.video-card:active .video-cover { filter: brightness(1.1); box-shadow: var(--shadow-md); }
.video-cover img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
  opacity: 1;
}
@keyframes fadeInImg {
  from { opacity: 0; transform: scale(1.05); }
  to { opacity: 1; transform: scale(1); }
}
.video-cover .score {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, rgba(99,102,241,.9), rgba(236,72,153,.9));
  color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.video-cover .episode {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  backdrop-filter: blur(4px);
  font-weight: 500;
}
.video-cover .play-count {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  backdrop-filter: blur(4px);
}
.video-title {
  font-size: 12px; margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  color: var(--text);
  font-weight: 500;
}

/* ========== 底部导航 ========== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: var(--nav-h);
  background: rgba(12, 12, 24, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  display: flex; z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; color: var(--text-dim); font-size: 11px;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.bottom-nav .nav-item.active {
  color: var(--accent);
}
.bottom-nav .nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, .4));
}
.bottom-nav .nav-item .nav-icon {
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.bottom-nav .nav-item svg { width: 22px; height: 22px; fill: currentColor; }

/* ========== 胶囊广告（底部导航上方，居中药丸样式） ========== */
.capsule-ad {
  position: fixed; bottom: var(--nav-h); left: 50%; transform: translateX(-50%);
  max-width: 420px; height: var(--capsule-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 6px; z-index: 199;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    0 8px 28px rgba(229,57,53,0.25),
    0 2px 8px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.25);
  overflow: hidden;
}
.capsule-ad::before {
  content: '';
  position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,111,167,0.18), rgba(255,165,2,0.12));
  pointer-events: none;
}
.capsule-ad .capsule-icon {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; font-weight: 800;
  box-shadow: 0 0 10px rgba(229,57,53,0.6);
  animation: icon-pulse 2s ease-in-out infinite;
  position: relative; z-index: 1;
}
@keyframes icon-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(229,57,53,0.5); }
  50% { box-shadow: 0 0 16px rgba(229,57,53,0.8); }
}
.capsule-ad .capsule-track {
  flex: 1; height: 18px; overflow: hidden; position: relative; z-index: 1;
}
.capsule-ad .capsule-track-inner {
  display: flex; flex-direction: column;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.capsule-ad .capsule-item {
  height: 18px; line-height: 18px;
  font-size: 12.5px; color: var(--text); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
  text-decoration: none;
}
.capsule-ad .capsule-item .tag {
  color: var(--accent); font-weight: 700; margin-right: 6px;
  font-size: 11px;
}

/* ========== 悬浮广告 ========== */
.floating-ad {
  position: fixed; width: 60px; height: 60px; z-index: 150;
  will-change: transform;
}
.floating-ad img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.floating-close {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; line-height: 1;
}

/* ========== 搜索页 ========== */
.search-page { padding: 14px; }
.search-box {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.search-box input {
  flex: 1; padding: 10px 14px; border-radius: 22px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 14px; outline: none;
}
.search-box button {
  padding: 10px 18px; border-radius: 22px; border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff; font-size: 14px; cursor: pointer;
}
.search-hot h3 { font-size: 14px; margin-bottom: 10px; color: var(--text-dim); }
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-tag {
  padding: 6px 14px; border-radius: 14px; background: var(--bg-card);
  font-size: 12px; color: var(--text); cursor: pointer;
}

/* ========== 我的页 ========== */
.mine-page { padding: 14px; }
.mine-header {
  display: flex; align-items: center; gap: 14px;
  padding: 20px; background: var(--bg-card); border-radius: var(--radius);
  margin-bottom: 14px;
}
.mine-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
}
.mine-name { font-size: 18px; font-weight: 700; }
.mine-tip { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.menu-list { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .mi-left { display: flex; align-items: center; gap: 12px; }
.menu-item .mi-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg-card2); display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.menu-item .arrow { color: var(--text-dim2); }

/* 会员套餐 */
.member-promo {
  background: linear-gradient(135deg, #2c1810, #1a1a2e);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  border: 1px solid rgba(255, 193, 7, 0.3);
}
.member-promo-title {
  font-size: 15px; font-weight: 700; color: #ffc107;
  margin-bottom: 12px; text-align: center;
}
.member-packages {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.pkg-card {
  background: rgba(255,255,255,0.05); border-radius: 10px;
  padding: 12px; text-align: center; cursor: pointer;
  border: 1px solid rgba(255, 193, 7, 0.2);
  transition: transform 0.15s;
}
.pkg-card:active { transform: scale(0.96); }
.pkg-name { font-size: 13px; font-weight: 600; color: #ffc107; }
.pkg-price { font-size: 20px; font-weight: 800; color: #fff; margin: 4px 0; }
.pkg-dur { font-size: 11px; color: var(--text-dim); }
.member-vip-badge {
  background: linear-gradient(90deg, #ffc107, #ff9800);
  color: #1a1a2e; font-weight: 700; text-align: center;
  padding: 12px; border-radius: var(--radius); margin-bottom: 14px;
  font-size: 14px;
}

/* 试看限制弹窗 */
.trial-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.trial-modal-box {
  background: var(--bg-card); border-radius: 16px; padding: 28px 24px;
  max-width: 320px; width: 100%; text-align: center;
}
.trial-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.trial-modal-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.6; }
.trial-modal-btn {
  display: block; width: 100%; padding: 12px; border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 700; border: none; cursor: pointer; font-size: 15px;
}

/* ========== 分类页 ========== */
.category-page { padding: 14px; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.category-tab {
  padding: 6px 14px; border-radius: 14px; background: var(--bg-card);
  font-size: 13px; color: var(--text-dim); cursor: pointer;
}
.category-tab.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
}

/* ========== 管理后台入口 ========== */
.admin-entry {
  position: fixed; top: 12px; right: 12px; z-index: 300;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.4); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
}

/* ========== 管理后台页面 ========== */
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--bg-card);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.admin-logo { font-size: 18px; font-weight: 700; }
.admin-link { color: var(--accent2); text-decoration: none; font-size: 13px; }
.admin-layout {
  display: flex; min-height: calc(100vh - 53px);
}
.admin-sidebar {
  width: 200px; flex-shrink: 0; background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 0; position: sticky; top: 53px;
  height: calc(100vh - 53px); overflow-y: auto;
}
.admin-menu-group { margin-bottom: 8px; }
.admin-menu-group-title {
  padding: 10px 20px 6px; font-size: 11px; color: var(--text-dim2);
  text-transform: uppercase; letter-spacing: 1px;
}
.admin-menu-item {
  display: block; padding: 10px 20px; font-size: 13px;
  color: var(--text-dim); cursor: pointer; transition: all .15s;
  border-left: 3px solid transparent;
}
.admin-menu-item:hover { background: var(--bg-card2); color: var(--text); }
.admin-menu-item.active {
  background: var(--bg-card2); color: var(--accent);
  border-left-color: var(--accent); font-weight: 600;
}
.admin-main {
  flex: 1; padding: 20px; min-width: 0;
  overflow-x: auto;
}
.admin-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
}
/* 页面标题统一样式 */
.admin-page-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.admin-tab {
  padding: 7px 14px; border-radius: 16px; background: var(--bg-card);
  font-size: 13px; color: var(--text-dim); cursor: pointer;
}
.admin-tab.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600;
}
.admin-toolbar {
  display: flex; justify-content: flex-start; align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.filter-tabs {
  display: flex; gap: 4px;
  background: var(--bg-card2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.filter-tab {
  padding: 5px 14px; font-size: 12px; color: var(--text-dim);
  cursor: pointer; border-radius: 6px; transition: all .2s;
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}
.btn {
  padding: 7px 14px; border-radius: 6px; border: none; cursor: pointer;
  font-size: 13px; color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-success { background: #2ed573; color: #fff; }
.btn-primary { background: #3498db; color: #fff; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-sm + .btn-sm { margin-left: 4px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 22px; transition: .3s;
}
.switch span::before {
  position: absolute; content: ""; height: 16px; width: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .3s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }

/* 采集进度 */
.collect-progress { min-width: 100px; }
.collect-bar { width: 100px; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.collect-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.collect-count { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* 标签 */
.tag-success { background: rgba(46,213,115,.15); color: #2ed573; }

/* 表单网格 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .form-row:last-child { grid-column: 1 / -1; }
.table-wrap {
  background: var(--bg-card); border-radius: var(--radius); overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 600px; }
th, td {
  padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th { background: var(--bg-card2); color: var(--text-dim); font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: var(--bg-card2); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.tag-green { background: rgba(46,213,115,.15); color: #2ed573; }
.tag-red { background: rgba(231,76,60,.15); color: #e74c3c; }
.tag-orange { background: rgba(255,165,2,.15); color: var(--accent2); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 500;
  padding: 16px;
}
.modal {
  background: var(--bg-card); border-radius: var(--radius);
  width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto;
  padding: 18px;
}
.modal-wide { max-width: 860px; }
.modal h3 { margin-bottom: 14px; font-size: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 13px; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--accent); }

/* 通用 select 样式（工具栏、表格内） */
select {
  padding: 7px 30px 7px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 13px; outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 10px center;
}
select:focus { border-color: var(--accent); }
/* 通用 input 样式（工具栏、表格内） */
input[type="text"], input[type="date"], input[type="number"], input[type="url"], input[type="search"] {
  padding: 7px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 13px; outline: none;
}
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus, input[type="url"]:focus, input[type="search"]:focus {
  border-color: var(--accent);
}
/* 日期选择器日历图标提亮（深色背景下看清） */
input[type="date"] {
  color-scheme: dark;
  /* 在输入框右侧叠加白色日历图标 */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
/* 原生日历图标设为透明但保留点击区域 */
input[type="date"]::-webkit-calendar-picker-indicator {
  -webkit-appearance: none;
  appearance: none;
  background: transparent !important;
  border: none;
  opacity: 0 !important;
  cursor: pointer;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ========== 渠道统计弹窗 ========== */
.ch-stats-modal { width: 100%; }
.ch-stats-head { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.ch-stats-title { font-size: 16px; font-weight: 600; }
.ch-stats-summary {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 20px;
  background: var(--bg-card2); border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
.ch-stat-item { display: flex; flex-direction: column; gap: 4px; }
.ch-stat-item label { font-size: 12px; color: var(--text-dim2); }
.ch-stat-item span { font-size: 14px; font-weight: 600; color: var(--text); }
.ch-stats-detail-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.ch-stats-table-wrap { max-height: 350px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.ch-stats-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ch-stats-table th { background: var(--bg-card2); padding: 8px; text-align: center; font-weight: 600; color: var(--text-dim); position: sticky; top: 0; }
.ch-stats-table td { padding: 8px; border-top: 1px solid var(--border); color: var(--text); text-align: center; }
.ch-stats-footer {
  display: flex; align-items: center; gap: 16px; margin-top: 14px;
  justify-content: flex-end;
}
.ch-stats-total { font-size: 12px; color: var(--text-dim2); }
.ch-stats-pager { display: flex; align-items: center; gap: 6px; }
.ch-page-btn {
  width: 28px; height: 28px; border: 1px solid var(--border); background: var(--bg-card);
  border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--text-dim);
}
.ch-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.ch-page-cur {
  min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 4px; font-size: 12px; font-weight: 600;
}

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--text-dim2); font-size: 13px; }

/* 可排序表头 */
.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sortable:hover { color: var(--accent); }
.th-sortable:active { color: var(--accent2); }

/* 所有表格内容居中 */
.data-table th, .data-table td { text-align: center; }
.data-table td { vertical-align: middle; }
.empty-cell { text-align: center; padding: 30px; color: var(--text-dim2); }

/* 广告列表列宽 */
.col-title { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center !important; }
.col-link { max-width: 360px; text-align: center !important; }
.col-link .ad-link {
  display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle; color: var(--accent2); font-size: 11px;
  text-decoration: none;
}
.col-link .ad-link:hover { text-decoration: underline; }
.col-link .ad-link.link-invalid { color: #e74c3c; }
.col-link .ad-link.link-valid { color: #27ae60; }
.link-check-btn {
  padding: 2px 6px !important; font-size: 11px !important; min-width: 24px;
  margin-left: 4px; vertical-align: middle;
}

/* 筛选栏 */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px;
  background: var(--bg-card2); border-radius: var(--radius); margin-bottom: 10px;
  align-items: center;
}
.filter-select, .filter-input {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 12px; background: var(--bg-card); color: var(--text);
}
.filter-input { width: 120px; }
.filter-input::placeholder { color: var(--text-dim2); }

/* 批量操作栏 */
.batch-ops {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: #eaf2fd; border-radius: 4px; flex-wrap: wrap;
}

/* 行内可编辑单元格 */
.td-editable {
  cursor: pointer; transition: background 0.15s;
}
.td-editable:hover {
  background: var(--bg-card2);
  text-decoration: underline;
}
.input-sm {
  width: 100px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-card2);
  color: var(--text); font-size: 13px;
}
.input-sm:focus { outline: none; border-color: var(--accent); }
.input-sm:disabled { opacity: 0.5; cursor: not-allowed; }

/* 状态切换按钮 */
.tag-toggle {
  cursor: pointer;
  transition: opacity 0.15s;
  user-select: none;
}
.tag-toggle:hover { opacity: 0.75; }

/* ========== 分页 ========== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; margin-top: 8px; flex-wrap: wrap;
}
.page-btn {
  padding: 5px 12px; border: 1px solid var(--border); background: var(--bg-card);
  border-radius: 4px; cursor: pointer; font-size: 12px; color: var(--text-dim);
}
.page-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.page-btn.page-btn-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-info { font-size: 13px; color: var(--text-dim); }
.page-size-select {
  padding: 5px 8px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); border-radius: 4px; font-size: 12px; cursor: pointer;
}

/* ========== 渠道表固定列 + 固定表头 ========== */
.channel-table-wrap {
  overflow: auto; max-height: 60vh; position: relative;
}
#tbl-channel thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-card2);
}
/* 固定左侧列：ID(0), 渠道名(1), 渠道码(2) */
#tbl-channel .col-fixed-1 { position: sticky; left: 0; z-index: 5; background: var(--bg-card); min-width: 50px; }
#tbl-channel .col-fixed-2 { position: sticky; left: 50px; z-index: 5; background: var(--bg-card); min-width: 100px; }
#tbl-channel .col-fixed-3 { position: sticky; left: 150px; z-index: 5; background: var(--bg-card); min-width: 80px; }
/* 固定右侧操作列 */
#tbl-channel .col-fixed-ops { position: sticky; right: 0; z-index: 5; background: var(--bg-card); min-width: 200px; }
/* 表头固定列需要更高层级 */
#tbl-channel thead .col-fixed-1,
#tbl-channel thead .col-fixed-2,
#tbl-channel thead .col-fixed-3,
#tbl-channel thead .col-fixed-ops { z-index: 15; background: var(--bg-card2); }

/* 汇总行 */
.summary-row {
  background: var(--bg-card2) !important; font-weight: 600;
  border-top: 2px solid var(--accent);
}
.summary-row td { color: var(--text); }
.summary-row .col-fixed-1,
.summary-row .col-fixed-2,
.summary-row .col-fixed-3,
.summary-row .col-fixed-ops { background: var(--bg-card2) !important; }

/* ========== 页面模块标签页 ========== */
.pm-tabs {
  display: flex; gap: 4px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.pm-tab {
  padding: 8px 18px; font-size: 13px; color: var(--text-dim);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.pm-tab:hover { color: var(--text); }
.pm-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
  font-weight: 600;
}
.pm-tab-group { margin-bottom: 12px; }
.pm-tab-group-title {
  font-size: 12px; color: var(--text-dim2); margin-bottom: 4px; font-weight: 600;
}

/* 视频板块底部操作栏 */
.video-section-actions {
  display: flex; justify-content: center; gap: 12px;
  padding: 8px 0 4px;
}
.video-section-actions button {
  padding: 6px 20px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--bg-card2); color: var(--text-dim);
  cursor: pointer; transition: all .2s;
}
.video-section-actions button:hover {
  border-color: var(--accent); color: var(--accent);
}

/* ========== 播放器页面 ========== */
.player-page { padding-bottom: 16px; }
.player-back {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; font-size: 14px; color: var(--text); cursor: pointer;
  background: var(--bg-card);
  backdrop-filter: var(--card-blur, none);
  -webkit-backdrop-filter: var(--card-blur, none);
  border-bottom: 1px solid var(--border);
  transition: background .2s;
  font-weight: 500;
}
.player-back:active { background: var(--bg-card2); }
.player-back-icon {
  font-size: 20px; font-weight: 700; line-height: 1;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card2); border-radius: 50%;
}
.player-back-text { line-height: 1; }
.player-wrap {
  position: relative; width: 100%; background: #000;
  aspect-ratio: 16/9; overflow: hidden;
}
.player-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-center-play {
  position: absolute; inset: 0; margin: auto;
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer; z-index: 2;
}
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 28px 12px 10px; z-index: 3;
  transition: opacity .3s;
}
.pc-progress {
  position: relative; height: 14px; cursor: pointer;
  display: flex; align-items: center;
}
.pc-progress::before {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,.25); border-radius: 2px;
}
.pc-progress-buffered, .pc-progress-played {
  position: absolute; left: 0; height: 3px; border-radius: 2px;
}
.pc-progress-buffered { background: rgba(255,255,255,.4); }
.pc-progress-played { background: var(--accent); }
.pc-progress-thumb {
  position: absolute; top: 50%; width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.pc-row {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
}
.pc-btn {
  background: transparent; border: none; color: #fff;
  font-size: 16px; cursor: pointer; padding: 4px;
}
.pc-time { color: #fff; font-size: 12px; }
.pc-spacer { flex: 1; }
.pc-speed, .pc-quality {
  background: rgba(0,0,0,.5); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px; font-size: 12px; padding: 3px 6px; outline: none;
}
.player-info { padding: 14px; }
.player-title { font-size: 18px; margin-bottom: 8px; }
.player-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.player-score { color: var(--accent2); font-weight: 700; }
.player-desc { font-size: 13px; line-height: 1.6; color: var(--text-dim); }

.player-episodes { padding: 0 14px; }
.episode-list {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.ep-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 0; text-align: center;
  font-size: 12px; cursor: pointer; transition: all .2s;
}
.ep-item.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.ep-item:hover { border-color: var(--accent); }

/* 全屏时播放器撑满 */
.player-wrap:fullscreen video, .player-wrap:-webkit-full-screen video { width: 100%; height: 100%; }

/* 响应式 */
@media (min-width: 768px) {
  .grid9 { grid-template-columns: repeat(6, 1fr); }
}

/* 图片管理 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.image-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.image-card img {
  width: 100%;
  height: 172px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.image-card.pickable { cursor: pointer; transition: border-color .2s; }
.image-card.pickable:hover { border-color: var(--accent); }
.image-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}
.image-pager button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.image-info { padding: 8px; }
.image-name {
  font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.image-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.image-actions {
  display: flex; gap: 6px; padding: 0 8px 8px;
}
/* 图片管理布局 */
.image-manage-wrap {
  display: flex;
  gap: 16px;
  height: calc(100vh - 100px);
}
.image-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-y: auto;
}
.image-sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.image-folder-list { display: flex; flex-direction: column; gap: 4px; }
.image-folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  position: relative;
}
.image-folder-item:hover { background: rgba(148, 163, 184, 0.1); }
.image-folder-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}
.folder-icon { font-size: 16px; }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.15);
  padding: 2px 6px;
  border-radius: 10px;
}
.image-folder-item.active .folder-count {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent);
}
.folder-actions {
  display: none;
  gap: 4px;
  position: absolute;
  right: 4px;
  background: var(--bg-card);
  padding: 0 4px;
}
.image-folder-item:hover .folder-actions { display: flex; }
.folder-action-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
}
.folder-action-btn:hover { background: rgba(148, 163, 184, 0.2); }
.image-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.image-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.image-toolbar-right { display: flex; align-items: center; }
/* 图片选择框 */
.image-card { position: relative; }
.image-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.image-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
  border: 2px solid rgba(255,255,255,0.8);
}
.image-card.selected .image-check {
  background: var(--accent);
  border-color: var(--accent);
}
/* 图片选择器弹窗 */
.picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.picker-grid {
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px;
}
.picker-grid .image-card {
  height: auto;
}
.picker-grid .image-card img {
  height: 100px;
}
.picker-grid .image-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.picker-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.btn-danger { background: #e53935; color: #fff; border: 1px solid #e53935; }
.btn-danger:hover { background: #c62828; }

/* 图标选择器 */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--bg);
}
.icon-pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.icon-pick-item svg {
  width: 22px; height: 22px;
  fill: var(--text-dim);
  transition: fill .15s;
}
.icon-pick-item .icon-pick-label {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.icon-pick-item:hover {
  background: var(--bg-card);
  border-color: var(--border);
}
.icon-pick-item.active {
  border-color: var(--accent);
  background: rgba(229,57,53,0.08);
}
.icon-pick-item.active svg { fill: var(--accent); }
.icon-pick-item.active .icon-pick-label { color: var(--accent); font-weight: 600; }

/* 数据看板 */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.dash-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
}
.dash-card-value { font-size: 26px; font-weight: 700; color: var(--text); }
.dash-card-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.dash-card-sub { font-size: 11px; color: var(--text-dim2); margin-top: 2px; }
.dash-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
}
.dash-panel-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.trend-chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 180px; padding-top: 10px;
}
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.trend-bar {
  width: 70%; background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 4px 4px 0 0; min-height: 4px; transition: height .3s;
}
.trend-label { font-size: 10px; color: var(--text-dim); margin-top: 6px; }
.type-list { display: flex; flex-direction: column; gap: 10px; }
.type-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.type-row > span:first-child { width: 60px; color: var(--text-dim); }
.type-bar { flex: 1; height: 18px; background: var(--bg); border-radius: 9px; overflow: hidden; }
.type-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 9px; }
.type-row > span:last-child { width: 30px; text-align: right; font-weight: 600; }

/* 排行列表 */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; background: var(--bg); border-radius: 6px; font-size: 13px;
}
.rank-no {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--text-dim2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.rank-no.top { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.rank-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--bg-card); border-radius: var(--radius);
  width: 420px; max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.modal-title {
  padding: 16px 20px; font-weight: 600; font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.modal-body {
  padding: 20px; overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.btn-secondary { background: var(--bg-card2); color: var(--text); }

/* 表单组 */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px; font-size: 13px;
  color: var(--text-dim); font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--text);
  font-size: 13px; box-sizing: border-box;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-group input:disabled { opacity: .5; cursor: not-allowed; }

/* 支付弹窗 */
.pay-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.pay-modal-box {
  background: #fff; border-radius: 16px;
  width: 360px; max-width: 90vw;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.pay-modal-title {
  padding: 18px 20px; font-size: 16px; font-weight: 600;
  text-align: center; color: #333; position: relative;
  border-bottom: 1px solid #f0f0f0;
}
.pay-modal-close {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 24px; color: #999; cursor: pointer; line-height: 1;
}
.pay-modal-close:hover { color: #333; }
.pay-modal-body { padding: 20px; }
.pay-product-info {
  text-align: center; padding: 16px 0 20px;
  border-bottom: 1px solid #f0f0f0; margin-bottom: 16px;
}
.pay-product-name { font-size: 18px; font-weight: 600; color: #333; }
.pay-product-desc { font-size: 13px; color: #999; margin-top: 4px; }
.pay-product-price {
  font-size: 32px; font-weight: 700; color: #ff4d4f;
  margin-top: 12px;
}
.pay-method-title {
  font-size: 14px; color: #666; margin-bottom: 12px; font-weight: 500;
}
.pay-method-list { display: flex; flex-direction: column; gap: 10px; }
.pay-method-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 2px solid #e8e8e8;
  border-radius: 10px; cursor: pointer;
  transition: all .2s;
}
.pay-method-item:hover { border-color: #d9d9d9; }
.pay-method-item.active {
  border-color: #1890ff; background: #f0f7ff;
}
.pay-method-item input { display: none; }
.pay-icon { font-size: 24px; }
.pay-name { flex: 1; font-size: 14px; color: #333; font-weight: 500; }
.pay-method-item.active .pay-name { color: #1890ff; }
.pay-modal-footer {
  padding: 12px 20px 20px;
  display: flex; gap: 10px;
}
.pay-cancel-btn {
  flex: 1; padding: 12px; border: 1px solid #d9d9d9;
  background: #fff; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: #666;
}
.pay-cancel-btn:hover { background: #fafafa; }
.pay-confirm-btn {
  flex: 2; padding: 12px; border: none;
  background: linear-gradient(90deg, #ff7a59, #ff3d8a);
  color: #fff; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.pay-confirm-btn:hover { opacity: .9; }
.pay-confirm-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 登录注册页 */
.auth-page {
  min-height: 100%;
  background: var(--bg);
}
.auth-header {
  display: flex; align-items: center;
  padding: 14px 16px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.auth-back {
  font-size: 24px; color: var(--text);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.auth-title {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px; font-weight: 600;
}
.auth-form {
  padding: 40px 24px;
  text-align: center;
}
.auth-logo {
  font-size: 56px; margin-bottom: 16px;
}
.auth-welcome {
  font-size: 22px; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 32px;
}
.form-item {
  margin-bottom: 14px;
}
.form-item input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
}
.form-item input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.auth-btn:hover { opacity: .9; }
.auth-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-dim);
}
.auth-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

/* 我的页 - 退出按钮 */
.mine-logout {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
}
.mine-logout:hover { color: #e74c3c; border-color: #e74c3c; }

/* 我的页 - 登录引导 */
.login-promo {
  margin: 16px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  text-align: center;
}
.login-promo-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  margin-bottom: 6px;
}
.login-promo-desc {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 16px;
}
.login-promo-btn {
  padding: 10px 40px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.login-promo-btn:hover { opacity: .9; }

/* 列表页通用 */
.list-page {
  min-height: 100%;
  background: var(--bg);
  padding-bottom: 20px;
}
.page-header {
  display: flex; align-items: center;
  padding: 14px 16px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-back {
  font-size: 24px; color: var(--text);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.page-title {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px; font-weight: 600;
}
.page-right {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-dim);
}

/* 空状态 */
.empty-state {
  padding: 80px 24px;
  text-align: center;
}
.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: .5;
}
.empty-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.empty-btn {
  padding: 10px 32px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* 播放页收藏按钮 */
.player-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.player-fav-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.player-fav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.player-fav-btn.favorited {
  border-color: #ff9500;
  color: #ff9500;
  background: rgba(255, 149, 0, .1);
}
.fav-icon { font-size: 14px; }

/* 观看历史列表 */
.history-list {
  padding: 0 12px;
}
.history-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.history-item:last-child { border-bottom: none; }
.history-cover {
  position: relative;
  width: 120px;
  flex-shrink: 0;
  padding-top: 75%;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
}
.history-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.history-ep {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
}
.history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 0;
}
.history-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.history-time {
  font-size: 11px;
  color: var(--text-dim2);
}
.history-del {
  position: absolute;
  right: 0;
  top: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim2);
  font-size: 14px;
  cursor: pointer;
}
.history-del:hover { color: #e74c3c; }

/* 设置页 */
.settings-group {
  margin: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-title {
  padding: 12px 16px 6px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.settings-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.settings-item:first-child { border-top: none; }
.settings-item:hover { background: var(--bg); }
.si-label {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}
.si-value {
  font-size: 13px;
  color: var(--text-dim);
  margin-right: 4px;
}
.si-arrow {
  color: var(--text-dim2);
  font-size: 18px;
}
.settings-logout {
  margin: 24px 12px 12px;
  padding: 14px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  color: #e74c3c;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.settings-logout:hover { background: #fef0f0; }

/* 留存统计切换标签 */
.retention-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.retention-tab {
  padding: 6px 16px;
  border: none;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.retention-tab:hover {
  background: var(--bg);
}
.retention-tab.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
}
.retention-tab + .retention-tab {
  border-left: 1px solid var(--border);
}
.rank-val { font-weight: 700; color: var(--accent); }

/* 站点设置 */
.site-setting-form { max-width: 600px; }
.ss-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.ss-tab {
  padding: 10px 20px; cursor: pointer; color: var(--text-dim);
  font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .2s;
}
.ss-tab:hover { color: var(--text); }
.ss-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ss-section-title {
  font-size: 14px; font-weight: 600; color: var(--accent);
  margin: 20px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ss-section-title:first-child { margin-top: 0; }
.color-picker-row {
  display: flex; gap: 8px; align-items: center; flex: 1;
}
.color-picker-row input[type="color"] {
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 6px;
  cursor: pointer; background: none;
}
.color-picker-row input[type="text"] {
  flex: 1; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-card2); color: var(--text);
  font-family: monospace; font-size: 13px;
}
.ss-preview-box {
  width: 100%; min-height: 180px;
  border-radius: 12px; padding: 20px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}
.ss-preview-card {
  width: 100%; max-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.ss-preview-title {
  font-size: 15px; font-weight: 600; color: var(--accent);
  margin-bottom: 10px;
}
.ss-preview-text {
  font-size: 13px; color: var(--text); margin-bottom: 4px;
}
.ss-preview-dim {
  font-size: 12px; color: var(--text-dim); margin-bottom: 14px;
}
.ss-preview-btn {
  display: inline-block; padding: 8px 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 20px; text-align: center;
}
.logo-upload-area {
  width: 180px; height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; background: var(--bg);
}
.logo-upload-area:hover { border-color: var(--accent); }
.logo-upload-hint { color: var(--text-dim2); font-size: 13px; }
.logo-preview { max-width: 100%; max-height: 100%; object-fit: contain; }


/* iOS 风格开关 */
.switch-wrap { display: inline-flex; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 26px; transition: .3s;
}
.switch .slider:before {
  content: ''; position: absolute; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
  transition: .3s; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch-label-on { color: var(--accent); font-weight: 600; font-size: 13px; }
.switch-label-off { color: var(--text-dim); font-size: 13px; }

/* 数据看板分区 */
.dash-section { margin-bottom: 24px; }
.dash-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding: 0 4px;
}
.dash-tab {
  padding: 8px 20px; font-size: 14px; cursor: pointer;
  color: var(--text-dim); border-bottom: 2px solid transparent;
  transition: all .2s; font-weight: 500;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active {
  color: #fff; font-weight: 600;
  border-bottom-color: var(--accent);
}
.dash-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 12px; padding-left: 4px;
}
.dash-section-dot {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

/* 管理后台浅色主题下的按钮样式覆盖 */
.admin-main .btn {
  color: #fff;
}
.admin-main .btn-outline {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}
.admin-main .btn-outline:hover {
  background: #f5f5f5;
  color: #333;
}

/* 页面模块广告数量 */
.pm-ad-count {
  display: inline-block;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.pm-ad-count.has {
  background: #e8f5e9;
  color: #2e7d32;
}
.pm-ad-count.none {
  background: #fafafa;
  color: #999;
}
