/* ============================================
   App Layout - 主布局
   ============================================ */

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ---- 页面容器 ---- */
#page-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ---- Tab 页面 ---- */
.tab-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tabbar-height);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out),
              visibility 0s var(--duration-normal);
}

.tab-page.active {
  visibility: visible;
  opacity: 1;
  transition: opacity var(--duration-normal) var(--ease-out),
              visibility 0s;
}

/* ---- 隐藏状态类 ---- */
.hidden {
  display: none !important;
}

/* ---- 导航栏 [hidden] 强制覆盖（组件 CSS 中的 display:flex 会覆盖 UA [hidden]） ---- */
.player-nav[hidden],
.profile-nav[hidden],
.search-nav[hidden],
.list-nav[hidden],
.sub-page-nav[hidden],
.pw-nav[hidden] {
  display: none !important;
}

.invisible {
  visibility: hidden;
  pointer-events: none;
}

/* ---- 通用 section 样式 ---- */
.section {
  padding: var(--space-lg) var(--space-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.section-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.see-more {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  cursor: pointer;
}

/* ---- 短剧横向滚动列表 (基础) ---- */
.drama-scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-sm);
  scrollbar-width: none;
}
.drama-scroll::-webkit-scrollbar { display: none; }

/* ---- 短剧卡片 (基础) ---- */
.drama-card {
  flex-shrink: 0;
  width: 140px;
  scroll-snap-align: start;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transition: transform var(--duration-fast) var(--ease-out);
}

.drama-card:active {
  transform: scale(0.96);
}

.drama-card .card-poster {
  width: 140px;
  height: 196px;
  background-color: #1c1c1e;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.drama-card .card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 标签角标 - 默认右上角 */
.card-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  z-index: 2;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card-badge.hot { }
.card-badge.new { }
.card-badge.vip { }

/* 剧集数角标 */
.card-ep-count {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  font-size: 10px;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.6);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.drama-card .card-title {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.drama-card .card-meta {
  font-size: 11px;
  color: #8e8e93;
  margin-top: 2px;
}

/* ============================
   退出确认弹窗
   ============================ */
.exit-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal, 200) + 100);
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
.exit-confirm-overlay.show {
  display: flex;
}
.exit-confirm-card {
  background: #2C2C2E;
  border-radius: 14px;
  padding: 28px 24px 20px;
  width: 280px;
  max-width: 85vw;
  text-align: center;
}
.exit-confirm-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 24px;
}
.exit-confirm-btns {
  display: flex;
  gap: 12px;
}
.exit-btn {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.exit-btn-cancel {
  background: #3B82F6;
  color: #fff;
}
.exit-btn-cancel:focus {
  outline: 2px solid rgba(59,130,246,0.5);
  outline-offset: 2px;
}
.exit-btn-confirm {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.exit-btn:active {
  transform: scale(0.97);
}
