:root {
    color-scheme: dark;
    --bg: #0c1018;
    --surface: #121b26;
    --surface-alt: #161f2d;
    --text: #e8eef8;
    --muted: #9bb5d9;
    --accent: #58a6ff;
    --accent-2: #ffa657;
    --border: rgba(255,255,255,0.08);
    --shadow: rgba(0, 0, 0, 0.35);
    --code-bg: rgba(32, 38, 50, 0.95);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(88, 166, 255, 0.14), transparent 22%),
                radial-gradient(circle at bottom left, rgba(255,166,87,0.12), transparent 18%),
                var(--bg);
    color: var(--text);
    line-height: 1.7;
}
.page {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}
header {
    grid-column: 1 / -1;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border);
    background: rgba(20, 28, 40, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 80px var(--shadow);
}
header h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3.2rem);
    letter-spacing: -0.03em;
}
header p {
    margin: 0.75rem 0 0;
    color: var(--muted);
    max-width: 860px;
}
.site-search {
    position: relative;
    margin-top: 1rem;
    max-width: 640px;
}
.site-search input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15, 22, 35, 0.96);
    color: var(--text);
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.site-search input:focus {
    outline: 2px solid rgba(88,166,255,0.45);
    border-color: var(--accent);
}
.search-results {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 30;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    background: rgba(8, 12, 18, 0.98);
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    overflow: hidden;
}
.search-results[hidden] { display: none; }
.search-result {
    display: block;
    padding: 0.9rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.search-result:hover {
    background: rgba(88,166,255,0.12);
}
.search-result strong { display: block; margin-bottom: 0.15rem; }
.search-result small { color: var(--muted); display: block; }
.search-empty {
    padding: 0.9rem 1rem;
    color: var(--muted);
}
nav.sidebar {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    padding: 1.3rem;
    border: 1px solid var(--border);
    background: rgba(15, 22, 35, 0.9);
    border-radius: 24px;
    min-height: fit-content;
    backdrop-filter: blur(14px);
}
nav.sidebar h2 {
    margin-top: 0;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
}
nav.sidebar ol {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}
nav.sidebar a {
    display: block;
    margin: 0.45rem 0;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}
nav.sidebar a:hover {
    color: var(--accent-2);
}
main {
    padding: 1.3rem 1.6rem;
    border: 1px solid var(--border);
    background: rgba(14, 19, 28, 0.95);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}
section + section {
    margin-top: 2rem;
}
h2 {
    margin-top: 0;
    font-size: 1.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0.3rem;
}
h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}
p, ul, ol, dl {
    margin: 0 0 1rem 0;
}
ul, ol {
    padding-left: 1.2rem;
}
li {
    margin-bottom: 0.6rem;
}
.notice {
    border-left: 4px solid var(--accent);
    padding: 1rem 1rem 1rem 1rem;
    background: rgba(88,166,255,0.08);
    color: var(--text);
    margin: 1rem 0;
    border-radius: 14px;
}
.notice.warning {
    border-color: #ff7a72;
    background: rgba(255,122,114,0.12);
}
.notice code {
    color: inherit;
    word-break: break-word;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}
.section-card {
    display: block;
    padding: 1.3rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.section-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: rgba(88,166,255,0.12);
}
.section-card h3 {
    margin-top: 0;
    margin-bottom: 0.6rem;
}
.section-card p {
    margin: 0;
    color: var(--muted);
}
.table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(20, 28, 40, 0.9);
}
table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
}
th, td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: left;
}
th {
    color: var(--accent);
    background: rgba(255,255,255,0.03);
}
code, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
pre {
    margin: 1rem 0;
    padding: 1rem;
    overflow-x: auto;
    background: var(--code-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
}
pre code {
    color: #e3f6ff;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(88,166,255,0.12);
    color: var(--accent);
    font-size: 0.9rem;
}
.builder {
    margin: 1.5rem 0;
    padding: 1.1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.builder-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.builder-label {
    font-weight: 700;
    color: var(--text);
}
.builder-select {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15, 22, 35, 0.94);
    color: var(--text);
    font-size: 1rem;
    min-width: 220px;
}
.copy-code {
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #061325;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.copy-code:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
}
.builder-preview {
    margin-top: 0.9rem;
}
.builder-notes {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--muted);
    line-height: 1.6;
}
.section-highlight {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255,166,87,0.08);
    border: 1px solid rgba(255,166,87,0.12);
}
@media(max-width: 980px) {
    .page { grid-template-columns: 1fr; }
    nav.sidebar { position: relative; top: 0; }
}
@media(max-width: 700px) {
    header, nav.sidebar, main { padding: 1rem; }
    .page { padding: 1rem; }
}
