:root {
    --primary-color: #F59E0B;
    --primary-hover: #D97706;
    --secondary-color: #10B981;
    --text-color: #1F2937;
    --text-light: #6B7280;
    --bg-color: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --info-color: #3B82F6;
}

[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-light: #D1D5DB;
    --bg-color: #1a1a2e;
    --bg-secondary: #16213e;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header */
.header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="dark"] .header {
    box-shadow: 0 2px 8px rgba(255,255,255,0.06);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--primary-color);
}

.nav-links a.active {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--primary-color);
    font-weight: 600;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    color: var(--text-color);
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.sun-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

/* Dark mode card backgrounds */
[data-theme="dark"] .tool-card,
[data-theme="dark"] .feature-item,
[data-theme="dark"] .control-group,
[data-theme="dark"] .base-color-section,
[data-theme="dark"] .export-section,
[data-theme="dark"] .output-section,
[data-theme="dark"] .results,
[data-theme="dark"] .wcag-level,
[data-theme="dark"] .color-card,
[data-theme="dark"] .random-gradient-item {
    background-color: #2a2a2a;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Main Content */
.main {
    min-height: 100vh;
    padding: 2rem 0;
}

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
}

/* Ad Container */
.ad-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.ad-placeholder {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-color) 100%);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

[data-ad-slot="leaderboard"] {
    width: 728px;
    height: 90px;
}

[data-ad-slot="in-content"] {
    width: 728px;
    height: 90px;
}

[data-ad-slot="sidebar"] {
    width: 300px;
    height: 250px;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tool-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tool-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tool-description {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.tool-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.tool-features li {
    padding: 0.25rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Palette Generator */
.palette-generator {
    margin-top: 1rem;
}

.color-strip {
    display: flex;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.color-swatch {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: flex 0.3s ease;
    position: relative;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color: white;
}

.color-swatch:hover {
    flex: 1.5;
}

.color-swatch.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
}

.palette-controls {
    display: flex;
    gap: 1rem;
}

.palette-controls .btn {
    flex: 1;
}

/* Info Section */
.info-section {
    margin: 4rem 0;
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
}

.feature-item:hover {
    border-color: var(--primary-color) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-light);
}


        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            color: var(--text-light);
            margin-bottom: 1.5rem;
            padding: 0.5rem 0;
        }
        .breadcrumb a {
            color: var(--text-light);
            text-decoration: none;
            transition: color 0.2s ease;
        }
        .breadcrumb a:hover {
            color: var(--primary-color);
        }
        .breadcrumb .separator {
            color: var(--border-color);
            user-select: none;
        }
        .breadcrumb .current {
            color: var(--text-color);
            font-weight: 600;
        }

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    padding: 0.25rem 0;
}

.footer-section a {
    text-decoration: none;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-links {
        display: none;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    [data-ad-slot="leaderboard"],
    [data-ad-slot="in-content"] {
        width: 300px;
        height: 250px;
    }

    .palette-controls {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeIn 0.5s ease-out;
}

.tool-card:nth-child(2) {
    animation-delay: 0.1s;
}

.tool-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Color States */
.color-success { color: var(--success-color); }
.color-warning { color: var(--warning-color); }
.color-error { color: var(--error-color); }
.color-info { color: var(--info-color); }

/* Background States */
.bg-success { background-color: var(--success-color); }
.bg-warning { background-color: var(--warning-color); }
.bg-error { background-color: var(--error-color); }
.bg-info { background-color: var(--info-color); }

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}
