/* CSS样式文件 - 2026马年新春主题 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #e63946;
    --secondary-red: #d90429;
    --gold-color: #ffd700;
    --dark-gold: #b8860b;
    --light-gold: #fffacd;
    --dark-bg: #0d1b2a;
    --light-bg: #f8f9fa;
    --horse-brown: #8b4513;
    --festival-orange: #ff6b35;
    --anime-pink: #ffafcc;
    --anime-blue: #a2d2ff;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1b263b 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 粒子背景 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 烟花特效 */
.fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0,0,0,0.8) 100%);
}

/* 灯笼装饰 */
.lantern {
    position: fixed;
    top: 50px;
    width: 80px;
    height: 100px;
    z-index: 100;
}

.lantern.left {
    left: 30px;
    animation: swing-left 3s ease-in-out infinite alternate;
}

.lantern.right {
    right: 30px;
    animation: swing-right 3s ease-in-out infinite alternate 1.5s;
}

.lantern-body {
    width: 60px;
    height: 80px;
    background: linear-gradient(var(--primary-red), var(--secondary-red));
    border-radius: 30px 30px 15px 15px;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

.lantern-light {
    width: 40px;
    height: 60px;
    background: radial-gradient(circle, var(--gold-color) 0%, transparent 70%);
    position: absolute;
    top: 10px;
    left: 10px;
    border-radius: 20px;
    animation: flicker 2s ease-in-out infinite alternate;
}

.lantern-tassel {
    width: 4px;
    height: 40px;
    background: linear-gradient(to bottom, var(--gold-color), var(--dark-gold));
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
}

/* 飘落的福字 */
.fu-characters {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.fu-characters::before,
.fu-characters::after {
    content: '福';
    position: absolute;
    font-size: 40px;
    color: var(--primary-red);
    font-weight: bold;
    font-family: 'Ma Shan Zheng', cursive;
    opacity: 0.7;
    animation: float-down 10s linear infinite;
}

/* 二次元马娘角色 */
.anime-character.horse-girl {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 180px;
    background: linear-gradient(135deg, var(--anime-pink), var(--anime-blue));
    border-radius: 60px 60px 20px 20px;
    z-index: 100;
    animation: bounce 3s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.character-text {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--primary-red);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    animation: pulse-text 2s infinite;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* 新年横幅 */
.new-year-banner {
    background: linear-gradient(45deg, 
        var(--primary-red) 0%, 
        var(--festival-orange) 25%, 
        var(--gold-color) 50%, 
        var(--festival-orange) 75%, 
        var(--primary-red) 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    animation: gradient-shift 10s ease infinite;
    box-shadow: 0 15px 35px rgba(230, 57, 70, 0.3);
}

.year-text {
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    animation: glow 2s ease-in-out infinite alternate;
}

.greeting {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.wish-text {
    background: rgba(255,255,255,0.9);
    color: var(--primary-red);
    padding: 10px 20px;
    border-radius: 50px;
    display: inline-block;
    margin-right: 10px;
    font-weight: bold;
}

/* 倒计时样式 */
.countdown-container {
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.countdown-item {
    background: linear-gradient(135deg, #2a2d43, #1c1e2d);
    border-radius: 15px;
    padding: 20px;
    min-width: 100px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

.number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: var(--gold-color);
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.label {
    font-size: 1rem;
    color: #aaa;
    margin-top: 5px;
    display: block;
}

/* 卡片样式 */
.animated-card {
    background: rgba(255,255,255,0.95);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    animation: card-enter 1s ease-out;
    border: 3px solid var(--gold-color);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 20px;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-red), var(--gold-color));
    border-radius: 2px;
}

.card-header h2 {
    color: var(--primary-red);
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

/* 输入组样式 */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #ddd;
    border-radius: 15px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white;
    color: #333;
}

.input-with-icon input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
    outline: none;
}

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-red);
    font-size: 1.2rem;
}

.input-hint {
    color: #666;
    font-size: 0.9rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-generate, .btn-copy, .btn-validate, .btn-confirm {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
}

.btn-generate {
    background: linear-gradient(45deg, var(--primary-red), var(--festival-orange));
    color: white;
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(230, 57, 70, 0.4);
    animation: button-pulse 0.5s ease;
}

.btn-copy {
    background: linear-gradient(45deg, #2a9d8f, #264653);
    color: white;
}

.btn-validate {
    background: linear-gradient(45deg, #4361ee, #3a0ca3);
    color: white;
    width: 100%;
}

.btn-sparkle {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(255,255,255,0.3) 70%);
    opacity: 0;
    animation: sparkle 2s infinite;
}

/* 密钥显示区域 */
.key-display-container {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px dashed var(--gold-color);
}

.key-display {
    background: white;
    border-radius: 10px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    color: var(--primary-red);
    margin: 15px 0;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-display.copied {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
    animation: copy-success 1s ease;
}

.key-info {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* 验证结果 */
.validation-section {
    margin-top: 25px;
}

.validation-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.validation-result.show {
    opacity: 1;
    transform: translateY(0);
}

.validation-result.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #a5d6a7;
}

.validation-result.error {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #ef9a9a;
}

/* 祝福卡片 */
.blessings-card {
    background: linear-gradient(135deg, var(--horse-brown), #a0522d);
    border-radius: 20px;
    padding: 25px;
    color: var(--light-gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.blessings-header {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.blessings-content p {
    margin-bottom: 10px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.blessings-signature {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    color: var(--gold-color);
    font-weight: bold;
}

/* 页脚 */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: #aaa;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--gold-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 模态框 */
.new-year-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    animation: fade-in 0.5s ease;
}

.modal-content {
    background: linear-gradient(135deg, var(--primary-red), var(--festival-orange));
    border-radius: 25px;
    padding: 30px;
    max-width: 500px;
    margin: 100px auto;
    position: relative;
    color: white;
    animation: modal-enter 0.6s ease-out;
    border: 3px solid var(--gold-color);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.modal-header h2 {
    font-size: 2rem;
    animation: glow 2s infinite alternate;
}

.close-modal {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-modal:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px 0;
}

.special-wish {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--light-gold);
    text-align: center;
    margin: 20px 0;
}

.modal-horse {
    text-align: center;
    font-size: 3rem;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

/* 动画定义 */
@keyframes swing-left {
    0% { transform: translateY(-10px) rotate(-5deg); }
    100% { transform: translateY(10px) rotate(5deg); }
}

@keyframes swing-right {
    0% { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(10px) rotate(-5deg); }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float-down {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

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

@keyframes pulse-text {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes glow {
    0% { text-shadow: 0 0 10px rgba(255,215,0,0.5), 0 0 20px rgba(255,215,0,0.3); }
    100% { text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 30px rgba(255,215,0,0.6), 0 0 40px rgba(255,215,0,0.4); }
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes card-enter {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes sparkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

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

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .year-text {
        font-size: 2rem;
    }
    
    .countdown {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .countdown-item {
        min-width: 80px;
        padding: 15px;
    }
    
    .number {
        font-size: 2rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .lantern {
        width: 50px;
        height: 70px;
    }
    
    .lantern.left {
        left: 10px;
    }
    
    .lantern.right {
        right: 10px;
    }
    
    .anime-character.horse-girl {
        width: 80px;
        height: 120px;
        bottom: 10px;
        right: 10px;
    }
}

/* 元宵节当天特殊样式 */
body.lantern-festival {
    background: linear-gradient(135deg, #8b0000 0%, #ff4500 100%);
}

.countdown.festival-day .countdown-item {
    animation: festival-pulse 1s infinite;
}

@keyframes festival-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}