:root {
    --c-cyan: #22d3ee;
    --c-purple: #a855f7;
    --c-indigo: #6366f1;
    --c-slate: #0f172a;
}

* { box-sizing: border-box; }

body {
    background: #050a14;
    color: #cbd5e1;
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
}

/* ── 中文楷体 ── */
.font-kai { font-family: 'Noto Serif SC', 'KaiTi', 'STKaiti', '楷体', serif; }

/* ══════════════════════════════
   HERO NUMBER  — 6767
══════════════════════════════ */
.hero-num {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: clamp(9rem, 26vw, 22rem);
    line-height: 0.85;
    letter-spacing: -0.04em;
    position: relative;
    display: inline-block;
    /* layered text — base gradient */
    background: linear-gradient(135deg,
        #67e8f9 0%,
        #a78bfa 35%,
        #ec4899 65%,
        #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.hero-num::before {
    content: '6767';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        #22d3ee 0%,
        #818cf8 40%,
        #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(32px);
    opacity: 0.6;
    z-index: -1;
    transform: translate(2px, 4px) scale(1.01);
    animation: glow-shift 4s ease-in-out infinite alternate;
}

.hero-num::after {
    content: '6767';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #67e8f9, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -2;
    transform: scale(1.05);
    animation: glow-shift 6s ease-in-out infinite alternate-reverse;
}

@keyframes glow-shift {
    0%   { opacity: 0.4; transform: translate(2px, 4px) scale(1.01); }
    50%  { opacity: 0.8; transform: translate(-2px, 6px) scale(1.03); }
    100% { opacity: 0.5; transform: translate(4px, 2px) scale(1.01); }
}

.hero-num-wrap {
    position: relative;
    display: inline-block;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.hero-easter-egg {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    color: inherit;
}

.hero-easter-egg:focus-visible {
    outline: 2px solid rgba(34,211,238,0.7);
    outline-offset: 8px;
    border-radius: 18px;
}

/* scan-line shimmer */
.hero-num-wrap::after {
    content: '';
    position: absolute;
    inset: -5% -3%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(103,232,249,0.08) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: shimmer 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%   { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* ── name sub-heading ── */
.name-zh {
    font-family: 'Noto Serif SC', '楷体', serif;
    font-size: clamp(1.4rem, 4vw, 2.4rem);
    letter-spacing: 0.25em;
    background: linear-gradient(90deg, #67e8f9, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.name-en {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: #64748b;
    font-size: clamp(0.7rem, 2vw, 1rem);
    text-transform: uppercase;
}

/* ── grid background ── */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(34,211,238,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34,211,238,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

/* ── card ── */
.card {
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(51,65,85,0.6);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
    border-color: rgba(34,211,238,0.3);
    box-shadow: 0 0 30px rgba(34,211,238,0.06);
}

/* ── terminal block ── */
.terminal {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 14px;
    font-family: 'JetBrains Mono', monospace;
}

/* ── tag pills ── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    background: rgba(30,41,59,0.8);
    border: 1px solid rgba(71,85,105,0.5);
    transition: border-color 0.25s, color 0.25s;
    cursor: default;
}

/* ── repo cards ── */
.repo-card {
    background: rgba(15,23,42,0.6);
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 20px;
    transition: border-color 0.3s, transform 0.3s;
}
.repo-card:hover {
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-2px);
}

/* ── link items ── */
.link-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #0f172a;
    text-decoration: none;
    transition: color 0.2s;
}
.link-item:last-child { border-bottom: none; }

.link-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.code-tab {
    padding: 6px 12px;
    border: 1px solid #1e293b;
    border-radius: 8px;
    color: #64748b;
    background: rgba(15,23,42,0.6);
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.code-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.code-tab.active {
    color: #c4b5fd;
    border-color: rgba(139,92,246,0.55);
    background: rgba(76,29,149,0.28);
}

.code-panel {
    overflow-x: auto;
    white-space: pre;
    border: 1px solid #1e293b;
    border-radius: 12px;
    background: rgba(2,6,23,0.88);
    padding: 16px;
    color: #cbd5e1;
    line-height: 1.7;
    animation: code-panel-in 0.28s ease both;
}

@keyframes code-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar-portrait {
    width: 96px;
    height: 96px;
    object-fit: cover;
    display: block;
    margin: 4px auto 16px;
    border-radius: 50%;
    padding: 3px;
    background:
        linear-gradient(#020617, #020617) padding-box,
        linear-gradient(135deg, #22d3ee, #8b5cf6 48%, #ec4899) border-box;
    border: 2px solid transparent;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.08),
        0 0 0 7px rgba(15,23,42,0.72),
        0 0 30px rgba(34,211,238,0.24),
        0 16px 42px rgba(139,92,246,0.2);
    animation: avatar-in 0.75s ease both, avatar-float 5s ease-in-out infinite;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.avatar-portrait:hover {
    transform: translateY(-2px) scale(1.035);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.14),
        0 0 0 8px rgba(15,23,42,0.76),
        0 0 42px rgba(34,211,238,0.34),
        0 18px 52px rgba(236,72,153,0.22);
}

.api-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 6px;
}

.api-link {
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.api-link:hover {
    transform: translateX(4px);
    border-color: rgba(139,92,246,0.48);
    background: rgba(15,23,42,0.82);
}

.api-terminal {
    animation: terminal-glow 3.8s ease-in-out infinite alternate;
}

@keyframes avatar-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes avatar-float {
    0%, 100% {
        filter: saturate(1);
    }
    50% {
        filter: saturate(1.14);
    }
}

@keyframes terminal-glow {
    from {
        box-shadow: 0 0 0 rgba(139,92,246,0);
    }
    to {
        box-shadow: 0 0 28px rgba(139,92,246,0.08);
    }
}

.launch-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(20,184,166,0.25);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(2,6,23,0.96), rgba(6,78,59,0.28)),
        repeating-linear-gradient(0deg, rgba(45,212,191,0.06) 0 1px, transparent 1px 7px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 44px rgba(0,0,0,0.22);
}

.launch-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(45,212,191,0.08), transparent 36%, rgba(168,85,247,0.07));
    pointer-events: none;
}

.launch-row {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 10px;
}

.launch-row + .launch-row {
    border-top: 1px solid rgba(15,118,110,0.28);
}

.launch-prompt {
    color: #2dd4bf;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
}

.launch-command {
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.4;
}

.copy-command {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(45,212,191,0.26);
    border-radius: 8px;
    background: rgba(15,23,42,0.65);
    color: #5eead4;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.copy-command:hover {
    color: #ccfbf1;
    border-color: rgba(45,212,191,0.55);
    background: rgba(20,184,166,0.14);
}

/* ── section label ── */
.sec-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 6px;
}

/* fade-in on load */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    animation: fadein 0.7s ease forwards;
}
@keyframes fadein {
    to { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.22s; }
.delay-3 { animation-delay: 0.36s; }
.delay-4 { animation-delay: 0.5s; }
.delay-5 { animation-delay: 0.64s; }
.delay-6 { animation-delay: 0.78s; }

/* ══════════════════════════════
   TOC SIDEBAR
══════════════════════════════ */
.toc-rail {
    position: fixed;
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
    z-index: 30;
    width: 196px;
    padding: 16px 14px 18px;
    border: 1px solid rgba(51,65,85,0.65);
    border-radius: 14px;
    background: rgba(2,6,23,0.78);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 44px rgba(0,0,0,0.35);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toc-rail.is-collapsed {
    opacity: 0;
    pointer-events: none;
    transform: translate(-12px, -50%);
}

.toc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(71,85,105,0.5);
}

.toc-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    color: #475569;
}

.toc-close,
.toc-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(51,65,85,0.6);
    background: rgba(15,23,42,0.7);
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.toc-close:hover,
.toc-open:hover {
    color: #67e8f9;
    border-color: rgba(34,211,238,0.55);
    background: rgba(8,47,73,0.6);
}

.toc-list {
    display: grid;
    gap: 4px;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: #94a3b8;
    font-family: 'Noto Serif SC', '楷体', serif;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.toc-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #475569;
    min-width: 20px;
}

.toc-item:hover {
    color: #e2e8f0;
    background: rgba(15,23,42,0.7);
    border-color: rgba(71,85,105,0.5);
    transform: translateX(2px);
}

.toc-item.is-active {
    color: #67e8f9;
    border-color: rgba(34,211,238,0.55);
    background: rgba(8,47,73,0.55);
}

.toc-item.is-active .toc-num {
    color: #c4b5fd;
}

.toc-open {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 31;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
}

.toc-open.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

@media (max-width: 1180px) {
    .toc-rail {
        width: 180px;
        left: 16px;
    }
}

@media (max-width: 980px) {
    /* 切到右侧细长竖排单字导航：仿拼音首字母索引 */
    .toc-rail {
        top: 50%;
        bottom: auto;
        left: auto;
        right: 8px;
        transform: translateY(-50%);
        width: 30px;
        padding: 8px 4px;
        border-radius: 999px;
        background: rgba(2,6,23,0.86);
        box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    }
    .toc-rail.is-collapsed {
        transform: translate(36px, -50%);
    }
    .toc-head {
        display: none;
    }
    .toc-list {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        gap: 2px;
    }
    .toc-item {
        flex-direction: column;
        gap: 0;
        padding: 0;
        width: 22px;
        height: 22px;
        border-radius: 6px;
        font-family: 'KaiTi', 'STKaiti', 'Noto Serif SC', '楷体', serif;
        font-size: 0.92rem;
        letter-spacing: 0;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    /* 隐藏序号 + 隐藏多字标签，仅显示中字单字（来自 data-glyph） */
    .toc-num {
        display: none;
    }
    .toc-label {
        display: none;
    }
    .toc-item::before {
        content: attr(data-glyph);
        line-height: 1;
    }
    .toc-item:hover {
        transform: none;
    }
    .toc-open {
        top: 50%;
        bottom: auto;
        left: auto;
        right: 8px;
        transform: translateY(-50%) translateX(8px);
        width: 30px;
        height: 30px;
        border-radius: 999px;
    }
    .toc-open.is-visible {
        transform: translateY(-50%) translateX(0);
    }
}

/* ══════════════════════════════
   TTS PROXY TERMINAL
══════════════════════════════ */
.tts-terminal {
    border-color: rgba(20,184,166,0.28);
    animation: tts-glow 4s ease-in-out infinite alternate;
}

@keyframes tts-glow {
    from { box-shadow: 0 0 0 rgba(20,184,166,0); }
    to   { box-shadow: 0 0 24px rgba(20,184,166,0.08); }
}

.tts-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(20,184,166,0.3);
    background: rgba(15,23,42,0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ══════════════════════════════
   DYNAMIC REPO CARD
══════════════════════════════ */
.repo-card-dyn {
    display: block;
    background: rgba(15,23,42,0.6);
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    transition: border-color 0.3s, transform 0.3s;
}

.repo-card-dyn:hover {
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-2px);
}

.repo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.repo-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.92rem;
    color: #67e8f9;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-card-dyn:hover .repo-name {
    color: #cffafe;
}

.repo-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #facc15;
    flex-shrink: 0;
}

.repo-desc {
    margin: 4px 0 10px;
    color: #94a3b8;
    font-family: 'Noto Serif SC', '楷体', serif;
    font-size: 0.82rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #475569;
}

.repo-lang {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.repo-lang-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6366f1;
}

.repo-updated {
    margin-left: auto;
    color: #475569;
}

.repo-empty {
    padding: 24px;
    border: 1px dashed rgba(71,85,105,0.5);
    border-radius: 14px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    text-align: center;
}

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

/* ══════════════════════════════
   VISITS CARD + BADGE
══════════════════════════════ */
.visits-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px auto 8px;
    padding: 4px 12px;
    border: 1px solid rgba(51,65,85,0.55);
    border-radius: 999px;
    background: rgba(15,23,42,0.55);
    color: #94a3b8;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    line-height: 1.5;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    transition: border-color 0.25s, color 0.25s;
}

.visits-card:hover {
    border-color: rgba(34,211,238,0.45);
    color: #cbd5e1;
}

.visits-card-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: #475569;
    text-transform: uppercase;
}

.visits-card-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    color: #67e8f9;
}

.visits-card-label {
    font-family: 'KaiTi', 'STKaiti', 'Noto Serif SC', '楷体', serif;
    color: #64748b;
    font-size: 0.74rem;
    letter-spacing: 0.18em;
}

.visits-badge {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 25;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(51,65,85,0.6);
    border-radius: 999px;
    background: rgba(2,6,23,0.78);
    color: #94a3b8;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.35);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.4s, transform 0.4s, border-color 0.25s, color 0.25s;
}

.visits-badge.is-ready {
    opacity: 1;
    transform: translateY(0);
}

.visits-badge:hover {
    border-color: rgba(34,211,238,0.55);
    color: #cbd5e1;
}

.visits-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52,211,153,0.7);
    animation: visits-pulse 2s ease-in-out infinite;
}

@keyframes visits-pulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

.visits-text {
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.62rem;
}

.visits-num {
    color: #67e8f9;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.visits-num-online {
    color: #5eead4;
}

.visits-sep {
    color: #334155;
}

.visits-num.is-bumped {
    animation: visits-bump 0.55s ease;
    color: #5eead4;
}

@keyframes visits-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

@media (max-width: 720px) {
    .visits-badge {
        top: 14px;
        right: 14px;
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

/* ══════════════════════════════
   TOC ACTIVE INDICATOR
══════════════════════════════ */
.toc-rail {
    --toc-active-y: 0px;
}

.toc-list {
    position: relative;
}

.toc-list::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: calc(100% - 8px);
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(34,211,238,0.55);
    background: rgba(8,47,73,0.55);
    transform: translateY(var(--toc-active-y));
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.25s, height 0.2s, width 0.2s;
    pointer-events: none;
    z-index: 0;
}

.toc-list.has-active::before {
    opacity: 1;
}

.toc-item {
    position: relative;
    z-index: 1;
}

/* the static active style stays as the fallback hover/colour, but
   the indicator does the sliding work — so dim the per-item bg */
.toc-item.is-active {
    background: transparent;
    border-color: transparent;
    color: #67e8f9;
}

@media (max-width: 980px) {
    .toc-list::before {
        left: 4px;
        width: 22px;
        height: 22px;
    }
}

/* ══════════════════════════════
   SECTION SLIDE-IN ON NAV
══════════════════════════════ */
@keyframes section-slide-in {
    0%   { opacity: 0; transform: translateX(28px); }
    100% { opacity: 1; transform: translateX(0); }
}

.toc-target-anim {
    animation: section-slide-in 0.5s ease both;
}

/* ══════════════════════════════
   COPY BUTTON ON CODE PANELS
══════════════════════════════ */
.code-panel-wrap {
    position: relative;
}

.code-panel-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(71,85,105,0.6);
    border-radius: 8px;
    background: rgba(15,23,42,0.78);
    color: #94a3b8;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.2s, transform 0.2s, color 0.2s, border-color 0.2s, background 0.2s;
    z-index: 2;
}

.code-panel-wrap:hover .code-panel-copy,
.code-panel-copy:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.code-panel-copy:hover {
    color: #67e8f9;
    border-color: rgba(34,211,238,0.55);
    background: rgba(8,47,73,0.6);
}

.code-panel-copy.is-copied {
    color: #34d399;
    border-color: rgba(52,211,153,0.55);
}

@media (hover: none) {
    .code-panel-copy { opacity: 1; transform: translateY(0); }
}
