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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53, #ffd93d);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    color: #333;
    line-height: 1.6;
}

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

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #d92027, #ff9234);
    color: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 16px rgba(217, 32, 39, 0.3);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* 角色选择区域 */
.role-selection {
    margin-bottom: 30px;
}

.role-selection h2 {
    text-align: center;
    color: #d92027;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.role-card {
    background-color: #fff3cd;
    border: 2px solid #ffeeba;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.role-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: #d92027;
}

.role-card.selected {
    background-color: #ffeeba;
    border-color: #d92027;
    box-shadow: 0 0 0 3px rgba(217, 32, 39, 0.3);
}

.role-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.role-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #d92027;
}

/* 生成按钮 */
.generate-section {
    text-align: center;
    margin-bottom: 30px;
}

.generate-btn {
    background: linear-gradient(135deg, #d92027, #ff9234);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(217, 32, 39, 0.3);
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(217, 32, 39, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

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

.text-result, .image-result {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.text-result h3, .image-result h3 {
    color: #d92027;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

.blessing-text {
    background-color: #fff8e1;
    border: 2px dashed #ffd700;
    border-radius: 10px;
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #8b4513;
}

/* 拜年卡片样式 */
.card-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.blessing-card {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border: 3px solid #ffd700;
    border-radius: 15px;
    width: 300px;
    min-height: 450px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.blessing-card::before {
    content: "🧧";
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 2rem;
    opacity: 0.8;
}

.blessing-card::after {
    content: "🧧";
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 2rem;
    opacity: 0.8;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h4 {
    font-size: 1.5rem;
    color: #d92027;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.card-content {
    flex: 1;
    margin-bottom: 20px;
}

.card-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #8b4513;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-footer {
    margin-top: 20px;
}

.qr-code {
    width: 100px;
    height: 100px;
    margin: 0 auto 10px;
    background-color: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-note {
    font-size: 0.9rem;
    color: #666;
    font-weight: bold;
}

/* 操作按钮 */
.action-btn {
    background-color: #d92027;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 4px 8px rgba(217, 32, 39, 0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(217, 32, 39, 0.4);
}

.text-result .action-btn {
    display: block;
    margin: 0 auto;
}

.image-actions {
    text-align: center;
}

/* 广告区域 */
.ad-section {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ad-section h3 {
    color: #d92027;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.ad-content {
    background-color: #f8f9fa;
    border: 2px dashed #ffd700;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #666;
}

/* 打赏区域 */
.donate-section {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.donate-section h3 {
    color: #d92027;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.donate-container {
    display: flex;
    justify-content: center;
}

.wechat-pay {
    text-align: center;
}

.wechat-pay h4 {
    color: #07c160;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.qr-placeholder {
    width: 150px;
    height: 150px;
    background-color: #f8f9fa;
    border: 2px dashed #07c160;
    border-radius: 10px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #666;
}

/* 底部信息 */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
    background-color: white;
    border-radius: 15px;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .role-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .role-card {
        padding: 15px;
    }

    .role-icon {
        font-size: 2.5rem;
    }

    .generate-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .blessing-card {
        width: 280px;
        min-height: 400px;
        padding: 20px;
    }

    .qr-code {
        width: 80px;
        height: 80px;
    }

    .action-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 3px;
    }

    .qr-placeholder {
        width: 120px;
        height: 120px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.generate-btn.loading {
    background-color: #999;
    cursor: not-allowed;
}

/* 成功提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #07c160;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}