/* ═══════════════════════════════════════════════════════════
   mhpaihang.com - 漫画排行榜样式
   ═══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

:root {
  --primary: #e11d48;
  --primary-dark: #be123c;
  --bg: #fff;
  --bg-soft: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-soft: #64748b;
  --border: #e2e8f0;
  --hot: #ef4444;
  --max-w: 1200px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ═══ Header ═══ */
.site-header {
  background: var(--bg-dark);
  color: white;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: white !important;
  text-decoration: none !important;
}
.primary-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.primary-nav a {
  color: rgba(255,255,255,0.85) !important;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 15px;
  text-decoration: none !important;
}
.primary-nav a:hover, .primary-nav a.active {
  background: rgba(255,255,255,0.15);
  color: white !important;
}

/* ═══ 面包屑 ═══ */
.breadcrumbs {
  font-size: 14px;
  color: var(--text-soft);
  padding: 12px 16px;
}
.breadcrumbs a { color: var(--text-soft); }
.breadcrumbs .sep { margin: 0 4px; opacity: 0.5; }

/* ═══ Hero ═══ */
.hero, .list-hero, .genre-hero {
  text-align: center;
  padding: 40px 16px 28px;
  background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
  border-radius: 12px;
  margin: 16px 0 24px;
}
.hero h1, .list-hero h1, .genre-hero h1 {
  font-size: 32px;
  margin: 0 0 12px;
  color: var(--bg-dark);
}
.hero .lead, .list-hero .lead, .genre-hero .lead {
  color: var(--text-soft);
  font-size: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.updated-at {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 8px;
}

/* ═══ 排行榜区块 ═══ */
.rank-section {
  margin: 32px 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: 22px;
  margin: 0;
  color: var(--bg-dark);
}
.section-head .more {
  font-size: 14px;
  color: var(--primary);
}
.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ═══ 作品卡片 ═══ */
.work-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: var(--text) !important;
}
.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.work-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: #f1f5f9;
}
.work-card .no-cover {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: var(--text-soft);
  font-size: 14px;
}
.work-info { padding: 10px 12px 12px; }
.work-info h3 {
  font-size: 14px;
  margin: 0 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-info .meta {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.work-info .stats {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-info .hot {
  color: var(--hot);
  font-weight: 600;
}

.rank-num {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  z-index: 2;
}
.rank-num.rank-top { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.rank-num.rank-mid { background: linear-gradient(135deg, #94a3b8, #64748b); }
.rank-num.rank-low { background: rgba(0,0,0,0.55); font-size: 13px; }

.badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
}
.badge.serial { background: #fef3c7; color: #b45309; }
.badge.done { background: #dcfce7; color: #15803d; }

/* ═══ Sibling 导航 ═══ */
.sibling-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
  padding: 8px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.sibling-nav a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 14px;
  text-decoration: none !important;
}
.sibling-nav a.active {
  background: var(--primary);
  color: white !important;
}

/* ═══ 排行列表 ═══ */
.ranking-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.ranking-list .rank-item { position: relative; }

/* ═══ 题材入口 ═══ */
.genre-grid-section { margin: 40px 0; }
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.genre-tag {
  display: block;
  text-align: center;
  padding: 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text) !important;
  text-decoration: none !important;
  transition: all 0.15s;
}
.genre-tag:hover {
  background: var(--primary);
  color: white !important;
  border-color: var(--primary);
}

.genre-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.genre-block {
  display: block;
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none !important;
  color: var(--text) !important;
  transition: all 0.2s;
}
.genre-block:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(225,29,72,0.12);
}
.genre-block h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--bg-dark);
}
.genre-block h2 small {
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 400;
  margin-left: 8px;
}
.preview-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview-titles span {
  font-size: 13px;
  color: var(--text-soft);
}

/* ═══ 信息卡片块 ═══ */
.info-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 40px 0;
}
.info-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.info-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.info-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

/* ═══ 作品详情页 ═══ */
.work-detail { background: white; padding: 24px; border-radius: 12px; }
.work-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}
.work-cover {
  width: 200px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.work-meta h1 {
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--bg-dark);
}
.work-meta .author {
  font-size: 16px;
  color: var(--text-soft);
  margin: 0 0 12px;
}
.work-meta .badges {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.type-badge, .status-badge, .rating-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}
.type-badge { background: #dbeafe; color: #1e40af; }
.status-badge.serial { background: #fef3c7; color: #b45309; }
.status-badge.done { background: #dcfce7; color: #15803d; }
.rating-badge { background: #fef9c3; color: #a16207; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.stats-grid div {
  background: var(--bg-soft);
  padding: 10px 12px;
  border-radius: 6px;
}
.stats-grid dt {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.stats-grid dd {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.stats-grid dd.hot { color: var(--hot); }

.read-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white !important;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none !important;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(225,29,72,0.3);
  transition: transform 0.15s;
}
.read-cta:hover { transform: translateY(-2px); }
.read-cta.secondary { background: var(--bg-dark); }

.work-desc, .work-tags, .related {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.work-desc .hook {
  margin-top: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef2f2, #fce7e7);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
}
.work-desc .hook a {
  color: var(--primary-dark) !important;
  font-weight: 600;
  text-decoration: none !important;
}
.work-desc .hook a:hover { text-decoration: underline !important; }
.work-desc h2, .work-tags h2, .related h2 {
  font-size: 18px;
  margin: 0 0 12px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text) !important;
  text-decoration: none !important;
}
.tag:hover { background: var(--primary); color: white !important; border-color: var(--primary); }
.tag.plain { color: var(--text-soft) !important; }
.tag.plain:hover { background: var(--bg-soft); color: var(--text-soft) !important; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.related-card {
  display: block;
  text-decoration: none !important;
  color: var(--text) !important;
}
.related-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 6px;
}
.related-card .title {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  text-align: center;
  line-height: 1.3;
}

/* ═══ CTA 块 ═══ */
.cta-block {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin: 40px 0;
  text-align: center;
}
.cta-block h2 { margin: 0 0 8px; font-size: 22px; }
.cta-block p { margin: 0 0 16px; opacity: 0.95; }
.cta-block a { color: white !important; text-decoration: underline !important; }

/* ═══ Footer ═══ */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.85);
  padding: 32px 0 20px;
  margin-top: 48px;
}
.site-footer h3 { font-size: 16px; margin: 0 0 12px; color: white; }
.site-footer p { margin: 0; font-size: 14px; line-height: 1.6; }
.site-footer ul { padding: 0; margin: 0; list-style: none; }
.site-footer li { margin-bottom: 6px; }
.site-footer a {
  color: rgba(255,255,255,0.85) !important;
  font-size: 14px;
  text-decoration: none !important;
}
.site-footer a:hover { color: white !important; text-decoration: underline !important; }
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.copyright {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-soft);
  background: white;
  border-radius: 10px;
}

/* ═══ 响应式 ═══ */
@media (max-width: 640px) {
  .hero h1, .list-hero h1, .genre-hero h1 { font-size: 24px; }
  .work-header {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .work-cover { margin: 0 auto; width: 160px; }
  .work-meta .badges { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .read-cta { width: 100%; box-sizing: border-box; }
  .primary-nav { width: 100%; margin-left: 0; }
}
