:root {
    --bg-primary: #F5F0E6;
    --bg-secondary: #EBE5D9;
    --bg-card: #FFFFFF;
    --bg-hover: #EBE5D9;
    --text-primary: #1A0089;
    --text-secondary: #2D1B4E;
    --accent: #B7CF4F;
    --accent-hover: #A3BD3F;
    --text-muted: rgba(26, 0, 137, 0.7);
    --border: rgba(26, 0, 137, 0.15);
    --border-strong: rgba(26, 0, 137, 0.3);
    --shadow: rgba(26, 0, 137, 0.1);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --code-bg: #1A0089;
    --code-text: #F5F0E6;
    --scrollbar-thumb: rgba(26, 0, 137, 0.3);
    --input-bg: #FFFFFF;
    --header-bg: #FFFFFF;
    --toc-active: #B7CF4F;
    
    --font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --sidebar-width: 280px;
    --toc-sidebar-width: 240px;
    --header-height: 60px;
    --content-max-width: 900px;
    
    --transition-fast: 0.15s;
    --transition-normal: 0.25s;
    --transition-slow: 0.4s;
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    color-scheme: light;
}

[data-theme="dark"] {
    --bg-primary: #0D0D12;
    --bg-secondary: #16161D;
    --bg-card: #1E1E26;
    --bg-hover: #252530;
    --text-primary: #E8E4D9;
    --text-secondary: #B8B4A9;
    --accent: #B7CF4F;
    --accent-hover: #C9D96A;
    --text-muted: rgba(232, 228, 217, 0.7);
    --border: rgba(232, 228, 217, 0.15);
    --border-strong: rgba(232, 228, 217, 0.3);
    --shadow: rgba(0, 0, 0, 0.3);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --code-bg: #0A0A0F;
    --code-text: #E8E4D9;
    --scrollbar-thumb: rgba(232, 228, 217, 0.3);
    --input-bg: #1E1E26;
    --header-bg: #1E1E26;
    --toc-active: #B7CF4F;
    
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-normal) var(--ease-in-out), 
                color var(--transition-normal) var(--ease-in-out);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast) var(--ease-out);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible {
    outline: 0.3px solid var(bg-card);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

a:hover {
    color: var(--accent);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition-normal) var(--ease-out);
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--toc-sidebar-width);
    min-height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    transition: background-color var(--transition-normal) var(--ease-in-out),
                border-color var(--transition-normal) var(--ease-in-out);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    margin-right: 12px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-normal) var(--ease-out);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: all var(--transition-normal) var(--ease-out);
}

.search-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.search-hint {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: var(--bg-card);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all var(--transition-normal) var(--ease-out);
    cursor: pointer;
    border: none;
}

.theme-toggle svg {
    fill: currentColor;
    transition: transform var(--transition-normal) var(--ease-spring);
}

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

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

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

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

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 1.5rem 0;
    transition: transform var(--transition-normal) var(--ease-out);
    z-index: 900;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

.nav-list {
    padding: 0 0.75rem;
}

.nav-list > li {
    margin-bottom: 4px;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-normal) var(--ease-out);
}

.nav-list a svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform var(--transition-normal) var(--ease-spring);
}

.nav-list a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-list a:hover svg {
    transform: scale(1.1);
}

.nav-list a.active {
    background: var(--accent);
    color: #0A0047;
    font-weight: 600;
}

.mega-trigger {
    justify-content: start;
}

.mega-trigger::after {
    content: '▸';
    font-size: 0.75rem;
    transition: transform var(--transition-normal) var(--ease-out);
}

.mega-trigger.expanded::after {
    transform: rotate(90deg);
}

.mega-menu {
    display: none;
    padding-left: 12px;
    margin-top: 4px;
}

.mega-menu.expanded {
    display: block;
}

.mega-menu li a {
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 400;
}

.main-content {
    grid-column: 2;
    padding: 2rem 3rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

.content-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.toc-sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: var(--toc-sidebar-width);
    height: calc(100vh - var(--header-height));
    padding: 1.5rem;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    background: var(--bg-card);
    transition: transform var(--transition-normal) var(--ease-out);
}

.toc-container {
    position: sticky;
    top: 1.5rem;
}

.toc-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.toc {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.toc li {
    margin-bottom: 2px;
}

.toc a {
    display: block;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -2px;
    transition: all var(--transition-normal) var(--ease-out);
}

.toc a:hover {
    color: var(--text-primary);
    border-left-color: var(--border-strong);
    padding-left: 16px;
}

.toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

.toc-h2 {
    padding-left: 0;
}

.toc-h3 {
    padding-left: 20px;
    font-size: 0.8rem;
}

.toc-h4 {
    padding-left: 32px;
    font-size: 0.75rem;
}

.markdown-body {
    line-height: 1.7;
    animation: fadeInUp var(--transition-normal) var(--ease-out);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: var(--text-primary);
    scroll-margin-top: calc(var(--header-height) + 20px);
    transition: color var(--transition-fast) var(--ease-out);
}

.markdown-body h1 {
    font-size: 1.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    margin-top: 0;
}

.markdown-body h2 {
    font-size: 1.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.markdown-body h3 {
    font-size: 1.15rem;
}

.markdown-body h4 {
    font-size: 1rem;
}

.markdown-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-body ul {
    list-style: disc;
}

.markdown-body ol {
    list-style: decimal;
}

.markdown-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.markdown-body li::marker {
    color: var(--accent);
}

.markdown-body a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 2px;
    transition: all var(--transition-fast) var(--ease-out);
}

.markdown-body a:hover {
    text-decoration-color: var(--text-primary);
    color: var(--accent);
}

.markdown-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

.mobile-toc-wrapper {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 800;
    overflow: visible;
}

.mobile-toc-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-toc-count {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.75rem;

}

.mobile-toc-arrow {
    transition: transform var(--transition-normal) var(--ease-out);
}

.mobile-toc-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow);
    padding: 1rem;
    z-index: 801;
    pointer-events: auto;
    touch-action: pan-y;
}

.mobile-toc-dropdown.show {
    display: block;
}

.mobile-toc-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mobile-toc-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-toc-dropdown::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.mobile-toc-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-toc-nav a {
    display: block;
    padding: 12px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    min-height: 44px;
    touch-action: manipulation;
    cursor: pointer;
    transition: background-color var(--transition-fast) var(--ease-out), 
                color var(--transition-fast) var(--ease-out),
                padding-left var(--transition-normal) var(--ease-out);
    pointer-events: auto;
}

.mobile-toc-nav a:last-child {
    border-bottom: none;
}

.mobile-toc-nav a:hover,
.mobile-toc-nav a:active {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding-left: 8px;
}

.mobile-toc-nav a.active {
    color: var(--accent);
    font-weight: 600;
}

.mobile-toc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 799;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal) var(--ease-out);
}

.mobile-toc-backdrop.show {
    display: block;
    pointer-events: auto;
    opacity: 1;
}

.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background:rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    transition: opacity var(--transition-normal) var(--ease-out);
}

.search-overlay.show {
    display: flex;
    opacity: 1;
}

.search-modal {
    width: 90%;
    max-width: 600px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideDown var(--transition-normal) var(--ease-out);
    transition: background-color var(--transition-normal) var(--ease-in-out);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: border-color var(--transition-normal) var(--ease-out),
                background-color var(--transition-normal) var(--ease-in-out);
}

.search-input-wrapper:focus-within {
    border-color: var(--accent);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 12px;
    transition: color var(--transition-fast) var(--ease-out);
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--accent);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: var(--text-primary);
    transition: color var(--transition-fast) var(--ease-out);
}

.search-input::placeholder {
    color: var(--text-muted);
    transition: color var(--transition-fast) var(--ease-out);
}

.search-input:focus::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.search-close {
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: 4px;
    transition: all var(--transition-normal) var(--ease-out);
}

.search-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.search-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: border-color var(--transition-normal) var(--ease-out),
                background-color var(--transition-normal) var(--ease-in-out);
}

.search-filter {
    padding: 4px 12px;
    font-size: 0.75rem;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal) var(--ease-out);
}

.search-filter:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.search-filter.active {
    background: var(--accent);
    color: #0A0047;
    font-weight: 600;
    border-color: var(--accent);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    transition: background-color var(--transition-normal) var(--ease-in-out);
}

.search-status {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem;
}

.search-result {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-normal) var(--ease-out);
    border: 1px solid transparent;
}

.search-result:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    transform: translateX(4px);
}

.search-result.active {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition-fast) var(--ease-out);
}

.search-result:hover .search-result-title {
    color: var(--accent);
}

.search-result-category {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--accent);
    color: #0A0047;
    border-radius: 12px;
    font-weight: 600;
    transition: all var(--transition-normal) var(--ease-out);
}

.search-result:hover .search-result-category {
    background: var(--accent-hover);
}

.search-result-snippet {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-fast) var(--ease-out);
}

.search-result:hover .search-result-snippet {
    color: var(--text-secondary);
}

.search-result-snippet mark {
    background: var(--accent);
    color: #0A0047;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
}

.search-category {
    font-weight: 700;
    color: var(--accent);
    padding: 12px 12px 8px;
    margin-top: 8px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}

.search-category:first-child {
    margin-top: 0;
    padding-top: 0;
}

.search-file-group {
    margin: 6px 0 6px 8px;
    padding-left: 8px;
    border-left: 2px solid var(--border);
}

.search-file-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 8px;
    display: block;
}

.search-result-nested {
    padding: 10px 12px;
    border-radius: 6px;
    margin: 4px 0;
    cursor: pointer;
    transition: all var(--transition-normal) var(--ease-out);
    border: 1px solid transparent;
}

.search-result-nested:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    transform: translateX(4px);
}

.search-result-nested .search-result-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.search-result-nested .search-result-snippet {
    font-size: 0.8rem;
}

.search-no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    transition: color var(--transition-normal) var(--ease-out);
}

.search-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
    transition: color var(--transition-normal) var(--ease-out);
}
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.search-section-title:first-child {
    margin-top: 0;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 850;
}

.overlay.show {
    display: block;
}

.footer {
    grid-column: 1 / -1;
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: background-color var(--transition-normal) var(--ease-in-out),
                border-color var(--transition-normal) var(--ease-in-out),
                color var(--transition-normal) var(--ease-in-out);
}

.footer a {
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition-fast) var(--ease-out);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
    .layout {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
    
    .toc-sidebar {
        display: none;
    }
    
    .main-content {
        grid-column: 2;
        padding: 2rem;
    }
}

@media (max-width: 900px) {
    .hamburger {
        display: flex;
    }
    
    .layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        grid-column: 1;
        padding: 1.5rem;
    }
    
    .mobile-toc-wrapper {
        display: block;
    }
}

@media (max-width: 600px) {
    :root {
        --header-height: 56px;
    }
    
    .header {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .search-hint {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .markdown-body h1 {
        font-size: 1.5rem;
    }
    
    .markdown-body h2 {
        font-size: 1.25rem;
    }
    
    .markdown-body {
        font-size: 0.95rem;
    }
    
    .mobile-toc-dropdown {
        width: calc(100vw - 2rem);
        right: -8px;
        max-height: 50vh;
    }
}

.heading-highlight {
    animation: heading-flash 2s ease;
    border-radius: 4px;
}

@keyframes heading-flash {
    0%, 100% { background-color: transparent; }
    10%, 30% { background-color: var(--accent); color: #0A0047; }
    20%, 40% { background-color: transparent; }
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-hover) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-line:last-child {
    width: 60%;
}

.content-skeleton {
    animation: fadeInUp var(--transition-slow) var(--ease-out);
}

.content-skeleton > * {
    animation: fadeInUp var(--transition-slow) var(--ease-out);
    animation-fill-mode: both;
}

.content-skeleton > *:nth-child(1) { animation-delay: 0s; }
.content-skeleton > *:nth-child(2) { animation-delay: 0.05s; }
.content-skeleton > *:nth-child(3) { animation-delay: 0.1s; }
.content-skeleton > *:nth-child(4) { animation-delay: 0.15s; }
.content-skeleton > *:nth-child(5) { animation-delay: 0.2s; }
.content-skeleton > *:nth-child(6) { animation-delay: 0.25s; }
.content-skeleton > *:nth-child(7) { animation-delay: 0.3s; }
.content-skeleton > *:nth-child(8) { animation-delay: 0.35s; }
.content-skeleton > *:nth-child(9) { animation-delay: 0.4s; }
.content-skeleton > *:nth-child(10) { animation-delay: 0.45s; }

.main-content {
    animation: fadeInUp var(--transition-normal) var(--ease-out);
}

.nav-list li {
    animation: fadeInUp var(--transition-normal) var(--ease-out);
    animation-fill-mode: both;
}

.nav-list li:nth-child(1) { animation-delay: 0.02s; }
.nav-list li:nth-child(2) { animation-delay: 0.04s; }
.nav-list li:nth-child(3) { animation-delay: 0.06s; }
.nav-list li:nth-child(4) { animation-delay: 0.08s; }
.nav-list li:nth-child(5) { animation-delay: 0.1s; }
.nav-list li:nth-child(6) { animation-delay: 0.12s; }
.nav-list li:nth-child(7) { animation-delay: 0.14s; }
.nav-list li:nth-child(8) { animation-delay: 0.16s; }
.nav-list li:nth-child(9) { animation-delay: 0.18s; }
.nav-list li:nth-child(10) { animation-delay: 0.2s; }

.toc a {
    animation: fadeInUp var(--transition-normal) var(--ease-out);
    animation-fill-mode: both;
}

.toc a:nth-child(1) { animation-delay: 0.05s; }
.toc a:nth-child(2) { animation-delay: 0.1s; }
.toc a:nth-child(3) { animation-delay: 0.15s; }
.toc a:nth-child(4) { animation-delay: 0.2s; }
.toc a:nth-child(5) { animation-delay: 0.25s; }
.toc a:nth-child(6) { animation-delay: 0.3s; }
.toc a:nth-child(7) { animation-delay: 0.35s; }
.toc a:nth-child(8) { animation-delay: 0.4s; }
.toc a:nth-child(9) { animation-delay: 0.45s; }
.toc a:nth-child(10) { animation-delay: 0.5s; }

[data-theme="dark"] .nav-list a.active {
    color: #0D0D12;
}

[data-theme="dark"] .search-filter.active {
    color: #0D0D12;
}

[data-theme="dark"] .heading-highlight {
    color: #0D0D12;
}
