:root {
    color-scheme: light; --paper: #f7f6ef; --white: #fffef9; --ink: #26362a;
    --muted: #566258; --line: #dcdfd3; --green: #315a42; --green-dark: #234432;
    --soft: #e8efe4; --clay: #f2e8d7; --focus: #94511d;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button, input, select { font: inherit; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.ico { width: 18px; height: 18px; flex: none; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topline, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topline { min-height: 68px; }
.brand, .main-site { display: inline-flex; align-items: center; gap: 10px; }
.brand { font-size: 17px; font-weight: 750; letter-spacing: .02em; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; background: var(--green); color: white; }
.brand-mark .ico { width: 21px; height: 21px; }
.main-site { font-weight: 600; font-size: 13px; color: var(--green); }
.content { flex: 1; padding-block: 37px 68px; }
.page-title { margin-bottom: 26px; }
h1 { font-weight: 760; font-size: clamp(27px, 3vw, 36px); line-height: 1.24; overflow-wrap: anywhere; }
.page-title p { margin-top: 9px; color: var(--muted); }
.catalog-layout { display: grid; grid-template-columns: 199px minmax(0, 1fr); align-items: start; gap: 28px; }
.categories { padding: 14px 10px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.categories h2 { margin: 4px 10px 11px; display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; }
.categories h2 .ico { width: 14px; height: 14px; }
.categories a { display: flex; min-height: 42px; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.categories a:hover, .categories a[aria-current] { background: var(--soft); color: var(--green-dark); }
.categories a[aria-current] { font-weight: 740; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; }
.search { min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--white); color: var(--muted); padding: 0 13px; border-radius: 9px; border: 1px solid var(--line); }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search input { min-width: 0; width: 100%; height: 41px; border: 0; outline: none; background: transparent; color: var(--ink); }
.search input:focus-visible { outline: none; }
.toolbar select { height: 43px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; background: var(--white); color: var(--ink); cursor: pointer; }
.subfilter { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.subfilter select { min-width: 0; max-width: calc(100% - 120px); }
.subfilter .button { flex: none; }
.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; border-radius: 9px; border: 1px solid transparent; font-weight: 650; cursor: pointer; text-align: center; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: var(--green-dark); }
.secondary { background: var(--white); border-color: var(--line); color: var(--green-dark); }
.secondary:hover { background: var(--soft); }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 21px 0 11px; }
.results-heading h2 { font-size: 18px; }
.results-heading span { font-size: 13px; text-align: right; color: var(--muted); }
.results-heading a { text-decoration: underline; text-underline-offset: 3px; }
.resource-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.card { height: 100%; display: flex; flex-direction: column; min-width: 0; gap: 12px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 13px; transition: border-color .16s, box-shadow .16s; }
.card:hover { border-color: #859c86; box-shadow: 0 3px 10px #243c2820; }
.card-top { display: flex; align-items: center; gap: 11px; }
.card-title { min-width: 0; overflow-wrap: anywhere; }
.card-title h3 { font-size: 16px; line-height: 1.34; }
.game-card .card-title h2 { font-size: 17px; line-height: 1.34; }
.card-title span { color: var(--muted); font-size: 12px; }
.game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card p { font-size: 14px; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; }
.tile { display: grid; width: 43px; height: 43px; flex: none; place-items: center; border-radius: 9px; color: var(--green-dark); background: var(--soft); }
.tile .ico { height: 22px; width: 22px; }
.tile-mod, .tile-mods, .tile-save { color: #724b27; background: var(--clay); }
.tile-tool, .tile-utility, .tile-translation { color: #49516d; background: #e9ebf4; }
.tile-visual, .tile-pack, .tile-modpacks { color: #745469; background: #f3e9ef; }
.card-cover { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.tag { width: fit-content; max-width: 100%; display: inline-block; flex: none; color: var(--green-dark); background: var(--soft); padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 650; }
.version { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.card-open { display: grid; place-items: center; flex: none; margin-left: auto; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); }
.card:hover .card-open { background: var(--green); color: white; border-color: var(--green); }
.empty { display: grid; justify-items: center; gap: 12px; padding: 46px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); text-align: center; }
.state { margin-top: 20px; }
.state-icon { width: 36px; height: 36px; color: var(--green); }
.pagination { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--green-dark); margin-bottom: 19px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "title download" "body download"; gap: 16px 20px; align-items: start; }
.detail, .download-panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--white); padding: 23px; }
.detail-head { grid-area: title; display: flex; align-items: flex-start; gap: 13px; }
.detail-head > div { min-width: 0; }
.download-panel { grid-area: download; }
.detail-head .tile { margin-top: 3px; width: 50px; height: 50px; }
.detail-head h1 { margin-top: 7px; }
.summary { margin-top: 9px; color: var(--muted); overflow-wrap: anywhere; }
.detail-cover { display: block; width: 100%; max-height: 420px; object-fit: contain; margin-bottom: 14px; background: var(--paper); border-radius: 8px; }
.detail-section { grid-area: body; }
.detail-section h2, .download-panel h2 { font-size: 17px; margin-bottom: 10px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.download { width: 100%; margin-top: 8px; }
.metadata { margin: 17px 0 0; }
.metadata > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; border-top: 1px solid var(--line); padding: 9px 0; font-size: 13px; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; max-width: 100%; overflow-wrap: anywhere; }
.footer { border-top: 1px solid var(--line); background: var(--white); padding-block: 15px; font-size: 13px; color: var(--muted); }
.footer a { color: var(--green-dark); font-weight: 650; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; top: 4px; left: 4px; z-index: 2; padding: 9px; background: var(--white); }
@media (max-width: 830px) {
    .shell { width: calc(100% - 36px); }
    .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 15px; }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .categories { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; }
    .categories h2 { position: absolute; clip-path: inset(50%); }
    .categories a { gap: 5px; padding: 6px 8px; min-height: 35px; }
    .categories .ico { width: 15px; height: 15px; }
    .detail-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "download" "body"; }
}
@media (max-width: 570px) {
    .shell { width: calc(100% - 28px); }
    .topline { min-height: 58px; }
    .brand { font-size: 15px; }
    .brand-mark { width: 32px; height: 32px; }
    .main-site .ico { display: none; }
    .content { padding-block: 25px 43px; }
    .page-title { margin-bottom: 17px; }
    .resource-grid { grid-template-columns: minmax(0, 1fr); }
    .toolbar { gap: 6px; }
    .toolbar .button { padding-inline: 10px; }
    .toolbar label:not(.subfilter) select { max-width: 97px; font-size: 13px; }
    .search { gap: 6px; padding-inline: 7px; }
    .search input { font-size: 14px; }
    .detail, .download-panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
