/* ==========================================================================
   COMIC READER & COMIC CARDS (IMMERSIVE CONTINUOUS VERTICAL STRIP & PAGED)
   ========================================================================== */

/* 1. Media Tab Switcher (全部 / 漫画 / 小说) */
.media-tabs-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}

.media-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.16s ease;
}

.media-tab-btn:hover {
  color: var(--text-primary);
}

.media-tab-btn.active {
  background-color: var(--bg-surface);
  color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-subtle);
}

.media-count-badge {
  font-style: normal;
  font-size: 10px;
  font-family: monospace;
  padding: 1px 5px;
  border-radius: 999px;
  background-color: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

/* 2. Comic Card Tagging & Badges */
.comic-card .wf-comic-tag {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 3;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.4);
}

.comic-card .wf-chapter-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 7px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* 3. Full-Bleed Comic Viewer */
#comicReaderView {
  width: 100%;
  min-height: 100vh;
  background-color: #000000;
  color: #f5f5f7;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

body.is-comic-reading .app-header,
body.is-comic-reading .app-footer,
body.is-comic-reading #libraryMainWrapper,
body.is-comic-reading #libraryBottomNav,
html.is-comic-reading .app-header,
html.is-comic-reading .app-footer,
html.is-comic-reading #libraryMainWrapper,
html.is-comic-reading #libraryBottomNav {
  display: none !important;
}

body.is-comic-reading #comicReaderView,
html.is-comic-reading #comicReaderView {
  display: block !important;
}

/* Top & Bottom Chrome for Comic */
.comic-top {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 52px;
  z-index: 60;
  background: rgba(12, 12, 16, 0.88);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.comic-top__title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f5f5f7;
  display: inline-flex;
  align-items: center;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comic-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* 高度必须包含底部安全区，否则 PWA 下内容区被 Home 条挤压 */
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 60;
  background: rgba(12, 12, 16, 0.92);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-around;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.comic-top.mobile-nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.comic-bottom-nav.mobile-nav-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Comic Strip Container */
.comic-reader-content {
  max-width: 860px;
  margin: 0 auto;
  padding: calc(52px + env(safe-area-inset-top, 0px)) 0 calc(90px + env(safe-area-inset-bottom, 0px)) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #000000;
}

.comic-images-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.comic-img-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  background-color: #050508;
  min-height: 240px;
}

.comic-strip-img {
  width: 100%;
  max-width: 860px;
  height: auto;
  display: block;
  object-fit: contain;
  margin: 0 auto;
}

.comic-chapter-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comic-trans-divider {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 16px 28px;
}

.comic-trans-divider .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.comic-trans-divider .divider-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
  background: rgba(230, 184, 115, 0.1);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(230, 184, 115, 0.25);
}

.comic-chapter-footer {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 16px 24px;
  gap: 12px;
}
