/* Học viện Pháo Đài Số — lớp giao diện đè lên style.css của sotay, theo nhận diện phaodaiso.fpt.edu.vn:
   đêm xanh thẫm của tường thành, lửa cam FPT, ánh sáng số xanh ngọc. Mặc định tối; nút ◐ chuyển sang sáng. */
:root {
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Chakra Petch", "Be Vietnam Pro", system-ui, sans-serif;
  --serif: var(--display);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --topbar: 62px; --radius: 12px;
  --fire: #f27125; --fire-2: #ff8a3d; --amber: #ffb547; --cyan: #33e1d4;
}
:root, :root[data-theme="dark"], :root[data-theme="auto"] {
  --accent: #f27125; --link: #ffb547;
  --bg: #0a1022; --surface: #10183a; --surface-2: #172150; --fg: #e8ecf8; --muted: #a3aed0;
  --line: rgb(148 163 255 / .16); --code-bg: #0d1430; --shadow: 0 10px 30px rgb(0 0 0 / .25);
  --ok: #4ade80; --ok-bg: rgb(74 222 128 / .1); --bad: #ff6b6b; --bad-bg: rgb(255 107 107 / .1);
  --warn: #ffb547; --warn-bg: rgb(255 181 71 / .1); --info: #33e1d4; --info-bg: rgb(51 225 212 / .08);
  --vio: #b9a4ff; --vio-bg: rgb(185 164 255 / .1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --accent: #c2410c; --link: #b45309;
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #eceffa; --fg: #10183a; --muted: #4f5a7e;
  --line: #dde1f0; --code-bg: #eef0f8; --shadow: 0 1px 2px rgb(16 24 58 / .06), 0 6px 18px rgb(16 24 58 / .06);
  --ok: #15803d; --ok-bg: #e9f7ee; --bad: #b42318; --bad-bg: #fdecea; --warn: #a15c00; --warn-bg: #fff4e0;
  --info: #0e7490; --info-bg: #e6f7fa; --vio: #6d28d9; --vio-bg: #f1eafe;
  color-scheme: light;
}
body { font-family: var(--font); }
a { color: var(--link); }
a:hover { color: var(--fire-2); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
h1, h2, .content h2, .hero h1, .chapter-card h3 { font-family: var(--display); letter-spacing: .01em; }
.hero h1 { font-weight: 700; }
.skip { background: var(--fire); color: #fff; border-radius: 8px; }

/* Đầu trang */
.topbar { background: rgb(10 16 34 / .86); border-bottom-color: rgb(148 163 255 / .14); color: #e8ecf8; }
:root[data-theme="light"] .topbar { background: rgb(10 16 34 / .94); }
.topbar .icon-btn, .topbar .menu-btn { color: #e8ecf8; }
.topbar .icon-btn:hover { background: rgb(255 255 255 / .08); }
.brand { color: #e8ecf8; }
.brand-logo { width: 34px; height: 34px; border-radius: 0; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: .06em; font-size: 1.02rem; max-width: 40vw; }
.brand-name b { color: var(--fire); }
.search input { background: rgb(255 255 255 / .06); border-color: rgb(148 163 255 / .22); color: #e8ecf8; }
.search input::placeholder { color: #a3aed0; }
.top-actions { align-items: center; }
.top-link { color: #a3aed0; text-decoration: none; font-weight: 500; font-size: .9rem; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.top-link:hover { color: #fff; background: rgb(255 255 255 / .06); }
.top-cta { color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--fire), var(--fire-2)); box-shadow: 0 6px 18px rgb(242 113 37 / .35); margin-right: 6px; }
.top-cta:hover { color: #fff; background: linear-gradient(135deg, var(--fire-2), var(--fire)); }
@media (max-width: 980px) { .top-link:not(.top-cta) { display: none; } }
@media (max-width: 640px) { .top-cta, .brand-name { display: none; } }

/* Nút */
.btn { border-radius: 10px; border: 2px solid transparent; background: linear-gradient(135deg, var(--fire), var(--fire-2)); color: #fff;
  box-shadow: 0 8px 22px rgb(242 113 37 / .28); padding: 9px 18px; font-weight: 700; transition: transform .15s; }
.btn:hover { color: #fff; transform: translateY(-1px); filter: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: color-mix(in srgb, var(--fg) 25%, transparent); box-shadow: none; }
.btn.ghost:hover { border-color: var(--cyan); color: var(--fg); }
.btn.complete.is-done { background: var(--ok); color: #06210f; box-shadow: none; }

/* Trang chủ */
.home .hero { position: relative; margin: 0 -24px; padding: 40px 24px 36px; border-radius: 0 0 18px 18px; overflow: hidden;
  background: radial-gradient(700px 320px at 85% 20%, rgb(51 225 212 / .13), transparent 60%),
              radial-gradient(600px 300px at 0% 0%, rgb(242 113 37 / .18), transparent 60%), #0a1022; color: #e8ecf8; }
.home .hero::before { content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: linear-gradient(rgb(148 163 255 / .14) 1px, transparent 1px), linear-gradient(90deg, rgb(148 163 255 / .14) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%); }
.home .hero > * { position: relative; }
.home .hero .eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #a3aed0; border: 1px solid rgb(148 163 255 / .16);
  background: rgb(255 255 255 / .03); padding: 5px 14px; border-radius: 999px; font-size: .88rem; text-transform: none; letter-spacing: 0; }
.home .hero .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.home .hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: .03em; margin: 18px 0 10px; color: #fff; }
.home .hero h1 .fire { color: var(--fire); text-shadow: 0 0 36px rgb(242 113 37 / .45); }
.home .hero .lede { color: #c9d1ea; }
.home .hero .meta-strip dt { color: #a3aed0; }
.home .hero .meta-strip dd { color: #e8ecf8; }
.home .hero .btn.ghost { color: #e8ecf8; border-color: rgb(255 255 255 / .22); }
.home .hero #overall-text { color: #a3aed0; }
.chapter-card { border-radius: 16px; }
.chapter-card .ch-no { color: var(--fire); font-family: var(--display); font-weight: 700; letter-spacing: .04em; }
.clo-id { color: var(--cyan); }
:root[data-theme="light"] .clo-id { color: var(--info); }

/* Bài học */
.lesson-hero .eyebrow { color: var(--fire); font-family: var(--display); font-weight: 700; letter-spacing: .06em; }
.sidebar ol a.current { color: var(--fire); background: rgb(242 113 37 / .12); }
:root[data-theme="light"] .sidebar ol a.current { color: var(--accent); }
.sidebar .sb-label { color: var(--muted); }
code { color: var(--cyan); }
:root[data-theme="light"] code { color: #0e7490; }
pre code { color: inherit; }
.site-footer { font-family: var(--display); letter-spacing: .06em; font-size: .9rem; }

/* Thay thuộc tính style nội tuyến (CSP style-src 'self') */
[data-align="center"] { text-align: center; }
[data-align="right"] { text-align: right; }
[data-cols="2"] { --cols: 2; } [data-cols="3"] { --cols: 3; } [data-cols="4"] { --cols: 4; }
.search-results .sr-empty { padding: 8px 10px; }

/* Sơ đồ dựng sẵn (SVG) và công thức MathML */
.diagram { margin: 1.4em 0; padding: 16px; background: #10183a; border: 1px solid rgb(148 163 255 / .16); border-radius: 14px; text-align: center; overflow-x: auto; }
.diagram img { max-width: 100%; height: auto; border-radius: 0; }
.math-r math { font-size: 1.1em; }
.math-r.math-block { display: block; margin: 1em 0; overflow-x: auto; text-align: center; }
.diagram figcaption { margin-top: 8px; font-size: .8rem; color: #a3aed0; }
@media (min-width: 700px) { .diagram img { min-width: min(100%, 560px); } }
