/* ===========================
   拾光谷 · 全局样式
   =========================== */

/* 引入手写感英文字体 */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap');

/* CSS 变量（颜色/字体统一管理，改一处全站变） */
:root {
  --bg:          #FFF8F0;   /* 奶油白背景 */
  --bg-card:     #FFFDF7;   /* 卡片背景，比背景稍白 */
  --text:        #5D4E37;   /* 主文字，深棕 */
  --text-light:  #9C8570;   /* 次要文字，浅棕 */
  --title:       #E8734A;   /* 标题橘色 */
  --green:       #7BAE7F;   /* 草绿点缀 */
  --green-dark:  #5D8C5A;   /* 深绿 */
  --amber:       #F4C562;   /* 暖黄（太阳色） */
  --border:      #D4C4B0;   /* 边框色，米棕 */
  --shadow:      rgba(93, 78, 55, 0.12); /* 投影色 */

  --font-hand:   'Caveat', cursive;       /* 手写英文 */
  --font-body:   'LXGW WenKai', 'Noto Serif SC', Georgia, serif; /* 正文宋体感 */
  --font-ui:     system-ui, -apple-system, sans-serif; /* UI 元素 */

  --radius:      12px;    /* 圆角 */
  --radius-lg:   20px;
  --max-width:   780px;   /* 最大内容宽度 */
}

/* ===========================
   重置 & 基础
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* 点击导航平滑滚动 */
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  /* 手绘纸张质感：细微噪点纹理 */
  background-image:
    radial-gradient(circle at 20% 50%, rgba(244, 197, 98, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(123, 174, 127, 0.04) 0%, transparent 50%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--title);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.75;
}

/* ===========================
   布局容器
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   导航栏
   =========================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 248, 240, 0.88);
  backdrop-filter: blur(8px);  /* 毛玻璃效果 */
  border-bottom: 1.5px dashed var(--border); /* 手绘虚线感 */
  padding: 12px 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo 文字 */
.navbar-logo {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--title);
  letter-spacing: 0.02em;
}

.navbar-logo span {
  color: var(--green);
}

/* 导航链接 */
.navbar-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.navbar-links a {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--text);
  position: relative;
  padding-bottom: 2px;
}

/* 链接下划线动画（手绘划线感） */
.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--title);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.navbar-links a:hover::after {
  width: 100%;
}

.navbar-links a:hover {
  color: var(--title);
  opacity: 1;
}

/* ===========================
   Hero 区域（顶部大图）
   =========================== */
.hero {
  text-align: center;
  padding: 60px 24px 0;
  position: relative;
  overflow: hidden;
}

.hero-text {
  position: relative;
  z-index: 1;
}

/* 网站主标题 */
.hero-title {
  font-family: var(--font-hand);
  font-size: clamp(2.8rem, 8vw, 5rem); /* clamp = 自适应字号 */
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-title .highlight {
  color: var(--title);
  /* 手绘下划线装饰 */
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--amber);
  text-underline-offset: 6px;
}

/* 副标题/slogan */
.hero-slogan {
  font-family: var(--font-hand);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-light);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}

/* 手绘"圈圈"装饰按钮 */
.hero-btn {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--text);
  background: transparent;
  border: 2.5px solid var(--text);
  border-radius: 50px;
  padding: 8px 28px;
  cursor: pointer;
  transition: all 0.25s;
  /* 手绘感：轻微旋转 */
  transform: rotate(-0.5deg);
}

.hero-btn:hover {
  background: var(--title);
  border-color: var(--title);
  color: white;
  transform: rotate(0deg) scale(1.04);
  opacity: 1;
}

/* 山谷插图 */
.hero-illustration {
  margin-top: 16px;
  width: 100%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================
   波浪分割线
   =========================== */
.wave-divider {
  width: 100%;
  line-height: 0;
  overflow: hidden;
}

.wave-divider img,
.wave-divider svg {
  width: 100%;
  display: block;
}

/* 手绘风水平分割线 */
.doodle-divider {
  text-align: center;
  margin: 48px 0 40px;
  color: var(--border);
  font-family: var(--font-hand);
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  user-select: none;
}

/* ===========================
   章节通用样式
   =========================== */
section {
  padding: 64px 0;
}

/* 章节标题 */
.section-title {
  font-family: var(--font-hand);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  font-size: 1.6rem;
}

/* 章节小副标题 */
.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 36px;
  font-style: italic;
}

/* ===========================
   关于我
   =========================== */
.about-section {
  background: var(--bg);
}

/* 手绘风卡片 */
.about-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  position: relative;
  /* 手绘歪斜感 */
  transform: rotate(-0.3deg);
  box-shadow: 4px 4px 0 var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.about-card:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 6px 8px 0 var(--border);
}

/* 卡片左侧彩色竖条 */
.about-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 4px;
  background: linear-gradient(to bottom, var(--title), var(--amber));
  border-radius: 4px;
}

.about-name {
  font-family: var(--font-hand);
  font-size: 1.8rem;
  color: var(--title);
  margin-bottom: 12px;
}

.about-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
}

.about-text p + p {
  margin-top: 12px;
}

/* ===========================
   文章卡片列表
   =========================== */
.posts-section {
  background: var(--bg);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* 单篇文章卡片 */
.post-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 3px 3px 0 var(--border);
}

.post-card:hover {
  transform: translateY(-4px) rotate(0.3deg);
  box-shadow: 5px 7px 0 var(--border);
}

/* 卡片顶部彩色标签条 */
.post-card-tag {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: white;
  background: var(--green);
  padding: 2px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.post-card-title {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 16px;
}

.post-card-meta {
  font-size: 0.82rem;
  color: var(--border);
  font-family: var(--font-hand);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 占位提示（没有文章时显示） */
.posts-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-family: var(--font-hand);
  font-size: 1.2rem;
}

.posts-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ===========================
   好奇清单
   =========================== */
.curiosity-section {
  background: var(--bg);
}

.curiosity-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.curiosity-item {
  background: var(--bg-card);
  border: 2px dashed var(--border); /* 虚线边框，更手绘 */
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.25s, transform 0.25s;
  cursor: default;
}

.curiosity-item:hover {
  border-color: var(--green);
  transform: rotate(0.5deg);
}

.curiosity-item.done {
  opacity: 0.6;
  border-style: solid;
}

/* 复选框样式 */
.curiosity-check {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin-top: 1px;
}

.curiosity-item.done .curiosity-check {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.curiosity-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.curiosity-item.done .curiosity-text {
  text-decoration: line-through;
  color: var(--text-light);
}

/* ===========================
   页脚
   =========================== */
.footer {
  background: var(--bg);
  border-top: 1.5px dashed var(--border);
  padding: 48px 0 36px;
  text-align: center;
}

.footer-quote {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--text-light);
  margin-bottom: 24px;
  font-style: italic;
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.footer-link {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  transition: all 0.25s;
}

.footer-link:hover {
  border-color: var(--title);
  color: var(--title);
  opacity: 1;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--border);
  font-family: var(--font-hand);
}

/* ===========================
   滚动动画（JS 配合使用）
   =========================== */

/* 初始状态：透明 + 向上偏移 */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* JS 添加这个 class 后触发动画 */
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 延迟（让多个元素依次出现） */
.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }
.fade-up:nth-child(4) { transition-delay: 0.3s; }
.fade-up:nth-child(5) { transition-delay: 0.4s; }

/* ===========================
   手机端适配（屏幕宽度 < 600px）
   =========================== */
@media (max-width: 600px) {
  .navbar-links {
    gap: 16px;
  }

  .navbar-links a {
    font-size: 1rem;
  }

  .about-card {
    padding: 24px 22px;
    transform: none; /* 手机上去掉歪斜 */
  }

  .about-card:hover {
    transform: translateY(-3px);
  }

  .posts-grid {
    grid-template-columns: 1fr; /* 手机单列 */
  }

  .curiosity-list {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 40px 16px 0;
  }

  section {
    padding: 48px 0;
  }
}

/* ===========================
   打印样式（可选）
   =========================== */
@media print {
  .navbar,
  .hero-btn {
    display: none;
  }
}
