/* ============================================================
   跨年倒计时 · 液态玻璃主题
   核心：backdrop-filter 磨砂 + 内外双层高光 + 边缘折射描边
   ============================================================ */
:root {
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-edge: rgba(255, 235, 200, 0.6);
  --glass-edge-soft: rgba(255, 230, 190, 0.42);
  --glass-shadow-in: rgba(255, 245, 220, 0.5);
  --glass-shadow-out: rgba(110, 10, 10, 0.5);
  --glass-tint: rgba(255, 140, 60, 0.10);
  --text-main: #fff6ec;
  --text-dim: rgba(255, 240, 222, 0.78);
  --accent: #ffd76e;
  --accent-soft: rgba(255, 215, 110, 0.35);
}

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

html, body { height: 100%; }

body {
  font-family: "Noto Serif SC", "Microsoft YaHei", "PingFang SC", serif;
  color: var(--text-main);
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 15% 10%, #8a1e1e 0%, transparent 60%),
    radial-gradient(1000px 700px at 85% 90%, #4a0d0d 0%, transparent 55%),
    radial-gradient(900px 600px at 80% 15%, #b33a0d 0%, transparent 60%),
    linear-gradient(160deg, #2b0404 0%, #4a0e0e 55%, #6e1209 100%);
}

/* 背景画布（星辰 + 烟花 + 飘雪） */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* WebGL 液态玻璃渲染层：全屏透明，玻璃只在数字卡片区域绘制 */
#liquid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- 舞台布局 ---------- */
.stage {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5vh 16px 3.5vh;
  user-select: none;
}

.header { text-align: center; }

.label {
  font-size: clamp(13px, 2vw, 18px);
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: var(--accent);
  opacity: 0.95;
  text-shadow: 0 0 22px rgba(255, 215, 110, 0.55);
  font-weight: 600;
}

.title {
  margin-top: 10px;
  font-size: clamp(30px, 5.5vw, 54px);
  font-weight: 900;
  letter-spacing: 0.18em;
  background: linear-gradient(180deg, #fff 0%, #ffe9b8 45%, #ffb84d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 190, 90, 0.35));
  white-space: nowrap;
}

.subtitle {
  margin-top: 12px;
  font-size: clamp(13px, 1.9vw, 17px);
  color: var(--text-dim);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

/* ---------- 液态玻璃倒计时 ---------- */
.glass-clock {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 28px);
}

/* ============================================================
   液态玻璃倒计时卡片
   - 液态玻璃本体完全由下方 #liquid-canvas 的 WebGL 层绘制
     （折射采样 bg-canvas 背景纹理 + 圆角 SDF + 边缘高光弧）；
   - 本卡片只保留数字文字、细描边与细微受光，自身透明，
     绝不遮挡或二次模糊 WebGL 玻璃。
   ============================================================ */
.glass-unit {
  position: relative;
  min-width: clamp(78px, 15vw, 168px);
  padding: clamp(14px, 2.4vh, 30px) clamp(10px, 1.6vw, 22px) clamp(10px, 1.8vh, 22px);

  /* CSS 像素布局基准，供 liquid.js 对齐玻璃片尺寸 */
  isolation: isolate;
  text-align: center;
  border-radius: 28px;
  overflow: hidden;

  /* 卡片自身完全透明——液态玻璃本体由下方 WebGL 层绘制，
     这里只保留极细描边与高光，绝不遮挡玻璃折射 */
  background: transparent;
  border: 1px solid rgba(255, 245, 220, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),   /* 顶部受光细线 */
    inset 0 -1px 0 rgba(40, 10, 10, 0.10),
    0 24px 50px -20px rgba(60, 5, 5, 0.40),
    0 6px 16px -8px rgba(255, 160, 60, 0.10);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.35s;
}

/* 内部流动高光带（sheen 扫过）—— 这是"液态"与人造塑料的最大区别 */
.glass-unit::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -30%;
  width: 55%;
  height: 180%;
  background: linear-gradient(100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.42) 45%,
    rgba(255, 255, 255, 0.12) 55%,
    transparent 100%);
  transform: rotate(16deg);
  filter: blur(2px);
  z-index: 2;
  pointer-events: none;
  animation: sheen 5.2s ease-in-out infinite;
  opacity: 0.9;
}

@keyframes sheen {
  0%   { left: -70%; opacity: 0; }
  18%  { opacity: 0.85; }
  42%  { left: 90%; opacity: 0; }
  100% { left: 90%; opacity: 0; }
}

/* 玻璃左上角的球形受光点（模拟曲面高光） */
.glass-unit::after {
  content: "";
  position: absolute;
  top: 8%;
  left: 9%;
  width: 34%;
  height: 30%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.0) 70%);
  border-radius: 50%;
  filter: blur(5px);
  z-index: 2;
  pointer-events: none;
}

.glass-unit:hover {
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.90),
    inset 0 -1px 0 rgba(40, 10, 10, 0.16),
    0 30px 60px -18px rgba(60, 5, 5, 0.55),
    0 8px 20px -8px rgba(255, 170, 70, 0.25);
}

/* 数字被挤压缩放动画（液态感） */
.glass-unit.flip .glass-num {
  animation: liquid-wobble 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes liquid-wobble {
  0%   { transform: scale(1, 1); }
  25%  { transform: scale(1.12, 0.86); }
  50%  { transform: scale(0.94, 1.08); }
  75%  { transform: scale(1.04, 0.97); }
  100% { transform: scale(1, 1); }
}

/* 数字本体：高透文字 + 细亮描边，像刻在玻璃表面 */
.glass-num {
  position: relative;
  z-index: 3; /* 让数字浮在流动高光之上，仍透出背景 */
  display: block;
  font-size: clamp(40px, 8.5vw, 96px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.9);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 -1px 1px rgba(60, 10, 10, 0.3),
    0 6px 26px rgba(255, 190, 90, 0.25);
}

.glass-unit-label {
  position: relative;
  z-index: 3;
  display: block;
  margin-top: clamp(4px, 0.8vh, 10px);
  font-size: clamp(12px, 1.8vw, 17px);
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: var(--text-dim);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* 冒号分隔符（同样做成小玻璃丸） */
.glass-colon {
  width: clamp(14px, 2.2vw, 22px);
  height: clamp(14px, 2.2vw, 22px);
  display: grid;
  place-items: center;
  font-size: clamp(26px, 4.4vw, 44px);
  line-height: 1;
  color: rgba(255, 255, 255, 0.75);
  margin-top: clamp(12px, 2.5vh, 30px);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.6);
  text-shadow: 0 0 14px rgba(255, 215, 110, 0.6);
  animation: colon-pulse 1.6s ease-in-out infinite;
}

@keyframes colon-pulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.86); }
}

/* ---------- 页脚 ---------- */
.footer p {
  font-size: clamp(12px, 1.6vw, 15px);
  color: var(--text-dim);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  opacity: 0.85;
  animation: fade-in-up 1.2s 0.6s both;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 0.85; transform: translateY(0); }
}

/* ---------- 入场动画 ---------- */
.label, .title, .subtitle { animation: fade-in-up 1.1s 0.1s both; }
.glass-unit { animation: glass-in 1s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.glass-unit:nth-child(1) { animation-delay: 0.10s; }
.glass-unit:nth-child(3) { animation-delay: 0.22s; }
.glass-unit:nth-child(5) { animation-delay: 0.34s; }
.glass-unit:nth-child(7) { animation-delay: 0.46s; }

@keyframes glass-in {
  from { opacity: 0; transform: translateY(26px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 响应式：小屏收紧间距 ---------- */
@media (max-width: 720px) {
  .glass-clock { gap: 8px; }
}