.guide-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.guide-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.guide-section h2 {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.guide-section h4 {
    font-size: 0.95rem;
    margin: 16px 0 10px 0;
    color: var(--text);
}

.guide-section p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.guide-section ol, .guide-section ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.guide-section li {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.guide-section li strong {
    color: var(--text);
}

.guide-ordered-list {
    counter-reset: step;
    list-style: none;
    padding-left: 0 !important;
}

.guide-ordered-list li {
    counter-increment: step;
    padding: 8px 12px 8px 40px;
    position: relative;
    border-left: 2px solid var(--border);
    margin-bottom: 2px;
}

.guide-ordered-list li::before {
    content: counter(step);
    position: absolute;
    left: 8px;
    top: 8px;
    width: 22px;
    height: 22px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Code blocks */
.code-block {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    overflow-x: auto;
    white-space: pre;
    color: var(--text);
    margin: 8px 0 16px 0;
}

/* Diagram */
.guide-diagram {
    margin: 16px 0;
}

.guide-diagram .code-block {
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Tips */
.guide-tip {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    margin: 12px 0;
    line-height: 1.6;
    border-left: 3px solid;
}

.tip-info {
    background: var(--blue-bg);
    border-color: var(--blue);
    color: var(--text);
}

.tip-warning {
    background: var(--orange-bg);
    border-color: var(--orange);
    color: var(--text);
}

.tip-danger {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--text);
}

.guide-tip strong {
    display: inline;
}

/* Tables */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 16px 0;
    font-size: 0.82rem;
}

.guide-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.guide-table td {
    padding: 6px 12px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.guide-table td code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--accent);
}

.guide-table-compact td, .guide-table-compact th {
    padding: 4px 10px;
    font-size: 0.78rem;
}

/* Best practices grid */
.bp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.bp-card {
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid;
}

.bp-must {
    background: var(--green-bg);
    border-color: rgba(61, 214, 140, 0.3);
}

.bp-avoid {
    background: var(--red-bg);
    border-color: rgba(245, 85, 93, 0.3);
}

.bp-card h4 {
    margin: 0 0 10px 0 !important;
    font-size: 0.9rem !important;
}

.bp-must h4 { color: var(--green); }
.bp-avoid h4 { color: var(--red); }

.bp-card ul {
    padding-left: 16px;
}

.bp-card li {
    font-size: 0.8rem !important;
    margin-bottom: 6px !important;
}

/* Mistakes grid */
.mistake-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.mistake-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.mistake-card h4 {
    font-size: 0.85rem !important;
    margin: 0 0 10px 0 !important;
}

.mistake-wrong, .mistake-right {
    border-radius: var(--radius-sm);
    margin: 6px 0;
    overflow: hidden;
}

.mistake-wrong {
    border-left: 3px solid var(--red);
}

.mistake-right {
    border-left: 3px solid var(--green);
}

.mistake-wrong pre, .mistake-right pre {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.5;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    margin: 0;
    white-space: pre;
    overflow-x: auto;
}

/* Example block */
.guide-example {
    margin: 16px 0;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.guide-example h4 {
    margin: 0 0 8px 0 !important;
    color: var(--accent) !important;
    font-size: 0.85rem !important;
}

.guide-example .code-block {
    margin-bottom: 0;
}

/* Template tabs */
.template-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.template-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.1s;
}

.template-tab:hover { color: var(--text); }

.template-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.template-content {
    display: none;
    padding-top: 12px;
}

.template-content.active {
    display: block;
}

/* Sidebar guide sub-links */
.guide-sb-link.active {
    background: var(--accent-bg) !important;
    color: var(--accent) !important;
}

/* Responsive */
@media (max-width: 900px) {
    .bp-grid, .mistake-grid {
        grid-template-columns: 1fr;
    }
}
