/* ═══════════════════════════════════════════════════════════════
   guide.css — Tutorial page styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Layout skeleton ──────────────────────────────────────────────── */

.guide-main {
    display: flex;
    align-items: flex-start;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    padding-top: 100px;
    padding-bottom: 80px;
    gap: 40px;
}

/* ─── Sidebar ────────────────────────────────────────────────── */

.guide-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.guide-sidebar-inner {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px 0;
    box-shadow: var(--shadow-soft);
}

.guide-toc-title {
    font-family: var(--font-tech);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 20px 12px;
}

.guide-toc {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
}

.guide-toc-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    line-height: 1.3;
}

.guide-toc-item i {
    font-size: 12px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
}

.guide-toc-item:hover {
    background: var(--bg-base);
    color: var(--text-primary);
}

.guide-toc-item.active {
    background: rgba(37, 99, 235, 0.07);
    color: var(--accent-primary);
    font-weight: 500;
}

.guide-toc-item.active i {
    color: var(--accent-primary);
}

.guide-sidebar-actions {
    padding: 16px 12px 4px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 12px;
}

.guide-dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-tech);
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.guide-dl-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ─── Content area ─────────────────────────────────────────────────── */

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

/* ─── Page header ──────────────────────────────────────────────────── */

.guide-hero {
    margin-bottom: 52px;
}

.guide-hero h1 {
    font-family: var(--font-tech);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 12px 0 14px;
    color: var(--text-primary);
}

.guide-hero-sub {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.guide-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.guide-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.guide-meta i {
    font-size: 12px;
}

/* ─── Sections ──────────────────────────────────────────────────── */

.guide-section {
    position: relative;
    padding-top: 8px;
}

.guide-section-label {
    font-family: var(--font-tech);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-primary);
    opacity: 0.6;
    margin-bottom: 8px;
}

.guide-section h2 {
    font-family: var(--font-tech);
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
    scroll-margin-top: 110px;
}

.guide-section h3 {
    font-family: var(--font-tech);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 14px;
}

.guide-section p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.guide-section a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 48px 0;
}

/* ─── Callout boxes ─────────────────────────────────────────── */

.guide-callout {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
    margin: 20px 0;
    border-left: 3px solid transparent;
}

.guide-callout > i {
    flex-shrink: 0;
    font-size: 15px;
    margin-top: 2px;
}

.guide-callout div {
    color: var(--text-secondary);
}

.guide-callout strong {
    color: var(--text-primary);
}

.guide-callout-info {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.3);
}

.guide-callout-info > i { color: var(--accent-primary); }

.guide-callout-tip {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
}

.guide-callout-tip > i { color: var(--accent-secondary); }

.guide-callout-warning {
    background: rgba(234, 179, 8, 0.06);
    border-color: rgba(234, 179, 8, 0.4);
}

.guide-callout-warning > i { color: #D97706; }

/* ─── Concept card grid ──────────────────────────────────────── */

.guide-concept-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.guide-concept-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-soft);
}

.guide-concept-card:hover {
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-hover);
}

.guide-concept-card > i {
    font-size: 20px;
    color: var(--accent-primary);
    margin-bottom: 12px;
    display: block;
}

.guide-concept-card h4 {
    font-family: var(--font-tech);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.guide-concept-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

/* ─── Platform tab ──────────────────────────────────────────────── */

.guide-platform-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.guide-pt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-family: var(--font-tech);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-soft);
}

.guide-pt:hover {
    background: var(--bg-base);
    color: var(--text-primary);
    border-color: var(--border-highlight);
}

.guide-pt.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.guide-pt-panel {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.guide-pt-panel.active {
    display: block;
}

/* ─── Step list ──────────────────────────────────────────────── */

.guide-steps-list {
    padding-left: 20px;
    margin: 0 0 16px;
}

.guide-steps-list li {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 10px;
}

.guide-steps-list li strong {
    color: var(--text-primary);
}

/* ─── Visual step flow ──────────────────────────────────────────── */

.guide-steps-visual {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 24px 0;
}

.guide-step-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
}

.guide-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.07);
    border: 1px solid rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-primary);
    font-size: 16px;
}

.guide-step-body h4 {
    font-family: var(--font-tech);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.guide-step-body p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

.guide-step-arrow {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px 0;
}

/* ─── Proxy mode grid ──────────────────────────────────────────── */

.guide-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.guide-mode-card {
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    box-shadow: var(--shadow-soft);
}

.guide-mode-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.guide-mode-header i {
    font-size: 18px;
}

.guide-mode-header h4 {
    font-family: var(--font-tech);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-mode-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

.mode-rule {
    background: rgba(37, 99, 235, 0.03);
    border-color: rgba(37, 99, 235, 0.15);
}

.mode-rule .guide-mode-header i { color: var(--accent-primary); }

.mode-global {
    background: rgba(139, 92, 246, 0.03);
    border-color: rgba(139, 92, 246, 0.15);
}

.mode-global .guide-mode-header i { color: #7C3AED; }

.mode-direct {
    background: var(--bg-surface);
}

.mode-direct .guide-mode-header i { color: var(--text-muted); }

.mode-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mode-tag.recommended {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-secondary);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ─── Comparison cards ──────────────────────────────────────────────── */

.guide-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.guide-compare-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.guide-compare-recommended {
    background: rgba(37, 99, 235, 0.03);
    border-color: rgba(37, 99, 235, 0.2);
}

.guide-compare-title {
    font-family: var(--font-tech);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.guide-compare-card ul {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.guide-compare-card li {
    font-size: 13.5px;
    color: var(--text-secondary);
    padding: 5px 0;
    padding-left: 14px;
    position: relative;
    line-height: 1.5;
}

.guide-compare-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-highlight);
}

.guide-compare-recommended li::before {
    background: var(--accent-primary);
    opacity: 0.5;
}

.text-danger { color: #EF4444; }
.text-success { color: var(--accent-secondary); }

/* ─── Numbered steps ──────────────────────────────────────────────── */

.guide-steps-numbered {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0;
}

.guide-num-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.guide-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-tech);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.guide-num-step strong {
    color: var(--text-primary);
}

/* ─── Code blocks ─────────────────────────────────────────────────── */

.guide-code-block {
    border-radius: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-subtle);
    margin: 20px 0;
    box-shadow: var(--shadow-soft);
}

.guide-code-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-tech);
}

.guide-copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.guide-copy-btn:hover {
    background: var(--bg-base);
    border-color: var(--border-highlight);
    color: var(--text-primary);
}

.guide-code-block pre {
    margin: 0;
    padding: 20px;
    background: #F8FAFC;
    font-family: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: #334155;
    overflow: visible;
    white-space: pre;
    min-width: max-content;
}

.guide-code-block .ky { color: #2563EB; font-weight: 500; }
.guide-code-block .st { color: #D97706; }
.guide-code-block .cm { color: #94A3B8; font-style: italic; }
.guide-code-block .ac { color: #10B981; font-weight: 500; }

/* ─── Inline code ──────────────────────────────────────────────── */

.guide-inline-code {
    background: #F8FAFC;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.guide-inline-code code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace;
    font-size: 13px;
    color: #D97706;
    white-space: pre;
    background: none;
    border: none;
    padding: 0;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace;
    font-size: 12.5px;
    background: var(--bg-base);
    color: #D97706;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--border-subtle);
}

/* ─── Tables ──────────────────────────────────────────────────── */

.guide-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    margin: 16px 0;
    box-shadow: var(--shadow-soft);
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.guide-table thead th {
    background: var(--bg-base);
    padding: 12px 16px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: var(--font-tech);
    font-size: 12px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.guide-table tbody td {
    padding: 11px 16px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
    background: var(--bg-surface);
}

.guide-table tbody tr:hover td {
    background: var(--bg-base);
}

/* ─── FAQ accordion ─────────────────────────────────────────────── */

.guide-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.guide-faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-soft);
}

.guide-faq-item[open] {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow-hover);
}

.guide-faq-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.2s;
}

.guide-faq-item summary::-webkit-details-marker {
    display: none;
}

.guide-faq-item summary:hover {
    color: var(--accent-primary);
}

.guide-faq-icon {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.25s;
}

.guide-faq-item[open] .guide-faq-icon {
    transform: rotate(90deg);
    color: var(--accent-primary);
}

.guide-faq-body {
    padding: 0 18px 18px 40px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.guide-faq-body p { margin: 0 0 10px; }

.guide-faq-body ul {
    padding-left: 18px;
    margin: 0;
}

.guide-faq-body li {
    margin-bottom: 6px;
    line-height: 1.65;
}

/* ─── Bottom nav cards ────────────────────────────────────────────── */

.guide-bottom-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 60px;
}

.guide-nav-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.25s;
    box-shadow: var(--shadow-soft);
}

.guide-nav-card:hover {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.guide-nav-card > i:first-child {
    font-size: 22px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.guide-nav-card div {
    flex: 1;
}

.guide-nav-card strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-primary);
}

.guide-nav-card span {
    font-size: 13px;
    color: var(--text-muted);
}

.guide-nav-arrow {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .guide-sidebar {
        width: 200px;
    }
}

@media (max-width: 860px) {
    .guide-main {
        flex-direction: column;
        gap: 0;
        padding-top: 80px;
        overflow-x: hidden;
    }

    .guide-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-bottom: 32px;
    }

    .guide-sidebar-inner {
        padding: 14px 0;
    }

    .guide-toc {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0 12px;
        gap: 4px;
    }

    .guide-toc-item {
        font-size: 12.5px;
        padding: 6px 10px;
    }

    .guide-toc-title {
        display: none;
    }

    .guide-sidebar-actions {
        display: none;
    }

    .guide-content {
        width: 100%;
    }

    .guide-concept-grid {
        grid-template-columns: 1fr;
    }

    .guide-mode-grid {
        grid-template-columns: 1fr;
    }

    .guide-compare {
        grid-template-columns: 1fr;
    }

    .guide-bottom-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .guide-main {
        padding: 70px 16px 48px;
    }

    .guide-platform-tabs {
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 2px;
    }

    .guide-pt {
        font-size: 12px;
        padding: 7px 12px;
        flex-shrink: 0;
    }

    .guide-hero h1 {
        font-size: 26px;
    }

    .guide-section h2 {
        font-size: 20px;
    }

    .guide-code-block pre {
        font-size: 11.5px;
    }
}

@media (max-width: 480px) {
    .guide-hero-title { font-size: 24px; }
    .guide-section h2 { font-size: 19px; }
    .guide-section h3 { font-size: 16px; }
    .guide-code-block pre { font-size: 12px; padding: 14px 14px; }
    .guide-step-list { gap: 12px; }
    .guide-callout { padding: 14px 16px; font-size: 13.5px; }
    .guide-toc { padding: 0 8px; }
    .guide-toc-item { font-size: 12px; padding: 5px 8px; }
}
@media (max-width: 768px) {

    .guide-main { padding-top: 96px; }
}
