:root {
    --page-bg: #f5f7fb;
    --panel-bg: rgba(255, 255, 255, 0.84);
    --panel-border: rgba(255, 255, 255, 0.68);
    --text-primary: #10233f;
    --text-secondary: #5d6b82;
    --brand-primary: #2563eb;
    --brand-secondary: #10b981;
    --fresh-green: #dff8ea;
    --fresh-blue: #e8f0ff;
    --fresh-yellow: #fff6d8;
    --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.10);
    --shadow-card: 0 16px 40px rgba(37, 99, 235, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.15), transparent 24%),
        linear-gradient(180deg, #eef4ff 0%, var(--page-bg) 34%, #eef2f8 100%);
}

a {
    color: inherit;
}

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

.docs-hero {
    padding: 32px 0 20px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
    gap: 24px;
    align-items: stretch;
}

.hero-copy,
.hero-note-card,
.stat-tile,
.docs-intro,
.ad-slot,
.content-container,
#friend-links,
.empty-state,
body > header:not(.docs-hero) {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-soft);
}

.hero-copy {
    position: relative;
    overflow: hidden;
    padding: 42px;
    border-radius: var(--radius-xl);
    text-align: left;
}

.hero-copy::after {
    content: "";
    position: absolute;
    inset: auto -36px -54px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.23), rgba(16, 185, 129, 0));
}

.hero-badge,
.section-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.10);
}

.hero-copy h1,
body > header:not(.docs-hero) h1 {
    position: relative;
    z-index: 1;
    margin: 18px 0 12px;
    font-size: 64px;
    line-height: 1.05;
}

.site-summary {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0;
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.search-shell {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 680px;
    margin-top: 28px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.10);
}

.search-shell input {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    padding: 0 18px;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    font: inherit;
}

.search-shell input::placeholder {
    color: #8a98ab;
}

.search-shell span {
    flex: 0 0 auto;
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
}

.hero-dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.hero-note-card {
    grid-column: 1 / -1;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.hero-note-card p {
    margin: 14px 0 0;
    line-height: 1.8;
    color: var(--text-secondary);
}

.hero-note-card code {
    padding: 2px 6px;
    border-radius: 8px;
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.stat-tile {
    min-height: 144px;
    padding: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.stat-tile::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    right: -24px;
    bottom: -32px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
}

.stat-tile.wide {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), var(--fresh-green));
}

.stat-tile span {
    display: block;
    color: var(--text-secondary);
}

.stat-tile strong {
    display: block;
    margin-top: 12px;
    color: var(--text-primary);
    font-size: 44px;
    line-height: 1;
}

main {
    padding: 8px 0 44px;
}

.docs-intro {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
    align-items: center;
    gap: 24px;
    margin-top: 4px;
    padding: 28px;
    border-radius: var(--radius-lg);
}

.docs-intro h2,
.section-title-row h2,
#friend-links h3 {
    margin: 12px 0 0;
    font-size: 34px;
    line-height: 1.2;
}

.docs-intro p {
    margin: 12px 0 0;
    line-height: 1.8;
    color: var(--text-secondary);
}

.topic-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.topic-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 14px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
    color: #1e3a5f;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.topic-links a:nth-child(3n + 1) {
    background: var(--fresh-green);
}

.topic-links a:nth-child(3n + 2) {
    background: var(--fresh-blue);
}

.topic-links a:nth-child(3n) {
    background: var(--fresh-yellow);
}

.topic-links a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.ad-slot {
    min-height: 96px;
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.header-tabs-container,
.tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.header-tabs-container button,
.tabs-container button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    padding: 0 15px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.tabs-container button {
    border-radius: 14px;
}

.header-tabs-container button small,
.tabs-container button small {
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.10);
    font-size: 12px;
}

.header-tabs-container button:hover,
.tabs-container button:hover,
.header-tabs-container button.active,
.tabs-container button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary), #4f46e5);
    transform: translateY(-2px);
}

.header-tabs-container button:hover small,
.tabs-container button:hover small,
.header-tabs-container button.active small,
.tabs-container button.active small {
    color: #065f46;
    background: #d1fae5;
}

.content-container {
    padding: 28px;
    border-radius: var(--radius-lg);
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 22px;
}

.section-title-row h2 {
    margin-top: 10px;
}

.section-title-row span {
    color: var(--text-secondary);
    font-weight: 700;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 14px;
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    position: relative;
    min-height: 96px;
    height: auto;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.card a {
    display: block;
    height: 100%;
    text-decoration: none;
}

.card-body {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 20px;
    gap: 14px;
    align-items: center;
    min-height: 96px;
    padding: 16px;
}

.card-body img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

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

.card .title {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .description {
    display: -webkit-box;
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-arrow {
    color: var(--brand-secondary);
    font-weight: 800;
}

.ad-card {
    grid-column: 1 / -1;
    min-height: 112px;
    max-height: 150px;
    background: rgba(255, 255, 255, 0.64);
}

.ad-card .ad-slot,
.ad-card .adsbygoogle {
    width: 100%;
    min-height: 96px;
    max-height: 130px;
    margin: 0;
    box-shadow: none;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.empty-state {
    margin: 24px 0;
    padding: 32px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-align: center;
}

.empty-state strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 20px;
}

#friend-links {
    margin-top: 24px;
    padding: 28px;
    border-radius: var(--radius-lg);
}

#friend-links h3 {
    margin: 0 0 18px;
}

#friend-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body > header:not(.docs-hero) {
    width: min(1200px, calc(100% - 32px));
    margin: 32px auto 20px;
    padding: 36px 42px;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

body > header:not(.docs-hero)::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -56px;
    width: 210px;
    height: 210px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.20), rgba(16, 185, 129, 0));
}

.breadcrumb {
    margin: 0 0 12px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--brand-primary);
    text-decoration: none;
}

.topic-section {
    margin-top: 26px;
}

footer {
    position: relative;
    z-index: 1;
}

#footer {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto 40px;
    background: transparent;
}

#footer .footer-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

#footer .footer-ad {
    min-height: 0;
    max-height: 140px;
    overflow: hidden;
}

#footer .footer-ad:empty {
    display: none;
}

#footer .footer-content {
    min-height: 0;
}

@media (max-width: 900px) {
    .hero-grid,
    .docs-intro {
        grid-template-columns: 1fr;
    }

    .hero-copy h1,
    body > header:not(.docs-hero) h1 {
        font-size: 46px;
    }

    .topic-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .docs-hero,
    main,
    body > header:not(.docs-hero) {
        width: min(100% - 24px, 1200px);
    }

    .hero-copy,
    .docs-intro,
    .content-container,
    #friend-links,
    body > header:not(.docs-hero) {
        padding: 22px;
    }

    .hero-copy h1,
    body > header:not(.docs-hero) h1 {
        font-size: 38px;
    }

    .site-summary {
        font-size: 16px;
    }

    .search-shell {
        display: block;
    }

    .search-shell span {
        display: block;
        padding: 10px 6px 2px;
    }

    .hero-dashboard,
    .topic-links {
        grid-template-columns: 1fr;
    }

    .section-title-row {
        display: block;
    }

    .section-title-row span {
        display: block;
        margin-top: 8px;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }
}
