/* ==========================================================================
   里番动漫 lmrrz.cn — 全站样式表
   分组：base / layout / components / pages / responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   base — 变量、重置、排版基线
   -------------------------------------------------------------------------- */

:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-alt: #fbfbfc;
  --text: #1f2328;
  --text-sub: #5a6169;
  --text-mute: #7b828a;
  --line: #d8dce0;
  --line-soft: #e8eaed;
  --accent: #b23a3a;
  --accent-dark: #8e2c2c;
  --status-ongoing: #2f7d4f;
  --status-finished: #3a5fa8;
  --status-hiatus: #a8621f;
  --radius: 6px;
  --radius-sm: 4px;
  --container: 1180px;
  --gutter: 20px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-soft: 0 1px 2px rgba(31, 35, 40, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

strong {
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   layout — 骨架：容器、页头、导航、主体、面包屑、页脚
   -------------------------------------------------------------------------- */

.site-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.site-main {
  flex: 1 1 auto;
  width: 100%;
}

.inner-main,
.home-main {
  width: 100%;
}

/* 通用内容容器 */
.header-inner,
.factbar-inner,
.footer-inner,
.home-main > section,
.inner-main > .breadcrumb,
.inner-main > .page-header,
.inner-main > .page-layout,
.inner-main > .pager,
.inner-main > .page-pager,
.inner-main > .error-panel {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* 顶部事实条 */
.top-factbar {
  background: #23272c;
  color: #d6dae0;
  font-size: 13px;
}

.factbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.factbar-text {
  color: #c3c9d0;
  line-height: 1.5;
}

.factbar-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.factbar-links a {
  color: #f0d9d9;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.factbar-links a:hover {
  color: #ffffff;
  border-bottom-color: var(--accent);
}

/* 页头 */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.brand-slogan {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.3;
}

.brand:hover .brand-name {
  color: var(--accent);
}

/* 主导航 */
.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text-sub);
  border-radius: var(--radius-sm);
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.nav-link.is-current {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

/* 汉堡按钮（桌面隐藏） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 16px;
  padding-bottom: 0;
  font-size: 13px;
  color: var(--text-mute);
}

.breadcrumb a {
  color: var(--text-sub);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  color: var(--line);
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* 页面标题区 */
.page-header {
  padding-top: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.page-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
}

.page-description {
  margin-top: 10px;
  max-width: 900px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.8;
}

/* 页脚 */
.site-footer {
  margin-top: 40px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer-inner {
  padding-top: 26px;
  padding-bottom: 20px;
}

.footer-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.footer-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-list a {
  font-size: 13px;
  color: var(--text-sub);
}

.footer-list a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--text-mute);
}

.footer-brand {
  font-weight: 700;
  color: var(--text);
}

.footer-note {
  color: var(--text-sub);
}

.footer-copy {
  color: var(--text-mute);
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   components — 全站复用组件
   -------------------------------------------------------------------------- */

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #ffffff;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* 文本链接 */
.text-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid rgba(178, 58, 58, 0.35);
}

.text-link:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
}

/* 连载状态标签 */
.status {
  display: inline-block;
  padding: 1px 8px;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid currentColor;
}

.status-ongoing,
.status.status-ongoing {
  color: var(--status-ongoing);
}

.status-finished,
.status.status-completed,
.status.status-finished {
  color: var(--status-finished);
}

.status-hiatus,
.status.status-paused,
.status.status-hiatus {
  color: var(--status-hiatus);
}

/* 图片容器 */
.content-media,
.hero-figure,
.section-media,
.genre-media,
.update-media,
.guide-figure,
.rank-cover {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.content-media img,
.hero-figure img,
.section-media img,
.genre-media img,
.update-media img,
.guide-figure img,
.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

figcaption {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.6;
}

/* 通用区块头 */
.section-head {
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.section-desc {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.8;
}

.section-desc a,
.section-lead a {
  color: var(--accent);
  border-bottom: 1px solid rgba(178, 58, 58, 0.3);
}

.section-desc a:hover,
.section-lead a:hover {
  color: var(--accent-dark);
}

.section-foot {
  margin-top: 14px;
  font-size: 13px;
}

.section-lead {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.8;
}

.sub-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

/* 侧栏（内页三栏） */
.page-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 200px;
  gap: 28px;
  align-items: start;
}

.page-aside,
.side-toc,
.side-links,
.page-toc,
.page-side {
  position: sticky;
  top: 86px;
  font-size: 13px;
}

.aside-title,
.side-toc-title,
.side-links-title,
.toc-title,
.side-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.aside-list,
.side-toc-list,
.side-links-list,
.toc-list,
.side-list,
.aside-link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aside-list a,
.side-toc-list a,
.side-links-list a,
.toc-list a,
.side-list a,
.aside-link-list a {
  display: block;
  padding: 5px 8px;
  color: var(--text-sub);
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.aside-list a:hover,
.side-toc-list a:hover,
.side-links-list a:hover,
.toc-list a:hover,
.side-list a:hover,
.aside-link-list a:hover {
  color: var(--accent);
  background: var(--surface-alt);
  border-left-color: var(--accent);
}

/* 翻页导航 */
.page-pager,
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.pager-link,
.pager-prev,
.pager-next {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 44px;
}

.pager-link:hover,
.pager-prev:hover,
.pager-next:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pager-label {
  font-size: 12px;
  color: var(--text-mute);
}

.pager-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pager-next {
  text-align: right;
}

/* 交叉入口卡片 */
.cross-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.cross-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.cross-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cross-desc,
.cross-text {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
}

.cross-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.cross-link:hover {
  color: var(--accent-dark);
}

/* 字段说明表 */
.field-table {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}

.field-table caption,
.field-caption {
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line-soft);
}

.field-table th,
.field-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.field-table thead th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text);
}

.field-table tbody tr:last-child th,
.field-table tbody tr:last-child td {
  border-bottom: 0;
}

.field-name {
  font-weight: 700;
  white-space: nowrap;
}

/* 状态图例 */
.status-legend {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

/* FAQ */
.faq-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
}

.faq-question {
  padding: 13px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 26px;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.faq-item[open] .faq-question::after {
  content: "–";
}

.faq-answer {
  padding: 0 0 14px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

/* --------------------------------------------------------------------------
   pages — 首页
   -------------------------------------------------------------------------- */

/* 首屏作品索引区 */
.hero-index {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-top: 26px;
  padding-bottom: 8px;
}

.hero-col {
  min-width: 0;
}

.hero-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
}

.hero-summary {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.85;
  max-width: 640px;
}

.hero-genre-entry {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.genre-chip {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.genre-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-figure {
  margin-top: 20px;
  aspect-ratio: 16 / 7;
}

.hero-figure figcaption {
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

/* 首屏右侧更新摘要面板 */
.hero-update-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
}

.panel-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.7;
}

.update-mini-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
}

.update-mini-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  grid-template-areas:
    "date name status"
    "date tag status";
  gap: 2px 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.update-mini-item:last-child {
  border-bottom: 0;
}

.update-mini-item .update-date {
  grid-area: date;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mute);
}

.update-mini-item .update-name {
  grid-area: name;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-mini-item .update-tag {
  grid-area: tag;
  font-size: 12px;
  color: var(--text-mute);
}

.update-mini-item .status {
  grid-area: status;
  justify-self: end;
}

.panel-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.panel-more:hover {
  color: var(--accent-dark);
}

/* 首页首屏下方主视觉图 */
.content-media-primary {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 8;
  margin-top: 4px;
}

.content-media-primary figcaption {
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
}

/* 首页通用区块 */
.home-section {
  padding-top: 34px;
  padding-bottom: 6px;
}

/* 题材分类索引 */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.genre-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.genre-name {
  font-size: 16px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.genre-scope {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
}

.genre-works {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.genre-works li {
  font-size: 13px;
  padding-left: 12px;
  position: relative;
}

.genre-works li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  background: var(--line);
  border-radius: 50%;
}

.genre-works a {
  color: var(--text-sub);
}

.genre-works a:hover {
  color: var(--accent);
}

/* 最近更新记录表 */
.update-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.update-table-head,
.update-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 92px 90px 92px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
}

.update-table-head {
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line);
}

.update-row {
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.update-row:last-child {
  border-bottom: 0;
}

.update-row:hover {
  background: var(--surface-alt);
}

.update-row .col-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mute);
}

.update-row .col-name a {
  font-weight: 600;
  color: var(--text);
}

.update-row .col-name a:hover {
  color: var(--accent);
}

.update-row .col-genre,
.update-row .col-chapter {
  color: var(--text-sub);
}

.update-row .col-status {
  justify-self: start;
}

/* 人气榜单与编辑推荐 */
.rank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.rank-col {
  min-width: 0;
}

.col-title {
  font-size: 16px;
  font-weight: 700;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.rank-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.rank-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 84px 84px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.rank-item:last-child {
  border-bottom: 0;
}

.rank-item:hover {
  background: var(--surface-alt);
}

.rank-no {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.rank-name {
  font-weight: 600;
  color: var(--text);
}

.rank-genre {
  color: var(--text-mute);
  font-size: 12px;
}

.rank-item .status {
  justify-self: start;
}

.rank-note-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.rank-note {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

.rank-note + .rank-note {
  margin-top: 12px;
}

.rank-reason-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-reason-list li {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.rank-reason-list strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

/* 阅读说明与内容反馈摘要 */
.read-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.read-col {
  min-width: 0;
}

.read-field-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.field-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  font-size: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.field-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.field-list .field-name {
  color: var(--text);
}

.field-list .field-desc {
  color: var(--text-sub);
  line-height: 1.7;
}

.read-feedback-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.read-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

.feedback-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

.feedback-list li {
  padding-left: 12px;
  position: relative;
  line-height: 1.75;
}

.feedback-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* 站内栏目索引 */
.site-index-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.index-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 44px;
}

.index-card:hover {
  border-color: var(--accent);
}

.index-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.index-card:hover .index-name {
  color: var(--accent);
}

.index-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   pages — 内页公共区块
   -------------------------------------------------------------------------- */

.content-section,
.section-block,
.section {
  margin-bottom: 30px;
}

.content-article,
.page-content {
  min-width: 0;
}

.content-section > .section-title,
.section-block > .section-title,
.section > .section-title {
  font-size: 20px;
}

/* 内页图片 */
.section-media,
.update-media,
.guide-figure {
  margin-top: 14px;
}

.section-media img,
.update-media img,
.guide-figure img {
  aspect-ratio: 16 / 7;
}

.section-media figcaption,
.update-media-caption,
.guide-figure figcaption {
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
}

/* 题材分类页 — 总览列表 */
.overview-list {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.overview-row {
  display: grid;
  grid-template-columns: 40px 120px minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.overview-row:last-child {
  border-bottom: 0;
}

.overview-row:hover {
  background: var(--surface-alt);
}

.overview-no {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.overview-name {
  font-weight: 700;
  color: var(--text);
}

.overview-scope {
  color: var(--text-sub);
  line-height: 1.7;
}

.overview-count {
  color: var(--text-mute);
  font-size: 12px;
}

/* 题材分类页 — 各题材内容块 */
.genre-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}

.genre-title {
  font-size: 17px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.genre-media {
  margin-top: 14px;
}

.genre-media img {
  aspect-ratio: 16 / 6;
}

.genre-media figcaption {
  padding: 8px 12px;
  background: var(--surface-alt);
  border-top: 1px solid var(--line-soft);
}

.genre-block .genre-scope {
  margin-top: 12px;
}

.genre-setting {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

/* 题材分类页 — 代表作品条目 */
.entry-list {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 96px 88px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.entry-row:last-child {
  border-bottom: 0;
}

.entry-row:hover {
  background: var(--surface-alt);
}

.entry-title {
  font-weight: 600;
  color: var(--text);
}

.entry-genre {
  color: var(--text-mute);
  font-size: 12px;
}

.entry-chapter {
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: 12px;
}

.entry-status {
  justify-self: start;
}

/* 题材分类页 — 选择方法 */
.howto-list {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.howto-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  counter-increment: howto;
}

.howto-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.howto-step p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

/* 最近更新页 — 更新列表 */
.update-list {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.update-list .update-row {
  display: grid;
  grid-template-columns: 92px 56px minmax(0, 1fr) 96px 96px 88px;
  gap: 12px;
  align-items: center;
  padding: 9px 16px;
}

.update-list .update-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mute);
}

.update-thumb {
  width: 56px;
  height: 38px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.update-list .update-name {
  font-weight: 600;
  color: var(--text);
}

.update-list .update-name:hover {
  color: var(--accent);
}

.update-list .update-genre {
  color: var(--text-mute);
  font-size: 12px;
}

.update-list .update-chapter {
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: 12px;
}

.update-list .status {
  justify-self: start;
}

/* 最近更新页 — 按日期归组 */
.group-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
}

.group-date {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-item {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
  padding-left: 12px;
  position: relative;
}

.group-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  background: var(--line);
  border-radius: 50%;
}

/* 人气榜单页 — 位次条目 */
.ranking-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ranking-item {
  display: grid;
  grid-template-columns: 44px 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.ranking-item:last-child {
  border-bottom: 0;
}

.ranking-item:hover {
  background: var(--surface-alt);
}

.rank-index {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.rank-cover {
  width: 96px;
  height: 64px;
}

.rank-main {
  min-width: 0;
}

.rank-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.rank-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-mute);
}

.rank-reason {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
}

/* 人气榜单页 — 编辑推荐说明 */
.note-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.note-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.note-text {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

/* 人气榜单页 — 按题材分组摘要 */
.genre-group-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.genre-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.genre-group-title {
  font-size: 15px;
  font-weight: 700;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.genre-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.genre-rank-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  align-items: baseline;
}

.genre-rank-pos {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
}

/* 阅读说明页 — 字段与状态 */
.status-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
}

.status-desc {
  color: var(--text-sub);
  line-height: 1.75;
}

.status-tag {
  justify-self: start;
}

/* 阅读说明页 — 读法说明 */
.reading-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.reading-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.reading-block p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

.reading-sample {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
}

/* 阅读说明页 — 内容反馈 */
.feedback-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.feedback-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* --------------------------------------------------------------------------
   pages — 404
   -------------------------------------------------------------------------- */

.error-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.error-panel {
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-align: left;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.error-title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.error-desc {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.85;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.error-links {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13px;
}

.error-links a {
  color: var(--accent);
  font-weight: 600;
}

.error-links a:hover {
  color: var(--accent-dark);
}

/* --------------------------------------------------------------------------
   responsive — 960px / 640px
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    flex-basis: 100%;
    order: 3;
    justify-content: flex-start;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 6px 0;
    border-top: 1px solid var(--line);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-link {
    padding: 12px 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-link.is-current {
    border-bottom-color: var(--line-soft);
    background: var(--surface-alt);
  }

  /* 首页首屏改为单列 */
  .hero-index {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .genre-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rank-layout,
  .read-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* 内页三栏 → 单列，正文在前，侧栏在后 */
  .page-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .page-aside,
  .side-toc,
  .side-links,
  .page-toc,
  .page-side {
    position: static;
    order: 2;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .page-content,
  .content-article {
    order: 1;
  }

  .update-table-head,
  .update-row {
    grid-template-columns: 84px minmax(0, 1fr) 84px 78px 84px;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 14px;
  }

  body {
    font-size: 14px;
  }

  .factbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .factbar-links {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-inner {
    min-height: 58px;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-slogan {
    font-size: 11px;
  }

  .page-title,
  .hero-title {
    font-size: 22px;
  }

  .page-header {
    padding-top: 12px;
    padding-bottom: 14px;
    margin-bottom: 18px;
  }

  .section-title,
  .content-section > .section-title,
  .section-block > .section-title,
  .section > .section-title {
    font-size: 17px;
  }

  .hero-summary {
    font-size: 14px;
  }

  .hero-figure {
    aspect-ratio: 16 / 9;
  }

  .content-media-primary {
    aspect-ratio: 16 / 9;
  }

  .genre-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 首页更新表在窄屏改为卡片式两列 */
  .update-table-head {
    display: none;
  }

  .update-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name status"
      "date chapter"
      "genre chapter";
    gap: 4px 10px;
    padding: 12px 14px;
  }

  .update-row .col-name {
    grid-area: name;
  }

  .update-row .col-status {
    grid-area: status;
    justify-self: end;
  }

  .update-row .col-date {
    grid-area: date;
  }

  .update-row .col-genre {
    grid-area: genre;
  }

  .update-row .col-chapter {
    grid-area: chapter;
    justify-self: end;
    align-self: end;
  }

  .rank-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas:
      "no name status"
      "no genre status";
    gap: 2px 10px;
    padding: 11px 14px;
  }

  .rank-item .rank-no {
    grid-area: no;
  }

  .rank-item .rank-name {
    grid-area: name;
  }

  .rank-item .rank-genre {
    grid-area: genre;
  }

  .rank-item .status {
    grid-area: status;
    justify-self: end;
  }

  .site-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-row {
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-areas:
      "no name"
      "no scope"
      "no count";
    gap: 2px 10px;
    padding: 12px 14px;
  }

  .overview-row .overview-no {
    grid-area: no;
  }

  .overview-row .overview-name {
    grid-area: name;
  }

  .overview-row .overview-scope {
    grid-area: scope;
  }

  .overview-row .overview-count {
    grid-area: count;
  }

  .entry-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title status"
      "genre chapter";
    gap: 4px 10px;
    padding: 11px 14px;
  }

  .entry-row .entry-title {
    grid-area: title;
  }

  .entry-row .entry-status {
    grid-area: status;
    justify-self: end;
  }

  .entry-row .entry-genre {
    grid-area: genre;
  }

  .entry-row .entry-chapter {
    grid-area: chapter;
    justify-self: end;
  }

  /* 更新页列表窄屏卡片化 */
  .update-list .update-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb name status"
      "thumb date chapter"
      "thumb genre chapter";
    gap: 3px 10px;
    padding: 11px 14px;
  }

  .update-list .update-thumb {
    grid-area: thumb;
    width: 56px;
    height: 44px;
    align-self: center;
  }

  .update-list .update-name {
    grid-area: name;
  }

  .update-list .status {
    grid-area: status;
    justify-self: end;
  }

  .update-list .update-date {
    grid-area: date;
  }

  .update-list .update-genre {
    grid-area: genre;
  }

  .update-list .update-chapter {
    grid-area: chapter;
    justify-self: end;
  }

  .ranking-item {
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas:
      "index title"
      "index meta"
      "index reason";
    gap: 4px 12px;
    padding: 12px 14px;
  }

  .ranking-item .rank-index {
    grid-area: index;
    font-size: 16px;
    align-self: start;
    padding-top: 2px;
  }

  .ranking-item .rank-cover {
    display: none;
  }

  .ranking-item .rank-main {
    display: contents;
  }

  .ranking-item .rank-title {
    grid-area: title;
  }

  .ranking-item .rank-meta {
    grid-area: meta;
  }

  .ranking-item .rank-reason {
    grid-area: reason;
  }

  .field-table {
    font-size: 12.5px;
  }

  .field-table th,
  .field-table td {
    padding: 9px 10px;
  }

  .field-list li,
  .status-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .page-pager,
  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager-next {
    text-align: left;
  }

  .footer-groups {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }

  .footer-copy {
    margin-left: 0;
  }

  .error-panel {
    padding: 22px 18px;
  }

  .error-title {
    font-size: 20px;
  }

  .error-actions .btn {
    flex: 1 1 auto;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
