/* ============================================================
   China Grant · CSCA & HSK — таблица стилей, версия 2

   Дизайн-система ChinaGrant: киноварь, золото, нефрит, тушь,
   фон «рис»; шрифты Unbounded (заголовки) + Golos Text (текст).

   Точки перелома:
     ≤ 479   телефон
     480–767 большой телефон
     768–1023 планшет
     1024–1279 ноутбук
     ≥ 1280  настольный
   Меню сворачивается в бургер ниже 1024.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@700;900&family=Golos+Text:wght@400;500;600;700;800&family=Cinzel:wght@600&display=swap');

/* ---------- Токены ---------- */
:root {
  --red-500: #E8402F;  --red-600: #C4301F;  --red-050: #FBE9E5;
  --gold-400: #F5BC40; --gold-600: #8A5A00; --gold-050: #FCF1DC;
  --jade-500: #2F9B7F; --jade-600: #1F7A62; --jade-050: #E3F3ED;
  --blue-600: #3056D6; --blue-700: #2843AC; --blue-050: #E9EEFC;
  --ink-900: #1B1A23;  --ink-800: #26242F;  --ink-600: #56545F;
  --ink-400: #8B8894;  --ink-200: #D9D3C7;  --ink-100: #E9E3D8;  --ink-050: #F3EEE5;
  --paper-0: #FAF7F1;  --paper-100: #F1EBDF;  --surface: #FFFFFF;
  --wa: #25D366;       --wa-dark: #1FBA59;  --wa-ink: #04310F;

  --grad-fire: linear-gradient(135deg, #E8402F 0%, #FF8A3D 55%, #FFC53D 100%);
  --grad-ink:  linear-gradient(160deg, #1B1A23 0%, #332A3F 100%);

  --font-display: 'Unbounded', 'Montserrat', system-ui, sans-serif;
  --font-text: 'Golos Text', 'Inter', system-ui, -apple-system, sans-serif;

  /* Шкала текста: телефон → настольный */
  --fs-body:  clamp(16px, 0.95rem + 0.2vw, 17px);
  --fs-small: clamp(13.5px, 0.8rem + 0.15vw, 14.5px);
  --fs-lead:  clamp(17px, 1rem + 0.35vw, 19.5px);
  --fs-h1:    clamp(28px, 1.35rem + 2.4vw, 46px);
  --fs-h2:    clamp(22px, 1.15rem + 1.4vw, 32px);
  --fs-h3:    clamp(18px, 1.05rem + 0.4vw, 21px);
  --fs-stat:  clamp(30px, 1.5rem + 1.6vw, 42px);

  /* Отступы */
  --sp-section: clamp(44px, 4vw + 24px, 84px);
  --sp-tight:   clamp(28px, 2.5vw + 16px, 52px);
  --sp-card:    clamp(18px, 1.2vw + 12px, 28px);
  --gap:        clamp(14px, 1.2vw + 8px, 24px);
  --wrap: 1180px;
  --measure: 68ch;

  --radius-sm: 10px; --radius: 16px; --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(27,26,35,.04), 0 8px 24px rgba(27,26,35,.06);
  --shadow-md: 0 14px 36px rgba(27,26,35,.13);
  --header-h: 64px;
  --tap: 44px;
}

/* ---------- Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--paper-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 0;
}
/* Место под плавающую кнопку на телефоне */
@media (max-width: 767px) { body { padding-bottom: 76px; } body.no-fab { padding-bottom: 0; } }

img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
button { font: inherit; }
b, strong { font-weight: 600; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible, .opt:focus-visible { outline-offset: 2px; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 900; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
h4 { font-family: var(--font-text); font-weight: 600; font-size: 1.02em; line-height: 1.35; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lead { font-size: var(--fs-lead); line-height: 1.5; }
.prose { max-width: var(--measure); }
.prose p { line-height: 1.65; }
.prose p + p { margin-top: -.2em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 24px); }
.section { padding: var(--sp-section) 0; }
.section--tight { padding: var(--sp-tight) 0; }
.section--paper { background: var(--paper-100); }
.section--ink { background: var(--ink-900); color: var(--paper-0); }
.section--ink h2, .section--ink h3 { color: var(--paper-0); }
.section--ink .muted { color: rgba(255,253,248,.72); }

.sec-head { max-width: 720px; margin-bottom: clamp(22px, 2.5vw, 36px); }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head p { color: var(--ink-600); font-size: var(--fs-lead); line-height: 1.5; margin: 0; }
.section--ink .sec-head p { color: rgba(255,253,248,.75); }

.muted { color: var(--ink-600); }
.small { font-size: var(--fs-small); }
.center { text-align: center; }
.accent { color: var(--red-500); }
.mark {
  background: linear-gradient(transparent 60%, var(--gold-400) 60%, var(--gold-400) 92%, transparent 92%);
  padding: 0 .06em;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 24px;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: 16px; line-height: 1.2; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--red-500); color: var(--paper-0); box-shadow: 0 4px 14px rgba(232,64,47,.26); }
.btn--primary:hover { background: var(--red-600); box-shadow: 0 6px 18px rgba(232,64,47,.32); }
.btn--dark { background: var(--ink-900); color: var(--paper-0); }
.btn--dark:hover { background: var(--ink-800); }
.btn--outline { border-color: var(--ink-200); color: var(--ink-900); background: transparent; }
.btn--outline:hover { border-color: var(--ink-900); background: var(--ink-050); }
.btn--light { background: var(--paper-0); color: var(--ink-900); }
.btn--light:hover { background: #fff; }
.btn--ghost-light { border-color: rgba(255,253,248,.4); color: var(--paper-0); background: transparent; }
.btn--ghost-light:hover { background: rgba(255,253,248,.12); border-color: rgba(255,253,248,.6); }
.btn--wa { background: var(--wa); color: var(--wa-ink); }
.btn--wa:hover { background: var(--wa-dark); color: var(--wa-ink); }
.btn--sm { min-height: 40px; padding: 8px 18px; font-size: 14.5px; }
.btn--lg { min-height: 52px; padding: 14px 32px; font-size: 17px; }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row.center { justify-content: center; }
@media (max-width: 479px) {
  .btn-row > .btn { flex: 1 1 auto; }
  .btn--lg { min-height: 50px; font-size: 16px; }
}

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em; line-height: 1.3;
}
.badge--gold  { background: var(--gold-400); color: var(--ink-900); }
.badge--jade  { background: var(--jade-500); color: #fff; }
.badge--red   { background: var(--red-050); color: var(--red-600); }
.badge--blue  { background: var(--blue-050); color: var(--blue-700); }
.badge--ghost { background: rgba(255,253,248,.14); color: var(--paper-0); border: 1px solid rgba(255,253,248,.25); }
.badge--outline { border: 1.5px solid var(--ink-200); color: var(--ink-600); background: var(--paper-0); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Карточки и сетки ---------- */
.card {
  background: var(--paper-0); border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg); padding: var(--sp-card);
}
.card > :last-child { margin-bottom: 0; }
.card--hover { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.card--hover:hover { border-color: var(--ink-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card--ink { background: var(--ink-800); border-color: rgba(255,255,255,.1); color: var(--paper-0); }
.card--ink .muted { color: rgba(255,253,248,.72); }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 899px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* Строка с иконкой и заголовком (шапка предмета, уровень HSK) */
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row__grow { flex: 1 1 240px; min-width: 0; }
.row h2, .row h3 { margin: 0; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,253,248,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-100);
}
.site-header__inner {
  height: var(--header-h); display: flex; align-items: center; gap: 20px;
  max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 24px);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; min-height: var(--tap); }
.logo:hover { text-decoration: none; }
.logo img { height: 32px; width: auto; }
.logo__text { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-900); letter-spacing: -.02em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; min-height: 38px;
  padding: 0 12px; border-radius: 999px; color: var(--ink-900);
  font-weight: 500; font-size: 14.5px; text-decoration: none; white-space: nowrap;
  transition: background .12s ease;
}
.nav a:hover { background: var(--paper-100); text-decoration: none; }
.nav a.is-active { background: var(--red-050); color: var(--red-600); font-weight: 600; }
.header-cta { margin-left: 8px; }
/* Широкий ноутбук: длинные пункты меню ужимаем; ниже 1280 — бургер */
@media (min-width: 1280px) and (max-width: 1459px) {
  .nav a { padding: 0 9px; font-size: 13.5px; }
  .header-cta { margin-left: 4px; padding-left: 14px; padding-right: 14px; }
}
.burger {
  display: none; margin-left: auto; background: none; border: 1.5px solid var(--ink-200);
  border-radius: 12px; width: var(--tap); height: var(--tap); cursor: pointer;
  align-items: center; justify-content: center;
}
.burger span, .burger span::before, .burger span::after {
  display: block; width: 18px; height: 2px; background: var(--ink-900); border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease;
}
.burger span { position: relative; }
.burger span::before, .burger span::after { content: ''; position: absolute; left: 0; }
.burger span::before { top: -6px; } .burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1279px) {
  .burger { display: flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper-0); border-bottom: 1px solid var(--ink-100);
    padding: 10px clamp(16px, 4vw, 24px) 18px; margin: 0; display: none;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; }
  .nav a { min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 16px; }
  .header-cta { margin: 10px 0 0; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--grad-ink); color: var(--paper-0);
  padding: clamp(48px, 6vw, 84px) 0 clamp(40px, 5vw, 64px);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -160px; top: -160px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(232,64,47,.34) 0%, transparent 68%); pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; text-align: center; }
.hero h1 { color: var(--paper-0); margin-bottom: .55em; }
.hero__sub {
  font-size: var(--fs-lead); line-height: 1.5;
  color: rgba(255,253,248,.82); max-width: 620px; margin: 0 auto 26px;
}
.hero__note { font-size: var(--fs-small); color: rgba(255,253,248,.6); margin-top: 16px; }
.hero .breadcrumb, .hero .breadcrumb a { color: rgba(255,253,248,.7); }
.hero .btn--ghost-light { border-color: rgba(255,253,248,.35); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: clamp(28px, 4vw, 44px); }
.step {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 14px 16px;
}
.step__n {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: var(--red-500); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.step__t { font-size: 14.5px; line-height: 1.4; font-weight: 500; color: rgba(255,253,248,.92); }
@media (max-width: 767px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

/* ---------- Плитки цифр ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.stat { text-align: center; padding: clamp(14px, 2vw, 22px) 12px; }
.stat__n {
  font-family: var(--font-display); font-weight: 900; font-size: var(--fs-stat);
  line-height: 1; color: var(--red-500); letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.section--ink .stat__n { color: var(--gold-400); }
.stat__l { font-size: var(--fs-small); color: var(--ink-600); margin-top: 8px; line-height: 1.35; }
.section--ink .stat__l { color: rgba(255,253,248,.7); }
@media (max-width: 767px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat { padding: 12px 8px; } }

/* ---------- Карточка предмета ---------- */
.subject-card { display: flex; flex-direction: column; }
.subject-card__icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; margin-bottom: 14px; flex: 0 0 auto;
}
.subject-card__meta { color: var(--ink-600); font-size: var(--fs-small); margin: 0 0 14px; line-height: 1.45; }
.subject-card__meta b { color: var(--ink-900); font-weight: 600; }
.subject-card .btn-row { margin-top: auto; padding-top: 6px; }
.i-math { background: var(--blue-050); }
.i-phys { background: var(--jade-050); }
.i-chem { background: var(--red-050); }
.i-hsk1, .i-hsk2, .i-hsk3, .i-hsk4 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--paper-0);
}
.i-hsk1 { background: var(--jade-500); }
.i-hsk2 { background: var(--blue-600); }
.i-hsk3 { background: var(--gold-400); color: var(--ink-900); }
.i-hsk4 { background: var(--red-500); }

/* ---------- Коллаут ---------- */
.callout {
  border-left: 5px solid var(--gold-400); background: var(--paper-100);
  border-radius: var(--radius); padding: clamp(14px, 1.5vw, 18px) clamp(16px, 2vw, 22px);
  margin: clamp(18px, 2vw, 24px) 0; line-height: 1.55;
}
.callout--jade { border-left-color: var(--jade-500); background: var(--jade-050); }
.callout--red  { border-left-color: var(--red-500);  background: var(--red-050); }
.callout--blue { border-left-color: var(--blue-600); background: var(--blue-050); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Факты и таблицы ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 899px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .facts { grid-template-columns: minmax(0, 1fr); } }
.fact { background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 14px 16px; }
.fact__k { font-size: 13px; color: var(--ink-600); margin-bottom: 4px; letter-spacing: .01em; }
.fact__v { font-weight: 600; font-size: 15.5px; line-height: 1.35; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--ink-100); background: var(--paper-0); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--ink-100); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-600); background: var(--ink-050); }
table.data tbody tr:hover { background: var(--paper-100); }
@media (max-width: 767px) { table.data { font-size: 14px; } table.data th, table.data td { padding: 10px 12px; } }
table.data .btn { min-height: 34px; padding: 5px 14px; font-size: 13.5px; white-space: nowrap; }
.adm-check { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--red-500); cursor: pointer; }
.adm-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
/* Админка: добавление администратора по почте и список администраторов */
.adm-add { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.adm-add__field { flex: 1 1 260px; min-width: 0; margin: 0; }
.adm-admins { margin-top: 18px; border-top: 1px solid var(--ink-100); }
.adm-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; border-bottom: 1px solid var(--ink-100); }
.adm-admin:last-child { border-bottom: 0; padding-bottom: 0; }
.adm-admin__who { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Аккордеон ---------- */
.acc { border: 1px solid var(--ink-100); border-radius: var(--radius); overflow: hidden; background: var(--paper-0); }
.acc + .acc { margin-top: 10px; }
.acc__q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  min-height: var(--tap); padding: 15px 48px 15px 18px; font-weight: 600; font-size: 16px; line-height: 1.35;
  position: relative; color: var(--ink-900);
}
.acc__q::after {
  content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 22px; color: var(--red-500); line-height: 1; transition: transform .15s ease;
}
.acc.is-open .acc__q::after { content: '−'; }
.acc__a { padding: 0 18px 18px; color: var(--ink-600); display: none; line-height: 1.6; }
.acc.is-open .acc__a { display: block; }
.acc__a p:last-child { margin-bottom: 0; }

/* ---------- Таймлайн ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; background: var(--ink-100); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: clamp(18px, 2vw, 26px); }
.tl-item:last-child { padding-bottom: 6px; }
.tl-item::before {
  content: ''; position: absolute; left: -29px; top: 4px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--red-500); border: 3px solid var(--paper-0); box-shadow: 0 0 0 1px var(--ink-100);
}
.tl-item--jade::before { background: var(--jade-500); }
.tl-item--gold::before { background: var(--gold-400); }
.tl-item--blue::before { background: var(--blue-600); }
.tl-item__date { font-size: 13px; font-weight: 600; color: var(--red-500); letter-spacing: .04em; text-transform: uppercase; }
.tl-item--jade .tl-item__date { color: var(--jade-600); }
.tl-item--gold .tl-item__date { color: var(--gold-600); }
.tl-item--blue .tl-item__date { color: var(--blue-700); }
.tl-item h4 { margin: 2px 0 4px; font-size: 16.5px; }
.tl-item p { margin: 0; color: var(--ink-600); font-size: 15px; line-height: 1.55; max-width: var(--measure); }

/* ---------- Полоса прогресса ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--ink-100); overflow: hidden; }
.bar__fill { height: 100%; background: var(--jade-500); border-radius: 999px; transition: width .3s ease; }
.bar--red .bar__fill { background: var(--red-500); }
.bar--gold .bar__fill { background: var(--gold-400); }

/* ---------- Контакт-блок ---------- */
.contact-cta {
  background: var(--grad-fire); color: #fff; border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px) clamp(18px, 3vw, 32px); text-align: center;
}
.contact-cta h2 { color: #fff; }
.contact-cta p { color: rgba(255,255,255,.92); max-width: 560px; margin: 0 auto 22px; line-height: 1.5; }
.contact-cta .btn--light { color: var(--red-600); }

/* ---------- Подвал ---------- */
.site-footer { background: var(--ink-900); color: rgba(255,253,248,.7); padding: clamp(36px, 4vw, 52px) 0 24px; font-size: 15px; }
.site-footer a { color: rgba(255,253,248,.82); }
.site-footer a:hover { color: var(--paper-0); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: clamp(20px, 3vw, 32px); }
@media (max-width: 899px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 479px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h5 {
  font-family: var(--font-text); font-size: 13px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--paper-0); margin: 0 0 12px; font-weight: 600;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-links a { display: inline-block; min-height: 24px; }
.footer-about img { height: 38px; margin-bottom: 14px; }
.footer-about p { line-height: 1.5; max-width: 34ch; }
.footer-bottom {
  margin-top: clamp(24px, 3vw, 34px); padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: 13.5px; line-height: 1.5;
}
.social-row { display: flex; gap: 8px; flex-wrap: wrap; }
.social-row a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: 14px; text-decoration: none;
}
.social-row a:hover { background: rgba(255,255,255,.1); text-decoration: none; }

/* ---------- Плавающая кнопка WhatsApp ---------- */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  display: inline-flex; align-items: center; gap: 9px; min-height: 48px;
  background: var(--wa); color: var(--wa-ink); font-weight: 600; font-size: 15px;
  padding: 12px 18px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 8px 24px rgba(37,211,102,.4);
}
.wa-float:hover { text-decoration: none; background: var(--wa-dark); color: var(--wa-ink); }
@media (max-width: 767px) { .wa-float span { display: none; } .wa-float { padding: 12px; width: 52px; height: 52px; justify-content: center; } }
body.no-fab .wa-float { display: none; }

/* ---------- Список тем ---------- */
.topic-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius);
  padding: 13px 16px; min-height: 60px; cursor: pointer; color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.topic-row + .topic-row { margin-top: 10px; }
.topic-row:hover { border-color: var(--ink-200); box-shadow: var(--shadow-sm); text-decoration: none; }
.topic-row__main { flex: 1 1 auto; min-width: 0; }
.topic-row__name { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.topic-row__meta { font-size: 13.5px; color: var(--ink-600); margin-top: 4px; display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.topic-row__prog { flex: 0 0 120px; }
@media (max-width: 767px) { .topic-row__prog { display: none; } .topic-row { gap: 10px; } .topic-row > .btn { padding-left: 14px; padding-right: 14px; } }
.freq { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.freq--high { background: var(--red-050); color: var(--red-600); }
.freq--mid  { background: var(--gold-050); color: var(--gold-600); }
.freq--low  { background: var(--ink-100); color: var(--ink-600); }

/* Заголовок модуля над списком тем */
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.module-head__name { font-weight: 600; color: var(--ink-900); font-size: 15px; }
.module-block { margin-bottom: 26px; }

/* ---------- Тренажёр ---------- */
.quiz-shell { max-width: 760px; margin: 0 auto; }
.quiz-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: var(--fs-small); color: var(--ink-600);
}
.quiz-top__prog { flex: 1 1 140px; min-width: 100px; }
.timer { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.timer.is-low { color: var(--red-500); }

.qcard { background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius-lg); padding: var(--sp-card); }
.qcard__tag { font-size: 13px; color: var(--ink-600); margin-bottom: 10px; letter-spacing: .01em; }
.qcard__text { font-size: clamp(17.5px, 1rem + 0.5vw, 20px); font-weight: 500; line-height: 1.45; margin-bottom: 18px; text-wrap: pretty; }
.qcard__alt { font-size: 15px; color: var(--ink-600); font-style: italic; margin: -10px 0 18px; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 52px; background: var(--paper-0); border: 2px solid var(--ink-100); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; font-size: 16px; line-height: 1.4; color: var(--ink-900);
  transition: border-color .12s, background .12s, transform .08s;
}
.opt:hover:not([disabled]) { border-color: var(--ink-200); background: var(--ink-050); }
.opt:active:not([disabled]) { transform: scale(.995); }
.opt__k {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; background: var(--ink-100);
  display: grid; place-items: center; font-weight: 600; font-size: 13.5px; color: var(--ink-600);
}
.opt.is-picked { border-color: var(--blue-600); background: var(--blue-050); }
.opt.is-picked .opt__k { background: var(--blue-600); color: #fff; }
.opt.is-correct { border-color: var(--jade-500); background: var(--jade-050); }
.opt.is-correct .opt__k { background: var(--jade-500); color: #fff; }
.opt.is-wrong { border-color: var(--red-500); background: var(--red-050); }
.opt.is-wrong .opt__k { background: var(--red-500); color: #fff; }
.opt[disabled] { cursor: default; }
.opt[disabled]:not(.is-correct):not(.is-wrong) { opacity: .6; }

.explain { margin-top: 18px; border-top: 1px dashed var(--ink-200); padding-top: 16px; }
.explain__verdict { font-weight: 700; font-family: var(--font-display); font-size: 16px; margin-bottom: 8px; }
.explain__verdict.ok { color: var(--jade-600); }
.explain__verdict.no { color: var(--red-600); }
.explain p { color: var(--ink-600); margin-bottom: 0; line-height: 1.6; }

.quiz-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.quiz-actions .btn-row { margin-left: auto; }
@media (max-width: 479px) {
  .quiz-actions { flex-direction: column-reverse; align-items: stretch; }
  .quiz-actions .btn-row { margin-left: 0; }
  .quiz-actions .btn { width: 100%; }
}

/* ---------- Результаты ---------- */
.score-ring { display: grid; place-items: center; gap: 6px; }
.score-ring__n { font-family: var(--font-display); font-weight: 900; font-size: clamp(44px, 8vw, 60px); line-height: 1; color: var(--red-500); }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.result-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; margin-top: 6px; }
.dot--ok { background: var(--jade-500); } .dot--no { background: var(--red-500); }

/* ---------- Фильтры каталога ---------- */
.filters { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr 1fr; }
@media (max-width: 1023px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px)  { .filters { grid-template-columns: 1fr; } }
.filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter__label { font-size: 13px; font-weight: 600; color: var(--ink-600); text-transform: uppercase; letter-spacing: .05em; }
.input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; font: inherit; font-size: 15.5px;
  color: var(--ink-900); background: var(--paper-0);
  border: 1.5px solid var(--ink-200); border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--ink-400); }
.input:focus { outline: none; border-color: var(--red-500); box-shadow: 0 0 0 3px rgba(232,64,47,.14); }
select.input {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A5766' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer;
}
.filters__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ink-100);
}

/* ---------- Карта вузов и путь студента ---------- */
.cgmap { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; }
.cgmap--journey { grid-template-areas: "stage panel" "steps steps"; }
.cgmap--journey .cgmap__stage { grid-area: stage; }
.cgmap--journey .cgmap__side { grid-area: panel; }
.cgmap--journey .cgmap__steps { grid-area: steps; }
@media (max-width: 899px) {
  .cgmap, .cgmap--journey { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "panel" "steps"; }
}

.cgmap__stage {
  position: relative; background: linear-gradient(180deg, #F6F1E7 0%, #EFE7D8 100%);
  border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  padding: clamp(8px, 1.5vw, 16px); overflow: hidden;
}
.cgmap__svg { display: block; width: 100%; height: auto; }

/* Провинции: шесть мягких оттенков по макрорегионам */
.cgmap__prov path { stroke: rgba(29,27,38,.22); stroke-width: 1; stroke-linejoin: round; transition: fill .2s, stroke .2s; }
.cgmap__prov--ne path { fill: #EAF1F8; }
.cgmap__prov--n  path { fill: #F3ECE0; }
.cgmap__prov--e  path { fill: #E8F3EC; }
.cgmap__prov--s  path { fill: #FBEBDD; }
.cgmap__prov--sw path { fill: #F1EAF4; }
.cgmap__prov--nw path { fill: #F5EFD9; }
.cgmap__prov:hover path { fill: #FFFDF8; stroke: var(--ink-600); stroke-width: 1.4; }
.cgmap__prov.is-active path { fill: #FFF3E0; stroke: var(--red-500); stroke-width: 1.6; }

/* Города */
.cgmap__city { cursor: pointer; outline: none; }
.cgmap__pulse { fill: var(--red-500); opacity: 0; }
.cgmap__halo { fill: var(--red-500); opacity: 0; transition: opacity .15s; }
.cgmap__dot { fill: var(--red-500); stroke: var(--paper-0); stroke-width: 2; }
.cgmap__city:hover .cgmap__halo, .cgmap__city:focus-visible .cgmap__halo { opacity: .16; }
.cgmap__city.is-active .cgmap__dot { fill: var(--ink-900); }
.cgmap__city.is-active .cgmap__halo { opacity: .12; fill: var(--ink-900); }
.cgmap__city.is-active .cgmap__pulse { animation: cgmap-pulse 1.8s ease-out infinite; }
.cgmap__city--home .cgmap__dot { fill: var(--blue-600); }
.cgmap__city--home .cgmap__pulse { fill: var(--blue-600); animation: cgmap-pulse 2.4s ease-out infinite; }
.cgmap__label {
  font-family: var(--font-text); font-size: 13.5px; font-weight: 600; fill: var(--ink-900);
  paint-order: stroke; stroke: rgba(255,253,248,.92); stroke-width: 4px; stroke-linejoin: round;
  pointer-events: none; opacity: 0; transition: opacity .15s;
}
.cgmap__city--major .cgmap__label, .cgmap__city:hover .cgmap__label, .cgmap__city.is-active .cgmap__label { opacity: 1; }
.cgmap__city--major .cgmap__label { font-size: 15px; }
@media (max-width: 599px) {
  .cgmap__label { font-size: 17px; }
  .cgmap__city--major .cgmap__label { font-size: 19px; }
  .cgmap__prov path { stroke-width: 1.4; }
}
@keyframes cgmap-pulse {
  0%   { opacity: .35; transform: scale(.6); }
  100% { opacity: 0;   transform: scale(1.6); }
}
.cgmap__pulse { transform-box: fill-box; transform-origin: center; }

/* Появление карты: провинции проявляются волной, города «выпрыгивают» следом */
.cgmap--intro .cgmap__prov { opacity: 0; animation: cgmap-fade .5s ease-out forwards; animation-delay: calc(var(--i, 0) * 28ms); }
.cgmap--intro .cgmap__city { opacity: 0; transform-box: fill-box; transform-origin: center; animation: cgmap-pop .45s cubic-bezier(.2,.9,.3,1.3) forwards; animation-delay: calc(700ms + var(--i, 0) * 30ms); }
@keyframes cgmap-fade { to { opacity: 1; } }
@keyframes cgmap-pop  { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }

.cgmap__legend {
  position: absolute; left: 14px; bottom: 12px; display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-600); pointer-events: none;
}
.cgmap__legend span { display: inline-flex; align-items: center; gap: 6px; }
.cgmap__legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red-500); border: 2px solid var(--paper-0); box-shadow: 0 0 0 1px var(--ink-200); }
.cgmap__legend-dot--home { background: var(--blue-600); }
@media (max-width: 599px) { .cgmap__legend { position: static; margin-top: 8px; } }

/* Карточка города. На широких экранах она не выше карты и прокручивается внутри,
   чтобы вехи пути оставались сразу под картой */
.cgmap__side { min-height: 200px; }
.cgmap__panel { overflow: hidden; }
@media (min-width: 900px) {
  .cgmap__side { position: relative; align-self: stretch; }
  .cgmap__panel { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
}
.cgmap__card { padding: var(--sp-card); }
.cgmap__card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cgmap__vibe { font-size: 13.5px; color: var(--ink-600); margin-top: 2px; }
.cgmap__facts { display: grid; gap: 8px; margin: 0 0 12px; }
.cgmap__facts div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 14px; line-height: 1.4; }
.cgmap__facts dt { color: var(--ink-600); margin: 0; }
.cgmap__facts dd { margin: 0; color: var(--ink-900); }
.cgmap__note { margin-bottom: 12px; }
.cgmap__list-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-600); margin: 4px 0 6px; }
.cgmap__panel-empty { padding: var(--sp-card); }

/* Плашка города — когда фото нет */
.cgmap__tile {
  position: relative; height: 150px; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px 18px; color: var(--paper-0); overflow: hidden;
}
.cgmap__tile::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.22), transparent 55%);
}
.cgmap__tile-zh { position: absolute; right: 14px; top: 8px; font-size: 64px; line-height: 1; font-weight: 700; opacity: .22; letter-spacing: -.04em; }
.cgmap__tile-name { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.cgmap__tile--ne { background: linear-gradient(135deg, #2D5BFF, #1D1B26); }
.cgmap__tile--n  { background: linear-gradient(135deg, #C52A1B, #1D1B26); }
.cgmap__tile--e  { background: linear-gradient(135deg, #00A878, #1D1B26); }
.cgmap__tile--s  { background: linear-gradient(135deg, #E8402F, #FF8A3D); }
.cgmap__tile--sw { background: linear-gradient(135deg, #3A2E4F, #1D1B26); }
.cgmap__tile--nw { background: linear-gradient(135deg, #B07B00, #E8402F); }

/* Фото города, если задано в cities.js */
.cgmap__photo { margin: 0; position: relative; }
.cgmap__photo img { width: 100%; height: 170px; object-fit: cover; display: block; }
.cgmap__photo figcaption { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #fff; background: rgba(29,27,38,.55); padding: 2px 8px; border-radius: 999px; }

.cgmap__tip {
  position: absolute; z-index: 2; pointer-events: none;
  background: var(--ink-900); color: var(--paper-0); border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; line-height: 1.35; white-space: nowrap; box-shadow: var(--shadow-md);
}
.cgmap__tip b { display: block; }
.cgmap__tip span { color: rgba(255,253,248,.72); }

.cgmap__panel { background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius-lg); min-height: 200px; }
.cgmap__panel h3 { margin: 2px 0 0; }
.cgmap__panel-empty h3 { margin-bottom: 6px; }
.cgmap__list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.cgmap__list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ink-100); font-size: 15px; }
.cgmap__list li:last-child { border-bottom: 0; }
.cgmap__list a { color: var(--ink-900); font-weight: 500; }
.cgmap__list .chips { flex: 0 0 auto; gap: 4px; }
.cgmap__list .badge { padding: 3px 8px; font-size: 11px; }
.cgmap__panel .btn + .btn { margin-left: 8px; }
.cgmap__replay { margin-top: 4px; }

/* Маршрут */
.cgmap__route-bg { fill: none; stroke: var(--ink-200); stroke-width: 2; stroke-dasharray: 5 7; }
.cgmap__route-fg { fill: none; stroke: var(--red-500); stroke-width: 3; stroke-linecap: round; }
.cgmap__mark { fill: var(--paper-0); stroke: var(--ink-200); stroke-width: 2; transition: fill .2s, stroke .2s; }
.cgmap__mark.is-done { fill: var(--gold-400); stroke: var(--red-500); }
.cgmap__mover circle { fill: var(--ink-900); stroke: var(--paper-0); stroke-width: 2.5; }
.cgmap__mover-arrow { fill: none; stroke: var(--gold-400); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Степпер под картой */
.cgmap__steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1023px) { .cgmap__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px)  { .cgmap__steps { grid-template-columns: minmax(0, 1fr); } }
.cgmap__step {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius);
  color: inherit; text-decoration: none; transition: border-color .2s, background .2s, transform .2s;
}
.cgmap__step:hover { text-decoration: none; border-color: var(--ink-200); }
.cgmap__step-n {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  background: var(--ink-100); color: var(--ink-600); transition: background .2s, color .2s;
}
.cgmap__step-body { display: grid; gap: 2px; font-size: 13.5px; line-height: 1.35; color: var(--ink-600); min-width: 0; }
.cgmap__step-body b { color: var(--ink-900); font-size: 14.5px; }
.cgmap__step.is-done .cgmap__step-n { background: var(--jade-500); color: #fff; }
.cgmap__step.is-active { border-color: var(--red-500); background: var(--red-050); transform: translateY(-2px); }
.cgmap__step.is-active .cgmap__step-n { background: var(--red-500); color: #fff; }

/* ---------- Вход, регистрация, кабинет ---------- */
.auth-shell { max-width: 520px; margin: 0 auto; }
.auth-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--ink-050); border: 1px solid var(--ink-100); border-radius: 999px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.auth-tab {
  flex: 1 1 auto; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-600); font-weight: 600; font-size: 14.5px;
  cursor: pointer; white-space: nowrap; transition: background .12s, color .12s;
}
.auth-tab:hover { color: var(--ink-900); }
.auth-tab.is-active { background: var(--paper-0); color: var(--ink-900); box-shadow: var(--shadow-sm); }
.auth-form { display: grid; gap: 14px; }
.auth-form h2 { margin-bottom: 0; }
.auth-form > p { margin: -6px 0 2px; }
.auth-form .btn { margin-top: 4px; }
.auth-consent {
  display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small);
  color: var(--ink-600); line-height: 1.45; cursor: pointer;
}
.auth-consent input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--red-500); }
/* Подтверждение почты: код из письма */
.auth-email { color: var(--ink-900); overflow-wrap: anywhere; }
.auth-code {
  text-align: center; font-size: 26px; font-weight: 700; letter-spacing: .3em; padding-left: calc(14px + .3em);
  font-variant-numeric: tabular-nums;
}
.auth-code::placeholder { font-weight: 400; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-form .auth-links .btn { flex: 1 1 190px; margin-top: 0; }
.auth-form > .auth-note { margin: 0; font-size: var(--fs-small); color: var(--ink-600); }

/* ---------- Утилиты ---------- */
.hidden { display: none !important; }
.stack > * + * { margin-top: 14px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--ink-100); margin: clamp(24px, 3vw, 36px) 0; border: 0; }
.breadcrumb { font-size: var(--fs-small); color: var(--ink-600); margin-bottom: 12px; }
.breadcrumb a { color: var(--ink-600); }
.page-head { padding: clamp(32px, 4vw, 48px) 0 8px; }
.card-link { color: inherit; text-decoration: none; display: block; }
.card-link:hover { text-decoration: none; }
.nowrap { white-space: nowrap; }

/* ============================================================
   ПРОФТЕСТ
   ============================================================ */
.ct-part-intro { max-width: 720px; margin: 0 auto; }
.ct-scale { display: grid; gap: 8px; margin-top: 8px; }
.ct-scale__item { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-600); }
.ct-part-tag { font-size: 13px; color: var(--ink-600); white-space: nowrap; }
.ct-kbd { display: none; }
@media (min-width: 900px) { .ct-kbd { display: inline; } }
.ct-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-top: 22px; padding: 12px 16px; border-radius: var(--radius); background: rgba(255,253,248,.12);
  color: var(--paper-0); font-size: 15px;
}

/* Результат */
.ct-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end;
  background: linear-gradient(135deg, #C52A1B 0%, #1D1B26 100%); color: var(--paper-0);
  border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 36px); margin-top: 8px;
}
.ct-hero__actions { display: grid; gap: 8px; min-width: 220px; }
.ct-code { display: flex; gap: 8px; margin: 12px 0 14px; }
.ct-code span {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 8vw, 76px); line-height: 1;
  width: 1.25em; height: 1.25em; display: grid; place-items: center; border-radius: 16px;
  background: rgba(255,253,248,.1); border: 1px solid rgba(255,253,248,.2);
}
.ct-code span:first-child { background: var(--gold-400); color: var(--ink-900); border-color: transparent; }
.ct-hero__types { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-type-chip { display: inline-flex; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,253,248,.12); font-size: 14px; }
.ct-hero__p { margin: 14px 0 0; color: rgba(255,253,248,.78); max-width: 60ch; font-size: 15.5px; }
@media (max-width: 767px) {
  .ct-hero { grid-template-columns: minmax(0, 1fr); }
  .ct-hero__actions { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); min-width: 0; }
}

.ct-section { margin-top: clamp(28px, 4vw, 44px); }
.ct-section h2 { font-size: var(--fs-h3); margin-bottom: 6px; }
.ct-section > .muted { margin-bottom: 14px; }
.ct-bars { display: grid; gap: 14px; }
.ct-bars h4 { margin-bottom: 2px; }
.ct-bar__head { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; margin-bottom: 6px; align-items: baseline; }
.ct-bar__n { font-variant-numeric: tabular-nums; color: var(--ink-600); white-space: nowrap; }
.bar--blue .bar__fill { background: var(--blue-600); }

.ct-type { border-top: 4px solid var(--ink-200); }
.ct-type--red { border-top-color: var(--red-500); }
.ct-type--gold { border-top-color: var(--gold-400); }
.ct-type--jade { border-top-color: var(--jade-500); }
.ct-type--blue { border-top-color: var(--blue-600); }
.ct-type__head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ct-type__head h3 { margin: 0; font-size: 19px; }
.ct-type__letter {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; background: var(--ink-900); color: var(--paper-0);
}
.ct-type p { font-size: 15px; line-height: 1.55; }
.ct-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-roles .badge { font-weight: 500; text-transform: none; letter-spacing: 0; }

.ct-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-field {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px;
  background: var(--paper-0); border: 1.5px solid var(--ink-100); color: var(--ink-900); font-size: 15px; text-decoration: none;
  transition: border-color .12s, background .12s;
}
.ct-field:hover { border-color: var(--red-500); background: var(--red-050); text-decoration: none; }
.ct-field b { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--ink-900); color: var(--paper-0); }
.ct-field--none { color: var(--ink-600); border-style: dashed; }

.ct-list { margin: 8px 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.ct-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.ct-list li b { color: var(--ink-600); font-variant-numeric: tabular-nums; }
.ct-list li::marker { color: var(--red-500); font-weight: 600; }
.ct-dl { display: grid; gap: 10px; margin: 8px 0 0; }
.ct-dl div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.4; padding-bottom: 10px; border-bottom: 1px solid var(--ink-100); }
.ct-dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.ct-dl dt { color: var(--ink-600); margin: 0; }
.ct-dl dd { margin: 0; }
@media (max-width: 599px) { .ct-dl div { grid-template-columns: 1fr; gap: 2px; } }
.ct-insights { display: grid; gap: 12px; }
.ct-insights .callout { margin: 0; }
.ct-cta { margin-top: clamp(28px, 4vw, 44px); }

@media print {
  #site-header, #site-footer, .wa-float, .breadcrumb, .ct-hero__actions, .ct-cta, .quiz-actions { display: none !important; }
  .ct-hero { background: #1D1B26 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card, .ct-type { break-inside: avoid; }
  .quiz-shell { max-width: none; }
}

/* ============================================================
   ГЕЙТ «НУЖЕН АККАУНТ»
   ============================================================ */
.gate {
  max-width: 640px; margin: 16px auto 0; padding: clamp(24px, 4vw, 40px);
  background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius-lg); text-align: center;
}
.gate--wait { padding: 40px; }
/* Закрытое содержимое не показываем вовсе — класс is-open ставит js/gate.js после проверки входа */
[data-requires-auth]:not(.is-open) { display: none !important; }
.gate-page { padding: clamp(28px, 6vw, 72px) 0; }
.gate-page .gate { margin-top: 0; }
.gate--compact { margin-top: 0; }
.gate--compact .gate__title { font-size: var(--fs-h3); }
.gate__icon { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.gate__title { font-size: var(--fs-h2); margin-bottom: 10px; }
.gate__text { color: var(--ink-600); font-size: var(--fs-lead); line-height: 1.5; max-width: 50ch; margin: 0 auto 18px; }
.gate__list { text-align: left; max-width: 440px; margin: 0 auto 22px; }
.gate__note { margin-top: 14px; }

/* ============================================================
   V3 — РЕДИЗАЙН ПО ДИЗАЙН-СИСТЕМЕ CHINAGRANT
   Локап логотипа (эмблема + CHINA GRANT капителью), фирменная
   полоса grad-fire, декор: иероглиф-подложка и искра ✦.
   Правило 60/30/10 и «один градиент на экран» соблюдаем.
   ============================================================ */
:root {
  --font-logo: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-hanzi: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* --- Шапка: фирменная полоса + новый локап --- */
.site-header::before { content: ''; display: block; height: 3px; background: var(--grad-fire); }
.logo { gap: 11px; }
.logo img { height: 40px; }
.logo__text {
  font-family: var(--font-logo); font-weight: 600; font-size: 13px;
  letter-spacing: .24em; line-height: 1.3; color: var(--red-500); white-space: nowrap;
}
@media (max-width: 359px) { .logo__text { display: none; } }

/* --- Hero: тёплое свечение + иероглиф-подложка --- */
.hero {
  background:
    radial-gradient(640px 460px at 90% -12%, rgba(232,64,47,.4), transparent 66%),
    radial-gradient(560px 440px at -8% 112%, rgba(255,197,61,.13), transparent 70%),
    var(--grad-ink);
}
.hero::after {
  content: '学'; right: -30px; top: 50%; width: auto; height: auto;
  transform: translateY(-50%); background: none;
  font-family: var(--font-hanzi); font-weight: 700;
  font-size: clamp(220px, 26vw, 380px); line-height: 1;
  color: var(--gold-400); opacity: .07;
}
@media (max-width: 767px) { .hero::after { font-size: 230px; right: -70px; opacity: .055; } }
.hero-link { color: var(--gold-400); font-weight: 600; }
.hero-link:hover { color: #FFD76B; }

/* --- Кнопки: главный CTA сочнее --- */
.btn--primary { background: linear-gradient(135deg, #E8402F 0%, #FF6A3D 100%); }
.btn--primary:hover { background: linear-gradient(135deg, #C52A1B 0%, #E8402F 100%); }

/* --- Карточки: заметнее отклик на наведение --- */
.card--hover:hover { transform: translateY(-3px); border-color: rgba(232,64,47,.35); }

/* --- Заголовки секций: фирменная искра ✦ (декор, не текст) --- */
.sec-head h2::before {
  content: '✦'; color: var(--gold-400);
  font-size: .6em; vertical-align: .28em; margin-right: .5em;
}

/* --- Плитки цифр: золотая кромка и «огненные» числа --- */
.stat { border-top: 3px solid var(--gold-400); }
.stat__n {
  color: var(--red-600);
  background: linear-gradient(135deg, var(--red-500) 20%, #FF8A3D 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* --- Подвал: вертикальный локап + печать-штамп --- */
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.footer-brand img { height: 48px; margin: 0; filter: brightness(0) invert(1); opacity: .96; }
.footer-brand__t {
  font-family: var(--font-logo); font-weight: 600; font-size: 15px;
  letter-spacing: .24em; line-height: 1.35; color: var(--paper-0);
}
.seal {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 9px;
  background: var(--red-500); color: #fff; display: grid; place-items: center;
  font-family: var(--font-hanzi); font-size: 20px; line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255,253,248,.4);
}

/* --- CTA-плашка: лёгкая иероглиф-подложка --- */
.contact-cta { position: relative; overflow: hidden; }
.contact-cta::after {
  content: '梦'; position: absolute; right: -16px; top: -36px;
  font-family: var(--font-hanzi); font-weight: 700; font-size: 210px; line-height: 1;
  color: #fff; opacity: .09; pointer-events: none;
}
.contact-cta h2, .contact-cta p, .contact-cta .btn-row { position: relative; z-index: 1; }

/* --- Результат теста на уровень HSK --- */
.hsk-level-badge {
  font-family: var(--font-display); font-weight: 900; line-height: 1.1;
  font-size: clamp(40px, 6vw, 60px); letter-spacing: -.02em; color: var(--red-600);
}

/* ============================================================
   V4 — «ФАРФОР И КИНОВАРЬ»
   Светлая основа: страницы дышат, поверхности белые, тёмный тон —
   максимум одна секция. Заголовки h2/h3 — Golos (читабельность),
   Unbounded остаётся голосом бренда в h1 и больших цифрах.
   Полный свод правил — DESIGN.md.
   ============================================================ */

/* --- Типографика: дисплейный шрифт только для h1 --- */
h2, h3 { font-family: var(--font-text); letter-spacing: -0.015em; }
h2 { font-weight: 800; line-height: 1.22; }
h3 { font-weight: 700; line-height: 1.3; }

/* --- Белые поверхности на фарфоре --- */
.card, .qcard, .opt, .gate, .cgmap__panel, .cgmap__step, .topic-row, table.data, .step, .ct-field {
  background: var(--surface);
}
.card, .qcard, .gate { box-shadow: var(--shadow-sm); }
.card--ink { background: var(--ink-800); box-shadow: none; }
.contact-cta { box-shadow: 0 18px 44px rgba(196,48,31,.25); }

/* --- Hero: светлый фарфор с тёплым свечением --- */
.hero {
  background:
    radial-gradient(640px 420px at 88% -14%, rgba(232,64,47,.09), transparent 65%),
    radial-gradient(520px 400px at -6% 112%, rgba(245,188,64,.12), transparent 70%),
    var(--paper-0);
  color: var(--ink-900);
  border-bottom: 1px solid var(--ink-050);
}
.hero::after { color: var(--red-500); opacity: .05; }
.hero h1 { color: var(--ink-900); }
.hero__sub { color: var(--ink-600); }
.hero__note { color: var(--ink-600); }
.hero .breadcrumb, .hero .breadcrumb a { color: var(--ink-600); }
.hero .hero-link { color: var(--red-600); }
.hero .hero-link:hover { color: var(--red-500); }
.hero .btn--ghost-light {
  border-color: var(--ink-200); color: var(--ink-900); background: var(--surface);
}
.hero .btn--ghost-light:hover { border-color: var(--ink-900); background: var(--ink-050); }

/* Шаги 1-2-3 в hero — белые плитки, номер селадоном к цели */
.step { border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm); }
.step__t { color: var(--ink-800); }
.step:last-child .step__n { background: var(--jade-500); }

/* Баннер «у вас уже есть результат» на светлом hero */
.ct-banner {
  background: var(--surface); border: 1px solid var(--ink-100);
  color: var(--ink-900); box-shadow: var(--shadow-sm);
}
.ct-banner .btn--light { background: var(--red-500); color: #fff; }
.ct-banner .btn--light:hover { background: var(--red-600); }

/* Тёмный результат профтеста и CTA-плашка сохраняют белые ghost-кнопки */
.ct-hero .btn--ghost-light, .contact-cta .btn--ghost-light {
  border-color: rgba(255,253,248,.4); color: var(--paper-0); background: transparent;
}

/* --- Чипы-статусы: единый стиль «тинт + тёмный текст» --- */
.badge--red  { background: var(--red-050);  color: var(--red-600); }
.badge--gold { background: var(--gold-050); color: var(--gold-600); }
.badge--jade { background: var(--jade-050); color: var(--jade-600); }
.badge--blue { background: var(--blue-050); color: var(--blue-700); }

/* --- Шапка: фарфор --- */
.site-header { background: rgba(250,247,241,.92); }

/* --- Секции: у тёмной — мягкий переход --- */
.section--ink { background: var(--grad-ink); }

/* --- Плитки цифр: на белом --- */
.stat { background: var(--surface); }

/* --- Гейт --- */
.gate__title { font-size: var(--fs-h2); }

/* --- Иконки предметов: фирменные линейные (суаньпань · атом · колба) --- */
.subject-card__icon svg { width: 26px; height: 26px; display: block; }
.i-math { background: var(--red-050);  color: var(--red-600); }
.i-phys { background: var(--blue-050); color: var(--blue-700); }
.i-chem { background: var(--jade-050); color: var(--jade-600); }

/* ============================================================
   ФОТОГРАФИИ КАМПУСОВ
   Обложка карточки каталога, галерея на странице вуза и подпись
   с автором и лицензией. Подпись обязательна: большинство снимков
   под CC BY-SA. См. SOURCES.md §7.
   ============================================================ */

/* --- Обложка в карточке каталога: во всю ширину, поверх паддинга --- */
.card__media {
  margin: calc(-1 * var(--sp-card)) calc(-1 * var(--sp-card)) var(--sp-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  background: var(--paper-100);
  aspect-ratio: 3 / 2;
}
.card__media img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}

/* Плашка вместо фото: фарфор и один иероглиф киноварью */
.card__media--empty {
  display: grid; place-items: center;
  background:
    radial-gradient(120% 100% at 78% 0%, rgba(232,64,47,.07), transparent 62%),
    var(--paper-100);
}
.card__media--empty span {
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  font-size: clamp(44px, 9vw, 76px); font-weight: 700; line-height: 1;
  color: rgba(232,64,47,.14);
  user-select: none;
}

/* --- Снимок с подписью --- */
.figure { margin: 0; }
.figure__frame {
  border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--paper-100);
}
.figure__frame img { display: block; width: 100%; height: auto; }
.figure--crop .figure__frame { aspect-ratio: 3 / 2; }
.figure--crop .figure__frame img { height: 100%; object-fit: cover; }
.figure__credit {
  margin: 8px 2px 0;
  font-size: 13px; line-height: 1.45; color: var(--ink-600);
}
.figure__credit a { color: var(--ink-600); text-decoration: underline; text-underline-offset: 2px; }
/* Что на снимке: учебный корпус, кампус или общежитие */
.figure__kind {
  display: inline-block; margin-right: 8px; padding: 1px 8px;
  border-radius: 999px; background: var(--jade-050); color: var(--jade-600);
  font-size: 13px; font-weight: 600;
}
.figure__credit a:hover { color: var(--blue-600); }

/* Ведущий снимок кадрируем по 16:9: вертикальные кадры иначе занимают весь экран */
.figure--lead .figure__frame { aspect-ratio: 16 / 9; }

/* --- Галерея кампуса --- */
.gallery { display: grid; gap: var(--gap); }
.gallery--lead { grid-template-columns: minmax(0, 1fr); }
.gallery__rest { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--gap); }
@media (max-width: 599px) { .gallery__rest { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   СПРАВОЧНИК: карточки вузов, программы, гранты
   ============================================================ */
.fact, .input, .table-scroll { background: var(--surface); }

/* Пары «подпись — значение» */
.kv { display: grid; gap: 10px; margin: 0; }
.kv div {
  display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px;
  font-size: 15px; line-height: 1.45; padding-bottom: 10px; border-bottom: 1px solid var(--ink-100);
}
.kv div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv dt { color: var(--ink-600); margin: 0; }
.kv dd { margin: 0; color: var(--ink-900); font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 479px) { .kv div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Строка программы */
.prog { padding: 12px 0; border-bottom: 1px solid var(--ink-100); }
.prog:last-child { border-bottom: 0; padding-bottom: 0; }
.prog__name { font-weight: 600; font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; }
.prog__uni { font-size: 14.5px; margin-top: 3px; }
.prog__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ink-600); margin-top: 5px; }
.prog__csca { color: var(--jade-600); font-weight: 600; }
.prog-list { display: grid; gap: 0; }
.prog-list .prog { padding: 14px 0; }

/* Раскрывающийся хвост списка */
details.more { margin-top: 4px; }
details.more summary {
  cursor: pointer; display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--blue-600); font-weight: 600; font-size: 15px; list-style: none;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: '\00a0↓'; }
details.more[open] summary::after { content: '\00a0↑'; }

/* Список документов */
.doc-list { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; }
.doc-list li::marker { color: var(--red-500); font-weight: 600; }

/* Каталог: строка быстрых фактов и шесть фильтров в два ряда */
.card__quick { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; font-size: 13.5px; color: var(--jade-600); font-weight: 600; }
@media (min-width: 1024px) { .filters--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Чекбоксы-плашки (мои предметы CSCA) */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 6px 14px;
  border: 1.5px solid var(--ink-200); border-radius: 999px; background: var(--surface);
  cursor: pointer; font-size: 15px; user-select: none;
}
.check input { accent-color: var(--red-500); width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.check:has(input:checked) { border-color: var(--red-500); background: var(--red-050); }
.check:focus-within { outline: 3px solid var(--blue-600); outline-offset: 2px; }

/* Карточка вида гранта */
.grant { border-top: 4px solid var(--ink-200); }
.grant--red  { border-top-color: var(--red-500); }
.grant--gold { border-top-color: var(--gold-400); }
.grant--jade { border-top-color: var(--jade-500); }
.grant--blue { border-top-color: var(--blue-600); }
.grant__official { font-size: 13.5px; color: var(--ink-600); margin: -2px 0 12px; }
.grant ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; }

/* Строка стипендии в справочнике */
.sch { padding: 14px 0; border-bottom: 1px solid var(--ink-100); }
.sch:last-child { border-bottom: 0; }
.sch__name { font-weight: 600; font-size: 15.5px; line-height: 1.35; margin: 8px 0 4px; }
.sch__unis { font-size: 14.5px; color: var(--ink-600); }
