/* ============================================================
   BASE — 全局变量、重置、排版与通用元素
   ============================================================ */
:root {
  --color-bg: #f5f2ee;
  --color-bg-deep: #ece7df;
  --color-text: #2b2b2b;
  --color-text-soft: #5a554e;
  --color-muted: #8a8378;
  --color-accent: #b08d57;
  --color-accent-dark: #96763f;
  --color-accent-light: #c9ab7d;
  --color-white: #ffffff;
  --color-line: #e0d5c3;
  --color-footer-bg: #26221d;
  --color-footer-text: #c9c2b8;
  --color-footer-title: #e8e2d8;

  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --container-width: 1200px;
  --content-max: 860px;
  --sidebar-width: 240px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-card: 0 1px 4px rgba(43, 43, 43, 0.06), 0 2px 12px rgba(43, 43, 43, 0.04);
  --shadow-hover: 0 4px 12px rgba(43, 43, 43, 0.1), 0 8px 24px rgba(43, 43, 43, 0.06);

  --header-height: 64px;
  --space-section: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent);
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  color: var(--color-text);
  line-height: 1.4;
  font-weight: 700;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 20px;
}

p {
  margin-bottom: 1em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   LAYOUT — 全站统一骨架：页头、页脚、主容器、面包屑
   ============================================================ */
.site-header {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-line);
  position: relative;
  z-index: 100;
}

.header-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.brand-name::first-letter {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-list li a {
  display: block;
  padding: 8px 16px;
  font-size: 15px;
  color: var(--color-text-soft);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-list li a:hover {
  color: var(--color-text);
  background-color: var(--color-bg);
}

.nav-list li a.is-current {
  color: var(--color-accent-dark);
  font-weight: 600;
  background-color: rgba(176, 141, 87, 0.08);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background-color: var(--color-white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-icon {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  position: relative;
  transition: background-color 0.2s ease;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, top 0.25s ease;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-main {
  min-height: 60vh;
}

.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  margin-top: var(--space-section);
}

.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 48px 24px 24px;
}

.footer-brand {
  margin-bottom: 32px;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-footer-title);
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 14px;
  color: var(--color-footer-text);
  max-width: 480px;
  line-height: 1.7;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-col h3 {
  font-size: 15px;
  color: var(--color-footer-title);
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-col ul li {
  margin-bottom: 6px;
}

.footer-col ul li a {
  font-size: 14px;
  color: var(--color-footer-text);
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: var(--color-white);
}

.footer-bottom {
  padding-top: 24px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.footer-bottom p {
  margin-bottom: 0;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--color-muted);
}

.breadcrumb a:hover {
  color: var(--color-accent-dark);
}

.breadcrumb-sep {
  color: var(--color-muted);
}

.breadcrumb-current {
  color: var(--color-text-soft);
  font-weight: 500;
}

/* 内页通用 */
.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 32px;
  margin-bottom: 8px;
}

.page-description {
  font-size: 16px;
  color: var(--color-text-soft);
  max-width: 640px;
}

/* ============================================================
   COMPONENTS — 通用组件：卡片、封面图、按钮、侧栏
   ============================================================ */
/* 封面图容器 */
.cover-figure,
.category-media,
.subtype-media,
.hero-figure,
.content-media,
.content-figure {
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-deep);
}

.cover-figure img,
.category-media img,
.subtype-media img,
.hero-figure img,
.content-media img,
.content-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.cover-figure:hover img,
.category-card:hover .category-media img,
.subtype-card:hover .subtype-media img {
  transform: scale(1.03);
}

/* 按钮 */
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--color-accent);
  color: var(--color-white);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-accent);
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* 文本链接 */
.text-link {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin-top: 8px;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: var(--color-accent);
}

.text-link::after {
  content: " →";
  transition: margin-left 0.2s ease;
}

.text-link:hover::after {
  margin-left: 4px;
}

/* 侧栏通用 */
.sidebar,
.page-sidebar,
.page-aside {
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 24px;
  height: fit-content;
}

.sidebar h2,
.sidebar-title,
.toc-title {
  font-size: 18px;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}

.sidebar-list li,
.sidebar-nav li,
.toc-list li {
  margin-bottom: 4px;
}

.sidebar-list a,
.sidebar-nav a,
.toc-list a {
  display: block;
  padding: 8px 12px;
  font-size: 15px;
  color: var(--color-text-soft);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-list a:hover,
.sidebar-nav a:hover,
.toc-list a:hover {
  background-color: var(--color-bg);
  color: var(--color-accent-dark);
}

/* 相关阅读 */
.related-links {
  margin-top: 48px;
  padding: 24px;
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}

.related-links h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.related-links ul li {
  margin-bottom: 8px;
}

.related-links ul li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.related-links ul li a::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent);
  flex-shrink: 0;
}

/* 内容区块 */
.content-section {
  margin-bottom: 48px;
}

.content-section h2 {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}

.content-section h3 {
  margin-bottom: 8px;
}

.section-lead {
  font-size: 16px;
  color: var(--color-text-soft);
  margin-bottom: 24px;
}

/* ============================================================
   LAYOUT VARIANT — 侧栏布局（sidebar-left 变体）
   ============================================================ */
.layout-shell {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.sidebar-left {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.sidebar-left .sidebar,
.sidebar-left .page-sidebar,
.sidebar-left .page-aside {
  grid-column: 1;
  position: sticky;
  top: 24px;
}

.sidebar-left .site-main,
.sidebar-left .page-content,
.sidebar-left .main-content {
  grid-column: 2;
  min-width: 0;
}

/* categories 页的 layout-shell 直接包住 aside 与 main */
.layout-shell.sidebar-left .sidebar,
.layout-shell.sidebar-left .page-sidebar,
.layout-shell.sidebar-left .page-aside {
  grid-column: 1;
}

.layout-shell.sidebar-left .site-main,
.layout-shell.sidebar-left .page-content,
.layout-shell.sidebar-left .main-content {
  grid-column: 2;
}

/* ============================================================
   PAGES — 首页
   ============================================================ */
.home-main {
  background-color: var(--color-bg);
}

/* Hero */
.hero-section {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  max-width: 560px;
}

.hero-content h1 {
  font-size: 36px;
  margin-bottom: 20px;
  line-height: 1.3;
}

.hero-lead {
  font-size: 17px;
  color: var(--color-text-soft);
  margin-bottom: 28px;
  line-height: 1.8;
}

.hero-cta {
  margin-bottom: 24px;
}

.hero-scroll-hint {
  font-size: 14px;
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-scroll-hint::before {
  content: "";
  width: 24px;
  height: 1px;
  background-color: var(--color-accent);
  display: inline-block;
}

.hero-figure {
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-card);
}

.hero-figure img {
  object-fit: cover;
}

/* 题材分类导航带 */
.category-nav-section {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--color-line);
}

.category-nav-section h2,
.recent-updates-section h2,
.ranking-preview-section h2,
.guide-entry-section h2,
.feedback-section h2 {
  margin-bottom: 12px;
}

.section-intro {
  color: var(--color-text-soft);
  margin-bottom: 28px;
  max-width: 640px;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-tags li a {
  display: inline-block;
  padding: 10px 24px;
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-size: 15px;
  color: var(--color-text-soft);
  transition: all 0.25s ease;
}

.category-tags li a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  background-color: rgba(176, 141, 87, 0.06);
}

/* 最近更新 */
.recent-updates-section {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--color-line);
}

.update-group {
  margin-bottom: 36px;
}

.update-group h3 {
  font-size: 18px;
  color: var(--color-accent-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.update-group h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

.update-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.update-item {
  display: flex;
  gap: 16px;
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.update-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.update-item .cover-figure {
  width: 88px;
  height: 118px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.update-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.update-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-meta {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.update-status {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background-color: rgba(176, 141, 87, 0.1);
  color: var(--color-accent-dark);
  width: fit-content;
}

/* 人气榜单 */
.ranking-preview-section {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--color-line);
}

.ranking-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.ranking-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ranking-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.ranking-card .cover-figure {
  aspect-ratio: 3 / 4;
  border-radius: 0;
}

.ranking-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ranking-body h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.ranking-reason {
  font-size: 14px;
  color: var(--color-text-soft);
  line-height: 1.6;
  margin-bottom: 12px;
  flex: 1;
}

.ranking-body a {
  font-size: 14px;
  font-weight: 600;
}

/* 阅读指南入口 */
.guide-entry-section {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--color-line);
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.guide-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.guide-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.guide-card h3 {
  margin-bottom: 12px;
}

.guide-card p {
  color: var(--color-text-soft);
  font-size: 15px;
  margin-bottom: 16px;
}

/* 反馈说明 */
.feedback-section {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--color-line);
}

.feedback-section p {
  color: var(--color-text-soft);
  max-width: 640px;
}

/* ============================================================
   PAGES — 题材分类页 categories
   ============================================================ */
.inner-main {
  min-width: 0;
}

.page-categories .layout-shell {
  padding-top: 32px;
}

.category-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent-light);
}

.category-media {
  aspect-ratio: 3 / 4;
  width: 180px;
}

.category-content h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.category-content p {
  color: var(--color-text-soft);
  font-size: 15px;
  margin-bottom: 8px;
}

.category-list {
  margin-bottom: 48px;
}

.category-list > h2 {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}

.category-notes {
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 24px;
}

.category-notes h2 {
  margin-bottom: 16px;
}

.category-notes p {
  color: var(--color-text-soft);
  margin-bottom: 12px;
}

/* ============================================================
   PAGES — 阅读指南 guide
   ============================================================ */
.page-guide .page-content {
  min-width: 0;
}

.content-media-inline {
  margin-bottom: 24px;
  max-width: 640px;
}

.content-media-inline img {
  aspect-ratio: 16 / 9;
}

.content-media-inline figcaption {
  font-size: 13px;
  color: var(--color-muted);
  padding: 8px 4px 0;
  text-align: center;
}

.guide-step {
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.guide-step h3 {
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.guide-step h3::before {
  content: attr(data-step);
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  background-color: rgba(176, 141, 87, 0.1);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-step p {
  color: var(--color-text-soft);
  font-size: 15px;
}

.guide-step p a {
  font-weight: 600;
}

.step-note {
  font-size: 14px;
  color: var(--color-muted);
  background-color: var(--color-bg);
  border-left: 3px solid var(--color-accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 12px;
}

.guide-tip {
  padding: 20px;
  border-left: 3px solid var(--color-accent);
  background-color: var(--color-white);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--color-line);
  border-right: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.guide-tip h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.guide-tip p {
  color: var(--color-text-soft);
  font-size: 15px;
  margin-bottom: 0;
}

/* ============================================================
   PAGES — 恋爱漫画 romance
   ============================================================ */
.page-romance .layout-shell {
  padding-top: 32px;
}

.toc-nav {
  position: sticky;
  top: 24px;
}

.subtype-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.subtype-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.subtype-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.subtype-media {
  aspect-ratio: 4 / 3;
  border-radius: 0;
}

.subtype-card h3 {
  font-size: 17px;
  padding: 16px 16px 4px;
}

.subtype-card p {
  font-size: 14px;
  color: var(--color-text-soft);
  padding: 0 16px 16px;
  margin-bottom: 0;
}

.subtype-card p:last-of-type {
  padding-top: 0;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.recommend-item {
  background-color: var(--color-bg-deep);
  border-radius: var(--radius-md);
  padding: 20px;
}

.recommend-item h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.recommend-item p {
  font-size: 14px;
  color: var(--color-text-soft);
  margin-bottom: 0;
}

/* ============================================================
   PAGES — 科幻漫画 science
   ============================================================ */
.page-science .layout-shell {
  padding-top: 32px;
}

.sidebar-inner {
  position: sticky;
  top: 24px;
}

.recommend-list {
  margin: 16px 0;
}

.recommend-list li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
  font-size: 15px;
  color: var(--color-text-soft);
}

.recommend-list li:last-child {
  border-bottom: none;
}

.recommend-list strong {
  color: var(--color-text);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 120px;
}

.content-figure {
  margin: 32px 0;
  max-width: 640px;
}

.content-figure img {
  aspect-ratio: 16 / 9;
}

.content-figure figcaption {
  font-size: 13px;
  color: var(--color-muted);
  padding: 8px 4px 0;
  text-align: center;
}

/* ============================================================
   PAGES — 404
   ============================================================ */
.error-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  min-height: 60vh;
}

.error-panel {
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 48px;
  max-width: 520px;
  text-align: center;
}

.error-code {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 16px;
}

.error-panel h1 {
  font-size: 24px;
  margin-bottom: 12px;
}

.error-desc {
  color: var(--color-text-soft);
  margin-bottom: 24px;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn-home {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--color-accent);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-accent);
  transition: background-color 0.25s ease, transform 0.2s ease;
}

.btn-home:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-white);
  transform: translateY(-2px);
}

.error-actions a:not(.btn-home) {
  display: inline-block;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.error-actions a:not(.btn-home):hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.error-tip {
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 0;
}

/* ============================================================
   RESPONSIVE — 响应式断点
   ============================================================ */
/* 平板：≤1024px */
@media (max-width: 1024px) {
  :root {
    --space-section: 48px;
  }

  .hero-section {
    gap: 32px;
  }

  .ranking-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .update-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .subtype-list,
  .recommend-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar-left {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
  }
}

/* 手机：≤768px */
@media (max-width: 768px) {
  :root {
    --space-section: 40px;
  }

  .header-inner {
    padding: 0 16px;
    height: 56px;
  }

  .brand-name {
    font-size: 19px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-line);
    box-shadow: 0 8px 16px rgba(43, 43, 43, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    gap: 4px;
  }

  .nav-list li a {
    padding: 12px 16px;
    font-size: 16px;
  }

  .nav-list.is-open {
    display: flex;
  }

  .site-nav.is-open {
    max-height: 360px;
  }

  /* Hero */
  .hero-section {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 16px 32px;
  }

  .hero-content h1 {
    font-size: 28px;
  }

  .hero-figure {
    aspect-ratio: 16 / 10;
  }

  /* 通用区块 */
  .category-nav-section,
  .recent-updates-section,
  .ranking-preview-section,
  .guide-entry-section,
  .feedback-section {
    padding: 40px 16px;
  }

  .update-list {
    grid-template-columns: 1fr;
  }

  .ranking-list {
    grid-template-columns: 1fr;
  }

  .guide-cards {
    grid-template-columns: 1fr;
  }

  .category-tags {
    gap: 8px;
  }

  .category-tags li a {
    padding: 8px 16px;
    font-size: 14px;
  }

  /* 侧栏布局变为单列 */
  .layout-shell {
    padding: 24px 16px 40px;
  }

  .sidebar-left {
    display: block;
  }

  .sidebar-left .sidebar,
  .sidebar-left .page-sidebar,
  .sidebar-left .page-aside {
    position: static;
    margin-bottom: 24px;
  }

  .sidebar-left .site-main,
  .sidebar-left .page-content,
  .sidebar-left .main-content {
    width: 100%;
  }

  .layout-shell.sidebar-left .sidebar,
  .layout-shell.sidebar-left .page-sidebar,
  .layout-shell.sidebar-left .page-aside {
    margin-bottom: 24px;
  }

  /* 分类卡片 */
  .category-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .category-media {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  /* 子类型卡片 */
  .subtype-list,
  .recommend-grid {
    grid-template-columns: 1fr;
  }

  /* 页脚 */
  .footer-inner {
    padding: 32px 16px 16px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* 面包屑 */
  .breadcrumb {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .page-header {
    margin-bottom: 24px;
  }

  .page-title {
    font-size: 26px;
  }

  /* 404 */
  .error-main {
    padding: 48px 16px;
  }

  .error-panel {
    padding: 32px 24px;
  }

  .error-code {
    font-size: 48px;
  }
}

/* 小手机：≤390px */
@media (max-width: 390px) {
  .header-inner {
    padding: 0 12px;
  }

  .brand-name {
    font-size: 17px;
  }

  .hero-section,
  .category-nav-section,
  .recent-updates-section,
  .ranking-preview-section,
  .guide-entry-section,
  .feedback-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .update-item {
    flex-direction: column;
  }

  .update-item .cover-figure {
    width: 100%;
    height: 160px;
  }

  .category-tags li a {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ============================================================
   ANIMATIONS — 滚动出现动画（增强，不阻塞初始显示）
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content,
.hero-figure,
.category-nav-section .category-tags,
.update-group,
.ranking-card,
.guide-card {
  animation: fadeInUp 0.5s ease both;
}

.hero-content {
  animation-delay: 0.05s;
}

.hero-figure {
  animation-delay: 0.1s;
}

.category-nav-section .category-tags {
  animation-delay: 0.15s;
}

.update-group:nth-of-type(2) {
  animation-delay: 0.1s;
}

.ranking-card:nth-child(2) {
  animation-delay: 0.05s;
}

.ranking-card:nth-child(3) {
  animation-delay: 0.1s;
}

.ranking-card:nth-child(4) {
  animation-delay: 0.15s;
}

.guide-card:nth-child(2) {
  animation-delay: 0.1s;
}

/* 尊重 prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   FOCUS — 键盘焦点样式
   ============================================================ */
a:focus-visible,
button:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nav-toggle:focus-visible {
  border-color: var(--color-accent);
}
