:root {
    --ink: #14211f;
    --muted: #667773;
    --line: #dce6e2;
    --paper: #ffffff;
    --surface: #f3f7f5;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-soft: #d9f3ee;
    --accent: #f97316;
    --danger: #c2413a;
    --shadow: 0 12px 32px rgba(19, 49, 44, 0.08);
    --radius: 14px;
    --shell: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    line-height: 1.6;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

button {
    cursor: pointer;
}

svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.shell {
    width: min(calc(100% - 32px), var(--shell));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(220, 230, 226, 0.9);
    backdrop-filter: blur(16px);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--brand);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 18px;
    line-height: 1.2;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.icon-link,
.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: var(--paper);
    transition: 160ms ease;
}

.icon-link:hover,
.icon-button:hover {
    color: var(--brand);
    border-color: #a8cec7;
    background: #f8fffd;
}

.search-band {
    padding: 38px 0 32px;
    color: #fff;
    background: #123d39;
    border-bottom: 5px solid #e8b44c;
}

.search-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
    align-items: end;
    gap: 42px;
}

.eyebrow {
    margin: 0 0 7px;
    color: #9edbd1;
    font-size: 13px;
    font-weight: 700;
}

.search-copy h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.18;
}

.search-copy p:last-child {
    max-width: 560px;
    margin: 12px 0 0;
    color: #c8ded9;
}

.search-form {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 18px;
    color: var(--muted);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
}

.search-form input {
    min-width: 0;
    flex: 1;
    color: var(--ink);
    border: 0;
    outline: 0;
    background: transparent;
}

.primary-button,
.secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: 11px;
    font-weight: 700;
    transition: 160ms ease;
}

.primary-button {
    color: #fff;
    border: 1px solid var(--brand);
    background: var(--brand);
}

.primary-button:hover {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
}

.secondary-button {
    color: var(--brand-dark);
    border: 1px solid #b8d9d3;
    background: #f7fffd;
}

.secondary-button:hover {
    border-color: #8bc7bd;
    background: #edf9f6;
}

.compact {
    min-height: 38px;
    padding-inline: 14px;
    font-size: 14px;
}

.content-section {
    padding-top: 34px;
    padding-bottom: 48px;
}

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

.section-heading h2 {
    margin: 0;
    font-size: 24px;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 700;
}

.text-link svg {
    width: 16px;
    height: 16px;
}

.filter-bar {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
    padding: 15px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-group::-webkit-scrollbar {
    display: none;
}

.filter-label {
    width: 48px;
    flex: 0 0 48px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-chip {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    color: #50615d;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fbfdfc;
    font-size: 13px;
    white-space: nowrap;
    transition: 150ms ease;
}

.filter-chip:hover,
.filter-chip.active {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

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

.resource-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(19, 49, 44, 0.04);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.resource-card:hover {
    transform: translateY(-3px);
    border-color: #b9d6d1;
    box-shadow: var(--shadow);
}

.resource-card.featured {
    border-color: #efc76b;
}

.featured-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 9px;
    color: #7c4700;
    border: 1px solid #f3d58e;
    border-radius: 999px;
    background: #fff7dc;
    font-size: 12px;
    font-weight: 700;
}

.featured-badge svg {
    width: 14px;
    height: 14px;
}

.resource-cover {
    position: relative;
    height: 148px;
    overflow: hidden;
    background: #e8f3f0;
}

.cover-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 7px;
    color: #4f8179;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.62) 25%, transparent 25%) 0 0 / 18px 18px,
        linear-gradient(315deg, rgba(255, 255, 255, 0.5) 25%, transparent 25%) 0 0 / 18px 18px,
        #dceeea;
}

.cover-fallback svg {
    width: 38px;
    height: 38px;
}

.cover-fallback span {
    font-size: 13px;
    font-weight: 700;
}

.resource-cover img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.resource-cover:not(.has-image) img {
    display: none;
}

.resource-body {
    padding: 16px;
}

.resource-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 24px;
}

.pan-badge,
.category-label {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
}

.pan-badge {
    padding: 0 8px;
}

.pan-blue {
    color: #2459a8;
    background: #e7f0ff;
}

.pan-violet {
    color: #6d3ca3;
    background: #f1e9fb;
}

.pan-orange {
    color: #a44b08;
    background: #fff0df;
}

.pan-cyan {
    color: #087087;
    background: #dcf7fb;
}

.pan-indigo {
    color: #3d4f9e;
    background: #e9ecff;
}

.pan-slate {
    color: #4c5f5b;
    background: #edf2f1;
}

.category-label {
    color: var(--muted);
}

.resource-body h3 {
    margin: 12px 0 7px;
    font-size: 18px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.resource-description {
    min-height: 48px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.tag-list {
    min-height: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 12px;
}

.tag-list span {
    color: #4f6e68;
    font-size: 12px;
}

.resource-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding-top: 12px;
    color: #75847f;
    border-top: 1px dashed var(--line);
    font-size: 12px;
}

.resource-footer span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.resource-footer svg {
    width: 14px;
    height: 14px;
}

.resource-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.resource-actions .primary-button {
    min-width: 0;
    flex: 1;
}

.resource-actions .secondary-button {
    min-width: 0;
    padding-inline: 11px;
    font-size: 13px;
}

.resource-actions .secondary-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    display: grid;
    justify-items: center;
    padding: 72px 24px;
    text-align: center;
    background: var(--paper);
    border: 1px dashed #bad2cd;
    border-radius: var(--radius);
}

.empty-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 18px;
}

.empty-icon svg {
    width: 30px;
    height: 30px;
}

.empty-state h3 {
    margin: 18px 0 5px;
    font-size: 20px;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 30px;
}

.page-button {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-size: 14px;
    font-weight: 700;
}

.page-button.active {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

.page-button.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.site-footer {
    padding: 30px 0;
    color: #71827e;
    border-top: 1px solid var(--line);
    background: #edf3f1;
    text-align: center;
    font-size: 13px;
}

.site-footer p {
    margin: 0;
}

.toast {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 24px;
    max-width: calc(100% - 32px);
    padding: 11px 16px;
    color: #fff;
    background: #173d39;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: 180ms ease;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 960px) {
    .search-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

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

@media (max-width: 640px) {
    .shell {
        width: min(calc(100% - 24px), var(--shell));
    }

    .header-inner {
        min-height: 62px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .search-band {
        padding: 28px 0 24px;
    }

    .search-copy h1 {
        font-size: 29px;
    }

    .search-copy p:last-child {
        font-size: 14px;
    }

    .search-form {
        min-height: 56px;
        padding-left: 14px;
        border-radius: 14px;
    }

    .search-form .primary-button {
        padding-inline: 14px;
    }

    .content-section {
        padding-top: 26px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .filter-bar {
        margin-inline: -12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

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

    .resource-cover {
        height: 158px;
    }

    .resource-description {
        min-height: auto;
    }

    .resource-actions {
        flex-wrap: wrap;
    }

    .resource-actions .primary-button {
        flex-basis: calc(100% - 50px);
    }

    .resource-actions .secondary-button {
        order: 3;
        width: 100%;
        flex-basis: 100%;
    }
}
