/* Manual Page Layout */
.manual-page {
    background: #ffffff;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
}

/* Header */
.manual-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.manual-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.back-button {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-button:hover {
    color: #4f46e5;
}

.manual-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Manual Layout: Sidebar + Content */
.manual-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* Sidebar TOC */
.manual-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 2rem 1rem 2rem 2rem;
    background: #fafafa;
    border-right: 1px solid #e0e0e0;
    position: sticky;
    top: 80px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.manual-toc h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    margin: 0 0 1rem 0;
}

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

.manual-toc li {
    margin: 0.5rem 0;
}

.manual-toc a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 0.9375rem;
}

.manual-toc a:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.manual-toc a.active {
    background: #6366f1;
    color: #ffffff;
    font-weight: 500;
}

/* Main Content */
.manual-content {
    flex: 1;
    padding: 2rem 2rem 2rem 3rem;
    max-width: 900px;
}

/* TOC Toggle (mobile only) */
.toc-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: #6366f1;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 200;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.toc-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #ffffff;
    transition: all 0.3s;
}

/* Manual Sections */
.manual-section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px;
}

.manual-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.manual-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: #1f2937;
}

.manual-section p {
    margin: 1rem 0;
    color: #374151;
}

.manual-section ul, .manual-section ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: #374151;
}

.manual-section li {
    margin: 0.5rem 0;
}

.manual-section code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.manual-section pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Screenshot Figure */
.manual-figure {
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fafafa;
}

.screenshot-slot {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    position: relative;
}

.screenshot-slot img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot-slot.missing::before {
    content: '📷 Screenshot placeholder';
    color: #9ca3af;
    font-size: 1.125rem;
}

.manual-figure figcaption {
    padding: 0.75rem 1rem;
    background: #ffffff;
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

/* Footer */
.manual-footer {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Mobile Responsive (768px breakpoint) */
@media (max-width: 768px) {
    .manual-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 150;
        transition: left 0.3s;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }
    
    .manual-sidebar.open {
        left: 0;
    }
    
    .manual-content {
        padding: 1.5rem 1rem;
        width: 100%;
    }
    
    .toc-toggle {
        display: flex;
    }
    
    .manual-section h2 {
        font-size: 1.5rem;
    }
    
    .screenshot-slot {
        min-height: 200px;
    }
}
