/* ===========================================================
   圣诞装饰（所有页面共用）
   彩灯串 / 冬青 / 火漆 / 糖果条纹 / 月亮 / 雪地 / 礼物
   =========================================================== */

:root {
  --xmas-gold: #f6d391;
  --xmas-gold-2: #ffeec4;
  --xmas-red: #c33a2f;
  --xmas-red-2: #e2634f;
  --xmas-green: #2b6b4a;
  --xmas-cream: #fdf6e6;
}

/* ---------- 彩灯串 ---------- */
.garland {
  position: relative;
  height: 46px;
  margin: -8px -6px 2px;
  pointer-events: none;
  transform-origin: 50% 0;
  animation: garland-sway 9s ease-in-out infinite alternate;
}

.garland::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 30px;
  border-bottom: 1.4px solid rgba(246, 211, 145, 0.32);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.garland i {
  position: absolute;
  width: 8px;
  height: 11px;
  margin-left: -4px;
  border-radius: 50% 50% 46% 46%;
  background: currentColor;
  box-shadow: 0 0 8px 1px currentColor, 0 0 18px 3px currentColor;
  animation: garland-bulb 3.6s ease-in-out infinite;
}

.garland i:nth-child(1)  { left: 3%;  top: 10px; color: #ffd98a; animation-delay: 0s; }
.garland i:nth-child(2)  { left: 11%; top: 19px; color: #ff7a63; animation-delay: 0.5s; }
.garland i:nth-child(3)  { left: 20%; top: 24px; color: #7ef0b8; animation-delay: 1.1s; }
.garland i:nth-child(4)  { left: 30%; top: 27px; color: #8fb4ff; animation-delay: 0.2s; }
.garland i:nth-child(5)  { left: 40%; top: 29px; color: #ffd98a; animation-delay: 0.8s; }
.garland i:nth-child(6)  { left: 50%; top: 30px; color: #ff9bd0; animation-delay: 1.4s; }
.garland i:nth-child(7)  { left: 60%; top: 29px; color: #7ef0b8; animation-delay: 0.35s; }
.garland i:nth-child(8)  { left: 70%; top: 27px; color: #ff7a63; animation-delay: 1s; }
.garland i:nth-child(9)  { left: 80%; top: 24px; color: #ffd98a; animation-delay: 0.65s; }
.garland i:nth-child(10) { left: 89%; top: 19px; color: #8fb4ff; animation-delay: 1.25s; }
.garland i:nth-child(11) { left: 97%; top: 10px; color: #ff7a63; animation-delay: 0.9s; }

@keyframes garland-sway {
  from { transform: rotate(-0.35deg); }
  to   { transform: rotate(0.35deg); }
}

@keyframes garland-bulb {
  0%, 100% { opacity: 0.5; transform: scale(0.92); }
  50%      { opacity: 1; transform: scale(1.08); }
}

/* ---------- 顶部彩灯（后台用） ---------- */
.lights {
  position: fixed;
  inset: 0 0 auto;
  height: 20px;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10px 9px, #ffd98a 0 2.3px, transparent 3px),
    radial-gradient(circle at 10px 9px, #ff7a63 0 2.3px, transparent 3px),
    radial-gradient(circle at 10px 9px, #7ef0b8 0 2.3px, transparent 3px),
    radial-gradient(circle at 10px 9px, #8fb4ff 0 2.3px, transparent 3px),
    linear-gradient(180deg, rgba(246, 211, 145, 0.22), rgba(246, 211, 145, 0));
  background-size: 96px 100%, 96px 100%, 96px 100%, 96px 100%, 100% 1px;
  background-position: 0 0, 24px 0, 48px 0, 72px 0, 0 4px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 6px rgba(255, 214, 140, 0.45));
  animation: lights-glow 5s ease-in-out infinite;
}

@keyframes lights-glow {
  0%, 100% { opacity: 0.68; }
  50%      { opacity: 1; }
}

/* ---------- 冬青 ---------- */
.holly {
  display: inline-block;
  width: 38px;
  height: auto;
  vertical-align: -0.12em;
  flex: 0 0 auto;
}

.holly-div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 320px;
  margin: 6px auto 22px;
}

.holly-div .holly { width: 54px; }

.holly-div span {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 211, 145, 0.48), transparent);
}

/* ---------- 糖果条纹边 ---------- */
.xmas-stripe::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: repeating-linear-gradient(115deg, #c33a2f 0 7px, #fdf6e6 7px 14px);
  opacity: 0.82;
  pointer-events: none;
  z-index: 1;
}

/* ---------- 火漆印章 ---------- */
.wax-seal {
  position: absolute;
  right: 20px;
  bottom: -18px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 47% 53% 51% 49% / 52% 48% 54% 46%;
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 23px;
  font-weight: 600;
  color: rgba(255, 232, 205, 0.72);
  text-shadow: 0 1px 0 rgba(80, 10, 8, 0.6);
  background: radial-gradient(circle at 34% 28%, #e8776a 0%, #c33a2f 42%, #8e211c 78%, #6d1613 100%);
  box-shadow:
    0 12px 20px -12px rgba(80, 15, 12, 0.9),
    0 0 0 1px rgba(255, 210, 180, 0.16) inset,
    0 -4px 10px rgba(0, 0, 0, 0.22) inset;
  transform: rotate(-8deg);
  pointer-events: none;
}

.wax-seal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 224, 190, 0.32);
}

/* ---------- 月亮 ---------- */
.moon {
  position: fixed;
  top: 3.5%;
  right: 7%;
  width: 78px;
  height: 78px;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 36% 32%, #fffdf4 0%, #ffeecb 46%, #f2cc8c 100%);
  box-shadow:
    0 0 54px 4px rgba(255, 228, 170, 0.24),
    0 0 140px 40px rgba(255, 214, 140, 0.1);
}

.moon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 30%, rgba(210, 172, 114, 0.26) 0 7%, transparent 7.6%),
    radial-gradient(circle at 38% 64%, rgba(210, 172, 114, 0.2) 0 9%, transparent 9.6%),
    radial-gradient(circle at 70% 68%, rgba(210, 172, 114, 0.18) 0 5%, transparent 5.6%);
}

/* ---------- 雪地 ---------- */
.snow-bank {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -34px;
  height: 118px;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(52% 100% at 12% 100%, #aac7e7 0 56%, transparent 74%),
    radial-gradient(42% 100% at 37% 100%, #91b0d4 0 58%, transparent 76%),
    radial-gradient(46% 100% at 67% 100%, #b6d0ee 0 56%, transparent 74%),
    radial-gradient(38% 100% at 94% 100%, #9cb9da 0 58%, transparent 76%);
  filter: blur(5px);
}

/* ---------- 远处小屋 ---------- */
.village {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(26px, 8vw, 70px);
  opacity: 0.9;
  pointer-events: none;
}

.village i {
  position: relative;
  width: 42px;
  height: 30px;
  border-radius: 2px;
  background: linear-gradient(180deg, #0d2033, #07131f);
}

.village i::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: 100%;
  height: 21px;
  background: linear-gradient(180deg, #16324a, #0c1c2e);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.village i::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 10px;
  height: 6px;
  background-image: radial-gradient(circle, #ffd98a 0 1.5px, transparent 2px);
  background-size: 9px 6px;
  opacity: 0.85;
}

.village i:nth-child(2) { width: 30px; height: 24px; }
.village i:nth-child(3) { width: 54px; height: 36px; }
.village i:nth-child(4) { width: 34px; height: 26px; }

/* ---------- 礼物盒 ---------- */
.gifts {
  position: absolute;
  right: 6%;
  bottom: 26px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}

.gifts i {
  position: relative;
  width: calc(26px * var(--s, 1));
  height: calc(20px * var(--s, 1));
  border-radius: 3px;
  background: linear-gradient(180deg, #1d5a40, #103526);
  box-shadow: 0 10px 18px -12px #000, 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.gifts i:nth-child(2) { background: linear-gradient(180deg, #a6342b, #6f1d18); }
.gifts i:nth-child(3) { background: linear-gradient(180deg, #2a4a7a, #16294a); }

.gifts i::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 5px;
  margin-left: -2.5px;
  background: linear-gradient(180deg, #f4d193, #c99a52);
  opacity: 0.9;
}

.gifts i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 20px;
  height: 10px;
  margin-left: -10px;
  background:
    radial-gradient(circle at 30% 55%, transparent 0 2.6px, #f0c987 2.7px 3.3px, transparent 3.4px),
    radial-gradient(circle at 70% 55%, transparent 0 2.6px, #f0c987 2.7px 3.3px, transparent 3.4px);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3));
  opacity: 0.95;
}

/* ---------- MERRY CHRISTMAS ---------- */
.merry {
  margin: 34px 0 7px;
  text-align: center;
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 9.5px;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  color: rgba(246, 211, 145, 0.5);
}

@media (max-width: 480px) {
  .garland { height: 42px; margin-left: -2px; margin-right: -2px; }
  .garland::before { height: 27px; }
  .garland i { width: 7px; height: 10px; margin-left: -3.5px; }
  .garland i:nth-child(1)  { top: 9px; }
  .garland i:nth-child(2)  { top: 17px; }
  .garland i:nth-child(3)  { top: 22px; }
  .garland i:nth-child(4)  { top: 24px; }
  .garland i:nth-child(5)  { top: 26px; }
  .garland i:nth-child(6)  { top: 27px; }
  .garland i:nth-child(7)  { top: 26px; }
  .garland i:nth-child(8)  { top: 24px; }
  .garland i:nth-child(9)  { top: 22px; }
  .garland i:nth-child(10) { top: 17px; }
  .garland i:nth-child(11) { top: 9px; }

  .moon { width: 62px; height: 62px; top: 3%; right: 5%; }
  .gifts { right: 4%; bottom: 20px; gap: 7px; }
  .village { bottom: 24px; gap: 30px; }
  .village i:nth-child(3) { width: 44px; height: 30px; }
}

/* ---------- 备案号 ---------- */
.beian {
  margin: 14px 0 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: rgba(233, 228, 214, 0.3);
}

.beian a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(233, 228, 214, 0.18);
}

.beian a:hover { color: rgba(246, 211, 145, 0.65); border-bottom-color: rgba(246, 211, 145, 0.4); }

@media (prefers-reduced-motion: reduce) {
  .garland, .garland i, .lights { animation: none !important; }
}

/* ---------- 冷杉（共用图形见 /scenery.js） ---------- */
.xmas-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.fir {
  position: absolute;
  bottom: 18px;
  left: var(--x);
  width: calc(var(--h) * 0.625);
  height: var(--h);
  opacity: var(--o);
  transform: translateX(-50%);
  filter: drop-shadow(0 6px 12px rgba(2, 10, 18, 0.55));
}
.fir--slim { width: calc(var(--h) * 0.588); }
