/* ===== 墨水倾泻主题切换 =====
   快照层：克隆当前页面（旧主题外观）盖在真实页面上，然后用波浪 clip-path
   从下往上把它冲走，露出已切换好的新主题。 */

.ink-snap {
    position: fixed;
    inset: 0;
    z-index: 9990;
    overflow: hidden;
    pointer-events: none;
    will-change: clip-path;
}

.ink-snap__inner {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
}

/* ---- 冻结旧主题的变量（:root 与 :root.dark 的合集） ---- */

.ink-snap.snap-light {
    --color-primary: #0969da;
    --color-primary-dark: #0550ae;
    --color-text: #333;
    --color-text-light: #666;
    --color-link: #0969da;
    --color-link-hover: #0550ae;
    --color-border: #e5e5e5;
    --color-bg: #f5f5f5;
    --color-bg-white: #fff;
    --color-bg-code: #f8f8f8;
    --color-header-bg: #0f1011;

    --bg-deep: #f6f8fa;
    --bg-panel: #0f1011;
    --bg-surface: #ffffff;
    --bg-elevated: #f6f8fa;
    --text-primary: #1f2328;
    --text-secondary: #32383f;
    --text-tertiary: #656d76;
    --text-muted: #6f7780;
    --accent-brand: #5e6ad2;
    --accent-interactive: #4c56c8;
    --accent-hover: #3b45b5;
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-default: rgba(0, 0, 0, 0.10);
    --border-strong: rgba(0, 0, 0, 0.16);
    --card-bg: #ffffff;
    --card-bg-hover: #f6f8fa;

    --c-bg: #f6f8fa;
    --c-panel: #ffffff;
    --c-panel-2: #f6f8fa;
    --c-panel-3: #eaeef2;
    --c-border: #d0d7de;
    --c-border-2: #d8dee4;
    --c-text: #1f2328;
    --c-text-2: #32383f;
    --c-text-strong: #1f2328;
    --c-dim: #57606a;
    --c-accent: #1a7f37;
    --c-accent-2: #1a7f37;
    --c-warn: #9a6700;
    --c-bad: #cf222e;
    --c-link: #0969da;
    --c-overlay: rgba(255, 255, 255, 0.88);

    --cs-h1-bg: #eaf2fa; --cs-h1-fg: #214a73; --cs-h1-bd: #c3d9ef;
    --cs-h2-bg: #eafaf5; --cs-h2-fg: #217358; --cs-h2-bd: #c3efe0;
    --cs-h3-bg: #faf6ea; --cs-h3-fg: #735e21; --cs-h3-bd: #efe4c3;
    --cs-h4-bg: #faeeea; --cs-h4-fg: #733621; --cs-h4-bd: #efcec3;
    --cs-h5-bg: #f6eafa; --cs-h5-fg: #5e2173; --cs-h5-bd: #e4c3ef;
    --cs-h6-bg: #eaf8fa; --cs-h6-fg: #216573; --cs-h6-bd: #c3e8ef;
    --cs-h7-bg: #faeaf0; --cs-h7-fg: #73213c; --cs-h7-bd: #efc3d1;
    --cs-h8-bg: #f1faea; --cs-h8-fg: #437321; --cs-h8-bd: #d5efc3;

    color: var(--color-text);
}

.ink-snap.snap-dark {
    --color-text: #e6edf3;
    --color-text-light: #8b949e;
    --color-bg: #0d1117;
    --color-bg-white: #161b22;
    --color-bg-code: #161b22;
    --color-border: #30363d;
    --color-header-bg: #010409;
    --color-primary: #58a6ff;
    --color-primary-dark: #79c0ff;
    --color-link: #58a6ff;
    --color-link-hover: #79c0ff;

    --bg-deep: #08090a;
    --bg-panel: #0f1011;
    --bg-surface: #191a1b;
    --bg-elevated: #23252a;
    --text-primary: #f7f8f8;
    --text-secondary: #d0d6e0;
    --text-tertiary: #8a8f98;
    --text-muted: #62666d;
    --accent-brand: #5e6ad2;
    --accent-interactive: #7170ff;
    --accent-hover: #828fff;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-bg-hover: rgba(255, 255, 255, 0.04);

    --c-bg: #08090a;
    --c-panel: #0d1117;
    --c-panel-2: #161b22;
    --c-panel-3: #21262d;
    --c-border: #30363d;
    --c-border-2: #3d444d;
    --c-text: #e6edf3;
    --c-text-2: #c9d1d9;
    --c-text-strong: #f0f6fc;
    --c-dim: #8b949e;
    --c-accent: #39d353;
    --c-accent-2: #3fb950;
    --c-warn: #d29922;
    --c-bad: #f85149;
    --c-link: #58a6ff;
    --c-overlay: rgba(13, 17, 23, 0.88);

    --cs-h1-bg: #1d2e3e; --cs-h1-fg: #adc7e1; --cs-h1-bd: #2e4a66;
    --cs-h2-bg: #1d3e33; --cs-h2-fg: #ade1d0; --cs-h2-bd: #2e6653;
    --cs-h3-bg: #3e361d; --cs-h3-fg: #e1d4ad; --cs-h3-bd: #66582e;
    --cs-h4-bg: #3e261d; --cs-h4-fg: #e1baad; --cs-h4-bd: #663c2e;
    --cs-h5-bg: #361d3e; --cs-h5-fg: #d4ade1; --cs-h5-bd: #582e66;
    --cs-h6-bg: #1d393e; --cs-h6-fg: #add8e1; --cs-h6-bd: #2e5d66;
    --cs-h7-bg: #3e1d28; --cs-h7-fg: #e1adbe; --cs-h7-bd: #662e41;
    --cs-h8-bg: #2b3e1d; --cs-h8-fg: #c3e1ad; --cs-h8-bd: #45662e;

    color: var(--color-text);
}

/* ---- 液体层 ---- */

.ink-svg {
    position: fixed;
    inset: 0;
    z-index: 9991;
    pointer-events: none;
    overflow: visible;
}

/* ---- 开关的滑块反馈 ---- */

.nav-dark-toggle.is-switching .icon-sun,
.nav-dark-toggle.is-switching .icon-moon {
    animation: inkIconSlide 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes inkIconSlide {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    45% { transform: translateY(9px) rotate(70deg) scale(0.72); opacity: 0; }
    55% { transform: translateY(-9px) rotate(-70deg) scale(0.72); opacity: 0; }
    100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
}
