/* =========================================
   小丸子成长记录 - 全站样式
   简洁温馨，浅色调家庭记录类网站
   ========================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink-light: #fff0f4;
  --pink-soft:  #ffd6e0;
  --pink-mid:   #f4a7b9;
  --pink-main:  #e8758a;
  --pink-dark:  #c25470;
  --warm-white: #fffaf8;
  --warm-gray:  #6b6560;
  --warm-light: #f9f3f0;
  --border:     rgba(232, 117, 138, 0.2);
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --shadow-sm:  0 2px 8px rgba(200,100,120,0.08);
  --shadow-md:  0 4px 20px rgba(200,100,120,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--warm-white);
  color: #3d3530;
  line-height: 1.7;
  font-size: 15px;
}

/* ---- 备案提示顶栏 ---- */
.beian-topbar {
  background: var(--pink-light);
  border-bottom: 1px solid var(--pink-soft);
  text-align: center;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--warm-gray);
  letter-spacing: 0.02em;
}
.beian-topbar a {
  color: var(--pink-dark);
  text-decoration: none;
}
.beian-topbar a:hover { text-decoration: underline; }

/* ---- 导航栏 ---- */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
nav {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.nav-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--pink-dark);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-logo span { font-weight: 300; color: var(--warm-gray); font-size: 13px; margin-left: 6px; }
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: #5a4f4a;
  font-size: 14px;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--pink-dark);
  border-bottom-color: var(--pink-mid);
}

/* ---- 主内容区 ---- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ---- 页脚 ---- */
footer {
  background: var(--warm-light);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  font-size: 12px;
  color: var(--warm-gray);
  line-height: 2;
}
footer a {
  color: var(--pink-dark);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
.footer-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.footer-icp-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.footer-icp-icon img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* ---- 英雄区（首页） ---- */
.hero {
  text-align: center;
  padding: 56px 0 40px;
}
.hero-badge {
  display: inline-block;
  background: var(--pink-light);
  color: var(--pink-dark);
  border: 1px solid var(--pink-soft);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  margin-bottom: 18px;
  letter-spacing: 0.04em;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  color: var(--pink-dark);
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}
.hero p {
  color: var(--warm-gray);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 36px;
}

/* ---- 轮播器 ---- */
.carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--pink-light);
  margin-bottom: 48px;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16/9;
  max-height: 460px;
}
.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}
.carousel-slide {
  min-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--pink-light);
}
.carousel-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff0f4, #fde8ee);
  font-size: 48px;
  gap: 12px;
}
.carousel-placeholder p {
  font-size: 15px;
  color: var(--pink-dark);
  font-weight: 500;
}
.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 100%);
  color: #fff;
  padding: 32px 24px 16px;
  font-size: 14px;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-dark);
  box-shadow: var(--shadow-sm);
  transition: background 0.2s;
  z-index: 2;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.carousel-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-dot.active { background: #fff; }

/* ---- 快速入口卡片 ---- */
.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--pink-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--pink-mid);
  border-radius: 2px;
}
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 48px;
}
.entry-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.entry-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.entry-card-icon { font-size: 32px; }
.entry-card h3 { font-size: 16px; font-weight: 600; color: var(--pink-dark); }
.entry-card p { font-size: 13px; color: var(--warm-gray); line-height: 1.6; }

/* ---- 童言童语页 ---- */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.quote-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.quote-card::before {
  content: '\201C';
  position: absolute;
  top: -10px;
  right: 14px;
  font-size: 80px;
  color: var(--pink-soft);
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}
.quote-text {
  font-size: 16px;
  color: #3d3530;
  font-weight: 500;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}
.quote-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--warm-gray);
}
.quote-tag {
  background: var(--pink-light);
  color: var(--pink-dark);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 11px;
}
.quote-age {
  background: #fff5e4;
  color: #c07a10;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 11px;
}

/* ---- 照片墙页 ---- */
/* ---- 诗歌卡片（童言童语页） ---- */
.poem-card {
  background: linear-gradient(135deg, #fff0f4 0%, #fde8ee 50%, #fff5f7 100%);
  border: 2px solid var(--pink-soft);
  border-radius: var(--radius-lg);
  padding: 28px 24px 20px;
  box-shadow: var(--shadow-md);
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
}
.poem-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(244,167,185,0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.poem-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--pink-dark);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.06em;
}
.poem-card-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--pink-mid);
  margin: 8px auto 0;
  border-radius: 1px;
}
.poem-line {
  font-size: 15px;
  line-height: 2;
  color: #4a3f3a;
  text-align: center;
}
.poem-speaker {
  color: var(--pink-main);
  font-weight: 600;
  margin-right: 4px;
}
.poem-divider {
  width: 30px;
  height: 1px;
  background: var(--pink-mid);
  margin: 6px auto;
  opacity: 0.5;
}
.photo-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: #5a4f4a;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--pink-light);
  border-color: var(--pink-mid);
  color: var(--pink-dark);
}
.photo-grid {
  columns: 3 220px;
  column-gap: 16px;
}
.photo-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--pink-light);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.photo-item img {
  width: 100%;
  display: block;
  object-fit: contain;
  background: var(--pink-light);
}
.photo-placeholder {
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  gap: 8px;
  min-height: 160px;
}
.photo-placeholder.tall { aspect-ratio: 3/4; }
.photo-placeholder.wide { aspect-ratio: 16/9; }
.photo-placeholder p { font-size: 12px; color: var(--pink-dark); }
.photo-caption {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.photo-caption p { font-size: 13px; color: #4a3f3a; }
.photo-caption small { font-size: 11px; color: var(--warm-gray); }
.photo-year-label {
  font-size: 22px;
  font-weight: 700;
  color: var(--pink-dark);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--pink-soft);
}

/* ---- 汉堡菜单（移动端） ---- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--pink-dark);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  nav { padding: 12px 16px; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 24px;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .nav-links a.active, .nav-links a:hover {
    border-left-color: var(--pink-mid);
    background: var(--pink-light);
  }
  header { position: relative; }
  main { padding: 24px 16px 48px; }
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 26px; }
  .photo-grid { columns: 2 140px; }
  .carousel { aspect-ratio: 4/3; }
  .footer-beian { flex-direction: column; gap: 8px; }
}

@media (max-width: 400px) {
  .photo-grid { columns: 1; }
}

/* ---- 动画 ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.5s ease both; }
.fade-in-d1 { animation-delay: 0.1s; }
.fade-in-d2 { animation-delay: 0.2s; }
.fade-in-d3 { animation-delay: 0.3s; }
