/* Engly — bảng màu: mực xanh đậm trên giấy, bút dạ vàng làm điểm nhấn duy nhất */
:root{
  --ink:#16213E; --ink-2:#243356; --paper:#FCFCFA; --card:#FFFFFF;
  --marker:#FFD23F; --teal:#14877B; --coral:#E8505B; --muted:#6C7A96;
  --line:#E4E8F0; --radius:14px;
  --shadow:0 1px 0 var(--line), 0 8px 24px -18px rgba(22,33,62,.45);
}
*{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",sans-serif;
  font-size:16px; line-height:1.65; padding-bottom:76px;
}
a{color:var(--ink); text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%}
:focus-visible{outline:3px solid var(--marker); outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

.wrap{max-width:960px; margin:0 auto; padding:0 18px}
h1,h2,h3{line-height:1.25; letter-spacing:-.02em; margin:0 0 .5em}
h1{font-size:1.95rem; font-weight:800}
h2{font-size:1.3rem; font-weight:700}
h3{font-size:1.05rem; font-weight:700}
p{margin:0 0 1em}
.muted{color:var(--muted)}
.small{font-size:.86rem}

/* nét bút dạ — điểm nhấn thương hiệu, chỉ dùng cho tiêu đề mục */
.mark{position:relative; display:inline; z-index:0}
.mark::after{
  content:""; position:absolute; left:-2px; right:-2px; bottom:.08em; height:.42em;
  background:var(--marker); z-index:-1; border-radius:2px 8px 3px 6px;
}

/* thanh trên */
header.top{background:var(--ink); color:#fff; padding:12px 0}
header.top a{color:#fff}
.top-row{display:flex; align-items:center; gap:14px}
.logo{font-weight:800; font-size:1.15rem; letter-spacing:-.03em; text-decoration:none!important}
.logo span{color:var(--marker)}
.top-nav{margin-left:auto; display:flex; gap:18px; align-items:center; font-size:.93rem}
.top-nav .desk{display:none}
@media(min-width:820px){ .top-nav .desk{display:inline} body{padding-bottom:0} }
.avatar{width:32px;height:32px;border-radius:50%;object-fit:cover;background:var(--ink-2)}

/* thanh dưới (mobile) */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:40; display:flex;
  background:#fff; border-top:1px solid var(--line); padding:6px 0 8px;
}
@media(min-width:820px){ .tabbar{display:none} }
.tabbar a{flex:1; text-align:center; font-size:.72rem; color:var(--muted); text-decoration:none!important}
.tabbar a b{display:block; font-size:1.15rem; line-height:1.4}
.tabbar a.on{color:var(--ink); font-weight:600}

/* thẻ */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:16px}
.grid{display:grid; gap:14px}
@media(min-width:700px){ .grid.two{grid-template-columns:1fr 1fr} .grid.three{grid-template-columns:repeat(3,1fr)} }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--ink); color:#fff; border:0; border-radius:10px; cursor:pointer;
  font:inherit; font-weight:600; padding:12px 18px; text-decoration:none!important;
}
.btn:hover{background:var(--ink-2)}
.btn.ghost{background:transparent; color:var(--ink); border:1.5px solid var(--ink)}
.btn.mk{background:var(--marker); color:var(--ink)}
.btn.block{width:100%}
.btn[disabled]{opacity:.5; cursor:default}
.btn.g,.btn.f{background:#fff;color:var(--ink);border:1.5px solid var(--line)}
.btn.g svg,.btn.f svg{width:18px;height:18px}

input,select,textarea{
  font:inherit; color:var(--ink); width:100%; padding:11px 13px;
  border:1.5px solid var(--line); border-radius:10px; background:#fff;
}
textarea{min-height:110px; resize:vertical}
label{display:block; font-weight:600; font-size:.9rem; margin:14px 0 6px}

.chip{
  display:inline-block; font-size:.76rem; font-weight:600; padding:3px 9px;
  border-radius:999px; background:#EEF1F7; color:var(--ink-2);
}
.chip.vocab{background:#E4F4F1; color:#0F6B60}
.chip.grammar{background:#FFF3D1; color:#7A5B00}

/* hero: thẻ luyện nhanh */
.hero{padding:26px 0 8px}
.hero h1{margin-bottom:.35em}
.quickcard{margin-top:18px; background:var(--card); border:1px solid var(--line); border-radius:18px; padding:18px; box-shadow:var(--shadow)}
.qprompt{font-size:1.15rem; font-weight:700; margin:6px 0 14px}
.opt{
  display:block; width:100%; text-align:left; background:#fff; border:1.5px solid var(--line);
  border-radius:12px; padding:12px 14px; margin-bottom:9px; font:inherit; cursor:pointer;
}
.opt:hover{border-color:var(--ink)}
.opt.right{border-color:var(--teal); background:#EAF6F4}
.opt.wrong{border-color:var(--coral); background:#FDEDEE}
.opt b{color:var(--muted); margin-right:8px}

/* tiến độ */
.stats{display:flex; gap:10px; flex-wrap:wrap; margin:14px 0}
.stat{flex:1 1 90px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 12px}
.stat b{display:block; font-size:1.35rem; line-height:1.2}
.bar{height:8px; background:#EEF1F7; border-radius:99px; overflow:hidden}
.bar i{display:block; height:100%; background:var(--marker)}

/* danh sách bài học */
.lesson{display:block; padding:14px 0; border-bottom:1px solid var(--line)}
.lesson:hover{text-decoration:none}
.lesson h3{margin:6px 0 4px}
.lesson .meta{font-size:.83rem; color:var(--muted)}
.lesson.done h3::after{content:" ✓"; color:var(--teal)}

/* nội dung bài học */
.article{max-width:68ch}
.article h3{margin-top:1.6em}
.article table{width:100%; border-collapse:collapse; margin:1em 0; font-size:.94rem}
.article th,.article td{border:1px solid var(--line); padding:8px 10px; text-align:left}
.article th{background:#F4F6FA}
.article blockquote{margin:1em 0; padding:10px 14px; border-left:4px solid var(--marker); background:#FFFBEF}
.table-scroll{overflow-x:auto}

/* từ vựng */
.word{display:flex; gap:12px; padding:12px 0; border-bottom:1px dashed var(--line)}
.word b{font-size:1.02rem}
.word .ipa{color:var(--muted); font-size:.85rem}

/* xếp hạng */
.rank{display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line)}
.rank .no{width:28px; text-align:center; font-weight:800; color:var(--muted)}
.rank .no.top{color:var(--ink)}
.rank .xp{margin-left:auto; font-weight:700}
.rank.me{background:#FFFBEF; margin:0 -10px; padding:11px 10px; border-radius:10px}

/* cộng đồng */
.thread{padding:14px 0; border-bottom:1px solid var(--line)}
.thread .who{display:flex; align-items:center; gap:8px; font-size:.85rem; color:var(--muted)}
.thread .who img{width:26px;height:26px;border-radius:50%}
.reply{padding:12px 0 12px 12px; border-left:2px solid var(--line)}
.tabs{display:flex; gap:8px; overflow:auto; padding:4px 0 12px}
.tabs button{background:#fff; border:1.5px solid var(--line); border-radius:999px; padding:7px 14px; font:inherit; cursor:pointer; white-space:nowrap}
.tabs button.on{background:var(--ink); color:#fff; border-color:var(--ink)}

.notice{padding:12px 14px; border-radius:12px; background:#FFF3D1; margin:14px 0}
.empty{padding:28px 6px; color:var(--muted)}
footer.foot{margin-top:38px; padding:22px 0 34px; border-top:1px solid var(--line); color:var(--muted); font-size:.86rem}
.toast{position:fixed; left:50%; bottom:88px; transform:translateX(-50%); background:var(--ink); color:#fff;
  padding:11px 18px; border-radius:99px; z-index:80; box-shadow:var(--shadow); font-size:.9rem}

/* thẻ ghi nhớ */
.fcard{background:var(--card); border:1px solid var(--line); border-radius:18px; padding:26px 20px;
  text-align:center; box-shadow:var(--shadow); margin:10px 0 16px}
.fword{font-size:2rem; font-weight:800; letter-spacing:-.02em; line-height:1.2}
.fcard .ipa{color:var(--muted); margin-top:2px}
.fmean{font-size:1.15rem; font-weight:600; margin-top:16px; padding-top:16px; border-top:1px dashed var(--line)}
.speak{background:none; border:0; cursor:pointer; font-size:.72em; padding:2px 6px; border-radius:8px; line-height:1}
.speak:hover{background:#EEF1F7}
