:root {
    --bg: #f4efe6;
    --bg-ink: #101010;
    --panel: #fbf7f0;
    --panel-strong: #fffdfa;
    --line: rgba(16, 16, 16, 0.12);
    --line-strong: rgba(16, 16, 16, 0.22);
    --text: #111111;
    --muted: #655d52;
    --accent: #d94f2b;
    --accent-soft: rgba(217, 79, 43, 0.12);
    --accent-2: #1e5749;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow: 0 20px 50px rgba(45, 31, 12, 0.08);
    --container: 1320px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        linear-gradient(90deg, rgba(16, 16, 16, 0.02) 1px, transparent 1px),
        linear-gradient(var(--bg) 0%, #efe5d7 100%);
    background-size: 120px 120px, auto;
}

a {
    color: inherit;
}

.layout {
    width: min(100%, var(--container));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    padding: 18px;
}

.rail {
    position: sticky;
    top: 18px;
    align-self: start;
    display: grid;
    gap: 16px;
}

.rail-card,
.content-card,
.manifesto,
.stage,
.detail-card,
.footer-card {
    border: 1px solid var(--line);
    background: rgba(255, 252, 246, 0.72);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
}

.rail-card,
.detail-card,
.footer-card {
    border-radius: var(--radius-lg);
}

.rail-card {
    padding: 18px;
}

.brand {
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: var(--bg-ink);
    color: #fff;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.brand-title {
    margin: 14px 0 0;
    font-family: "Iowan Old Style", "Songti SC", serif;
    font-size: 1.45rem;
    line-height: 1.05;
}

.brand-subtitle,
.meta,
.copy,
.note,
label {
    color: var(--muted);
}

.brand-subtitle {
    margin: 8px 0 0;
    line-height: 1.65;
    font-size: 0.92rem;
}

.stack {
    display: grid;
    gap: 10px;
}

.nav-link,
.version-link,
.action-link,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    text-decoration: none;
    font-size: 0.94rem;
    background: var(--panel-strong);
}

.nav-link {
    justify-content: flex-start;
}

.version-link.current {
    background: var(--bg-ink);
    border-color: var(--bg-ink);
    color: #fff;
}

.content {
    display: grid;
    gap: 22px;
}

.manifesto {
    border-radius: 36px;
    overflow: hidden;
}

.manifesto-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 220px;
}

.manifesto-main {
    padding: 30px 34px 34px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
}

.manifesto-title,
.section-title,
.stage-title,
.result-title {
    margin: 0;
    font-family: "Iowan Old Style", "Songti SC", serif;
    font-weight: 700;
}

.manifesto-title {
    margin-top: 18px;
    font-size: clamp(3rem, 7vw, 6.2rem);
    line-height: 0.88;
    letter-spacing: -0.04em;
    max-width: 9ch;
}

.manifesto-copy {
    max-width: 42rem;
    margin: 20px 0 0;
    line-height: 1.8;
    color: var(--muted);
}

.hero-actions,
.headline-strip,
.detail-actions,
.field-grid,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-link,
button {
    background: var(--bg-ink);
    color: #fff;
    border-color: var(--bg-ink);
    cursor: pointer;
}

.action-link.alt {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.hero-actions {
    margin-top: 28px;
}

.manifesto-side {
    padding: 24px 20px;
    background: var(--bg-ink);
    color: #fff;
    display: grid;
    align-content: space-between;
    gap: 16px;
}

.big-number {
    font-size: clamp(4rem, 8vw, 7rem);
    line-height: 0.9;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.side-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.side-list li {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
}

.headline-strip {
    justify-content: space-between;
    padding: 0 6px;
    font-size: 0.86rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
}

.content-card {
    border-radius: var(--radius-xl);
    padding: 26px;
}

.card-kicker {
    color: var(--accent-2);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.section-title {
    margin-top: 8px;
    font-size: 2rem;
}

.function-list {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.function-link {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-strong);
    text-decoration: none;
}

.function-index {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 800;
}

.function-title {
    margin: 0;
    font-size: 1.18rem;
}

.api-stack {
    display: grid;
    gap: 18px;
}

.api-block {
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.api-block:first-child {
    padding-top: 0;
    border-top: none;
}

pre {
    margin: 10px 0 0;
    padding: 16px;
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: #161616;
    color: #f5efe6;
}

code,
pre,
textarea,
select {
    font-family: "SFMono-Regular", Consolas, monospace;
}

.stage {
    border-radius: 34px;
    padding: 18px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
}

.detail-card {
    padding: 20px;
    background: #111;
    color: #fff;
}

.detail-card .note,
.detail-card label {
    color: rgba(255, 255, 255, 0.66);
}

.stage-title {
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 0.9;
}

.detail-actions {
    margin-top: 18px;
}

.stage-main {
    display: grid;
    gap: 16px;
}

.workspace-panel,
.result-panel {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel-strong);
    padding: 22px;
}

.field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.field-grid {
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 16px;
}

.field-grid > div:first-child {
    flex: 1 1 260px;
}

.field-grid > div:last-child {
    flex: 0 0 220px;
}

textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--text);
    padding: 15px 16px;
    outline: none;
}

textarea {
    min-height: 320px;
    resize: vertical;
    line-height: 1.7;
}

.result-panel:empty {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    border: 1px solid var(--line);
    background: #fff;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    line-height: 1.75;
}

th {
    background: #f1e7d7;
}

tr:last-child td {
    border-bottom: none;
}

.footer-card {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.footer-links a {
    text-decoration: none;
    color: var(--accent);
}

@media (max-width: 1100px) {
    .layout,
    .manifesto-grid,
    .feature-grid,
    .stage {
        grid-template-columns: 1fr;
    }

    .rail {
        position: static;
    }
}

@media (max-width: 720px) {
    .layout {
        padding: 12px;
        gap: 16px;
    }

    .manifesto-main,
    .content-card,
    .detail-card,
    .workspace-panel,
    .result-panel,
    .footer-card {
        padding: 18px;
    }

    .field-grid,
    .footer-card {
        flex-direction: column;
    }

    .field-grid > div:last-child,
    .nav-link,
    .version-link,
    .action-link,
    button {
        width: 100%;
    }
}
