:root {
    --bg: #fbfaf6;
    --panel: #ffffff;
    --line: #d9d6cb;
    --text: #222222;
    --muted: #6a6a6a;
    --link: #0b3fb5;
    --visited: #5b2f91;
    --accent: #0b3fb5;
    --accent-dark: #082e86;
    --bar: #eef2fa;
    --good: #1c7a4d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--link); text-decoration: underline; }
a:visited { color: var(--visited); }
a:hover { color: #d03800; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #e8a200; outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: #111; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.55rem); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.site-header { background: var(--panel); border-bottom: 3px solid var(--accent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; flex-wrap: wrap; }
.brand { font: 800 2.15rem/1.1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--accent-dark); text-decoration: none; letter-spacing: .02em; }
.brand:visited { color: var(--accent-dark); }
.brand:hover { color: var(--accent); }
.brand span { color: inherit; font-style: normal; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin: 0 0 .9em; }
.section-head h2 { border-bottom: 0; margin: 0; }
.section-head a { font-weight: 700; font-size: .93rem; white-space: nowrap; padding-bottom: 6px; }
.brand-block { line-height: 1.1; }
.brand-block .brand { display: block; }
.tagline { font-size: .85rem; color: var(--muted); margin-top: 3px; }
.main-nav { background: var(--bar); border-top: 1px solid var(--line); }
.main-nav .wrap { display: flex; gap: 4px 22px; flex-wrap: wrap; padding: 9px 0; }
.main-nav a { font-weight: 700; font-size: .93rem; }
.search { display: flex; gap: 6px; }
.search input { width: 260px; }

input, select, textarea { background: #fff; border: 1px solid #b9b5a8; color: var(--text); border-radius: 3px; padding: 8px 10px; font: inherit; max-width: 100%; }
textarea { width: 100%; min-height: 110px; }
label { display: block; font-weight: 700; margin: 16px 0 6px; }
.button { display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent-dark); border-radius: 3px; padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.button:visited { color: #fff; }
.button:hover { background: var(--accent-dark); color: #fff; }
.button.small { padding: 7px 12px; font-size: .9rem; }
.button.ghost { background: #fff; color: var(--accent); border-color: #b9b5a8; }
.button.ghost:hover { background: var(--bar); color: var(--accent-dark); }
.button.danger { background: #a3262f; border-color: #7e1b22; }

.banner-top { text-align: center; margin: 18px 0 4px; }
.banner-top img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.layout { margin-top: 18px; }
.layout.has-side { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 34px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.side-banner img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }

.hero { padding: 14px 0 8px; max-width: 760px; }
.hero h1 { margin-bottom: .35em; }
.hero .lead { color: #444; font-size: 1.05rem; }
.hero-search { display: flex; gap: 8px; margin-top: 16px; }
.hero-search input { flex: 1; padding: 11px 12px; font-size: 1.05rem; }

.section { margin: 34px 0; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.cat-card { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 4px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.cat-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.count { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.sub-list { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; }

.links { list-style: none; margin: 0 0 1.2em; padding: 0; }
.links li { padding: 6px 0 6px 18px; position: relative; border-bottom: 1px dotted #e3e0d6; }
.links li::before { content: "\2022"; position: absolute; left: 4px; color: #8a8a8a; }
.host { color: var(--muted); font-size: .82rem; word-break: break-all; }
.tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; margin-left: 4px; color: var(--muted); vertical-align: middle; background: #fff; }
.tag.sponsored { border-color: #d6a44a; color: #7a5200; background: #fff6df; }
.tag.fresh { border-color: #9bcbb0; color: var(--good); background: #eefaf3; }
.subcats { columns: 3 190px; column-gap: 24px; list-style: none; padding: 0; margin: 0 0 1.4em; font-size: .93rem; }
.subcats li { padding: 2px 0; }
.sortbar { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 16px; }
.gal { margin: 0; text-align: center; }
.gal img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #e8e6dd; border: 1px solid var(--line); padding: 3px; background-clip: content-box; }
.gal a:hover img { border-color: var(--accent); }
.gal figcaption { margin-top: 6px; font-size: .9rem; font-weight: 700; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; }
.pagination a, .pagination .current { min-width: 36px; text-align: center; padding: 5px 11px; border: 1px solid var(--line); border-radius: 3px; background: #fff; text-decoration: none; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pagination .gap { padding: 5px 4px; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 22px; }
.form { max-width: 640px; }
.notice { border-radius: 3px; padding: 10px 14px; margin: 14px 0; border: 1px solid var(--line); }
.notice.error { border-color: #d98a8f; background: #fdeeee; }
.notice.success { border-color: #94c9ac; background: #eefaf3; }
.hp { position: absolute; left: -5000px; }
code { background: #f1efe6; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
.page-heading { padding: 6px 0 4px; }
.page-heading p { color: #444; max-width: 720px; }
.meta { color: var(--muted); font-size: .85rem; }
.empty { color: var(--muted); padding: 24px 0; }
.back-link { display: inline-block; margin: 0 0 8px; font-size: .9rem; }

.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 22px 0 40px; background: var(--bar); color: var(--muted); font-size: .88rem; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0; }
.footer-note { font-size: .8rem; }

.age-gate { position: fixed; inset: 0; background: rgba(250, 249, 244, .97); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.age-gate[hidden] { display: none; }
.age-card { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 4px; padding: 30px; max-width: 460px; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .15); }
.age-badge { display: inline-block; font-size: 2.4rem; font-weight: 900; color: var(--accent); margin-bottom: 4px; }
.age-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
body.gated { overflow: hidden; }

/* admin */
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fff; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; background: var(--bar); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; }
.stat strong { display: block; font-size: 1.6rem; color: var(--accent-dark); }
.inline-form { display: inline; }
.reco { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 3px; border: 1px solid var(--line); }
.reco.approve { color: var(--good); border-color: #94c9ac; background: #eefaf3; }
.reco.reject { color: #a3262f; border-color: #d98a8f; background: #fdeeee; }
.reco.review { color: #7a5200; border-color: #d6a44a; background: #fff6df; }
.banner-preview { max-width: 240px; max-height: 90px; border: 1px solid var(--line); }

@media (max-width: 820px) {
    .layout.has-side { grid-template-columns: 1fr; }
    .sidebar { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .search { width: 100%; }
    .search input { flex: 1; width: auto; min-width: 0; }
    .hero-search { flex-direction: column; }
    .cat-grid { grid-template-columns: 1fr; }
    .admin-table { display: block; overflow-x: auto; }
}
