/* ==========================================================================
   中国奶龙大学 - Dreamy Bubble Landing Page Styles
   ========================================================================== */

:root {
  --primary-blue: #0f2942;
  --primary-blue-hover: #163a5f;
  --accent-gold: #d97706;
  --accent-gold-light: #f59e0b;
  --nailong-yellow: #ffd11b;
  --nailong-warm: #f59e0b;
  --sky-blue: rgba(186, 218, 255, 0.9);
  --cream: rgba(254, 236, 170, 0.75);
  --text-main: #0f172a;
  --text-soft: #334155;
  --text-muted: #64748b;
  --focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 0 6px rgba(245, 158, 11, 0.55);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-main);
  --timer-size: 200px;
  --mascot-size: 220px;
  --mascot-right: 24px;
  --mascot-bottom: 40px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: var(--text-main);
  background-color: #f7f4ea;
  background-image:
    radial-gradient(48% 52% at 12% 44%, var(--cream) 0%, rgba(254, 236, 170, 0) 100%),
    radial-gradient(44% 46% at 70% 94%, var(--cream) 0%, rgba(254, 236, 170, 0) 100%),
    linear-gradient(160deg, #fbf8ee 0%, #f6f4ee 50%, #f4f2ea 100%);
  position: relative;
}

/* ==========================================================================
   背景氛围：阳光、色晕、闪光、肥皂泡
   ========================================================================== */

.bg-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sun-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(380px, 44vmax, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-40%, -42%);
  background: radial-gradient(circle,
    #ffffff 0%,
    rgba(255, 255, 255, 0.96) 30%,
    rgba(255, 249, 225, 0.75) 46%,
    rgba(254, 240, 190, 0.35) 60%,
    rgba(254, 240, 190, 0) 72%);
  animation: sunBreath 9s ease-in-out infinite alternate;
}

@keyframes sunBreath {
  0% { transform: translate(-40%, -42%) scale(1); opacity: 0.92; }
  100% { transform: translate(-40%, -42%) scale(1.06); opacity: 1; }
}

/* 用渐变而非 blur 滤镜绘制色晕，漂移动画只触发合成 */
.ambient-blob {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: floatBlobs 18s ease-in-out infinite alternate;
}

.blob-1 {
  width: 72vmax;
  top: -34vmax;
  right: -30vmax;
  background: radial-gradient(circle, var(--sky-blue) 0%, rgba(186, 218, 255, 0.45) 40%, rgba(186, 218, 255, 0) 68%);
}

.blob-2 {
  width: 62vmax;
  bottom: -32vmax;
  left: -26vmax;
  background: radial-gradient(circle, var(--sky-blue) 0%, rgba(186, 218, 255, 0.4) 42%, rgba(186, 218, 255, 0) 68%);
  animation-delay: -9s;
}

@keyframes floatBlobs {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2vmax, 2vmax) scale(1.06); }
}

/* 闪光点：单个元素 + 多重 box-shadow，只做透明度动画 */
.sparkles {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
}

.sparkles-fine {
  width: 2px;
  height: 2px;
  box-shadow:
    16.6vw 30vh 1px 1px rgba(255, 255, 255, 0.95),
    22.4vw 33vh 1px 1px rgba(255, 255, 255, 0.9),
    14.7vw 56vh 1px 1px rgba(255, 255, 255, 0.9),
    12vw 68vh 1px 1px rgba(255, 255, 255, 0.95),
    13.8vw 77vh 1px 1px rgba(255, 255, 255, 0.85),
    17vw 72vh 1px 1px rgba(255, 255, 255, 0.9),
    19.4vw 63vh 1px 1px rgba(255, 255, 255, 0.85),
    23.5vw 72vh 1px 1px rgba(255, 255, 255, 0.95),
    26vw 57vh 1px 1px rgba(255, 255, 255, 0.9),
    25.5vw 47.5vh 1px 1px rgba(255, 255, 255, 0.85),
    66vw 19vh 1px 1px rgba(255, 255, 255, 0.9),
    77.7vw 23vh 1px 1px rgba(255, 255, 255, 0.95),
    82.6vw 35vh 1px 1px rgba(255, 255, 255, 0.9),
    80.5vw 39vh 1px 1px rgba(255, 255, 255, 0.85),
    75vw 49.5vh 1px 1px rgba(255, 255, 255, 0.95),
    82.5vw 56.5vh 1px 1px rgba(255, 255, 255, 0.9),
    77.7vw 59.5vh 1px 1px rgba(255, 255, 255, 0.85),
    90vw 44vh 1px 1px rgba(255, 255, 255, 0.9),
    40vw 12vh 1px 1px rgba(255, 255, 255, 0.8),
    58vw 88vh 1px 1px rgba(255, 255, 255, 0.85);
  animation: twinkle 4.5s ease-in-out infinite;
}

.sparkles-soft {
  width: 6px;
  height: 6px;
  box-shadow:
    18.3vw 30vh 6px 2px rgba(255, 255, 255, 0.95),
    21.2vw 68vh 8px 3px rgba(255, 255, 255, 0.9),
    18.9vw 85vh 7px 2px rgba(255, 255, 255, 0.85),
    21.2vw 76.6vh 5px 2px rgba(255, 255, 255, 0.9),
    83.6vw 35.4vh 8px 3px rgba(255, 255, 255, 0.95),
    83vw 48.2vh 6px 2px rgba(255, 255, 255, 0.9),
    79.6vw 38.6vh 5px 2px rgba(255, 255, 255, 0.85),
    66vw 19.5vh 5px 2px rgba(255, 255, 255, 0.8),
    11vw 64vh 6px 2px rgba(255, 255, 255, 0.85);
  animation: twinkle 6s ease-in-out infinite -3s;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 肥皂泡：高光 + 彩虹边缘 + 暖色反光 */
.bubble {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.95) 0 9%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 70% 76%, rgba(253, 230, 138, 0.55) 0 6%, rgba(253, 230, 138, 0) 22%),
    radial-gradient(circle, rgba(255, 255, 255, 0.04) 0 56%, rgba(219, 234, 254, 0.55) 76%, rgba(191, 219, 254, 0.8) 90%, rgba(255, 255, 255, 0.95) 100%);
  box-shadow: inset 0 0 calc(var(--size) * 0.12) rgba(255, 255, 255, 0.7), 0 4px 14px rgba(59, 130, 246, 0.08);
  animation: bubbleFloat var(--dur, 9s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.bubble-1 { --size: 52px; left: 18%; top: 37%; --dur: 10s; }
.bubble-2 { --size: 44px; left: 75%; top: 27%; --dur: 12s; --delay: -4s; }
.bubble-3 { --size: 30px; left: 26%; top: 64%; --dur: 8s; --delay: -2s; }
.bubble-4 { --size: 18px; left: 70%; top: 21%; --dur: 7s; --delay: -5s; }
.bubble-5 { --size: 24px; left: 88%; top: 63%; --dur: 9s; --delay: -1s; }
.bubble-6 { --size: 18px; left: 9%; top: 82%; --dur: 11s; --delay: -6s; }
.bubble-7 { --size: 14px; left: 22.5%; top: 34%; --dur: 7.5s; --delay: -3s; }

@keyframes bubbleFloat {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(6px, -14px); }
  66% { transform: translate(-5px, -6px); }
}

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ==========================================================================
   页面骨架
   ========================================================================== */

.page-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 48px;
  z-index: 10;
}

.top-nav {
  width: 100%;
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--primary-blue);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* ==========================================================================
   主视觉：标题、副标题
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  padding-bottom: 2vh;
}

.hero-title {
  font-size: clamp(2.6rem, 7.4vw, 5.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--primary-blue);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 14px 32px rgba(15, 41, 66, 0.14);
}

.hero-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: clamp(14px, 2.4vh, 24px);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

.divider {
  width: 1.5px;
  height: 1em;
  border-radius: 1px;
  background: rgba(51, 65, 85, 0.45);
}

.target-url-link {
  font-family: var(--font-display);
  color: inherit;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  border-radius: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.target-url-link:hover {
  color: var(--primary-blue);
  border-bottom-color: rgba(245, 158, 11, 0.7);
}

/* ==========================================================================
   玻璃水滴倒计时
   ========================================================================== */

.timer {
  position: relative;
  width: var(--timer-size);
  height: var(--timer-size);
  margin: clamp(26px, 6vh, 56px) 0 clamp(24px, 5vh, 46px);
}

.timer-blob {
  position: absolute;
  inset: 0;
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  background:
    radial-gradient(circle at 27% 22%, rgba(255, 255, 255, 0.95) 0 4%, rgba(255, 255, 255, 0) 13%),
    radial-gradient(circle at 70% 82%, rgba(253, 224, 71, 0.38) 0 4%, rgba(253, 224, 71, 0) 26%),
    radial-gradient(circle at 46% 42%, rgba(255, 255, 255, 0.04) 0 38%, rgba(214, 231, 255, 0.42) 62%, rgba(147, 190, 253, 0.62) 83%, rgba(219, 234, 254, 0.9) 94%, rgba(255, 255, 255, 0.95) 100%);
  box-shadow:
    inset 8px 10px 16px rgba(255, 255, 255, 0.8),
    inset -14px -18px 26px rgba(59, 130, 246, 0.26),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.6),
    0 28px 44px -16px rgba(30, 64, 175, 0.32),
    0 6px 14px rgba(59, 130, 246, 0.08);
  animation: blobWobble 9s ease-in-out infinite;
}

/* 左上角弧形反光 */
.timer-blob::after {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.85);
  border-left-color: rgba(255, 255, 255, 0.45);
  transform: rotate(-18deg);
  filter: blur(1px);
}

@keyframes blobWobble {
  0%, 100% {
    border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
    transform: rotate(0deg) scale(1);
  }
  33% {
    border-radius: 56% 44% 43% 57% / 44% 56% 45% 55%;
    transform: rotate(5deg) scale(1.02, 0.985);
  }
  66% {
    border-radius: 47% 53% 60% 40% / 57% 45% 55% 43%;
    transform: rotate(-4deg) scale(0.985, 1.02);
  }
}

.timer-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 2.5;
}

.circle-bar {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke-dashoffset 0.1s linear;
}

.timer-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 6px;
}

.timer-number {
  font-family: var(--font-display);
  font-size: calc(var(--timer-size) * 0.46);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 35%, #fff4cc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter:
    drop-shadow(0 0 1px rgba(217, 119, 6, 0.9))
    drop-shadow(0 0 7px rgba(251, 191, 36, 0.85))
    drop-shadow(0 3px 6px rgba(180, 83, 9, 0.2));
}

.timer-unit {
  font-family: var(--font-display);
  font-size: calc(var(--timer-size) * 0.075);
  font-weight: 500;
  color: var(--primary-blue);
  letter-spacing: 0.08em;
  margin-top: 6px;
}

/* 水滴旁的小气泡 */
.timer-satellite {
  position: absolute;
  right: -2%;
  bottom: 2%;
  width: calc(var(--timer-size) * 0.12);
  height: calc(var(--timer-size) * 0.12);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 12%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 0 52%, rgba(191, 219, 254, 0.75) 86%, rgba(255, 255, 255, 0.95) 100%);
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.12);
  animation: bubbleFloat 6s ease-in-out infinite -2s;
}

/* 暂停：水滴静止；传送：水滴膨胀破裂 */
.timer.is-paused .timer-blob,
.timer.is-frozen .timer-blob,
.timer.is-frozen .timer-satellite {
  animation-play-state: paused;
}

/* 时间流速（奶龙被拎着时为 0，飞行时随速度变慢）：圆环与数字褪成冰蓝色并结霜 */
@property --time-rate {
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}

.timer {
  transition: --time-rate 0.25s ease;
}

.timer-svg,
.timer-inner {
  filter: saturate(calc(0.35 + var(--time-rate, 1) * 0.65)) hue-rotate(calc((1 - var(--time-rate, 1)) * 165deg));
}

.timer::after {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 22px 4px rgba(147, 197, 253, 0.7),
    inset 0 0 18px 2px rgba(191, 219, 254, 0.75);
  opacity: calc(1 - var(--time-rate, 1));
}

.timer.is-launching {
  animation: bubblePop 0.4s ease-in forwards;
}

@keyframes bubblePop {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(1.16); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ==========================================================================
   胶囊按钮
   ========================================================================== */

.action-group {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  padding: 0 34px;
  font-family: var(--font-main);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible,
.target-url-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-arrow {
  font-family: var(--font-display);
  font-weight: 500;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(180deg, #2b4b70 0%, #13304f 46%, #0a2038 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 16px 30px -12px rgba(15, 41, 66, 0.6),
    0 4px 10px rgba(15, 41, 66, 0.12);
}

.btn-primary:hover {
  filter: brightness(1.12);
}

.btn-secondary {
  color: var(--primary-blue);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 247, 220, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 1px 0 #ffffff,
    inset 0 -4px 10px rgba(251, 191, 36, 0.16),
    0 16px 30px -14px rgba(180, 120, 20, 0.4),
    0 3px 10px rgba(217, 119, 6, 0.08);
}

.btn-secondary:hover {
  filter: brightness(1.02) saturate(1.1);
}

.btn-secondary.is-paused {
  background: linear-gradient(180deg, #fffdf2 0%, #fdeeb6 100%);
}

/* 首次访问：拖住奶龙就能暂停，暂停按钮让出位置，只在键盘聚焦时出现 */
html:not([data-visit="returning"]) #pauseBtn:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   奶龙角色、底座与气泡
   ========================================================================== */

.mascot-container {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: var(--mascot-size);
  height: var(--mascot-size);
  touch-action: none;
  cursor: grab;
  transform-origin: center center;
  will-change: transform;
}

.mascot-container.is-dragging {
  cursor: grabbing !important;
}

.mascot-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(146, 64, 14, 0.16));
  user-drag: none;
  -webkit-user-drag: none;
  transform-origin: center 90%;
}

/* Every pose loads once; changing state never starts an image request. */
.mascot-sprite--dragging,
.mascot-sprite--cranking,
.mascot-sprite--goodbye,
.mascot-sprite--dizzy {
  opacity: 0;
}

.mascot-container:not([data-pose="sitting"]) .mascot-sprite--sitting {
  opacity: 0;
}

.mascot-container[data-pose="dragging"] .mascot-sprite--dragging,
.mascot-container[data-pose="cranking"] .mascot-sprite--cranking,
.mascot-container[data-pose="goodbye"] .mascot-sprite--goodbye,
.mascot-container[data-pose="dizzy"] .mascot-sprite--dizzy {
  opacity: 1;
}

/* The goodbye pose sways gently from the seat as he waves. */
.mascot-container[data-pose="goodbye"] .mascot-sprite--goodbye {
  animation: goodbyeSway 0.9s ease-in-out infinite;
}

/* Dizzy: a wobble from the seat plus two stars circling his head. */
.mascot-container[data-pose="dizzy"] .mascot-sprite--dizzy {
  animation: dizzyWobble 1.1s ease-in-out infinite;
}

.mascot-container[data-pose="dizzy"]::before,
.mascot-container[data-pose="dizzy"]::after {
  content: '💫';
  position: absolute;
  top: 12%;
  left: 52%;
  z-index: 1;
  font-size: calc(var(--mascot-size) * 0.11);
  line-height: 1;
  pointer-events: none;
  animation: dizzyOrbit 1.2s linear infinite;
}

.mascot-container[data-pose="dizzy"]::after {
  content: '⭐';
  animation-delay: -0.6s;
}

@keyframes goodbyeSway {
  0%, 100% { rotate: -2deg; }
  50% { rotate: 2deg; }
}

@keyframes dizzyWobble {
  0%, 100% { rotate: -5deg; }
  50% { rotate: 5deg; }
}

/* Scaling the circle flat (and back for the glyph) turns it into an ellipse. */
@keyframes dizzyOrbit {
  from {
    transform: translate(-50%, -50%) scaleY(0.35) rotate(0deg)
      translateX(calc(var(--mascot-size) * 0.24)) rotate(0deg) scaleY(2.857);
  }
  to {
    transform: translate(-50%, -50%) scaleY(0.35) rotate(360deg)
      translateX(calc(var(--mascot-size) * 0.24)) rotate(-360deg) scaleY(2.857);
  }
}

/* 奶油色圆形底座 */
.mascot-pedestal {
  position: fixed;
  right: calc(var(--mascot-right) + var(--mascot-size) * 0.06);
  bottom: var(--mascot-bottom);
  width: calc(var(--mascot-size) * 0.88);
  height: calc(var(--mascot-size) * 0.17);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 251, 238, 0.92) 48%,
    rgba(250, 236, 196, 0.6) 78%,
    rgba(250, 236, 196, 0) 100%);
  box-shadow: 0 12px 22px -12px rgba(146, 64, 14, 0.28);
  pointer-events: none;
  z-index: 999;
}

.speech-bubble {
  position: absolute;
  top: -58px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 14px 30px -10px rgba(15, 41, 66, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.95),
    inset 0 -3px 8px rgba(251, 191, 36, 0.14);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  z-index: 60;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 6px 0 6px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.94) transparent transparent transparent;
}

.speech-bubble.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* ==========================================================================
   跳转转场：页面褪成灰色剪影，从奶龙所在的右下角撕下（背面是奶龙黄），
   露出东华官网骨架；浏览器在骨架后面加载真实页面
   ========================================================================== */

body > :not(.handoff) {
  transition: filter 0.45s ease;
}

body.is-handing-off > :not(.handoff) {
  filter: grayscale(1);
}

.handoff {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

/* 转场期间拦下所有点击，页面已不可操作 */
.handoff.is-active {
  visibility: visible;
  pointer-events: auto;
}

.dhu-skeleton,
.handoff-shade,
.handoff-sheet,
.handoff-flap-shadow,
.handoff-flap {
  position: absolute;
  inset: 0;
}

/* 剪影纸：与页面背景同样的柔光渐变，只是褪去了颜色 */
.handoff-sheet {
  background:
    radial-gradient(48% 52% at 12% 44%, #ececec 0%, rgba(236, 236, 236, 0) 100%),
    radial-gradient(44% 46% at 70% 94%, #ececec 0%, rgba(236, 236, 236, 0) 100%),
    radial-gradient(circle at 0 0, #ffffff 0%, rgba(255, 255, 255, 0) 36vmax),
    #f3f3f3;
  opacity: 0;
  transition: opacity 0.3s ease 0.2s;
}

.handoff.is-active .handoff-sheet {
  opacity: 1;
}

.handoff.is-revealed .handoff-sheet {
  opacity: 0;
  transition-delay: 0s;
}

.silhouette {
  position: absolute;
  border-radius: 999px;
}

.silhouette--title { background: #d0d0d0; }
.silhouette--line { background: #dcdcdc; }
.silhouette--strong { background: #bdbdbd; }
.silhouette--soft { background: #e5e5e5; }

.silhouette-mascot {
  position: absolute;
  top: 0;
  left: 0;
}

.silhouette-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center 90%;
  filter: brightness(0) invert(0.8);
}

.silhouette--bubble {
  top: -58px;
  left: 50%;
  transform: translateX(-50%);
  background: #e8e8e8;
}

/* 撕页：卷起的纸背与它投在骨架上的阴影，形状由 handoff.js 逐帧计算 */
.handoff-shade,
.handoff-flap-shadow {
  visibility: hidden;
}

.handoff.is-peeling .handoff-shade,
.handoff.is-peeling .handoff-flap-shadow {
  visibility: visible;
}

.handoff.is-revealed .handoff-shade,
.handoff.is-revealed .handoff-flap-shadow {
  visibility: hidden;
}

.handoff-flap-shadow {
  filter: drop-shadow(0 10px 18px rgba(120, 72, 0, 0.3));
}

/* 东华官网骨架：版心 1200 / 1400 / 1600px，断点与官网一致；
   窄屏时与官网一样靠左排版、右侧溢出 */
.dhu-skeleton {
  overflow: hidden;
  background: #ffffff;
  visibility: hidden;
  --dhu-logo-gap: 240px;
}

.handoff.is-peeling .dhu-skeleton {
  visibility: visible;
}

.dhu-frame {
  width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1501px) {
  .dhu-frame { width: 1400px; }
  .dhu-skeleton { --dhu-logo-gap: 310px; }
}

@media (min-width: 1701px) {
  .dhu-frame { width: 1600px; }
  .dhu-skeleton { --dhu-logo-gap: 380px; }
}

.dhu-header {
  height: 95px;
  background: linear-gradient(to right, #911724 0%, #c82e31 50%, #911724 100%);
}

.dhu-header-inner {
  display: grid;
  grid-template-columns: 1fr var(--dhu-logo-gap) 1fr;
  height: 100%;
}

.dhu-nav {
  display: grid;
  grid-template-rows: 48px 1fr;
}

.dhu-nav-main,
.dhu-nav-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px 0 20px;
}

.dhu-nav-main {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.dhu-nav-main span {
  width: 72px;
  height: 15px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.dhu-nav-sub span {
  width: 44px;
  height: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.36);
}

.dhu-nav--right .dhu-nav-sub {
  padding-right: 20px;
}

.dhu-nav--right .dhu-nav-sub span:last-child {
  width: 124px;
}

.dhu-logo {
  display: grid;
  place-items: center;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
}

.dhu-logo::before {
  content: "";
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.12);
}

.dhu-banner {
  position: relative;
  aspect-ratio: 1600 / 678;
  background: #e6e6e6;
}

.dhu-caption {
  position: absolute;
  left: 50%;
  bottom: 52px;
  width: 46%;
  height: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  transform: translateX(-50%);
}

.dhu-dots {
  position: absolute;
  right: 110px;
  bottom: 56px;
  width: 124px;
  height: 8px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 3.5px, rgba(255, 255, 255, 0) 4px) 0 0 / 18px 8px repeat-x;
}

.dhu-heading {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 28px 40px 32px;
}

.dhu-heading span:first-child {
  width: 96px;
  height: 26px;
  border-radius: 6px;
  background: rgba(166, 30, 45, 0.28);
}

.dhu-heading span:last-child {
  width: 28px;
  height: 12px;
  border-radius: 6px;
  background: #e4e4e4;
}

.dhu-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.dhu-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  height: 170px;
  padding: 0 32px 0 44px;
  background: #f5f5f5;
}

.dhu-card span {
  height: 14px;
  border-radius: 7px;
  background: #e2e2e2;
}

.dhu-card span:last-child {
  width: 62%;
}

/* 骨架上的流光，表示正在加载 */
.dhu-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%);
}

.handoff.is-peeling .dhu-skeleton::after {
  animation: dhuShimmer 1.6s ease-in-out infinite;
}

@keyframes dhuShimmer {
  to { transform: translateX(170%); }
}

/* 官网迟迟不响应时出现的提示 */
.handoff-status {
  position: absolute;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 14px 30px -10px rgba(15, 41, 66, 0.25),
    0 0 0 1px rgba(15, 41, 66, 0.06);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.handoff-status.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.handoff-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nailong-yellow);
  animation: statusPulse 1.2s ease-in-out infinite;
}

@keyframes statusPulse {
  50% { transform: scale(0.6); opacity: 0.5; }
}

.handoff-status a {
  color: var(--accent-gold);
  font-weight: 700;
  text-decoration: none;
}

.handoff-status a:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--focus-ring);
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (min-width: 1025px) {
  :root {
    --mascot-size: 250px;
    --mascot-right: max(50px, 6vw);
    --mascot-bottom: max(40px, 8vh);
  }
}

/* 竖屏平板：同手机一样在底部预留奶龙停靠区 */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  .page-container {
    padding-bottom: 240px;
  }
}

/* 矮屏桌面 / 横屏平板：收紧垂直间距 */
@media (min-width: 641px) and (max-height: 720px) {
  :root {
    --timer-size: 168px;
  }
  .hero-title {
    font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  }
  .btn {
    min-height: 54px;
  }
}

@media (min-width: 641px) and (max-height: 540px) {
  :root {
    --timer-size: 120px;
    --mascot-size: 110px;
    --mascot-right: 16px;
    --mascot-bottom: 16px;
  }
  .page-container {
    padding: 16px 32px;
  }
  .hero-title {
    font-size: clamp(2.2rem, 5.6vw, 3.4rem);
  }
  .timer {
    margin: 16px 0;
  }
  .btn {
    min-height: 48px;
  }
}

@media (max-width: 640px) {
  :root {
    --timer-size: 150px;
    --mascot-size: 150px;
    --mascot-right: 16px;
    --mascot-bottom: 16px;
  }
  /* 底部预留奶龙停靠区，内容在剩余空间内居中，避免奶龙遮挡按钮 */
  .page-container {
    padding: 16px 16px 180px;
  }
  .wordmark {
    font-size: 1.35rem;
  }
  .top-nav {
    min-height: 38px;
  }
  .hero-title {
    font-size: clamp(2.3rem, 12.5vw, 3.6rem);
  }
  .hero-subtitle {
    flex-direction: column;
    gap: 4px;
    font-size: 0.98rem;
  }
  .divider {
    display: none;
  }
  .timer {
    margin: 26px 0 24px;
  }
  .action-group {
    flex-direction: column;
    gap: 12px;
    width: min(100%, 300px);
  }
  .btn {
    min-height: 50px;
    padding: 0 24px;
    font-size: 1rem;
  }
  .bubble-1 { --size: 34px; left: 6%; top: 30%; }
  .bubble-2 { --size: 30px; left: 84%; top: 18%; }
  .bubble-5 { left: 86%; top: 52%; }
}

/* 矮屏手机（iPhone SE 等）：压缩间距，保证内容完整落在奶龙停靠区上方 */
@media (max-width: 640px) and (max-height: 700px) {
  :root {
    --timer-size: 108px;
  }
  .page-container {
    padding-bottom: 164px;
  }
  .speech-bubble {
    top: -50px;
  }
  .hero-title {
    font-size: clamp(2.2rem, 11.5vw, 3.2rem);
  }
  .hero-subtitle {
    margin-top: 8px;
    gap: 2px;
  }
  .timer {
    margin: 14px 0;
  }
  .action-group {
    gap: 8px;
  }
  .btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sun-glow,
  .ambient-blob,
  .sparkles,
  .bubble,
  .timer-blob,
  .timer-satellite,
  .mascot-sprite,
  .mascot-container::before,
  .mascot-container::after {
    animation: none;
  }

  .mascot-container[data-pose="dizzy"]::after {
    display: none;
  }

  .handoff.is-peeling .dhu-skeleton::after,
  .handoff-status::before {
    animation: none;
  }
}
