/* 音乐控制按钮 */
.music-btn {
    position: fixed;
    top: 100px; /* 位置上移 */
    right: 25px;
    z-index: 2000;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 40%, #000 70%);
    border: 2px solid rgba(255, 215, 0, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(2px);
}

.music-btn::before {
    /* 唱片纹理 */
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 215, 0, 0.2);
    pointer-events: none;
}

.music-btn::after {
    /* 中心孔 */
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    z-index: 2;
}

.music-btn:hover {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: scale(1.1) rotate(15deg);
}

.music-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
    position: relative; /* 为斜线定位 */
}

/* 停止状态下的斜线 */
.music-btn:not(.playing) .music-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 2px;
    background-color: #FFD700; /* 金色斜线 */
    transform: translate(-50%, -50%) rotate(-45deg);
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(0,0,0,0.8);
    z-index: 4;
}

/* 播放时的旋转动画 - 整个按钮旋转 */
.music-btn.playing {
    animation: music-spin 4s linear infinite;
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.music-btn.playing .music-icon {
    animation: none;
}

@keyframes music-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 音乐文件缺失提示 */
.music-toast {
    position: fixed;
    top: 70px;
    right: 25px;
    background: rgba(0, 0, 0, 0.8);
    color: #FFD700;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #FFD700;
    font-size: 14px;
    z-index: 1001;
    max-width: 250px;
    text-align: right;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.music-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 倒福字样式 */
.fu-diamond {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 8px;
    vertical-align: middle;
}

/* 菱形背景 - 使用伪元素实现，避免容器旋转影响文字 */
.fu-diamond::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #800000;
    border: 1px solid #FFD700;
    transform: rotate(45deg) scale(0.8); /* 缩放以适应容器 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 0;
}

/* 倒福字 - 在菱形中旋转 */
.reversed-fu {
    position: relative; /* 确保在背景之上 */
    z-index: 1;
    display: block;
    transform: rotate(180deg); /* 纯粹的倒置 */
    margin: 0;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    color: #FFD700;
}

/* ========================================
   新春装饰元素
   ======================================== */
.decor-hanging {
    position: absolute;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: swing 3s ease-in-out infinite alternate;
    transform-origin: top center;
}

.decor-hanging.left {
    left: 10%;
}

.decor-hanging.right {
    right: 10%;
    animation-delay: -1.5s; /* 错开动画时间 */
}

/* 挂绳 */
.decor-line {
    width: 2px;
    height: 40px; /* 初始高度，可调整 */
    background: #FFD700;
}

/* 小灯笼 */
.decor-lantern-small {
    width: 60px;
    height: 50px;
    background: radial-gradient(circle, #ff4d4d, #b30000);
    border-radius: 15px;
    border: 2px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 灯笼上下盖 */
.decor-lantern-small::before,
.decor-lantern-small::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 6px;
    background: #FFD700;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
}

.decor-lantern-small::before { top: -4px; }
.decor-lantern-small::after { bottom: -4px; }

/* 灯笼上的文字 */
.d-fu {
    color: #FFD700;
    font-weight: bold;
    font-size: 24px;
    font-family: 'Noto Serif SC', serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 流苏 */
.decor-tassel {
    width: 4px;
    height: 60px;
    background: linear-gradient(to bottom, #FFD700, #ff0000 20%, #8b0000);
    margin-top: 4px;
    position: relative;
}

.decor-tassel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #FFD700;
    border-radius: 50%;
}

@keyframes swing {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

/* 卡片角饰 */
.blessing-card {
    position: relative; /* 为角饰定位 */
}

.corner-decor {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid transparent;
    pointer-events: none;
}

.corner-decor.top-left {
    top: 10px;
    left: 10px;
    border-top: 2px solid #FFD700;
    border-left: 2px solid #FFD700;
    border-top-left-radius: 8px;
}

.corner-decor.top-right {
    top: 10px;
    right: 10px;
    border-top: 2px solid #FFD700;
    border-right: 2px solid #FFD700;
    border-top-right-radius: 8px;
}

.corner-decor.bottom-left {
    bottom: 10px;
    left: 10px;
    border-bottom: 2px solid #FFD700;
    border-left: 2px solid #FFD700;
    border-bottom-left-radius: 8px;
}

.corner-decor.bottom-right {
    bottom: 10px;
    right: 10px;
    border-bottom: 2px solid #FFD700;
    border-right: 2px solid #FFD700;
    border-bottom-right-radius: 8px;
}

/* 角饰内部花纹 - 简单的回纹模拟 */
.corner-decor::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.corner-decor.top-left::after { top: 4px; left: 4px; border-top-left-radius: 4px; border-right: none; border-bottom: none; }
.corner-decor.top-right::after { top: 4px; right: 4px; border-top-right-radius: 4px; border-left: none; border-bottom: none; }
.corner-decor.bottom-left::after { bottom: 4px; left: 4px; border-bottom-left-radius: 4px; border-right: none; border-top: none; }
.corner-decor.bottom-right::after { bottom: 4px; right: 4px; border-bottom-right-radius: 4px; border-left: none; border-top: none; }


/* ========================================
   马年大吉 - 新年烟花祝福
   三页面流程样式
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none; /* 全局禁止文本选择 */
    -webkit-user-select: none;
}

/* 允许输入框选择文本 */
input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* 禁止图片拖拽 */
img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none; /* 让鼠标事件穿透图片，避免出现光标 */
}

/* 恢复交互元素的鼠标事件 */
button, .music-btn, .quick-tag, a {
    pointer-events: auto;
}

:root {
    --red: #C41E3A;
    --red-dark: #8B0000;
    --red-light: #E74C3C;
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --cream: #FDF5E6;
    --bg-dark: #0A0510;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: var(--bg-dark);
    color: var(--cream);
    position: relative;
}

/* ========================================
   页面通用
   ======================================== */
.page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    z-index: 1;
}

.page.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* ========================================
   页面1: 加载页
   ======================================== */
.loading-page {
    background: radial-gradient(ellipse at center, #1a0a15 0%, var(--bg-dark) 100%);
}

.loading-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 灯笼加载动画 - 替换为可爱马图片 */
.loading-lantern {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    position: relative;
    animation: swing 2s ease-in-out infinite;
    transform-origin: top center;
    background: url('cute-horse-lantern.png') no-repeat center center;
    background-size: contain;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.3));
}

.loading-lantern::before,
.loading-lantern::after {
    display: none; /* 隐藏原有的 CSS 灯笼结构 */
}

.lantern-light {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    animation: pulse 1.5s ease-in-out infinite;
    z-index: -1; /* 放在图片后面 */
}

@keyframes swing {

    0%,
    100% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(8deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }
}

/* 替换原有文字样式为图片样式 */
.loading-title-img {
    width: 280px; /* 调整图片宽度 */
    height: auto;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4)); /* 添加光晕 */
}

/* 移除原有的 .loading-title 样式 */
/* .loading-title { ... } */

.loading-subtitle {
    font-size: 1.2rem;
    color: var(--red);
    letter-spacing: 8px;
    margin-bottom: 40px;
}

.loading-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 auto 15px;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 3px;
    animation: loadProgress 3.5s ease-in-out forwards;
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

.loading-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

/* ========================================
   页面2: 祝福语编辑页
   ======================================== */
.blessing-page {
    background: radial-gradient(ellipse at center top, #1a0a15 0%, var(--bg-dark) 100%);
    position: fixed; /* 确保定位上下文 */
}

.blessing-page::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vmin;
    height: 80vmin;
    background: url('blessing-bg.png') no-repeat center center;
    background-size: contain;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
    animation: horse-breathe 4s ease-in-out infinite;
}

@keyframes horse-breathe {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.65;
    }
}

.blessing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    z-index: 2;
    width: 100%;
    max-width: 900px; /* 增加宽度 */
}

/* 祝福页标题图片 */
.blessing-title-img {
    position: absolute;
    top: -10px; /* 继续上移，略微超出顶部边界 */
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
    z-index: 20;
}

.blessing-header {
    text-align: center;
}

.blessing-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.blessing-header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 4px;
}

.blessing-card {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.2), rgba(20, 10, 15, 0.8));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.blessing-input {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    font-family: inherit;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--gold);
    text-align: center;
    resize: none;
    transition: all 0.3s ease;
}

.blessing-input::placeholder {
    color: rgba(255, 215, 0, 0.3);
    font-size: 1.1rem;
}

.blessing-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.char-count {
    text-align: right;
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(255, 215, 0, 0.4);
}

.quick-blessings {
    text-align: center;
}

.quick-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    letter-spacing: 3px;
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.quick-tag {
    padding: 10px 20px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--gold);
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-tag:hover {
    background: var(--red);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 30, 58, 0.4);
}

.next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(12px, 2vh, 18px) clamp(25px, 4vw, 40px);
    font-family: inherit;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--gold);
    background: linear-gradient(180deg, var(--red-light), var(--red), var(--red-dark));
    border: 2px solid var(--gold);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 30px rgba(196, 30, 58, 0.5);
    margin-top: 10px;
}

.next-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(196, 30, 58, 0.6);
}

/* ========================================
   页面3: 烟花发射页
   ======================================== */
.firework-page {
    background: linear-gradient(180deg, #050510 0%, #0A0515 50%, #100A15 100%);
}

.stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 50px 50px, white, transparent),
        radial-gradient(2px 2px at 150px 150px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 250px 80px, white, transparent),
        radial-gradient(2px 2px at 350px 200px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 450px 120px, white, transparent),
        radial-gradient(2px 2px at 550px 250px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 650px 100px, white, transparent),
        radial-gradient(2px 2px at 750px 300px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 100px 280px, white, transparent),
        radial-gradient(2px 2px at 300px 50px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 500px 320px, white, transparent),
        radial-gradient(1px 1px at 700px 80px, rgba(255, 255, 255, 0.6), transparent);
    background-size: 800px 350px;
    animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

#fireworkCanvas {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.fw-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 25px; /* 移除顶部内边距 */
    text-align: center;
    z-index: 10;
}

/* 烟花发射页顶部标题图片 */
.fw-title-img {
    width: 360px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    margin-top: -10px; /* 负边距上移 */
}

/* 移除原有的 .fw-title 样式 */
/* .fw-title { ... } */

/* 左下角吉祥物 */
.mascot-left-bottom {
    position: absolute;
    bottom: 10px; /* 调整到底部，与右侧对称 */
    left: 10px;
    width: 300px; /* 放大宽度，与右侧对称 */
    height: auto;
    z-index: 30; /* 确保在 footer 背景之上 */
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    pointer-events: none; /* 避免遮挡点击 */
    animation: float 4s ease-in-out infinite;
}

/* 右下角吉祥物 */
.mascot-right-bottom {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 330px; /* 放大宽度 */
    height: auto;
    z-index: 30; /* 确保在 footer 背景之上 */
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    pointer-events: none; /* 避免遮挡点击 */
    animation: float-reverse 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes float-reverse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); } /* 稍微不同的浮动幅度 */
}

.fw-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px 20px 25px;
    background: linear-gradient(to top, rgba(10, 5, 15, 0.98) 0%, transparent 100%);
    z-index: 20;
}

/* 烟筒 */
.cannon-group {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.cannon {
    position: relative;
    width: 45px;
    height: 85px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cannon:hover {
    transform: scale(1.08);
}

.cannon:active {
    transform: scale(0.95);
}

.cannon-body {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 60px;
    background: linear-gradient(90deg, #2D1B0E 0%, #5D3A1A 20%, #8B5A2B 45%, #A0522D 55%, #5D3A1A 80%, #2D1B0E 100%);
    border-radius: 6px 6px 3px 3px;
    border-top: 3px solid #1A0F05;
    box-shadow: inset 0 -15px 25px rgba(0, 0, 0, 0.5), 0 4px 15px rgba(0, 0, 0, 0.5);
}

.cannon-body::before,
.cannon-body::after {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    height: 6px;
    background: linear-gradient(90deg, #8B4513, #D4A574 30%, #FFD700 50%, #D4A574 70%, #8B4513);
    border-radius: 2px;
}

.cannon-body::before {
    top: 8px;
}

.cannon-body::after {
    top: 25px;
}

.cannon-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 22px;
    background: linear-gradient(180deg, #4A3728, #2D1B0E, #1A0F05);
    border-radius: 4px 4px 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.cannon-glow {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 25px;
    background: radial-gradient(circle, rgba(255, 200, 100, 0.9) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.cannon.firing .cannon-glow {
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) scale(2.5);
    }
}

.launch-btn {
    padding: clamp(10px, 2vh, 14px) clamp(25px, 4vw, 45px);
    font-family: inherit;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--gold);
    background: linear-gradient(180deg, #DC143C, var(--red), var(--red-dark));
    border: 2px solid var(--gold);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(196, 30, 58, 0.5), 0 0 25px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.launch-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s linear infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.launch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 35px rgba(196, 30, 58, 0.6), 0 0 35px rgba(255, 215, 0, 0.3);
}

.back-btn {
    position: fixed;
    top: 160px;
    right: 25px;
    z-index: 1000;
    padding: 15px 8px;
    font-family: inherit;
    font-size: 0.9rem;
    color: rgba(255, 215, 0, 0.6);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(139, 0, 0, 0.5);
    transform: translateY(2px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* 祝福语显示 */
.blessing-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
}

.blessing-text {
    position: absolute;
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 15px;
    text-shadow:
        0 0 30px rgba(255, 215, 0, 0.9),
        0 0 60px rgba(255, 215, 0, 0.5),
        0 0 100px rgba(255, 215, 0, 0.3),
        4px 4px 8px rgba(0, 0, 0, 0.9);
    animation: blessingPop 3s ease-out forwards;
    white-space: pre-wrap;
    text-align: center;
    line-height: 1.2;
}

@keyframes blessingPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.25);
    }

    25% {
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.15) translateY(-40px);
    }
}

/* ========================================
   响应式
   ======================================== */


@media (max-width: 500px) {
    .loading-title {
        font-size: 2.2rem;
        letter-spacing: 10px;
    }

    .blessing-header h1 {
        font-size: 1.6rem;
        letter-spacing: 5px;
    }

    .blessing-input {
        font-size: 1.2rem;
        height: 100px;
    }

    .quick-tag {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .next-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .cannon-group {
        gap: 15px;
    }

    .cannon {
        width: 38px;
        height: 70px;
    }

    .cannon-body {
        width: 26px;
        height: 48px;
    }

    .cannon-base {
        width: 38px;
        height: 18px;
    }

    .launch-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .mascot-left-bottom, 
    .mascot-right-bottom {
        width: 130px; /* 手机端进一步缩小 */
        bottom: 140px; /* 提至烟花筒上方 */
    }
}

/* Trae Logo on Cannon */
.trae-logo {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 14px;
    z-index: 5;
    /* SVG will handle the border and shape */
}

/* Removed .trae-diamond as it is now part of SVG */

/* Snow Effect */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
}

/* ========================================
   响应式适配 (笔记�?小屏设备)
   ======================================== */

/* 针对高度较小的屏幕 (笔记本常见高度 768px - 900px) */
@media screen and (max-height: 900px) {
    /* 祝福页适配 */
    .blessing-content {
        gap: 12px; /* 进一步减小间距 */
        max-width: 85%;
    }

    .blessing-title-img {
        position: relative; 
        top: auto;
        left: auto;
        transform: none;
        width: 280px; /* 稍微再缩小一点 */
        margin-top: -100px; /* 再往上移动 */
        margin-bottom: 0;
    }

    .blessing-header h1 {
        font-size: 1.6rem; /* 调小字体 */
        margin-bottom: 5px;
    }

    .blessing-header p {
        font-size: 0.9rem;
    }

    .blessing-input {
        height: 100px;
        font-size: 1.3rem;
        padding: 12px;
    }

    .next-btn {
        padding: 10px 30px; /* 调小按钮 */
        font-size: 1.1rem;
        margin-top: 5px;
    }

    /* 烟花页适配 */
    .fw-header {
        padding-top: 5px;
    }

    .fw-title-img {
        width: 260px; /* 进一步缩小 */
        margin-top: 0;
    }

    .mascot-left-bottom {
        width: 180px;
        left: 0;
        bottom: 10px;
    }

    .mascot-right-bottom {
        width: 210px; /* 右侧稍微大一点 */
        right: 0;
        bottom: 10px;
    }

    .fw-footer {
        padding: 10px 10px 35px; /* 增加底部间距，让按钮往上一点 */
        gap: 8px;
    }

    .cannon {
        width: 32px; /* 稍微缩小烟筒 */
        height: 65px;
    }

    .cannon-body {
        width: 24px;
        height: 46px;
    }

    .launch-btn {
        padding: 8px 25px; /* 更紧凑的按钮 */
        font-size: 1rem;
        letter-spacing: 3px;
    }

    /* Loading 页适配 */
    .loading-lantern {
        width: 110px;
        height: 110px;
        margin-bottom: 10px;
    }

    .loading-title-img {
        width: 200px;
    }
}

/* 针对宽度较小的屏�?(平板/小屏笔记�? */
@media screen and (max-width: 1024px) {
    .blessing-content {
        width: 90%;
    }

    .quick-tag {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .cannon-group {
        gap: 20px; /* 减小烟筒间距 */
    }
    
    .mascot-left-bottom {
        width: 180px;
        opacity: 0.8;
    }

    .mascot-right-bottom {
        width: 210px;
        opacity: 0.8;
    }
}

/* 针对极小高度屏幕 (�?1366x768 的全屏模式下内容�? */
@media screen and (max-height: 700px) {
    .blessing-title-img {
        width: 240px;
        margin-top: -10px;
    }
    
    .blessing-input {
        height: 80px;
    }
    
    .fw-title-img {
        width: 200px;
    }
    
    .cannon {
        transform: scale(0.8);
    }
}

/* ========================================
   Mobile Fixes (Final Override)
   ======================================== */
@media screen and (max-width: 500px) {
    .mascot-left-bottom {
        width: 100px;
        bottom: auto;
        top: 40%;
        left: 0;
    }

    .mascot-right-bottom {
        width: 120px; /* 手机端右侧也稍微大一点 */
        bottom: auto;
        top: 45%;
        right: 0;
    }

    .music-btn {
        width: 32px;
        height: 32px;
        top: 80px;
        right: 15px;
    }
    
    .music-btn svg {
        width: 16px;
        height: 16px;
    }

    .music-btn::after {
        width: 6px;
        height: 6px;
    }
}
