/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-tab: #0a0a15;
  --text: #fff;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --accent: #e94560;
  --tab-height: 50px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ============================================
   Bottom Tab Bar
   ============================================ */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-tab);
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 900;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.tab-item.active {
  color: var(--accent);
}

.tab-item:active {
  opacity: 0.7;
}

.tab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.tab-label {
  font-size: 10px;
  line-height: 1;
  font-weight: 500;
}

/* ============================================
   Page Containers
   ============================================ */
.page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.page-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 8px);
}

/* ============================================
   Category Tabs (Home Page)
   ============================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 12px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.category-tabs::-webkit-scrollbar { display: none; }

/* 右侧渐变遮罩提示可滚动 */
.category-tabs-shell {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.category-tabs-shell::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 0;
  width: 40px;
  height: 28px;
  background: linear-gradient(90deg, transparent, var(--bg) 80%);
  pointer-events: none;
  transition: opacity 0.3s;
}
.category-tabs-shell.scrolled::after { opacity: 0; }

.category-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab.active {
  color: #fff;
  background: var(--accent);
}

.category-tab:active {
  transform: scale(0.95);
}

/* ============================================
   Section Title
   ============================================ */
.section-title {
  font-size: 16px;
  font-weight: 600;
  padding: 16px 12px 10px;
}

/* ============================================
   Video Card Grid
   ============================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 8px;
}

.video-card {
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.video-card:active {
  transform: scale(0.97);
}

.video-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.video-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  transition: opacity 0.3s ease;
}

.video-card-cover img.loading {
  opacity: 0;
}

/* Duration badge */
.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* VIP badge */
.vip-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #f5af19, #f12711);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.3;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.drama-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #2f80ed, var(--accent));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.3;
}

.video-card-drama .video-card-cover {
  aspect-ratio: 3 / 4;
}

.video-card-body {
  padding: 8px 10px 10px;
}

.video-card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.video-card-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ============================================
   Video Detail Overlay
   ============================================ */
.detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.detail-overlay.visible,
.detail-overlay.active {
  transform: translateY(0);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.back-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.detail-header-title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Video player area */
.video-player-area {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
}

.video-player-area video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Detail info */
.detail-info {
  padding: 14px 14px 0;
}

.detail-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Detail player wrap */
.detail-player-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.detail-player-wrap video,
.detail-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.detail-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.detail-close-btn:active { background: rgba(255,255,255,0.1); }
.detail-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 40px;
}
.detail-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-section-title {
  font-size: 15px;
  font-weight: 600;
  padding: 14px 12px 8px;
}
.detail-type {
  font-size: 12px;
  color: var(--accent);
  padding: 4px 0;
}

.detail-drama-panel {
  padding-top: 12px;
}

.detail-drama-panel .detail-section-title {
  padding: 0 0 10px;
}

.detail-drama-episodes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding-bottom: 14px;
}

.detail-drama-episode-btn {
  min-height: 34px;
  border-radius: 7px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.detail-drama-episode-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Recommend section in detail */
.detail-recommend {
  padding-bottom: 20px;
}

.detail-recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 8px;
}
.detail-recommend-grid .video-card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}
.detail-recommend-grid .video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-recommend-grid .video-card-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 3px;
}
.detail-recommend-grid .video-card-vip {
  position: absolute;
  top: 4px;
  left: 4px;
  background: linear-gradient(135deg, #f5af19, #f12711);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}
.detail-recommend-grid .video-card-title {
  font-size: 12px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-recommend-grid .video-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   Comic Tabs
   ============================================ */
.comic-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 12px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.comic-tabs::-webkit-scrollbar { display: none; }
.comic-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  white-space: nowrap;
  transition: all 0.2s ease;
}
.comic-tab.active {
  color: #fff;
  background: var(--accent);
}

.comic-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.comic-page-inner {
  min-height: 100%;
}

.comic-search-bar {
  position: sticky;
  top: 0;
  z-index: 11;
  background: var(--bg);
  padding: 10px 12px 4px;
}
.comic-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.comic-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-secondary);
  pointer-events: none;
}
.comic-search-input {
  width: 100%;
  padding: 8px 32px 8px 32px;
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 18px;
  background: var(--bg-card);
  color: var(--text, #fff);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.comic-search-input:focus {
  border-color: var(--accent);
}
.comic-search-input::-webkit-search-cancel-button { display: none; }
.comic-search-clear {
  position: absolute;
  right: 8px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.comic-search-input:not(:placeholder-shown) + .comic-search-clear {
  opacity: 1;
}
/* 有搜索框后，tabs 顶部对齐下移 */
.comic-search-bar + .comic-tabs { top: 48px; }

.loading-spinner {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}
.loading-spinner::after {
  content: '加载中...';
}

.scroll-sentinel {
  height: 1px;
}

/* ============================================
   Mine Page
   ============================================ */
.mine-page {
  padding-top: 20px;
}
.mine-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
}
.mine-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.mine-name { font-size: 18px; font-weight: 600; }
.mine-desc { font-size: 13px; color: var(--text-secondary); }
.mine-stats {
  display: flex;
  justify-content: space-around;
  padding: 16px 0;
  margin: 0 16px;
  background: var(--bg-card);
  border-radius: 12px;
}
.mine-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mine-stat-num { font-size: 20px; font-weight: 700; }
.mine-stat-label { font-size: 12px; color: var(--text-secondary); }
.mine-menu { margin: 16px; }
.mine-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  cursor: pointer;
}
.mine-menu-item:active { background: rgba(255,255,255,0.08); }
.mine-arrow { margin-left: auto; color: var(--text-secondary); font-size: 18px; }
.mine-footer {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.short-poster {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
  background: #000;
}

.short-tap-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 60px;
  bottom: 0;
}

/* ============================================
   Comic Card Grid
   ============================================ */
.comic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 10px;
  overflow: hidden;
}

.comic-card {
  cursor: pointer;
  transition: transform 0.15s ease;
  min-width: 0;
  overflow: hidden;
}

.comic-card:active {
  transform: scale(0.96);
}

.comic-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
}

.comic-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  text-align: right;
}

.episode-badge {
  position: absolute;
  bottom: 4px;
  left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
}

.sync-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(233, 128, 40, 0.92);
  border-radius: 3px;
}

.status-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  color: #fff;
}

.status-badge.status-completed {
  background: rgba(46, 160, 67, 0.92);
}

.status-badge.status-ongoing {
  background: rgba(233, 128, 40, 0.92);
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  color: #fff;
  margin-right: 4px;
  vertical-align: middle;
}

.status-pill.status-completed {
  background: rgba(46, 160, 67, 0.88);
}

.status-pill.status-ongoing {
  background: rgba(233, 128, 40, 0.88);
}

.comic-card-title {
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   Comic Detail Overlay
   ============================================ */
.comic-detail-cover {
  position: relative;
  width: 100%;
  padding: 16px;
  display: flex;
  gap: 14px;
}

.comic-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comic-detail-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 0;
}

.comic-detail-info {
  padding: 0 14px;
}

.comic-chapter-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.comic-chapter-btn {
  padding: 8px 4px;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.comic-chapter-btn.active,
.comic-chapter-btn:active {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.12);
}

/* Comic detail overlay */
.comic-detail-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.comic-detail-overlay.active {
  transform: translateY(0);
}
.comic-detail-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.comic-detail-close-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
}
.comic-detail-close-btn:active { background: rgba(255,255,255,0.1); }
.comic-detail-bar-title {
  font-size: 15px;
  font-weight: 600;
}
.comic-detail-cover-img {
  width: 100px;
  aspect-ratio: 3/4;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.comic-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.comic-detail-stats {
  font-size: 12px;
  color: var(--text-secondary);
}
.comic-detail-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}
.comic-detail-view {}
.comic-detail-header {
  display: flex;
  gap: 14px;
  padding: 0 14px 14px;
}
.comic-detail-header img {
  width: 100px;
  aspect-ratio: 3/4;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.comic-detail-header-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.comic-detail-header-info h1 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.comic-detail-header-info .detail-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.comic-detail-header-info .detail-stats { font-size: 12px; color: var(--text-secondary); }
.comic-detail-summary {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 14px 14px;
  line-height: 1.5;
}
.comic-read-btn {
  display: block;
  width: calc(100% - 28px);
  margin: 0 14px 14px;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.comic-read-btn:active { opacity: 0.8; }
.comic-read-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.comic-sync-summary {
  margin: 0 14px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 1.5;
}

.comic-sync-summary.is-complete {
  background: rgba(46, 160, 67, 0.12);
  border-color: rgba(46, 160, 67, 0.22);
}

.comic-sync-summary.is-partial {
  background: rgba(233, 128, 40, 0.12);
  border-color: rgba(233, 128, 40, 0.22);
}

.comic-related-section { padding: 0 14px; }
.comic-related-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.comic-related-card {
  flex-shrink: 0;
  width: 90px;
  cursor: pointer;
}
.comic-related-cover {
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
}
.comic-related-cover img { width: 100%; height: 100%; object-fit: cover; }
.comic-related-title {
  font-size: 11px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Comic reader */
.comic-detail-content.is-reader {
  background: #000;
  padding-bottom: 0;
}

.comic-reader-view {
  min-height: 100%;
  background: #000;
  position: relative;
}

.comic-reader-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.86), rgba(0,0,0,0.48) 72%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.comic-reader-view.controls-hidden .comic-reader-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.comic-reader-catalog-btn,
.comic-reader-top-nav {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.comic-reader-top-nav:disabled {
  opacity: 0.38;
  cursor: default;
}

.comic-reader-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
}

.comic-reader-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comic-reader-progress {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  font-variant-numeric: tabular-nums;
}

.comic-reader-body {
  background: #000;
}

.comic-reader-page {
  position: relative;
  width: 100%;
  min-height: clamp(280px, 68vh, 780px);
  background: #080808;
  overflow: hidden;
}

.comic-reader-image {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
}

.comic-reader-page.is-loaded {
  min-height: 0;
}

.comic-reader-page.is-loaded .comic-reader-image {
  opacity: 1;
  visibility: visible;
}

.comic-reader-page-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #111, #050505);
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.comic-reader-page.is-loaded .comic-reader-page-loading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.comic-reader-page.is-error .comic-reader-page-loading {
  color: rgba(255,255,255,0.5);
}

.comic-reader-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.16);
  border-top-color: rgba(255,255,255,0.72);
  border-radius: 50%;
  animation: comicReaderSpin 0.8s linear infinite;
}

.comic-reader-page.is-error .comic-reader-spinner {
  display: none;
}

@keyframes comicReaderSpin {
  to { transform: rotate(360deg); }
}

.comic-reader-chapter {
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comic-reader-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px calc(30px + var(--safe-bottom));
  gap: 10px;
  background: #000;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.comic-reader-nav-btn {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-card);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.comic-reader-nav-btn:active:not(:disabled) {
  background: rgba(233, 69, 96, 0.2);
}

.comic-reader-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.comic-reader-chapter-num {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: center;
}

/* 详情页章节网格 */
.comic-chapter-section {
  padding: 16px 14px 0;
}

.comic-chapter-section h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.comic-chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.comic-chapter-grid .comic-chapter-btn {
  padding: 10px 6px;
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background 0.15s;
}

.comic-chapter-grid .comic-chapter-btn:active {
  background: rgba(233, 69, 96, 0.2);
}

.comic-chapter-grid .comic-chapter-btn:disabled {
  cursor: default;
  opacity: 1;
}

.comic-chapter-grid .comic-chapter-btn.is-missing {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.comic-chapter-grid .comic-chapter-btn.is-locked {
  background: rgba(233, 128, 40, 0.1);
  border-style: solid;
  border-color: rgba(233, 128, 40, 0.2);
}

.comic-chapter-grid .chapter-num {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comic-chapter-grid .chapter-pages {
  font-size: 10px;
  color: var(--text-secondary);
}

/* Comic related horizontal scroll */
.comic-related-scroll {
  display: flex;
  gap: 10px;
  padding: 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.comic-related-scroll::-webkit-scrollbar {
  display: none;
}

.comic-related-scroll .comic-card {
  flex-shrink: 0;
  width: 100px;
}

/* Comic reader */
.comic-reader {
  background: #000;
}

.comic-reader-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comic-reader-pages img {
  width: 100%;
  height: auto;
}

/* ============================================
   Short Video Page (Vertical Snap)
   ============================================ */
.short-video-item {
  scroll-snap-align: start;
  width: 100%;
  height: calc(100vh - var(--tab-height) - var(--safe-bottom));
  position: relative;
  background: #000;
  flex-shrink: 0;
}

.short-video-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.short-video-info {
  position: absolute;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
  left: 0;
  right: 60px;
  padding: 0 14px;
  z-index: 2;
}

.short-video-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.short-video-author {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Side action bar for short video */
.short-video-actions {
  position: absolute;
  right: 10px;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 3;
}

.short-channel-tabs {
  position: absolute;
  top: calc(52px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 8;
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.short-channel-tab {
  min-width: 56px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.short-channel-tab.active {
  color: #fff;
  background: var(--accent);
}

.short-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-height) + var(--safe-bottom));
  z-index: 9;
  height: 18px;
  cursor: pointer;
  touch-action: none;
}

.short-progress-bar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.short-progress-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  transition: width 0.08s linear;
}

.short-drama-free-badge {
  position: absolute;
  top: calc(92px + env(safe-area-inset-top, 0px));
  left: 14px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #2f80ed, var(--accent));
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,0,0,0.28);
}

.short-video-drama-item .short-poster {
  object-fit: contain;
}

.short-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
}

.short-action-btn svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.short-action-btn span {
  font-size: 11px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Pull-to-Refresh
   ============================================ */
.pull-indicator {
  position: absolute;
  top: -44px;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
.pull-indicator.refreshing .pull-spinner {
  animation: pullSpin 0.8s linear infinite;
}
@keyframes pullSpin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Home Banner (top ad)
   ============================================ */
.home-banner {
  margin: 10px 12px 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 320 / 46;
  line-height: 0;
}
.home-banner-video,
.home-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ============================================
   深度起飞主域推广入口
   ============================================ */
.deepfly-promo {
  margin: 10px 12px 0;
  padding: 12px;
  border: 1px solid rgba(233, 69, 96, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(233, 69, 96, 0.12), rgba(255, 255, 255, 0.03)),
    var(--bg-card);
}
.deepfly-promo-label {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(233, 69, 96, 0.16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 7px;
}
.deepfly-promo h2 {
  font-size: 16px;
  line-height: 1.35;
  margin-bottom: 6px;
}
.deepfly-promo p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}
.deepfly-promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.deepfly-promo-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.deepfly-promo-actions a:first-child {
  background: var(--accent);
}

.mine-deepfly-promo {
  margin: 16px;
}

/* ============================================
   Tag Pills
   ============================================ */
/* Search bar */
.search-bar {
  padding: 10px 12px 0;
  position: relative;
}

.short-search-bar {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 8;
  padding: 0 64px 0 12px;
}

.search-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 8px 44px 8px 14px;
  border: none;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
}
.search-input::placeholder { color: var(--text-secondary); }
.search-input:focus { box-shadow: 0 0 0 1px var(--accent); }

.search-submit,
.search-page-submit {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.search-submit:active,
.search-page-submit:active {
  transform: translateY(-50%) scale(0.96);
}

.search-submit-icon {
  width: 17px;
  height: 17px;
}

.search-submit-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--accent);
  animation: search-spin 0.75s linear infinite;
}

.search-bar.is-searching .search-submit-icon,
.search-page-form.is-searching .search-submit-icon {
  display: none;
}

.search-bar.is-searching .search-submit-spinner,
.search-page-form.is-searching .search-submit-spinner {
  display: block;
}

.short-search-bar .search-input {
  height: 36px;
  background: rgba(26, 26, 46, 0.72);
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 20;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.short-search-bar .search-results {
  left: 12px;
  right: 64px;
  max-height: min(300px, 52vh);
}

.search-result-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.search-result-item:active { background: rgba(255,255,255,0.06); }
.search-result-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-result-main strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-main small {
  color: var(--accent);
  font-size: 11px;
}
.search-count { font-size: 12px; color: var(--text-secondary); }
.search-empty { padding: 16px; text-align: center; color: var(--text-secondary); font-size: 13px; }

.search-page-open {
  overflow: hidden;
}

.search-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

.search-page-overlay.open {
  display: flex;
}

.search-page-header {
  height: 56px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(15, 15, 26, 0.96);
}

.search-page-back {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
}

.search-page-back svg {
  width: 22px;
  height: 22px;
}

.search-page-form {
  position: relative;
  min-width: 0;
}

.search-page-input {
  width: 100%;
  height: 40px;
  padding: 9px 44px 9px 14px;
  border: none;
  border-radius: 20px;
  outline: none;
  color: var(--text);
  background: var(--bg-card);
  font-size: 14px;
  -webkit-appearance: none;
}

.search-page-input:focus {
  box-shadow: 0 0 0 1px var(--accent);
}

.search-page-status {
  padding: 12px 16px 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.search-page-results {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 24px;
}

.search-page-results .search-result-item {
  border-radius: 8px;
}

@keyframes search-spin {
  to { transform: rotate(360deg); }
}

/* Video card tags */
.video-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.video-card-tag {
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent);
  border-radius: 8px;
  white-space: nowrap;
}

/* Tag navigation bar */
.tag-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(233, 69, 96, 0.12);
  border-radius: 8px;
  margin: 0 8px 8px;
}
.tag-nav-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.tag-nav-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-secondary);
}
.tag-nav-close:active { background: rgba(255,255,255,0.1); }

.tag-pill {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.2s ease;
}

.tag-pill:active {
  background: rgba(255, 255, 255, 0.14);
}

/* ============================================
   Mine Page
   ============================================ */
.mine-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 16px 20px;
}

.mine-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mine-avatar svg {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
}

.mine-name {
  font-size: 18px;
  font-weight: 600;
}

.mine-stats {
  display: flex;
  justify-content: space-around;
  padding: 16px 0;
  margin: 0 16px;
  background: var(--bg-card);
  border-radius: 12px;
}

.mine-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mine-stat-value {
  font-size: 20px;
  font-weight: 700;
}

.mine-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.mine-menu {
  margin: 16px;
}

.mine-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  transition: background 0.15s ease;
}

.mine-menu-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.mine-menu-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skeleton-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.skeleton-title {
  height: 14px;
  margin: 10px 10px 0;
  width: 80%;
  border-radius: 4px;
}

.skeleton-meta {
  height: 10px;
  margin: 6px 10px 10px;
  width: 50%;
  border-radius: 4px;
}

.skeleton-comic-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
}

.skeleton-comic-title {
  height: 12px;
  margin-top: 6px;
  width: 70%;
  border-radius: 4px;
}

/* Skeleton card wrapper */
.skeleton-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

/* ============================================
   Transitions
   ============================================ */
.fade-in {
  animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
.page-content::-webkit-scrollbar {
  width: 0;
  display: none;
}

.page-content {
  scrollbar-width: none;
}

/* ============================================
   Responsive: Tablet / wider phones
   ============================================ */
@media (min-width: 480px) {
  .video-grid {
    gap: 10px;
    padding: 0 12px;
  }

  .comic-grid {
    gap: 10px;
    padding: 0 12px;
  }

  .video-card-title {
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px;
  }

  .comic-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px;
  }

  .comic-chapter-list {
    grid-template-columns: repeat(6, 1fr);
  }

  .category-tabs {
    padding: 14px 16px 10px;
  }

  .section-title {
    padding: 18px 16px 12px;
  }
}

/* ============================================
   用户互动：详情、短视频、我的
   ============================================ */
.detail-actions {
  display: flex;
  gap: 10px;
  padding: 12px 0 10px;
}

.detail-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 13px;
}

.detail-action-btn.active {
  color: #fff;
  background: rgba(233, 69, 96, 0.18);
}

.detail-action-btn.active .detail-action-icon {
  color: var(--accent);
}

.short-action-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.short-action-btn.active svg,
.short-action-btn.active span:first-of-type {
  color: var(--accent);
}

.mine-menu-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(233, 69, 96, 0.16);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.mine-menu-count + .mine-arrow {
  margin-left: 6px;
}

.mine-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  background: var(--bg);
}

.mine-overlay.active {
  display: block;
}

.mine-overlay-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.mine-overlay-header {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mine-overlay-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}

.mine-overlay-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
}

.mine-overlay-clear {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
}

.mine-overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 28px;
}

.mine-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.mine-date-label {
  padding: 12px 2px 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.mine-video-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
}

.mine-video-cover {
  position: relative;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}

.mine-video-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mine-video-duration,
.mine-video-type {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
}

.mine-video-type {
  left: 5px;
  right: auto;
}

.mine-video-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.mine-video-title {
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mine-video-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ============================================
   Membership / Unlock
   ============================================ */
.detail-player-wrap {
  position: relative;
}

.detail-unlock-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.56);
}

.detail-unlock-btn {
  min-width: 150px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.detail-unlock-btn small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.82;
}

.short-unlock-btn.active {
  color: var(--accent);
}

.short-unlock-btn:disabled {
  opacity: 0.72;
}

.short-lock-hint {
  position: absolute;
  left: 14px;
  right: 76px;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 112px);
  z-index: 2;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.56);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
}

.member-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
}

.member-modal-panel {
  width: min(100%, 520px);
  max-height: min(86vh, 680px);
  overflow-y: auto;
  border-radius: 12px 12px 0 0;
  background: var(--bg);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.member-modal-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.member-modal-head h2 {
  font-size: 17px;
  margin-bottom: 4px;
}

.member-modal-head p,
.member-modal-hint {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.member-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 24px;
  color: var(--text-secondary);
}

.member-modal-body {
  padding: 14px 16px;
}

.member-field,
.mine-member-bind {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-field span,
.mine-member-bind label {
  color: var(--text-secondary);
  font-size: 12px;
}

.member-field input,
.mine-member-bind input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  outline: none;
}

.member-modal-error {
  min-height: 18px;
  color: #ff7a90;
  font-size: 12px;
}

.member-plans,
.mine-member-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.member-plan {
  min-height: 78px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  text-align: left;
}

.member-plan.active {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.14);
}

.member-plan-name,
.member-plan span:last-child {
  color: var(--text-secondary);
  font-size: 12px;
}

.member-plan strong {
  font-size: 18px;
}

.member-modal-actions,
.mine-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 16px;
}

.member-action {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
}

.member-action.claim {
  flex-basis: 100%;
}

.member-action:disabled,
.member-plan:disabled {
  opacity: 0.58;
  pointer-events: none;
}

.member-action.primary {
  background: var(--accent);
  color: #fff;
}

.mine-membership-preview {
  margin: 12px 16px 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mine-membership-preview div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mine-membership-preview strong {
  font-size: 15px;
}

.mine-membership-preview span {
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-membership-preview button {
  flex-shrink: 0;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.mine-member-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mine-member-status div {
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mine-member-status span {
  color: var(--text-secondary);
  font-size: 12px;
}

.mine-member-status strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-member-actions {
  padding: 0;
}
