/* ==========================================================================
   里番动漫 - 全站样式表
   公共交通风：高对比、紧凑信息、冷灰底 + 线路色点缀
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base - 基础变量、重置、全局字体与色彩
   -------------------------------------------------------------------------- */
:root {
  --bg: #F5F5F0;
  --text: #1A1A1A;
  --primary: #003B5C;
  --accent: #FFB000;
  --line-red: #E63946;
  --line-green: #2A9D8F;
  --line-blue: #1D3557;
  --card-bg: #FFFFFF;
  --border: #E2E2DA;
  --muted: #6B6B64;
  --header-h: 68px;
  --content-w: 1200px;
  --radius: 8px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--line-red);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --------------------------------------------------------------------------
   2. Layout - 全站容器、页头、页脚、面包屑、页面标题骨架
   -------------------------------------------------------------------------- */

/* 站点根容器 */
.site-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 统一页头 */
.site-header {
  background: #FFFFFF;
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  line-height: 1.2;
}

/* 主导航 */
.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-list a {
  display: block;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 4px;
  position: relative;
}

.nav-list a:hover {
  color: var(--primary);
  background: rgba(0, 59, 92, 0.06);
}

.nav-list a.is-current {
  color: #FFFFFF;
  background: var(--primary);
  font-weight: 600;
}

/* 移动端汉堡按钮（默认隐藏） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 主内容区 */
.site-main {
  flex: 1;
  width: 100%;
}

.inner-main {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 28px 24px 60px;
  width: 100%;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--primary);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #B0B0A8;
  user-select: none;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* 页面标题区（所有内页统一） */
.page-header {
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
  margin-bottom: 10px;
}

.page-description {
  font-size: 1rem;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.7;
}

/* 页脚 */
.site-footer {
  background: var(--primary);
  color: #E8EEF2;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.footer-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #B8C6CE;
  max-width: 320px;
}

.footer-col h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #B8C6CE;
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.8rem;
  color: #8FA3AD;
}

/* --------------------------------------------------------------------------
   3. Components - 通用组件：封面卡、漫画卡、线路角标、标签、榜单、更新项
   -------------------------------------------------------------------------- */

/* 线路角标 */
.route-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 14px;
  background: var(--line-blue);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

/* 封面卡（首页最近更新） */
.cover-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  flex: 0 0 190px;
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.cover-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.cover-card .route-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.cover-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.cover-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 12px 4px;
  line-height: 1.4;
}

.cover-card .cover-meta {
  padding: 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.cover-card .cover-date {
  padding: 6px 12px 12px;
  font-size: 0.75rem;
  color: #999990;
  margin-top: auto;
}

/* 通用漫画卡片（漫画库、题材页） */
.manga-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.manga-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.manga-card a {
  display: block;
  position: relative;
}

.manga-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.manga-card h3,
.manga-card .manga-title {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 12px 4px;
  line-height: 1.4;
}

.manga-card .card-tags,
.manga-card .manga-tags {
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.manga-card .card-tags span,
.manga-card .manga-tags span {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: #F0F0EA;
  border-radius: 10px;
  color: var(--muted);
}

.manga-card .card-status,
.manga-card .manga-status {
  padding: 8px 12px 12px;
  font-size: 0.78rem;
  color: var(--line-green);
  font-weight: 600;
  margin-top: auto;
}

.manga-card .card-desc {
  padding: 0 12px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 题材标签（首页） */
.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.genre-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.genre-tag:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 59, 92, 0.1);
}

.tag-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 题材线路色 */
.tag-urban .tag-dot {
  background: var(--line-red);
}

.tag-fantasy .tag-dot {
  background: var(--line-green);
}

.tag-daily .tag-dot {
  background: var(--accent);
}

.tag-scifi .tag-dot {
  background: var(--line-blue);
}

.tag-campus .tag-dot {
  background: #8E44AD;
}

.tag-mystery .tag-dot {
  background: #2C3E50;
}

.tag-romance .tag-dot {
  background: #E91E63;
}

.tag-adventure .tag-dot {
  background: #F39C12;
}

/* 排行榜条目（通用） */
.rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-item img {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.rank-item .rank-num,
.rank-item .rank-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 36px;
  text-align: center;
  font-style: italic;
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-info p {
  font-size: 0.78rem;
  color: var(--muted);
}

.rank-pop,
.rank-popularity {
  font-size: 0.82rem;
  color: var(--line-red);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 更新条目（更新记录页） */
.update-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-bottom-width: 1px;
}

.update-date {
  text-align: center;
  flex-shrink: 0;
  min-width: 52px;
  padding: 6px 10px;
  background: #F0F0EA;
  border-radius: 6px;
}

.date-num {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.date-month {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.update-cover {
  flex-shrink: 0;
}

.update-cover img {
  width: 52px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
}

.update-info {
  flex: 1;
  min-width: 0;
}

.update-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.update-info h3 a {
  color: var(--text);
}

.update-info h3 a:hover {
  color: var(--primary);
}

.update-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* 侧栏通用链接列表 */
.side-list li,
.sidebar-links li,
.aside-nav li,
.aside-links li,
.related-list li {
  margin-bottom: 8px;
}

.side-list a,
.sidebar-links a,
.aside-nav a,
.aside-links a,
.related-list a {
  display: block;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text);
  border-bottom: 1px dashed #E0E0D8;
}

.side-list a:hover,
.sidebar-links a:hover,
.aside-nav a:hover,
.aside-links a:hover,
.related-list a:hover {
  color: var(--primary);
  padding-left: 4px;
}

/* 区块标题 */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}

.section-head h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
}

.section-more {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.section-more:hover {
  background: var(--primary);
  color: #FFFFFF;
}

/* 通用说明段落 */
.section-desc,
.section-intro,
.genre-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
  max-width: 760px;
}

/* --------------------------------------------------------------------------
   4. Pages - 首页及各内页专属布局
   -------------------------------------------------------------------------- */

/* ===== 首页 ===== */
.home-main {
  width: 100%;
}

/* 首屏 hero */
.hero-section {
  background: var(--primary);
  color: #FFFFFF;
  padding: 56px 24px 48px;
}

.hero-grid {
  max-width: var(--content-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-copy h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #FFFFFF;
}

.hero-lead {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 0.95rem;
  color: #C0D0DA;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 4px;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 176, 0, 0.3);
  color: var(--primary);
}

.hero-figure {
  border-radius: var(--radius);
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.hero-figure img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.hero-figure figcaption {
  background: rgba(0, 0, 0, 0.55);
  padding: 10px 16px;
  font-size: 0.82rem;
  color: #E8EEF2;
}

/* 首屏三个功能入口 */
.hero-entries {
  max-width: var(--content-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.entry-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.entry-card:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent);
}

.entry-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  font-style: italic;
}

.entry-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.entry-desc {
  font-size: 0.82rem;
  color: #B8C6CE;
  line-height: 1.5;
}

/* 最近更新区 */
.recent-updates {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 56px 24px 32px;
}

.cover-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.cover-strip::-webkit-scrollbar {
  height: 6px;
}

.cover-strip::-webkit-scrollbar-thumb {
  background: #C8C8C0;
  border-radius: 3px;
}

.cover-card {
  position: relative;
}

/* 热门榜单区 */
.hot-rank {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 40px 24px;
}

.rank-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
}

.rank-main .rank-list {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 20px;
}

.rank-side {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.rank-side h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.rank-side .side-list {
  margin-bottom: 28px;
}

.rank-side .side-list:last-child {
  margin-bottom: 0;
}

/* 题材分类线路区 */
.genre-lines {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 40px 24px 56px;
}

/* 内容说明与版权入口 */
.content-note {
  background: #EDEDE6;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px;
}

.note-card {
  max-width: var(--content-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: center;
}

.note-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.note-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.7;
}

.note-link {
  display: inline-block;
  background: var(--primary);
  color: #FFFFFF;
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  justify-self: end;
}

.note-link:hover {
  background: var(--line-blue);
  color: #FFFFFF;
}

/* ===== 漫画库 ===== */
.layout-shell {
  display: grid;
  gap: 32px;
}

.layout-shell.sidebar-left {
  grid-template-columns: 220px 1fr;
  align-items: start;
}

.series-index {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.series-index h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.index-tip {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.index-letters {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.index-letters li {
  text-align: center;
}

.index-letters a {
  display: block;
  padding: 6px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: #F0F0EA;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.index-letters a:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.index-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.index-note p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.manga-collection {
  min-width: 0;
}

.manga-series {
  margin-bottom: 40px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.manga-series h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* ===== 题材分类 ===== */
.page-layout.sidebar-left {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

.genre-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.sidebar-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-box h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.genre-content {
  min-width: 0;
}

/* 线路图 */
.genre-map {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
}

.genre-map h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.genre-line-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.genre-line-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: #FAFAF6;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.genre-line-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 59, 92, 0.12);
}

.line-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  color: #FFFFFF;
  flex-shrink: 0;
}

/* 线路配色 */
.line-city .line-number {
  background: var(--line-red);
}

.line-fantasy .line-number {
  background: var(--line-green);
}

.line-daily .line-number {
  background: var(--accent);
  color: var(--primary);
}

.line-adventure .line-number {
  background: #F39C12;
}

.line-sci .line-number {
  background: var(--line-blue);
}

.line-romance .line-number {
  background: #E91E63;
}

.line-mystery .line-number {
  background: #2C3E50;
}

.line-school .line-number {
  background: #8E44AD;
}

/* 代表作品 */
.represent-cards {
  margin-bottom: 40px;
}

.represent-cards h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.genre-block {
  margin-bottom: 32px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.genre-block h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.represent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.represent-grid .manga-card img {
  height: 200px;
}

/* 题材提示 */
.genre-tip {
  background: #EDEDE6;
  border-radius: var(--radius);
  padding: 24px;
}

.genre-tip h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}

.genre-tip p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 6px;
}

/* ===== 排行榜 ===== */
.page-layout.sidebar-right {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.main-content {
  min-width: 0;
}

.main-content .breadcrumb {
  margin-bottom: 16px;
}

.main-content .page-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.main-content .rank-list {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 20px;
  margin-bottom: 16px;
}

.rank-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.step-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.step-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #FFFFFF;
}

.step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.step-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 60px;
  text-align: center;
}

.rank-tip {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

.rank-tip a {
  color: var(--primary);
  text-decoration: underline;
}

/* 侧栏细分榜单 */
.aside-content {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.sub-rank-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.sub-rank-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.sub-rank-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #E8E8E0;
}

.sub-rank-list li:last-child {
  border-bottom: none;
}

.sub-rank-num {
  font-size: 1rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 24px;
  font-style: italic;
}

.sub-rank-cover {
  width: 40px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.sub-rank-info {
  flex: 1;
  min-width: 0;
}

.sub-rank-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-rank-trend {
  font-size: 0.75rem;
  color: var(--line-green);
  font-weight: 600;
}

.aside-link-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.aside-link-block h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ===== 阅读指南 ===== */
.page-container {
  max-width: var(--content-w);
  margin: 0 auto;
}

.layout-with-aside {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.main-content-area {
  min-width: 0;
}

.guide-section {
  margin-bottom: 40px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.guide-section h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.guide-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content {
  min-width: 0;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

.guide-figure {
  margin-top: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.guide-figure img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.guide-figure figcaption {
  padding: 8px 14px;
  font-size: 0.78rem;
  color: var(--muted);
  background: #F8F8F4;
}

/* FAQ 列表 */
.faq-list {
  margin-top: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--card-bg);
}

.faq-item summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 40px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--primary);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item summary:hover {
  background: #F8F8F4;
}

.faq-item p {
  padding: 0 18px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}

/* 侧栏相关指南 */
.aside-links {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.aside-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.aside-card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ===== 版权说明 ===== */
.copyright-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

.copyright-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.copyright-section p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 12px;
}

.scope-list {
  margin: 16px 0;
  padding-left: 4px;
}

.scope-list li {
  padding: 8px 0 8px 24px;
  position: relative;
  font-size: 0.9rem;
  border-bottom: 1px dashed #E8E8E0;
}

.scope-list li::before {
  content: '●';
  position: absolute;
  left: 4px;
  color: var(--line-green);
  font-size: 0.7rem;
  top: 12px;
}

.copyright-illustration {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.copyright-illustration img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.copyright-illustration figcaption {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  background: #F8F8F4;
}

.related-links .related-list {
  margin-top: 12px;
}

.related-links .related-list a {
  font-weight: 500;
}

/* ===== 更新记录 ===== */
.layout-shell.sidebar-left {
  grid-template-columns: 220px 1fr;
}

.date-filter {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.date-filter h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 14px;
}

.filter-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-tabs a {
  display: block;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-tabs a:hover,
.filter-tabs a.is-active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.filter-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.filter-note a {
  color: var(--primary);
  text-decoration: underline;
}

.update-list {
  min-width: 0;
}

.update-list h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.update-list .update-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
}

.update-list .route-badge {
  flex-shrink: 0;
}

.update-note {
  margin-top: 32px;
  background: #EDEDE6;
  border-radius: var(--radius);
  padding: 24px;
}

.update-note h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}

.update-note p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

.update-note a {
  color: var(--primary);
  font-weight: 600;
  margin-right: 12px;
}

/* ===== 404 ===== */
.error-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.error-panel {
  text-align: center;
  max-width: 560px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
}

.error-panel h1 {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
}

.error-lead {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.error-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

.btn-back-home {
  display: inline-block;
  background: var(--primary);
  color: #FFFFFF;
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

.btn-back-home:hover {
  background: var(--line-blue);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   5. Responsive - 响应式断点
   -------------------------------------------------------------------------- */

/* 平板 */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-figure img {
    height: 240px;
  }

  .hero-entries {
    grid-template-columns: repeat(3, 1fr);
  }

  .rank-grid {
    grid-template-columns: 1fr;
  }

  .page-layout.sidebar-right {
    grid-template-columns: 1fr;
  }

  .aside-content {
    position: static;
  }

  .layout-with-aside {
    grid-template-columns: 1fr;
  }

  .aside-links {
    position: static;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* 手机 */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .brand-tag {
    display: none;
  }

  /* 汉堡菜单 */
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  }

  .nav-list {
    display: none;
    flex-direction: column;
    padding: 8px 16px 16px;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    padding: 14px 12px;
    font-size: 1rem;
    border-bottom: 1px solid #F0F0EA;
    border-radius: 0;
  }

  .nav-list a.is-current {
    background: transparent;
    color: var(--primary);
    font-weight: 700;
  }

  .nav-list li:last-child a {
    border-bottom: none;
  }

  .inner-main {
    padding: 20px 16px 48px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .hero-section {
    padding: 40px 16px 36px;
  }

  .hero-copy h1 {
    font-size: 1.8rem;
  }

  .hero-entries {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .recent-updates,
  .hot-rank,
  .genre-lines {
    padding: 36px 16px 28px;
  }

  .content-note {
    padding: 36px 16px;
  }

  .note-card {
    grid-template-columns: 1fr;
  }

  .note-link {
    justify-self: start;
  }

  /* 侧栏布局：手机端主内容在前 */
  .layout-shell.sidebar-left,
  .page-layout.sidebar-left {
    grid-template-columns: 1fr;
  }

  .layout-shell.sidebar-left .series-index,
  .layout-shell.sidebar-left .date-filter,
  .page-layout.sidebar-left .genre-sidebar {
    grid-row: 2;
    position: static;
  }

  .layout-shell.sidebar-left .manga-collection,
  .layout-shell.sidebar-left .update-list,
  .page-layout.sidebar-left .genre-content {
    grid-row: 1;
  }

  .genre-sidebar {
    position: static;
  }

  .sidebar-box {
    margin-bottom: 12px;
  }

  .manga-grid,
  .represent-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .manga-card img,
  .represent-grid .manga-card img {
    height: 180px;
  }

  .cover-card {
    flex-basis: 150px;
  }

  .cover-card img {
    height: 200px;
  }

  .rank-item {
    gap: 10px;
  }

  .rank-item img {
    width: 44px;
    height: 58px;
  }

  .rank-item .rank-num,
  .rank-item .rank-number {
    font-size: 1.1rem;
    min-width: 28px;
  }

  .rank-pop,
  .rank-popularity {
    font-size: 0.75rem;
  }

  .update-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .update-date {
    min-width: 44px;
  }

  .update-cover img {
    width: 40px;
    height: 52px;
  }

  .guide-step {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .copyright-section {
    padding: 20px;
  }

  .error-panel {
    padding: 32px 20px;
  }

  .error-panel h1 {
    font-size: 3rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    padding: 32px 16px 24px;
    gap: 24px;
  }

  .footer-bottom {
    padding: 12px 16px;
  }
}

/* 小屏手机 */
@media (max-width: 420px) {
  .brand-name {
    font-size: 1.2rem;
  }

  .hero-copy h1 {
    font-size: 1.6rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .genre-tags {
    gap: 8px;
  }

  .genre-tag {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .manga-grid,
  .represent-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .manga-card img,
  .represent-grid .manga-card img {
    height: 150px;
  }

  .manga-card h3,
  .manga-card .manga-title {
    font-size: 0.85rem;
    padding: 8px 8px 2px;
  }

  .manga-card .card-tags,
  .manga-card .manga-tags {
    padding: 0 8px;
  }

  .manga-card .card-status,
  .manga-card .manga-status {
    padding: 4px 8px 8px;
    font-size: 0.72rem;
  }

  .rank-item .rank-info h3 {
    font-size: 0.85rem;
  }

  .update-item {
    padding: 12px;
  }

  .update-info h3 {
    font-size: 0.88rem;
  }
}
