:root {
    --primary: #7a3e1d;
    --primary-dark: #5c2d14;
    --primary-light: #f6ece4;
    --accent: #c8923f;
    --bg: #f5f3f0;
    --surface: #ffffff;
    --text: #2b2420;
    --text-muted: #7b716a;
    --border: #e4ddd6;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #e0a578;
        --primary-dark: #f0c9a6;
        --primary-light: #3a2a20;
        --accent: #d9a24a;
        --bg: #1c1612;
        --surface: #261e19;
        --text: #efe7e0;
        --text-muted: #b3a79e;
        --border: #3b3029;
    }
}

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

html {
    scroll-behavior: smooth;
}

body.site-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

a {
    color: var(--primary);
}

.site-container {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px;
}

/* header */
.site-header {
    background: #5c2d14;
    color: #fff;
}

.site-header-inner {
    max-width: 1000px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.site-nav a {
    padding: 6px 12px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* content */
.site-main {
    flex: 1;
    padding: 32px 0 48px;
}

.doc {
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.doc h1 {
    font-size: 32px;
    line-height: 1.25;
    color: var(--primary);
}

.doc-meta {
    margin: 4px 0 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.doc h2 {
    margin: 32px 0 8px;
    padding-top: 8px;
    font-size: 22px;
    line-height: 1.3;
    border-top: 1px solid var(--border);
}

.doc h3 {
    margin: 18px 0 4px;
    font-size: 17px;
}

.doc p,
.doc ul,
.doc ol {
    margin-bottom: 12px;
}

.doc ul,
.doc ol {
    padding-left: 22px;
}

.doc li {
    margin-bottom: 4px;
}

.doc-toc {
    margin: 20px 0 8px;
    padding: 16px 20px;
    border-radius: 8px;
    background: var(--primary-light);
    font-size: 15px;
}

.doc-toc ol {
    margin: 6px 0 0;
    columns: 2;
}

.doc-toc li {
    break-inside: avoid;
}

/* footer */
.site-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: 14px;
    color: var(--text-muted);
}

.site-footer .site-container {
    max-width: 1000px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

@media (max-width: 600px) {
    .site-main {
        padding: 16px 0 32px;
    }

    .doc {
        padding: 20px 16px;
        border-radius: 8px;
    }

    .doc h1 {
        font-size: 26px;
    }

    .doc-toc ol {
        columns: 1;
    }
}

.doc-callout {
    margin: 8px 0 14px;
    padding: 12px 16px;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    background: var(--primary-light);
    word-break: break-word;
}

.doc-table {
    width: 100%;
    margin: 8px 0 16px;
    border-collapse: collapse;
    font-size: 15px;
}

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

.doc-table th {
    width: 38%;
    background: var(--primary-light);
    font-weight: 600;
}

@media (max-width: 600px) {
    .doc-table th,
    .doc-table td {
        padding: 8px 10px;
    }
}

.doc .steps {
    margin: 10px 0 14px;
    padding: 4px 0 4px 0;
    list-style: none;
    counter-reset: step;
}

.doc .steps li {
    position: relative;
    margin-bottom: 10px;
    padding: 12px 16px 12px 56px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--primary-light);
    counter-increment: step;
}

.doc .steps li::before {
    content: counter(step);
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}
