:root {
  --bg: #0b0d17; --bg2: #11142200; --surface: #141829; --surface2: #1b2036; --line: #262c47;
  --text: #e9ebf5; --muted: #9aa2bd; --accent: #8b5cf6; --accent2: #22d3ee; --on-accent: #fff;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171; --star: #fbbf24;
  --grad: linear-gradient(135deg, #7c3aed, #06b6d4);
  --radius: 14px; --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fb; --surface: #fff; --surface2: #eef0f8; --line: #dfe3f0;
    --text: #151830; --muted: #5b6382; --accent: #6d28d9; --accent2: #0891b2;
    --ok: #059669; --warn: #b45309; --bad: #dc2626; --star: #f59e0b;
    --shadow: 0 8px 30px rgba(30, 35, 80, .08);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-top: 28px; padding-bottom: 56px; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.wrap.narrow { max-width: 460px; padding-top: 60px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.sr, .skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 18px; min-height: 62px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; }
.logo:hover { text-decoration: none; }
.logo-mark { border-radius: 9px; flex: none; }
.logo-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 9px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface2); text-decoration: none; }
.actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.actions form { margin: 0; }
.lang { border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-weight: 700; font-size: .82rem; color: var(--muted); }
.me { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
@media (max-width: 720px) { .nav { order: 3; flex-basis: 100%; } .me-name { display: none; } }

/* buttons, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; background: var(--grad); color: var(--on-accent); font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 11px; white-space: nowrap; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.1); text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 50%, transparent); }
.btn.sm { padding: 6px 12px; font-size: .86rem; border-radius: 9px; } .btn.lg { padding: 13px 24px; font-size: 1.05rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.chip { display: inline-block; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.chip.accent { color: var(--accent2); } .chip.approved { color: var(--ok); } .chip.pending { color: var(--warn); } .chip.rejected { color: var(--bad); }
.badge { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }

/* layout blocks */
section { margin-top: 44px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; } .sec-head a { font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 16px; } .g3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-body { padding: 16px; }
.card h3 { margin-bottom: .4em; } .card h3 a { color: var(--text); }
.card p { color: var(--muted); font-size: .94rem; margin-bottom: .6em; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.more { font-weight: 700; font-size: .92rem; }
.hero { text-align: center; padding: 44px 0 14px; margin-top: 0; background: radial-gradient(60% 80% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); border-radius: 24px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .1em; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 62ch; margin: 0 auto 1.4em; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.news .thumb { display: block; aspect-ratio: 16 / 9; background: var(--surface2); }
.news .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tool { padding: 20px; color: var(--text); display: block; transition: border-color .15s, transform .15s; }
.tool:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.tool .ico { font-size: 1.9rem; display: block; margin-bottom: 8px; }
.top { padding: 18px; } .top ol { list-style: none; margin: 0 0 12px; padding: 0; counter-reset: n; }
.top li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.top li a { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; min-width: 0; }
.top li b { color: var(--star); white-space: nowrap; font-size: .9rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; font-size: .86rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.tabs { display: flex; gap: 6px; margin: 18px 0; overflow-x: auto; }
.tabs a { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 700; white-space: nowrap; }
.tabs a.active { background: var(--grad); color: #fff; border-color: transparent; } .tabs a:hover { text-decoration: none; color: var(--text); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0; color: var(--muted); }

/* avatars, stars */
.avatar { --h: 260; flex: none; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; font-weight: 800; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 65% 48%), hsl(calc(var(--h) + 50) 70% 40%)); }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: .85rem; } .avatar.xl { width: 76px; height: 76px; border-radius: 20px; font-size: 2rem; }
.stars { position: relative; display: inline-block; font-size: 1rem; line-height: 1; letter-spacing: 2px; white-space: nowrap; }
.stars::before { content: "★★★★★"; color: var(--line); }
.stars > span { position: absolute; left: 0; top: 0; overflow: hidden; }
.stars > span::before { content: "★★★★★"; color: var(--star); }
.score { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; } .score b { font-size: 1.2rem; } .score small, .score.none { color: var(--muted); font-size: .84rem; }

/* rating */
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rank-row { display: flex; gap: 14px; align-items: center; padding: 16px; }
.pos { font-size: 1.3rem; font-weight: 800; color: var(--muted); width: 1.6em; text-align: center; flex: none; }
.rank-main { flex: 1; min-width: 0; } .rank-main h2 { font-size: 1.15rem; margin-bottom: .2em; } .rank-main h2 a { color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.rank-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
@media (max-width: 720px) { .rank-row { flex-wrap: wrap; } .rank-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; } }
.item-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; } .item-head h1 { margin: 0 0 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0; }
.facts > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.facts dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; } .facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.reviews { display: grid; gap: 12px; margin-bottom: 26px; }
.review { padding: 14px 16px; margin-bottom: 12px; } .review header { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 8px; }
.review time { color: var(--muted); font-size: .82rem; margin-left: auto; } .review p { color: var(--text); overflow-wrap: anywhere; }
.note { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.note.approved { border-color: var(--ok); } .note.pending { border-color: var(--warn); } .note.rejected { border-color: var(--bad); }
.notice { padding: 18px; }
.review-form, .form { padding: 18px; display: grid; gap: 12px; max-width: 760px; }
.rate { border: 0; padding: 0; margin: 0; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rate legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-weight: 600; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: var(--star); }
.rate input:focus-visible + label { outline: 2px solid var(--accent2); border-radius: 4px; }

/* forms */
label { font-weight: 600; font-size: .92rem; display: grid; gap: 5px; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; } textarea.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } form.inline { display: inline; margin: 0; }

/* prose */
.article { max-width: 780px; } .article > .meta { margin-bottom: 20px; }
.prose { font-size: 1.05rem; } .prose h2 { margin-top: 1.6em; } .prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin-bottom: .35em; }
.prose code { background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; } .prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; } .prose th, .prose td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.faq { max-width: 780px; }

/* tools */
.app { margin: 20px 0; display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel > h2 { font-size: 1.05rem; margin-bottom: 12px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.drop label { display: inline; color: var(--accent2); cursor: pointer; text-decoration: underline; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.editor { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }
.glist { list-style: none; margin: 10px 0; padding: 0; max-height: 560px; overflow-y: auto; }
.glist li { display: flex; align-items: center; gap: 4px; padding: 3px 4px 3px 0; border-radius: 9px; }
.glist li.sel { background: var(--surface2); }
.glist .gname { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; padding: 6px 8px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glist .cnt { color: var(--muted); font-size: .78rem; }
.ib { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 5px; border-radius: 6px; font-size: .95rem; line-height: 1; }
.ib:hover { background: var(--line); color: var(--text); } .ib.on { background: color-mix(in srgb, var(--bad) 25%, transparent); } .ib:disabled { opacity: .3; cursor: default; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; } .toolbar input[type=search] { flex: 1; min-width: 160px; }
.bulk { background: var(--surface2); border-radius: 10px; padding: 8px 10px; } .bulk select { width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); }
tr:last-child td { border-bottom: 0; } tr.dim { opacity: .5; }
.ch td.n { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch td.u { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.ch td.a { white-space: nowrap; text-align: right; } .ch td.c { width: 30px; }
.out { width: 100%; min-height: 220px; } .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(520px, 92vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .6); } dialog form { display: grid; gap: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 99; box-shadow: var(--shadow); }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: auto; }
.foot { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; padding-top: 30px; padding-bottom: 14px; }
.foot p { color: var(--muted); font-size: .9rem; margin-top: 10px; max-width: 50ch; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: start; } .foot nav a { color: var(--muted); font-weight: 600; }
.copy { color: var(--muted); font-size: .82rem; padding-bottom: 22px; }
@media (max-width: 720px) { .foot { grid-template-columns: 1fr; } }

/* admin */
.admin .stats .stat { padding: 18px; color: var(--text); display: grid; } .admin .stat b { font-size: 2rem; } .admin .stat span { color: var(--muted); }
.admin h2 { margin-top: 1.6em; } .admin .form { margin-bottom: 14px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
