/* ==========================================================================
   五一漫画 · 全站样式
   分组：base / layout / components / pages / responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   base
   -------------------------------------------------------------------------- */

:root {
  --c-bg: #f5f7fa;
  --c-surface: #ffffff;
  --c-text: #141c26;
  --c-muted: #5a6a7a;
  --c-brand: #4056d6;
  --c-brand-soft: #eef1fd;
  --c-serial: #1f9d6b;
  --c-teal: #12a5a0;
  --c-line: #e2e8f0;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-soft: 0 1px 2px rgba(20, 28, 38, 0.05);
  --shadow-lift: 0 6px 16px rgba(20, 28, 38, 0.1);
  --shell: 1120px;
  --gap-block: 40px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--c-brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   layout
   -------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
}

.site-main {
  display: block;
  padding-bottom: 8px;
}

.inner-main {
  padding-bottom: 24px;
}

/* 页头 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--c-text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-sub {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.4;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--c-text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--c-brand-soft);
  color: var(--c-brand);
  text-decoration: none;
}

.nav-link.is-current {
  color: var(--c-brand);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--c-brand);
}

.nav-quick {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  color: var(--c-brand);
  font-size: 13px;
  white-space: nowrap;
}

.nav-quick:hover {
  background: var(--c-brand-soft);
  text-decoration: none;
}

.nav-quick.is-current {
  background: var(--c-brand-soft);
  border-color: var(--c-brand);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
}

/* 面包屑 */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 16px 24px 0;
  font-size: 13px;
  color: var(--c-muted);
}

.breadcrumb a {
  color: var(--c-muted);
}

.breadcrumb a:hover {
  color: var(--c-brand);
}

.breadcrumb-sep {
  color: var(--c-line);
}

.breadcrumb-current {
  color: var(--c-text);
  font-weight: 600;
}

/* 页面标题区 */

.page-header {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px 24px 0;
}

.page-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--c-text);
}

section.page-title {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 10px 24px 0;
}

.page-lead {
  max-width: 68ch;
  font-size: 15px;
  color: var(--c-muted);
}

/* 页脚 */

.site-footer {
  margin-top: var(--gap-block);
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 32px;
}

.footer-brand {
  max-width: 320px;
}

.footer-logo {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-muted);
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.footer-list li + li {
  margin-top: 8px;
}

.footer-list a {
  font-size: 13px;
  color: var(--c-muted);
}

.footer-list a:hover {
  color: var(--c-brand);
}

.footer-bottom {
  padding-top: 16px;
  padding-bottom: 24px;
  border-top: 1px solid var(--c-line);
}

.footer-bottom p {
  font-size: 13px;
  color: var(--c-muted);
}

/* --------------------------------------------------------------------------
   components
   -------------------------------------------------------------------------- */

/* 通用区块标题 */

.section-title {
  font-size: 21px;
  font-weight: 600;
}

.section-lead,
.section-note,
.section-intro {
  max-width: 68ch;
  margin-top: 8px;
  font-size: 14px;
  color: var(--c-muted);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-more {
  font-size: 13px;
  white-space: nowrap;
}

/* 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--c-brand);
  color: #ffffff;
}

.btn-primary:hover {
  background: #3448bd;
}

.btn-ghost {
  background: var(--c-surface);
  border-color: var(--c-line);
  color: var(--c-text);
}

.btn-ghost:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}

/* 标签 */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

.tag-genre {
  background: var(--c-brand-soft);
  color: var(--c-brand);
}

.tag-state {
  background: #eaf7f1;
  color: var(--c-serial);
}

/* 状态徽章 */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-serial {
  background: #eaf7f1;
  color: var(--c-serial);
}

.badge-pause {
  background: #fdf3e3;
  color: #a86a12;
}

.badge-end {
  background: var(--c-brand-soft);
  color: var(--c-brand);
}

/* 更新条目行 */

.update-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.update-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 10px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.update-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--c-brand-soft);
}

.update-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.update-main,
.update-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.update-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

.update-name:hover {
  color: var(--c-brand);
}

.update-chapter {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.update-state {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--c-muted);
}

.update-state.is-serial {
  color: var(--c-serial);
}

.update-state.is-pause {
  color: #a86a12;
}

.update-state.is-done {
  color: var(--c-brand);
}

.update-date,
.update-day {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.update-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--c-muted);
}

/* 流程节点条（首页） */

.flow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.flow-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--c-muted);
}

.flow-index {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e6f7f6;
  color: var(--c-teal);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 步骤条（首页 / 题材分类） */

.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.guide-step {
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-brand-soft);
  color: var(--c-brand);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.step-title {
  margin-top: 10px;
  font-size: 17px;
}

.step-text {
  margin-top: 6px;
  font-size: 14px;
  color: var(--c-muted);
}

.step-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
}

/* 相关条目模块 */

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.related-item a {
  display: block;
  padding: 14px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-text);
}

.related-item a:hover {
  border-color: var(--c-brand);
  text-decoration: none;
}

.related-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.related-desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--c-muted);
}

/* 首页底部相关链接条 */

.related-links[aria-label="相关内容"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: var(--shell);
  margin: 32px auto 0;
  padding: 0 24px;
}

.related-links-label {
  font-size: 13px;
  color: var(--c-muted);
}

.related-links-item {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--c-text);
}

.related-links-item:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   pages
   -------------------------------------------------------------------------- */

/* ---- 首页 ---- */

.hero {
  padding: 40px 0 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.hero-copy {
  max-width: 560px;
}

.hero-kicker {
  font-size: 13px;
  color: var(--c-brand);
  font-weight: 600;
}

.hero-copy h1 {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 600;
}

.hero-lead {
  margin-top: 12px;
  font-size: 15px;
  color: var(--c-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--c-line);
}

.hero-facts li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--c-muted);
}

.fact-num {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.hero-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-figure {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-brand-soft);
  border: 1px solid var(--c-line);
}

.hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-figure figcaption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--c-muted);
  background: var(--c-surface);
}

.hero-thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.thumb-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.thumb-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.thumb-card figcaption {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--c-muted);
}

/* 题材速览条 */

.genre-strip {
  padding: var(--gap-block) 0 0;
}

.genre-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.genre-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-text);
}

.genre-chip:hover {
  border-color: var(--c-brand);
  background: var(--c-brand-soft);
  text-decoration: none;
}

.chip-name {
  font-size: 15px;
  font-weight: 600;
}

.chip-note {
  font-size: 13px;
  color: var(--c-muted);
}

/* 最近更新 */

.update-feed {
  padding: var(--gap-block) 0 0;
}

.update-feed .update-list {
  margin-top: 18px;
}

/* 作品档案速览 */

.archive-preview {
  padding: var(--gap-block) 0 0;
}

.archive-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.archive-group {
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.archive-year {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.archive-list {
  margin-top: 12px;
}

.archive-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--c-line);
}

.archive-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.archive-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.archive-name:hover {
  color: var(--c-brand);
}

.archive-meta {
  font-size: 13px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

/* 编辑推荐 */

.editor-picks {
  padding: var(--gap-block) 0 0;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.pick-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.pick-link {
  display: block;
  padding: 12px;
  color: var(--c-text);
}

.pick-link:hover {
  text-decoration: none;
}

.pick-cover {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--c-brand-soft);
}

.pick-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.pick-name {
  margin-top: 10px;
  font-size: 15px;
}

.pick-reason {
  margin-top: 4px;
  font-size: 13px;
  color: var(--c-muted);
}

.pick-card .tag-state {
  margin: 0 12px 12px;
}

/* 创作手记入口 */

.notes-entry {
  padding: var(--gap-block) 0 0;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.note-item {
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.note-stage {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6f7f6;
  color: var(--c-teal);
  font-size: 12px;
}

.note-title {
  margin-top: 10px;
  font-size: 17px;
}

.note-title a {
  color: var(--c-text);
}

.note-title a:hover {
  color: var(--c-brand);
}

.note-summary {
  margin-top: 6px;
  font-size: 14px;
  color: var(--c-muted);
}

/* 阅读说明入口 */

.reading-guide {
  padding: var(--gap-block) 0 0;
}

/* ---- 题材分类 ---- */

.genre-overview {
  padding-top: 24px;
}

.genre-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.genre-tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--c-text);
}

.genre-tag:hover {
  border-color: var(--c-brand);
  background: var(--c-brand-soft);
  color: var(--c-brand);
  text-decoration: none;
}

.genre-blocks {
  padding-top: var(--gap-block);
}

.genre-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--c-line);
}

.genre-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.genre-info h2 {
  font-size: 21px;
}

.genre-info p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--c-muted);
}

.genre-works {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.work-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.work-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.work-card figcaption {
  padding: 10px;
  font-size: 13px;
  color: var(--c-text);
}

.work-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.genre-picker-guide {
  padding-top: var(--gap-block);
}

/* ---- 作品档案 ---- */

.filter-bar {
  padding-top: 24px;
}

.filter-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-line);
}

.filter-label {
  flex: 0 0 auto;
  width: 72px;
  font-size: 13px;
  color: var(--c-muted);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--c-text);
}

.filter-tag:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.filter-tag.is-active {
  background: var(--c-brand-soft);
  border-color: var(--c-brand);
  color: var(--c-brand);
  font-weight: 600;
}

.result-summary {
  padding-top: 14px;
}

.result-text {
  font-size: 13px;
  color: var(--c-muted);
}

.work-list {
  padding-top: var(--gap-block);
}

.work-list-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.work-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.work-cover {
  width: 96px;
  height: 128px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--c-brand-soft);
}

.work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-body {
  min-width: 0;
}

.work-body .work-name {
  font-size: 17px;
}

.work-genre {
  margin-top: 4px;
  font-size: 13px;
  color: var(--c-muted);
}

.work-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 18px;
  margin: 12px 0 0;
}

.work-fields dt {
  font-size: 12px;
  color: var(--c-muted);
}

.work-fields dd {
  margin: 0;
  font-size: 14px;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.status-ongoing {
  background: #eaf7f1;
  color: var(--c-serial);
}

.status-paused {
  background: #fdf3e3;
  color: #a86a12;
}

.status-done {
  background: var(--c-brand-soft);
  color: var(--c-brand);
}

.cover-gallery {
  padding-top: var(--gap-block);
}

.gallery-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.gallery-item {
  min-width: 0;
}

.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery-trigger:hover {
  border-color: var(--c-brand);
}

.gallery-trigger img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ---- 最近更新 ---- */

.update-timeline {
  padding-top: 24px;
}

.timeline-group {
  padding: 20px 0;
  border-top: 1px solid var(--c-line);
}

.timeline-group:first-of-type {
  border-top: 0;
  padding-top: 12px;
}

.timeline-date {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.timeline-group .update-list {
  margin-top: 12px;
}

.serial-status {
  padding-top: var(--gap-block);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.status-card {
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.status-card h3 {
  font-size: 17px;
}

.status-card p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--c-muted);
}

.status-tip {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--c-line);
  font-size: 13px;
}

/* ---- 创作手记 ---- */

.article-body {
  padding-top: 24px;
}

.article-section {
  max-width: 760px;
  padding-bottom: 28px;
}

.article-section + .article-section {
  padding-top: 8px;
}

.article-section p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--c-text);
}

.article-figure {
  margin-top: 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-surface);
}

.article-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-figure figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--c-muted);
}

.process-nodes {
  padding-top: var(--gap-block);
}

.node-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.node-card {
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.node-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e6f7f6;
  color: var(--c-teal);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.node-title {
  margin-top: 10px;
  font-size: 17px;
}

.node-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--c-muted);
}

.faq-mini {
  padding-top: var(--gap-block);
}

/* ---- FAQ 折叠面板 ---- */

.faq-list {
  margin-top: 18px;
}

.faq-item {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.faq-item + .faq-item {
  margin-top: 10px;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 400;
  color: var(--c-muted);
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 16px 14px;
  font-size: 14px;
  color: var(--c-muted);
}

.faq-answer p + p {
  margin-top: 8px;
}

/* ---- 阅读说明 ---- */

.field-table-section {
  padding-top: 24px;
}

.field-figure {
  margin-top: 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-surface);
}

.field-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.field-figure figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--c-muted);
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.field-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
}

.field-table caption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--c-muted);
  text-align: left;
  border-bottom: 1px solid var(--c-line);
}

.field-table th,
.field-table td {
  padding: 12px 16px;
  font-size: 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}

.field-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-muted);
  background: #fafbfd;
}

.field-table tbody tr:last-child th,
.field-table tbody tr:last-child td {
  border-bottom: 0;
}

.field-table tbody th {
  width: 34%;
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.field-table td {
  color: var(--c-muted);
}

.steps-section {
  padding-top: var(--gap-block);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.step-card {
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.faq-section {
  padding-top: var(--gap-block);
}

.related-section {
  padding-top: var(--gap-block);
}

/* ---- 版权与反馈 ---- */

.page-layout {
  display: block;
  padding-top: 24px;
}

.content-block {
  padding: 24px 0;
  border-top: 1px solid var(--c-line);
}

.content-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.content-block h2 {
  font-size: 21px;
}

.block-intro {
  max-width: 68ch;
  margin-top: 10px;
  font-size: 14px;
  color: var(--c-muted);
}

.block-note {
  max-width: 68ch;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--c-brand-soft);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--c-brand);
}

.rule-figure {
  max-width: 640px;
  margin-top: 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-surface);
}

.rule-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.rule-figure figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--c-muted);
}

.rule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.rule-item {
  padding: 16px 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.rule-item h3 {
  font-size: 16px;
}

.rule-item p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--c-muted);
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.flow-step {
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e6f7f6;
  color: var(--c-teal);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.flow-step h3 {
  margin-top: 10px;
  font-size: 17px;
}

.flow-step p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--c-muted);
}

.note-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.note-item h3 {
  font-size: 16px;
}

.note-item p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--c-muted);
}

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.link-card a {
  display: block;
  padding: 16px 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-text);
}

.link-card a:hover {
  border-color: var(--c-brand);
  text-decoration: none;
}

.link-card-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.link-card-desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--c-muted);
}

/* ---- 404 ---- */

.error-main {
  padding: 64px 0 32px;
}

.error-panel {
  max-width: 640px;
}

.error-code {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-brand);
  font-variant-numeric: tabular-nums;
}

.error-title {
  margin-top: 10px;
  font-size: 30px;
}

.error-text {
  margin-top: 12px;
  font-size: 15px;
  color: var(--c-muted);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--c-line);
}

.error-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--c-text);
}

.error-links a:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 8px 16px 16px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--shadow-lift);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    display: none;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-link {
    height: 48px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
  }

  .nav-link.is-current {
    box-shadow: none;
    background: var(--c-brand-soft);
  }

  .nav-quick {
    justify-content: center;
    height: 48px;
    margin-top: 8px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  .hero-copy {
    max-width: none;
  }

  .genre-block {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }

  .flow-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 0 16px;
  }

  .breadcrumb {
    padding: 14px 16px 0;
  }

  .page-header {
    padding: 10px 16px 0;
  }

  section.page-title {
    padding: 8px 16px 0;
  }

  .page-title,
  .hero-copy h1,
  .error-title {
    font-size: 23px;
  }

  .section-title,
  .genre-info h2,
  .content-block h2 {
    font-size: 19px;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-facts {
    gap: 18px;
  }

  .genre-works {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-label {
    width: auto;
  }

  .work-item {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .work-cover {
    width: 76px;
    height: 101px;
  }

  .update-row {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }

  .update-main,
  .update-info {
    flex: 1 1 140px;
  }

  .update-date,
  .update-day {
    margin-left: auto;
  }

  .gallery-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 32px;
  }

  .related-links[aria-label="相关内容"] {
    padding: 0 16px;
  }

  .error-main {
    padding: 40px 0 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pick-card {
    transition: none;
  }

  .pick-card:hover {
    transform: none;
  }
}
