/* 首页样式 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 清新配色方案 */
    --primary-color: #10b981;
    --secondary-color: #06d6a0;
    --accent-color: #fbbf24;
    --success-color: #34d399;
    --error-color: #f87171;
    
    /* 清新背景 */
    --bg-primary: #f0fdf4;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-hover: #ecfdf5;
    
    /* 柔和文字色 */
    --text-primary: #064e3b;
    --text-secondary: #047857;
    --text-muted: #6b7280;
    
    /* 清新边框和阴影 */
    --border-color: #d1fae5;
    --shadow-sm: 0 1px 3px rgba(16, 185, 129, 0.1);
    --shadow-md: 0 4px 12px rgba(16, 185, 129, 0.15);
    --shadow-lg: 0 8px 25px rgba(16, 185, 129, 0.2);
    
    /* 流畅动画 */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #d1fae5 100%);
    color: var(--text-primary);
    line-height: 1.7;
    position: relative;
}

/* 添加清新的背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* 首页容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    box-sizing: border-box;
}

/* 首页头部 */
.home-header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-header h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-shadow: 0 4px 8px rgba(16, 185, 129, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.9;
}

/* 难度选择器 */
.difficulty-selector {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    width: 100%;
    max-width: 900px;
}

.difficulty-selector::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.02) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.difficulty-selector h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
    position: relative;
    z-index: 1;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    font-size: 1rem;
    font-weight: 600;
    border: 3px solid var(--border-color);
    border-radius: 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    min-height: 70px;
    position: relative;
    overflow: hidden;
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity var(--transition);
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.difficulty-btn:hover::before {
    opacity: 0.1;
}

.difficulty-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 214, 160, 0.05));
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.difficulty-btn.active::before {
    opacity: 0.15;
}

.progress-info {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.start-btn {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 18px 45px;
    border: none;
    border-radius: 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-btn::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: left 0.6s;
}

.start-btn:hover::before {
    left: 100%;
}

.start-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.3);
}

/* 首页控制按钮 */
.home-controls {
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.control-btn {
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 25px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transition: left 0.5s;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 首页底部 */
.home-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 15px 20px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideInBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

@keyframes slideInBounce {
    from { 
        transform: translateX(100%) scale(0.8); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
}

.message-success {
    background: rgba(52, 211, 153, 0.9);
    color: white;
    border: 2px solid var(--success-color);
}

.message-error {
    background: rgba(248, 113, 113, 0.9);
    color: white;
    border: 2px solid var(--error-color);
}

.message-info {
    background: rgba(16, 185, 129, 0.9);
    color: white;
    border: 2px solid var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        gap: 10px;
        justify-content: center;
    }
    
    .home-header {
        margin-bottom: 10px;
    }
    
    .home-header h1 {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .difficulty-selector {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .difficulty-selector h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .difficulty-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .difficulty-btn {
        min-height: 50px;
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .start-btn {
        font-size: 1rem;
        padding: 12px 30px;
    }
    
    .home-footer {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
        gap: 8px;
        justify-content: center;
    }
    
    .home-header h1 {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .difficulty-selector {
        padding: 12px;
    }
    
    .difficulty-selector h2 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .difficulty-btn {
        font-size: 0.85rem;
        min-height: 45px;
        padding: 6px 8px;
    }
    
    .progress-info {
        font-size: 0.75rem;
    }
    
    .start-btn {
        font-size: 0.95rem;
        padding: 10px 25px;
    }
    
    .home-footer {
        font-size: 0.75rem;
    }
}
