/* === Growing Gallery — Fresh Sketchbook Style === */
@import url('https://fonts.googleapis.com/css2?family=ZCOOL+XiaoWei&display=swap');

:root {
  --bg: #fefdfb;
  --bg-tint: #faf7f2;
  --card: #ffffff;
  --ink: #3a3530;
  --ink-soft: #5c5650;
  --muted: #a0988c;
  --muted-light: #ccc4b8;
  --border: #ede8e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.04);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.07);

  --yifei: #f0977c;
  --yifei-soft: #fce8e2;
  --yifei-bg: #fef9f7;
  --yicheng: #7db8a8;
  --yicheng-soft: #e2f2ed;
  --yicheng-bg: #f7fcfa;

  --pink: #f5c4b8;
  --mint: #b8d8ce;
  --lavender: #d4c8e8;
  --yellow: #f5e2a8;
  --sky: #b8d8f0;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --font-display: 'ZCOOL XiaoWei', 'PingFang SC', 'STKaiti', 'KaiTi', sans-serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;

  --transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === Typography === */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.35; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.65rem); }
h3 { font-size: 1.1rem; }

/* === Decorative Dots (reusable accent) === */
.dot-row { display: flex; gap: 6px; justify-content: center; }
.dot-row .d {
  width: 8px; height: 8px; border-radius: 50%;
}

/* === Nav === */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(254,253,251,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s;
}
nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 1.5rem;
}
.nav-brand {
  font-family: var(--font-display); font-size: 1.1rem;
  color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 0.3rem;
}
.nav-brand .emoji { font-size: 1.25rem; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  font-size: 0.88rem; text-decoration: none;
  color: var(--muted); transition: color 0.25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active {
  position: relative;
}
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--yifei);
}

.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); }

/* === Hero === */
.hero {
  text-align: center; padding: 7rem 1.5rem 4rem;
  max-width: 640px; margin: 0 auto;
  position: relative;
}
.hero .dot-row { margin-bottom: 2rem; }
.hero h1 { margin-bottom: 0.2em; }
.hero h1 .hl-yifei { color: var(--yifei); }
.hero h1 .hl-yicheng { color: var(--yicheng); }
.hero .subtitle {
  color: var(--ink-soft); font-size: 1rem; line-height: 1.85;
  max-width: 480px; margin: 1rem auto 0;
}

/* Hero mini stats */
.hero-mini {
  display: inline-flex; gap: 0.5rem; margin-top: 1.5rem;
  flex-wrap: wrap; justify-content: center;
}
.hero-mini span {
  font-size: 0.78rem; color: var(--muted);
  background: var(--bg-tint); padding: 0.3em 0.8em;
  border-radius: var(--radius-full);
}

/* === Child Cards === */
.child-cards {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 1rem; max-width: 800px; margin: 0 auto 3rem; padding: 0 1.5rem;
}
.child-card {
  display: block; text-decoration: none;
  background: var(--card); border-radius: var(--radius-lg);
  padding: 2rem 1.75rem; text-align: center;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.child-card::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.5; transition: transform var(--transition);
}
.child-card.yifei::before { background: var(--yifei-soft); }
.child-card.yicheng::before { background: var(--yicheng-soft); }
.child-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.child-card:hover::before { transform: scale(1.3); }

.child-card .avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem; font-family: var(--font-display);
  font-size: 1.3rem; color: #fff;
}
.child-card.yifei .avatar { background: var(--yifei); }
.child-card.yicheng .avatar { background: var(--yicheng); }
.child-card .name {
  font-family: var(--font-display); font-size: 1.3rem; color: var(--ink);
}
.child-card .sub {
  font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; line-height: 1.6;
}
.child-card .badge {
  display: inline-block; margin-top: 0.6rem;
  font-size: 0.72rem; padding: 0.2em 0.7em; border-radius: var(--radius-full);
  font-weight: 500;
}
.child-card.yifei .badge { background: var(--yifei-soft); color: var(--yifei); }
.child-card.yicheng .badge { background: var(--yicheng-soft); color: var(--yicheng); }

/* === Section === */
.section { max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem; }
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-header h2 { display: flex; align-items: center; gap: 0.5rem; }
.section-header h2::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--yifei); flex-shrink: 0;
}
.section-header .see-all {
  font-size: 0.82rem; color: var(--muted); text-decoration: none; transition: color 0.25s;
}
.section-header .see-all:hover { color: var(--ink); }

/* === Gallery Masonry === */
.gallery {
  columns: 4; column-gap: 1rem;
}
@media (max-width: 1100px) { .gallery { columns: 3; } }
@media (max-width: 768px)  { .gallery { columns: 2; } }
@media (max-width: 500px)  { .gallery { columns: 1; } }

.artwork-card {
  break-inside: avoid; margin-bottom: 1rem;
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.artwork-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-hover);
}
.artwork-card img { width: 100%; display: block; }
.artwork-card .card-info { padding: 0.75rem 0.9rem; }
.artwork-card .card-info .title {
  font-family: var(--font-display); font-size: 0.95rem; color: var(--ink);
  line-height: 1.4; margin-bottom: 0.25rem;
}
.artwork-card .card-info .meta {
  font-size: 0.76rem; color: var(--muted);
  display: flex; align-items: center; gap: 0.35rem;
}
.artwork-card .child-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

/* === Artwork Detail Page === */
.artwork-detail {
  max-width: 1000px; margin: 0 auto; padding: 5rem 1.5rem 3rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2.5rem; align-items: start;
}
.artwork-detail .image-column { min-width: 0; overflow: hidden; }
@media (max-width: 860px) {
  .artwork-detail { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}

.artwork-image-wrap {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 0.75rem;
  box-shadow: var(--shadow);
}
.artwork-image-wrap img { width: 100%; display: block; border-radius: 6px; cursor: zoom-in; }
.artwork-image-wrap .images-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem; margin-top: 0.5rem;
}
.artwork-image-wrap .images-row img {
  cursor: pointer; border-radius: 6px; aspect-ratio: 1; object-fit: cover;
  border: 2px solid transparent; transition: border-color 0.25s;
}
.artwork-image-wrap .images-row img:hover { border-color: var(--yifei); }

/* Sidebar label */
.artwork-label { position: sticky; top: 76px; }
.artwork-label .label-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.25rem 1.25rem;
  box-shadow: var(--shadow);
}
.artwork-label .label-card + .label-card { margin-top: 0.75rem; }

.artwork-label .artwork-title {
  font-family: var(--font-display); font-size: 1.3rem; color: var(--ink);
  line-height: 1.35; margin-bottom: 0.25rem;
}
.artwork-label .artwork-date {
  font-size: 0.82rem; color: var(--muted);
}

.label-table { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.label-table tr:not(:last-child) { border-bottom: 1px solid var(--border); }
.label-table td { padding: 0.5rem 0; vertical-align: top; }
.label-table td:first-child { color: var(--muted); width: 52px; }

.artwork-label .teacher-note {
  font-size: 0.84rem; color: var(--ink-soft); line-height: 1.85;
}
.artwork-label .teacher-note .highlight {
  background: var(--yifei-soft); padding: 0.1em 0.3em; border-radius: 3px;
}

.classmates-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.classmate-tag {
  font-size: 0.76rem; padding: 0.25em 0.7em; border-radius: var(--radius-full);
  background: var(--bg-tint); border: 1px solid var(--border); color: var(--ink-soft);
}

.child-badge {
  display: inline-block; padding: 0.25em 0.75em; border-radius: var(--radius-full);
  font-size: 0.75rem; margin-bottom: 0.6rem;
}
.child-badge.yifei { background: var(--yifei-soft); color: var(--yifei); }
.child-badge.yicheng { background: var(--yicheng-soft); color: var(--yicheng); }

.back-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.85rem; color: var(--muted); text-decoration: none;
  margin-bottom: 0.75rem; transition: color 0.25s;
}
.back-link:hover { color: var(--ink); }

/* === Scene Strip === */
.scene-strip {
  margin-top: 1rem;
  background: var(--bg-tint); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1rem 1.25rem;
}
.scene-strip .scene-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.scene-strip .scene-header .scene-title {
  font-family: var(--font-display); font-size: 0.95rem; color: var(--ink);
}
.scene-strip .scene-header .scene-sub {
  font-size: 0.74rem; color: var(--muted);
}
.scene-strip .scene-items {
  display: flex; gap: 0.6rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--muted-light) transparent;
}
.scene-strip .scene-items::-webkit-scrollbar { height: 4px; }
.scene-strip .scene-items::-webkit-scrollbar-track { background: transparent; }
.scene-strip .scene-items::-webkit-scrollbar-thumb { background: var(--muted-light); border-radius: 2px; }

.scene-strip .scene-item {
  flex: 0 0 auto; width: 200px;
  scroll-snap-align: start;
  background: var(--card); border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer;
  transition: transform var(--transition);
  overflow: hidden;
}
.scene-strip .scene-item:hover { transform: translateY(-2px); }
.scene-strip .scene-item img,
.scene-strip .scene-item video {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
}
.scene-strip .scene-item .scene-label {
  padding: 0.35rem 0.5rem; font-size: 0.7rem;
  color: var(--muted); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scene-strip .scene-item.video { position: relative; }
.scene-strip .scene-item .video-play {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,0.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; pointer-events: none;
}

@media (max-width: 768px) {
  .scene-strip { padding: 0.75rem; }
  .scene-strip .scene-item { width: 160px; }
}

/* === Classroom Gallery Wall === */
.classroom-wall {
  margin-top: 1rem;
  background: var(--bg-tint); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1rem 1.25rem;
}
.classroom-wall .wall-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.classroom-wall .wall-header .wall-title {
  font-family: var(--font-display); font-size: 0.95rem; color: var(--ink);
}
.classroom-wall .wall-header .wall-sub {
  font-size: 0.74rem; color: var(--muted);
}
.classroom-wall .wall-header .wall-hint {
  margin-left: auto; font-size: 0.7rem; color: var(--muted-light);
}

.classroom-wall .wall-strip {
  display: flex; gap: 0.6rem;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--muted-light) transparent;
}
.classroom-wall .wall-strip::-webkit-scrollbar { height: 4px; }
.classroom-wall .wall-strip::-webkit-scrollbar-track { background: transparent; }
.classroom-wall .wall-strip::-webkit-scrollbar-thumb { background: var(--muted-light); border-radius: 2px; }

.classroom-wall .wall-item {
  flex: 0 0 auto; width: 150px;
  scroll-snap-align: start;
  background: var(--card); border-radius: var(--radius-sm);
  border: 2px solid var(--border); cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
  overflow: hidden;
}
.classroom-wall .wall-item:hover { transform: translateY(-2px); border-color: var(--muted-light); }
.classroom-wall .wall-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
}
.classroom-wall .wall-item .wall-label {
  padding: 0.35rem 0.5rem; font-size: 0.72rem;
  color: var(--muted); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.classroom-wall .wall-item .wall-label .wall-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  margin-right: 0.25em; vertical-align: middle;
}
.classroom-wall .wall-item.hero-work {
  border-color: var(--yifei); border-width: 2px;
  box-shadow: 0 0 0 3px var(--yifei-soft);
}
.classroom-wall .wall-item.hero-work::after {
  content: '羿霏'; position: absolute; top: 0.3rem; left: 0.3rem;
  font-size: 0.62rem; background: var(--yifei); color: #fff;
  padding: 0.12em 0.4em; border-radius: var(--radius-full);
}

@media (max-width: 768px) {
  .classroom-wall { padding: 0.75rem; }
  .classroom-wall .wall-item { width: 120px; }
}

/* === Lightbox === */
.lightbox { display: none; }
.lightbox.open {
  display: flex; flex-direction: column;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30,28,24,0.95);
  align-items: center; justify-content: center;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox .lightbox-img-wrap {
  max-width: 85vw; max-height: 75vh;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); overflow: hidden;
}
.lightbox .lightbox-img-wrap img {
  max-width: 100%; max-height: 75vh; object-fit: contain;
  border-radius: var(--radius-sm);
}
.lightbox .close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: rgba(255,255,255,0.08); border: none;
  color: rgba(255,255,255,0.8); font-size: 1.8rem; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s;
}
.lightbox .close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.lightbox .info-bar {
  margin-top: 1rem; color: rgba(255,255,255,0.55); font-size: 0.82rem;
  text-align: center; font-family: var(--font-display);
}
.lightbox .nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7); width: 42px; height: 42px; border-radius: 50%;
  font-size: 1.3rem; cursor: pointer; transition: all 0.25s;
  display: flex; align-items: center; justify-content: center;
}
.lightbox .nav-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.lightbox .nav-btn.prev { left: 1.25rem; }
.lightbox .nav-btn.next { right: 1.25rem; }

/* === Timeline Page === */
.timeline-page { max-width: 800px; margin: 0 auto; padding: 5rem 1.5rem 3rem; }
.timeline-page .dot-row { justify-content: center; margin-bottom: 1.5rem; }
.timeline-page h1 { text-align: center; margin-bottom: 2.5rem; font-family: var(--font-display); }

.timeline-era { margin-bottom: 2.5rem; }
.timeline-era .era-header {
  display: flex; align-items: baseline; gap: 0.75rem;
  margin-bottom: 0.75rem;
  position: sticky; top: 68px; z-index: 10;
  background: linear-gradient(to bottom, var(--bg) 80%, transparent);
  padding: 0.5rem 0;
}
.timeline-era .era-years {
  font-family: var(--font-display); font-size: 1.3rem; color: var(--yifei);
}
.timeline-era .era-label {
  font-size: 0.85rem; color: var(--muted);
}
.timeline-era .era-line {
  height: 2px; background: linear-gradient(to right, var(--yifei-soft), var(--border));
  border-radius: 1px; margin-bottom: 1rem;
}

.timeline-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.5rem;
}
.timeline-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
  text-decoration: none; color: var(--ink); font-size: 0.82rem;
  transition: all 0.2s;
}
.timeline-item:hover { background: var(--bg-tint); transform: translateY(-1px); }
.timeline-item .dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.timeline-item .item-title {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.timeline-item .item-date {
  font-size: 0.73rem; color: var(--muted); flex-shrink: 0;
}

/* === Child Hero === */
.child-hero {
  text-align: center; padding: 6rem 1.5rem 3rem; max-width: 560px; margin: 0 auto;
}
.child-hero .dot-row { margin-bottom: 1.5rem; }
.child-hero .child-initial {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; font-family: var(--font-display);
  font-size: 1.5rem; color: #fff;
}
.child-hero.yifei .child-initial { background: var(--yifei); }
.child-hero.yicheng .child-initial { background: var(--yicheng); }
.child-hero h1 { margin-bottom: 0.2rem; }
.child-hero .hero-desc { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.8; }
.child-hero .hero-tags { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.child-hero .hero-tag {
  font-size: 0.74rem; padding: 0.2em 0.7em; border-radius: var(--radius-full);
  border: 1px solid;
}
.child-hero.yifei .hero-tag { border-color: var(--yifei-soft); color: var(--yifei); background: var(--yifei-bg); }
.child-hero.yicheng .hero-tag { border-color: var(--yicheng-soft); color: var(--yicheng); background: var(--yicheng-bg); }

/* === Filters === */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem;
  max-width: 1200px; margin-left: auto; margin-right: auto; padding: 0 1.5rem;
}
.filter-btn {
  font-family: var(--font-body); font-size: 0.78rem;
  padding: 0.4em 1em; border: 1px solid var(--border);
  background: var(--card); cursor: pointer; color: var(--muted);
  border-radius: var(--radius-full); transition: all 0.25s;
}
.filter-btn:hover { border-color: var(--muted); color: var(--ink); }
.filter-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* === Footer === */
footer {
  text-align: center; padding: 3rem 1.5rem 2.5rem;
  color: var(--muted-light); font-size: 0.8rem;
  font-family: var(--font-display);
}
footer::before {
  content: '· · ·'; display: block; margin-bottom: 1.25rem;
  font-size: 1rem; color: var(--muted-light); letter-spacing: 0.5em;
}

/* === Mobile === */
@media (max-width: 768px) {
  .nav-inner { padding: 0 1rem; }
  .mobile-menu-btn { display: block; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 1rem; gap: 0.6rem;
  }
  .hero { padding: 5rem 1rem 2.5rem; }
  .child-cards { grid-template-columns: 1fr; padding: 0 1rem; }
  .section { padding: 2rem 1rem; }
  .lightbox .nav-btn { display: none; }
}
