/**
 * 多主题颜色方案 + 手机端适配
 * 通过 html[data-theme="xxx"] 切换
 */
:root,
[data-theme="default"] {
    --body-bg: #f4f4f9;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --nav-bg: #333;
    --nav-text: #fff;
    --nav-hover-bg: #444;
    --footer-bg: #333;
    --footer-text: #fff;
    --text-primary: #333;
    --text-secondary: #666;
    --accent: #007bff;
    --accent-hover: #0056b3;
    --link: #007bff;
    --link-hover-bg: #007bff;
    --link-hover-text: #fff;
    --border: rgba(0, 0, 0, 0.1);
    --input-bg: #fff;
    --input-border: #ced4da;
}

[data-theme="dark"] {
    --body-bg: #1a1a1e;
    --card-bg: #25252a;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --nav-bg: #0d0d0f;
    --nav-text: #e4e4e7;
    --nav-hover-bg: #2d2d32;
    --footer-bg: #0d0d0f;
    --footer-text: #e4e4e7;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --link: #60a5fa;
    --link-hover-bg: #3b82f6;
    --link-hover-text: #fff;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: #2d2d32;
    --input-border: #3f3f46;
}

[data-theme="ocean"] {
    --body-bg: #e8f4fc;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(6, 78, 120, 0.12);
    --nav-bg: #0c4a6e;
    --nav-text: #e0f2fe;
    --nav-hover-bg: #075985;
    --footer-bg: #0c4a6e;
    --footer-text: #e0f2fe;
    --text-primary: #0c4a6e;
    --text-secondary: #0369a1;
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --link: #0284c7;
    --link-hover-bg: #0284c7;
    --link-hover-text: #fff;
    --border: rgba(6, 78, 120, 0.2);
    --input-bg: #fff;
    --input-border: #7dd3fc;
}

[data-theme="forest"] {
    --body-bg: #f0fdf4;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(20, 83, 45, 0.1);
    --nav-bg: #14532d;
    --nav-text: #dcfce7;
    --nav-hover-bg: #166534;
    --footer-bg: #14532d;
    --footer-text: #dcfce7;
    --text-primary: #14532d;
    --text-secondary: #15803d;
    --accent: #16a34a;
    --accent-hover: #15803d;
    --link: #16a34a;
    --link-hover-bg: #16a34a;
    --link-hover-text: #fff;
    --border: rgba(20, 83, 45, 0.2);
    --input-bg: #fff;
    --input-border: #86efac;
}

[data-theme="sunset"] {
    --body-bg: #fff7ed;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(124, 45, 18, 0.12);
    --nav-bg: #9a3412;
    --nav-text: #ffedd5;
    --nav-hover-bg: #c2410c;
    --footer-bg: #9a3412;
    --footer-text: #ffedd5;
    --text-primary: #431407;
    --text-secondary: #9a3412;
    --accent: #ea580c;
    --accent-hover: #c2410c;
    --link: #ea580c;
    --link-hover-bg: #ea580c;
    --link-hover-text: #fff;
    --border: rgba(124, 45, 18, 0.2);
    --input-bg: #fff;
    --input-border: #fdba74;
}

/* 全局基础 */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body { background-color: var(--body-bg); }

/* 手机端适配：导航栏 */
@media (max-width: 768px) {
    .navbar-container {
        flex-wrap: wrap;
        gap: 10px;
    }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }
    .nav-links.is-open {
        display: flex;
    }
    .nav-links a {
        padding: 12px 20px;
        border-radius: 6px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        margin-left: auto;
        background: var(--nav-hover-bg);
        border: none;
        border-radius: 8px;
        color: var(--nav-text);
        cursor: pointer;
        font-size: 1.25rem;
    }
    .nav-toggle:focus {
        outline: 2px solid var(--nav-text);
        outline-offset: 2px;
    }
    .theme-switch-wrap {
        order: -1;
        margin-left: auto;
        margin-right: 8px;
    }
}

@media (min-width: 769px) {
    .nav-toggle { display: none; }
}

/* 电脑端：导航栏单行、不换行 */
@media (min-width: 769px) {
    .navbar-container { flex-wrap: nowrap; }
    .theme-switch-wrap { flex-shrink: 0; }
}

/* 主题切换控件 */
.theme-switch-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.theme-switch-wrap label {
    font-size: 0.75rem;
    color: var(--nav-text);
    opacity: 0.9;
    white-space: nowrap;
}
.theme-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: var(--nav-text);
    font-size: 0.85rem;
    cursor: pointer;
    min-height: 36px;
}
.theme-select:focus {
    outline: 2px solid rgba(255,255,255,0.6);
    outline-offset: 2px;
}
@media (max-width: 480px) {
    .theme-switch-wrap label { display: none; }
    .theme-select { min-width: 90px; }
}
