/* TriwayShow — kiểu dùng chung cho mọi trang của triwayshow.com.
   Làm cho điện thoại rộng 360–390 px trước, rồi mới tới màn hình rộng.
   Không tải phông, ảnh hay tệp nào từ tên miền khác. */

:root {
  --navy: #1f2a5c;
  --cam: #f47b20;
  --cam-sang: #ff9440;
  --cam-dam: #b4500c;
  --cam-nhat: #fff3e8;
  --nen: #f3f5fb;
  --xanh-nhat: #e9edfa;
  --chu: #1b2340;
  --mo: #555d7c;
  --vien: #dfe4f2;
  --bo: 18px;
  --bong: 0 2px 14px rgba(31, 42, 92, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 17px/1.65 system-ui, "Segoe UI", Roboto, Arial, sans-serif; overflow-wrap: break-word; }
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--cam-dam); }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--navy); text-wrap: balance; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin: 6px 0; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
kbd { font: inherit; font-weight: 700; white-space: nowrap; background: var(--xanh-nhat); border: 1px solid #c9d1ec; border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; }
code { font-family: Consolas, "Courier New", monospace; font-size: .94em; background: var(--xanh-nhat); border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere; }
[id] { scroll-margin-top: 14px; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.dau :focus-visible, .mo-dau :focus-visible, .dau-trang :focus-visible, .keu-goi :focus-visible, .chan :focus-visible { outline-color: #fff; }

.khung { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.hep { max-width: 800px; }

.bo-qua { position: absolute; left: 8px; top: -80px; z-index: 5; background: #fff; color: var(--navy); font-weight: 700; padding: 10px 14px; border-radius: 10px; }
.bo-qua:focus { top: 8px; }

/* ---------- thanh đầu trang ---------- */
.dau { background: var(--navy); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .13); }
.dau .khung { display: flex; flex-wrap: wrap; align-items: center; column-gap: 18px; padding-top: 6px; padding-bottom: 8px; }
.ten { display: inline-flex; align-items: center; min-height: 48px; margin-right: auto; font-size: 23px; font-weight: 800; letter-spacing: .2px; color: #fff; text-decoration: none; }
.ten span { color: var(--cam); }
.ten:hover { color: #fff; }
.muc { display: flex; flex: 1 0 100%; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px; }
.muc a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 6px; font-size: 16px; font-weight: 600; color: #e6eaff; text-decoration: none; border-radius: 10px; }
.muc a:hover { color: #fff; text-decoration: underline; }
.muc a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--cam); border-radius: 0; }
.muc a.tai { padding: 0 18px; background: var(--cam); color: var(--navy); font-weight: 800; border-radius: 12px; }
.muc a.tai:hover { background: var(--cam-sang); color: var(--navy); text-decoration: none; }

/* ---------- mở đầu (trang chính) và đầu các trang trong ---------- */
.mo-dau, .dau-trang { background: var(--navy); color: #fff; }
.mo-dau { padding: 30px 0 42px; background: radial-gradient(620px 320px at 96% -12%, rgba(244, 123, 32, .24), transparent 70%), var(--navy); }
.mo-dau h1 { color: #fff; font-size: clamp(29px, 7.6vw, 46px); line-height: 1.2; margin-bottom: 14px; }
.mo-dau .dan, .dau-trang .dan { margin: 0; font-size: 18px; color: #dfe5ff; max-width: 660px; }
.mo-dau .nut { margin-top: 24px; }
.dieu-kien { margin: 12px 0 0; font-size: 16px; color: #cdd5f7; }
.tren-dt { margin: 14px 0 0; padding: 12px 14px; font-size: 16px; color: #fff; background: rgba(255, 255, 255, .1); border-radius: 12px; max-width: 660px; }
.ba-y { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.ba-y li { margin: 0; padding-left: 30px; position: relative; color: #eef1ff; }
.ba-y li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: var(--cam); color: var(--navy); font-weight: 800; font-size: 14px; line-height: 22px; text-align: center; }
.phu { margin: 14px 0 0; }
.phu a { display: inline-flex; align-items: center; min-height: 48px; color: #fff; font-weight: 600; }
.dau-trang { padding: 24px 0 30px; }
.dau-trang h1 { color: #fff; font-size: clamp(27px, 6.6vw, 38px); margin-bottom: 10px; }
.ban-tam { display: inline-block; margin: 0 0 12px; padding: 4px 12px; font-size: 16px; font-weight: 700; color: var(--navy); background: #ffd9b8; border-radius: 999px; }

/* ---------- nút ---------- */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 12px 24px; font: inherit; font-size: 18px; font-weight: 800; line-height: 1.3; text-align: center; text-decoration: none; color: var(--navy); background: var(--cam); border: 2px solid var(--cam); border-radius: 14px; cursor: pointer; }
.nut:hover { background: var(--cam-sang); border-color: var(--cam-sang); color: var(--navy); }
.nut.vien { background: #fff; border-color: #c3ccea; font-size: 17px; font-weight: 700; min-height: 48px; padding: 10px 18px; }
.nut.vien:hover { background: var(--xanh-nhat); border-color: var(--navy); }
.nut.day { display: flex; width: 100%; }
.hang-nut { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- khối nội dung ---------- */
main { display: block; padding-bottom: 8px; }
.phan { padding-top: 38px; }
.phan > h2, .tieu-de { font-size: clamp(23px, 5.6vw, 30px); margin-bottom: 8px; }
.gioi { margin: 0 0 16px; color: var(--mo); max-width: 700px; }
.the { background: #fff; border-radius: var(--bo); box-shadow: var(--bong); padding: 20px 18px; margin-top: 16px; }
.the > h2 { font-size: 22px; margin-bottom: 10px; }
.the h3 { font-size: 19px; margin: 16px 0 6px; }
.the h3:first-child { margin-top: 0; }
.ghi { font-size: 16px; color: var(--mo); }
.luu-y { margin: 14px 0 0; padding: 12px 14px; background: var(--cam-nhat); border-left: 5px solid var(--cam); border-radius: 0 12px 12px 0; }
.luu-y b:first-child { color: var(--cam-dam); }
.xem-them { margin: 16px 0 0; }
.xem-them a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }

/* các bước có số */
.buoc { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: buoc; }
.buoc > li { counter-increment: buoc; position: relative; margin: 0; padding: 18px 18px 18px 68px; background: #fff; border-radius: var(--bo); box-shadow: var(--bong); }
.buoc > li::before { content: counter(buoc); position: absolute; left: 16px; top: 16px; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 19px; line-height: 38px; text-align: center; }
.buoc h3 { font-size: 19px; margin: 4px 0 6px; }
.buoc .nut { margin-top: 12px; }

/* tình huống trên lớp + khung điện thoại */
.canh { display: grid; gap: 22px; align-items: center; margin-top: 16px; padding: 22px 18px 26px; background: #fff; border-radius: var(--bo); box-shadow: var(--bong); }
.canh h3 { font-size: 21px; margin-bottom: 8px; }
.canh .nhan { display: block; margin-bottom: 6px; font-size: 16px; font-weight: 700; color: var(--cam-dam); }
.may { width: min(232px, 72%); margin: 0 auto; padding: 20px 9px 14px; position: relative; background: var(--navy); border-radius: 32px; box-shadow: 0 14px 32px rgba(31, 42, 92, .22); }
.may::before { content: ""; position: absolute; top: 8px; left: 50%; width: 46px; height: 5px; margin-left: -23px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
.may img { display: block; position: relative; width: 100%; height: auto; aspect-ratio: 9 / 19; object-fit: cover; overflow: hidden; border-radius: 20px; background: linear-gradient(160deg, var(--xanh-nhat), var(--cam-nhat)); color: var(--mo); font-size: 15px; line-height: 1.5; text-align: center; }
/* khi ảnh chưa có: phủ kín khung bằng nền màu + chữ alt (trình duyệt chỉ vẽ ::after cho ảnh hỏng) */
.may img::after { content: attr(alt); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px 14px; background: linear-gradient(160deg, var(--xanh-nhat), var(--cam-nhat)); }

/* lưới và thẻ số */
.luoi-3, .luoi-2 { display: grid; gap: 12px; margin-top: 16px; }
.so { margin: 0; padding: 16px; background: #fff; border-radius: 14px; box-shadow: var(--bong); }
.the .so { background: var(--nen); box-shadow: none; }
.so b { display: block; font-size: 25px; line-height: 1.3; color: var(--navy); }
.so span { display: block; margin-top: 2px; color: var(--mo); font-size: 16px; }
.nhom { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.nhom li { margin: 0; padding: 12px 14px; background: var(--nen); border-radius: 12px; }
.nhom b { display: block; color: var(--navy); }

/* bảng */
.cuon { overflow-x: auto; margin-top: 12px; }
.bang { width: 100%; border-collapse: collapse; font-size: 16px; }
.bang th, .bang td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--vien); vertical-align: top; }
.bang th { color: var(--navy); background: var(--nen); }
.bang tr:last-child td { border-bottom: 0; }

/* mục lục */
.muc-luc { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.muc-luc li { margin: 0; }
.muc-luc a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; font-size: 16px; font-weight: 600; text-decoration: none; background: #fff; border: 1px solid var(--vien); border-radius: 999px; }
.muc-luc a:hover { border-color: var(--navy); color: var(--navy); }

/* hỏi đáp */
.hd { margin-top: 14px; }
.hd > h2 { font-size: 21px; margin: 28px 0 4px; }
details { margin-top: 10px; background: #fff; border-radius: 14px; box-shadow: var(--bong); }
summary { position: relative; display: block; list-style: none; cursor: pointer; padding: 15px 50px 15px 18px; font-weight: 700; color: var(--navy); line-height: 1.45; border-radius: 14px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 18px; top: 50%; margin-top: -17px; font-size: 26px; font-weight: 400; line-height: 34px; color: var(--cam-dam); }
details[open] summary::after { content: "−"; }
.tl { padding: 0 18px 16px; }

/* mã mời */
.nguoi { margin: 10px 0 0; font-size: 18px; color: #dfe5ff; }
.nguoi b { color: #fff; }
.ma { min-height: 84px; margin: 8px 0 12px; padding: 12px 8px; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; letter-spacing: 6px; line-height: 1.3; text-align: center; color: var(--cam-dam); background: var(--cam-nhat); border: 2px dashed var(--cam); border-radius: 14px; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.ma.sai { font-size: 22px; letter-spacing: 0; color: var(--chu); }

/* lời gọi cuối trang */
.keu-goi { margin-top: 40px; padding: 30px 20px; text-align: center; color: #fff; background: var(--navy); border-radius: var(--bo); }
.keu-goi h2 { color: #fff; font-size: clamp(23px, 5.6vw, 30px); margin-bottom: 8px; }
.keu-goi p { color: #dfe5ff; max-width: 620px; margin-left: auto; margin-right: auto; }
.keu-goi .nut { margin-top: 10px; }
.keu-goi .dieu-kien { margin-top: 12px; }

/* ---------- chân trang ---------- */
.chan { margin-top: 46px; padding: 22px 0 30px; background: var(--navy); color: #cdd5f7; font-size: 16px; }
.chan nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 4px 0 10px; }
.chan nav a { display: inline-flex; align-items: center; min-height: 48px; color: #fff; }
.chan nav a:hover { color: #ffd9b8; }
.chan .dong { margin: 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .16); }

/* ---------- màn hình rộng ---------- */
@media (min-width: 720px) {
  .dau .khung { flex-wrap: nowrap; padding-top: 8px; }
  .muc { flex: 0 1 auto; flex-wrap: nowrap; gap: 6px; }
  .muc a { padding: 0 12px; }
  .muc a.tai { margin-left: 8px; }
  .mo-dau { padding: 54px 0 62px; }
  .dau-trang { padding: 38px 0 42px; }
  .ba-y { grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 28px; }
  .phan { padding-top: 54px; }
  .the { padding: 26px 28px; }
  .luoi-3 { grid-template-columns: repeat(3, 1fr); }
  .luoi-2 { grid-template-columns: repeat(2, 1fr); }
  .nhom { grid-template-columns: repeat(2, 1fr); }
  .canh { grid-template-columns: 1fr 232px; gap: 44px; padding: 32px 44px; }
  .canh:nth-of-type(even) { grid-template-columns: 232px 1fr; }
  .canh:nth-of-type(even) .may { order: -1; }
  .canh .may { width: 232px; }
  .co-anh { display: grid; grid-template-columns: 1fr 210px; gap: 32px; align-items: start; }
  .co-anh .may { width: 210px; }
  .keu-goi { padding: 44px 28px; }
}
@media (min-width: 900px) {
  .buoc.ba { grid-template-columns: repeat(3, 1fr); }
  .buoc.ba > li { padding: 70px 22px 22px; }
  .buoc.ba > li::before { left: 22px; top: 20px; }
}
@media (max-width: 719px) {
  .co-anh .may { margin-top: 20px; }
}
/* máy có chuột (máy tính lớp): không cần lời nhắc dành cho người đang xem bằng điện thoại */
@media (hover: hover) and (pointer: fine) {
  .tren-dt { display: none; }
}

/* ---------- chuyển động: chỉ khi người dùng không tắt ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .nut, .muc a, .muc-luc a { transition: background-color .15s, border-color .15s, color .15s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- in ra giấy (thầy cô hay in trang hướng dẫn) ---------- */
@media print {
  body { background: #fff; font-size: 12pt; }
  .dau .muc, .chan nav, .bo-qua, .nut, .muc-luc, .may { display: none !important; }
  .dau, .mo-dau, .dau-trang, .chan, .keu-goi { background: #fff !important; color: #000; }
  .dau-trang h1, .mo-dau h1, .ten, .keu-goi h2 { color: #000; }
  .the, .buoc > li, .canh, details { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
}
