:root {
    /* Default Dark Theme (Rent Site Style) */
    --bg-color: #0c0c0c;
    --surface-color: #1a1a1a;
    --surface-hover: #252525;
    --primary-color: #4dabf7;
    --primary-glow: rgba(77, 171, 247, 0.3);
    --secondary-color: #22c55e;
    --accent-color: #8b5cf6; /* Purple */
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --navbar-height: 72px;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-light {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --primary-color: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.1);
    --text-main: #0f172a;
    --text-dim: #475569;
    --text-muted: #94a3b8;
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.05);
}

body.theme-administrative {
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --primary-color: #4b5563;
    --accent-color: #2563eb;
}

body.theme-warm {
    --bg-color: #1a1614;
    --surface-color: #26211e;
    --primary-color: #f59e0b;
    --accent-color: #ef4444;
}

body.theme-azure {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --primary-color: #0ea5e9;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
nav {
    height: var(--navbar-height);
    background: var(--surface-color);
    color: var(--text-main);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.logo svg {
    width: 32px;
    height: 32px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-trigger {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-base);
}

.search-trigger:hover {
    background: var(--glass-border);
    color: var(--text-main);
}

.hotkey-hint {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

/* Hero */
.hero {
    padding: 160px 0 80px;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-dim);
    max-width: 800px;
    margin: 0 auto 40px;
}

/* Dashboard Grid */
.dashboard-preview {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tile {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition-base);
    cursor: pointer;
}

.tile:hover {
    transform: translateY(-4px);
    background: var(--surface-hover);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tile i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: block;
}

.tile .count {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.tile .label {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Feature Rows */
.feature-row {
    display: flex;
    align-items: center;
    gap: 64px;
    padding: 100px 0;
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-content {
    flex: 1;
}

.feature-image {
    flex: 1.2;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}

.feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary-glow);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 24px;
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-modal {
    background: var(--surface-color);
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    padding: 8px;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px;
    color: var(--text-main);
    font-size: 1.25rem;
    outline: none;
}

/* Utilities */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--glass-border);
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-base);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

/* Tutorial Page Layout */
.tutorial-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    padding: 120px 0 60px;
}

.steps-sidebar {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    height: fit-content;
}

.step-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-base);
}

.step-card:hover {
    background: var(--glass-bg);
}

.step-card.active {
    background: var(--glass-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--glass-border);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition-base);
}

.step-card.active .step-num {
    background: var(--primary-color);
    color: #fff;
}

.step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dim);
}

.step-card.active .step-title {
    color: var(--text-main);
}

.tutorial-content-pane {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tutorial-card {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.tutorial-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #000;
    margin-bottom: 24px;
    max-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tutorial-image-wrapper img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 11.1%;
    transition: width 0.3s ease;
}

/* Footer */
footer {
    padding: 80px 0 40px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

@media (max-width: 900px) {
    .tutorial-layout {
        grid-template-columns: 1fr;
        padding-top: 100px;
    }
    .steps-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .feature-row {
        flex-direction: column;
        text-align: center;
    }
    .feature-row.reverse {
        flex-direction: column;
    }
    .nav-links {
        display: none; /* simple responsive hide for mobile navigation links */
    }
}

/* Theme selector: solid, theme-matched background so the native dropdown
   popup stays readable in every theme (avoids white-on-white). */
#themeSelect {
    background: var(--surface-color) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--glass-border);
}

#themeSelect option {
    background: var(--surface-color);
    color: var(--text-main);
}


/* ===== Additions generated by build.py (doc layout, TOC, language toggle) ===== */

.doc-toc {
    position: sticky;
    top: calc(var(--navbar-height) + 24px);
    max-height: calc(100vh - var(--navbar-height) - 48px);
    overflow-y: auto;
}

/* The TOC is a <nav>, so undo the fixed top-navbar styling it inherits from
   the shared "nav { position: fixed; ... }" rule. */
#tocList {
    position: static;
    height: auto;
    display: block;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    z-index: auto;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    text-decoration: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.92rem;
    transition: var(--transition-base);
}

.toc-link:hover {
    background: var(--glass-bg);
}

.toc-link.active {
    background: var(--glass-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
    color: var(--text-main);
}

.toc-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--glass-border);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    transition: var(--transition-base);
}

.toc-link.active .toc-num {
    background: var(--primary-color);
    color: #fff;
}

.toc-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 40px;
    border-radius: 10px;
    margin-bottom: 4px;
    text-decoration: none;
    border-left: 2px solid var(--glass-border);
    margin-left: 13px;
    border-radius: 0 10px 10px 0;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-base);
}

.toc-sublink:hover {
    background: var(--glass-bg);
}

.toc-sublink.active {
    background: var(--glass-bg);
    border-left-color: var(--primary-color);
    color: var(--text-main);
}

.doc-content h1 {
    font-size: 1.9rem;
    line-height: 1.25;
    margin-bottom: 14px;
}

.doc-content h2 {
    font-size: 1.35rem;
    margin: 36px 0 14px;
    padding-top: 26px;
    border-top: 1px solid var(--glass-border);
    scroll-margin-top: calc(var(--navbar-height) + 24px);
}

.doc-content h3 {
    font-size: 1.1rem;
    margin: 24px 0 10px;
    scroll-margin-top: calc(var(--navbar-height) + 24px);
}

.doc-content p {
    color: var(--text-dim);
    margin-bottom: 14px;
}

.doc-content ul, .doc-content ol {
    color: var(--text-dim);
    padding-left: 24px;
    margin-bottom: 16px;
}

.doc-content li {
    margin-bottom: 8px;
}

.doc-content strong {
    color: var(--text-main);
}

.doc-content a {
    color: var(--primary-color);
}

.doc-content img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.doc-content th,
.doc-content td {
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    text-align: left;
    vertical-align: top;
}

.doc-content th {
    background: var(--glass-bg);
    color: var(--text-main);
    font-weight: 700;
}

.lang-toggle {
    display: flex;
    gap: 4px;
    margin-right: 12px;
}

.lang-link {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid transparent;
    transition: var(--transition-base);
}

.lang-link:hover {
    background: var(--glass-bg);
}

.lang-link.active {
    color: var(--text-main);
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.tutorial-image-wrapper.no-image {
    display: none;
}

/* ===== Image lightbox (click-to-zoom) ===== */

.zoomable {
    cursor: zoom-in;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@media (max-width: 900px) {
    .doc-toc {
        position: static;
        max-height: none;
        order: 0;
    }
}

/* ===== TOC landing page (layout: toc / "create-toc" marker) ===== */

.toc-page {
    padding: 120px 0 64px;
}

.toc-header {
    max-width: 640px;
    margin: 0 auto 48px;
    text-align: center;
}

.toc-header h1 {
    font-size: 2.1rem;
    margin-bottom: 10px;
}

.toc-subtitle {
    color: var(--text-dim);
    margin-bottom: 28px;
}

.toc-search-wrap {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
}

.toc-search-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.toc-search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-base);
}

.toc-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.toc-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border-radius: 18px;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    color: inherit;
    text-decoration: none;
    transition: var(--transition-base);
}

.toc-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 24px var(--primary-glow);
    transform: translateY(-2px);
}

.toc-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-glow);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.toc-card-body {
    flex: 1;
    min-width: 0;
}

.toc-card-body h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.toc-card-body p {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-dim);
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.toc-card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: var(--transition-base);
}

.toc-card:hover .toc-card-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

.toc-empty {
    margin-top: 32px;
    color: var(--text-dim);
    text-align: center;
}
