* {
    box-sizing: border-box;
}

:root {
    --page-bg: #f5f5f7;
    --surface: #ffffff;
    --surface-soft: #fbfbfd;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --border: #d2d2d7;
    --border-soft: #e5e5ea;
    --blue: #0071e3;
    --blue-hover: #0077ed;
    --ink: #111114;
    --copper: #a85f2a;
    --radius: 8px;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(245, 245, 247, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1120px, calc(100% - 32px));
    min-height: 52px;
    margin: 0 auto;
    gap: 18px;
}

.brand {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.nav-links a:hover,
.breadcrumb a:hover,
.text-link:hover {
    color: var(--blue);
}

.page-hero {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 76px 0 54px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--copper);
    font-size: 14px;
    font-weight: 700;
}

h1 {
    max-width: 940px;
    margin: 0 auto;
    color: var(--ink);
    font-size: clamp(40px, 8vw, 76px);
    line-height: 1.05;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.hero-copy {
    max-width: 800px;
    margin: 22px auto 0;
    color: var(--muted);
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.hero-actions,
.cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.button.primary {
    color: #ffffff;
    background: var(--blue);
}

.button.primary:hover {
    background: var(--blue-hover);
    transform: translateY(-1px);
}

.button.secondary {
    color: var(--blue);
    background: transparent;
    border: 1px solid rgba(0, 113, 227, 0.35);
}

.button.secondary:hover {
    border-color: var(--blue);
    background: rgba(0, 113, 227, 0.06);
}

.main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto 70px;
}

.content-band {
    margin: 0 calc(50% - 50vw);
    padding: 64px calc(50vw - 50%);
    background: var(--surface);
}

.content-band.soft {
    background: var(--surface-soft);
}

.section-head {
    max-width: 780px;
    margin-bottom: 28px;
}

.section-head.center {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

h2 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.12;
    font-weight: 700;
    overflow-wrap: anywhere;
}

h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 21px;
    line-height: 1.25;
}

p {
    margin: 0;
}

.section-copy,
.article-copy {
    color: var(--muted);
    font-size: 17px;
    overflow-wrap: anywhere;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid > *,
.article-layout > *,
.article-stack > *,
.link-card,
.info-card,
.formula-card,
.density-card,
.table-wrap {
    min-width: 0;
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.link-card,
.info-card,
.formula-card,
.density-card {
    display: block;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.link-card {
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.link-card:hover {
    border-color: rgba(0, 113, 227, 0.45);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.link-title {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
}

.link-desc {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.formula-card {
    border-color: #c7d7ed;
    background: #f8fbff;
}

.formula-line {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 12px 0;
    padding: 16px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid #d9e7f8;
    border-radius: var(--radius);
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 16px;
    line-height: 1.7;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.formula-list {
    grid-template-columns: 1fr;
}

.formula-note {
    color: var(--muted);
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    background: #f9f9fb;
    font-weight: 700;
}

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

.pill-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pill,
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    color: var(--muted);
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.tag:hover {
    color: var(--blue);
    border-color: rgba(0, 113, 227, 0.38);
}

.breadcrumb {
    width: min(1120px, calc(100% - 32px));
    margin: 22px auto 0;
    color: var(--muted);
    font-size: 13px;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 26px;
    align-items: start;
}

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

.article-section {
    padding: 8px 0;
}

.article-section > .grid {
    margin-top: 18px;
}

.side-panel {
    position: sticky;
    top: 76px;
    display: grid;
    gap: 12px;
}

.side-panel .info-card {
    padding: 18px;
}

.compact-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.compact-list a,
.compact-list span {
    color: var(--muted);
    font-size: 14px;
}

.compact-list a:hover {
    color: var(--blue);
}

.example-box {
    padding: 20px;
    color: var(--text);
    background: #f5f5f7;
    border-radius: var(--radius);
}

.example-box strong {
    color: var(--ink);
}

.cta-band {
    margin-top: 34px;
    padding: 42px 22px;
    text-align: center;
    color: #ffffff;
    background: var(--ink);
    border-radius: var(--radius);
}

.cta-band h2,
.cta-band p {
    color: #ffffff;
}

.cta-band p {
    max-width: 720px;
    margin: 12px auto 0;
    color: rgba(255, 255, 255, 0.78);
}

.site-footer {
    padding: 34px 16px 44px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.site-footer a {
    font-weight: 700;
}

.site-footer a:hover {
    color: var(--blue);
}

.directory-group {
    margin-top: 38px;
}

.directory-group:first-child {
    margin-top: 0;
}

.notice {
    padding: 16px 18px;
    color: var(--muted);
    background: #fffaf2;
    border: 1px solid #f1d9b8;
    border-radius: var(--radius);
    font-size: 14px;
}

@media (max-width: 860px) {
    .nav-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .page-hero {
        padding: 54px 0 38px;
        text-align: left;
    }

    .page-hero,
    .breadcrumb,
    .main {
        width: auto;
        margin-left: 16px;
        margin-right: 16px;
    }

    .main {
        max-width: none;
    }

    .article-layout,
    .article-stack,
    .formula-list,
    .info-card,
    .formula-card {
        width: 100%;
        max-width: 100%;
    }

    .formula-line {
        padding: 12px;
        font-size: 14px;
    }

    h1,
    .hero-copy {
        margin-left: 0;
        margin-right: 0;
    }

    h1 {
        max-width: 330px;
        font-size: clamp(30px, 9vw, 36px);
        line-height: 1.12;
        word-break: break-all;
    }

    h2 {
        max-width: 330px;
        font-size: 28px;
        word-break: break-all;
    }

    .hero-copy {
        max-width: 330px;
        font-size: 16px;
        word-break: break-all;
    }

    .section-head.center,
    .section-copy {
        max-width: 330px;
    }

    .section-head.center {
        margin-left: 0;
        margin-right: 0;
        text-align: left;
    }

    .section-copy {
        word-break: break-all;
    }

    .hero-actions,
    .cta-actions,
    .pill-row {
        justify-content: flex-start;
    }

    .grid.three,
    .grid.four,
    .article-layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
    }

    .content-band {
        padding-top: 46px;
        padding-bottom: 46px;
    }
}
