/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-radius: 16px;
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

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

.language-switch {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.lang-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.3em;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Stats Section */
.stats-section {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--border-radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.stats-section h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 1.8em;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    padding: 24px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.stat-number {
    font-size: 3em;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-status {
    font-size: 1.4em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-status.idle {
    color: var(--text-secondary);
}

.stat-status.running {
    color: var(--warning-color);
    animation: pulse 2s infinite;
}

.stat-status.online {
    color: var(--success-color);
}

.stat-status.error {
    color: var(--error-color);
}

.stat-label {
    font-size: 0.95em;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
}

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

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 页面加载动画 */
.container > section {
    animation: slideInUp 0.6s ease-out;
}

.container > section:nth-child(1) { animation-delay: 0.1s; }
.container > section:nth-child(2) { animation-delay: 0.2s; }
.container > section:nth-child(3) { animation-delay: 0.3s; }
.container > section:nth-child(4) { animation-delay: 0.4s; }

/* 统计卡片动画 */
.stat-card {
    animation: bounceIn 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* 工具卡片动画 */
.tool-card {
    animation: slideInRight 0.5s ease-out;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }

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

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

/* 按钮悬停效果增强 */
.mint-btn, .reset-btn {
    position: relative;
    overflow: hidden;
}

.mint-btn::before, .reset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mint-btn:hover::before, .reset-btn:hover::before {
    left: 100%;
}

/* 消息动画 */
.mint-message {
    animation: slideInUp 0.3s ease-out;
}

/* 语言切换按钮动画 */
.lang-btn {
    position: relative;
}

.lang-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.lang-btn.active::after {
    width: 80%;
}

/* Tools Section */
.tools-section {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--border-radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.tools-section h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 1.8em;
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.tool-card {
    background: linear-gradient(135deg, #ddd6fe 0%, #fecaca 100%);
    padding: 24px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.tool-name {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.tool-status {
    display: inline-block;
    padding: 6px 16px;
    background: var(--success-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Control Section */
.control-section {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--border-radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.control-section h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 1.8em;
    font-weight: 600;
}

.mint-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.mint-controls select,
.mint-controls input {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1em;
    min-width: 160px;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
}

.mint-controls select:focus,
.mint-controls input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.mint-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.4);
}

.mint-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(37, 99, 235, 0.5);
}

.mint-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.4);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(239, 68, 68, 0.5);
}

.mint-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    display: none;
    border-left: 4px solid transparent;
    font-weight: 500;
}

.mint-message.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-left-color: var(--success-color);
}

.mint-message.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-left-color: var(--error-color);
}

.mint-message.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-left-color: var(--primary-color);
}

/* Footer */
.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 24px;
    font-weight: 500;
}

/* 优化响应式设计 */
@media (max-width: 1024px) {
    .container {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 24px 20px;
    }
    
    .header h1 {
        font-size: 2.2em;
    }
    
    .header p {
        font-size: 1.1em;
    }
    
    .header-top {
        flex-direction: column;
        gap: 16px;
    }
    
    .stats-section,
    .tools-section,
    .control-section {
        padding: 24px 20px;
    }
    
    .mint-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .mint-controls select,
    .mint-controls input,
    .mint-btn,
    .reset-btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 2.2em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .language-switch {
        width: 100%;
        justify-content: center;
    }
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(17, 24, 39, 0.9);
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
}
