/* ═══ Дизайн-система зеркала Xiaomi EV FAQ — см. crawler/DESIGN.md ═══
   Подключается всеми страницами: главная (assets/portal.css),
   страницы моделей (../assets/), топики (../../assets/, до topic.css).
   Цвета — только через токены ниже; никаких #06c/#ccc и т.п. в коде страниц. */

/* ── MiSans: сабсеты (кириллица+греческий / латиница+цифры);
     тире —–… в сабсетах отсутствуют и уходят в системный фолбэк ── */
@font-face { font-family: MiSans; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/MiSans-Regular-cyr.woff2') format('woff2'); unicode-range: U+0370-052F; }
@font-face { font-family: MiSans; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/MiSans-Regular-latin.woff2') format('woff2'); unicode-range: U+0000-036F, U+0530-10FFFF; }
@font-face { font-family: MiSans; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/MiSans-Demibold-cyr.woff2') format('woff2'); unicode-range: U+0370-052F; }
@font-face { font-family: MiSans; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/MiSans-Demibold-latin.woff2') format('woff2'); unicode-range: U+0000-036F, U+0530-10FFFF; }
@font-face { font-family: MiSans; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/MiSans-Bold-cyr.woff2') format('woff2'); unicode-range: U+0370-052F; }
@font-face { font-family: MiSans; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/MiSans-Bold-latin.woff2') format('woff2'); unicode-range: U+0000-036F, U+0530-10FFFF; }

/* ── Токены ── */
:root {
  --accent: #ff6900;
  --accent-soft: rgba(255, 105, 0, .08);
  --bg: #f6f6f7; --card: #fff; --card-dim: #fafafa;
  --ink: #1a1a1a; --muted: #666; --line: #e5e5e5;
  --badge-todo: #b3b3b7;
  --shadow: 0 6px 20px rgba(0, 0, 0, .08);
  color-scheme: light;
}
html[data-theme="dark"] {
  --accent: #ff7a1a;
  --accent-soft: rgba(255, 122, 26, .14);
  --bg: #101014; --card: #1c1c20; --card-dim: #17171b;
  --ink: #f0f0f2; --muted: #9a9aa2; --line: #2c2c31;
  --badge-todo: #54545b;
  --shadow: 0 6px 20px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ── База ── */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'MiSans', system-ui, 'Segoe UI', sans-serif;
       background: var(--bg); color: var(--ink); }
::selection { background: var(--accent); color: #fff; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 32px; }
main.wrap { padding: 26px 32px 10px; }
.empty { color: var(--muted); }
code { background: var(--card-dim); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
html[data-theme="dark"] code { background: #232329; }

/* ── Шапка ── */
header { background: var(--card); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: flex-start; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { width: 36px; height: 36px; flex: none; display: block; }
header h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; }
header .sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.stats { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
         color: var(--muted); font-size: 13px; }
.stats b { color: var(--accent); font-weight: 600; }

/* ── Переключатель темы (кнопка #themeBtn + иконки) ── */
#themeBtn { margin-left: auto; flex: none; width: 40px; height: 40px; display: grid; place-items: center;
            background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 10px;
            cursor: pointer; transition: color .15s, border-color .15s; }
#themeBtn:hover { color: var(--accent); border-color: var(--accent); }
#themeBtn svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ── Бейджи статуса ── */
.badge { display: inline-block; font-size: 11px; font-weight: 600; color: #fff;
         background: var(--accent); border-radius: 999px; padding: 2px 9px; }
.badge.todo { background: var(--badge-todo); }

/* ── Мобильные ── */
@media (max-width: 640px) {
  .wrap { padding: 18px 16px; }
  main.wrap { padding: 20px 16px 6px; }
  .logo { width: 30px; height: 30px; }
  header h1 { font-size: 20px; }
  header .sub { font-size: 12px; }
}
