@font-face {
  font-family: "MaShanZheng";
  src: local("Ma Shan Zheng"), local("MaShanZheng-Regular"), local("Kaiti SC"), local("STKaiti"), local("KaiTi"), local("KaiTi_GB2312"), serif;
}

@font-face {
  font-family: "NotoSansSC";
  src: local("Noto Sans SC"), local("NotoSansSC-Regular"), local("PingFang SC"), local("Microsoft YaHei"), sans-serif;
}

:root {
  /* 中国传统色 - 红金配色体系 */
  --red-dark: #2b0808;
  --red-main: #c21f30; /* 中国红 */
  --red-light: #ff4d4d;
  --gold-dark: #8a6000;
  --gold-main: #f2c75c;
  --gold-light: #fff2cc;
  
  --bg-gradient: radial-gradient(circle at 50% 20%, #4a0a0a 0%, #1a0202 80%, #000000 100%);
  --glass-panel: rgba(40, 10, 10, 0.75);
  --glass-border: rgba(242, 199, 92, 0.4);
  
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

* {
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* 禁止滚动 */
  font-family: "NotoSansSC", sans-serif;
  background: var(--bg-gradient);
  color: var(--gold-light);
  /* 禁止选择和触摸默认行为 */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  position: fixed; /* 锁定body位置，防止移动端回弹 */
}

/* 动态背景纹理 */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* 祥云装饰（底部） */
body::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30vh;
  background: radial-gradient(ellipse at bottom, rgba(194, 31, 48, 0.2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header Design */
.app-header {
  position: absolute;
  top: 4vh;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  animation: fadeInDown 1s ease-out;
}

.title {
  font-family: "MaShanZheng", serif;
  font-size: clamp(32px, 8vw, 64px); /* 响应式字体 */
  font-weight: normal;
  color: transparent;
  background: linear-gradient(180deg, var(--gold-light) 20%, var(--gold-main) 60%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 2px rgba(242, 199, 92, 0.5));
}

.subtitle {
  font-size: clamp(12px, 3vw, 16px);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.subtitle::before, .subtitle::after {
  content: "✦";
  color: var(--gold-main);
  font-size: 10px;
}

/* Main Content */
.app-main {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

.danmaku-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  perspective: 1000px;
  overflow: hidden;
}

.danmaku-item {
  position: absolute;
  white-space: nowrap;
  font-weight: 700;
  color: #fff;
  text-shadow: 
    1px 1px 0 #000,
    -1px -1px 0 #000,
    0 0 8px rgba(0,0,0,0.5);
  font-family: "MaShanZheng", sans-serif;
  will-change: transform;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-name: danmaku-move;
  pointer-events: none;
}

/* 弹幕特殊动画效果 */
.danmaku-item.anim-shake {
  animation-name: danmaku-move, danmaku-shake;
  animation-duration: inherit, 0.3s;
  animation-iteration-count: 1, infinite;
}
.danmaku-item.anim-scale {
  animation-name: danmaku-move, danmaku-scale;
  animation-duration: inherit, 1s;
  animation-iteration-count: 1, infinite;
}
.danmaku-item.anim-vibrate {
  animation-name: danmaku-move, danmaku-vibrate;
  animation-duration: inherit, 0.2s;
  animation-iteration-count: 1, infinite;
}
.danmaku-item.anim-bounce {
  animation-name: danmaku-move, danmaku-bounce;
  animation-duration: inherit, 0.6s;
  animation-iteration-count: 1, infinite;
}
.danmaku-item.anim-rotate {
  animation-name: danmaku-move, danmaku-rotate;
  animation-duration: inherit, 2s;
  animation-iteration-count: 1, infinite;
  transform-origin: center center;
}
.danmaku-item.anim-flip {
  animation-name: danmaku-move, danmaku-flip;
  animation-duration: inherit, 1.5s;
  animation-iteration-count: 1, infinite;
}

/* 五彩斑斓字体特效 */
.danmaku-item.rainbow-text {
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #00ffff, #0000ff, #8b00ff);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  /* 使用具体属性而非简写，避免覆盖 animation-fill-mode 等全局属性 */
  animation-name: danmaku-move, rainbow-flow;
  animation-timing-function: linear, linear;
  animation-iteration-count: 1, infinite;
  /* animation-duration 由 JS 动态设置 */
  
  font-weight: 900;
  text-shadow: none !important; /* 去掉之前的 text-shadow 以显示渐变 */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); /* 使用 drop-shadow 替代 text-shadow */
}
/* 五彩弹幕叠加动画时，需要组合 animation */
.danmaku-item.rainbow-text.anim-shake { animation-name: danmaku-move, rainbow-flow, danmaku-shake; }
.danmaku-item.rainbow-text.anim-scale { animation-name: danmaku-move, rainbow-flow, danmaku-scale; }
.danmaku-item.rainbow-text.anim-vibrate { animation-name: danmaku-move, rainbow-flow, danmaku-vibrate; }
.danmaku-item.rainbow-text.anim-bounce { animation-name: danmaku-move, rainbow-flow, danmaku-bounce; }
.danmaku-item.rainbow-text.anim-rotate { animation-name: danmaku-move, rainbow-flow, danmaku-rotate; }
.danmaku-item.rainbow-text.anim-flip { animation-name: danmaku-move, rainbow-flow, danmaku-flip; }

@keyframes danmaku-move {
  0% { transform: translateX(0) translateZ(0); }
  100% { transform: translateX(calc(-100vw - 100%)) translateZ(0); }
}

@keyframes danmaku-shake {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}
@keyframes danmaku-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
@keyframes danmaku-vibrate {
  0% { transform: translate(0, 0); }
  25% { transform: translate(2px, 2px); }
  50% { transform: translate(-2px, 0); }
  75% { transform: translate(0, -2px); }
  100% { transform: translate(0, 0); }
}
@keyframes danmaku-bounce {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.1, 0.9); }
}
@keyframes danmaku-rotate {
  0% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
  100% { transform: rotate(-10deg); }
}
@keyframes danmaku-flip {
  0% { transform: perspective(400px) rotateX(0); }
  50% { transform: perspective(400px) rotateX(180deg); }
  100% { transform: perspective(400px) rotateX(360deg); }
}
@keyframes rainbow-flow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Controls - Floating Bar */
.controls {
  position: fixed; /* 使用fixed定位确保在视口底部 */
  bottom: max(20px, var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 94%;
  max-width: 640px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
  touch-action: manipulation;
}

/* 随机祝福词 */
.quick-words {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  min-height: 32px;
}

.quick-word-item {
  background: rgba(242, 199, 92, 0.15);
  border: 1px solid rgba(242, 199, 92, 0.3);
  color: var(--gold-light);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s;
  animation: fadeIn 0.5s ease-out;
}

.quick-word-item:active {
  transform: scale(0.95);
  background: rgba(242, 199, 92, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}


/* 输入栏容器 */
.input-bar {
  position: relative;
  display: flex;
  width: 100%;
  height: 60px;
  background: var(--glass-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 4px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.input-bar:focus-within {
  transform: translateY(-5px);
  border-color: var(--gold-main);
  background: rgba(60, 10, 10, 0.85);
  box-shadow: 0 12px 40px rgba(194, 31, 48, 0.4);
}

/* 颜色选择器重构 */
.color-picker-wrapper {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  position: relative;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}

.color-picker-wrapper:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.15);
}

.color-picker-wrapper input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: block;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* 输入框重构 */
.input-bar input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--gold-light);
  font-size: 16px;
  padding: 0 12px;
  height: 100%;
  font-weight: 500;
  min-width: 0;
  -webkit-appearance: none; /* 去除iOS默认样式 */
}

.input-bar input[type="text"]::placeholder {
  color: rgba(242, 199, 92, 0.5);
  font-size: 15px;
  font-weight: 400;
}

/* 发送按钮重构 */
.input-bar button {
  height: 48px;
  padding: 0 24px;
  margin-left: 4px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #f2c75c 0%, #d4a017 100%);
  color: #3d1c00;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  flex-shrink: 0;
  -webkit-appearance: none;
}

/* 按钮内部光效 */
.input-bar button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  border-radius: 24px 24px 0 0;
  opacity: 0.6;
}

.input-bar button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  filter: brightness(0.95);
}

/* 状态文字 */
.status {
  height: 20px;
  line-height: 20px;
  font-size: 13px;
  color: var(--gold-main);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  background: rgba(0,0,0,0.4);
  padding: 0 10px;
  border-radius: 10px;
}
.status:not(:empty) {
  opacity: 1;
}

/* 口令框弹窗 */
.passcode-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(255, 255, 255, 0.95);
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.6);
  z-index: 1000;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90%;
  width: 320px;
}

.passcode-modal.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* ==========================================
   红包雨 & 大红包样式
   ========================================== */

/* 红包雨容器 */
.red-packet-rain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001; /* 遮罩是1000? 不，遮罩在JS中创建 */
  pointer-events: none;
  overflow: hidden;
}

/* 单个下落红包 */
.red-packet-drop {
  position: absolute;
  top: -100px;
  width: 40px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  /* 使用 emoji 作为红包 */
  font-size: 30px;
  animation: fall linear forwards;
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(360deg); }
}

/* 大红包弹窗 */
.big-red-packet-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.big-red-packet-modal.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 红包外壳 (未打开) */
.red-packet-wrapper {
  width: 300px;
  height: 420px;
  background: #cf3a3a;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 弧形盖子 */
.rp-lid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  background: #e64c4c;
  border-radius: 0 0 50% 50%;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.rp-body {
  position: absolute;
  top: 80px;
  width: 100%;
  text-align: center;
  z-index: 3;
}

.rp-avatar {
  width: 60px;
  height: 60px;
  background: #ffd700;
  border-radius: 50%;
  margin: 0 auto 15px;
  line-height: 60px;
  font-size: 30px;
  border: 3px solid #fff;
}

.rp-title {
  color: #fceea7;
  font-family: "MaShanZheng", serif;
  font-size: 26px;
  margin-bottom: 80px;
}

.rp-btn-open {
  width: 90px;
  height: 90px;
  background: #ebcd99;
  border-radius: 50%;
  margin: 0 auto;
  line-height: 90px;
  font-size: 36px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.5s;
  user-select: none;
}

/* 点击开后的旋转动画 */
.rp-btn-open.rotate {
  animation: rotate-y 1s infinite linear;
}

@keyframes rotate-y {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* 红包结果页 */
.red-packet-result {
  width: 300px;
  height: 420px;
  background: #f5f5f5;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.rp-result-header {
  height: 100px;
  background: #cf3a3a;
  position: relative;
  border-radius: 0 0 50% 50%;
}

.rp-result-title {
  color: #fceea7;
  padding-top: 30px;
  font-size: 18px;
  font-weight: bold;
}

.rp-amount {
  margin-top: 40px;
  color: #cf3a3a;
}

.rp-amount .num {
  font-size: 50px;
  font-weight: bold;
}

.rp-amount .unit {
  font-size: 18px;
  margin-left: 5px;
}

.rp-code-box {
  margin: 20px 30px;
  padding: 15px;
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 8px;
}

.rp-code-box .label {
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
}

.rp-code-box .code {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  word-break: break-all;
}

.rp-btn-copy {
  background: #cf3a3a;
  color: #fff;
  border: none;
  padding: 10px 40px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}

.rp-btn-copy:active {
  background: #b02a2a;
}

.rp-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: #fff; /* header是红色的 */
  cursor: pointer;
  opacity: 0.8;
}

/* 翻转显示结果 */
.red-packet-result.show {
  animation: fade-in-up 0.5s ease-out;
}

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

/* 
 * 废弃口令框样式 (保留代码以防回滚，或直接删除)
 * 为保持整洁，暂不删除，因为是新加的块
 */
.passcode-modal {
  font-family: "MaShanZheng", serif;
  color: #d32f2f;
  font-size: 28px;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.passcode-box {
  background: #fff5e6;
  border: 2px dashed #ff9800;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  letter-spacing: 2px;
  user-select: text; /* 允许复制 */
}

.passcode-tip {
  font-size: 14px;
  color: #666;
  margin-bottom: 25px;
}

.passcode-btn {
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white;
  border: none;
  padding: 10px 30px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.passcode-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3);
}

/* 小马动画 */
.horse-runner {
  position: fixed;
  z-index: 200;
  font-size: 32px;
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(242, 199, 92, 0.6);
  font-weight: bold;
  transform-origin: center bottom;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
}

.horse-runner .horse-icon {
  font-size: 48px;
  margin-right: 4px;
  animation: horse-gallop 0.3s infinite alternate cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes horse-gallop {
  0% { transform: translateY(0) rotate(0deg) scaleY(1); }
  100% { transform: translateY(-8px) rotate(-8deg) scaleY(0.95); }
}

/* 适配超小屏幕 */
@media (max-width: 360px) {
  .title { font-size: 48px; }
  .input-bar { height: 52px; padding: 3px; }
  .color-picker-wrapper { width: 36px; height: 36px; }
  .color-picker-wrapper input[type="color"] { width: 28px; height: 28px; }
  .input-bar button { height: 44px; padding: 0 16px; font-size: 14px; }
  .input-bar input[type="text"] { font-size: 14px; padding: 0 8px; }
}

/* 适配横屏模式 */
@media (orientation: landscape) and (max-height: 500px) {
  .app-header { top: 10px; }
  .title { font-size: 32px; margin-bottom: 0; }
  .subtitle { display: none; }
  .controls { bottom: 10px; width: 80%; }
}

/* 倒计时样式 - 修复乱码 */
.countdown-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  mix-blend-mode: screen;
}

/* 暗淡背景遮罩 */
.dim-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 4; /* 在烟花(5)之下，内容之上 */
  opacity: 0;
  transition: opacity 2s ease-in-out;
  pointer-events: none;
}

.dim-overlay.active {
  opacity: 1;
}

.countdown-label {
  font-family: "MaShanZheng", serif;
  font-size: clamp(18px, 5vw, 64px); /* 缩小字体防止移动端溢出 */
  color: transparent;
  background: linear-gradient(180deg, #fff2cc 20%, #f2c75c 60%, #8a6000 100%);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 20px;
  letter-spacing: 2px;
  /* text-shadow 在 background-clip: text 下效果不佳，改用 filter */
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8)); 
  white-space: nowrap; /* 禁止换行 */
  animation: labelPulse 3s infinite ease-in-out;
}

@keyframes labelPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 15px rgba(242, 199, 92, 0.8)); }
}

.countdown-timer {
  font-family: "NotoSansSC", sans-serif;
  font-size: clamp(28px, 7vw, 80px); /* 调整最小值适配移动端 */
  font-weight: 700;
  color: var(--gold-main);
  /* 移除 text-shadow，因为子元素使用了 gradient text */
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: baseline;
  white-space: nowrap;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

/* 移动端倒计时适配 */
@media (max-width: 480px) {
  .countdown-timer {
    gap: 4px; /* 缩小间距 */
  }
  .countdown-label {
    margin-bottom: 10px;
  }
}

.countdown-timer span {
  font-feature-settings: "tnum";
  background: linear-gradient(180deg, var(--gold-light) 20%, var(--gold-main) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#fireworksCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* Rules Button */
.rules-button {
  position: fixed;
  left: 0;
  top: 30%;
  transform: translateY(-50%);
  background: rgba(194, 31, 48, 0.8); /* Red background */
  color: var(--gold-light);
  padding: 15px 10px;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
  z-index: 1000;
  font-family: "MaShanZheng", serif;
  font-size: 15px;
  box-shadow: 2px 0 10px rgba(0,0,0,0.5);
  border: 1px solid var(--gold-main);
  border-left: none;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 4px;
}

.rules-button:hover {
  background: rgba(194, 31, 48, 1);
}

/* Rules Modal */
.rules-modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
}

.rules-modal.show {
  display: flex;
  animation: fadeIn 0.3s;
}

.rules-content {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe0b2 100%);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  position: relative;
  border: 2px solid var(--gold-main);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  color: #5d4037;
  font-family: "NotoSansSC", sans-serif;
}

.rules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--gold-dark);
  padding-bottom: 10px;
}

.rules-title {
  font-family: "MaShanZheng", serif;
  font-size: 28px;
  color: var(--red-main);
}

.close-rules {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close-rules:hover,
.close-rules:focus {
  color: var(--red-main);
  text-decoration: none;
  cursor: pointer;
}

.rules-body p {
  margin: 10px 0;
  font-size: 16px;
  line-height: 1.6;
}

.rules-note {
  margin-top: 20px !important;
  font-size: 14px !important;
  color: var(--red-main);
  font-weight: bold;
}
