/**
 * 2026新年祝福网站 - 主样式（全面兼容移动端）
 */
:root {
  --bg-primary: #0f0c14;
  --bg-secondary: #1a1520;
  --bg-tertiary: #12101a;
  --color-rose: #E8B4B8;
  --color-rose-deep: #C27C7E;
  --color-gold: #D4AF6A;
  --color-gold-light: #E8D5A3;
  --color-white: #FEFEFE;
  --color-white-72: rgba(255,255,255,0.72);
  --color-white-45: rgba(255,255,255,0.45);
  --glass-light: rgba(255,255,255,0.08);
  --glass-dark: rgba(0,0,0,0.35);
  --border-glass: rgba(255,255,255,0.10);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 100px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-stack: "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","WenQuanYi Micro Hei",system-ui,-apple-system,sans-serif;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font-stack);
  background: var(--bg-primary);
  background: linear-gradient(160deg, var(--bg-primary), var(--bg-secondary), var(--bg-tertiary));
  color: var(--color-white);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

/* ===== 欢迎屏 ===== */
.welcome-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  background: var(--bg-primary);
  background: linear-gradient(160deg, var(--bg-primary), var(--bg-secondary), var(--bg-tertiary));
  -webkit-transition: opacity 0.8s ease, visibility 0.8s; transition: opacity 0.8s ease, visibility 0.8s;
}
.welcome-screen.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.welcome-content {
  text-align: center; padding: 24px;
  -webkit-animation: fadeInUp 1s ease both; animation: fadeInUp 1s ease both;
}
.lantern-icon {
  font-size: 3rem;
  -webkit-animation: swing 3s ease-in-out infinite; animation: swing 3s ease-in-out infinite;
  -webkit-filter: drop-shadow(0 0 20px rgba(212,175,106,0.4)); filter: drop-shadow(0 0 20px rgba(212,175,106,0.4));
}
.welcome-year {
  font-size: 4.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light), var(--color-rose));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: 0.15em; line-height: 1.1; margin: 12px 0;
}
.welcome-subtitle { font-size: 1.6rem; font-weight: 700; color: var(--color-gold); letter-spacing: 0.35em; margin-bottom: 16px; }
.welcome-text { font-size: 0.95rem; color: var(--color-white-72); line-height: 1.8; letter-spacing: 0.06em; margin-bottom: 20px; }
.welcome-signature { font-size: 0.85rem; color: var(--color-gold); letter-spacing: 0.1em; margin-bottom: 32px; font-weight: 600; }
.btn-start {
  position: relative; display: -webkit-inline-flex; display: inline-flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  padding: 14px 48px;
  border: 1.5px solid var(--color-gold); border-radius: var(--radius-pill);
  background: rgba(212,175,106,0.12); color: var(--color-gold-light);
  font-size: 1.05rem; font-weight: 700; font-family: var(--font-stack);
  letter-spacing: 0.2em; cursor: pointer; overflow: hidden;
  -webkit-transition: all 0.4s ease; transition: all 0.4s ease;
  -webkit-appearance: none; appearance: none;
}
.btn-start:active { -webkit-transform: scale(0.96); transform: scale(0.96); }
.btn-glow {
  position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-gold), var(--color-rose), var(--color-gold));
  opacity: 0; -webkit-filter: blur(12px); filter: blur(12px);
  -webkit-transition: opacity 0.4s; transition: opacity 0.4s; z-index: -1;
}
.btn-start:hover .btn-glow, .btn-start:focus .btn-glow { opacity: 0.35; }
.btn-start.ready {
  -webkit-animation: breathGlow 3.5s ease-in-out infinite; animation: breathGlow 3.5s ease-in-out infinite;
  border-color: var(--color-gold-light);
}
.horse-icon {
  font-size: 2.2rem; margin-top: 20px;
  -webkit-animation: float 4s ease-in-out infinite; animation: float 4s ease-in-out infinite;
}

/* ===== 主屏幕 ===== */
.main-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1;
  background: var(--bg-primary); overflow: hidden;
}
.main-screen.hidden { display: none; }

/* ===== 视频层 - 强制底层 ===== */
.video-layer {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1;
  background: #0a0a0f; overflow: hidden;
  -webkit-transform: translateZ(0); transform: translateZ(0);
}
.video-layer video {
  display: block; width: 100%; height: 100%;
  -o-object-fit: contain; object-fit: contain;
  background: #0a0a0f;
  -webkit-transform: translateZ(0); transform: translateZ(0);
  position: relative; z-index: 1;
  max-width: 100%; max-height: 100%;
}

/* ===== 遮罩层 ===== */
.gradient-overlay-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%; z-index: 2;
  background: -webkit-linear-gradient(top, rgba(15,12,20,0) 0%, rgba(15,12,20,0.15) 35%, rgba(15,12,20,0.55) 65%, rgba(15,12,20,0.92) 100%);
  background: linear-gradient(to bottom, rgba(15,12,20,0) 0%, rgba(15,12,20,0.15) 35%, rgba(15,12,20,0.55) 65%, rgba(15,12,20,0.92) 100%);
  pointer-events: none;
}
.gradient-overlay-top {
  position: absolute; left: 0; right: 0; top: 0; height: 18%; z-index: 2;
  background: -webkit-linear-gradient(bottom, rgba(15,12,20,0) 0%, rgba(15,12,20,0.6) 100%);
  background: linear-gradient(to top, rgba(15,12,20,0) 0%, rgba(15,12,20,0.6) 100%);
  pointer-events: none;
}

/* ===== 环境光（简化，避免 mix-blend-mode 兼容问题）===== */
.ambient-light {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  -webkit-filter: blur(80px); filter: blur(80px);
  opacity: 0.12; pointer-events: none; z-index: 3;
}
.light-gold {
  background: var(--color-gold); top: 10%; left: -10%;
  -webkit-animation: driftGold 12s ease-in-out infinite alternate; animation: driftGold 12s ease-in-out infinite alternate;
}
.light-rose {
  background: var(--color-rose); bottom: 15%; right: -10%;
  -webkit-animation: driftRose 14s ease-in-out infinite alternate; animation: driftRose 14s ease-in-out infinite alternate;
}

/* ===== 烟花 Canvas ===== */
.fireworks-layer {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 10;
  pointer-events: none;
}

/* ===== 左上角信息卡 ===== */
.corner-card {
  position: absolute; top: 16px; left: 12px; z-index: 15;
  padding: 12px 16px;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass); border-radius: var(--radius-md);
  max-width: 280px;
  opacity: 0; -webkit-transform: translateY(-10px); transform: translateY(-10px);
  -webkit-animation: fadeSlideIn 0.8s ease 0.5s forwards; animation: fadeSlideIn 0.8s ease 0.5s forwards;
}
.corner-identity { font-size: 0.85rem; color: var(--color-gold); font-weight: 600; letter-spacing: 0.06em; margin-bottom: 5px; }
.corner-main { font-size: 1rem; font-weight: 700; color: var(--color-white); letter-spacing: 0.04em; line-height: 1.4; }
.corner-sub { font-size: 0.78rem; color: var(--color-rose); font-weight: 600; letter-spacing: 0.08em; margin-top: 4px; }

/* ===== 装饰标签 ===== */
.decor-tags {
  position: absolute; bottom: 280px; left: 50%;
  -webkit-transform: translateX(-50%); transform: translateX(-50%);
  z-index: 6; display: -webkit-flex; display: flex; gap: 10px;
  pointer-events: none;
}
.decor-tag {
  padding: 4px 16px;
  background: rgba(212,175,106,0.12); border: 1px solid rgba(212,175,106,0.25);
  border-radius: var(--radius-pill); color: var(--color-gold-light);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em;
  opacity: 0; -webkit-transform: translateY(8px); transform: translateY(8px);
  -webkit-transition: opacity 0.5s ease, -webkit-transform 0.5s ease;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.decor-tag.active { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); }

/* ===== 祝福卡片容器 ===== */
.blessing-container {
  position: absolute; left: 10px; right: 10px; bottom: 40px; z-index: 12;
  max-height: 260px; padding: 10px;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass); border-radius: var(--radius-lg);
  opacity: 0; -webkit-transform: translateY(20px); transform: translateY(20px);
  -webkit-transition: opacity 0.6s ease, -webkit-transform 0.6s ease;
  transition: opacity 0.6s ease, transform 0.6s ease;
  padding-bottom: 10px;
  padding-bottom: calc(10px + constant(safe-area-inset-bottom));
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.blessing-container.visible {
  opacity: 1; -webkit-transform: translateY(0); transform: translateY(0);
}
.blessing-section {
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  gap: 5px;
}
.teacher-section {
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-glass);
}
.blessing-card {
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  gap: 8px; padding: 6px 12px;
  background: rgba(255,255,255,0.04); border-radius: var(--radius-sm);
  -webkit-transition: -webkit-transform 0.35s ease, opacity 0.28s ease;
  transition: transform 0.35s ease, opacity 0.28s ease;
  min-height: 34px;
}
.blessing-card.exiting {
  -webkit-transform: translateY(-10px); transform: translateY(-10px);
  opacity: 0;
  -webkit-transition: -webkit-transform 0.15s ease-in, opacity 0.15s ease-in;
  transition: transform 0.15s ease-in, opacity 0.15s ease-in;
}
.blessing-card.entering {
  -webkit-transform: translateY(16px); transform: translateY(16px);
  opacity: 0;
}
.badge {
  -webkit-flex-shrink: 0; flex-shrink: 0;
  display: -webkit-inline-flex; display: inline-flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--radius-pill);
  font-size: 0.7rem; font-weight: 700;
}
.badge-teacher { background: rgba(212,175,106,0.2); color: var(--color-gold); border: 1px solid rgba(212,175,106,0.3); }
.badge-friend { background: rgba(232,180,184,0.2); color: var(--color-rose); border: 1px solid rgba(232,180,184,0.3); }
.card-text {
  font-size: 0.88rem; font-weight: 500; color: var(--color-white-72);
  letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-text .highlight-name { color: var(--color-gold); font-weight: 700; }

/* ===== 音乐按钮 ===== */
.btn-music {
  position: absolute; top: 16px; right: 12px; z-index: 20;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  cursor: pointer;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  -webkit-transition: opacity 0.3s; transition: opacity 0.3s;
  -webkit-appearance: none; appearance: none;
  padding: 0;
}
.btn-music:not(.playing) { opacity: 0.5; }
.music-bars {
  display: -webkit-flex; display: flex;
  -webkit-align-items: flex-end; align-items: flex-end;
  gap: 2.5px; height: 16px;
}
.music-bars span {
  display: block; width: 3px; background: var(--color-gold-light);
  border-radius: 1.5px; height: 4px;
  -webkit-transition: height 0.2s; transition: height 0.2s;
}
.btn-music.playing .music-bars span:nth-child(1) { -webkit-animation: barJump 0.8s ease-in-out infinite 0s; animation: barJump 0.8s ease-in-out infinite 0s; }
.btn-music.playing .music-bars span:nth-child(2) { -webkit-animation: barJump 0.8s ease-in-out infinite 0.15s; animation: barJump 0.8s ease-in-out infinite 0.15s; }
.btn-music.playing .music-bars span:nth-child(3) { -webkit-animation: barJump 0.8s ease-in-out infinite 0.3s; animation: barJump 0.8s ease-in-out infinite 0.3s; }
.btn-music.playing .music-bars span:nth-child(4) { -webkit-animation: barJump 0.8s ease-in-out infinite 0.45s; animation: barJump 0.8s ease-in-out infinite 0.45s; }
.btn-music:not(.playing) .music-bars span { height: 4px !important; -webkit-animation: none; animation: none; }

/* ===== 动画关键帧（全部带 -webkit- 前缀）===== */
@-webkit-keyframes fadeInUp { from { opacity: 0; -webkit-transform: translateY(24px); } to { opacity: 1; -webkit-transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@-webkit-keyframes fadeSlideIn { from { opacity: 0; -webkit-transform: translateY(-10px); } to { opacity: 1; -webkit-transform: translateY(0); } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@-webkit-keyframes swing { 0%, 100% { -webkit-transform: rotate(-6deg); } 50% { -webkit-transform: rotate(6deg); } }
@keyframes swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@-webkit-keyframes float { 0%, 100% { -webkit-transform: translateY(0); } 50% { -webkit-transform: translateY(-12px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@-webkit-keyframes breathGlow { 0%, 100% { box-shadow: 0 0 20px rgba(212,175,106,0.15), 0 0 40px rgba(212,175,106,0.08); } 50% { box-shadow: 0 0 30px rgba(212,175,106,0.3), 0 0 60px rgba(212,175,106,0.15); } }
@keyframes breathGlow { 0%, 100% { box-shadow: 0 0 20px rgba(212,175,106,0.15), 0 0 40px rgba(212,175,106,0.08); } 50% { box-shadow: 0 0 30px rgba(212,175,106,0.3), 0 0 60px rgba(212,175,106,0.15); } }
@-webkit-keyframes barJump { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@keyframes barJump { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@-webkit-keyframes driftGold { from { -webkit-transform: translate(0,0) scale(1); } to { -webkit-transform: translate(60px,40px) scale(1.15); } }
@keyframes driftGold { from { transform: translate(0,0) scale(1); } to { transform: translate(60px,40px) scale(1.15); } }
@-webkit-keyframes driftRose { from { -webkit-transform: translate(0,0) scale(1); } to { -webkit-transform: translate(-50px,-30px) scale(1.1); } }
@keyframes driftRose { from { transform: translate(0,0) scale(1); } to { transform: translate(-50px,-30px) scale(1.1); } }

/* ===== 响应式（移动端优先）===== */
@media screen and (max-width: 360px) {
  .welcome-year { font-size: 3.5rem; }
  .welcome-subtitle { font-size: 1.2rem; }
  .corner-card { max-width: 200px; padding: 8px 10px; }
  .corner-identity { font-size: 0.75rem; }
  .corner-main { font-size: 0.85rem; }
  .blessing-container { bottom: 24px; max-height: 220px; }
  .card-text { font-size: 0.8rem; }
}
@media screen and (min-width: 481px) and (max-width: 768px) {
  .blessing-container { left: 15%; right: 15%; }
}
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .blessing-container { left: 20%; right: 20%; }
}
@media screen and (min-width: 1025px) {
  .blessing-container {
    left: 50%; right: auto; width: 480px;
    -webkit-transform: translateX(-50%) translateY(20px); transform: translateX(-50%) translateY(20px);
  }
  .blessing-container.visible {
    -webkit-transform: translateX(-50%) translateY(0); transform: translateX(-50%) translateY(0);
  }
  .video-layer video { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    -webkit-animation-duration: 0.01ms !important; animation-duration: 0.01ms !important;
    -webkit-animation-iteration-count: 1 !important; animation-iteration-count: 1 !important;
    -webkit-transition-duration: 0.01ms !important; transition-duration: 0.01ms !important;
  }
}
