/* ==========================================================================
   动漫天堂 v9231.com — 全站样式表
   分组：base / layout / components / pages / responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   base：变量、重置、排版、通用工具类
   -------------------------------------------------------------------------- */

:root {
  --bg-page: #F5F6F4;
  --bg-surface: #FFFFFF;
  --bg-zebra: #F0F2EF;
  --bg-thead: #E8ECE7;
  --line: #DEE2DE;
  --ink-title: #14181D;
  --ink-body: #3C444C;
  --ink-muted: #6B747C;
  --brand: #1F6F5C;
  --brand-dark: #185A4B;
  --status-ongoing: #1F6F5C;
  --status-paused: #A8671C;
  --status-finished: #6B7280;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-card: 0 1px 2px rgba(20, 24, 29, 0.06);
  --shadow-card-hover: 0 4px 12px rgba(20, 24, 29, 0.12);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --shell-max: 1120px;
  --shell-pad: 24px;
  --header-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink-title);
  font-weight: 700;
  line-height: 1.35;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
}

table {
  border-collapse: collapse;
  width: 100%;
}

caption {
  caption-side: top;
  text-align: left;
}

button {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   layout：全站骨架 —— 页头、导航、主容器、页脚
   -------------------------------------------------------------------------- */

.site-body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--shell-max);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
}

.brand {
  flex: 0 0 auto;
  color: var(--ink-title);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover,
.brand:focus-visible {
  color: var(--brand);
  text-decoration: none;
}

.site-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.nav-list li {
  flex: 0 0 auto;
}

.nav-list a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-body);
  font-size: 15px;
  white-space: nowrap;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background-color: var(--bg-zebra);
  color: var(--brand-dark);
  text-decoration: none;
}

.nav-list a.is-current {
  color: var(--brand);
  font-weight: 700;
}

.header-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.tool-link {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
}

.tool-link:hover,
.tool-link:focus-visible {
  border-color: var(--brand);
  background-color: var(--bg-zebra);
  color: var(--brand-dark);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--ink-title);
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background-color: var(--bg-surface);
}

.mobile-nav-list {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 8px var(--shell-pad) 16px;
}

.mobile-nav-list li {
  border-bottom: 1px solid var(--line);
}

.mobile-nav-list li:last-child {
  border-bottom: 0;
}

.mobile-nav-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-body);
  font-size: 16px;
}

.mobile-nav-list a.is-current {
  color: var(--brand);
  font-weight: 700;
}

.site-main {
  flex: 1 1 auto;
  width: 100%;
}

.inner-main {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 24px var(--shell-pad) 56px;
}

.home-main {
  padding-bottom: 8px;
}

.site-footer {
  margin-top: 48px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 40px var(--shell-pad) 28px;
}

.footer-col {
  min-width: 0;
}

.footer-title {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--ink-title);
}

.footer-list li {
  margin-bottom: 8px;
}

.footer-list a {
  color: var(--ink-muted);
  font-size: 14px;
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--brand);
}

.footer-text {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.footer-bottom {
  border-top: 1px solid var(--line);
}

.footer-bottom p {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 16px var(--shell-pad);
  color: var(--ink-muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   components：表格、状态标签、卡片、步骤、注释块、面包屑、标题区
   -------------------------------------------------------------------------- */

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.breadcrumb a {
  color: var(--ink-muted);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--brand);
}

.breadcrumb-sep {
  color: var(--line);
}

.breadcrumb-current {
  color: var(--ink-body);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 页面标题区 */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  color: var(--ink-title);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
}

.page-description {
  margin-top: 10px;
  color: var(--ink-body);
  font-size: 15px;
}

.page-note {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 13px;
}

/* 内页导语区 */
.page-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.page-lead {
  color: var(--ink-body);
  font-size: 16px;
}

.page-head .page-note {
  margin-top: 8px;
}

.section-intro,
.section-lead,
.section-desc {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.section-title {
  font-size: 22px;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
}

.status-ongoing {
  color: var(--status-ongoing);
}

.status-paused {
  color: var(--status-paused);
}

.status-finished,
.status-completed {
  color: var(--status-finished);
}

/* 数据表格 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.data-table {
  min-width: 640px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.data-table caption {
  padding: 12px 14px 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.data-table thead th {
  padding: 10px 14px;
  background-color: var(--bg-thead);
  border-bottom: 1px solid var(--line);
  color: var(--ink-title);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-body);
  vertical-align: top;
}

.data-table tbody tr:nth-child(even) {
  background-color: var(--bg-zebra);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody td:first-child {
  color: var(--ink-title);
  font-weight: 600;
}

.table-note {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

.table-caption {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

/* 注释块 */
.note-block {
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.note-block + .note-block {
  margin-top: 14px;
}

.note-block p {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.notice-block {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--brand);
  background-color: var(--bg-zebra);
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

/* 编号步骤（通用结构） */
.step-list {
  display: grid;
  gap: 12px;
}

.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-index,
.step-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  background-color: var(--bg-thead);
  color: var(--ink-title);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step-body {
  min-width: 0;
}

.step-owner {
  display: inline-block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
}

/* 相关入口（横向链接块） */
.related-entry,
.related-section {
  margin-top: 40px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.related-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.related-item a {
  display: block;
  color: var(--ink-title);
  font-weight: 600;
}

.related-item p {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 13px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
}

.related-links-label {
  color: var(--ink-muted);
  font-size: 13px;
}

.related-links-item {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--ink-body);
  font-size: 14px;
}

.related-links-item:hover,
.related-links-item:focus-visible {
  border-color: var(--brand);
  color: var(--brand-dark);
  text-decoration: none;
}

.related-link {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--ink-body);
  font-size: 14px;
}

.related-link:hover,
.related-link:focus-visible {
  border-color: var(--brand);
  color: var(--brand-dark);
  text-decoration: none;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.related-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.related-card:hover,
.related-card:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
}

.related-name {
  display: block;
  color: var(--ink-title);
  font-weight: 600;
}

.related-desc {
  display: block;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.65;
}

/* 入口卡片（题材分类相关入口） */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.entry-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.entry-card:hover,
.entry-card:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
}

.entry-name {
  display: block;
  color: var(--ink-title);
  font-weight: 600;
}

.entry-desc {
  display: block;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.65;
}

.entry-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.entry-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.entry-item a {
  display: block;
  color: var(--ink-title);
  font-weight: 600;
}

/* 通用 section 间距 */
.section {
  margin-top: 48px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 22px;
}

/* --------------------------------------------------------------------------
   pages：首页
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 40px var(--shell-pad) 0;
}

.hero-summary {
  min-width: 0;
}

.hero-summary h1 {
  font-size: 32px;
  line-height: 1.28;
}

.hero-lead {
  margin-top: 14px;
  color: var(--ink-body);
  font-size: 16px;
}

.hero-lead + .hero-lead {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 15px;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 13px;
}

.hero-visual {
  min-width: 0;
}

.hero-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-zebra);
}

.updates-overview,
.genres-entry,
.ranking-snapshot,
.topics-entry,
.guide-entry,
.notice-bar {
  max-width: var(--shell-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--shell-pad);
  padding-right: var(--shell-pad);
}

/* 首页题材分类卡片 */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.genre-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.genre-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-card-hover);
}

.genre-cover {
  margin: 0 0 12px;
}

.genre-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 22;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: var(--bg-zebra);
}

.genre-name {
  font-size: 17px;
}

.genre-desc {
  margin-top: 6px;
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.7;
}

.genre-status {
  margin-top: 10px;
}

.genre-link {
  margin-top: auto;
  padding-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* 首页榜单快照 */
.rank-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 180px) minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-row:nth-child(even) {
  background-color: var(--bg-zebra);
}

.rank-no {
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rank-genre {
  color: var(--ink-title);
  font-size: 15px;
  font-weight: 600;
}

.rank-reason {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.65;
}

/* 首页专题合辑 */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.topic-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-card-hover);
}

.topic-card .topic-name {
  font-size: 17px;
}

.topic-criteria {
  margin-top: 8px;
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.7;
}

.topic-card .topic-order {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.topic-card .topic-link {
  margin-top: auto;
  padding-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* 首页选漫指南摘要 */
.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.guide-steps {
  display: grid;
  gap: 12px;
  counter-reset: guide-step;
}

.guide-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--ink-body);
  font-size: 15px;
  line-height: 1.7;
}

.guide-step::before {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  background-color: var(--bg-thead);
  color: var(--ink-title);
  font-size: 13px;
  font-weight: 700;
  counter-increment: guide-step;
  content: counter(guide-step);
}

.guide-entry-block {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.guide-entry-title {
  font-size: 17px;
}

.guide-entry-block p {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.entry-link {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}

.entry-link:hover,
.entry-link:focus-visible {
  background-color: var(--brand);
  color: #FFFFFF;
  text-decoration: none;
}

/* 首页说明条 */
.notice-bar {
  margin-top: 48px;
}

.notice-line {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.notice-line:last-child {
  border-bottom: 1px solid var(--line);
}

.notice-line a {
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   pages：内页布局（两栏 / 单栏 / 侧栏）
   -------------------------------------------------------------------------- */

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 32px;
  align-items: start;
}

.page-layout.layout-shell {
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
}

.content-main,
.layout-main {
  min-width: 0;
}

.content-aside {
  min-width: 0;
}

.content-aside h2,
.aside-title {
  font-size: 16px;
  margin-bottom: 12px;
}

.aside-figure {
  margin-top: 20px;
}

.aside-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-zebra);
}

/* 更新表页 */
.field-notes {
  margin-top: 8px;
}

.field-note-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.field-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.field-note-index {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-thead);
  color: var(--ink-title);
  font-size: 13px;
  font-weight: 700;
}

.field-note-name {
  font-size: 15px;
}

.field-note-text {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.update-table-section {
  margin-top: 36px;
}

.update-table-section h2 {
  font-size: 22px;
}

.update-table-section .table-scroll {
  margin-top: 14px;
}

.update-table td:first-child,
.update-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: var(--bg-surface);
}

.update-table thead th:first-child {
  background-color: var(--bg-thead);
}

.update-table tbody tr:nth-child(even) td:first-child {
  background-color: var(--bg-zebra);
}

/* 更新表侧栏：状态图例卡与追更步骤 */
.legend-cards {
  display: grid;
  gap: 10px;
}

.legend-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.legend-card p {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.65;
}

.follow-steps {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.follow-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.follow-step .step-index {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  background-color: var(--bg-thead);
  color: var(--ink-title);
  font-size: 12px;
  font-weight: 700;
}

.follow-step p {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

/* 榜单页 */
.rank-figure {
  max-width: var(--shell-max);
  margin: 0 auto 24px;
  padding: 0 var(--shell-pad);
}

.rank-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-zebra);
}

.rank-section,
.concentration-section {
  margin-top: 36px;
}

.rank-section:first-child {
  margin-top: 0;
}

.rank-section h2,
.concentration-section h2 {
  font-size: 22px;
}

.rank-section .table-scroll,
.concentration-section .table-scroll {
  margin-top: 14px;
}

.rank-table td:first-child,
.rank-table th:first-child {
  width: 56px;
  color: var(--brand);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.concentration-table td:first-child,
.concentration-table th:first-child {
  white-space: nowrap;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
}

.tag-high {
  color: var(--status-ongoing);
}

.tag-mid {
  color: var(--status-paused);
}

.tag-low {
  color: var(--status-finished);
}

/* 题材分类页 */
.sidebar-left {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.genre-toc {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.toc-list {
  display: grid;
  gap: 4px;
}

.toc-item a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-body);
  font-size: 14px;
}

.toc-item a:hover,
.toc-item a:focus-visible {
  background-color: var(--bg-zebra);
  color: var(--brand-dark);
  text-decoration: none;
}

.toc-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.content-column {
  min-width: 0;
}

.genre-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.genre-section:first-child {
  padding-top: 0;
}

.genre-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.genre-text {
  min-width: 0;
}

.genre-text h2 {
  font-size: 22px;
}

.genre-text .genre-desc {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.75;
}

.genre-text .genre-status {
  margin-top: 10px;
}

.genre-sub {
  margin-top: 16px;
  font-size: 15px;
}

.genre-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 20px;
  margin-top: 8px;
}

.genre-points li {
  position: relative;
  padding-left: 14px;
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.7;
}

.genre-points li::before {
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--brand);
  content: "";
}

.genre-figure {
  min-width: 0;
}

.genre-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-zebra);
}

.genre-faq {
  margin-top: 36px;
}

.genre-faq h2 {
  font-size: 22px;
}

.qa-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.qa-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.qa-question {
  font-size: 15px;
}

.qa-answer {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.75;
}

/* 专题合辑页 */
.topic-list {
  max-width: 100%;
}

.topic-list .section-title {
  font-size: 22px;
}

.topic-block {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.topic-media {
  min-width: 0;
}

.topic-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: var(--bg-zebra);
}

.topic-body {
  min-width: 0;
}

.topic-body .topic-name {
  font-size: 19px;
}

.topic-summary {
  margin-top: 10px;
  color: var(--ink-body);
  font-size: 15px;
  line-height: 1.75;
}

.topic-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.topic-meta dt {
  color: var(--ink-muted);
  white-space: nowrap;
}

.topic-meta dd {
  margin: 0;
  color: var(--ink-body);
}

.topic-body .topic-link {
  padding-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

.topic-order {
  margin-top: 40px;
}

.topic-order .section-title {
  font-size: 22px;
}

.topic-order .step-list {
  margin-top: 14px;
}

.topic-order .step-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.topic-order .step-index {
  grid-row: 1 / span 2;
}

.topic-order .step-text {
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.7;
}

.topic-order .step-owner {
  margin-top: 0;
}

/* 选漫指南页 */
.guide-questions h2,
.guide-compare h2,
.guide-steps h2,
.guide-pitfalls h2,
.related-links h2 {
  font-size: 22px;
}

.question-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.question-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.question-item h3 {
  font-size: 15px;
}

.question-item p {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.75;
}

.guide-memo {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.guide-memo h2 {
  font-size: 16px;
}

.memo-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.memo-item {
  position: relative;
  padding-left: 16px;
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.7;
}

.memo-item::before {
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--brand);
  border-radius: 50%;
  content: "";
}

.guide-compare {
  margin-top: 36px;
}

.compare-figure {
  margin-top: 14px;
}

.compare-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-zebra);
}

.compare-table {
  min-width: 720px;
}

.compare-table caption {
  padding: 12px 14px 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  font-size: 14px;
  text-align: left;
  vertical-align: top;
}

.compare-table thead th {
  background-color: var(--bg-thead);
  color: var(--ink-title);
}

.compare-table tbody th {
  color: var(--ink-title);
  font-weight: 600;
  white-space: nowrap;
}

.compare-table tbody tr:nth-child(even) {
  background-color: var(--bg-zebra);
}

.guide-steps {
  margin-top: 36px;
}

.guide-steps .step-list {
  margin-top: 14px;
}

.guide-steps .step-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) max-content;
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.guide-steps .step-text {
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.7;
}

.guide-steps .step-owner {
  margin-top: 0;
  align-self: center;
}

.guide-pitfalls {
  margin-top: 36px;
}

.pitfall-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.pitfall-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.pitfall-item h3 {
  font-size: 15px;
}

.pitfall-item p {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.75;
}

/* 版权与纠错页 */
.content-section {
  max-width: 760px;
  margin-top: 36px;
}

.content-section:first-of-type {
  margin-top: 0;
}

.content-section h2 {
  font-size: 22px;
}

.content-section > p {
  margin-top: 10px;
  color: var(--ink-body);
  font-size: 15px;
  line-height: 1.75;
}

.principle-block {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.principle-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.principle-item h3 {
  font-size: 15px;
}

.principle-item p {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.75;
}

.field-figure {
  margin-top: 18px;
}

.field-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-zebra);
}

.content-section .step-list {
  margin-top: 16px;
}

.content-section .step-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.content-section .step-item .step-index {
  grid-row: 1 / span 3;
}

.content-section .step-item h3 {
  font-size: 15px;
}

.content-section .step-item p {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.content-section .step-item .step-owner {
  margin-top: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.faq-item summary {
  padding: 14px 16px;
  color: var(--ink-title);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  float: right;
  margin-left: 12px;
  color: var(--ink-muted);
  font-weight: 400;
  content: "＋";
}

.faq-item[open] summary::after {
  content: "－";
}

.faq-item summary:hover {
  color: var(--brand-dark);
}

.faq-item p {
  padding: 0 16px 16px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.75;
}

/* 404 页 */
.error-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px var(--shell-pad);
}

.page-container {
  width: 100%;
  max-width: var(--shell-max);
}

.error-container {
  max-width: 760px;
}

.error-panel {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
}

.error-panel h1 {
  font-size: 30px;
}

.error-lead {
  margin-top: 12px;
  color: var(--ink-body);
  font-size: 15px;
  line-height: 1.75;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
}

.btn-primary {
  background-color: var(--brand);
  color: #FFFFFF;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--brand-dark);
  color: #FFFFFF;
  text-decoration: none;
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink-body);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--brand);
  color: var(--brand-dark);
  text-decoration: none;
}

.error-hints {
  margin-top: 32px;
}

.error-hints h2 {
  font-size: 18px;
}

.hint-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hint-list li {
  min-width: 0;
}

.hint-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
  color: var(--ink-body);
  font-size: 14px;
}

.hint-list a:hover,
.hint-list a:focus-visible {
  border-color: var(--brand);
  color: var(--brand-dark);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   responsive：1024 / 768 / 480 断点
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .header-inner {
    gap: 14px;
  }

  .nav-list a {
    padding: 8px 8px;
    font-size: 14px;
  }

  .tool-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .hero {
    gap: 24px;
  }

  .page-layout,
  .page-layout.layout-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
    gap: 24px;
  }

  .sidebar-left {
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 24px;
  }

  .genre-grid,
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-block {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --shell-pad: 16px;
  }

  .site-header {
    position: static;
  }

  .header-inner {
    height: 56px;
    gap: 10px;
  }

  .brand {
    font-size: 17px;
  }

  /* 移动端：只收起 .nav-list 本身，父容器保持可显示 */
  .nav-list {
    display: none;
  }

  .nav-list.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 4px 0 8px;
  }

  .nav-list.is-open li {
    border-bottom: 1px solid var(--line);
  }

  .nav-list.is-open li:last-child {
    border-bottom: 0;
  }

  .nav-list.is-open a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
    font-size: 16px;
  }

  .site-nav {
    order: 4;
    flex: 1 1 100%;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .header-tools {
    margin-left: auto;
  }

  .header-tools .tool-link {
    padding: 6px 8px;
    font-size: 12px;
  }

  .nav-toggle {
    display: flex;
  }

  .mobile-nav {
    display: none;
  }

  .mobile-nav.is-open {
    display: block;
  }

  .inner-main {
    padding-top: 16px;
    padding-bottom: 40px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 24px;
  }

  .hero-summary h1,
  .page-title,
  .error-panel h1 {
    font-size: 22px;
  }

  .section {
    margin-top: 36px;
  }

  .section-head h2,
  .genre-text h2,
  .genre-faq h2,
  .rank-section h2,
  .concentration-section h2,
  .topic-list .section-title,
  .topic-order .section-title,
  .guide-questions h2,
  .guide-compare h2,
  .guide-steps h2,
  .guide-pitfalls h2,
  .related-links h2,
  .content-section h2 {
    font-size: 19px;
  }

  .page-layout,
  .page-layout.layout-shell,
  .sidebar-left {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .genre-grid,
  .topic-grid,
  .guide-split,
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    gap: 24px;
    padding-top: 28px;
  }

  .rank-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px 12px;
  }

  .rank-reason {
    grid-column: 2 / -1;
  }

  .topic-block {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .topic-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .topic-meta dd {
    margin-bottom: 8px;
  }

  .data-table {
    min-width: 600px;
  }

  .compare-table {
    min-width: 640px;
  }

  .guide-steps .step-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .guide-steps .step-owner {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .error-main {
    padding: 32px var(--shell-pad);
  }

  .error-panel {
    padding: 22px;
  }

  .genre-points {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .header-tools {
    gap: 6px;
  }

  .header-tools .tool-link {
    padding: 6px 6px;
    font-size: 11px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .status-legend {
    gap: 8px 14px;
  }

  .related-list,
  .related-grid,
  .entry-grid,
  .entry-list,
  .pitfall-list,
  .hint-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .error-actions {
    flex-direction: column;
  }

  .error-actions .btn-primary,
  .error-actions .btn-ghost {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
