/* HDV IT – Hướng dẫn xử lý sự cố · Bản 2 (hiện đại)
   Điện thoại trước; chế độ sáng/tối bằng biến CSS. */

/* ---------- Biến màu: chế độ sáng ---------- */
:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #e8f0ff;
  --link: #1d4ed8;
  --header-bg: rgba(255, 255, 255, .78);
  --header-solid: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 6px rgba(15, 23, 42, .05);
  --shadow: 0 2px 4px -1px rgba(15, 23, 42, .05), 0 12px 28px -8px rgba(15, 23, 42, .14);
  --shadow-lg: 0 6px 12px -4px rgba(15, 23, 42, .08), 0 24px 48px -14px rgba(15, 23, 42, .24);
  --hero-from: #2563eb;
  --hero-to: #7c3aed;
  --self-bg: #effcf4;
  --self-border: #a7e3bd;
  --self-ink: #14532d;
  --self-badge: #15803d;
  --self-badge-ink: #ffffff;
  --it-bg: #f0f4fc;
  --it-border: #c9d6f0;
  --it-ink: #1e3a8a;
  --it-badge: #1e40af;
  --it-badge-ink: #ffffff;
  --warn-bg: #fff4f4;
  --warn-border: #f8c4c4;
  --warn-ink: #991b1b;
  --done-bg: #f4f1ff;
  --done-border: #d6ccfb;
  --done-ink: #4c1d95;
  --pill-amber-bg: #fef3c7;
  --pill-amber-ink: #7c2d12;
  --pill-blue-bg: #dbeafe;
  --pill-blue-ink: #1e3a8a;
  --code-bg: #0f172a;
  --code-ink: #e2e8f0;
  --code-border: #0f172a;
  --inline-code-bg: #eef2f7;
  --focus: #7c3aed;
  --radius: 18px;
  --radius-sm: 12px;
  --font: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
}

/* ---------- Biến màu: chế độ tối (chọn tay) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #131c2f;
  --surface-2: #1a2540;
  --text: #e6eaf2;
  --muted: #a7b3c6;
  --border: #26344f;
  --primary: #7aa7ff;
  --primary-strong: #9dbdff;
  --primary-soft: #1b2a4a;
  --link: #93b6ff;
  --header-bg: rgba(11, 17, 32, .74);
  --header-solid: #0b1120;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 28px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 6px 12px rgba(0, 0, 0, .35), 0 24px 48px -14px rgba(0, 0, 0, .7);
  --hero-from: #1e40af;
  --hero-to: #5b21b6;
  --self-bg: #0f2a1d;
  --self-border: #1f6a43;
  --self-ink: #a7f3c4;
  --self-badge: #4ade80;
  --self-badge-ink: #052e16;
  --it-bg: #14213b;
  --it-border: #2c4475;
  --it-ink: #bcd0ff;
  --it-badge: #93b4ff;
  --it-badge-ink: #0b1a3a;
  --warn-bg: #2a1417;
  --warn-border: #6b2a30;
  --warn-ink: #fecaca;
  --done-bg: #1f1a3a;
  --done-border: #463a85;
  --done-ink: #ddd6fe;
  --pill-amber-bg: #3a2a0c;
  --pill-amber-ink: #fde68a;
  --pill-blue-bg: #1b2a4a;
  --pill-blue-ink: #bfdbfe;
  --code-bg: #0f172a;
  --code-ink: #e2e8f0;
  --code-border: #334155;
  --inline-code-bg: #1e293b;
  --focus: #c4b5fd;
}

/* ---------- Chế độ tối theo hệ thống (khi chưa chọn tay) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1120;
    --surface: #131c2f;
    --surface-2: #1a2540;
    --text: #e6eaf2;
    --muted: #a7b3c6;
    --border: #26344f;
    --primary: #7aa7ff;
    --primary-strong: #9dbdff;
    --primary-soft: #1b2a4a;
    --link: #93b6ff;
    --header-bg: rgba(11, 17, 32, .74);
    --header-solid: #0b1120;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 28px -8px rgba(0, 0, 0, .55);
    --shadow-lg: 0 6px 12px rgba(0, 0, 0, .35), 0 24px 48px -14px rgba(0, 0, 0, .7);
    --hero-from: #1e40af;
    --hero-to: #5b21b6;
    --self-bg: #0f2a1d;
    --self-border: #1f6a43;
    --self-ink: #a7f3c4;
    --self-badge: #4ade80;
    --self-badge-ink: #052e16;
    --it-bg: #14213b;
    --it-border: #2c4475;
    --it-ink: #bcd0ff;
    --it-badge: #93b4ff;
    --it-badge-ink: #0b1a3a;
    --warn-bg: #2a1417;
    --warn-border: #6b2a30;
    --warn-ink: #fecaca;
    --done-bg: #1f1a3a;
    --done-border: #463a85;
    --done-ink: #ddd6fe;
    --pill-amber-bg: #3a2a0c;
    --pill-amber-ink: #fde68a;
    --pill-blue-bg: #1b2a4a;
    --pill-blue-ink: #bfdbfe;
    --code-bg: #0f172a;
    --code-ink: #e2e8f0;
    --code-border: #334155;
    --inline-code-bg: #1e293b;
    --focus: #c4b5fd;
  }
}

/* ---------- Nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 4.4vw, 1.65rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--primary-strong); }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
strong { font-weight: 700; }
code {
  font-family: var(--mono);
  font-size: .92em;
  background: var(--inline-code-bg);
  padding: .1em .4em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}
[hidden] { display: none !important; }
/* Đích của neo không bị thanh menu dính che (C11) */
[id] { scroll-margin-top: 84px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 792px; } /* 760 px nội dung + lề */
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

/* ---------- Thanh menu dính đầu trang ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-solid);
  border-bottom: 1px solid var(--border);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar {
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
  }
}
.bar { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  min-height: 44px; margin-right: auto;
}
.brand:hover { color: var(--text); }
.logo {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; font-weight: 800; font-size: .86rem; letter-spacing: .04em;
  box-shadow: 0 6px 14px -4px rgba(79, 70, 229, .55);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { font-size: .8rem; color: var(--muted); }

.bar-actions { display: flex; align-items: center; gap: 6px; order: 3; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.25rem; cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.icon-btn:hover { background: var(--surface-2); }
/* Nút "☰ Menu" có chữ (G8) */
.menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  width: auto; min-width: 44px; padding: 0 14px;
  font-size: 1rem; font-weight: 700;
}
.menu-btn span { font-size: 1.15rem; line-height: 1; width: 1.1em; text-align: center; }
/* Màn rất hẹp (320–374 px): bỏ dòng phụ của logo để không tràn ngang */
@media (max-width: 374px) {
  .brand-text small { display: none; }
  .bar { gap: 8px; }
  .brand { gap: 8px; }
  .menu-btn { padding: 0 10px; }
}
.icon-btn svg { width: 22px; height: 22px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}

.nav {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  margin: 0 12px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
}
.nav.open { display: block; }
.nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 14px;
  border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--link); }
.no-js .nav { display: block; position: static; margin: 0; box-shadow: none; border: 0; background: none; }

/* Menu con: danh sách chuyên mục */
.nav { max-height: calc(100vh - 88px); overflow-y: auto; }
.nav-sub { margin: 2px 0 6px 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.nav-sub a { min-height: 44px; font-weight: 500; font-size: .95rem; color: var(--muted, var(--text)); }
.nav-sub a::before { content: "›"; margin-right: 8px; color: var(--link); font-weight: 700; }

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .nav {
    display: flex !important; gap: 4px; position: static; order: 2;
    margin: 0; padding: 0; background: none; border: 0; box-shadow: none;
    max-height: none; overflow: visible;
  }
  .nav a { min-height: 44px; }
  .nav-group { position: relative; }
  .nav-group-title::after { content: "▾"; margin-left: 6px; font-size: .8em; }
  .nav-sub {
    display: none; position: absolute; top: 100%; left: 0; z-index: 60;
    min-width: 240px; margin: 0; padding: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-lg);
  }
  .nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub { display: block; }
  .nav-sub a { display: flex; white-space: nowrap; }
}

/* ---------- Phần mở đầu (hero) ---------- */
.hero {
  position: relative; overflow: hidden;
  color: #fff;
  background: linear-gradient(125deg, var(--hero-from) 0%, var(--hero-to) 100%);
  padding: 44px 0 56px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 70%);
}
.hero::before { width: 360px; height: 360px; right: -120px; top: -140px; }
.hero::after { width: 280px; height: 280px; left: -110px; bottom: -150px; }
.hero .wrap { position: relative; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero-lead { font-size: 1.06rem; max-width: 60ch; color: #fff; opacity: .96; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 700; letter-spacing: .02em;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}

.search { position: relative; max-width: 680px; margin-top: 24px; }
.search label { display: block; font-weight: 700; margin-bottom: 8px; }
.search-field { position: relative; }
.search-field svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; color: #475569; pointer-events: none;
}
.search input {
  width: 100%; min-height: 58px;
  padding: 14px 20px 14px 52px;
  font: inherit; font-size: 1rem; color: #0f172a;
  background: #fff; border: 2px solid transparent; border-radius: 999px;
  box-shadow: 0 14px 34px -10px rgba(15, 23, 42, .45), 0 2px 6px rgba(15, 23, 42, .12);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.search input::placeholder { color: #5b6678; }
.search input:focus { outline: none; border-color: #c4b5fd; box-shadow: 0 0 0 4px rgba(255, 255, 255, .35), 0 14px 34px -10px rgba(15, 23, 42, .45); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.chips span { font-size: .9rem; opacity: .95; }
.chip-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .92rem; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35);
  transition: background-color .2s ease;
}
.chip-btn:hover { background: rgba(255, 255, 255, .28); }
.chip-btn:focus-visible { outline-color: #fff; }

.results {
  margin-top: 14px; background: var(--surface); color: var(--text);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; max-width: 680px;
}
.results[hidden] { display: none; }
.results p { margin: 10px 12px; color: var(--muted); }
.results ul { list-style: none; margin: 0; padding: 0; }
.results li { margin: 0; }
.results a {
  display: block; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--text);
}
.results a:hover, .results a:focus-visible { background: var(--surface-2); }
.results .r-title { display: block; font-weight: 700; color: var(--link); }
.results .r-desc { display: block; font-size: .92rem; color: var(--muted); }

/* ---------- Khối trang ---------- */
.section { padding: 40px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Lưới chuyên mục: 2 cột điện thoại, 3 cột máy tính */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.cat-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; min-height: 100%;
  text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cat-card:hover { color: var(--text); transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.cat-card[aria-current="page"] { border: 2px solid var(--primary); }
.cat-name { font-weight: 750; font-size: 1.02rem; line-height: 1.3; margin-top: 6px; }
.cat-desc { font-size: .92rem; color: var(--muted); line-height: 1.5; flex: 1; }
.cat-count {
  align-self: flex-start; margin-top: 6px;
  font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--link);
}
.cat-count.zero { background: var(--surface-2); color: var(--muted); }
@media (min-width: 900px) { .cat-card { padding: 22px; } .cat-desc { font-size: .96rem; } }

/* Ô tròn biểu tượng */
.ic {
  display: inline-grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--tint, rgba(37, 99, 235, .12));
}
.ic svg { width: 30px; height: 30px; }
.ic.big { width: 72px; height: 72px; }
.ic.big svg { width: 42px; height: 42px; }
.t-m365 { --tint: rgba(37, 99, 235, .13); }
.t-net { --tint: rgba(13, 148, 136, .15); }
.t-nas { --tint: rgba(79, 70, 229, .14); }
.t-hw { --tint: rgba(234, 88, 12, .14); }
.t-win { --tint: rgba(14, 165, 233, .15); }
.t-ai { --tint: rgba(192, 38, 211, .14); }

/* Thẻ bài viết */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.post-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
@media (min-width: 900px) { .post-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.post-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { color: var(--text); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card h3 { margin: 0; font-size: 1.1rem; color: var(--text); }
.post-card p { margin: 0; color: var(--muted); font-size: .96rem; flex: 1; }
.post-top { display: flex; align-items: center; gap: 10px; }
.post-top .ic { width: 40px; height: 40px; }
.post-top .ic svg { width: 24px; height: 24px; }
.chip {
  display: inline-block; font-size: .82rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--link);
}
.post-meta { font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.read-more { font-weight: 700; color: var(--link); font-size: .95rem; }

/* Về tác giả */
.author {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 22px; margin: 8px 0 0;
}
.author .logo.xl { width: 72px; height: 72px; border-radius: 20px; font-size: 1.15rem; }
.author h3 { margin: 0; font-size: 1.2rem; }
.author .role { color: var(--muted); margin: 2px 0 10px; font-weight: 600; }
.author p:last-of-type { margin-bottom: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; text-decoration: none;
  background: linear-gradient(120deg, #2563eb, #6d28d9); color: #fff;
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .7);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(79, 70, 229, .8); }
button.btn { font: inherit; font-weight: 700; border: 0; cursor: pointer; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.ghost { background: var(--surface); color: var(--link); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { color: var(--primary-strong); }

/* ---------- Trang con ---------- */
.page { padding: 20px 0 32px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 0 0 18px; padding: 0; font-size: .92rem; color: var(--muted); }
.crumbs li { margin: 0; display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); }
.crumbs [aria-current] { padding: 11px 0; color: var(--muted); }

.page-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 22px; margin-bottom: 24px;
}
.page-head h1 { margin-bottom: 6px; }
.page-head p { margin: 0 0 6px; color: var(--muted); }

.empty {
  text-align: center; padding: 32px 20px; margin-bottom: 8px;
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface);
}
.empty svg { width: 64px; height: 64px; margin-bottom: 8px; }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); }
.empty .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Bài viết ---------- */
.article-head h1 { font-size: clamp(1.55rem, 5.6vw, 2.25rem); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 16px; }
.tags li {
  margin: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: .88rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.tags li.t-cat { background: var(--primary-soft); border-color: transparent; color: var(--link); }
.tags li.t-cat { padding: 0; }
.tags a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; }

/* Nút neo "Đi tới: Bạn tự làm" + Chia sẻ (G2, G9) */
.article-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 22px; }
.article-actions .btn { min-height: 48px; }
.share-status { flex-basis: 100%; margin: 0; font-size: .95rem; font-weight: 600; color: var(--self-badge); overflow-wrap: anywhere; }
.share-status:empty { margin: 0; }
.tags a:hover { text-decoration: underline; }
.tags svg { width: 16px; height: 16px; flex: none; }

.article > section { margin-bottom: 22px; }
.article h2 { margin-top: 0; }
.plain { padding: 20px; }
.plain ul { margin-bottom: 0; }
.summary {
  padding: 20px 20px 4px; border-left: 5px solid var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%);
}
.summary h2 { font-size: 1.15rem; color: var(--link); }

/* Bạn tự làm / Dành cho IT */
.box { border-radius: var(--radius); padding: 20px 18px 8px; border: 1.5px solid; }
.box.self { background: var(--self-bg); border-color: var(--self-border); }
.box.it { background: var(--it-bg); border-color: var(--it-border); }
.badge-h {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1.08rem; font-weight: 800; letter-spacing: .01em;
  padding: 8px 16px 8px 12px; border-radius: 999px; margin-bottom: 14px;
}
.badge-h svg { width: 20px; height: 20px; flex: none; }
.self .badge-h { background: var(--self-badge); color: var(--self-badge-ink); }
.it .badge-h { background: var(--it-badge); color: var(--it-badge-ink); }
.box-note { font-size: .98rem; }
.self .box-note { color: var(--self-ink); }
.it .box-note { color: var(--it-ink); }
.it-dont { margin-top: 4px; }

/* "Dành cho IT" thu gọn mặc định (G1) */
.box.it { padding-bottom: 16px; }
.it-details > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  min-height: 44px; cursor: pointer; list-style: none; border-radius: 14px;
}
.it-details > summary::-webkit-details-marker { display: none; }
.it-details > summary .badge-h { margin: 0; font-size: 1.02rem; }
.sum-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: .95rem; color: var(--it-ink); padding-left: 6px;
}
.sum-hint::after {
  content: ""; width: 9px; height: 9px; margin-left: 2px;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s ease;
}
.it-details[open] .sum-hint::after { transform: rotate(-135deg) translateY(-2px); }
.it-details .h-mo { display: none; }
.it-details[open] .h-mo { display: inline; }
.it-details[open] .h-dong { display: none; }
.it-details > summary:hover .sum-hint { text-decoration: underline; }
.it-details[open] > summary { margin-bottom: 14px; }

/* Nút lên đầu trang (G9) */
.to-top {
  position: fixed; z-index: 45;
  right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px; min-width: 48px; padding: 0 16px 0 14px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-lg);
}
.to-top svg { width: 20px; height: 20px; }
.to-top:hover { background: var(--surface-2); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 8px; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 16px 16px 8px 60px; margin-bottom: 12px; min-width: 0;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1rem;
}
.self .steps > li::before { background: var(--self-badge); color: var(--self-badge-ink); }
.it .steps > li::before { background: var(--it-badge); color: var(--it-badge-ink); }
.steps > li > p { margin: .5em 0; }
.steps ul { padding-left: 1.15em; margin: .3em 0 .8em; }
@media (max-width: 559px) {
  .box { padding: 16px 10px 4px; }
  .box > .badge-h, .box > .box-note { margin-left: 4px; margin-right: 4px; }
  .steps > li { padding: 14px 12px 6px 50px; }
  .steps > li::before { left: 10px; top: 12px; width: 30px; height: 30px; font-size: .95rem; }
  .steps > li > .code { margin-left: -38px; }
}
.steps li li { margin-bottom: .3em; }

/* Hộp lệnh */
.code {
  position: relative; margin: 10px 0 14px; max-width: 100%;
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 14px; box-shadow: 0 8px 20px -10px rgba(2, 6, 23, .6);
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 4px 4px 14px; border-bottom: 1px solid rgba(148, 163, 184, .2);
}
.code-lang { font-family: var(--mono); font-size: .78rem; color: #b4c0d3; letter-spacing: .04em; }
.copy {
  min-height: 44px; min-width: 96px; padding: 0 14px;
  font: inherit; font-size: .88rem; font-weight: 700;
  color: #e2e8f0; background: rgba(148, 163, 184, .16);
  border: 1px solid rgba(148, 163, 184, .35); border-radius: 10px; cursor: pointer;
  transition: background-color .2s ease;
}
.copy:hover { background: rgba(148, 163, 184, .3); }
.copy.ok { background: #15803d; border-color: #15803d; color: #fff; }
.copy:focus-visible { outline-color: #c4b5fd; }
.code pre {
  margin: 0; padding: 14px 16px 16px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.code code {
  display: block; background: none; padding: 0; border-radius: 0;
  font-family: var(--mono); font-size: .9rem; line-height: 1.65;
  color: var(--code-ink); white-space: pre; overflow-wrap: normal; width: max-content; min-width: 100%;
}

.box.done { background: var(--done-bg); border-color: var(--done-border); padding: 20px; }
.box.done h2 { color: var(--done-ink); display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.box.done p { margin: 0; }
.box.warn { background: var(--warn-bg); border-color: var(--warn-border); padding: 20px; }
.box.warn h2 { color: var(--warn-ink); display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.box.warn p { margin: 0; }
.box h2 svg { width: 26px; height: 26px; flex: none; }
.sources { font-size: .92rem; color: var(--muted); }
.sources h2 { font-size: 1.05rem; color: var(--text); }

/* ---------- Giới thiệu ---------- */
.profile {
  position: relative; overflow: hidden;
  padding: 24px; margin-bottom: 28px; color: #fff; border: 0;
  background: linear-gradient(125deg, var(--hero-from), var(--hero-to));
  box-shadow: var(--shadow);
}
.profile::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 70%);
}
.profile-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; position: relative; }
.profile .logo { width: 76px; height: 76px; border-radius: 22px; font-size: 1.2rem; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); box-shadow: none; }
.profile h1 { color: #fff; margin: 0; font-size: clamp(1.6rem, 6vw, 2.2rem); }
.profile .role { margin: 2px 0 0; font-weight: 600; }
.profile blockquote { margin: 0; position: relative; font-size: 1.04rem; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; } }
.stat {
  padding: 18px 16px; text-align: left;
  transition: transform .25s ease, box-shadow .25s ease;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat .num {
  display: block; font-size: 2.1rem; font-weight: 850; line-height: 1.1; letter-spacing: -.02em;
  color: var(--primary);
  margin-bottom: 6px;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .stat .num {
    background: linear-gradient(120deg, #2563eb, #7c3aed);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  :root[data-theme="dark"] .stat .num { background-image: linear-gradient(120deg, #93b6ff, #c4b5fd); }
}
@media (prefers-color-scheme: dark) {
  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    :root:not([data-theme="light"]) .stat .num { background-image: linear-gradient(120deg, #93b6ff, #c4b5fd); }
  }
}
.stat .lbl { font-size: .95rem; color: var(--muted); line-height: 1.45; display: block; }
.stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 640px) { .stat:last-child:nth-child(odd) { grid-column: auto; } }

.skills-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 900px) { .skills-top { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.skill {
  padding: 22px 18px 18px; position: relative;
  background: linear-gradient(90deg, #2563eb, #7c3aed) top / 100% 5px no-repeat, var(--surface);
}
.skill .rank {
  display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .03em;
  padding: 3px 10px; border-radius: 999px; background: var(--pill-blue-bg); color: var(--pill-blue-ink); margin-bottom: 8px;
}
.skill h3 { margin-bottom: 4px; }
.skill p { margin: 0; color: var(--muted); font-size: .96rem; }
.skills-other { padding: 18px 20px; }
.skills-other h3 { font-size: 1rem; color: var(--muted); }
.skills-other ol { margin: 0; padding-left: 1.4em; }

.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 900px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.project { padding: 20px; transition: transform .25s ease, box-shadow .25s ease; }
.project:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.project ul { margin-bottom: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.test { background: var(--pill-amber-bg); color: var(--pill-amber-ink); }
.pill.deploy { background: var(--pill-blue-bg); color: var(--pill-blue-ink); }
.contact { padding: 20px; }

/* ---------- Chân trang ---------- */
.footer {
  margin-top: 48px; padding: 28px 0 36px;
  background: var(--surface); border-top: 1px solid var(--border);
  font-size: .95rem; color: var(--muted);
}
.footer strong { color: var(--text); }
.footer p { margin: 0 0 .6em; }
.footer .brand-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer .logo { width: 36px; height: 36px; border-radius: 11px; font-size: .72rem; }

/* ---------- Hiệu ứng hiện thẻ ---------- */
.reveal { transition: opacity .55s ease, transform .55s ease; }
.reveal.hide { opacity: 0; transform: translateY(16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal.hide { opacity: 1; transform: none; }
  .cat-card:hover, .post-card:hover, .stat:hover, .project:hover, .btn:hover { transform: none; }
}

@media (min-width: 900px) {
  .hero { padding: 72px 0 84px; }
  .section { padding-top: 56px; }
  .page { padding-top: 28px; }
  .box { padding: 26px 26px 12px; }
  .page-head, .profile { padding: 32px; }
}

@media print {
  .topbar, .copy, .search, .chips, .to-top, .article-actions { display: none !important; }
  body { background: #fff; color: #000; }
}
