:root {
    --ink: #101111;
    --muted: #5f6664;
    --line: #dce3df;
    --paper: #fbfcfa;
    --surface: #ffffff;
    --green: #0c8f62;
    --coral: #e65b45;
    --gold: #d49b19;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 6vw;
    background: rgba(251, 252, 250, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    font-weight: 800;
    font-size: 20px;
}

.brand span {
    color: var(--green);
}

.main-nav,
.header-actions,
.hero-actions,
.site-footer > div:last-child,
.admin-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--muted);
    font-size: 15px;
}

.solid-btn,
.ghost-btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.solid-btn,
button {
    color: #fff;
    background: var(--ink);
}

.ghost-btn {
    color: var(--ink);
    background: transparent;
}

.large {
    min-height: 50px;
    padding: 0 24px;
}

.hero {
    min-height: 76vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 44vw);
    align-items: center;
    gap: 5vw;
    padding: 56px 6vw 36px;
}

.hero-copy h1 {
    max-width: 720px;
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 1;
    letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
    max-width: 650px;
    color: var(--muted);
    font-size: 19px;
}

.hero-image,
.workflow img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.eyebrow {
    color: var(--coral);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 13px;
}

.metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.metrics span,
.model-card,
.feature-grid article,
.stats-grid article,
.api-key-box,
.table-wrap,
.form-panel,
.auth-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metrics span {
    padding: 12px 14px;
    color: var(--muted);
}

.metrics strong {
    color: var(--green);
}

.band,
.workflow,
.page-wrap,
.auth-wrap,
.install-page {
    padding: 72px 6vw;
}

.section-title,
.page-head {
    max-width: 760px;
    margin-bottom: 30px;
}

h1,
h2,
h3 {
    line-height: 1.18;
    letter-spacing: 0;
}

.section-title h2,
.page-head h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
}

.feature-grid,
.model-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature-grid article,
.model-card,
.stats-grid article,
.api-key-box,
.table-wrap {
    padding: 22px;
}

.workflow,
.two-col {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}

.model-card .badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 8px;
    color: #fff;
    background: var(--green);
    font-size: 13px;
}

.docs pre {
    overflow-x: auto;
    padding: 18px;
    border-radius: 8px;
    color: #f4f7f5;
    background: #161a18;
}

.auth-wrap,
.install-page {
    display: grid;
    place-items: center;
    min-height: 70vh;
}

.auth-panel,
.form-panel {
    width: min(100%, 480px);
    padding: 28px;
}

.form-panel.wide {
    width: min(100%, 880px);
    margin-bottom: 28px;
}

label {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
    color: var(--muted);
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

textarea {
    resize: vertical;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check input {
    width: auto;
    min-height: auto;
}

.api-key-box code {
    display: block;
    overflow-x: auto;
    padding: 14px;
    border-radius: 8px;
    background: #eef5f0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

.admin-tabs {
    margin: 18px 0 26px;
}

.admin-tabs a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.stats-grid article strong {
    display: block;
    color: var(--gold);
    font-size: 36px;
}

.flash,
.notice {
    margin: 16px auto;
    width: min(90vw, 920px);
    padding: 12px 16px;
    border-radius: 8px;
}

.flash.ok,
.notice.ok {
    color: #075b3d;
    background: #e8f6ee;
}

.flash.error,
.notice.error {
    color: #9a1f16;
    background: #ffe8e4;
}

.muted {
    color: var(--muted);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 6vw;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .workflow,
    .two-col {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 36px;
    }

    .feature-grid,
    .model-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
