:root {
  --bg: #0e1120; --surface: #171b2e; --surface2: #20263f; --line: #2c3456;
  --text: #e9ecf7; --muted: #9aa3c0; --accent: #6c8cff; --accent2: #ffb547;
  --good: #3ddc97; --bad: #ff5d73; --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
main { flex: 1; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(14, 17, 32, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.logo b { color: var(--accent); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.site-nav a:hover, .site-nav a.on { color: var(--text); background: var(--surface2); text-decoration: none; }
.site-search { position: relative; margin-left: auto; flex: 0 1 320px; }
.site-search input { width: 100%; height: 38px; border-radius: 19px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 14px 0 36px; font: inherit; font-size: 14px; outline: none; }
.site-search input:focus { border-color: var(--accent); }
.site-search::before { content: ""; position: absolute; left: 13px; top: 11px; width: 11px; height: 11px; border: 2px solid var(--muted); border-radius: 50%; }
.site-search::after { content: ""; position: absolute; left: 25px; top: 24px; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--text); }
.sr-item img { border-radius: 4px; background: var(--surface2); }
.sr-item small { margin-left: auto; color: var(--muted); font-size: 12px; }
.sr-item:hover, .sr-item.on { background: var(--surface2); text-decoration: none; }
.sr-empty { padding: 10px; color: var(--muted); font-size: 14px; }
.lang-switch { color: var(--muted); font-size: 14px; border: 1px solid var(--line); padding: 5px 10px; border-radius: 8px; white-space: nowrap; }
@media (max-width: 860px) { .site-nav { display: none; } }
@media (max-width: 560px) {
  .site-header .wrap { gap: 10px; }
  .logo span { display: none; }
}

/* ---------- home ---------- */
.hero { padding: 36px 0 12px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 6px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0 0 20px; max-width: 680px; }
.home-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.home-search input { flex: 1 1 280px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 16px; font: inherit; outline: none; }
.home-search input:focus { border-color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.count { color: var(--muted); font-size: 14px; margin: 8px 0; }
.section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 21px; }
.section-head a { font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.card-thumb { aspect-ratio: 16 / 10; background: var(--surface2); display: block; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.card-title { font-weight: 700; font-size: 15px; }
.card-short { color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { color: var(--muted); }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ---------- text pages ---------- */
.prose { max-width: 760px; padding: 28px 0 48px; }
.prose h1 { font-size: 30px; margin-top: 0; }
.prose p, .prose li { color: #cfd4e6; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin: 18px 0 10px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
