/* ==========================================================================
   韩漫屋漫画免费版 · 全站样式
   分组：base / layout / components / pages / responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   base
   -------------------------------------------------------------------------- */

:root {
  --bg: #0e1116;
  --panel: #161b23;
  --panel-2: #1b212b;
  --line: #232b36;
  --line-strong: #313b49;
  --text: #e6eaf0;
  --text-dim: #96a1b3;
  --accent: #35d0c4;
  --live: #f2b544;
  --done: #7f8ea3;
  --warn: #e0605a;
  --radius: 6px;
  --radius-sm: 4px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
  --shell-max: 1180px;
  --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: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: #6ee6dc;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  vertical-align: top;
}

.mono,
.num,
.num-body,
.order-num,
.follow-num,
.numbered-index,
.cell-num,
.col-no,
.col-num,
.status-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   layout · 全站骨架
   -------------------------------------------------------------------------- */

.site-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #10151c;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: var(--shell-max);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
}

.brand {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.brand:hover,
.brand:focus-visible {
  color: var(--accent);
}

.site-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.nav-list li {
  flex: 0 0 auto;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--text);
  background: var(--panel);
}

.nav-list a.is-current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 移动菜单按钮 */
.menu-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.menu-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 主内容 */
.site-main {
  flex: 1 1 auto;
  width: 100%;
}

.home-main {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--shell-pad) 56px;
}

.inner-main {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--shell-pad) 56px;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-dim);
}

.breadcrumb a {
  color: var(--text-dim);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--accent);
}

.breadcrumb-sep {
  color: #4a5563;
}

.breadcrumb-current {
  color: var(--text);
}

/* 页面标题区 */
.page-header {
  padding: 28px 0 20px;
}

.page-title {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.page-title + .page-lead,
.page-title-block .page-lead,
.page-title .page-lead {
  margin-top: 10px;
}

.page-lead {
  max-width: 46em;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
}

.page-lead + .page-lead {
  margin-top: 8px;
}

.page-meta,
.page-status,
.page-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

.page-meta .mono,
.page-status .mono,
.page-status .status-mono,
.page-status-line .mono {
  color: var(--text-dim);
}

.page-title-block {
  padding: 0 0 24px;
}

/* 页脚 */
.site-footer {
  margin-top: auto;
  background: #10151c;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px 40px;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 36px var(--shell-pad) 22px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  grid-column: 1 / -1;
}

.footer-group {
  min-width: 0;
}

.footer-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}

.footer-group ul {
  display: flex;
  flex-direction: column;
}

.footer-group li {
  min-height: 40px;
}

.footer-group a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-group a:hover,
.footer-group a:focus-visible {
  color: var(--accent);
}

.footer-about {
  min-width: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.footer-about p + p {
  margin-top: 6px;
}

.footer-legend {
  min-width: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.legend-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.footer-legend ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.footer-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-dim);
}

.copyright {
  min-width: 0;
}

.back-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.back-top:hover,
.back-top:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   components · 通用组件
   -------------------------------------------------------------------------- */

/* 区块标题与说明 */
.section-title {
  position: relative;
  padding-left: 12px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.section-lead,
.section-intro,
.section-desc {
  max-width: 46em;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06211f;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #5ee1d7;
  border-color: #5ee1d7;
  color: #06211f;
}

.btn-secondary {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-dim);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* 状态徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: 2px;
  border: 1px solid transparent;
}

.badge-live {
  color: var(--live);
  border-color: rgba(242, 181, 68, 0.45);
  background: rgba(242, 181, 68, 0.1);
}

.badge-done {
  color: var(--done);
  border-color: rgba(127, 142, 163, 0.5);
  background: rgba(127, 142, 163, 0.12);
}

.badge-arch {
  color: var(--done);
  border-color: rgba(127, 142, 163, 0.5);
  background: rgba(127, 142, 163, 0.12);
}

.badge-archived {
  color: var(--done);
  border-color: rgba(127, 142, 163, 0.5);
  background: rgba(127, 142, 163, 0.12);
}

.badge-step {
  color: var(--accent);
  border-color: rgba(53, 208, 196, 0.45);
  background: rgba(53, 208, 196, 0.1);
}

.badge-note {
  color: var(--warn);
  border-color: rgba(224, 96, 90, 0.5);
  background: rgba(224, 96, 90, 0.1);
}

/* 表格通用 */
.table-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  min-width: 560px;
  font-size: 13px;
  line-height: 1.5;
}

.data-table caption,
.table-caption {
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}

.data-table thead th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: #131922;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table tbody th,
.data-table tbody td {
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--panel-2);
}

.data-table tbody th {
  font-weight: 600;
}

.data-table a {
  color: var(--accent);
}

.data-table a:hover,
.data-table a:focus-visible {
  color: #6ee6dc;
}

/* 标签 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-decoration: underline;
  text-decoration-color: rgba(53, 208, 196, 0.4);
  text-underline-offset: 3px;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.tag:hover,
.tag:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--panel-2);
}

/* 编号列表 */
.numbered-list,
.order-list,
.follow-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.numbered-item,
.order-list > li,
.follow-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.numbered-index,
.order-num,
.follow-num {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
}

.numbered-body,
.order-body,
.follow-body {
  min-width: 0;
}

.numbered-title,
.order-body h3,
.follow-body h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.numbered-body p,
.order-body p,
.follow-body p {
  margin-top: 4px;
  max-width: 46em;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

/* 相关入口 */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.related-list li {
  display: block;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.related-list a {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.related-list p,
.related-desc {
  display: block;
  margin-top: 4px;
  max-width: 46em;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* 双栏通用 */
.two-column,
.compare-columns,
.maintain-columns,
.combo-columns,
.notes-columns,
.rationale-layout {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.two-column,
.compare-columns,
.maintain-columns,
.combo-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-column > article,
.compare-col,
.maintain-col,
.combo-card {
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.two-column h3,
.compare-col h3,
.maintain-col h3,
.combo-title {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.two-column p,
.compare-col li,
.maintain-col p,
.combo-card p {
  margin-top: 6px;
  max-width: 46em;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.compare-col ul {
  margin-top: 8px;
  padding-left: 0;
}

.compare-col li {
  position: relative;
  padding-left: 14px;
}

.compare-col li + li {
  margin-top: 6px;
}

.compare-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 1px;
}

/* figure 通用约束 */
.hero-media,
.cover-media,
.pick-media,
.note-media,
.combo-figure,
.guide-figure,
.archive-media,
.scope-figure {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.hero-media img,
.cover-media img,
.pick-media img,
.note-media img,
.combo-figure img,
.guide-figure img,
.archive-media img,
.scope-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media figcaption,
.note-media figcaption,
.combo-figure figcaption,
.guide-figure figcaption,
.archive-media figcaption,
.scope-figure figcaption {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   pages · 首页
   -------------------------------------------------------------------------- */

/* 首屏 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: stretch;
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--line);
}

.hero-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-text h1 {
  font-size: 30px;
  line-height: 1.28;
  font-weight: 700;
  color: var(--text);
}

.hero-lead {
  margin-top: 12px;
  max-width: 40em;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-status {
  margin-top: auto;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}

.hero-media {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-media img {
  flex: 1 1 auto;
  min-height: 220px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* 锚点导航 */
.anchor-nav {
  margin: 0 -4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.anchor-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 4px 2px;
  scrollbar-width: thin;
}

.anchor-list li {
  flex: 0 0 auto;
}

.anchor-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-dim);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--panel);
  white-space: nowrap;
}

.anchor-list a:hover,
.anchor-list a:focus-visible {
  color: var(--text);
  background: var(--panel-2);
}

.anchor-list a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--panel-2);
}

/* 通用区块 */
.section {
  padding: 32px 0 0;
}

.section > .section-lead,
.section > .section-intro {
  margin-top: 8px;
}

.section-more,
.tags-more {
  margin-top: 14px;
  font-size: 13px;
}

.section-more a,
.tags-more a,
.entry-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-weight: 600;
  color: var(--accent);
}

.section-more a:hover,
.tags-more a:hover,
.entry-link:hover,
.section-more a:focus-visible,
.tags-more a:focus-visible,
.entry-link:focus-visible {
  color: #6ee6dc;
}

/* 栏目总览表 */
.columns-table tbody th {
  width: 22%;
  color: var(--text);
}

.columns-table tbody td {
  color: var(--text-dim);
}

.columns-table tbody td:last-child {
  white-space: nowrap;
}

.columns-table tbody td:last-child a {
  font-weight: 600;
}

/* 封面墙 */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cover-card {
  min-width: 0;
}

.cover-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.cover-link:hover,
.cover-link:focus-visible {
  border-color: var(--accent);
  background: var(--panel-2);
  color: var(--text);
}

.cover-no {
  display: block;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}

.cover-media {
  margin: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: 4 / 3;
}

.cover-media img {
  aspect-ratio: 4 / 3;
}

.cover-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.cover-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

/* 更新摘要表 */
.digest-table {
  min-width: 520px;
}

.digest-table .col-no {
  width: 64px;
  color: var(--text-dim);
}

.digest-table tbody th {
  color: var(--text);
}

.digest-table tbody td {
  color: var(--text-dim);
}

.digest-table tbody td:last-child {
  white-space: nowrap;
}

/* 题材标签带 */
.tag-list + .tags-more {
  margin-top: 12px;
}

/* 阅读提示双栏 */
.notes-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.note-col {
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.note-col h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.note-col p {
  margin-top: 8px;
  max-width: 46em;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.note-media {
  margin-top: 14px;
  aspect-ratio: 16 / 9;
}

.note-media img {
  aspect-ratio: 16 / 9;
}

/* 站务公告 */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.notice-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.notice-row:hover {
  background: var(--panel-2);
}

.notice-text {
  min-width: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.notice-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   pages · 内页通用区块
   -------------------------------------------------------------------------- */

.content-block,
.section-block,
.record-section,
.legend-section,
.maintain-section,
.follow-section,
.related-section,
.scope-summary,
.faq-group,
.feedback-note,
.picks-row,
.rationale-columns,
.reading-order,
.link-to-updates,
.related-entry,
.relation-block,
.related-block,
.cross-combo-block,
.select-steps-block,
.genre-table-block {
  padding: 28px 0 0;
}

.content-block h2,
.section-block h2,
.record-section h2,
.legend-section h2,
.maintain-section h2,
.follow-section h2,
.related-section h2,
.scope-summary h2,
.faq-group h2,
.feedback-note h2,
.picks-row h2,
.rationale-columns h2,
.reading-order h2,
.link-to-updates h2,
.related-entry h2,
.relation-block h2,
.related-block h2,
.cross-combo-block h2,
.select-steps-block h2,
.genre-table-block h2 {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
}

.content-block .section-intro,
.record-section .section-desc,
.legend-section .section-desc,
.follow-section .section-desc,
.scope-summary .section-intro,
.faq-group .section-intro,
.section-block .section-desc {
  margin-top: 8px;
}

.relation-block p,
.link-to-updates p,
.feedback-note p {
  margin-top: 10px;
  max-width: 46em;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
}

/* 内容容器（完结页） */
.content-container {
  width: 100%;
}

/* 内页页标题区（各页差异在模块内，不覆盖全局） */
.inner-main .page-title {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
}

/* 今日推荐页 */
.page-today .picks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pick-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.pick-media {
  margin: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: 4 / 3;
}

.pick-media img {
  aspect-ratio: 4 / 3;
}

.pick-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.pick-index {
  font-size: 12px;
  color: var(--text-dim);
}

.pick-body h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.pick-body p {
  max-width: 46em;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.pick-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.pick-note {
  font-size: 12px;
  color: var(--text-dim);
}

.pick-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.rationale-layout {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: start;
}

.rationale-text,
.rationale-status {
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rationale-text h3,
.rationale-status h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.rationale-text p {
  margin-top: 8px;
  max-width: 46em;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
}

.status-table {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.status-table thead th {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: #131922;
  border-bottom: 1px solid var(--line);
}

.status-table tbody td,
.status-table tbody th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.status-table tbody tr:last-child td,
.status-table tbody tr:last-child th {
  border-bottom: 0;
}

.status-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}

.inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* 题材分类页 */
.genre-table {
  min-width: 720px;
}

.genre-table tbody th {
  width: 14%;
  color: var(--text);
}

.genre-table tbody td {
  color: var(--text-dim);
}

.genre-table tbody td:last-child {
  white-space: nowrap;
}

.combo-figure {
  margin: 0 0 12px;
  aspect-ratio: 16 / 9;
}

.combo-figure img {
  aspect-ratio: 16 / 9;
}

.combo-note {
  font-size: 12px;
  color: var(--text-dim);
}

/* 连载更新页 */
.record-table {
  width: 100%;
  min-width: 560px;
  font-size: 13px;
  line-height: 1.5;
}

.record-table thead th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: #131922;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.record-table tbody td {
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.record-table tbody tr:last-child td {
  border-bottom: 0;
}

.record-table tbody tr:hover {
  background: var(--panel-2);
}

.record-table .cell-num {
  width: 64px;
  color: var(--text-dim);
}

.record-table .cell-title {
  font-weight: 600;
}

.record-table .cell-stage {
  color: var(--text-dim);
}

.record-table tbody td:last-child {
  white-space: nowrap;
}

.table-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}

.state-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.legend-item {
  min-width: 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legend-item dt {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-item dd {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.maintain-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 完结作品页 */
.section-block .archive-media {
  margin: 14px 0 0;
  max-width: 720px;
  aspect-ratio: 16 / 9;
}

.archive-media img {
  aspect-ratio: 16 / 9;
}

.archive-table {
  min-width: 560px;
}

.archive-table tbody th {
  width: 12%;
  color: var(--text);
}

.archive-table .col-num {
  width: 64px;
  color: var(--text-dim);
}

.archive-table tbody td {
  color: var(--text-dim);
}

.archive-table tbody td:last-child {
  white-space: nowrap;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.path-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.path-name {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.path-fit {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

.path-steps {
  margin-top: 10px;
  padding-left: 0;
  counter-reset: path-step;
}

.path-steps li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  counter-increment: path-step;
}

.path-steps li + li {
  margin-top: 6px;
}

.path-steps li::before {
  content: counter(path-step) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.compare-list {
  margin-top: 8px;
  padding-left: 0;
}

.compare-list li {
  position: relative;
  padding-left: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.compare-list li + li {
  margin-top: 6px;
}

.compare-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 1px;
}

.back-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

/* 阅读指南页 */
.page-guide .page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: start;
  padding-top: 8px;
}

/* 侧栏在前的真实 DOM：.page-layout.sidebar-left */
.page-layout.sidebar-left {
  grid-template-columns: 240px minmax(0, 1fr);
}

.page-layout.sidebar-left .toc-aside {
  order: 0;
}

.page-layout.sidebar-left .article-body {
  order: 1;
}

.toc-aside {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toc-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.toc-nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-dim);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
}

.toc-nav a:hover,
.toc-nav a:focus-visible {
  color: var(--text);
  background: var(--panel-2);
  border-left-color: var(--accent);
}

.article-body {
  min-width: 0;
}

.guide-section {
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
}

.guide-section + .guide-section {
  padding-top: 28px;
}

.guide-section h2 {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
}

.guide-section > p {
  margin-top: 10px;
  max-width: 46em;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
}

.guide-section > p a {
  font-weight: 600;
}

.stage-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.stage-card {
  min-width: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stage-card h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.stage-card p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.stage-dest {
  font-size: 13px;
  color: var(--accent);
}

.guide-figure {
  margin: 14px 0 0;
  max-width: 640px;
  aspect-ratio: 16 / 9;
}

.guide-figure img {
  aspect-ratio: 16 / 9;
}

.guide-section .numbered-list {
  margin-top: 14px;
}

.guide-section .numbered-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.guide-section .num {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent);
}

.num-body {
  min-width: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.compare-columns {
  margin-top: 14px;
}

.glossary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.glossary-item {
  min-width: 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.glossary-item dt {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.glossary-item dd {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.article-body .related-entry {
  padding-top: 28px;
}

/* 内容说明页 */
.scope-table {
  min-width: 520px;
}

.scope-table tbody th {
  width: 22%;
  color: var(--text);
}

.scope-table tbody td {
  color: var(--text-dim);
}

.scope-table tbody td:last-child {
  white-space: nowrap;
}

.scope-figure {
  margin: 16px 0 0;
  max-width: 640px;
  aspect-ratio: 16 / 9;
}

.scope-figure img {
  aspect-ratio: 16 / 9;
}

.faq-group {
  padding-top: 26px;
}

.faq-item {
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
}

.faq-item[open] .faq-summary::after {
  content: "−";
}

.faq-summary:hover {
  background: var(--panel-2);
}

.faq-body {
  padding: 0 16px 14px;
  border-top: 1px solid var(--line);
}

.faq-body p {
  margin-top: 10px;
  max-width: 46em;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
}

.feedback-note {
  padding-top: 26px;
}

/* --------------------------------------------------------------------------
   pages · 404
   -------------------------------------------------------------------------- */

.error-main {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 40px var(--shell-pad) 56px;
}

.error-panel {
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.error-code {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--warn);
}

.error-title {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

.error-lead {
  margin-top: 10px;
  max-width: 46em;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.error-paths {
  padding-top: 32px;
}

.error-path-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.error-path-item {
  min-width: 0;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.error-path-name {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

.error-path-name a {
  color: var(--accent);
}

.error-path-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    padding-top: 8px;
    padding-bottom: 8px;
    row-gap: 8px;
  }

  .brand {
    flex: 1 1 auto;
    font-size: 16px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    flex: 1 1 100%;
    order: 3;
  }

  /* 手机端只收起 .nav-list 本身 */
  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 6px;
    border-top: 1px solid var(--line);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list li {
    flex: 0 0 auto;
  }

  .nav-list a {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .nav-list a.is-current {
    border-bottom-color: var(--line);
    border-left: 3px solid var(--accent);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 24px 0 20px;
  }

  .hero-text h1 {
    font-size: 24px;
  }

  .hero-media img {
    min-height: 180px;
    aspect-ratio: 16 / 9;
  }

  .cover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-columns,
  .two-column,
  .compare-columns,
  .maintain-columns,
  .combo-columns,
  .state-legend,
  .glossary-list,
  .error-path-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .rationale-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-today .picks-grid,
  .stage-columns,
  .path-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 阅读指南：正文在前，目录在后 */
  .page-layout.sidebar-left {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .page-layout.sidebar-left .article-body {
    order: 0;
  }

  .page-layout.sidebar-left .toc-aside {
    order: 1;
    position: static;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-top: 28px;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
  }

  .footer-about,
  .footer-legend {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --shell-pad: 16px;
  }

  body {
    font-size: 14px;
  }

  .site-main {
    max-width: 100%;
  }

  .home-main,
  .inner-main,
  .error-main {
    padding-bottom: 44px;
  }

  .page-header {
    padding: 20px 0 16px;
  }

  .page-title,
  .inner-main .page-title {
    font-size: 21px;
    line-height: 1.35;
  }

  .hero-text h1 {
    font-size: 22px;
    line-height: 1.32;
  }

  .hero-lead {
    font-size: 14px;
  }

  .hero-actions {
    gap: 8px;
  }

  .btn {
    flex: 1 1 auto;
    min-width: 132px;
    padding: 10px 14px;
  }

  .section {
    padding-top: 26px;
  }

  .cover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .cover-meta {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }

  .cover-name {
    font-size: 13px;
  }

  .notice-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .notice-link {
    justify-self: start;
    padding: 0;
  }

  /* 表格转纵向卡片行：取消最小宽度，避免横向溢出 */
  .table-wrap {
    overflow-x: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .data-table,
  .record-table,
  .status-table,
  .genre-table,
  .archive-table,
  .scope-table {
    min-width: 0;
    width: 100%;
    display: block;
    font-size: 13px;
  }

  .data-table caption,
  .table-caption {
    display: block;
    padding: 0 0 10px;
    border-bottom: 0;
  }

  .data-table thead,
  .record-table thead,
  .status-table thead {
    display: none;
  }

  .data-table tbody,
  .record-table tbody,
  .status-table tbody {
    display: block;
  }

  .data-table tbody tr,
  .record-table tbody tr,
  .status-table tbody tr {
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .data-table tbody th,
  .data-table tbody td,
  .record-table tbody td,
  .status-table tbody th,
  .status-table tbody td {
    display: block;
    width: auto;
    padding: 4px 0;
    border-bottom: 0;
    white-space: normal;
  }

  .data-table tbody th,
  .status-table tbody th,
  .record-table .cell-title {
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px dashed var(--line);
    padding-bottom: 6px;
    margin-bottom: 4px;
  }

  .record-table .cell-num,
  .digest-table .col-no,
  .archive-table .col-num {
    width: auto;
    font-size: 12px;
  }

  .record-table tbody td:last-child,
  .data-table tbody td:last-child,
  .archive-table tbody td:last-child,
  .genre-table tbody td:last-child,
  .scope-table tbody td:last-child,
  .columns-table tbody td:last-child {
    white-space: normal;
  }

  .numbered-item,
  .order-list > li,
  .follow-item,
  .guide-section .numbered-list li {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .numbered-index,
  .order-num,
  .follow-num {
    font-size: 16px;
  }

  .tag-list {
    gap: 8px;
  }

  .tag {
    min-height: 44px;
    padding: 8px 12px;
  }

  .section-title,
  .content-block h2,
  .section-block h2,
  .record-section h2,
  .legend-section h2,
  .maintain-section h2,
  .follow-section h2,
  .related-section h2,
  .scope-summary h2,
  .faq-group h2,
  .feedback-note h2,
  .picks-row h2,
  .rationale-columns h2,
  .reading-order h2,
  .link-to-updates h2,
  .related-entry h2,
  .relation-block h2,
  .related-block h2,
  .cross-combo-block h2,
  .select-steps-block h2,
  .genre-table-block h2,
  .guide-section h2 {
    font-size: 17px;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .error-panel {
    padding: 22px 16px;
  }

  .error-title {
    font-size: 21px;
  }

  .error-actions .btn {
    flex: 1 1 100%;
  }
}

/* 程序验收反馈：移动端防溢出 */
@media (max-width: 768px) {
  .site-main,
  .site-main * {
    min-width: 0;
    max-width: 100%;
  }

  .site-main :is(h1, h2, h3, h4, p, a, span) {
    overflow-wrap: anywhere;
  }
}
