/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'ZCOOL QingKe HuangYou', 'Ma Shan Zheng', sans-serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 192, 203, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 218, 185, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, 
            #ff9a9e 0%, 
            #fad0c4 25%, 
            #fbc2eb 50%, 
            #a6c1ee 75%, 
            #c2e9fb 100%
        );
    background-size: 400% 400%, 300% 300%, 500% 500%, 400% 400%;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    animation: gradientBackground 15s ease infinite, floatingBubbles 20s ease-in-out infinite;
    position: relative;
}

/* 添加动态气泡背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.06) 0%, transparent 30%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 15%);
    animation: bubbleFloat 25s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* 添加爱心雨效果 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(255, 105, 180, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 85% 25%, rgba(255, 182, 193, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 25% 85%, rgba(255, 192, 203, 0.06) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 105, 180, 0.1) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px, 180px 180px;
    animation: heartRain 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

/* Logo样式 */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.main-logo {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 6px 20px rgba(255, 107, 157, 0.4));
    transition: all 0.3s ease;
    animation: logoFloat 3s ease-in-out infinite;
}

.main-logo:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 25px rgba(255, 107, 157, 0.6));
}

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

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, 
        #ff6b6b 0%, 
        #ff9a9e 25%, 
        #fbc2eb 50%, 
        #a6c1ee 75%, 
        #c2e9fb 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(255, 107, 107, 0.3);
    animation: titleGradient 6s ease infinite, titleFloat 3s ease-in-out infinite;
    position: relative;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    margin-bottom: 5px;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.2),
        0 0 10px rgba(255, 255, 255, 0.3);
    animation: fadeInUp 1.5s ease-out 0.3s both;
    letter-spacing: 0.5px;
}

/* 主要内容区域 */
.main-content {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 25px;
    padding: 35px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideInUp 1s ease-out;
}

/* 输入区域 */
.input-section {
    margin-bottom: 30px;
}

.input-container {
    position: relative;
    margin-bottom: 20px;
}

#messageInput {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1.1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

#messageInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.char-count {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: #999;
    font-size: 0.9rem;
}

.analyze-btn {
    width: 100%;
    padding: 18px 35px;
    background: linear-gradient(45deg, #ff6b6b, #ff9a9e, #fbc2eb);
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.analyze-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.5);
    background: linear-gradient(45deg, #ff5252, #ff7b7b, #ffb8e4);
}

.analyze-btn:active {
    transform: translateY(-1px);
}

/* 结果区域 */
.result-section {
    margin-bottom: 30px;
}

.loading {
    text-align: center;
    padding: 40px;
    display: none;
}

.error-message {
    text-align: center;
    padding: 20px;
}

/* 结果内容样式优化 */
.result-card .original-message {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    border-left: 4px solid #8b0000;
    color: #8b0000;
}

.result-card .analysis-result {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #8b0000;
    font-size: 1.1rem;
}

.result-card .advice {
    padding: 15px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    border: 2px dashed rgba(139, 0, 0, 0.3);
    color: #8b0000;
    font-weight: 500;
}

.result-card strong {
    color: #8b0000;
    font-weight: 600;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.result-card {
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.95) 0%, 
        rgba(255, 209, 220, 0.95) 50%, 
        rgba(255, 235, 240, 0.95) 100%
    );
    border-radius: 20px;
    padding: 30px;
    color: #8b0000;
    box-shadow: 
        0 15px 40px rgba(255, 105, 180, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.4);
    animation: fadeIn 0.5s ease-out;
    backdrop-filter: blur(20px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h3 {
    font-size: 1.5rem;
    margin: 0;
}

.result-emoji {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.result-content {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.result-footer {
    display: flex;
    gap: 10px;
}

.copy-btn, .share-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.share-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #f5576c;
}

.share-btn:hover {
    background: white;
    transform: translateY(-2px);
}

/* 示例区域 */
.examples-section {
    margin-top: 30px;
}

.examples-section h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.example-card {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-card:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.example-card p {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

.example-hint {
    font-size: 0.8rem;
    color: #667eea;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.8);
    animation: fadeInUp 1s ease-out;
}

/* 浮动元素 */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-heart, .floating-sparkle, .floating-love {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    opacity: 0.6;
    filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.3));
}

.floating-heart {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation: float 6s ease-in-out infinite, heartPulse 3s ease-in-out infinite;
}

.floating-sparkle {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
    animation: float 6s ease-in-out infinite, sparkleTwinkle 2s ease-in-out infinite;
}

.floating-love {
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
    animation: float 6s ease-in-out infinite, loveGlow 4s ease-in-out infinite;
}

/* 新增浮动元素 */
.floating-elements::before {
    content: '💖';
    position: absolute;
    top: 15%;
    right: 20%;
    font-size: 1.5rem;
    animation: float 8s ease-in-out infinite, heartPulse 2.5s ease-in-out infinite;
    opacity: 0.4;
    filter: drop-shadow(0 0 8px rgba(255, 182, 193, 0.4));
}

.floating-elements::after {
    content: '✨';
    position: absolute;
    bottom: 20%;
    right: 10%;
    font-size: 1.8rem;
    animation: float 7s ease-in-out infinite, sparkleTwinkle 1.8s ease-in-out infinite;
    opacity: 0.5;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.3));
}

/* 动画定义 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 100%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 0%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes titleGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

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

/* 新增动画效果 */
@keyframes floatingBubbles {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 0% 100%;
    }
    25% {
        background-position: 100% 0%, 0% 100%, 25% 75%, 100% 0%;
    }
    50% {
        background-position: 100% 100%, 0% 0%, 75% 25%, 50% 50%;
    }
    75% {
        background-position: 0% 100%, 100% 0%, 50% 50%, 25% 75%;
    }
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.1;
    }
    25% {
        transform: translateY(-10px) scale(1.1);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-20px) scale(0.9);
        opacity: 0.2;
    }
    75% {
        transform: translateY(-10px) scale(1.05);
        opacity: 0.12;
    }
}

@keyframes heartRain {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 新增特效动画 */
@keyframes heartPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.3));
    }
    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.6));
    }
}

@keyframes sparkleTwinkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.3));
    }
    25% {
        transform: scale(1.1) rotate(90deg);
        filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.5));
    }
    50% {
        transform: scale(0.9) rotate(180deg);
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    }
    75% {
        transform: scale(1.05) rotate(270deg);
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.45));
    }
}

@keyframes loveGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(255, 182, 193, 0.4));
    }
    33% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 15px rgba(255, 182, 193, 0.7));
    }
    66% {
        transform: scale(0.95);
        filter: drop-shadow(0 0 12px rgba(255, 182, 193, 0.5));
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .main-logo {
        width: 80px;
        height: 80px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .floating-elements {
        display: none;
    }
}