/* ==========================================================================
   漫蛙manwa · 全站样式表
   视觉方向：漫画书店风 / 纸张白底 / 书脊色分类标签 / 清晰更新标签
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base —— 变量、重置、全局基础
   -------------------------------------------------------------------------- */
:root {
  --paper: #f5f0e8;
  --paper-deep: #ece4d6;
  --ink: #2b2b2b;
  --ink-soft: #5a554e;
  --line: #ddd5c7;
  --accent: #c0392b;
  --accent-dark: #a03024;
  --blue: #2980b9;
  --green: #27ae60;
  --amber: #f39c12;
  --white: #fffdf8;
  --radius: 8px;
  --radius-sm: 6px;
  --container: 1160px;
  --header-h: 72px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   2. Layout —— 容器、页头、页脚、面包屑、页面标题
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.brand-slogan {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.site-nav .nav-list {
  display: flex;
  gap: 6px;
}

.site-nav .nav-list a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 500;
}

.site-nav .nav-list a:hover {
  background: var(--paper);
  color: var(--accent);
}

.site-nav .nav-list a.is-current {
  background: var(--ink);
  color: var(--white);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius-sm);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* 内页统一容器 */
.site-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60vh;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 0 8px;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--ink-soft);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  color: var(--line);
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 500;
}

/* 页面标题区 */
.page-header {
  padding: 18px 0 28px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.page-description {
  font-size: 1rem;
  max-width: 720px;
}

/* 页脚 */
.site-footer {
  background: var(--ink);
  margin-top: 64px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px 24px 24px;
}

.footer-brand {
  margin-bottom: 32px;
}

.footer-brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.footer-desc {
  color: #b5aea2;
  font-size: 0.9rem;
  max-width: 560px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 24px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-link-group h3 {
  color: var(--white);
  font-size: 0.95rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-link-group li {
  margin-bottom: 8px;
}

.footer-link-group a {
  color: #b5aea2;
  font-size: 0.875rem;
}

.footer-link-group a:hover {
  color: var(--amber);
}

.footer-bottom {
  padding-top: 20px;
  text-align: center;
}

.footer-bottom p {
  color: #8f887c;
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   3. Components —— 通用组件
   -------------------------------------------------------------------------- */
.section-title {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.section-desc {
  margin-bottom: 24px;
  max-width: 680px;
}

.section-lead {
  margin-bottom: 20px;
}

/* 封面图容器统一约束 */
.cover-figure,
.work-cover,
.category-figure,
.hero-figure,
.guide-figure {
  background: var(--paper-deep);
  border-radius: var(--radius);
  overflow: hidden;
}

.cover-figure img,
.work-cover img,
.category-figure img,
.hero-figure img,
.guide-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.cover-figure:hover img,
.work-cover:hover img,
.category-figure:hover img,
.longtail-card:hover img {
  transform: scale(1.04);
}

/* 通用卡片 */
.work-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.work-card:hover {
  box-shadow: 0 6px 20px rgba(43, 43, 43, 0.08);
  transform: translateY(-3px);
}

/* 相关推荐模块 */
.related-links {
  margin-top: 48px;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.related-links h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--paper);
}

.related-links li {
  margin-bottom: 10px;
}

.related-links a {
  display: inline-block;
  padding: 4px 0;
  font-size: 0.95rem;
}

.related-links a::before {
  content: "▸ ";
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. Pages —— 首页
   -------------------------------------------------------------------------- */
.home-main {
  padding-bottom: 0;
}

/* 首屏 hero */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 48px;
}

.hero-content h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero-desc {
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-cta {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.hero-cta:hover {
  background: var(--accent-dark);
  color: var(--white);
}

.hero-figure {
  aspect-ratio: 4 / 3;
}

/* 分类导航带 */
.category-nav {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.category-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-tag {
  display: inline-block;
  padding: 10px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.category-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 最近更新 */
.recent-updates {
  padding: 48px 0 8px;
}

.update-group {
  margin-bottom: 36px;
}

.update-date {
  display: inline-block;
  background: var(--ink);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.update-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.update-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  transition: box-shadow 0.25s ease;
}

.update-item:hover {
  box-shadow: 0 4px 16px rgba(43, 43, 43, 0.08);
}

.update-item .cover-figure {
  width: 88px;
  height: 118px;
  flex-shrink: 0;
}

.update-info {
  min-width: 0;
}

.work-title {
  font-size: 1rem;
  margin-bottom: 6px;
}

.update-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  background: var(--green);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.work-brief {
  font-size: 0.8125rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 人气榜单 */
.ranking {
  padding: 48px 0 8px;
}

.ranking-list {
  counter-reset: rank;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
  counter-increment: rank;
  position: relative;
}

.ranking-item::before {
  content: counter(rank);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--amber);
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.ranking-item .cover-figure {
  width: 72px;
  height: 96px;
  flex-shrink: 0;
}

.ranking-info {
  min-width: 0;
}

.ranking-title {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.ranking-reason {
  font-size: 0.875rem;
}

/* 阅读指南入口 */
.guide-entry {
  padding: 48px 0 8px;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.guide-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 28px;
}

.guide-card h3 {
  margin-bottom: 10px;
}

.guide-card p {
  font-size: 0.925rem;
  margin-bottom: 16px;
}

.guide-link {
  font-weight: 600;
  font-size: 0.925rem;
}

/* 长尾推荐预告 */
.longtail-preview {
  padding: 48px 0 8px;
}

.longtail-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.longtail-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.longtail-card:hover {
  box-shadow: 0 6px 20px rgba(43, 43, 43, 0.08);
  transform: translateY(-3px);
}

.longtail-card .cover-figure {
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.longtail-card h3 {
  padding: 16px 20px 6px;
  font-size: 1.1rem;
}

.longtail-card p {
  padding: 0 20px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.longtail-link {
  display: inline-block;
  margin: 0 20px 20px;
  font-weight: 600;
  font-size: 0.925rem;
}

/* --------------------------------------------------------------------------
   5. Pages —— 题材分类页
   -------------------------------------------------------------------------- */
.category-list {
  margin-bottom: 48px;
}

.category-group {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}

.category-group-head {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--paper);
}

.category-group-title {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.category-group-title::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 10px;
  background: var(--amber);
  vertical-align: middle;
}

.category-group:nth-child(2) .category-group-title::before {
  background: var(--accent);
}

.category-group:nth-child(3) .category-group-title::before {
  background: var(--blue);
}

.category-group:nth-child(4) .category-group-title::before {
  background: var(--green);
}

.category-group:nth-child(5) .category-group-title::before {
  background: var(--amber);
}

.category-group-desc {
  font-size: 0.9rem;
}

.category-group-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px 28px;
  align-items: center;
}

.category-figure {
  aspect-ratio: 16 / 10;
}

.category-figure figcaption {
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  background: var(--paper);
}

.category-group-links p {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.category-group-links a {
  font-weight: 600;
}

/* 代表作品 */
.featured-works {
  margin-bottom: 40px;
}

.featured-works > p {
  margin-bottom: 20px;
}

.featured-works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.featured-works-grid .work-card {
  padding: 16px;
  display: flex;
  gap: 16px;
}

.featured-works-grid img {
  width: 96px;
  height: 128px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.featured-works-grid h3 {
  margin-bottom: 6px;
}

.featured-works-grid p {
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   6. Pages —— 阅读指南页
   -------------------------------------------------------------------------- */
.guide-section {
  margin-bottom: 48px;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.guide-step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 16px;
}

.step-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.step-content p {
  font-size: 0.875rem;
}

.step-content a {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.guide-figure {
  aspect-ratio: 21 / 9;
  margin-bottom: 20px;
}

.guide-figure figcaption {
  padding: 10px 14px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  background: var(--white);
  border-top: 1px solid var(--line);
}

/* 追更技巧 */
.tips-list {
  list-style: none;
}

.tip-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 14px;
  font-size: 0.925rem;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   7. Pages —— 长尾页（恋爱 / 热血）
   -------------------------------------------------------------------------- */
.subcategory-groups {
  margin-bottom: 48px;
}

.section-heading {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}

.section-heading h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.section-heading p {
  font-size: 0.9rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.work-grid .work-card {
  display: flex;
  gap: 18px;
  padding: 18px;
}

.work-cover {
  width: 120px;
  height: 160px;
  flex-shrink: 0;
}

.work-info {
  min-width: 0;
}

.work-info h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.work-info p {
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.work-point {
  display: flex;
  gap: 6px;
  font-size: 0.875rem;
}

.work-point strong {
  color: var(--accent);
  font-weight: 600;
}

/* 阅读建议 */
.reading-tips {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
}

.reading-tips h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.reading-tips p {
  font-size: 0.925rem;
  margin-bottom: 10px;
}

/* 热血页 */
.content-section {
  margin-bottom: 44px;
}

.content-section > h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}

.content-section > p {
  font-size: 0.925rem;
  margin-bottom: 20px;
}

.work-card-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.work-card-list .work-card {
  display: flex;
  gap: 18px;
  padding: 18px;
}

/* --------------------------------------------------------------------------
   8. Pages —— 404
   -------------------------------------------------------------------------- */
.error-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
  padding: 48px 24px;
}

.error-section {
  text-align: center;
  max-width: 520px;
}

.error-code {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 8px;
}

.error-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.error-desc {
  margin-bottom: 28px;
}

.error-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   9. Responsive —— 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-figure {
    aspect-ratio: 16 / 9;
  }

  .update-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-group-media {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .brand-slogan {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(43, 43, 43, 0.08);
  }

  .site-nav .nav-list {
    display: none;
    flex-direction: column;
    padding: 12px 16px;
    gap: 2px;
  }

  .site-nav .nav-list.is-open {
    display: flex;
  }

  .site-nav .nav-list a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }

  .site-main {
    padding: 0 16px;
  }

  .page-header {
    padding: 14px 0 22px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .footer-inner {
    padding: 36px 16px 20px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .guide-cards,
  .longtail-cards,
  .featured-works-grid,
  .work-grid,
  .work-card-list {
    grid-template-columns: 1fr;
  }

  .update-list {
    grid-template-columns: 1fr;
  }

  .guide-steps {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 36px 0 32px;
  }

  .hero-content h1 {
    font-size: 1.7rem;
  }

  .ranking-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .ranking-item::before {
    width: 32px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .update-item {
    flex-direction: column;
  }

  .update-item .cover-figure {
    width: 100%;
    height: 160px;
  }

  .featured-works-grid .work-card {
    flex-direction: column;
  }

  .featured-works-grid img {
    width: 100%;
    height: 160px;
  }

  .work-grid .work-card,
  .work-card-list .work-card {
    flex-direction: column;
  }

  .work-cover {
    width: 100%;
    height: 180px;
  }

  .guide-step {
    flex-direction: column;
  }

  .category-group-head,
  .category-group-media {
    padding: 18px;
  }

  .longtail-card .cover-figure {
    aspect-ratio: 16 / 10;
  }

  .error-code {
    font-size: 3.2rem;
  }
}
