/* Bố cục: khung trang, 4 đích điều hướng (menu bên / thanh hẹp / thanh dưới), bảng tên ga */

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 24px 32px 48px; max-width: 1200px; }

/* ---------- điều hướng: 4 đích chính ----------
 * Theo mẫu app học ngôn ngữ (tham khảo trên Mobbin) và NN/g, Material 3, Apple HIG:
 *   - ít đích (4), nhãn ngắn luôn hiện; trang lẻ nằm trong trang tổng hợp của từng đích
 *   - máy tính ≥ 1100px: menu bên đủ chữ · 861–1099px: thanh hẹp chỉ có ô hình · điện thoại: thanh dưới 4 tab
 *   - chỗ đang đứng báo bằng nhiều tín hiệu: ô thành biển hiệu màu tuyến, nền nhạt, viền, chữ đậm
 * Ô vuông như quân mạt chược có hình nét mảnh (người mới chưa đọc được chữ Hán vẫn nhận ra). */
.sidenav {
  position: sticky; top: 0; height: 100vh; width: var(--nav-w); flex: 0 0 var(--nav-w);
  background: var(--nav-bg); backdrop-filter: blur(12px); border-right: 1px solid var(--border);
  padding: 16px 14px 12px; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin;
}
/* biển hiệu quán: nền màu biển hiệu, một đường viền kem lùi vào, chữ kem */
.brand {
  --sign: var(--brand, var(--minibus-red)); --ink: var(--hk-cream, var(--cream));
  position: relative; display: block; flex: 0 0 auto; margin: 0 0 18px; padding: 9px 14px 11px; border-radius: 10px; text-align: center;
  color: var(--ink); text-decoration: none !important; background-color: var(--sign);
  box-shadow: inset 0 0 0 5px var(--sign), inset 0 0 0 6px color-mix(in srgb, var(--ink) 50%, transparent), var(--shadow);
}
.brand:hover { filter: brightness(1.05); }
.brand-zh { display: inline-flex; align-items: flex-end; gap: 6px; font-family: var(--font-zh-serif); font-weight: 900; font-size: 1.75rem; line-height: 1.45; letter-spacing: .1em; }
.brand-zh rt { font-family: var(--font); font-size: .36em; font-weight: 700; letter-spacing: 0; }
.brand-zh rt span, .brand-zh .jp span { color: inherit !important; }
.brand-zh i, .brand-mini i { font-style: normal; font-family: var(--font); font-weight: 800; font-size: .8em; letter-spacing: -.02em; line-height: 1.45; }
.brand-mini { display: none; font-family: var(--font-zh-serif); font-weight: 900; font-size: 1.5rem; line-height: 1.2; }
.brand-mini i { display: block; font-size: .62em; line-height: 1; }
.brand small { display: block; margin-top: -1px; font-size: .74rem; font-weight: 600; letter-spacing: .04em; color: color-mix(in srgb, var(--ink) 90%, transparent); }
.nav-main { display: flex; flex-direction: column; gap: 6px; }
.navlink {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 7px 10px; min-height: 56px; border-radius: 12px;
  color: var(--text); text-decoration: none !important; border: 2px solid transparent;
}
.navlink:hover { background: var(--surface-2); }
.navlink .nv { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.navlink .nv b { font-weight: 700; font-size: 1rem; }
.navlink .nv small { font-size: .74rem; white-space: nowrap; color: var(--muted); }
.navlink .nv small .zc { font-family: var(--font-zh); }
/* ô chữ: quân mạt chược nổi nhẹ; trang đang mở thì thành biển hiệu màu tuyến, chữ kem */
.nav-tile {
  --plate: color-mix(in oklab, var(--line, var(--accent)) var(--plate-mix, 100%), var(--bg));
  --edge: color-mix(in srgb, var(--field, var(--faint)) 50%, var(--border));
  position: relative; flex: 0 0 auto; width: 38px; height: 40px; display: grid; place-items: center; border-radius: 8px;
  font-family: var(--font-zh-serif); font-weight: 900; font-size: 1.12rem; line-height: 1; color: var(--text);
  background: var(--surface); border: 1px solid var(--edge); box-shadow: 0 2px 0 var(--edge); transition: transform .12s;
}
.nav-tile svg { width: 23px; height: 23px; display: block; }
.navlink:hover .nav-tile { transform: translateY(-1px); }
.navlink.active { background: color-mix(in oklab, var(--line) 10%, var(--surface)); border-color: color-mix(in oklab, var(--line) 45%, transparent); }
.navlink.active .nv b { font-weight: 800; }
.active > .nav-tile {
  background: var(--plate); color: var(--hk-cream, var(--cream)); border-color: transparent;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--plate) 65%, #000);
}
/* số thẻ đến hạn trên ô Luyện tập */
.nav-badge {
  position: absolute; top: -7px; right: -9px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font: 800 .68rem/1 var(--font); font-style: normal; letter-spacing: 0;
  background: var(--bad); color: var(--on-bad, #fff); box-shadow: 0 0 0 2px var(--nav-bg, var(--bg));
}
.nav-badge[hidden] { display: none; }
.nav-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.nav-foot .theme-chip { margin: 0; }
.voice-chip { font-size: .78rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.bottombar { display: none; }

/* màn vừa: thanh hẹp chỉ có ô hình (tên đầy đủ hiện khi rê chuột) */
@media (min-width: 861px) and (max-width: 1099px) {
  :root { --nav-w: 84px; }
  .sidenav { padding: 14px 10px 12px; align-items: center; }
  .brand { padding: 8px 6px 9px; width: 60px; }
  .brand-zh, .brand small { display: none; }
  .brand-mini { display: block; }
  .nav-main { align-items: center; }
  .navlink { padding: 6px; min-height: 0; width: 60px; justify-content: center; }
  .navlink .nv { display: none; }
  .nav-foot .voice-chip { display: none; }
  .nav-foot .theme-chip { padding: 2px; justify-content: center; }
  .nav-foot .theme-chip a { display: none; }
}

@media (max-width: 860px) {
  .sidenav { display: none; }
  .main { padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(92px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  /* thanh dưới: 4 đích, hình + nhãn ngắn; ô hình chỉ thành biển hiệu ở mục đang mở nên thanh nhẹ mắt */
  .bottombar {
    display: flex; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 0 max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
    background: var(--nav-bg); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    box-shadow: 0 -10px 24px -18px rgba(var(--shadow-rgb, 0, 0, 0), .7); justify-content: space-around; align-items: stretch;
  }
  .bottombar a {
    position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 0 4px;
    color: var(--muted); font-size: .72rem; font-weight: 700; text-decoration: none !important;
  }
  .bottombar .nav-tile { width: 46px; height: 32px; border-radius: 10px; background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
  .bottombar .nav-tile svg { width: 22px; height: 22px; }
  .bottombar .active > .nav-tile { background: var(--plate); color: var(--hk-cream, var(--cream)); box-shadow: 0 2px 0 color-mix(in srgb, var(--plate) 65%, #000); }
  .bottombar .bl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottombar .active { color: var(--text); font-weight: 800; }
  .bottombar .nav-badge { top: -4px; right: -2px; }
}

/* ---------- bảng tên ga MTR (đầu trang) ---------- */
.station {
  --line: var(--l-red);
  position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 18px; color: #fff;
  background-color: var(--line);
  box-shadow: var(--shadow);
  padding: 18px 22px 16px; display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
}
.station .back { position: absolute; top: 10px; left: 14px; color: rgba(255, 255, 255, .85); font-size: .85rem; font-weight: 600; }
.station .back + .plate { margin-top: 18px; }
.station .plate { min-width: 0; }
.station .plate-zh { font-family: var(--font-zh-serif); font-weight: 900; font-size: 2.3rem; line-height: 1.35; letter-spacing: .06em; }
.station .plate-zh rt { font-family: var(--font); letter-spacing: 0; font-size: .38em; font-weight: 700; color: #fff; }
.station .plate-zh rt span { color: #fff !important; }
.station .plate-vi { font-weight: 800; font-size: 1.2rem; line-height: 1.35; margin-top: 2px; }
.station .plate-sub { color: rgba(255, 255, 255, .88); font-size: .9rem; margin-top: 4px; max-width: 720px; }
.station .side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.station .side .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; }
.station .side .btn:hover { background: rgba(255, 255, 255, .26); }
.station .progress { background: rgba(0, 0, 0, .25); }
.station .progress > i { background: var(--cream); }
.station small, .station .muted { color: rgba(255, 255, 255, .85); }
@media (max-width: 560px) { .station { padding: 14px 16px 14px; } .station .plate-zh { font-size: 1.8rem; } .station .plate-vi { font-size: 1.05rem; } }
