:root {
    --bg: #f6f8f2;
    --paper: #ffffff;
    --paper-soft: #fbfcf8;
    --ink: #080b08;
    --body: #2a3328;
    --muted: #687365;
    --line: #dfe7da;
    --line-strong: #cbd8c5;
    --green: #55d72e;
    --green-dark: #087a34;
    --green-ink: #05351a;
    --shadow: 0 18px 54px rgba(24, 32, 20, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        linear-gradient(120deg, rgba(85, 215, 46, 0.14), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 74%, #eff5ea 100%);
    color: var(--ink);
    font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: 0.62;
    background-image:
        linear-gradient(#edf3e8 1px, transparent 1px),
        linear-gradient(90deg, #edf3e8 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 88%, transparent);
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    min-height: 74px;
    padding: 0 clamp(18px, 3vw, 46px);
    border-bottom: 1px solid rgba(203, 216, 197, 0.84);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 178px;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 158px;
    height: 48px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 8px 12px rgba(0, 80, 45, 0.1));
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: clamp(18px, 2.5vw, 40px);
}

.main-nav a {
    position: relative;
    padding: 26px 0 23px;
    color: #162015;
    font-size: 15px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a::after {
    position: absolute;
    left: 50%;
    bottom: 20px;
    width: 0;
    height: 4px;
    content: "";
    border-radius: 999px;
    background: var(--green);
    transform: translateX(-50%);
    transition: width 0.18s ease;
}

.main-nav a:hover::after {
    width: 28px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.search-button,
.header-cta {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.search-button {
    width: 42px;
    font-size: 23px;
    line-height: 1;
}

.header-cta {
    gap: 12px;
    padding: 0 10px 0 20px;
    background: #050805;
    color: #fff;
}

.header-cta span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green);
    color: #061006;
    font-weight: 1000;
}

main {
    width: min(1400px, calc(100vw - 52px));
    margin: 0 auto;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green-dark);
    font-family: "Courier New", monospace;
    font-size: 13px;
    font-weight: 1000;
    letter-spacing: 0.12em;
}

.portal-tools h2 {
    font-family: "Arial Black", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.portal-section {
    padding: clamp(22px, 3vw, 34px) 0 56px;
    scroll-margin-top: 104px;
}

.portal-tools {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 440px);
    gap: 20px;
    align-items: end;
    margin-bottom: 12px;
}

.portal-tools h2 {
    margin: 0;
    font-size: clamp(34px, 4.2vw, 56px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.search-field {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(24, 32, 20, 0.06);
}

.search-field span {
    color: var(--green-dark);
    font-size: 22px;
}

.search-field input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
    font-weight: 760;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.category-nav a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--green-ink);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.category-stack {
    display: grid;
    gap: 20px;
}

.category-section {
    scroll-margin-top: 94px;
}

.category-section.is-hidden {
    display: none;
}

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

.category-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
    letter-spacing: 0;
}

.category-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

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

.portal-card {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    min-height: 206px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 252, 248, 0.95)),
        var(--paper);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(24, 32, 20, 0.055);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-card::before {
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    content: "";
    background: linear-gradient(90deg, #55d72e, #087a34 56%, #061006);
}

.portal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(8, 122, 52, 0.34);
    box-shadow: var(--shadow);
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 38px;
    margin: 2px 0 16px;
}

.card-meta b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    color: var(--green-dark);
    font-family: "Courier New", monospace;
    font-size: 14px;
    font-weight: 1000;
    letter-spacing: 0.04em;
}

.card-meta i {
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #087a34;
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 12px;
    font-style: normal;
    font-weight: 1000;
    letter-spacing: 0;
    box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12);
}

.portal-card strong {
    display: block;
    min-height: 48px;
    margin: 0;
    font-family: "Arial Black", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(18px, 1.28vw, 21px);
    line-height: 1.18;
    letter-spacing: -0.035em;
}

.portal-card em {
    display: block;
    min-height: 16px;
    margin: 6px 0 0;
    color: var(--green-dark);
    font-family: "Courier New", monospace;
    font-size: 11px;
    font-style: normal;
    font-weight: 1000;
    letter-spacing: 0.03em;
}

.portal-card p {
    min-height: 44px;
    margin: 9px 0 12px;
    color: #384039;
    font-size: 13px;
    font-weight: 720;
    line-height: 1.5;
}

.card-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 12px;
    align-items: center;
    margin-top: auto;
    color: var(--muted);
    font-family: "Courier New", monospace;
    font-size: 11px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.card-link i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    font-family: inherit;
    font-style: normal;
    font-weight: 1000;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.portal-card:hover .card-link i {
    border-color: var(--green);
    background: var(--green);
}

.portal-card.is-hidden {
    display: none;
}

@media (max-width: 1220px) {
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1020px) {
    .site-header {
        grid-template-columns: auto 1fr;
    }

    .main-nav {
        display: none;
    }

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

@media (max-width: 720px) {
    body::before {
        background-size: 32px 32px;
    }

    .site-header {
        min-height: 64px;
        padding: 0 14px;
    }

    .brand {
        min-width: 132px;
    }

    .brand img {
        width: 122px;
        height: 38px;
    }

    .search-button {
        display: none;
    }

    .header-cta {
        min-height: 38px;
        padding-left: 14px;
        font-size: 12px;
    }

    .header-cta span {
        width: 24px;
        height: 24px;
    }

    main {
        width: min(100% - 28px, 1400px);
    }

    .portal-tools {
        grid-template-columns: 1fr;
    }

    .portal-tools h2 {
        font-size: 38px;
    }

    .category-nav {
        gap: 6px;
        margin-bottom: 14px;
    }

    .category-nav a {
        min-height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }

    .category-stack {
        gap: 18px;
    }

    .category-head {
        margin-bottom: 8px;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .portal-card {
        min-height: 196px;
        padding: 15px;
        border-radius: 17px;
    }

    .card-meta {
        margin-bottom: 14px;
    }

    .portal-card strong {
        min-height: 42px;
        font-size: 19px;
    }

    .portal-card p {
        min-height: 40px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
