:root {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-soft: #fff7ed;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --code-bg: #ffffff;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* ── Top bar ── */
.topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    max-width: 1180px;
    margin: 0 auto;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fb923c, #f97316);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.brand-text h1 { font-size: 16px; font-weight: 700; }
.brand-text p { font-size: 12px; color: var(--text-muted); }

.docs-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: #cbd5e1; }

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
}
.status-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

.version-badge {
    background: var(--success-soft);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ── Welcome page ── */
.welcome-hero {
    text-align: center;
    padding: 72px 24px 48px;
    max-width: 760px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.welcome-hero h2 {
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.15;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.welcome-hero h2 span { color: var(--primary); }

.welcome-hero > p {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
}

.hero-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 16px;
    box-shadow: var(--shadow);
}

.hero-stat strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.hero-stat span { font-size: 13px; color: var(--text-muted); }

.features-section {
    padding: 48px 24px 80px;
    max-width: 960px;
    margin: 0 auto;
}

.features-section h3 {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.features-section > p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.feature-icon.orange { background: #fff7ed; }
.feature-icon.blue { background: #eff6ff; }
.feature-icon.green { background: #f0fdf4; }
.feature-icon.purple { background: #faf5ff; }
.feature-icon.red { background: #fef2f2; }
.feature-icon.cyan { background: #ecfeff; }

.feature-card h4 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ── Docs layout ── */
.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    padding: 32px 24px 64px;
    max-width: 1180px;
    margin: 0 auto;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 88px;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.docs-content { min-width: 0; }

.openapi-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.page-header p { color: var(--text-muted); font-size: 15px; }

.section { margin-bottom: 40px; scroll-margin-top: 96px; }
.section > h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.section h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--text-muted); }
.section p { color: var(--text-muted); margin-bottom: 12px; font-size: 14px; }

.section-note {
    margin-bottom: 16px;
}

.examples-section .card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

.badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.info-card, .card, .endpoint-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.info-card strong {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.base-url-box {
    background: var(--primary-soft);
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
}

.base-url-box code {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
    background: none;
    padding: 0;
}

.endpoint-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.endpoint-tag {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.endpoint-tag.get { background: #dcfce7; color: #166534; }
.endpoint-tag.post { background: #dbeafe; color: #1e40af; }

code {
    font-family: 'JetBrains Mono', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #c2410c;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
    margin-top: 8px;
}

pre code {
    background: none;
    padding: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.7;
}

/* ── Code windows ── */
.code-window {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    background: #ffffff;
    position: relative;
}

.code-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.code-window-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.code-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.code-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ef4444; }
.code-dots span:nth-child(2) { background: #eab308; }
.code-dots span:nth-child(3) { background: #22c55e; }

.code-lang {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    font-family: 'JetBrains Mono', monospace;
}

.code-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.code-copy-btn .copy-icon {
    flex-shrink: 0;
    pointer-events: none;
}

.code-copy-btn .copy-label {
    pointer-events: none;
}

.code-copy-source {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    left: -9999px;
}

.code-copy-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.code-copy-btn.copied {
    background: #dcfce7;
    color: #166534;
}

.code-copy-btn.failed {
    background: #fee2e2;
    color: #991b1b;
}

.code-copy-btn .copy-icon {
    flex-shrink: 0;
}

.code-window-body {
    padding: 14px 16px;
    overflow-x: auto;
    background: #ffffff;
}

.code-window-body code {
    background: none;
    padding: 0;
    color: #374151;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre;
    display: block;
    font-family: 'JetBrains Mono', monospace;
}

.tok-key { color: #7c3aed; font-weight: 500; }
.tok-str { color: #059669; }
.tok-num { color: #2563eb; }
.tok-bool { color: #d97706; }
.tok-null { color: #64748b; }
.tok-cmd { color: #dc2626; font-weight: 600; }
.tok-url { color: #2563eb; }
.tok-path { color: #0f766e; }
.tok-param { color: #7c3aed; font-weight: 500; }
.tok-val { color: #059669; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 12px;
}

th, td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc;
}

.method {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}
.method.get { background: #dcfce7; color: #166534; }

.endpoint-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.alert-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    color: #92400e;
    margin: 12px 0;
}

.mini-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.mini-feature {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: white;
}

@media (max-width: 768px) {
    .docs-layout { grid-template-columns: 1fr; }
    .sidebar-card { position: static; }
    .hero-stats { grid-template-columns: 1fr; }
    .mini-features { grid-template-columns: 1fr; }
    .topbar-inner { flex-wrap: wrap; gap: 12px; }
}
