/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'ZCOOL XiaoWei', 'Ma Shan Zheng', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 30%, #0f3460 60%, #1a1a2e 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #fff;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* 粒子背景画布 */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 彩带容器 */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -20px;
    width: 12px;
    height: 20px;
    animation: confettiFall linear infinite;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotate(0deg) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) translateX(100px);
        opacity: 0.5;
    }
}

/* 气球容器 */
.balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -150px;
    font-size: 60px;
    animation: balloonFloat linear infinite;
}

@keyframes balloonFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-50vh) translateX(20px) rotate(10deg);
    }
    100% {
        transform: translateY(-120vh) translateX(-10px) rotate(-5deg);
        opacity: 0.7;
    }
}

/* 星星容器 */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* 主容器 */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    min-height: 100vh;
}

/* ========== 皇冠样式 ========== */
.crown-container {
    position: relative;
    margin: 20px 0;
    opacity: 0;
    animation: fadeInDown 1s ease forwards 0.3s;
}

.crown {
    font-size: 80px;
    animation: crownFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-15px) rotate(3deg); }
}

.sparkle-1, .sparkle-2 {
    position: absolute;
    font-size: 30px;
    animation: sparkleRotate 2s ease-in-out infinite;
}

.sparkle-1 {
    top: -10px;
    left: -30px;
    animation-delay: 0s;
}

.sparkle-2 {
    top: -10px;
    right: -30px;
    animation-delay: 0.5s;
}

@keyframes sparkleRotate {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; }
    50% { transform: rotate(180deg) scale(1.3); opacity: 0.7; }
}

/* ========== 成人礼标题 ========== */
.adult-title {
    font-size: 3.5rem;
    text-align: center;
    margin: 20px 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.5s;
    background: linear-gradient(90deg, #ffd700, #c0c0c0, #ffd700, #c0c0c0, #ffd700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease forwards 0.5s, shimmer 3s linear infinite;
    text-shadow: none;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.title-word {
    display: inline-block;
    animation: bounceIn 0.8s ease forwards;
    opacity: 0;
}

.title-word:nth-child(1) { animation-delay: 0.6s; }
.title-word:nth-child(2) { animation-delay: 0.7s; }
.title-word:nth-child(3) { animation-delay: 0.8s; }
.title-word:nth-child(4) { animation-delay: 0.9s; }

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3) rotate(-10deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ========== 18数字展示 ========== */
.number-18 {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1s;
}

.num {
    font-size: 6rem;
    font-weight: bold;
    animation: numPulse 2s ease-in-out infinite;
}

.num-1 {
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4);
}

.num-8 {
    color: #c0c0c0;
    text-shadow: 0 0 30px rgba(192, 192, 192, 0.8), 0 0 60px rgba(192, 192, 192, 0.4);
}

.num-1 { animation-delay: 0s; }
.num-8 { animation-delay: 0.3s; }

@keyframes numPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========== 名字标题 ========== */
.name-title {
    font-size: 2.5rem;
    text-align: center;
    margin: 20px 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.2s;
}

.name-word {
    display: inline-block;
    background: linear-gradient(90deg, #ffd700, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: nameFloat 2s ease-in-out infinite;
    opacity: 0;
}

.name-word:nth-child(1) { animation-delay: 1.3s, 0s; }
.name-word:nth-child(2) { animation-delay: 1.4s, 0.3s; }
.name-word:nth-child(3) { animation-delay: 1.5s, 0.6s; }

@keyframes nameFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(-3deg); }
    75% { transform: translateY(-5px) rotate(3deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 媒体容器 ========== */
.media-container {
    margin: 40px 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 2s;
}

.media-frame {
    position: relative;
    border-radius: 20px;
    overflow: visible;
    min-width: 320px;
    max-width: 100%;
    transition: transform 0.5s ease;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(1deg); }
}

.media-frame:hover {
    animation: none;
    transform: scale(1.08) rotate(-1deg);
}

.media-frame::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg,
        #ffd700, #c0c0c0, #ffd700, #c0c0c0, #ffd700);
    background-size: 400% 400%;
    border-radius: 25px;
    z-index: -1;
    animation: borderGlow 4s linear infinite;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.media-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    box-shadow: inset 0 0 60px rgba(255, 215, 0, 0.3);
    pointer-events: none;
}

.media-frame img {
    width: 100%;
    max-width: 500px;
    min-height: 200px;
    display: block;
    border-radius: 20px;
    background: #000;
    object-fit: cover;
}

.media-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #c0c0c0, #ffd700);
    border-radius: 22px;
    z-index: -1;
    animation: glowPulse 3s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; filter: blur(8px); }
    50% { opacity: 1; filter: blur(15px); }
}

.photo-frame-decoration {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    font-size: 1.5rem;
}

.deco-1, .deco-2, .deco-3 {
    animation: decoFloat 2s ease-in-out infinite;
}

.deco-1 { animation-delay: 0s; }
.deco-2 { animation-delay: 0.3s; }
.deco-3 { animation-delay: 0.6s; }

@keyframes decoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.media-emojis {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    font-size: 2rem;
}

.media-emojis span {
    animation: emojiBounce 1s ease-in-out infinite;
    display: inline-block;
}

.media-emojis span:nth-child(1) { animation-delay: 0s; }
.media-emojis span:nth-child(2) { animation-delay: 0.3s; }
.media-emojis span:nth-child(3) { animation-delay: 0.6s; }

@keyframes emojiBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.2); }
}

/* ========== 祝福语 ========== */
.blessing-message {
    max-width: 600px;
    padding: 40px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 2.5s;
}

.blessing-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.blessing-line {
    font-size: 1.4rem;
    line-height: 2.5;
    text-align: center;
    margin: 10px 0;
    opacity: 0;
    animation: fadeInLine 1s ease forwards;
}

.line-1 { animation-delay: 2.7s; color: #ffd700; }
.line-2 { animation-delay: 2.9s; color: #c0c0c0; }
.line-3 { animation-delay: 3.1s; color: #ffd700; }
.line-4 { animation-delay: 3.3s; color: #ff6b9d; }
.line-5 { animation-delay: 3.5s; color: #a8e6cf; }
.line-6 { animation-delay: 3.7s; color: #fff; font-size: 1.6rem; font-weight: bold; }

@keyframes fadeInLine {
    from { opacity: 0; transform: translateX(-30px) rotate(-5deg); }
    to { opacity: 1; transform: translateX(0) rotate(0deg); }
}

/* ========== 成人誓言 ========== */
.oath-section {
    max-width: 500px;
    margin: 50px 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 4s;
    text-align: center;
}

.oath-title {
    font-size: 1.8rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 30px;
    animation: oathGlow 2s ease-in-out infinite;
}

@keyframes oathGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 40px rgba(255, 215, 0, 0.8); }
}

.oath-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.oath-content p {
    font-size: 1.3rem;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(255, 215, 0, 0.3));
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: oathAppear 1s ease forwards, oathFloat 2s ease-in-out infinite;
    opacity: 0;
    animation-fill-mode: forwards, normal;
}

@keyframes oathAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes oathFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.oath-content p:nth-child(1) { animation-delay: 4.2s; }
.oath-content p:nth-child(2) { animation-delay: 4.4s; }
.oath-content p:nth-child(3) { animation-delay: 4.6s; }
.oath-content p:nth-child(4) { animation-delay: 4.8s; }

@keyframes oathFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ========== 特效文字 ========== */
.sparkle-text {
    display: flex;
    gap: 20px;
    margin: 40px 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 5s;
}

.sparkle-text span {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle-text span:nth-child(2) {
    color: #c0c0c0;
    text-shadow: 0 0 20px rgba(192, 192, 192, 0.8);
    animation-delay: 0.5s;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ========== 签名 ========== */
.signature {
    margin-top: 60px;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 5.5s;
}

.signature-emoji {
    font-size: 3rem;
    animation: heartPulse 1.5s ease-in-out infinite;
}

.signature-text {
    font-size: 1.5rem;
    background: linear-gradient(90deg, #ffd700, #c0c0c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 10px;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========== 音乐控制按钮 ========== */
.music-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.8), rgba(192, 192, 192, 0.8));
    padding: 15px 25px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 6s;
}

.music-control:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

.music-control.playing {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(192, 192, 192, 0.9));
}

.music-icon {
    font-size: 1.5rem;
    animation: musicBounce 0.6s ease-in-out infinite;
}

.music-control.playing .music-icon {
    animation: musicBounce 0.6s ease-in-out infinite;
}

@keyframes musicBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.music-text {
    font-size: 0.9rem;
    font-weight: bold;
}

/* ========== 额外的光效 ========== */
.container::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, rgba(192, 192, 192, 0.05) 50%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .adult-title {
        font-size: 2.5rem;
    }

    .number-18 {
        gap: 15px;
    }

    .num {
        font-size: 4rem;
    }

    .name-title {
        font-size: 1.8rem;
    }

    .blessing-line {
        font-size: 1.1rem;
    }

    .oath-content p {
        font-size: 1.1rem;
        padding: 12px 20px;
    }

    .sparkle-text span {
        font-size: 1.3rem;
    }

    .signature-text {
        font-size: 1.2rem;
    }

    .crown {
        font-size: 60px;
    }

    .music-control {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
    }

    .media-frame {
        min-width: 280px !important;
        max-width: 90vw !important;
    }

    .media-frame img {
        max-width: 90vw !important;
        min-height: 150px;
    }

    .container {
        padding: 20px 15px;
    }

    .blessing-card {
        padding: 20px;
    }
}

/* ========== 微信浏览器适配 ========== */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }

    .container {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffd700, #c0c0c0);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffe066, #e0e0e0);
}
