:root {
  --navy: #0b2545; --navy-2: #13315c; --ink: #1b2432; --muted: #64748b; --line: #e5e9f0;
  --bg: #f4f6fa; --card: #fff; --gold: #f2a900;
  --buy: #0f8a4a; --buy-bg: #e8f6ee; --sell: #c9302c; --sell-bg: #fdecec;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Be Vietnam Pro', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.num { font-variant-numeric: tabular-nums; }

/* Header */
header { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--navy); }
.logo-img { width: 44px; height: 44px; display: block; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--gold); display: grid; place-items: center; font-weight: 700; }
.links { display: flex; gap: 18px; margin-left: auto; }
.links a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .9rem; white-space: nowrap; }
.links a:hover, .links a.active { color: var(--navy); }
.menu-btn { display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer; color: var(--navy); }
/* Màn hình hẹp: menu thu vào nút ☰ */
@media (max-width: 1080px) {
  .menu-btn { display: block; }
  .hotline { margin-left: 0; }
  .links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(16,24,40,.08); padding: 6px 0; }
  .links.open { display: flex; }
  .links a { padding: 12px 20px; font-size: .95rem; }
}
.hotline { display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: #1a1300; text-decoration: none; font-weight: 700; padding: 9px 16px; border-radius: 999px; font-size: .92rem; white-space: nowrap; }
.hotline:hover { filter: brightness(1.05); }

/* Hero */
.hero { background: radial-gradient(1200px 400px at 80% -10%, #1d4a85 0%, transparent 60%), linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; padding: 40px 0 96px; }
.hero h1 { margin: 0 0 6px; font-size: 2rem; line-height: 1.25; letter-spacing: -.01em; }
.hero p { margin: 0; color: #c7d3e6; }
.live { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; font-size: .85rem; color: #dbe5f3; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61,220,132,.2); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: -64px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border: 1px solid var(--line); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.1); }
.stat-head { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); font-weight: 500; }
.tag { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2f8; color: var(--navy-2); }
.tag-binance { background: #fff6d6; color: #d9a000; font-weight: 700; } /* vàng tươi trên nền vàng nhạt */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.pair .k { font-size: .75rem; color: var(--muted); }
.pair .v { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.v.buy { color: var(--buy); } .v.sell { color: var(--sell); }
.stat-foot { margin-top: 8px; font-size: .78rem; color: var(--muted); min-height: 1.2em; }

/* Section */
section { padding: 36px 0 8px; }
[id] { scroll-margin-top: 72px; } /* không bị thanh header che khi bấm menu */
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: 1.35rem; color: var(--navy); }
.sec-head p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
/* Chỉ áp dụng cho bảng tỷ giá (.rates): thư viện biểu đồ cũng dùng <table> bên trong */
.rates { width: 100%; border-collapse: collapse; min-width: 700px; table-layout: fixed; }
.rates thead th { background: #f8fafc; color: var(--muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; line-height: 1.35; padding: 10px 14px; text-align: right; vertical-align: bottom; border-bottom: 1px solid var(--line); }
.rates thead tr.group th { text-align: center; font-size: .72rem; padding: 8px 14px 4px; border-bottom: 0; }
.rates thead tr.group th.bm { color: var(--navy); } .rates thead tr.group th.vcb { color: #006b3f; }
.rates .left { text-align: left; }
.rates .sep { border-left: 1px solid var(--line); }
.rates tbody td { padding: 12px 14px; border-bottom: 1px solid #eef1f5; text-align: right; white-space: nowrap; }
.rates tbody tr:last-child td { border-bottom: 0; }
.rates tbody tr { cursor: pointer; transition: background .12s; }
.rates tbody tr:hover { background: #f7f9fc; }
/* Cột ngoại tệ cố định khi cuộn ngang trên màn hình hẹp */
.rates .first { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.rates thead th.first { background: #f8fafc; }
.rates tbody td.first { background: var(--card); } .rates tbody tr:hover td.first { background: #f7f9fc; }
.cur { display: flex; align-items: center; gap: 10px; }
.flag { width: 28px; height: 21px; flex: none; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.badge { width: 40px; height: 28px; border-radius: 6px; background: #eef2f8; color: var(--navy); font-weight: 700; font-size: .74rem; display: grid; place-items: center; flex: none; }
.cur .name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; }
.rates td.buy { color: var(--buy); font-weight: 700; } .rates td.sell { color: var(--sell); font-weight: 700; }
.rates td.vcbv { color: #334155; }
.rates td.dash { color: #b6bfcc; }
.table-foot { padding: 12px 16px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* USDT detail */
.p2p { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.p2p .card { padding: 18px 20px; }
.p2p .k { font-size: .82rem; color: var(--muted); }
.p2p .v { font-size: 1.6rem; font-weight: 700; margin: 4px 0; }
.p2p .m { font-size: .82rem; color: var(--muted); line-height: 1.6; }

/* Alipay / WeChat */
.qr-grid { display: flex; justify-content: center; gap: 48px; padding: 18px 20px; }
.qr-item { text-align: center; }
.qr-item img { display: block; width: 140px; height: 140px; border-radius: 8px; }
.qr-head { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: .88rem; color: var(--navy); margin-top: 8px; }
.qr-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Subscribe + contact */
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.sub-card { padding: 26px; background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; border: 0; }
.sub-card h2 { margin: 0 0 6px; font-size: 1.35rem; }
.sub-card p { margin: 0 0 18px; color: #c7d3e6; font-size: .92rem; }
.form { display: grid; gap: 12px; }
.field label { display: block; font-size: .8rem; color: #c7d3e6; margin-bottom: 4px; font-weight: 500; }
.field input { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: inherit; }
.field input::placeholder { color: #8ea3c2; }
.field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn { border: 0; border-radius: 10px; background: var(--gold); color: #1a1300; font: inherit; font-weight: 700; padding: 12px 18px; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: wait; }
.consent { font-size: .75rem; color: #9fb2cf; margin: 0; }
.form-msg { font-size: .88rem; min-height: 1.3em; margin: 0; }
.form-msg.ok { color: #7ee2a8; } .form-msg.err { color: #ffb4b4; }

.contact { padding: 26px; }
.contact h2 { margin: 0 0 6px; font-size: 1.35rem; color: var(--navy); }
.contact > p { margin: 0 0 18px; color: var(--muted); font-size: .92rem; }
.ci { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.ci-ico { width: 42px; height: 42px; border-radius: 10px; background: #eef2f8; color: var(--navy); display: grid; place-items: center; flex: none; }
.ci .k { font-size: .78rem; color: var(--muted); }
.ci .v { font-weight: 600; text-decoration: none; }
.ci a.v:hover { color: var(--navy-2); text-decoration: underline; }
.ci .v.big { font-size: 1.3rem; color: var(--navy); }

footer { margin-top: 40px; background: #0a1c33; color: #93a4bd; font-size: .82rem; padding: 26px 0; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer p { margin: 0; max-width: 720px; }

/* Chart modal */
.modal { position: fixed; inset: 0; background: rgba(10,20,40,.55); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 960px; padding: 18px 20px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.modal-head h3 { font-size: 1.15rem; margin: 0; color: var(--navy); }
.modal-head .sub { font-size: .8rem; color: var(--muted); }
.close { border: 0; background: #f1f4f8; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; color: #475569; }
.close:hover { background: #e5e9f0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #f1f4f8; padding: 3px; border-radius: 10px; margin-bottom: 12px; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .82rem; font-weight: 500; cursor: pointer; color: #475569; }
.seg button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 600; }
#chart { width: 100%; height: 440px; position: relative; }
.chart-stats { position: absolute; top: 8px; left: 10px; z-index: 3; pointer-events: none; background: rgba(255,255,255,.88); border-radius: 10px; padding: 6px 10px; }
.chart-stats .k { font-size: .72rem; color: var(--muted); }
.chart-stats .mid { font-size: 1.35rem; font-weight: 700; color: var(--navy); line-height: 1.25; }
.chart-stats .chg { font-size: .82rem; font-weight: 600; color: var(--muted); }
.chart-stats .chg.up { color: var(--buy); } .chart-stats .chg.down { color: var(--sell); }
.chart-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: .9rem; padding: 16px; pointer-events: none; }

@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr; }
  .two, .p2p { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 28px 0 88px; }
  .hero h1 { font-size: 1.5rem; }
  .hotline .txt { display: none; }
  .row2 { grid-template-columns: 1fr; }
  #chart { height: 320px; }
  .brand span:last-child { font-size: 1rem; }
}

/* ---------- Kiến thức & Tin tức ---------- */
.page-hero { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; padding: 36px 0 40px; }
.page-hero h1 { margin: 0 0 6px; font-size: 1.9rem; }
.page-hero p { margin: 0; color: #c7d3e6; }
.news-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0 16px; }
.news-tabs a { text-decoration: none; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .88rem; font-weight: 500; color: #475569; }
.news-tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.news-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.news-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.1); }
.news-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #eef2f8; }
.news-cover-empty { display: grid; place-items: center; color: var(--navy-2); font-weight: 700; background: linear-gradient(135deg, #eef2f8, #dde6f3); }
.news-body { padding: 14px 16px 18px; }
.news-body h3 { margin: 8px 0 6px; font-size: 1.02rem; line-height: 1.4; color: var(--navy); }
.news-body p { margin: 0; font-size: .86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); }
.news-empty { padding: 32px; text-align: center; color: var(--muted); }
.article-wrap { max-width: 820px; padding-top: 20px; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--navy); text-decoration: underline; }
.article { padding: 28px 32px 32px; }
.article h1 { margin: 10px 0 8px; font-size: 1.9rem; line-height: 1.3; color: var(--navy); }
.article .lead { font-size: 1.05rem; color: #475569; margin: 0 0 18px; }
.article-cover { width: 100%; border-radius: 12px; margin-bottom: 18px; }
.prose { font-size: 1rem; line-height: 1.75; }
.prose h2 { font-size: 1.35rem; margin: 28px 0 10px; color: var(--navy); }
.prose h3 { font-size: 1.15rem; margin: 22px 0 8px; color: var(--navy); }
.prose h4 { font-size: 1rem; margin: 18px 0 6px; }
.prose p { margin: 0 0 14px; }
.prose a { color: #1d4ed8; }
.prose img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.prose blockquote { margin: 0 0 14px; padding: 8px 16px; border-left: 4px solid var(--gold); background: #fffbeb; color: #57534e; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.related-title { font-size: 1.2rem; color: var(--navy); margin: 32px 0 14px; }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .news-grid { grid-template-columns: 1fr; }
  .article { padding: 20px 18px 24px; }
  .article h1, .page-hero h1 { font-size: 1.5rem; }
}
/* Trang ngắn: đẩy footer xuống dưới */
.page-hero + main, .article-wrap { min-height: 50vh; }
