/**
 * User Guide Styles
 * @version 1.0.0
 */
html {
    scroll-behavior: smooth;
}

        .guide-layout {
            display: flex;
            max-width: 1400px;
            margin: 0 auto;
            padding: 1rem;
            gap: 2rem;
        }

        .guide-sidebar {
            position: sticky;
            top: 100px;
            width: 260px;
            height: fit-content;
            max-height: calc(100vh - 120px);
            overflow-y: auto;
            flex-shrink: 0;
            padding: 1rem;
            background: var(--color-surface, #f5f5f3);
            border-radius: 8px;
            border: 1px solid var(--color-border, #ddd);
        }

        .guide-sidebar h2 {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--color-text-secondary, #666);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--color-border, #ddd);
        }

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

        .toc-list li {
            margin: 0.25rem 0;
        }

        .toc-list a {
            display: block;
            padding: 0.4rem 0.5rem;
            text-decoration: none;
            color: var(--color-text, #333);
            border-radius: 4px;
            font-size: 0.875rem;
            transition: background-color 0.2s, color 0.2s;
        }

        .toc-list a:hover {
            background-color: var(--color-primary-light, #e8f4f8);
        }

        .toc-list a.active {
            background-color: var(--color-primary-light, #e8f4f8);
            color: var(--color-primary, #4a90e2);
            font-weight: 600;
        }

        .toc-list .toc-h3 {
            padding-left: 1.25rem;
            font-size: 0.8125rem;
        }

        .guide-content {
            flex: 1;
            min-width: 0;
            max-width: 800px;
        }

        /* Markdown body styles */
        .markdown-body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            line-height: 1.6;
            color: var(--color-text, #333);
        }

        .markdown-body h1 {
            font-size: 2.25rem;
            font-weight: 700;
            margin: 2rem 0 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--color-border, #ddd);
        }

        .markdown-body h2 {
            font-size: 1.75rem;
            font-weight: 600;
            margin: 2rem 0 1rem;
            padding-top: 1rem;
        }

        .markdown-body h3 {
            font-size: 1.375rem;
            font-weight: 600;
            margin: 1.5rem 0 0.75rem;
        }

        .markdown-body h4 {
            font-size: 1.125rem;
            font-weight: 600;
            margin: 1.25rem 0 0.5rem;
        }

        .markdown-body p {
            margin: 1rem 0;
        }

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

        .markdown-body li {
            margin: 0.5rem 0;
        }

        .markdown-body li > p {
            margin: 0.25rem 0;
        }

        .markdown-body code {
            background: var(--color-code-bg, #f5f5f5);
            padding: 0.2rem 0.4rem;
            border-radius: 3px;
            font-family: 'Courier New', monospace;
            font-size: 0.9em;
        }

        .markdown-body pre {
            background: var(--color-code-bg, #f5f5f5);
            padding: 1rem;
            border-radius: 6px;
            overflow-x: auto;
            margin: 1rem 0;
        }

        .markdown-body pre code {
            background: none;
            padding: 0;
            font-size: 0.875rem;
            line-height: 1.5;
        }

        .markdown-body blockquote {
            border-left: 4px solid var(--color-primary, #4a90e2);
            margin: 1rem 0;
            padding-left: 1rem;
            color: var(--color-text-secondary, #666);
        }

        .markdown-body table {
            border-collapse: collapse;
            width: 100%;
            margin: 1rem 0;
            font-size: 0.9375rem;
        }

        .markdown-body th,
        .markdown-body td {
            border: 1px solid var(--color-border, #ddd);
            padding: 0.625rem 0.75rem;
            text-align: left;
        }

        .markdown-body th {
            background: var(--color-surface, #f5f5f3);
            font-weight: 600;
        }

        .markdown-body a {
            color: var(--color-primary, #4a90e2);
            text-decoration: none;
        }

        .markdown-body a:hover {
            text-decoration: underline;
        }

        .markdown-body hr {
            border: none;
            border-top: 1px solid var(--color-border, #ddd);
            margin: 2rem 0;
        }

        /* Anchor links for headings */
        .markdown-body h1,
        .markdown-body h2,
        .markdown-body h3,
        .markdown-body h4 {
            position: relative;
            scroll-margin-top: 100px;
        }

        .anchor-link {
            color: var(--color-text-secondary, #999);
            text-decoration: none;
            opacity: 0;
            transition: opacity 0.2s;
            margin-right: 0.25rem;
        }

        .markdown-body h1:hover .anchor-link,
        .markdown-body h2:hover .anchor-link,
        .markdown-body h3:hover .anchor-link,
        .markdown-body h4:hover .anchor-link {
            opacity: 1;
        }

        .anchor-link:hover {
            color: var(--color-primary, #4a90e2);
        }

        /* Loading and error states */
        .loading {
            text-align: center;
            padding: 3rem;
            color: var(--color-text-secondary, #666);
        }

        .error-state {
            text-align: center;
            padding: 3rem;
        }

        .error-state h2 {
            color: var(--color-error, #e74c3c);
            margin-bottom: 1rem;
        }

        /* Mobile responsive */
        @media (max-width: 900px) {
            .guide-sidebar {
                display: none;
            }

            .guide-content {
                max-width: 100%;
            }

            .guide-layout {
                padding: 0.5rem;
            }
        }

        /* Mobile TOC toggle */
        .mobile-toc-toggle {
            display: none;
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--color-primary, #4a90e2);
            color: white;
            border: none;
            font-size: 1.25rem;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            z-index: 100;
        }

        @media (max-width: 900px) {
            .mobile-toc-toggle {
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .guide-sidebar.mobile-open {
                display: block;
                position: fixed;
                bottom: 70px;
                right: 1rem;
                left: auto;
                top: auto;
                width: 280px;
                max-height: 60vh;
                z-index: 99;
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
            }
        }

        /* Header help button styling (for consistency) */
        .help-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--color-surface, #f5f5f3);
            color: var(--color-text-secondary, #666);
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 600;
            border: 1px solid var(--color-border, #ddd);
            transition: background-color 0.2s, color 0.2s;
            margin-left: auto;
        }

        .help-link:hover {
            background: var(--color-primary, #4a90e2);
            color: white;
            border-color: var(--color-primary, #4a90e2);
        }
