/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    opacity: 0;
    animation: fadeInBody 0.3s ease-out 0.15s forwards;
}

@keyframes fadeInBody {
    to {
        opacity: 1;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.header {
    background: var(--gradient-bg);
    padding: 60px 0;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-primary);
    margin: 0;
    transition: all 0.3s ease;
}

[data-theme="light"] .header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23333" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

[data-theme="light"] .header::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e2e8f0" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.3rem;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.header .guide-link {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.header .guide-link a {
    color: #a78bfa;
    text-decoration: underline;
    text-decoration-color: rgba(167, 139, 250, 0.4);
    font-weight: 400;
    transition: all 0.3s ease;
}

.header .guide-link a:hover {
    color: var(--accent-primary);
    text-decoration-color: var(--accent-primary);
}

.header p:last-child {
    margin-bottom: 0;
}

/* Loading and spinner styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

[data-theme="light"] .loading-overlay {
    background: rgba(255, 255, 255, 0.9);
}

#loadingText {
    color: var(--text-primary);
    font-size: 1rem;
    margin-top: 10px;
}

[data-theme="light"] .spinner {
    border: 4px solid var(--border-primary);
    border-top: 4px solid var(--accent-primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--shadow-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
