/* 漫画专区 / 阅读器 */
.comic-section .comic-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.comic-search {
  display: flex;
  gap: 8px;
}
.comic-search input {
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.comic-search button {
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  background: #222;
  color: #fff;
  cursor: pointer;
}
.comic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.comic-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.comic-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f2f2;
}
.comic-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.comic-cover.empty,
.detail-cover.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  background: #eee;
  width: 100%;
  height: 100%;
}
.comic-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}
.comic-title {
  margin: 8px 0 4px;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comic-sub {
  margin: 0;
  font-size: 12px;
  color: #888;
}
.comic-detail-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.detail-cover {
  width: 180px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px;
  background: #eee;
  overflow: hidden;
  display: block;
}
img.detail-cover {
  height: 240px; /* 180 * 4/3 */
  max-height: 240px;
}
.detail-info h1 {
  margin: 0 0 8px;
  font-size: 24px;
}
.detail-info .desc {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #444;
}
.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.detail-actions .btn,
.reader-bar .rb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  background: #f3f3f3;
  color: #222;
}
.detail-actions .btn.primary {
  background: #222;
  color: #fff;
}
.detail-actions .btn.disabled,
.rb-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.chapter-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.chapter-item {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}
.chapter-item:hover {
  border-color: #ccc;
  background: #fafafa;
}
.ch-no {
  color: #888;
  white-space: nowrap;
}
.empty-tip {
  padding: 40px 16px;
  text-align: center;
  color: #999;
}

/* 阅读器 */
.comic-reader-body {
  margin: 0;
  background: #111;
  color: #eee;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.comic-reader {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
}
.reader-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(6px);
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.reader-bar.bottom {
  position: sticky;
  top: auto;
  bottom: 0;
}
.rb-title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-nav {
  display: flex;
  gap: 6px;
}
.rb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(17, 17, 17, 0.85);
  position: sticky;
  top: 48px;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 4;
}
.rb-pager + .reader-pages + .rb-pager,
.reader-pages + .rb-pager {
  top: auto;
  bottom: 48px;
  position: sticky;
}
.rb-page-num {
  font-size: 13px;
  color: #bbb;
  min-width: 48px;
  text-align: center;
}
.reader-bar .rb-btn {
  background: #2a2a2a;
  color: #fff;
  font-size: 13px;
}
.reader-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: #000;
}
.reader-page {
  width: 100%;
  height: auto;
  display: block;
  background: #1a1a1a;
}
.mayi-site-chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: center;
  padding: 8px 12px;
  font-size: 13px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}
.mayi-site-chrome a { color: #f5a; text-decoration: none; }
.mayi-reader-foot {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: #888;
}
.mayi-reader-foot a { color: #f5a; margin: 0 4px; }
.mayi-reader-noise {
  height: 4px;
  display: flex;
  gap: 2px;
  justify-content: center;
  opacity: 0.15;
  pointer-events: none;
}
.mayi-reader-noise i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #666;
}

.mayi-site-chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 12px;
  font-size: 12px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}
.mayi-site-chrome a { color: #f29; text-decoration: none; }
.mayi-reader-foot {
  text-align: center;
  padding: 16px 12px 28px;
  font-size: 12px;
  color: #888;
}
.mayi-reader-foot a { color: #f29; margin: 0 4px; }
.mayi-reader-noise {
  height: 6px;
  display: flex;
  gap: 4px;
  justify-content: center;
  opacity: 0.15;
  pointer-events: none;
}
.mayi-reader-noise i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #666;
  display: inline-block;
}

@media (max-width: 720px) {
  .comic-detail-hero {
    grid-template-columns: 120px 1fr;
  }
  .detail-cover {
    width: 120px;
  }
  .detail-info h1 {
    font-size: 18px;
  }
  .comic-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }
}
