:root {
    color-scheme: light;
    --paper: #f3f4ef;
    --white: #fff;
    --ink: #181c19;
    --text: #2f3932;
    --muted: #526057;
    --line: #d9dfd5;
    --accent: #e6fa70;
    --focus: #315614;
    --radius: 14px;
    --mono: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
    --sans: 'Aptos', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    font: 1rem/1.6 var(--sans);
    background: radial-gradient(ellipse at 85% -6%, #e5e9d7 0%, transparent 37rem), var(--paper);
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, figure { margin: 0; }
.shell { width: min(100% - 3rem, 79rem); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { z-index: 10; position: absolute; top: .5rem; left: .5rem; padding: .5rem 1rem; background: var(--accent); }

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-layout { display: grid; grid-template-columns: 1fr minmax(14rem, 27rem) 1fr; gap: 1.25rem; align-items: center; padding-block: .82rem; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: .55rem; font: 700 1.06rem/1 var(--mono); letter-spacing: -.06em; text-decoration: none; white-space: nowrap; }
.brand svg { flex: none; }
.brand-labs { color: #4a6451; }
.search { display: flex; min-width: 0; padding-left: .85rem; min-height: 2.68rem; border: 1px solid var(--line); border-radius: 8px; background: #f5f7f3; }
.search input { width: 100%; min-width: 0; border: 0; color: var(--ink); background: transparent; }
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { outline-offset: -3px; }
.search button { display: grid; flex: 0 0 2.7rem; place-items: center; border: 0; border-radius: 0 7px 7px 0; background: transparent; color: var(--ink); }
.search button:hover { background: #e8ede2; }
.member-nav { display: flex; justify-self: end; align-items: center; gap: .75rem; white-space: nowrap; }
.member-nav > a { text-decoration: none; }
.member-nav > a:not(.header-button) { padding: .3rem 0; }
.member-nav > a:not(.header-button):hover { text-decoration: underline; }
.header-button, .button { display: inline-flex; min-height: 2.35rem; align-items: center; justify-content: center; gap: .55rem; border: 1px solid var(--ink); border-radius: 8px; padding: .35rem .85rem; background: var(--ink); color: var(--white); font-weight: 650; text-decoration: none; }
.header-button:hover { background: #34423a; }
.button { min-height: 2.7rem; padding-inline: 1rem; border-color: #b9cb54; background: var(--accent); color: var(--ink); }
.button:hover { background: #d9ed58; }

.home-layout { padding-block: 1.7rem 3.8rem; }
.hero { position: relative; isolation: isolate; display: grid; min-height: 10rem; align-items: center; overflow: hidden; color: #fff; border: 1px solid #28392b; border-radius: var(--radius); background: linear-gradient(109deg, #151d18 17%, #21362b 70%, #374b28); }
.hero-copy { z-index: 1; padding: 1.45rem clamp(1rem, 4vw, 3rem); }
.eyebrow { font: 700 .72rem/1.5 var(--mono); letter-spacing: .1em; }
.hero-kicker { color: #e0eccd; }
.beacon { display: inline-block; width: .55em; height: .55em; margin-right: .25em; vertical-align: .1em; background: var(--accent); box-shadow: 0 0 0 2px currentColor; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.75rem); letter-spacing: -.06em; line-height: 1.14; margin-block: .3rem; }
.hero h1 span { color: var(--accent); }
.hero p { color: #e0e9db; }
.hero-grid { position: absolute; inset: 0 0 0 43%; color: var(--accent); background-image: linear-gradient(90deg, #223329 0%, transparent 55%), repeating-linear-gradient(0deg, #d1f1a830 0 1px, transparent 1px 24px), repeating-linear-gradient(90deg, #d1f1a830 0 1px, transparent 1px 24px); }
.hero-grid b { position: absolute; width: 19%; aspect-ratio: 1; border: 1px solid #e6fa7080; }
.hero-grid b:nth-child(1) { top: -33%; right: 18%; transform: rotate(-20deg); }
.hero-grid b:nth-child(2) { top: 0; right: 13%; transform: rotate(-20deg); }
.hero-grid b:nth-child(3) { top: 33%; right: 8%; transform: rotate(-20deg); }
.hero-grid b:nth-child(4) { top: 55%; right: 6%; transform: rotate(-20deg); }
.hero-grid i { position: absolute; bottom: 1rem; right: 1.4rem; padding: .15rem .4rem; background: #253222; font: 700 .75rem var(--mono); }

.tab-bar { display: flex; gap: .38rem; margin-block: 1rem 1.65rem; padding: .35rem .3rem .6rem; overflow: auto hidden; border-bottom: 1px solid var(--line); white-space: nowrap; scrollbar-width: thin; }
.tab-bar a { display: flex; align-items: center; min-height: 2.55rem; padding: .35rem .95rem; border-radius: 7px; color: var(--text); font-size: .92rem; font-weight: 650; text-decoration: none; }
.tab-bar a:hover { background: #e6ebe1; }
.tab-bar a[aria-current] { background: var(--ink); color: var(--white); }
.results-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.results-head > div, .article-head { min-width: 0; }
.section-kicker { color: #475b41; }
.results-head h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.25; margin-block: .24rem; overflow-wrap: anywhere; }
.results-count, .card-copy p { color: var(--muted); font-size: .88rem; }
.text-action { color: #345031; text-decoration: underline; font-weight: 650; font-size: .9rem; }
.results-head .text-action { flex: none; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.card { --cover: #2b463b; --streak: #d9f379; min-width: 0; }
.card:nth-child(4n+2) { --cover: #3e4158; --streak: #dce0fe; }
.card:nth-child(4n+3) { --cover: #4a3b31; --streak: #fae3a5; }
.card:nth-child(4n+4) { --cover: #2e454d; --streak: #b8f2ec; }
.card-link { display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card-link:hover { border-color: #647461; }
.card-link:hover h3 { text-decoration: underline; }
.card-visual { aspect-ratio: 3 / 2; overflow: hidden; background: #d9dfd5; }
.card-visual img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { display: grid; place-items: center; color: var(--streak); background: repeating-linear-gradient(153deg, #111d1b00 0 11px, #111d1b3d 12px 13px, #111d1b00 14px 21px), var(--cover); }
.card-placeholder > span { display: inline-block; padding: .35rem .47rem; border: 1px solid currentColor; background: var(--cover); font: 700 clamp(1.2rem, 4vw, 2.2rem)/1 var(--mono); letter-spacing: -.08em; }
.card-placeholder > span > span { opacity: .75; }
.card-copy { padding: .85rem 1rem 1rem; overflow-wrap: anywhere; }
.card-meta, .article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .65rem; }
.card-meta time, .article-meta time { color: var(--muted); font: .75rem/1.2 var(--mono); }
.pill { color: #354b31; background: #e9eee3; border-radius: 4px; padding: .15rem .45rem; font-size: .77rem; font-weight: 650; }
.card-copy h3 { font-size: 1.08rem; line-height: 1.35; margin: .5rem 0 .25rem; }
.card-copy p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card-tag { display: inline-block; margin-top: .45rem; color: #345031; font-size: .8rem; font-weight: 600; }
.empty-state { text-align: center; padding: 2.5rem 1rem; border: 1px dashed #a7b0a3; border-radius: var(--radius); background: #fafbf8; }
.empty-mark { color: var(--muted); font: 700 1.15rem var(--mono); }
.empty-state p { color: var(--muted); margin-block: .35rem .8rem; }
.empty-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .65rem 1rem; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .35rem; margin-top: 1.7rem; }
.pagination a, .current-page { display: grid; min-width: 2.45rem; min-height: 2.45rem; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: .3rem .55rem; text-decoration: none; }
.pagination a:hover { border-color: var(--ink); }
.pagination .current-page { border-color: var(--ink); background: var(--ink); color: #fff; }
.card-grid > [hidden], .pagination[hidden], .load-more-control[hidden] { display: none !important; }
.resource-enhancement .card-grid:not(.is-managed) > .card:nth-child(n+17) { display: none; }
@media (max-width: 62rem) { .resource-enhancement .card-grid:not(.is-managed) > .card:nth-child(n+9) { display: none; } }
@media (max-width: 36rem) { .resource-enhancement .card-grid:not(.is-managed) > .card:nth-child(n+5) { display: none; } }
.load-more-control { display: flex; justify-content: center; margin-block: 1.75rem .5rem; }
.load-more-control .button { min-width: 10rem; }
.load-more-control .button:disabled { opacity: .55; cursor: wait; }
.load-more-status { text-align: center; color: var(--muted); font-size: .9rem; }

.detail-layout { padding-block: 1.3rem 3.5rem; }
.breadcrumb { display: flex; gap: .55rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: .85rem; }
.article-head { padding: 1.35rem 0 1.05rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.article-head h1 { font-size: clamp(2rem, 6vw, 3.7rem); line-height: 1.15; margin: .35rem 0 .65rem; }
.article-summary { max-width: 56rem; color: var(--muted); font-size: 1.1rem; margin-bottom: .75rem; }
.jump-link { margin-left: .3rem; }
.article-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
.article-main, .resource-panel, .account-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.article-main { padding: clamp(.95rem, 3vw, 2rem); }
.article-cover { width: 100%; max-height: 34rem; object-fit: contain; background: #f5f5f0; border-radius: 8px; margin-bottom: 1.2rem; }
.article-body { max-width: 72ch; overflow-wrap: anywhere; }
.article-body p + p { margin-top: 1rem; }
.article-body h2 { margin-block: 1.4em .5em; font-size: 1.48rem; }
.article-body h3 { margin-block: 1.2em .45em; font-size: 1.15rem; }
.gallery-section { margin-top: 1.6rem; }
.gallery-section h2 { margin-bottom: .65rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .9rem; }
.gallery figure { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.gallery figure img { width: 100%; }
.gallery figcaption { padding: .55rem .65rem; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.tag-list, .share-list { list-style: none; padding: 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.2rem 0 0; }
.tag-list li { border: 1px solid var(--line); border-radius: 5px; padding: .1rem .45rem; font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.resource-panel { padding: 1.1rem; box-shadow: inset 0 3px #a7bc55; overflow-wrap: anywhere; }
.resource-panel > p:not(.eyebrow) { margin: .35rem 0 .65rem; color: var(--muted); }
.share-list { margin: .55rem 0 0; }
.share-list li + li { margin-top: .75rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.share-url, .share-code { display: block; font-size: .89rem; }
.share-url { color: #355734; }
.share-code { color: var(--muted); margin-top: .35rem; }
.share-code code { display: inline-block; padding: .05rem .3rem; border-radius: 4px; background: #edf1e7; color: var(--ink); font-family: var(--mono); }

.account-layout { padding-block: clamp(1.25rem, 5vw, 3.5rem); }
.account-panel { max-width: 30rem; margin-inline: auto; padding: clamp(1rem, 5vw, 2rem); box-shadow: inset 0 3px #a7bc55; }
.account-panel h1 { line-height: 1.2; margin: .4rem 0 .65rem; }
.account-description { color: var(--muted); margin-bottom: 1rem; }
.account-form { display: grid; gap: .85rem; }
.account-form label { display: block; margin-bottom: .22rem; font-weight: 650; }
.account-form input:not([type=hidden]) { width: 100%; border: 1px solid #8f9c92; border-radius: 7px; min-height: 2.65rem; padding: .36rem .65rem; color: var(--ink); background: #f7f9f6; }
.account-form .helptext { color: var(--muted); font-size: .87rem; }
.account-form .helptext ul { margin: .38rem 0 0; padding-inline-start: 1.3rem; }
.account-form .errorlist, .messages { margin: 0 0 .35rem; padding: .55rem .7rem; border-radius: 6px; list-style: none; color: #861d24; background: #fcecee; }
.messages { color: #254428; background: #e6f1de; }
.account-form > .button { justify-self: start; }
.alternate { margin-top: 1rem; color: #355734; }
.site-footer { color: var(--muted); border-top: 1px solid var(--line); background: #fafbf7; }
.footer-layout { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem 1rem; padding-block: 1.15rem; font: 700 .75rem/1.45 var(--mono); }

@media (max-width: 62rem) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .header-layout { grid-template-columns: auto minmax(8rem, 1fr) auto; }
}
@media (max-width: 47rem) {
    .article-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 36rem) {
    .shell { width: calc(100% - 1.5rem); }
    .header-layout { grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; padding-block: .65rem; }
    .search { grid-column: 1 / -1; grid-row: 2; }
    .member-nav { gap: .6rem; }
    .home-layout { padding-top: .85rem; }
    .hero-grid { opacity: .52; inset-inline-start: 30%; }
    .hero-grid i { display: none; }
    .tab-bar { margin-bottom: 1.2rem; }
    .results-head { align-items: start; }
    .card-grid { grid-template-columns: minmax(0, 1fr); }
}
