@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+SC:wght@300;400;500;700;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════
   DESIGN SYSTEM — 极简高奢
   Inspired by Linear, Vercel, Apple HIG
   ═══════════════════════════════════════ */

/* ===== Light Theme ===== */
:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --bg-sidebar: #ffffff;
    --bg-sidebar-active: rgba(0, 0, 0, 0.03);
    --bg-sidebar-hover: rgba(0, 0, 0, 0.02);
    --bg-code: #18181b;
    --bg-header: rgba(255, 255, 255, 0.85);

    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --text-heading: #09090b;
    --text-code: #e4e4e7;
    --text-tertiary: #d4d4d8;

    --accent-blue: #2563eb;
    --accent-cyan: #0891b2;
    --accent-purple: #7c3aed;
    --accent-pink: #db2777;
    --accent-green: #059669;
    --accent-orange: #d97706;
    --accent-red: #dc2626;

    --gradient-blue: linear-gradient(135deg, #2563eb, #0891b2);
    --gradient-purple: linear-gradient(135deg, #7c3aed, #db2777);
    --gradient-green: linear-gradient(135deg, #059669, #0891b2);
    --gradient-orange: linear-gradient(135deg, #d97706, #dc2626);

    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    --border-sidebar: rgba(0, 0, 0, 0.06);
    --border: rgba(0, 0, 0, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-glow-blue: 0 0 0 3px rgba(37, 99, 235, 0.08);

    --sidebar-width: 260px;
    --header-height: 52px;

    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition-fast: 0.12s ease;
    --transition-normal: 0.2s ease;

    --accent: #2563eb;
    --glass-bg: rgba(255, 255, 255, 0.8);
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-card: rgba(24, 24, 27, 0.8);
    --bg-card-hover: rgba(39, 39, 42, 0.8);
    --bg-sidebar: rgba(9, 9, 11, 0.98);
    --bg-sidebar-active: rgba(255, 255, 255, 0.04);
    --bg-sidebar-hover: rgba(255, 255, 255, 0.02);
    --bg-header: rgba(9, 9, 11, 0.9);

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --text-heading: #ffffff;
    --text-tertiary: #3f3f46;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-sidebar: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-glow-blue: 0 0 0 3px rgba(37, 99, 235, 0.15);

    --accent: #3b82f6;
    --glass-bg: rgba(24, 24, 27, 0.8);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    transition: background .3s, color .3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--accent-blue);
    color: #fff;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 10px;
}

/* ═══════════════════════════
   HEADER — Ultra Minimal
   ═══════════════════════════ */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    transition: background .3s, border-color .3s;
}

.header-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: .3rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    line-height: 0;
}

.menu-toggle:hover {
    color: var(--text-primary);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    user-select: none;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--text-heading);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    flex-shrink: 0;
    transition: transform .2s;
}

.logo:hover .logo-icon {
    transform: scale(1.04);
}

[data-theme="dark"] .logo-icon {
    background: #fff;
    color: #09090b;
}

.logo-name {
    font-size: .95rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -.02em;
}

.logo-divider {
    width: 1px;
    height: 14px;
    background: var(--border-hover);
}

.logo-tagline {
    font-size: .72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .01em;
}

/* Header Center Nav */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-link {
    padding: .35rem .75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-heading);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 1.5px;
    background: var(--text-heading);
    border-radius: 1px;
}

/* Header Right */
.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-sidebar-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: .3rem .7rem;
    gap: .35rem;
    width: 180px;
    transition: all var(--transition-normal);
}

.search-box:focus-within {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow-blue);
    width: 240px;
}

.search-svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: .8rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    font-size: .6rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 0 4px;
    font-family: var(--font-sans);
    line-height: 1.6;
    flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: var(--bg-secondary);
    position: relative;
    flex-shrink: 0;
    transition: border-color .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
}

.theme-toggle::after {
    content: '☀';
    font-size: .7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .theme-toggle::after {
    content: '☽';
}

/* ═══════════════════
   SIDEBAR
   ═══════════════════ */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    padding: .5rem 0;
    transition: transform var(--transition-normal), background .3s;
}

.sidebar::-webkit-scrollbar {
    width: 2px;
}

.sidebar-nav-tree {
    list-style: none;
}

.tree-group {
    margin-bottom: .15rem;
}

.tree-group-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem 1rem;
    cursor: pointer;
    user-select: none;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.tree-group-header:hover {
    color: var(--text-primary);
}

.tree-group-header .tree-arrow {
    font-size: .5rem;
    transition: transform .2s ease;
    flex-shrink: 0;
    margin-left: auto;
    opacity: .4;
}

.tree-group.open .tree-arrow {
    transform: rotate(90deg);
}

.tree-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease-out;
}

.tree-group.open .tree-children {
    max-height: 600px;
    transition: max-height .35s ease-in;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 1rem .4rem 1.5rem;
    font-size: .82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
}

.tree-item:hover {
    color: var(--text-primary);
    background: var(--bg-sidebar-hover);
}

.tree-item.active {
    color: var(--text-heading);
    border-left-color: var(--text-heading);
    font-weight: 600;
    background: var(--bg-sidebar-active);
}

[data-theme="dark"] .tree-item.active {
    border-left-color: #fff;
}

.tree-item .item-icon {
    font-size: .9rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.tree-item .item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item .item-badge {
    font-size: .55rem;
    padding: .1rem .4rem;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: .02em;
}

.item-badge.hot {
    background: rgba(220, 38, 38, .06);
    color: var(--accent-red);
}

.item-badge.new {
    background: rgba(5, 150, 105, .06);
    color: var(--accent-green);
}

/* ═══════════════════
   MAIN CONTENT
   ═══════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-right: 280px;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 2rem 2.5rem 4rem;
}

/* Page Hero */
.page-hero {
    padding: 2.5rem 0 2rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 500;
    padding: .25rem .7rem;
    border-radius: 50px;
    margin-bottom: 1.2rem;
    letter-spacing: .01em;
}

.page-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: .85rem;
    letter-spacing: -.03em;
    color: var(--text-heading);
}

.page-hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--text-heading), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-hero .hero-desc {
    font-size: .95rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -.03em;
}

.stat-label {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: .02em;
}

/* Home Grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
    margin-top: 1.5rem;
}

.home-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: .6rem;
}

.home-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.home-card .hc-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.home-card .hc-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-heading);
}

/* Section Page */
.section-page {
    animation: pageIn .3s ease-out;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-page-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-heading);
    margin-bottom: .3rem;
    letter-spacing: -.02em;
}

.section-page-header h2 .icon {
    font-size: 1.1rem;
}

.section-page-header .subtitle {
    font-size: .85rem;
    color: var(--text-secondary);
}

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 1rem;
    padding: .2rem .4rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    background: none;
    border: none;
    font-family: var(--font-sans);
}

.back-btn:hover {
    color: var(--text-primary);
}

/* ═══════════════════
   KNOWLEDGE CARDS
   ═══════════════════ */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.knowledge-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-normal);
}

.knowledge-card:hover {
    border-color: var(--border-hover);
}

/* Remove gradient top bars for minimal look */
.knowledge-card::before {
    display: none;
}

.card-top {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .75rem;
}

.card-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-sidebar-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.card-title-group h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-heading);
    letter-spacing: -.01em;
}

.card-title-group .card-subtitle {
    font-size: .7rem;
    color: var(--text-muted);
}

.card-tags {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
    margin-bottom: .7rem;
}

.card-tag {
    font-size: .6rem;
    padding: .1rem .4rem;
    border-radius: 3px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
}

/* Removed individual card-tag colors for minimal palette */
.card-tag.blue,
.card-tag.purple,
.card-tag.green,
.card-tag.orange,
.card-tag.red,
.card-tag.cyan,
.card-tag.pink {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.card-desc {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: .75rem;
}

.card-features {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.card-feature {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-feature::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    margin-top: .42rem;
}

/* ═══════════════════
   DETAIL ACCORDION
   ═══════════════════ */
.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: .75rem;
    overflow: hidden;
    transition: border-color var(--transition-normal);
}

.detail-card:hover {
    border-color: var(--border-hover);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1.15rem;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.detail-header:hover {
    background: var(--bg-sidebar-hover);
}

.detail-icon {
    font-size: 1.1rem;
    width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
}

.detail-header h3 {
    font-size: .92rem;
    font-weight: 600;
    flex: 1;
    color: var(--text-heading);
}

.detail-header .tag-row {
    display: flex;
    gap: .2rem;
}

.detail-toggle {
    font-size: .7rem;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
    flex-shrink: 0;
}

.detail-card.open .detail-toggle {
    transform: rotate(180deg);
}

.detail-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease-out;
}

.detail-card.open .detail-body {
    max-height: 3000px;
    transition: max-height .4s ease-in;
}

.detail-content {
    padding: 0 1.15rem 1.15rem 3.4rem;
}

.detail-content p {
    font-size: .84rem;
    color: var(--text-secondary);
    margin-bottom: .7rem;
    line-height: 1.75;
}

.detail-content strong {
    color: var(--text-heading);
    font-weight: 600;
}

.detail-content ul {
    list-style: none;
    margin-bottom: .7rem;
}

.detail-content ul li {
    position: relative;
    padding-left: 1rem;
    font-size: .82rem;
    color: var(--text-secondary);
    margin-bottom: .3rem;
    line-height: 1.65;
}

.detail-content ul li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.2em;
}

/* ═══════════════════
   CODE BLOCK
   ═══════════════════ */
.code-block {
    background: var(--bg-code);
    border: 1px solid rgba(255, 255, 255, .04);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    margin: .7rem 0;
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: attr(data-lang);
    position: absolute;
    top: .4rem;
    right: .6rem;
    font-size: .55rem;
    color: #52525b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: .78rem;
    line-height: 1.75;
    color: var(--text-code);
    white-space: pre;
}

.code-block .keyword {
    color: #c084fc;
}

.code-block .string {
    color: #86efac;
}

.code-block .func {
    color: #93c5fd;
}

.code-block .comment {
    color: #52525b;
}

.code-block .number {
    color: #fdba74;
}

/* ═══════════════════
   TABLES
   ═══════════════════ */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: .82rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--bg-sidebar-active);
    color: var(--text-heading);
    font-weight: 600;
    padding: .65rem .85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: .75rem;
    letter-spacing: .02em;
}

.comparison-table td {
    padding: .55rem .85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:hover td {
    background: var(--bg-sidebar-hover);
}

/* ═══════════════════
   ROADMAP
   ═══════════════════ */
.roadmap {
    position: relative;
    padding-left: 2rem;
}

.roadmap::before {
    content: '';
    position: absolute;
    left: .7rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-hover);
}

.roadmap-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-normal);
}

.roadmap-item:hover {
    border-color: var(--border-hover);
}

.roadmap-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 1.3rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-primary);
    z-index: 2;
}

.roadmap-item:nth-child(1)::before {
    background: var(--accent-blue);
}

.roadmap-item:nth-child(2)::before {
    background: var(--accent-purple);
}

.roadmap-item:nth-child(3)::before {
    background: var(--accent-cyan);
}

.roadmap-item:nth-child(4)::before {
    background: var(--accent-green);
}

.roadmap-item:nth-child(5)::before {
    background: var(--accent-orange);
}

.roadmap-item:nth-child(6)::before {
    background: var(--accent-pink);
}

.roadmap-stage {
    display: inline-block;
    font-size: .6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .1rem .45rem;
    border-radius: 3px;
    margin-bottom: .4rem;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.roadmap-stage.s1 {
    border-color: rgba(37, 99, 235, .2);
    color: var(--accent-blue);
}

.roadmap-stage.s2 {
    border-color: rgba(124, 58, 237, .2);
    color: var(--accent-purple);
}

.roadmap-stage.s3 {
    border-color: rgba(8, 145, 178, .2);
    color: var(--accent-cyan);
}

.roadmap-stage.s4 {
    border-color: rgba(5, 150, 105, .2);
    color: var(--accent-green);
}

.roadmap-stage.s5 {
    border-color: rgba(217, 119, 6, .2);
    color: var(--accent-orange);
}

.roadmap-stage.s6 {
    border-color: rgba(219, 39, 119, .2);
    color: var(--accent-pink);
}

.roadmap-item h4 {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .3rem;
    color: var(--text-heading);
}

.roadmap-item p {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: .5rem;
}

.roadmap-techs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.roadmap-tech {
    font-size: .65rem;
    padding: .1rem .4rem;
    border-radius: 3px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* ═══════════════════
   INFO BANNER
   ═══════════════════ */
.info-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin: 1.25rem 0;
    display: flex;
    align-items: flex-start;
    gap: .7rem;
}

.info-banner .banner-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.info-banner h4 {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: .2rem;
}

.info-banner p {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ═══════════════════
   GLOSSARY
   ═══════════════════ */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .65rem;
}

.glossary-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: .85rem 1rem;
    transition: border-color var(--transition-normal);
}

.glossary-item:hover {
    border-color: var(--border-hover);
}

.glossary-term {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: .1rem;
    font-family: var(--font-mono);
}

.glossary-def {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ═══════════════════
   TIPS & RESOURCES
   ═══════════════════ */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: border-color var(--transition-normal);
}

.tip-card:hover {
    border-color: var(--border-hover);
}

.tip-emoji {
    font-size: 1.8rem;
    margin-bottom: .5rem;
    display: block;
}

.tip-card h4 {
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: .3rem;
    color: var(--text-heading);
}

.tip-card p {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .75rem;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    transition: border-color var(--transition-normal);
    cursor: pointer;
}

.resource-card:hover {
    border-color: var(--border-hover);
}

.resource-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: var(--bg-sidebar-active);
}

.resource-icon.blue-bg,
.resource-icon.green-bg,
.resource-icon.purple-bg,
.resource-icon.orange-bg,
.resource-icon.cyan-bg,
.resource-icon.red-bg,
.resource-icon.pink-bg {
    background: var(--bg-sidebar-active);
}

.resource-info {
    flex: 1;
    min-width: 0;
}

.resource-info h4 {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0;
}

.resource-info p {
    font-size: .68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-arrow {
    color: var(--text-muted);
    font-size: .85rem;
    flex-shrink: 0;
    transition: transform .15s;
}

.resource-card:hover .resource-arrow {
    transform: translateX(2px);
    color: var(--text-primary);
}

.resource-category {
    margin-bottom: 1.5rem;
}

.resource-category-title {
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .6rem;
}

/* ═══════════════════
   SIDEBAR OVERLAY
   ═══════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 850;
}

/* ═══════════════════
   RESPONSIVE — Mobile
   ═══════════════════ */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem .85rem 3rem;
    }

    .right-panel {
        display: none;
    }

    .page-hero h1 {
        font-size: 1.8rem;
    }

    .search-box,
    .header-center,
    .logo-tagline,
    .logo-divider {
        display: none;
    }

    .knowledge-grid,
    .glossary-grid,
    .tips-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .home-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .prev-next-nav {
        flex-direction: column;
        gap: .4rem;
    }

    .pn-btn {
        width: 100%;
        text-align: center;
    }
}

/* ═══════════════════
   CODE COPY BUTTON
   ═══════════════════ */
.copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 10px;
    font-size: .7rem;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 4px;
    color: #a1a1aa;
    cursor: pointer;
    opacity: 0;
    transition: all .15s;
    z-index: 2;
    font-family: var(--font-sans);
}

.code-block:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.copy-btn.copied {
    background: rgba(5, 150, 105, .3);
    color: #86efac;
    border-color: rgba(5, 150, 105, .3);
    opacity: 1;
}

/* ═══════════════════
   BACK TO TOP
   ═══════════════════ */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all .2s;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--border-hover);
    color: var(--text-heading);
}

/* ═══════════════════
   PREV / NEXT NAV
   ═══════════════════ */
.prev-next-nav {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pn-btn {
    padding: .7rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: .82rem;
    transition: all .15s;
    max-width: 48%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-sans);
}

.pn-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-heading);
}

.pn-prev {
    text-align: left;
}

.pn-next {
    text-align: right;
    margin-left: auto;
}

/* ═══════════════════
   FOOTER
   ═══════════════════ */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .72rem;
    border-top: 1px solid var(--border-color);
    letter-spacing: .01em;
}

.site-footer p {
    margin: .2rem 0;
}

/* ═══════════════════
   HERO CTA
   ═══════════════════ */
.hero-cta {
    display: flex;
    gap: .65rem;
    margin-top: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: .6rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    font-family: var(--font-sans);
}

.cta-btn.primary {
    background: var(--text-heading);
    color: var(--bg-primary);
}

.cta-btn.primary:hover {
    opacity: .85;
}

[data-theme="dark"] .cta-btn.primary {
    background: #fff;
    color: #09090b;
}

.cta-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-hover);
}

.cta-btn.secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-heading);
}

/* Hero animations — subtle only */
.page-hero {
    animation: heroIn .4s ease-out;
}

@keyframes heroIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-stats {
    animation: fadeUp .4s ease-out .1s both;
}

.hero-cta {
    animation: fadeUp .4s ease-out .2s both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-section-title {
    font-size: 1.05rem;
    color: var(--text-heading);
    margin: 1.75rem 0 .85rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

/* Section page animation */
.section-page {
    animation: pageIn .3s ease-out;
}

/* ═══════════════════
   RIGHT PANEL
   ═══════════════════ */
.right-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: 260px;
    height: calc(100vh - var(--header-height));
    padding: 1.25rem .85rem 2rem;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
    background: var(--bg-primary);
    z-index: 10;
}

.right-panel::-webkit-scrollbar {
    width: 2px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 2px;
}

.rp-widget {
    margin-bottom: 1.25rem;
}

.rp-widget-title {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* TOC */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid var(--border-color);
}

.toc-item {
    padding: 5px 10px;
    font-size: .78rem;
    color: var(--text-muted);
    cursor: pointer;
    border-left: 1.5px solid transparent;
    margin-left: -1px;
    transition: all .15s;
    line-height: 1.4;
}

.toc-item:hover {
    color: var(--text-primary);
    border-left-color: var(--text-muted);
}

.toc-item.active {
    color: var(--text-heading);
    border-left-color: var(--text-heading);
    font-weight: 600;
}

/* Progress */
.progress-bar-wrap {
    background: var(--border-color);
    border-radius: 100px;
    height: 5px;
    overflow: hidden;
    margin-bottom: .4rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--text-heading);
    border-radius: 100px;
    transition: width .3s ease;
}

[data-theme="dark"] .progress-bar-fill {
    background: #fff;
}

.progress-text {
    font-size: .72rem;
    color: var(--text-muted);
}

.progress-text strong {
    color: var(--text-heading);
}

/* Tip widget */
.tip-widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: .85rem;
}

.tip-widget-card .tip-text {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.tip-widget-card .tip-author {
    font-size: .68rem;
    color: var(--text-muted);
    margin-top: .4rem;
    text-align: right;
}

/* Related */
.related-list {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.related-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: .78rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s;
}

.related-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-heading);
}

.related-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Tablet breakpoint */
@media (max-width: 1100px) {
    .right-panel {
        display: none;
    }

    .main-content {
        margin-right: 0;
    }

    .header-center {
        display: none;
    }
}

/* ═══════════════════
   READING PROGRESS
   ═══════════════════ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--text-heading);
    z-index: 9999;
    transition: width 0.08s linear;
}

[data-theme="dark"] .reading-progress {
    background: rgba(255, 255, 255, .6);
}

/* ═══════════════════
   SEARCH RESULTS
   ═══════════════════ */
.search-wrapper {
    position: relative;
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 300px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}

.search-results.visible {
    display: block;
    animation: searchIn .15s ease-out;
}

@keyframes searchIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .85rem;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid var(--border-color);
    font-size: .8rem;
    color: var(--text-primary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-sidebar-active);
}

.search-result-item .sr-icon {
    font-size: .95rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.search-result-item .sr-title {
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .sr-group {
    font-size: .65rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-result-item mark {
    background: rgba(37, 99, 235, .1);
    color: var(--accent-blue);
    border-radius: 1px;
    padding: 0 1px;
}

.search-no-results {
    padding: 1.25rem .85rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .8rem;
}

.search-no-results .snr-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: .3rem;
}

.search-results::-webkit-scrollbar {
    width: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 2px;
}