* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #222;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky breadcrumb bar: breadcrumb left, search right, same line */
.topbar {
  position: sticky;
  top: 43px;
  background: #ffffff;
  z-index: 10;
}
.topbar-inner {
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
.topbar .search { margin-left: auto; }
.crumbs { font-size: 14px; color: #555; font-weight: 700; }
.crumbs a { color: #555; text-decoration: none; font-weight: 700; }
.crumbs a:hover { color: #b45309; }
.crumbs .here { color: #222; font-weight: 700; }
.search input {
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  width: 130px;
}

/* CBLE section menu: the full customsclass menu, plain links */
.menu-wrap {
  padding: 12px 28px 0;
}
.menu { font-size: 14px; }
.menu a { color: #555; text-decoration: none; margin-right: 16px; font-weight: 700; }
.menu a:hover { color: #b45309; }
.menu .here { color: #222; font-weight: 700; margin-right: 16px; }

main {
  max-width: 720px;
  margin: 0;
  padding: 24px 28px 40px;
  flex: 1 0 auto;
  width: 100%;
}

/* Door pages (SHSAT / SAT): heading and door buttons centered like the homepage */
main.doorpage {
  max-width: none;
  text-align: left;
  /* Round 5 (2026-11-19): padding-top 24px -> 0. Part of the doorpage
     alignment fix below: the 24px main top padding is one of the fixed
     offsets that pushed the door-page calendar/buttons below the
     homepage's. See the .doors-wrap rule for the full offset chain. */
  padding-top: 0;
}
/* Round 4 item 5a: the door-page h1 sits in the standard position —
   first in <main>, directly under the frozen breadcrumb bar, aligned
   with every other page's h1 (global h1 rule: margin 0 0 6px). The
   clock + doors below it live in .doors-wrap, copied from the homepage. */
main.doorpage h1 { margin-bottom: 6px; }
main.doorpage .doors { margin-top: 0; }
/* Homepage layout (index.html .doors-wrap / .live-clock / .doors) with the
   Round 5 (2026-11-19) alignment fix: the door pages' calendar top and
   button top now land on the homepage's absolute positions.
   Homepage chain: fixed bars 88px (body padding-top) + .doors-wrap
   padding-top 2vh = calendar top; + calendar height C + .live-clock
   margin-bottom 9vh = button top (88 + 2vh + C + 9vh).
   Door-page chain before the fix: brandbar 43px (the sticky offset
   top:43px used by .crumbbar/.topbar in this file) + crumbbar 54px
   (10px top padding + 34px back-arrow + 10px bottom padding) = 97px
   of in-flow bars, then main padding-top 24px, then the h1 block
   29px (20px font, 23px line box — the same 23px line box the 43px
   brandbar total implies for its 20px link: 43 - 2x10px padding —
   plus the h1 margin-bottom 6px), then .doors-wrap padding-top 2vh.
   Extra fixed offset vs the homepage: (97 - 88) + 24 + 29 = 62px.
   Fix, all inside .doorpage scope: main.doorpage padding-top
   24px -> 0 absorbs 24px; the remaining 38px is taken as a negative
   margin-top here on .doors-wrap (padding cannot go negative, and
   2vh is only ~15-20px at laptop viewport heights, so a
   calc(2vh - 38px) padding would clamp to 0 and miss). The vh
   values themselves are unchanged: padding-top stays 2vh and
   .live-clock margin-bottom stays 9vh.
   Door-page chain after the fix: 97 + 0 + 29 - 38 + 2vh = 88 + 2vh
   = calendar top, identical to the homepage; button top adds the
   same C + 9vh on both pages, so it matches too. (Sibling margin
   collapsing changes nothing: 23 + (6 - 38) = 29 - 38 = -9 either
   way.) The h1 itself is untouched and stays first in <main>,
   directly under the breadcrumb bar (Round 4 decision). */
main.doorpage .doors-wrap { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 2vh; margin-top: -38px; }

h1 { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.sub { color: #666; font-size: 14px; margin: 0 0 18px; }

/* Plain text rows, amber on hover. No boxes, no cards.
   Round 3 (2026-11-18): every list under a page heading is indented by one
   fixed amount site-wide (calibrated to the width of the word "Courses" at
   heading size), so entries read as one level below their heading. */
.rows { margin-top: 8px; padding-left: 76px; }
/* Round 4 (2026-11-19): the .rows value above (76px) is the one site-wide
   indent — every content block under a page heading uses it, not just list
   rows. .indent is the shared class for blocks with no class of their own;
   prose pages, the article body and the news list take it here directly. */
.indent { padding-left: 76px; }
.prose, .article-body, .news-list { padding-left: 76px; }
.row {
  display: block;
  padding: 9px 2px;
  color: #222;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.row:hover { color: #b45309; }
.row .sub2 {
  display: block;
  font-size: 13px;
  color: #777;
  margin-top: 2px;
}
.row:hover .sub2 { color: #b45309; }
.door { font-size: 14px; padding: 9px 2px; }

.note { font-size: 15px; margin: 22px 0 0; }
.small { font-size: 13px; color: #555; margin: 10px 0 0; }
.small a { color: #555; font-weight: 700; }
.small a:hover { color: #b45309; }

footer {
  margin: 0;
  padding: 18px 28px 30px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
}
footer a { color: #555; text-decoration: none; margin-right: 18px; font-weight: 700; }
footer a:hover { color: #b45309; }
.foot-links { margin-left: auto; text-align: right; }
.foot-links a:last-child { margin-right: 0; }

/* ---- Phase A1 components (same plain language) ---- */
.blockhead { font-size: 17px; font-weight: 700; margin: 30px 0 8px; }

.prose p { font-size: 15px; line-height: 1.65; margin: 0 0 14px; }
.prose p.fine { font-size: 13px; color: #6b7280; }

.reg-body { font-size: 15px; line-height: 1.6; margin: 0; }
.reg-body a { color: #555; font-size: 13px; }
.reg-body a:hover { color: #b45309; }

.bank-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.bank-row select, .bank-row input[type="search"] {
  font-size: 14px; padding: 5px 8px; border: 1px solid #ccc; border-radius: 3px;
}
.bank-row input[type="search"] { flex: 1 1 260px; }
.bank-row button, .pager button {
  font-size: 14px; padding: 5px 12px; border: 1px solid #1e40af; border-radius: 3px;
  background: #1e40af; color: #fff; cursor: pointer;
}
.bank-row button:hover, .pager button:hover { color: #fff; background: #1a358a; border-color: #1a358a; }
.pager button:disabled { background: #aab4c6; border-color: #aab4c6; color: #fff; cursor: default; }
.pager button:disabled:hover { background: #aab4c6; border-color: #aab4c6; color: #fff; }
.matchline { font-size: 14px; color: #555; margin: 4px 0 10px; }

details.qcard { border-bottom: 1px solid #eee; padding: 10px 0; }
details.qcard summary { cursor: pointer; list-style: none; }
details.qcard summary::-webkit-details-marker { display: none; }
.qmeta { display: block; font-size: 13px; color: #777; }
.qpreview { display: block; font-size: 15px; margin-top: 2px; }
details.qcard summary:hover .qpreview, details.qcard summary:hover .qmeta { color: #b45309; }
.qbody h4 { font-size: 13px; color: #777; font-weight: 600; margin: 14px 0 4px; }
.qtext { font-size: 15px; line-height: 1.6; white-space: pre-wrap; margin: 0; }
.pager { display: flex; gap: 12px; align-items: center; margin: 18px 0 0; font-size: 14px; color: #555; }

.article-body p { font-size: 15px; line-height: 1.65; margin: 0 0 12px; }
.article-body ul.cc-list { margin: 0 0 12px; padding-left: 22px; }
.article-body ul.cc-list li { font-size: 15px; line-height: 1.6; margin: 3px 0; }
.article-body p.cc-list-head { font-weight: 700; margin: 14px 0 4px; }

/* ---- 2026-11-18 restructure: navy brand bar, blue back arrow, large door buttons ---- */
.brandbar {
  background: #1e40af;
  padding: 10px 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brandbar .auth-area { display: flex; align-items: center; gap: 10px; }
.brandbar a {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-decoration: none;
}
.brandbar a span { color: #bfdbfe; }
/* CBLE menu inside the brand bar (2026-11-18: moved up from its own row below the bar) */
.brandbar .bar-menu { display: flex; align-items: center; flex-wrap: wrap; font-size: 15px; margin-left: auto; margin-right: 36px; }
.brandbar .bar-menu a { color: #dbeafe; font-size: 15px; font-weight: 600; letter-spacing: normal; text-decoration: none; margin-left: 20px; }
.brandbar .bar-menu a:hover { color: #fbbf24; }
.brandbar .bar-menu .here { color: #ffffff; font-size: 15px; font-weight: 800; margin-left: 20px; }
.crumbbar {
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 43px;
  background: #ffffff;
  z-index: 15;
}
.back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  background: #1e40af;
  color: #fff;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  flex: 0 0 auto;
}
.back-arrow:hover { background: #1a358a; color: #fbbf24; }
.doors { margin-top: 10px; display: flex; gap: 24px; justify-content: center; }
/* Door pages only (Round 4 items 5a/5b): .doors matches the homepage
   (.doors in index.html: width 100%, max-width 880px, padding 0 24px,
   gap 26px, stretch so all buttons share one height), and .door-btn is a
   top-pinned column flex (flex: 1 1 0, max-width 250px, like the
   homepage .door-block + .cta pair) so each .door-name — the first
   child — sits at the same 14px top padding on one shared top line,
   however the button text wraps. Scoped to .doorpage so no other
   page's .doors/.door-btn changes. */
main.doorpage .doors { width: 100%; max-width: 880px; padding: 0 24px; gap: 26px; align-items: stretch; }
.door-btn {
  flex: 0 1 215px;
  display: block;
  background: #1e40af;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 14px 16px;
  border-radius: 14px;
  text-decoration: none;
  margin: 0;
}
main.doorpage .door-btn {
  flex: 1 1 0;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 18px;
}
.door-btn .door-name { display: block; flex: 0 0 auto; line-height: 1.2; }
@media (max-width: 700px){ .doors { gap: 8px; } .door-btn { font-size: 15px; padding: 12px 6px; border-radius: 10px; } main.doorpage .doors { gap: 8px; padding: 0 10px; } main.doorpage .door-btn { font-size: 15px; padding: 10px 5px; border-radius: 10px; } }
.door-btn:hover { color: #fbbf24; }

/* Round 3 (2026-11-18): plain-text auth links in the navy bar — no pill, no box; amber on hover */
.brandbar .hdr-btn { background: none; border: 0; color: #dbeafe; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.brandbar .hdr-btn:hover { color: #fbbf24; }
/* Round 3: Chinese-version link, right end of the CBLE breadcrumb row (after the search box) */
.crumb-zh { margin-left: auto; font-size: 14px; color: #222; font-weight: 700; text-decoration: none; white-space: nowrap; }
.crumb-zh:hover { color: #b45309; }
/* Round 2 (2026-11-18): Customs News back to the old Chinese site's layout —
   date in a left column, item text on the right, compact lines. The Chinese
   list and the Chinese subtitle only show in Chinese mode (html[lang=zh]
   is set by tm-lang.js); the English subtitle hides then. */
.news-list { margin-top: 6px; }
.news-line { display: flex; align-items: baseline; gap: 14px; padding: 7px 8px; border-bottom: 1px solid #eee; font-size: 14px; }
.news-date { font-weight: 700; min-width: 86px; white-space: nowrap; }
.news-body { line-height: 1.55; }
.news-body a { font-size: .85em; color: #666; font-weight: 700; }
.news-body a:hover { color: #b45309; }
/* Round 3 (2026-11-18): live calendar/clock, same as the homepage, hung high
   on the SHSAT and SAT door pages too (their pages looked empty). */
.live-clock { display: flex; flex-direction: column; align-items: center; }
.cal-icon { display: inline-block; width: 84px; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-align: center; }
.cal-month { background: #f97316; color: #fff; font-size: 9px; font-weight: 600; padding: 2px 0; text-transform: uppercase; letter-spacing: 1px; }
.cal-body { background: #e9f7ef; }
.cal-day { font-size: 14px; font-weight: 700; padding: 1px 0 0; line-height: 1.2; }
.cal-year { font-size: 9px; color: #333; font-weight: 700; padding: 0 0 3px; }
.lc-time { display: inline-block; font-size: 22px; font-weight: 600; color: #1a1a1a; margin-top: 8px; font-variant-numeric: tabular-nums; background: #faf5ff; border: 1px solid #f0e6ff; border-radius: 12px; padding: 4px 16px; }
.lc-ap { font-size: 0.55em; position: relative; top: 3px; margin-left: 5px; color: #555; }
.lc-sec { color: #f97316; }
main.doorpage .live-clock { margin: 0 auto 9vh; }

.news-zh { display: none; }
html[lang="zh"] .news-zh { display: block; }
html[lang="zh"] .news-en { display: none; }
.sub-zh-only { display: none; }
html[lang="zh"] .sub-zh-only { display: block; }
html[lang="zh"] .sub-en-only { display: none; }
