/* ============ 基础变量 ============ */
:root {
  --ink: #1d2143;
  --muted: #5e6389;
  --paper: #f8f8fc;
  --dusk: #2a3166;
  --night: #151a3d;
  --gold: #f7c95c;

  --sage: #bfe0d1;
  --rose: #f6c4cd;
  --sky: #bcd2f5;
  --lilac: #d4c8f4;
  --sun: #ffe08a;

  --display: "LXGW WenKai", "LXGW WenKai Screen", "Noto Serif SC", "Songti SC", "STSong", serif;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
.wrap { width: min(1080px, 100% - 48px); margin-inline: auto; }

:focus-visible { outline: 3px solid #6d7ee8; outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; line-height: 1.2; }
h2 { font-size: clamp(32px, 5vw, 48px); }
.lead { color: var(--muted); margin: 12px 0 0; max-width: 30em; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 16px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; }
.btn.small { padding: 8px 18px; font-size: 15px; color: var(--ink); }
.btn.solid { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ============ 导航 ============ */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(248, 248, 252, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(29, 33, 67, .08);
}
.nav-inner { display: flex; align-items: center; gap: 24px; padding: 10px 0; }
.brand { font-family: var(--display); font-size: 22px; text-decoration: none; margin-right: auto; }
.links { display: flex; gap: 22px; }
.links a { text-decoration: none; font-size: 15px; color: var(--muted); padding: 4px 0; }
.links a:hover { color: var(--ink); }
.sky-toggle {
  font: inherit; font-size: 14px; cursor: pointer;
  border: 1px solid rgba(29, 33, 67, .2); background: #fff; color: var(--ink);
  padding: 6px 14px; border-radius: 999px;
}
.sky-toggle:hover { background: #f0f1fa; }

/* ============ 首页 ============ */
.hero {
  --hero-ink: #fff;
  --sky-top: #12163a; --sky-bottom: #2e3670;
  --hwall: #4a5299; --hroof: #1e2352; --hdoor: #1e2352;
  --ground: #1f3b4d; --leaf: #2f6b6b;
  --unlit: #2a3166; --lit: #ffd36b; --glow: rgba(255, 205, 90, .8);
  --orb: #f4f1e1; --stars: 1;
  position: relative;
  overflow: hidden;
  color: var(--hero-ink);
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}
.hero[data-sky="day"] {
  --hero-ink: #1d2143;
  --sky-top: #9fc6f2; --sky-bottom: #e6f1fc;
  --hwall: #ffffff; --hroof: #7c86d6; --hdoor: #7c86d6;
  --ground: #a8d5b5; --leaf: #7cc8a0;
  --unlit: #cfe0f5; --lit: #ffeeb5; --glow: rgba(255, 210, 100, .35);
  --orb: #ffd25e; --stars: 0;
}
.hero[data-sky="dusk"] {
  --hero-ink: #fff;
  --sky-top: #5b5fb5; --sky-bottom: #f3b8c8;
  --hwall: #f6eff8; --hroof: #3b3f86; --hdoor: #3b3f86;
  --ground: #5c8c8a; --leaf: #4f9c93;
  --unlit: #9aa0d6; --lit: #ffd978; --glow: rgba(255, 205, 100, .6);
  --orb: #ffe3b0; --stars: .3;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: end;
  gap: 24px;
  padding-top: 64px;
}
.hero-text { padding-bottom: 72px; }
.hero h1 { font-size: clamp(52px, 9vw, 104px); line-height: 1.05; letter-spacing: .02em; }
.tagline { font-family: var(--display); font-size: clamp(20px, 3vw, 30px); margin: 20px 0 0; }
.intro { margin: 16px 0 0; max-width: 28em; opacity: .85; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero .btn.ghost { color: var(--hero-ink); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .14); }
.hero[data-sky="day"] .btn.ghost:hover { background: rgba(29, 33, 67, .08); }

.house { width: 100%; max-width: 520px; justify-self: end; display: block; overflow: visible; }
.house .stars { opacity: var(--stars); }
.house .orb { fill: var(--orb); filter: drop-shadow(0 0 14px var(--orb)); }
.house .leaf, .house .leaf * { fill: var(--leaf); }
.house .hwall { fill: var(--hwall); }
.house .roof, .house .roof-shape { fill: var(--hroof); }
.house .roof-shape { stroke: var(--hroof); stroke-width: 12; stroke-linejoin: round; }
.house .hdoor { fill: var(--hdoor); }
.ground { height: 56px; background: var(--ground); }

.win .pane {
  fill: var(--unlit);
  stroke: var(--hroof);
  stroke-width: 5;
  filter: drop-shadow(0 0 0 rgba(255, 205, 90, 0));
  transition: fill .9s ease, filter .9s ease;
}
.win .face { opacity: 0; transition: opacity .9s ease .2s; }
.win.lit .pane { fill: var(--lit); filter: drop-shadow(0 0 14px var(--glow)); }
.win.lit .face { opacity: 1; }

/* ============ 通用区块 ============ */
.block { padding-top: 104px; }

/* ============ 家人：每个人一扇拱门 ============ */
.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 250px));
  gap: 28px;
  margin-top: 48px;
  align-items: start;
}
.door {
  --door-bg: var(--sky);
  background: var(--door-bg);
  border-radius: 125px 125px 22px 22px;
  padding: 44px 24px 30px;
  text-align: center;
  transition: transform .25s ease;
}
.door:nth-child(even) { margin-top: 36px; }
.door:hover { transform: translateY(-6px); }
.door.c-sage { --door-bg: var(--sage); }
.door.c-rose { --door-bg: var(--rose); }
.door.c-sky { --door-bg: var(--sky); }
.door.c-lilac { --door-bg: var(--lilac); }
.door.c-sun { --door-bg: var(--sun); }
.avatar {
  position: relative;
  width: 92px; height: 92px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .62);
  font-size: 46px; line-height: 1;
  overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.door h3 { font-size: 26px; }
.door .role { margin: 2px 0 0; font-size: 14px; color: rgba(29, 33, 67, .7); }
.door .note { margin: 14px 0 0; font-size: 15px; line-height: 1.7; }

/* ============ 照片墙：一张张相纸 ============ */
.wall { columns: 3 260px; column-gap: 28px; margin-top: 48px; }
.polaroid {
  display: block; width: 100%;
  break-inside: avoid;
  margin: 0 0 32px;
  padding: 12px 12px 16px;
  background: #fff;
  border: 0; border-radius: 6px;
  box-shadow: 0 10px 30px -12px rgba(29, 33, 67, .35);
  transform: rotate(var(--r, 0deg));
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  text-align: left; font: inherit; color: inherit;
}
.polaroid:nth-child(3n+1) { --r: -1.6deg; }
.polaroid:nth-child(3n+2) { --r: 1.2deg; }
.polaroid:nth-child(3n) { --r: -.6deg; }
.polaroid:hover { transform: rotate(0) scale(1.025); box-shadow: 0 18px 40px -14px rgba(29, 33, 67, .45); }
.polaroid .cap { display: block; margin-top: 14px; font-family: var(--display); font-size: 19px; line-height: 1.4; }
.polaroid .date { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

.shot { aspect-ratio: 4 / 5; background: #e9ebf5; overflow: hidden; border-radius: 2px; }
.polaroid:nth-child(4n+2) .shot { aspect-ratio: 1; }
.polaroid:nth-child(4n+3) .shot { aspect-ratio: 4 / 3; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot.missing { display: grid; place-items: center; font-size: 64px; background: var(--tone-bg, linear-gradient(135deg, #bcd2f5, #e6eefb)); }
.shot[data-tone="sage"] { --tone-bg: linear-gradient(135deg, #bfe0d1, #e5f3ec); }
.shot[data-tone="rose"] { --tone-bg: linear-gradient(135deg, #f6c4cd, #fbe6ea); }
.shot[data-tone="sun"] { --tone-bg: linear-gradient(135deg, #ffe08a, #fff3cc); }
.shot[data-tone="lilac"] { --tone-bg: linear-gradient(135deg, #d4c8f4, #ece6fa); }
.shot[data-tone="sky"] { --tone-bg: linear-gradient(135deg, #bcd2f5, #e6eefb); }

/* ============ 时间线 ============ */
.timeline {
  --yw: 90px; --gap: 34px;
  list-style: none; margin: 48px 0 0; padding: 0; position: relative;
}
.timeline::before {
  content: ""; position: absolute; top: 12px; bottom: 12px;
  left: calc(var(--yw) + var(--gap) / 2 - 1px); width: 2px;
  background: linear-gradient(var(--gold), var(--sky));
}
.timeline li {
  position: relative;
  display: grid; grid-template-columns: var(--yw) 1fr; gap: var(--gap);
  padding-bottom: 40px;
}
.timeline li::before {
  content: ""; position: absolute; top: 9px;
  left: calc(var(--yw) + var(--gap) / 2 - 8px);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--dusk);
}
.timeline .year { font-family: var(--display); font-size: 28px; line-height: 1.3; text-align: right; }
.timeline h3 { font-size: 24px; }
.timeline p { margin: 4px 0 0; color: var(--muted); max-width: 30em; }

/* ============ 团聚倒计时 ============ */
.band {
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  padding: 56px;
  border-radius: 32px;
  color: #fff;
  background: linear-gradient(160deg, var(--night), var(--dusk));
}
.band .when { margin: 12px 0 0; opacity: .8; }
.count { display: flex; gap: 14px; }
.unit { min-width: 96px; padding: 18px 10px; text-align: center; border-radius: 18px; background: rgba(255, 255, 255, .09); }
.unit b { display: block; font-family: var(--display); font-weight: 500; font-size: 52px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--gold); }
.unit span { font-size: 14px; opacity: .75; }
.count .done { margin: 0; max-width: 18em; opacity: .85; }

/* ============ 家常菜 ============ */
.menu {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 56px;
}
.menu li { padding: 20px 0; border-bottom: 2px dotted rgba(29, 33, 67, .22); }
.menu .dish { font-family: var(--display); font-size: 26px; line-height: 1.3; }
.menu .by { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.menu .tip { margin: 8px 0 0; font-size: 15px; }

/* ============ 页脚 ============ */
.footer { margin-top: 120px; padding: 64px 0 28px; color: #fff; background: var(--night); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.foot-note { margin: 0; font-family: var(--display); font-size: 22px; max-width: 24em; line-height: 1.5; }
.copy { margin: 48px 0 0; text-align: center; font-size: 13px; opacity: .55; }

/* ============ 照片大图 ============ */
dialog#lightbox {
  border: 0; padding: 16px; border-radius: 20px; background: #fff; color: var(--ink);
  width: min(92vw, 720px);
}
dialog#lightbox::backdrop { background: rgba(21, 26, 61, .72); backdrop-filter: blur(4px); }
#lbStage .shot { aspect-ratio: auto; max-height: 68vh; border-radius: 10px; }
#lbStage .shot img { height: auto; max-height: 68vh; object-fit: contain; }
#lbStage .shot.missing { aspect-ratio: 4 / 3; max-height: none; }
.lb-cap { font-family: var(--display); font-size: 20px; margin: 14px 4px 0; }
.lb-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.lb-bar .solid { margin-left: auto; }

/* ============ 手机与小屏 ============ */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-text { padding-bottom: 8px; }
  .house { justify-self: center; max-width: 420px; }
  .band { grid-template-columns: 1fr; padding: 36px 24px; }
  .count { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-inner { flex-wrap: wrap; row-gap: 4px; }
  .links { order: 3; width: 100%; gap: 20px; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .block { padding-top: 80px; }
  .door:nth-child(even) { margin-top: 0; }
  .doors { justify-content: center; }
  .timeline { --yw: 56px; --gap: 28px; }
  .timeline .year { font-size: 20px; }
  .unit { min-width: 0; flex: 1 1 80px; }
  .unit b { font-size: 40px; }
  .wall { columns: 2 140px; column-gap: 16px; }
  .polaroid { padding: 8px 8px 12px; margin-bottom: 20px; }
  .polaroid .cap { font-size: 16px; }
  .shot.missing { font-size: 44px; }
}

/* ============ 减少动效 ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
