/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
    position: relative;
    transition: background 1s ease;
}

/* 背景装饰元素 */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: -1;
}

body::before {
    top: -100px;
    left: -100px;
    animation: float 15s ease-in-out infinite;
}

body::after {
    bottom: -100px;
    right: -100px;
    animation: float 18s ease-in-out infinite reverse;
}

/* 装饰气泡 */
.decoration-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    transition: transform 0.1s ease; /* 视差效果过渡 */
}

/* 滚动时的视差效果增强 */
@keyframes parallaxFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) translateX(5px) rotate(1deg);
    }
    50% {
        transform: translateY(0) translateX(10px) rotate(0deg);
    }
    75% {
        transform: translateY(15px) translateX(5px) rotate(-1deg);
    }
}

@-webkit-keyframes parallaxFloat {
    0%, 100% {
        -webkit-transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        -webkit-transform: translateY(-15px) translateX(5px) rotate(1deg);
    }
    50% {
        -webkit-transform: translateY(0) translateX(10px) rotate(0deg);
    }
    75% {
        -webkit-transform: translateY(15px) translateX(5px) rotate(-1deg);
    }
}

/* 添加更多的页面交互反馈 */
.messages-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    transition: transform 0.1s ease;
}

/* 触摸反馈样式 */
.touch-feedback {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transform: scale(0);
    z-index: 9999;
    mix-blend-mode: overlay;
}

@keyframes touchPulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    70% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@-webkit-keyframes touchPulse {
    0% {
        -webkit-transform: scale(0);
        opacity: 1;
    }
    70% {
        -webkit-transform: scale(1);
        opacity: 0.5;
    }
    100% {
        -webkit-transform: scale(1.5);
        opacity: 0;
    }
}

/* 添加页面背景的呼吸效果 */
@keyframes backgroundBreath {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@-webkit-keyframes backgroundBreath {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 便利贴动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(0, 20px);
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translate(0, 20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translate(0, 0);
    }
}

/* 带旋转的便利贴动画 */
@keyframes fadeInUpWithRotate {
    from {
        opacity: 0;
        transform: translate(0, 20px) rotate(0deg);
    }
    to {
        opacity: 1;
        /* 旋转角度会通过JavaScript动态设置 */
        transform: translate(0, 0) rotate(var(--rotation, 0deg));
    }
}

@-webkit-keyframes fadeInUpWithRotate {
    from {
        opacity: 0;
        -webkit-transform: translate(0, 20px) rotate(0deg);
    }
    to {
        opacity: 1;
        /* 旋转角度会通过JavaScript动态设置 */
        -webkit-transform: translate(0, 0) rotate(var(--rotation, 0deg));
    }
}

/* 便利贴样式 */
.message-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    max-width: 300px;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    z-index: 1; /* 基础z-index */
}

/* 便利贴颜色类 */
.message-item.color-1 { background-color: #fff9c4; }
.message-item.color-2 { background-color: #e0f7fa; }
.message-item.color-3 { background-color: #e8f5e9; }
.message-item.color-4 { background-color: #fff3e0; }
.message-item.color-5 { background-color: #f3e5f5; }

.message-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.message-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: center;
    word-wrap: break-word;
}

/* 主内容区域默认显示 */
.main-content {
    display: block;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.animate-bg {
    background-size: 400% 400%;
    animation: backgroundBreath 15s ease infinite;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 107, 139, 0.8), rgba(0, 0, 0, 0.9));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

/* 装饰性元素 */
.modal::before,
.modal::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 4s ease-in-out infinite;
}

.modal::before {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.modal::after {
    width: 150px;
    height: 150px;
    bottom: 15%;
    right: 10%;
    animation-delay: 1s;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    border-radius: 25px;
    padding: 35px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 15px rgba(255, 255, 255, 0.1);
    animation: modalEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* 弹窗装饰 */
.modal-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #ff6b8b, #ff9a9e, #fecfef, #f8b500);
    z-index: -1;
    border-radius: 30px;
    opacity: 0.7;
    animation: borderRotate 5s linear infinite;
    filter: blur(5px);
}

@keyframes modalEnter {
    0% {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes borderRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.modal-content h2 {
    color: #ff6b8b;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: bold;
}

.modal-content p {
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

#openGiftBtn {
    background: linear-gradient(135deg, #ff6b8b 0%, #ff5277 100%);
    color: white;
    border: none;
    padding: 18px 45px;
    font-size: 22px;
    font-weight: bold;
    border-radius: 35px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(255, 107, 139, 0.3), 0 3px 8px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#openGiftBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
    z-index: -1;
}

#openGiftBtn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 139, 0.4), 0 5px 15px rgba(0, 0, 0, 0.3);
}

#openGiftBtn:hover::before {
    left: 100%;
}

#openGiftBtn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 10px rgba(255, 107, 139, 0.4);
}

/* 按钮点击波纹效果 */
#openGiftBtn span.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 0.6s linear;
    z-index: -1;
}

#openGiftBtn:hover {
    background-color: #ff5277;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.4);
}

#openGiftBtn:active {
    transform: translateY(0);
}

/* 主内容区域 */
.main-content {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: opacity 1s ease, transform 1s ease, background 1s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

/* 漂浮装饰元素 */
.floating-decoration {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    pointer-events: none;
    z-index: -1;
    animation-name: floatAndTwinkle;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}

/* 漂浮和闪烁动画 */
@keyframes floatAndTwinkle {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-20px) translateX(10px) rotate(5deg);
        opacity: 0.9;
    }
    50% {
        transform: translateY(0) translateX(20px) rotate(0deg);
        opacity: 0.7;
    }
    75% {
        transform: translateY(20px) translateX(10px) rotate(-5deg);
        opacity: 0.5;
    }
}

@-webkit-keyframes floatAndTwinkle {
    0%, 100% {
        -webkit-transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        -webkit-transform: translateY(-20px) translateX(10px) rotate(5deg);
        opacity: 0.9;
    }
    50% {
        -webkit-transform: translateY(0) translateX(20px) rotate(0deg);
        opacity: 0.7;
    }
    75% {
        -webkit-transform: translateY(20px) translateX(10px) rotate(-5deg);
        opacity: 0.5;
    }
}

/* 响应式标题 */
@media (max-width: 768px) {
    .title-section h1 {
        font-size: 32px;
    }
    
    .title-section h1::before,
    .title-section h1::after {
        font-size: 20px;
        left: -25px;
        right: -25px;
    }
}

@media (max-width: 480px) {
    .title-section h1 {
        font-size: 28px;
    }
    
    .title-section h1::before,
    .title-section h1::after {
        font-size: 16px;
        left: -20px;
        right: -20px;
    }
}

.hidden {
    display: none !important;
}

.title-section {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
    animation: fadeInUp 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.title-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0) 100%);
    transform: translateY(-50%);
    z-index: -1;
}

.title-section h1 {
    font-size: 42px;
    color: #fff;
    font-weight: bold;
    background: linear-gradient(135deg, #ffffff 0%, #ffe6ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(255, 107, 139, 0.3);
    padding: 0 20px;
    display: inline-block;
    position: relative;
    animation: titleFloat 3s ease-in-out infinite;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.title-section h1:hover {
    transform: scale(1.05);
    text-shadow: 0 6px 25px rgba(255, 107, 139, 0.4);
}

.title-section h1::before,
.title-section h1::after {
    content: '✦';
    color: #fff;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    opacity: 0.7;
}

.title-section h1::before {
    left: -30px;
    animation: twinkle 2s ease-in-out infinite;
}

.title-section h1::after {
    right: -30px;
    animation: twinkle 2s ease-in-out infinite 0.5s;
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(-50%) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.1);
    }
}

/* 便利贴容器 */
.messages-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    overflow: visible; /* 确保便利贴不会被裁剪 */
}/* 允许点击下方元素 */

.messages-container .message-item {
    pointer-events: auto; /* 恢复便利贴的点击事件 */
}

/* 高级便利贴样式 */
.message-item {
    position: absolute;
    padding: 25px 20px;
    border-radius: 16px;
    font-size: 17px;
    max-width: 260px;
    min-width: 240px;
    word-wrap: break-word;
    opacity: 0.7 !important; /* 降低透明度，使颜色更淡 */
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 150px; /* 设置最小高度 */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transform-origin: center;
    background-size: 100% 100%;
    overflow: hidden;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-fill-mode: forwards;
    pointer-events: auto;
    position: relative;
    /* 更高级的阴影效果 */
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.08), /* 降低阴影不透明度 */
        0 6px 20px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    /* 更淡的背景色 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(245, 245, 245, 0.7) 100%);
    /* 白色格子线背景 */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px), /* 更明显的白色网格线 */
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 精致高光效果 */
.message-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* 底部阴影 */
.message-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5px;
    right: 5px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.05) 50%, transparent 100%);
    pointer-events: none;
}

/* 侧边光效 */
.message-item:hover::before {
    height: 15px;
    transition: height 0.3s ease;
}

/* 增强的悬停效果 */
.message-item:hover {
    transform: translate(-3px, -3px) scale(1.04) rotate(var(--hover-rotate, 0deg));
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.18),
        0 10px 25px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    opacity: 0.98 !important;
    z-index: 101 !important;
    background-position: -5px -5px;
}

/* 优化的点击效果 */
.message-item:active {
    transform: translate(2px, 2px) scale(0.98);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.1s ease;
}

/* 测试便利贴样式已移除 */

/* 入场动画类 */
@keyframes messageEnterUp {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    70% {
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageEnterDown {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    70% {
        transform: translateY(10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageEnterLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px) scale(0.8);
    }
    70% {
        transform: translateX(10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes messageEnterRight {
    0% {
        opacity: 0;
        transform: translateX(50px) scale(0.8);
    }
    70% {
        transform: translateX(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes messageEnterZoom {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes messageFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(1deg);
    }
    75% {
        transform: translateY(8px) rotate(-1deg);
    }
}

@-webkit-keyframes messageFloat {
    0%, 100% {
        -webkit-transform: translateY(0) rotate(0deg);
    }
    25% {
        -webkit-transform: translateY(-8px) rotate(1deg);
    }
    75% {
        -webkit-transform: translateY(8px) rotate(-1deg);
    }
}

/* 点击动画 */
@keyframes messageTap {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* 移除动画 */
@keyframes messageExit {
    0% {
        opacity: 1;
        transform: scale(1) rotate(var(--random-rotate, 0deg));
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(30px) rotate(var(--random-rotate, 0deg));
    }
}

/* 消息内容样式 */
.message-content {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    font-weight: 500;
    margin: 0;
    padding: 0;
    text-align: center;
    user-select: none; /* 防止文本选择 */
    flex: 1; /* 确保内容在flex容器中占满空间 */
}

/* 媒体查询 - 手机设备 */
@media screen and (max-width: 480px) {
    /* 调整body基础样式 */
    body {
        font-size: 14px;
        overflow-x: hidden;
    }
    
    /* 调整便利贴大小和间距 */
    .message-item {
        width: calc(100% - 20px);
        max-width: 180px;
        min-height: 100px;
        padding: 14px;
        margin: 6px;
        border-radius: 10px;
    }
    
    /* 调整便利贴内容字体大小 */
    .message-content {
        font-size: 14px;
        line-height: 1.3;
    }
    
    /* 背景装饰元素调整 */
    body::before,
    body::after {
        width: 150px;
        height: 150px;
    }
    
    body::before {
        top: -50px;
        left: -50px;
    }
    
    body::after {
        bottom: -50px;
        right: -50px;
    }
    
    /* 调整装饰气泡 */
    .decoration-bubbles {
        transform: scale(0.8);
    }
    
    /* 触摸反馈大小调整 */
    .touch-feedback {
        width: 40px;
        height: 40px;
    }
    
    /* 增强的悬停效果调整为更适合触摸 */
    .message-item:hover {
        transform: scale(1.02) rotate(var(--hover-rotate, 0deg));
        box-shadow: 
            0 15px 30px rgba(0, 0, 0, 0.15),
            0 8px 20px rgba(0, 0, 0, 0.1),
            0 0 0 1px rgba(255, 255, 255, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    
    /* 点击效果增强，更适合触摸 */
    .message-item:active {
        transform: scale(0.98);
        transition: all 0.05s ease;
    }
}

/* 媒体查询 - 大屏幕电脑 */
@media screen and (min-width: 1200px) {
    /* 大屏幕上调整便利贴大小 */
    .message-item {
        max-width: 280px;
        min-height: 160px;
        padding: 22px;
    }
    
    /* 大屏幕上调整字体大小 */
    .message-content {
        font-size: 18px;
        line-height: 1.5;
    }
    
    /* 背景装饰元素调整 */
    body::before,
    body::after {
        width: 400px;
        height: 400px;
    }
}

/* 响应式调整动画持续时间 */
@media screen and (max-width: 768px) {
    /* 调整动画速度，在移动设备上更快 */
    .message-item {
        animation-duration: 0.6s !important;
    }
    
    /* 呼吸动画也调整 */
    body.animate-bg {
        animation: backgroundBreath 12s ease infinite;
    }
}

/* 横屏模式特殊处理 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* 横屏时调整便利贴大小 */
    .message-item {
        max-width: 160px;
        min-height: 90px;
        padding: 12px;
    }
    
    /* 横屏时调整内容大小 */
    .message-content {
        font-size: 12px;
        line-height: 1.2;
    }
}

/* 不同颜色的高级便利贴 */
.message-color-1 {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.85) 0%, rgba(255, 185, 55, 0.85) 100%);
    background-image: 
        linear-gradient(135deg, rgba(255, 209, 102, 0.85) 0%, rgba(255, 185, 55, 0.85) 100%),
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    color: #333;
    transform: rotate(var(--rotate, 1deg));
    --hover-rotate: 2deg;
    box-shadow: 
        0 12px 32px rgba(255, 185, 55, 0.2),
        0 6px 20px rgba(255, 185, 55, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-color-2 {
    background: linear-gradient(135deg, rgba(102, 187, 255, 0.85) 0%, rgba(55, 150, 255, 0.85) 100%);
    background-image: 
        linear-gradient(135deg, rgba(102, 187, 255, 0.85) 0%, rgba(55, 150, 255, 0.85) 100%),
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    color: #fff;
    transform: rotate(var(--rotate, -1deg));
    --hover-rotate: -2deg;
    box-shadow: 
        0 12px 32px rgba(55, 150, 255, 0.2),
        0 6px 20px rgba(55, 150, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-color-3 {
    background: linear-gradient(135deg, rgba(174, 103, 250, 0.85) 0%, rgba(136, 57, 239, 0.85) 100%);
    background-image: 
        linear-gradient(135deg, rgba(174, 103, 250, 0.85) 0%, rgba(136, 57, 239, 0.85) 100%),
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    color: #fff;
    transform: rotate(var(--rotate, 1.5deg));
    --hover-rotate: 2.5deg;
    box-shadow: 
        0 12px 32px rgba(136, 57, 239, 0.2),
        0 6px 20px rgba(136, 57, 239, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-color-4 {
    background: linear-gradient(135deg, rgba(240, 100, 180, 0.85) 0%, rgba(220, 53, 165, 0.85) 100%);
    background-image: 
        linear-gradient(135deg, rgba(240, 100, 180, 0.85) 0%, rgba(220, 53, 165, 0.85) 100%),
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    color: #fff;
    transform: rotate(var(--rotate, -1.5deg));
    --hover-rotate: -2.5deg;
    box-shadow: 
        0 12px 32px rgba(220, 53, 165, 0.2),
        0 6px 20px rgba(220, 53, 165, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-color-5 {
    background: linear-gradient(135deg, rgba(102, 255, 178, 0.85) 0%, rgba(55, 215, 144, 0.85) 100%);
    background-image: 
        linear-gradient(135deg, rgba(102, 255, 178, 0.85) 0%, rgba(55, 215, 144, 0.85) 100%),
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    color: #333;
    transform: rotate(var(--rotate, 0.5deg));
    --hover-rotate: 1.5deg;
    box-shadow: 
        0 12px 32px rgba(55, 215, 144, 0.2),
        0 6px 20px rgba(55, 215, 144, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-color-6 {
    background: linear-gradient(135deg, rgba(255, 102, 102, 0.85) 0%, rgba(240, 50, 50, 0.85) 100%);
    background-image: 
        linear-gradient(135deg, rgba(255, 102, 102, 0.85) 0%, rgba(240, 50, 50, 0.85) 100%),
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    color: #fff;
    transform: rotate(var(--rotate, -0.5deg));
    --hover-rotate: -1.5deg;
    box-shadow: 
        0 12px 32px rgba(240, 50, 50, 0.2),
        0 6px 20px rgba(240, 50, 50, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}




/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@-webkit-keyframes slideUp {
    from {
        -webkit-transform: translateY(50px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateY(0);
        opacity: 1;
    }
}

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

/* 浏览器前缀支持 */
@-webkit-keyframes fadeInUp {
    from {
        -webkit-transform: translateY(30px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@-webkit-keyframes pulse {
    0% {
        -webkit-transform: scale(1);
    }
    50% {
        -webkit-transform: scale(1.05);
    }
    100% {
        -webkit-transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

@-webkit-keyframes float {
    0% {
        -webkit-transform: translateY(0);
    }
    50% {
        -webkit-transform: translateY(-10px);
    }
    100% {
        -webkit-transform: translateY(0);
    }
}

@keyframes fadeInAndOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

@-webkit-keyframes fadeInAndOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
        width: 90%;
        max-width: 350px;
    }
    
    .modal-content h2 {
        font-size: 24px;
    }
    
    .modal-content p {
        font-size: 16px;
    }
    
    #openGiftBtn {
        padding: 12px 30px;
        font-size: 18px;
    }
    
    .title-section h1 {
        font-size: 28px;
    }
    
    .message-item {
        font-size: 16px;
        padding: 12px 20px;
        max-width: 90%;
    }
    
    .messages-container {
        min-height: 350px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }
    
    .modal-content {
        padding: 20px;
        width: 85%;
    }
    
    .modal-content h2 {
        font-size: 22px;
    }
    
    .title-section h1 {
        font-size: 24px;
    }
    
    .message-item {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .messages-container {
        min-height: 300px;
    }
}

/* 横屏模式适配 */
@media screen and (orientation: landscape) and (max-width: 768px) {
    .modal-content {
        padding: 20px;
        width: 70%;
        max-width: none;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .messages-container {
        min-height: 250px;
    }
    
    .message-item {
        font-size: 14px;
        max-width: 45%;
    }
}

/* 高分辨率屏幕适配 */
@media (-webkit-device-pixel-ratio: 2), (resolution: 192dpi) {
    .modal-content,
    .message-item {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
}

/* 打印样式 */
@media print {
    .modal,
    .message-item {
        display: none;
    }
    
    .main-content {
        background: white;
        color: black;
    }
}

/* 减少动画性能消耗 - 用于低端设备 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}