/* sosanhduan.com: bảng màu khai ở :root, nền tối chỉ ghi đè */
:root {
  --paper: #f3f5f4;
  --surface: #ffffff;
  --ink: #15201d;
  --ink-2: #485652;
  --line: #c9d2ce;
  --line-strong: #7d8b86;
  --accent: #0b6e5f;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ec;
  --note-bg: #fff4e0;
  --note-ink: #6e4100;
  --radius: 10px;
  --measure: 70ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1513;
    --surface: #161f1c;
    --ink: #e5ece9;
    --ink-2: #a7b4af;
    --line: #2d3a36;
    --line-strong: #6f807a;
    --accent: #56c4ae;
    --accent-ink: #0a1411;
    --accent-soft: #19302b;
    --note-bg: #2b2112;
    --note-ink: #f2c98a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1513; --surface: #161f1c; --ink: #e5ece9; --ink-2: #a7b4af;
  --line: #2d3a36; --line-strong: #6f807a; --accent: #56c4ae; --accent-ink: #0a1411;
  --accent-soft: #19302b; --note-bg: #2b2112; --note-ink: #f2c98a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Đầu trang */
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 64px; }
.brand { font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; padding: 8px 2px; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* Mở đầu trang chủ */
.hero { padding: 56px 0 40px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 20ch; }
.hero p { font-size: 18px; color: var(--ink-2); margin: 0 0 24px; max-width: 52ch; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 12px 20px; border-radius: var(--radius); min-height: 44px; }
.btn:hover { filter: brightness(1.08); }

section { padding: 32px 0; }
h2 { font-size: 26px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 19px; line-height: 1.4; margin: 24px 0 8px; }
.lede { color: var(--ink-2); max-width: 64ch; margin: 0 0 20px; }

/* Bảng so sánh: phần tử chữ ký là nhãn nguồn dưới từng ô số */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.cmp { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 15.5px; line-height: 1.55; }
table.cmp th, table.cmp td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.cmp thead th { background: var(--accent-soft); font-weight: 600; }
table.cmp tbody th { font-weight: 600; width: 22%; color: var(--ink); }
table.cmp tr:last-child th, table.cmp tr:last-child td { border-bottom: 0; }
.src { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.src::before { content: "Nguồn: "; font-weight: 600; }
.na { color: var(--ink-2); font-style: italic; }

/* Danh sách bài */
.post-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.post-list li { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 120px 1fr; gap: 4px 20px; }
.post-list time { color: var(--ink-2); font-size: 14px; padding-top: 3px; }
.post-list a { font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; }
.post-list a:hover { color: var(--accent); }
.post-list p { grid-column: 2; margin: 2px 0 0; color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 600px) {
  .post-list li { grid-template-columns: 1fr; }
  .post-list p { grid-column: 1; }
}

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.steps li { counter-increment: s; padding-left: 44px; position: relative; margin-bottom: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 14px; display: grid; place-items: center; }

/* Hộp lưu ý */
.note { background: var(--note-bg); color: var(--note-ink); border-radius: var(--radius); padding: 14px 18px; font-size: 15.5px; line-height: 1.6; }
.note strong { color: inherit; }

/* Bài viết */
.crumb { font-size: 14px; color: var(--ink-2); padding-top: 20px; }
.crumb a { color: var(--ink-2); }
.article-head { padding: 16px 0 8px; max-width: var(--measure); }
.article-head h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.22; letter-spacing: -0.02em; margin: 0 0 12px; }
.article-head .sub { color: var(--ink-2); font-size: 18px; margin: 0 0 12px; }
.meta { font-size: 14px; color: var(--ink-2); }
.article-body { max-width: var(--measure); padding-bottom: 24px; }
.article-body > .table-scroll { max-width: none; }
.article-body h2 { margin-top: 40px; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 6px; }
.key-facts { border-left: 4px solid var(--accent); background: var(--surface); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0; }
.key-facts p { margin: 0 0 6px; font-weight: 600; }
.key-facts ul { margin: 0; }
.wide { max-width: 1120px; }
.cta-box { border: 1.5px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; background: var(--surface); margin: 32px 0; }
.cta-box p { margin: 0 0 10px; }
.cta-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-links a { border: 1.5px solid var(--accent); padding: 9px 14px; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.cta-links a:hover { background: var(--accent); color: var(--accent-ink); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq .faq-a p { margin: 8px 0 0; color: var(--ink); }
.related { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 32px; }
.related ul { padding-left: 20px; }

/* Chân trang */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px; font-size: 14.5px; color: var(--ink-2); background: var(--surface); }
.site-foot p { margin: 0 0 8px; max-width: 80ch; }
.site-foot a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
