/* 首页：内容优先的技术手册索引。全部规则限制在首页命名空间内。 */

body:has(.home-index-page),
.home-index-page {
    --home-canvas: #f5f7fa;
    --home-surface: #ffffff;
    --home-ink: #162033;
    --home-muted: #66758b;
    --home-line: #dce3ec;
    --home-blue: #2563eb;
    margin-top: 0;
    background: var(--home-surface);
    color: var(--home-ink);
}

body:has(.home-index-page) {
    background: var(--home-surface) !important;
}

body:has(.home-index-page) #headNav {
    background: var(--home-surface) !important;
    box-shadow: 0 1px 0 var(--home-line) !important;
}

body:has(.home-index-page) #headNav .brand-logo a,
body:has(.home-index-page) #headNav .nav-menu a,
body:has(.home-index-page) #headNav .sidenav-trigger,
body:has(.home-index-page) #headNav .dropdown-trigger,
body:has(.home-index-page) #headNav .right a {
    color: var(--home-ink) !important;
}

body:has(.home-index-page) #headNav .logo-img {
    filter: brightness(0) saturate(100%);
    opacity: .88;
}

body:has(.home-index-page) footer.page-footer {
    background: #162033 !important;
}

body:has(.home-index-page) footer.page-footer,
body:has(.home-index-page) footer.page-footer a {
    color: #d9e1ec !important;
}

.home-intro {
    border-bottom: 1px solid var(--home-line);
    background: var(--home-canvas);
}

.home-intro__inner {
    max-width: 1180px;
    padding-top: 64px;
    padding-bottom: 58px;
}

.home-eyebrow {
    margin: 0 0 12px;
    color: var(--home-blue);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.home-intro h1 {
    max-width: 780px;
    margin: 0;
    color: var(--home-ink);
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", system-ui, sans-serif;
    font-size: clamp(34px, 5.2vw, 66px);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1.14;
}

.home-intro__description {
    margin: 20px 0 28px;
    color: var(--home-muted);
    font-size: 16px;
}

.home-filter-search {
    display: flex;
    align-items: center;
    width: min(680px, 100%);
    height: 52px;
    padding: 0 15px;
    border: 1px solid var(--home-line);
    background: var(--home-surface);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.home-filter-search:focus-within {
    border-color: var(--home-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.home-filter-search > i {
    margin-right: 12px;
    color: var(--home-muted);
}

.home-filter-search input[type="search"] {
    flex: 1;
    width: auto;
    height: 50px;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--home-ink);
    font-size: 15px;
}

.home-filter-search button {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--home-muted);
    cursor: pointer;
}

.home-filter-search kbd {
    min-width: 24px;
    margin-left: 8px;
    padding: 2px 6px;
    border: 1px solid var(--home-line);
    border-radius: 3px;
    background: var(--home-canvas);
    color: var(--home-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    text-align: center;
}

.home-library {
    max-width: 1180px;
    padding-top: 46px;
    padding-bottom: 64px;
}

.home-library__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
}

.home-library__header h2 {
    margin: 0;
    color: var(--home-ink);
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -.025em;
}

.home-topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.home-topic-filters button {
    padding: 6px 0;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--home-muted);
    font: inherit;
    cursor: pointer;
}

.home-topic-filters button:hover,
.home-topic-filters button:focus-visible,
.home-topic-filters button[aria-pressed="true"] {
    border-bottom-color: var(--home-blue);
    color: var(--home-ink);
}

.home-result-status {
    min-height: 20px;
    margin: -8px 0 8px;
    color: var(--home-muted);
    font-size: 12px;
}

.home-lead-post {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 24px;
    padding: 28px 0;
    border-top: 2px solid var(--home-ink);
    border-bottom: 1px solid var(--home-line);
}

.home-lead-post[hidden],
.home-list-post[hidden] {
    display: none !important;
}

.home-lead-post__date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--home-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
}

.home-lead-post__date strong {
    color: var(--home-ink);
    font-size: 34px;
    font-weight: 500;
    line-height: 1;
}

.home-lead-post__date span {
    margin-top: 6px;
    font-size: 11px;
}

.home-topic-label {
    color: var(--home-blue);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
}

.home-lead-post h2 {
    margin: 6px 0 8px;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 750;
    letter-spacing: -.03em;
    line-height: 1.25;
}

.home-lead-post h2 a,
.home-list-post h3 a,
.home-search-post h3 a {
    color: var(--home-ink);
}

.home-lead-post h2 a:hover,
.home-list-post h3 a:hover,
.home-search-post h3 a:hover {
    color: var(--home-blue);
}

.home-lead-post__content > p {
    display: -webkit-box;
    max-width: 780px;
    margin: 0;
    overflow: hidden;
    color: var(--home-muted);
    font-size: 15px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-lead-post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
    color: var(--home-muted);
    font-size: 12px;
}

.home-lead-post__meta a {
    color: var(--home-muted);
}

.home-post-open {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--home-line);
    color: var(--home-muted);
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
}

.home-post-open:hover,
.home-post-open:focus-visible {
    border-color: var(--home-blue);
    color: var(--home-blue);
    transform: translateX(2px);
}

.home-post-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
}

.home-list-post {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 18px;
    min-height: 174px;
    padding: 25px 0 20px;
    border-bottom: 1px solid var(--home-line);
}

.home-list-post > time,
.home-search-post > time {
    padding-top: 2px;
    color: var(--home-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
}

.home-list-post h3,
.home-search-post h3 {
    margin: 6px 0 7px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.4;
}

.home-list-post__content > p,
.home-search-post p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--home-muted);
    font-size: 14px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-list-post__tags {
    display: flex;
    gap: 12px;
    height: 20px;
    margin-top: 9px;
    overflow: hidden;
}

.home-list-post__tags a {
    color: var(--home-muted);
    font-size: 11px;
}

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

.home-search-posts {
    border-top: 2px solid var(--home-ink);
}

.home-search-post {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 22px;
    padding: 22px 0;
    border-bottom: 1px solid var(--home-line);
}

.home-search-post h3 {
    margin-top: 4px;
}

.home-empty-posts {
    padding: 60px 0;
    border-top: 2px solid var(--home-ink);
    color: var(--home-muted);
    text-align: center;
}

.home-index-page [hidden] {
    display: none !important;
}

.home-index-page a:focus-visible,
.home-index-page button:focus-visible,
.home-index-page input:focus-visible {
    outline: 2px solid var(--home-blue);
    outline-offset: 3px;
}

@media only screen and (max-width: 760px) {
    .home-intro__inner {
        padding: 38px 18px 36px;
    }

    .home-intro h1 {
        font-size: clamp(32px, 10vw, 46px);
    }

    .home-intro__description {
        margin-top: 16px;
    }

    .home-library {
        padding: 34px 18px 48px;
    }

    .home-library__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .home-topic-filters {
        gap: 16px;
    }

    .home-lead-post {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 15px;
        padding: 22px 0;
    }

    .home-lead-post__date strong {
        font-size: 27px;
    }

    .home-post-open {
        display: none;
    }

    .home-lead-post h2 {
        font-size: 24px;
    }

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

    .home-list-post {
        min-height: 0;
    }

    .home-search-post {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 14px;
    }

    .home-filter-search kbd {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-filter-search,
    .home-post-open {
        transition: none;
    }
}

body.dark:has(.home-index-page),
body.dark .home-index-page,
body.DarkMode:has(.home-index-page),
body.DarkMode .home-index-page {
    --home-canvas: #111722;
    --home-surface: #161d29;
    --home-ink: #eef3fb;
    --home-muted: #9aa8ba;
    --home-line: #2a3547;
    --home-blue: #73a3ff;
}

body.dark:has(.home-index-page) #headNav .logo-img,
body.DarkMode:has(.home-index-page) #headNav .logo-img {
    filter: none;
}
