@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* ===========================
   CSS 自定义属性
   =========================== */
:root {
  --mint: #b4fde1;
  --ice: #add8e6;
  --ink: #172620;
  --mint-dark: #7de8be;
  --ice-dark: #7bbcd4;
  --ink-light: #2e4a40;
  --white: #ffffff;
  --card-bg: #dffef3;
  --card-bg2: #d6eef8;
  --radius: 18px;
  --radius-sm: 10px;
  --radius-xs: 4px;
  --border: 3px solid var(--ink);
  --shadow-outer: 5px 5px 0px var(--ink);
  --shadow-clay: 4px 4px 12px rgba(23,38,32,0.18), inset -2px -2px 8px rgba(23,38,32,0.08);
  --shadow-hover: 7px 7px 0px var(--ink);
  --font: 'Space Mono', 'Courier New', Courier, monospace;
  --header-w: 260px;
  --transition: 200ms cubic-bezier(0.34, 1.56);
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  background: var(--mint);
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--mint);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.75;
}

ul, ol {
  list-style: none;
}

/* ===========================
   点阵底纹
   =========================== */
.hero-section,
.cat-hero-section,
.entry-header-section,
.about-hero-section,
.privacy-header-section {
  background-image: radial-gradient(circle, var(--ink) 1px, transparent 1px);
  background-size: 22px 22px;
  background-color: var(--mint);
  position: relative;
}

.hero-section::after,
.cat-hero-section::after,
.entry-header-section::after,
.about-hero-section::after,
.privacy-header-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(180,253,225,0.82) 0%, rgba(173,216,230,0.72) 100%);
  pointer-events: none;
}

/* ===========================
   左侧固定导航 Header
   =========================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--header-w);
  height: 100vh;
  background: var(--ice);
  border-right: var(--border);
  box-shadow: var(--shadow-clay);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 200;
  padding: 0;
}

.brand-wrap {
  padding: 24px 20px 20px;
  border-bottom: 3px solid var(--ink);
}

.brand-logo {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  display: block;
  letter-spacing: 0.03em;
  line-height: 1.3;
  word-break: break-all;
}

.brand-logo:hover {
  opacity: 0.8;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--mint);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-outer);
  padding: 12px 16px;
  margin: 20px 20px 0;
  cursor: pointer;
  align-self: flex-start;
  transition: box-shadow var(--transition), transform var(--transition);
  min-height: 48px;
}

.nav-toggle:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-1px, -1px);
}

.nav-toggle:active {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

.burger-line {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}

/* 全屏遮罩菜单 */
.fullscreen-nav {
  position: fixed;
  inset: 0;
  background: var(--mint);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 48px 40px 40px;
  gap: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 250ms ease-out, transform 250ms ease-out;
  overflow-y: auto;
}

.fullscreen-nav.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-close {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  background: var(--ink);
  color: var(--mint);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-outer);
  padding: 10px 24px;
  margin-bottom: 32px;
  cursor: pointer;
  min-height: 44px;
  transition: box-shadow var(--transition), transform var(--transition);
  align-self: flex-end;
}

.nav-close:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-1px, -1px);
}

.nav-link {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  display: block;
  padding: 14px 0 14px 4px;
  border-bottom: 2px solid rgba(23,38,32,0.15);
  width: 100%;
  max-width: 560px;
  transition: color 150ms ease, padding-left 150ms ease;
  min-height: 50px;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--ink-light);
  padding-left: 16px;
  opacity: 1;
}

.nav-link--active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 700;
}

/* ===========================
   主内容区（左边 header 腾出空间）
   =========================== */
.home-main,
.cat-main,
.entry-main,
.about-main,
.privacy-main {
  margin-left: var(--header-w);
  min-height: 100vh;
  padding-bottom: 0;
}

/* ===========================
   Hero Section
   =========================== */
.hero-section {
  min-height: 45vh;
  display: flex;
  align-items: center;
  padding: 60px 48px 56px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  color: var(--ink);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-light);
  max-width: 520px;
  line-height: 1.7;
}

/* ===========================
   内容区公共
   =========================== */
.content-section,
.cat-content-section,
.entry-body-section,
.about-body-section,
.privacy-body-section {
  background: var(--white);
  padding: 40px 48px;
  border-top: 3px solid var(--ink);
}

.prose-wrap {
  max-width: 780px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
}

.prose-wrap h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 32px 0 12px;
  line-height: 1.3;
}

.prose-wrap h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 24px 0 8px;
}

.prose-wrap p {
  margin: 0 0 16px;
}

.prose-wrap ul, .prose-wrap ol {
  list-style: disc;
  padding-left: 24px;
  margin: 0 0 16px;
}

.prose-wrap li {
  margin-bottom: 6px;
}

.prose-wrap a {
  color: var(--ink-light);
  font-weight: 700;
}

hr {
  border: none;
  border-top: 3px solid var(--ink);
  margin: 14px 0 24px;
  border-radius: 2px;
}

/* ===========================
   分类卡片区（首页）
   =========================== */
.cats-section,
.recent-section,
.children-section,
.related-section,
.nav-back-section,
.about-nav-section,
.privacy-links-section {
  padding: 40px 48px;
  background: var(--mint);
  border-top: 3px solid var(--ink);
}

.cats-section h2,
.recent-section h2,
.children-section h2,
.related-section h2,
.nav-back-section h2,
.about-nav-section h2,
.privacy-links-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.cats-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 4px;
}

.cat-card {
  background: var(--card-bg);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-clay);
  padding: 24px 22px 20px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.cat-card--1 {
  background: var(--card-bg2);
}
.cat-card--2 {
  background: #fef9e7;
}
.cat-card--3 {
  background: #fce4ec;
}

.cat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.cat-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.cat-card h3 a {
  text-decoration: none;
  color: var(--ink);
}

.cat-card h3 a:hover {
  text-decoration: underline;
  opacity: 1;
}

.cat-card p {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.55;
  margin-bottom: 10px;
}

.cat-count {
  font-size: 0.82rem;
  background: var(--ink);
  color: var(--mint);
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-block;
}

/* ===========================
   最新更新列表（首页）
   =========================== */
.entries-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.entry-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-clay);
  padding: 20px 20px 18px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.entry-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.entry-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.entry-card h3 a {
  text-decoration: none;
  color: var(--ink);
}

.entry-card h3 a:hover {
  text-decoration: underline;
  opacity: 1;
}

.entry-card p {
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.55;
}

.entry-date {
  font-size: 0.82rem;
  color: var(--ink-light);
  display: block;
  margin-bottom: 6px;
}

/* ===========================
   栏目页子页列表
   =========================== */
.children-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 4px;
}

.child-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-clay);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.child-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.card-img-wrap {
  overflow: hidden;
  background: var(--ice);
  max-height: 180px;
}

.card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 0;
  transition: transform 300ms ease;
}

.child-card:hover .card-thumb {
  transform: scale(1.04);
}

.card-body {
  padding: 18px 18px 16px;
}

.card-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-body h3 a {
  text-decoration: none;
  color: var(--ink);
}

.card-body h3 a:hover {
  text-decoration: underline;
  opacity: 1;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.55;
  margin-bottom: 12px;
}

.card-cta {
  display: inline-block;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--mint);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: box-shadow var(--transition), transform var(--transition);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.card-cta:hover {
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(-1px, -1px);
  opacity: 1;
}

/* ===========================
   栏目页 Hero
   =========================== */
.cat-hero-section,
.about-hero-section,
.privacy-header-section {
  min-height: 28vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 48px 36px;
  overflow: hidden;
}

.cat-h1,
.about-h1,
.privacy-h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.cat-desc {
  font-size: 1rem;
  color: var(--ink-light);
  max-width: 560px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.about-sub {
  font-size: 1rem;
  color: var(--ink-light);
  max-width: 560px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* ===========================
   面包屑
   =========================== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumb-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===========================
   文章页
   =========================== */
.entry-h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.entry-date-tag {
  font-size: 0.84rem;
  background: rgba(23,38,32,0.08);
  color: var(--ink);
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-family: var(--font);
}

.entry-cat-tag {
  font-size: 0.84rem;
  background: var(--ink);
  color: var(--mint);
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font);
}

.entry-hero-wrap {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin-top: 16px;
}

.entry-hero-img {
  width: 100%;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-clay);
}

.entry-prose {
  max-width: 760px;
}

/* ===========================
   相关文章
   =========================== */
.sibling-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.sibling-card {
  background: var(--card-bg2);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-clay);
  padding: 18px 18px 16px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.sibling-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.sibling-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.sibling-card h3 a {
  text-decoration: none;
  color: var(--ink);
}

.sibling-card h3 a:hover {
  text-decoration: underline;
  opacity: 1;
}

.sibling-card p {
  font-size: 0.86rem;
  color: var(--ink-light);
  line-height: 1.55;
}

/* ===========================
   返回按钮
   =========================== */
.back-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--mint);
  color: var(--ink);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  text-decoration: none;
  box-shadow: var(--shadow-outer);
  transition: box-shadow var(--transition), transform var(--transition);
  min-height: 44px;
}

.back-btn:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
  opacity: 1;
}

.back-btn:active {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

/* ===========================
   About 导航网格
   =========================== */
.about-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.about-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-clay);
  padding: 20px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow var(--transition), transform var(--transition);
  min-height: 44px;
}

.about-nav-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
  opacity: 1;
}

.about-nav-item strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.about-nav-item span {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.5;
}

/* ===========================
   空状态
   =========================== */
.empty-tip {
  font-size: 1rem;
  color: var(--ink-light);
  padding: 24px 0;
}

/* ===========================
   页脚
   =========================== */
.site-footer {
  background: var(--ink);
  color: var(--mint);
  margin-left: var(--header-w);
  padding: 48px 48px 28px;
  border-top: 4px solid var(--mint);
}

.footer-brand {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 32px;
  color: var(--mint);
  word-break: break-all;
}

.footer-cols {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.footer-dl {
  min-width: 120px;
}

.footer-dl dt {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ice);
  margin-bottom: 10px;
  text-transform: none;
  letter-spacing: 0.05em;
}

.footer-dl dd {
  margin-bottom: 6px;
}

.footer-dl dd a {
  color: var(--mint);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
  transition: opacity 150ms ease;
  display: inline-block;
  min-height: 28px;
  line-height: 1.6;
}

.footer-dl dd a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.82rem;
  color: rgba(180,253,225,0.55);
  border-top: 1px solid rgba(180,253,225,0.18);
  padding-top: 18px;
  line-height: 1.6;
}

/* ===========================
   Stagger 动画
   =========================== */
@media (prefers-reduced-motion: no-preference) {
  [data-stagger] {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    animation: stagger-in 0.45s cubic-bezier(0.34, 1.56) forwards;
  }

  [data-stagger="0"] { animation-delay: 0.05s; }
  [data-stagger="1"] { animation-delay: 0.12s; }
  [data-stagger="2"] { animation-delay: 0.19s; }
  [data-stagger="3"] { animation-delay: 0.26s; }
  [data-stagger="4"] { animation-delay: 0.33s; }
  [data-stagger="5"] { animation-delay: 0.40s; }
  [data-stagger="6"] { animation-delay: 0.47s; }
  [data-stagger="7"] { animation-delay: 0.54s; }

  @keyframes stagger-in {
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .cat-card:active,
  .entry-card:active,
  .child-card:active,
  .sibling-card:active {
    transform: translate(2px, 2px) scale(0.98);
    box-shadow: 2px 2px 0 var(--ink);
    transition: transform 100ms ease-out, box-shadow 100ms ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===========================
   响应式：平板
   =========================== */
@media (max-width: 900px) {
  :root {
    --header-w: 0px;
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: var(--border);
    padding: 0 16px;
    z-index: 200;
    box-shadow: 0 3px 12px rgba(23,38,32,0.12);
  }

  .brand-wrap {
    padding: 14px 0;
    border-bottom: none;
    flex: 1;
  }

  .brand-logo {
    font-size: 0.95rem;
  }

  .nav-toggle {
    margin: 0;
    align-self: center;
  }

  .home-main,
  .cat-main,
  .entry-main,
  .about-main,
  .privacy-main {
    margin-left: 0;
    margin-top: 68px;
  }

  .site-footer {
    margin-left: 0;
  }
}

/* ===========================
   响应式：手机
   =========================== */
@media (max-width: 600px) {
  .hero-section {
    padding: 40px 20px 36px;
    min-height: 42vh;
  }

  .hero-h1 {
    font-size: 1.75rem;
  }

  .content-section,
  .cat-content-section,
  .entry-body-section,
  .about-body-section,
  .privacy-body-section {
    padding: 28px 20px;
  }

  .cats-section,
  .recent-section,
  .children-section,
  .related-section,
  .nav-back-section,
  .about-nav-section,
  .privacy-links-section {
    padding: 28px 20px;
  }

  .cat-hero-section,
  .about-hero-section,
  .privacy-header-section {
    padding: 32px 20px 28px;
    min-height: 24vh;
  }

  .cats-list,
  .entries-list,
  .children-list,
  .sibling-list,
  .about-nav-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 36px 20px 24px;
  }

  .footer-brand {
    font-size: 1.9rem;
  }

  .footer-cols {
    gap: 24px;
    flex-direction: column;
  }

  .back-links {
    flex-direction: column;
  }

  .back-btn {
    width: 100%;
    justify-content: center;
  }

  .fullscreen-nav {
    padding: 32px 24px 32px;
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 12px 0 12px 4px;
  }
}
