/* ==========================================================================
   久存网 · 可切换色系
   默认海蓝；绿色 / 橙色 / 紫色 / 粉色只改变强调色与底色，不改变布局。
   ========================================================================== */

:root,
html[data-theme="blue"] {
    --theme-swatch: #2f7cf6;
}

html[data-theme="green"] {
    --blue-25: #f6fcf8;
    --blue-50: #eefaf3;
    --blue-75: #e3f7ec;
    --blue-100: #d5f2e2;
    --blue-200: #b7e7cd;
    --blue-300: #88d7b0;
    --blue-400: #52c18e;
    --blue-500: #2c9e6d;
    --blue-600: #21845a;
    --blue-700: #196a48;
    --cyan-400: #46b8a3;
    --cyan-500: #2d9d88;
    --teal-500: #2b9d83;
    --ink: #12251c;
    --ink-2: #2a4435;
    --muted: #6b8775;
    --muted-2: #91aa9c;
    --line: #e1f0e7;
    --line-strong: #cfe8da;
    --canvas: #f6fcf8;
    --canvas-deep: #edf9f2;
    --theme-swatch: #2c9e6d;
    --shadow-xs: 0 1px 2px rgba(20, 70, 42, 0.04);
    --shadow-sm: 0 4px 14px rgba(26, 92, 58, 0.06);
    --shadow-md: 0 14px 40px rgba(26, 92, 58, 0.09);
    --shadow-lg: 0 28px 70px rgba(26, 92, 58, 0.14);
}

html[data-theme="orange"] {
    --blue-25: #fffaf5;
    --blue-50: #fff4e9;
    --blue-75: #ffecda;
    --blue-100: #ffe2c6;
    --blue-200: #ffd0a2;
    --blue-300: #f7b475;
    --blue-400: #ef9648;
    --blue-500: #df7727;
    --blue-600: #c25e16;
    --blue-700: #9e490e;
    --cyan-400: #d99b42;
    --cyan-500: #c18430;
    --teal-500: #bd8d43;
    --ink: #2a2018;
    --ink-2: #4c3a2a;
    --muted: #8a7462;
    --muted-2: #ad9a87;
    --line: #f3e6d8;
    --line-strong: #ecd7c1;
    --canvas: #fffaf5;
    --canvas-deep: #fff3e6;
    --theme-swatch: #df7727;
    --shadow-xs: 0 1px 2px rgba(95, 58, 20, 0.04);
    --shadow-sm: 0 4px 14px rgba(110, 70, 25, 0.06);
    --shadow-md: 0 14px 40px rgba(110, 70, 25, 0.09);
    --shadow-lg: 0 28px 70px rgba(110, 70, 25, 0.14);
}

html[data-theme="purple"] {
    --blue-25: #faf8ff;
    --blue-50: #f4f0ff;
    --blue-75: #ede7ff;
    --blue-100: #e3d9ff;
    --blue-200: #cdbdff;
    --blue-300: #b19af5;
    --blue-400: #9479e8;
    --blue-500: #7a5cd6;
    --blue-600: #6548bd;
    --blue-700: #52379f;
    --cyan-400: #8b8fe8;
    --cyan-500: #7276d2;
    --teal-500: #7b84c9;
    --ink: #1d1830;
    --ink-2: #3a3158;
    --muted: #776f92;
    --muted-2: #9e96b6;
    --line: #e8e1f6;
    --line-strong: #d9cfee;
    --canvas: #faf8ff;
    --canvas-deep: #f2edff;
    --theme-swatch: #7a5cd6;
    --shadow-xs: 0 1px 2px rgba(57, 38, 100, 0.04);
    --shadow-sm: 0 4px 14px rgba(65, 45, 115, 0.06);
    --shadow-md: 0 14px 40px rgba(65, 45, 115, 0.09);
    --shadow-lg: 0 28px 70px rgba(65, 45, 115, 0.14);
}

html[data-theme="pink"] {
    --blue-25: #fff8fb;
    --blue-50: #fff0f6;
    --blue-75: #ffe8f1;
    --blue-100: #ffdbe9;
    --blue-200: #ffc1d8;
    --blue-300: #f79abb;
    --blue-400: #eb719d;
    --blue-500: #d95386;
    --blue-600: #bc3e6e;
    --blue-700: #9c2e58;
    --cyan-400: #d883ae;
    --cyan-500: #c46a98;
    --teal-500: #c3769a;
    --ink: #2b1720;
    --ink-2: #52303f;
    --muted: #8c6d7a;
    --muted-2: #b096a1;
    --line: #f6e2ea;
    --line-strong: #efd1de;
    --canvas: #fff8fb;
    --canvas-deep: #fff0f6;
    --theme-swatch: #d95386;
    --shadow-xs: 0 1px 2px rgba(105, 35, 63, 0.04);
    --shadow-sm: 0 4px 14px rgba(120, 40, 70, 0.06);
    --shadow-md: 0 14px 40px rgba(120, 40, 70, 0.09);
    --shadow-lg: 0 28px 70px rgba(120, 40, 70, 0.14);
}

/* 主题下仍需要跟随色系的渐变背景 */
.text-gradient {
    background: linear-gradient(100deg, var(--blue-700) 0%, var(--blue-500) 45%, var(--cyan-400) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

.home-hero {
    background:
        radial-gradient(1000px 520px at 8% 10%, var(--blue-75), transparent 60%),
        radial-gradient(900px 500px at 92% 0%, var(--blue-50), transparent 55%),
        linear-gradient(135deg, var(--blue-25) 0%, #ffffff 50%, var(--canvas-deep) 100%) !important;
}

.hero-grid-pattern {
    background-image: radial-gradient(var(--blue-300) 0.7px, transparent 0.7px) !important;
    opacity: 0.28;
}

.hero-orb-1 {
    background: radial-gradient(circle, var(--blue-200), transparent 68%) !important;
    opacity: 0.34;
}

.hero-orb-2 {
    background: radial-gradient(circle, var(--blue-300), transparent 68%) !important;
    opacity: 0.22;
}

.site-footer {
    border-top-color: var(--line) !important;
    background:
        radial-gradient(700px 300px at 88% 0%, var(--blue-75), transparent 65%),
        linear-gradient(180deg, var(--blue-25), #ffffff 62%, var(--canvas-deep)) !important;
}

.footer-glow {
    background: radial-gradient(circle, var(--blue-100), transparent 68%) !important;
}

/* 顶栏风格切换 */
.topbar-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-theme {
    position: relative;
}

.topbar-theme-toggle,
.topbar-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #7b90a6;
    font-size: 11px;
}

.topbar-theme-toggle:hover,
.topbar-lang-toggle:hover {
    color: var(--blue-600);
}

.theme-current-swatch {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--theme-swatch);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line);
}

.theme-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 130;
    display: none;
    width: 156px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.topbar-theme.is-open .theme-menu {
    display: block;
}

.theme-menu button {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 6px 7px;
    border-radius: 5px;
    color: var(--ink-2);
    font-size: 11px;
    text-align: left;
}

.theme-menu button:hover,
.theme-menu button.is-active {
    background: var(--blue-50);
    color: var(--blue-600);
}

.theme-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--dot);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.theme-menu button.is-active::after {
    content: "✓";
    margin-left: auto;
    color: var(--blue-600);
    font-size: 10px;
}

.mobile-theme-row {
    display: none;
}

@media (max-width: 900px) {
    .topbar-theme {
        display: none;
    }

    .mobile-theme-row {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px 0 2px;
    }

    .mobile-theme-row button {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 5px 8px;
        border: 1px solid var(--line);
        border-radius: 5px;
        color: var(--muted);
        background: #fff;
        font-size: 10px;
    }

    .mobile-theme-row button.is-active {
        color: var(--blue-600);
        border-color: var(--blue-200);
        background: var(--blue-50);
    }

    .mobile-theme-row .theme-dot {
        width: 8px;
        height: 8px;
    }
}
