/* ==========================================================================
   歪歪漫画 · 全站样式
   分组：base / layout / components / pages / responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   base：变量、重置、排版
   -------------------------------------------------------------------------- */
:root {
  --bg: #F7F5EE;
  --bg-soft: #FBF9F3;
  --surface: #FFFFFF;
  --ink: #2B2A26;
  --ink-soft: #6B675C;
  --ink-faint: #8C8779;
  --green: #4C7A3F;
  --green-deep: #3A5F30;
  --green-wash: #EAF0E3;
  --wheat: #D9A93B;
  --wheat-wash: #F7EED6;
  --line: #DCD7C9;
  --line-soft: #E8E3D6;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(43, 42, 38, 0.06);
  --shadow-lift: 0 6px 18px rgba(43, 42, 38, 0.10);
  --font: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
  --wrap: 1120px;
  --gap: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--green-deep);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   layout：全站骨架（页头 / 导航 / 主容器 / 页脚）
   -------------------------------------------------------------------------- */
.site-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
}

.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--green-deep);
}

.brand-sub {
  font-size: 13px;
  color: var(--ink-soft);
}

.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  display: inline-block;
  padding: 6px 2px;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--green-deep);
  text-decoration: none;
  border-bottom-color: var(--line);
}

.nav-link.is-current {
  color: var(--green-deep);
  font-weight: 700;
  border-bottom-color: var(--green);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.nav-toggle-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink);
}

.nav-toggle-text {
  font-size: 14px;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
}

.home-main > section,
.inner-main > section {
  padding: 44px 0;
}

.inner-main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.inner-main > section {
  padding-left: 0;
  padding-right: 0;
}

/* 页脚 */
.site-footer {
  margin-top: 32px;
  background: #F1EEE4;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  padding-top: 40px;
  padding-bottom: 20px;
}

.footer-col {
  min-width: 0;
}

.footer-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.footer-list {
  display: grid;
  gap: 8px;
}

.footer-list a {
  display: inline-block;
  padding: 3px 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--green-deep);
}

.footer-about {
  grid-column: 1 / -1;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.footer-note {
  font-size: 14px;
  max-width: 760px;
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 13px;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   layout：内页统一外壳（面包屑 / 页标题区）
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 18px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.breadcrumb a {
  color: var(--ink-soft);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--green-deep);
}

.breadcrumb-sep {
  color: var(--line);
}

.breadcrumb-current {
  color: var(--ink);
}

.page-header {
  padding: 16px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 12px;
}

.page-description {
  max-width: 780px;
  font-size: 16px;
  color: var(--ink-soft);
}

.page-meta,
.page-summary,
.page-belong {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-faint);
}

/* 通用栏目标题 */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.section-desc,
.section-lead {
  max-width: 800px;
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.section-head {
  margin-bottom: 22px;
}

.section-more {
  margin-top: 18px;
  font-size: 14px;
}

.link-more {
  display: inline-block;
  padding: 4px 0;
  color: var(--green-deep);
  font-weight: 700;
}

.link-more::after {
  content: " →";
}

/* --------------------------------------------------------------------------
   components：按钮
   -------------------------------------------------------------------------- */
.btn,
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #FFFFFF;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #FFFFFF;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--green);
  color: var(--green-deep);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   pages：首页
   -------------------------------------------------------------------------- */
.section-positioning {
  padding: 14px 0 0;
}

.positioning-line {
  font-size: 14px;
  color: var(--ink-soft);
  padding: 10px 14px;
  background: var(--green-wash);
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.section-hero {
  padding-top: 30px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 34px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-copy .page-title {
  font-size: 32px;
  margin-bottom: 14px;
}

.hero-lead {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.hero-tag a {
  display: inline-block;
  padding: 6px 14px;
  min-height: 34px;
  font-size: 14px;
  color: var(--green-deep);
  background: var(--green-wash);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.hero-tag a:hover,
.hero-tag a:focus-visible {
  background: #FFFFFF;
  border-color: var(--green);
  text-decoration: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-figure {
  min-width: 0;
}

.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* 题材方向总览 */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.genre-card {
  min-width: 0;
  padding: 22px 20px;
  border-right: 1px solid var(--line-soft);
}

.genre-card:last-child {
  border-right: none;
}

.genre-name {
  font-size: 17px;
  margin-bottom: 8px;
}

.genre-intro {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.genre-meta {
  font-size: 13px;
  color: var(--ink-faint);
}

.genre-count {
  display: inline-block;
  padding: 2px 10px;
  background: var(--wheat-wash);
  border-radius: 999px;
  color: #7A5A12;
}

/* 封面墙 */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.cover-item {
  min-width: 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cover-item:hover,
.cover-item:focus-within {
  transform: translateY(-3px);
  border-color: var(--green);
  box-shadow: var(--shadow-lift);
}

.cover-figure {
  margin-bottom: 10px;
}

.cover-figure img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.cover-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-faint);
}

.cover-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.cover-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.field-genre,
.field-status {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

.field-status {
  background: var(--wheat-wash);
  border-color: #EADCB6;
  color: #7A5A12;
}

/* 最近更新记录 */
.update-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.update-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1.4fr) 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
}

.update-row:last-child {
  border-bottom: none;
}

.update-row:hover {
  background: var(--bg-soft);
}

.update-date {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-faint);
}

.update-name {
  font-weight: 700;
  color: var(--ink);
}

.update-genre {
  font-size: 14px;
  color: var(--ink-soft);
}

.update-progress {
  font-size: 14px;
  color: var(--green-deep);
}

/* 榜单与说明双栏 */
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 34px;
  align-items: start;
}

.split-main,
.split-aside {
  min-width: 0;
}

.mini-rank-list {
  border-top: 1px solid var(--line);
}

.mini-rank-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rank-no {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--wheat);
}

.rank-name {
  font-weight: 700;
}

.rank-note {
  font-size: 14px;
  color: var(--ink-soft);
}

.field-dict {
  margin: 0;
  border-top: 1px solid var(--line);
}

.field-term {
  padding-top: 12px;
  font-weight: 700;
  font-size: 15px;
}

.field-desc {
  padding-bottom: 12px;
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
}

/* 站内栏目索引 */
.sitelink-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.sitelink-item {
  min-width: 0;
}

.sitelink {
  display: block;
  height: 100%;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.sitelink:hover,
.sitelink:focus-visible {
  border-color: var(--green);
  transform: translateY(-2px);
  text-decoration: none;
}

.sitelink-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.sitelink-desc {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   pages：题材分类页
   -------------------------------------------------------------------------- */
.genre-groups {
  padding-top: 0;
}

.genre-group {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.genre-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.genre-group-title {
  font-size: 20px;
}

.genre-group-count {
  font-size: 13px;
  color: var(--ink-faint);
}

.genre-group-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.genre-group-figure {
  min-width: 0;
}

.genre-group-figure img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.genre-group-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-faint);
}

.genre-group-text {
  min-width: 0;
}

.genre-group-desc {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.genre-group-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}

.genre-group-item {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.genre-group-item:hover {
  border-color: var(--green);
}

.entry-name {
  font-weight: 700;
}

.entry-flag {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #7A5A12;
}

/* 收录范围字段 */
.genre-notes {
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.field-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.field-name {
  font-weight: 700;
  font-size: 15px;
}

.field-row .field-desc {
  padding: 0;
  border-bottom: none;
}

/* 相关入口 */
.genre-links {
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related-item {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.related-item a {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.related-note {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   pages：最近更新页
   -------------------------------------------------------------------------- */
.update-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 30px;
  align-items: center;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.overview-text {
  min-width: 0;
}

.overview-text p {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.overview-figure {
  min-width: 0;
}

.overview-figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.overview-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-faint);
}

.update-list-section {
  margin-bottom: 34px;
}

.update-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
}

.update-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--green-wash);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  color: var(--green-deep);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.update-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.update-table tbody tr:last-child td {
  border-bottom: none;
}

.update-table tbody tr:hover {
  background: var(--bg-soft);
}

.update-table .col-date {
  width: 130px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.update-table .col-entry {
  font-weight: 700;
}

.update-table .col-genre {
  width: 120px;
  color: var(--ink-soft);
}

.update-table .col-progress {
  width: 130px;
  color: var(--green-deep);
}

.update-table .col-status {
  width: 110px;
  color: #7A5A12;
}

.table-note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.update-covers {
  padding: 30px 0;
  border-top: 1px solid var(--line);
  margin-bottom: 34px;
}

.update-covers .cover-figure {
  max-width: 560px;
}

.status-notes {
  padding-top: 30px;
  border-top: 1px solid var(--line);
  margin-bottom: 34px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.note-card {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.note-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.note-meaning {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.note-scope {
  font-size: 13px;
  color: var(--ink-faint);
}

.notes-link {
  margin-top: 16px;
  font-size: 14px;
}

.notes-link a + a {
  margin-left: 14px;
}

.sitelinks {
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.sitelinks-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.sitelinks-list .sitelink-item a {
  display: block;
  padding: 14px;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
}

.sitelinks-list .sitelink-item a:hover,
.sitelinks-list .sitelink-item a:focus-visible {
  border-color: var(--green);
  text-decoration: none;
}

.sitelinks-list .sitelink-desc {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   pages：人气榜单页
   -------------------------------------------------------------------------- */
.ranking-list-section {
  padding-top: 0;
}

.ranking-list {
  display: grid;
  gap: 14px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.ranking-item:hover,
.ranking-item:focus-within {
  border-color: var(--green);
  transform: translateY(-2px);
}

.ranking-cover {
  min-width: 0;
}

.ranking-cover img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.ranking-body {
  min-width: 0;
}

.ranking-rank {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.rank-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--wheat);
}

.rank-label {
  font-size: 13px;
  color: var(--ink-faint);
}

.ranking-name {
  font-size: 18px;
  margin-bottom: 6px;
}

.ranking-genre {
  font-size: 14px;
  margin-bottom: 8px;
}

.ranking-note {
  font-size: 14px;
  color: var(--ink-soft);
}

.ranking-rules-section {
  padding-top: 30px;
  border-top: 1px solid var(--line);
  margin-top: 34px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.rule-card {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rule-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.rule-meaning {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.rule-scope {
  font-size: 13px;
  color: var(--ink-faint);
}

.rules-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.related-section {
  padding-top: 30px;
  border-top: 1px solid var(--line);
  margin-top: 34px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ranking-tail {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   pages：阅读说明页
   -------------------------------------------------------------------------- */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 38px;
  align-items: start;
}

.layout-main,
.layout-aside {
  min-width: 0;
}

.guide-section {
  padding-bottom: 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.guide-section:last-child {
  margin-bottom: 0;
}

.guide-figure {
  margin-bottom: 22px;
}

.guide-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.guide-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-faint);
}

.field-dictionary {
  border-top: 1px solid var(--line);
}

.field-item {
  border-bottom: 1px solid var(--line-soft);
}

.field-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.field-summary::-webkit-details-marker {
  display: none;
}

.field-summary::before {
  content: "＋";
  flex: 0 0 auto;
  width: 20px;
  color: var(--green);
  font-weight: 700;
}

.field-item[open] .field-summary::before {
  content: "－";
}

.field-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.field-body {
  padding: 0 0 16px 30px;
  font-size: 14px;
  color: var(--ink-soft);
}

.field-mean {
  margin-bottom: 8px;
}

.field-scope {
  font-size: 13px;
  color: var(--ink-faint);
}

.boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.boundary-col {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.boundary-include {
  border-left: 3px solid var(--green);
}

.boundary-exclude {
  border-left: 3px solid var(--wheat);
}

.boundary-title {
  font-size: 16px;
  margin-bottom: 10px;
}

.boundary-list {
  display: grid;
  gap: 8px;
}

.boundary-item {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.boundary-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--line);
  border-radius: 50%;
}

.boundary-include .boundary-item::before {
  background: var(--green);
}

.boundary-exclude .boundary-item::before {
  background: var(--wheat);
}

.boundary-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.boundary-note a + a {
  margin-left: 12px;
}

.feedback-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  counter-reset: feedback;
}

.feedback-step {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.step-title::before {
  counter-increment: feedback;
  content: counter(feedback) ". ";
  color: var(--wheat);
  font-family: var(--font-mono);
}

.step-text {
  font-size: 14px;
  color: var(--ink-soft);
}

.feedback-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.guide-aside {
  display: grid;
  gap: 18px;
}

.aside-block {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.aside-title {
  font-size: 16px;
  margin-bottom: 12px;
}

.aside-list {
  display: grid;
  gap: 8px;
}

.aside-item {
  font-size: 14px;
  color: var(--ink-soft);
}

.aside-text {
  font-size: 14px;
  color: var(--ink-soft);
}

.aside-link-list {
  display: grid;
  gap: 8px;
}

.aside-link-item a {
  display: inline-block;
  padding: 4px 0;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   pages：404
   -------------------------------------------------------------------------- */
.error-main {
  padding: 60px 20px 40px;
  max-width: var(--wrap);
  margin: 0 auto;
}

.error-panel {
  padding: 40px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--wheat);
  line-height: 1;
  margin-bottom: 14px;
}

.error-title {
  font-size: 26px;
  margin-bottom: 12px;
}

.error-text {
  max-width: 620px;
  margin: 0 auto 24px;
  font-size: 15px;
  color: var(--ink-soft);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.error-links {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.error-link-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.error-link-list a {
  display: block;
  padding: 14px;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
}

.error-link-list a:hover,
.error-link-list a:focus-visible {
  border-color: var(--green);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   responsive：断点 900px / 768px / 480px
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-layout,
  .split-layout,
  .update-overview,
  .page-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .genre-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .genre-card {
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }

  .genre-card:nth-child(odd) {
    border-right: 1px solid var(--line-soft);
  }

  .genre-card:nth-last-child(-n + 2) {
    border-bottom: none;
  }

  .cover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sitelink-grid,
  .sitelinks-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-grid,
  .rules-grid,
  .feedback-steps,
  .related-links,
  .related-list,
  .error-link-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 10px 16px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    flex: 0 0 100%;
    margin-left: 0;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 4px;
    border-top: 1px solid var(--line);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list > li {
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-link {
    display: block;
    padding: 12px 4px;
    min-height: 44px;
    font-size: 16px;
    border-bottom: none;
  }

  .nav-link.is-current {
    border-bottom: none;
    box-shadow: inset 3px 0 0 var(--green);
    padding-left: 12px;
  }

  .container,
  .inner-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-main > section,
  .inner-main > section {
    padding: 30px 0;
  }

  .page-title,
  .hero-copy .page-title {
    font-size: 24px;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 30px;
  }

  .cover-grid,
  .genre-grid,
  .sitelink-grid,
  .sitelinks-list,
  .notes-grid,
  .rules-grid,
  .feedback-steps,
  .related-links,
  .related-list,
  .error-link-list,
  .boundary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .genre-card,
  .genre-card:nth-child(odd) {
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }

  .genre-card:last-child {
    border-bottom: none;
  }

  .update-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 14px 16px;
  }

  .update-date {
    order: -1;
  }

  .genre-group-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .genre-group-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .ranking-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .ranking-cover img {
    aspect-ratio: 16 / 9;
  }

  .mini-rank-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .rank-note {
    grid-column: 2 / -1;
    font-size: 13px;
  }

  .update-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .update-table thead,
  .update-table tbody,
  .update-table tr {
    display: block;
  }

  .update-table thead {
    display: none;
  }

  .update-table tbody tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    white-space: normal;
  }

  .update-table tbody tr:last-child {
    border-bottom: none;
  }

  .update-table tbody td {
    display: block;
    padding: 2px 0;
    border-bottom: none;
    width: auto;
  }

  .update-table tbody td.col-date {
    font-size: 13px;
  }

  .update-table tbody td.col-entry {
    font-size: 16px;
  }

  .boundary-grid {
    gap: 14px;
  }

  .field-body {
    padding-left: 0;
  }

  .error-panel {
    padding: 30px 20px;
  }

  .error-code {
    font-size: 40px;
  }

  .error-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%;
  }

  .hero-tag a {
    padding: 6px 12px;
  }

  .section-title {
    font-size: 19px;
  }

  .brand-mark {
    font-size: 19px;
  }

  .brand-sub {
    font-size: 12px;
  }
}

/* 动效增强：滚动淡入（不依赖 JS 也可见） */
@media (prefers-reduced-motion: no-preference) {
  .section-head,
  .genre-card,
  .cover-item,
  .note-card,
  .rule-card,
  .feedback-step,
  .aside-block {
    animation: fade-up 0.5s ease both;
  }
}

@keyframes fade-up {
  from {
    transform: translateY(10px);
  }
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cover-item,
  .ranking-item,
  .sitelink {
    transition: none;
  }
}
