/* ==========================================================================
   香香漫画 · 全站样式表
   视觉方向：暖色餐饮目录风 × 漫画书库
   版本：1.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base — 基础变量、重置、字体与通用元素
   -------------------------------------------------------------------------- */
:root {
  --color-paper: #FFF7EE;
  --color-ink: #2B1A12;
  --color-accent: #F25C2A;
  --color-accent-soft: #E8A13D;
  --color-teal: #2F7D6F;
  --color-line: #D9C8B8;

  --font-main: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  --container-width: 1160px;
  --container-pad: 24px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --header-h: 64px;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-ink);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-teal);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

ul,
ol {
  list-style: none;
}

figure {
  margin: 0;
}

/* 通用容器 */
.header-inner,
.footer-inner,
.hero-section,
.inner-main,
.site-main > section,
.footer-related-inner,
.related-inner {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* --------------------------------------------------------------------------
   Layout — 全站骨架：页头、页脚、内外页通用布局
   -------------------------------------------------------------------------- */

/* ---- 页头 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.brand-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-link:hover .brand-name {
  color: var(--color-accent);
}

/* 导航 */
.site-nav {
  display: block;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list li a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
  transition: background var(--transition), color var(--transition);
}

.nav-list li a:hover {
  color: var(--color-accent);
  background: rgba(242, 92, 42, 0.08);
}

.nav-list li a.is-current {
  color: var(--color-accent);
  background: rgba(242, 92, 42, 0.12);
  font-weight: 600;
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ---- 页脚 ---- */
.site-footer {
  background: var(--color-ink);
  color: rgba(255, 247, 238, 0.75);
  margin-top: 64px;
}

.footer-inner {
  padding-top: 40px;
  padding-bottom: 32px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand-name {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-paper);
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  max-width: 320px;
}

.footer-nav-group h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-paper);
  margin-bottom: 12px;
}

.footer-nav-group li a {
  display: inline-block;
  padding: 3px 0;
  font-size: 13px;
  color: rgba(255, 247, 238, 0.7);
}

.footer-nav-group li a:hover {
  color: var(--color-accent-soft);
}

.footer-note {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 247, 238, 0.15);
  padding-top: 20px;
  margin-top: 8px;
}

.footer-note p {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 247, 238, 0.5);
  margin-bottom: 4px;
}

.copyright {
  font-size: 12px;
}

/* ---- 内页通用骨架 ---- */
.inner-main {
  padding-top: 24px;
  padding-bottom: 48px;
  min-height: 60vh;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(43, 26, 18, 0.55);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-teal);
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb-sep {
  color: var(--color-line);
}

.breadcrumb-current {
  color: rgba(43, 26, 18, 0.75);
  font-weight: 500;
}

/* 页面标题区 */
.page-header {
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--color-line);
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
  margin-bottom: 6px;
}

.page-description {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.65);
  max-width: 640px;
  line-height: 1.7;
}

/* ---- 双栏布局 ---- */
/* 默认右侧栏：主内容在前，aside 在后 */
.page-layout,
.layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}

/* 侧栏置左（genres 页） */
.sidebar-left {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* 内页通用 section 标题 */
.section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.4;
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Components — 通用 UI 组件
   -------------------------------------------------------------------------- */

/* ---- 章节入口按钮 ---- */
.chapter-link {
  display: inline-block;
  padding: 4px 16px;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  background: transparent;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  line-height: 1.6;
}

.chapter-link:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
}

/* ---- 题材标签 ---- */
.genre-label,
.genre-tag,
.tag {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(232, 161, 61, 0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-accent-soft);
  font-weight: 500;
  line-height: 1.6;
}

/* 首页题材大标签 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-item {
  display: inline-block;
  padding: 6px 18px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--color-ink);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.tag-item:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* ---- 区块标题通用 ---- */
.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.section-heading p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.6);
  line-height: 1.7;
}

.section-heading p a {
  font-weight: 500;
}

/* 首页主按钮 */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(242, 92, 42, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-line);
}

.btn-secondary:hover {
  border-color: var(--color-teal);
  color: var(--color-teal);
  transform: translateY(-2px);
}

/* 通用文字链接 */
.text-link {
  font-weight: 500;
  color: var(--color-teal);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.text-link:hover {
  border-bottom-color: var(--color-teal);
}

/* 通用栏目入口条（index related-links） */
.related-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-top: 1px solid var(--color-line);
  margin-top: 8px;
}

.related-links-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
}

.related-links-item {
  font-size: 14px;
  color: var(--color-teal);
}

.related-links-item:hover {
  color: var(--color-accent);
}

/* 数字步骤 */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Home — 首页专属样式
   -------------------------------------------------------------------------- */

.home-main {
  padding-bottom: 24px;
}

/* ---- Hero 首屏区：左文右图 ---- */
.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
  padding-top: 32px;
  padding-bottom: 32px;
}

.hero-copy h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.35;
  margin-bottom: 12px;
}

.hero-lead {
  font-size: 15px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(43, 26, 18, 0.12);
}

.hero-visual img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

/* ---- 今日更新卡片墙 ---- */
.today-update-section {
  padding-top: 16px;
}

.update-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.comic-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.comic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(43, 26, 18, 0.1);
}

.card-cover {
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.comic-card:hover .card-cover img {
  transform: scale(1.03);
}

.card-info {
  padding: 12px 14px 14px;
}

.card-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info .genre-label {
  margin-bottom: 10px;
}

.card-info .chapter-link {
  margin-top: 6px;
}

/* ---- 编辑特选入口 ---- */
.features-entry-section {
  padding-top: 40px;
}

.feature-entry-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.feature-entry-card {
  display: flex;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-entry-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(43, 26, 18, 0.1);
}

.feature-entry-cover {
  flex-shrink: 0;
  width: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.feature-entry-cover img {
  width: 120px;
  height: 96px;
  object-fit: cover;
}

.feature-entry-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-entry-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-entry-info p {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.65);
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ---- 阅读引导 ---- */
.reading-guide-section {
  padding-top: 40px;
}

.guide-step-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.guide-step {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.guide-step h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 10px 0 8px;
}

.guide-step p {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(43, 26, 18, 0.65);
}

.guide-step p a {
  display: inline-block;
  margin-top: 4px;
}

/* ---- 首页右侧栏 ---- */
.home-aside {
  padding-top: 48px;
}

.ranking-preview-section {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.ranking-preview-section .section-heading h2 {
  font-size: 22px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-line);
}

.ranking-item:last-child {
  border-bottom: none;
}

.rank-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent-soft);
  min-width: 24px;
}

.rank-cover {
  flex-shrink: 0;
  width: 48px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.rank-cover img {
  width: 48px;
  height: 36px;
  object-fit: cover;
}

.rank-info {
  min-width: 0;
  flex: 1;
}

.rank-info h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-info .genre-label {
  font-size: 11px;
}

/* ---- 首页相关任务带 ---- */
.footer-related {
  background: #fff;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  margin-top: 32px;
}

.related-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.related-tile {
  display: block;
  padding: 14px 16px;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  text-align: center;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.related-tile:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Inner Pages — 内页通用模块
   -------------------------------------------------------------------------- */

/* ---- 侧栏通用 ---- */
.sidebar-area,
.content-aside,
.sidebar,
.genres-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.aside-inner,
.sidebar-inner,
.tag-panel,
.aside-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.aside-title,
.aside-card h2,
.sidebar-inner h2,
.genres-aside h2,
.tag-panel h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-line);
}

.aside-note,
.sidebar-note,
.aside-tip {
  font-size: 12px;
  color: rgba(43, 26, 18, 0.5);
  line-height: 1.6;
  margin-top: 12px;
}

/* 侧栏链接列表 */
.tag-list li,
.aside-links li,
.sidebar-links li,
.genre-anchor-list li {
  margin-bottom: 2px;
}

.tag-list a,
.aside-links a,
.sidebar-links a,
.genre-anchor-list a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-ink);
  transition: background var(--transition), color var(--transition);
}

.tag-list a:hover,
.aside-links a:hover,
.sidebar-links a:hover,
.genre-anchor-list a:hover {
  background: rgba(242, 92, 42, 0.08);
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Today — 今日更新页
   -------------------------------------------------------------------------- */

.update-group {
  margin-bottom: 28px;
}

.update-group .section-title {
  font-size: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-line);
  position: relative;
}

.update-group .section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 48px;
  height: 2px;
  background: var(--color-accent);
}

.chapter-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.chapter-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(43, 26, 18, 0.1);
}

.card-cover-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
}

.card-cover-wrap img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.work-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.work-genre {
  font-size: 12px;
  color: rgba(43, 26, 18, 0.55);
  margin-bottom: 8px;
}

/* 阅读提示 */
.reading-tip {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 8px;
}

.reading-tip p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.8;
}

.reading-tip p a {
  display: inline-block;
  margin-right: 16px;
}

/* 今日更新页相关任务带 */
.related-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.link-tile {
  display: block;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), transform var(--transition);
}

.link-tile:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.link-tile-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.link-tile-desc {
  display: block;
  font-size: 12px;
  color: rgba(43, 26, 18, 0.5);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Ranking — 热门榜页
   -------------------------------------------------------------------------- */

.rank-filter {
  margin-bottom: 24px;
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filter-tag {
  display: inline-block;
  padding: 5px 16px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-ink);
  transition: all var(--transition);
}

.filter-tag:hover {
  border-color: var(--color-teal);
  color: var(--color-teal);
}

.filter-tag.is-active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-paper);
}

.rank-filter p {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.55);
}

/* 前三名大卡 */
.rank-top3 {
  margin-bottom: 32px;
}

.top3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.rank-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding-bottom: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.rank-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(43, 26, 18, 0.12);
}

.rank-card .rank-number {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.rank-card .rank-cover img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.rank-card .rank-info {
  padding: 12px 14px 0;
}

.rank-card .rank-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.rank-desc {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.6);
  margin-bottom: 8px;
}

.rank-meta {
  font-size: 12px;
  color: rgba(43, 26, 18, 0.5);
  margin-bottom: 6px;
}

/* 后七名细排行 */
.rank-rows {
  display: flex;
  flex-direction: column;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px dashed var(--color-line);
}

.rank-row:last-child {
  border-bottom: none;
}

.row-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-accent-soft);
  min-width: 28px;
  text-align: center;
}

.rank-row img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.row-info {
  flex: 1;
  min-width: 0;
}

.row-info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  font-size: 12px;
  color: rgba(43, 26, 18, 0.55);
}

.status-tag {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 999px;
  margin-left: 6px;
  background: rgba(47, 125, 111, 0.12);
  color: var(--color-teal);
}

/* 题材小结 */
.rank-genre-summary {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-line);
}

.genre-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.genre-summary-item {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.genre-summary-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.genre-summary-item p {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.6);
  line-height: 1.6;
  margin-bottom: 8px;
}

.genre-summary-item a {
  font-size: 13px;
  font-weight: 500;
}

/* 榜单相关任务带 */
.rank-feature-entry {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.rank-feature-entry p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.65);
  margin-bottom: 6px;
}

/* 榜单页 aside 块 */
.aside-block {
  margin-bottom: 16px;
}

/* 榜单页 footer related */
.footer-related {
  background: var(--color-paper);
  border-top: 1px solid var(--color-line);
}

.footer-related-inner {
  padding-top: 28px;
  padding-bottom: 28px;
}

.footer-related-inner h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.related-tasks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.related-task {
  display: block;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), transform var(--transition);
}

.related-task:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.task-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.task-desc {
  display: block;
  font-size: 12px;
  color: rgba(43, 26, 18, 0.5);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Genres — 题材书库页
   -------------------------------------------------------------------------- */

.genres-aside {
  position: sticky;
}

.genre-block {
  margin-bottom: 40px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.genre-intro {
  margin-bottom: 14px;
}

.genre-intro h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.genre-intro p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.65);
}

.genre-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.book-shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.book-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(43, 26, 18, 0.1);
}

.book-cover img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.book-info {
  padding: 12px;
}

.book-info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.book-desc {
  font-size: 12px;
  color: rgba(43, 26, 18, 0.55);
  line-height: 1.6;
  margin-bottom: 8px;
}

/* 标签云 */
.genre-cloud {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 16px;
}

.genre-cloud h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.genre-cloud p {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.6);
  margin-bottom: 12px;
}

.cloud-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.cloud-list a {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-ink);
  transition: all var(--transition);
}

.cloud-list a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* genres 页 footer related */
.related-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.related-card {
  display: block;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), transform var(--transition);
}

.related-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.related-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.related-note {
  display: block;
  font-size: 12px;
  color: rgba(43, 26, 18, 0.5);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Features — 编辑特选页
   -------------------------------------------------------------------------- */

.theme-intro {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.theme-intro h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.theme-intro p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.8;
  margin-bottom: 8px;
}

.featured-works {
  margin-bottom: 32px;
}

.section-note {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.55);
  margin-bottom: 16px;
}

.feature-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(43, 26, 18, 0.1);
}

.feature-media {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.feature-media img {
  width: 200px;
  height: 140px;
  object-fit: cover;
}

.feature-info h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-tags {
  font-size: 13px;
  color: var(--color-accent-soft);
  margin-bottom: 6px;
}

.feature-reason {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.7;
  margin-bottom: 10px;
}

/* 延伸书单 */
.extended-list {
  margin-bottom: 32px;
}

.extended-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.extend-card {
  display: block;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color var(--transition), transform var(--transition);
}

.extend-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.extend-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-ink);
}

.extend-card p {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.6);
  line-height: 1.6;
}

/* 往期特选 */
.past-features {
  margin-bottom: 24px;
}

.past-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.past-list li {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.past-list a {
  display: block;
  padding: 12px 16px;
}

.past-theme {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 2px;
}

.past-desc {
  display: block;
  font-size: 12px;
  color: rgba(43, 26, 18, 0.5);
}

/* features 侧栏 */
.sidebar-list {
  counter-reset: feature-counter;
}

.sidebar-list li {
  margin-bottom: 2px;
}

.sidebar-list a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-ink);
  transition: background var(--transition), color var(--transition);
}

.sidebar-list a:hover {
  background: rgba(242, 92, 42, 0.08);
  color: var(--color-accent);
}

/* features 页 footer related */
.footer-related ul.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: none;
  margin: 0;
}

.footer-related ul.related-links li a {
  display: inline-block;
  padding: 6px 16px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-ink);
}

.footer-related ul.related-links li a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Guide — 阅读指南页
   -------------------------------------------------------------------------- */

.guide-section {
  margin-bottom: 36px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.guide-section > h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-line);
}

.guide-section > p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.8;
  margin-bottom: 12px;
}

.guide-figure {
  margin: 16px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-line);
}

.guide-figure img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
}

.guide-figure figcaption {
  padding: 10px 16px;
  font-size: 12px;
  color: rgba(43, 26, 18, 0.5);
  background: #fff;
}

/* 指南步骤 */
.guide-step-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-step-item {
  display: flex;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.guide-step-item .step-number {
  background: var(--color-teal);
}

.step-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step-body p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.65);
  line-height: 1.7;
}

/* 栏目关系图 */
.relation-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.relation-node {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.node-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.node-desc {
  display: block;
  font-size: 12px;
  color: rgba(43, 26, 18, 0.55);
  line-height: 1.5;
}

.relation-arrow {
  display: flex;
  align-items: center;
  font-size: 18px;
  color: var(--color-accent-soft);
  padding: 0 2px;
}

.relation-arrow::after {
  content: "→";
}

/* FAQ 手风琴 */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
  list-style: none;
  transition: background var(--transition);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--color-accent);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item[open] summary {
  background: rgba(242, 92, 42, 0.05);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding: 0 18px 16px;
  font-size: 14px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.8;
}

/* guide 侧栏 */
.aside-card {
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Copyright — 版权说明页
   -------------------------------------------------------------------------- */

.content-section {
  margin-bottom: 32px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.content-section .section-heading {
  margin-bottom: 14px;
}

.content-section .section-heading h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.content-section .section-heading p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.65);
}

.principle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.principle-item {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.principle-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.principle-item p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.7;
}

.cover-policy-wrap {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.policy-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.cover-policy-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.policy-item {
  padding: 10px 0;
}

.policy-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.policy-item p {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.7);
  line-height: 1.7;
}

/* 步骤流 */
.step-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step-item {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step-item p {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.65);
  line-height: 1.7;
}

/* 反馈路径 */
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feedback-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.feedback-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feedback-card p {
  font-size: 13px;
  color: rgba(43, 26, 18, 0.65);
  line-height: 1.7;
}

/* copyright 侧栏 */
.sidebar-links a {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: block;
  font-size: 14px;
  color: var(--color-ink);
}

.sidebar-links a:hover {
  background: rgba(242, 92, 42, 0.08);
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   404 — 错误页
   -------------------------------------------------------------------------- */

.error-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - 200px);
  padding: 40px 24px;
}

.error-panel {
  text-align: center;
  max-width: 480px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
}

.error-code {
  font-size: 64px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 8px;
}

.error-panel h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-desc {
  font-size: 14px;
  color: rgba(43, 26, 18, 0.65);
  margin-bottom: 20px;
}

.error-back {
  display: inline-block;
  padding: 8px 28px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--transition);
}

.error-back:hover {
  color: #fff;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Responsive — 响应式断点
   -------------------------------------------------------------------------- */

/* ---- ≤ 1024px：平板 ---- */
@media (max-width: 1024px) {
  .update-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .top3-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-layout,
  .layout-shell {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 24px;
  }

  .sidebar-left {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 24px;
  }

  .hero-section {
    gap: 24px;
  }
}

/* ---- ≤ 860px：移动端导航切换 + 双栏合并 ---- */
@media (max-width: 860px) {
  /* 汉堡显示，导航收进抽屉 */
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: var(--color-paper);
    border-bottom: 1px solid var(--color-line);
    box-shadow: 0 8px 20px rgba(43, 26, 18, 0.08);
    z-index: 99;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list li a {
    display: block;
    padding: 12px 12px;
    font-size: 15px;
    border-radius: var(--radius-md);
  }

  .nav-list li a.is-current {
    background: rgba(242, 92, 42, 0.1);
  }

  /* 双栏全部合并为单栏 */
  .page-layout,
  .layout-shell,
  .sidebar-left {
    display: block;
  }

  /* 侧栏不再 sticky */
  .sidebar-area,
  .content-aside,
  .sidebar,
  .genres-aside {
    position: static;
    margin-top: 24px;
  }

  /* 内页侧栏在移动端回到正文之前（但 H1 永远在前） */
  .layout-shell .main-content,
  .page-layout .main-content {
    margin-bottom: 0;
  }

  /* hero 单栏 */
  .hero-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-visual img {
    height: 220px;
  }

  /* 首页右侧栏不再作为侧栏 */
  .home-aside {
    padding-top: 32px;
  }

  /* 卡片网格降列 */
  .update-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-entry-list,
  .guide-step-list {
    grid-template-columns: 1fr 1fr;
  }

  .chapter-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .top3-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .genre-summary-grid,
  .related-tasks,
  .related-strip,
  .related-inner,
  .extended-grid,
  .feedback-grid,
  .step-flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card {
    grid-template-columns: 1fr;
  }

  .feature-media img {
    width: 100%;
    height: 200px;
  }

  .relation-flow {
    flex-direction: column;
  }

  .relation-arrow {
    justify-content: center;
    transform: rotate(90deg);
    padding: 4px 0;
  }

  .cover-policy-wrap {
    grid-template-columns: 1fr;
  }

  .policy-cover {
    height: 180px;
  }

  /* 页脚单列 */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-note {
    grid-column: 1;
  }

  .related-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .past-list {
    grid-template-columns: 1fr;
  }
}

/* ---- ≤ 560px：手机 ---- */
@media (max-width: 560px) {
  :root {
    --container-pad: 16px;
  }

  .page-title {
    font-size: 26px;
  }

  .section-heading h2,
  .section-title {
    font-size: 22px;
  }

  .hero-copy h1 {
    font-size: 26px;
  }

  .update-card-grid,
  .chapter-list,
  .feature-entry-list,
  .guide-step-list,
  .genre-summary-grid,
  .related-tasks,
  .related-strip,
  .related-inner,
  .extended-grid,
  .feedback-grid,
  .step-flow,
  .related-links {
    grid-template-columns: 1fr;
  }

  .book-shelf {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .book-cover img {
    height: 200px;
  }

  .card-cover img,
  .card-cover-wrap img {
    height: 200px;
  }

  .rank-top3 .rank-cover img {
    height: 220px;
  }

  .feature-entry-card {
    flex-direction: column;
  }

  .feature-entry-cover,
  .feature-entry-cover img {
    width: 100%;
    height: 180px;
  }

  .rank-row {
    flex-wrap: wrap;
  }

  .rank-row img {
    width: 64px;
    height: 48px;
  }

  .row-info {
    flex: 1 1 120px;
  }

  .chapter-link {
    margin-top: 4px;
  }

  .faq-item summary {
    padding: 12px 14px;
    font-size: 14px;
  }

  .faq-item p {
    padding: 0 14px 14px;
    font-size: 13px;
  }

  .step-flow,
  .feedback-grid {
    gap: 10px;
  }

  .error-panel {
    padding: 32px 20px;
  }

  .error-code {
    font-size: 48px;
  }

  .footer-inner {
    padding-top: 32px;
  }
}

/* ---- 打印 ---- */
@media print {
  .site-header,
  .nav-toggle,
  .footer-related,
  .related-links,
  .related-inner,
  .hero-actions {
    display: none;
  }

  body {
    background: #fff;
    font-size: 12px;
  }

  .site-footer {
    background: #fff;
    color: #333;
    border-top: 1px solid #ccc;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* 程序验收反馈：移动端正文优先 */
@media (max-width: 768px) {
  .site-main :is(.page-content, .main-content, .content-main) {
    order: 1;
  }

  .site-main :is(aside, .sidebar) {
    order: 2;
  }
}
