:root {
  color-scheme: light;
  --ink: #1a2332;
  --muted: #5f6d7e;
  --line: #e2e8f0;
  --paper: #ffffff;
  --wash: #f7f9fc;
  --deep: #2a1215;
  --brand: #c62828;
  --brand-strong: #a51d1d;
  --brand-light: #fff1f1;
  --accent: #ef4444;
  --amber: #b45309;
  --blue: #2563eb;
  --teal: #0d9488;
  --rose: #e11d48;
  --gold: #c8a84e;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* Singapore hero overlay — used across all content-hero variants */
  --hero-overlay: linear-gradient(135deg, rgba(10,30,60,0.42), rgba(0,40,80,0.28));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: block;
  border-bottom: 2px solid var(--brand);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.header-main {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 0 clamp(18px, 4vw, 54px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
}

.brand-logo {
  display: block;
  height: 56px;
  width: auto;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  color: #344054;
  font-size: 13px;
  align-self: stretch;
}

/* Icon-based nav link (direct link items) */
.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 72px;
  padding: 0 clamp(12px, 1.6vw, 22px);
  font-weight: 700;
  white-space: nowrap;
  color: #344054;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover {
  color: var(--brand);
  background: #fff5f5;
}
.nav-link.active {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  margin: 8px 2px;
  min-height: 56px;
}
.nav-link.active .nav-icon { color: #fff; }

/* Nav icons */
.nav-icon {
  width: 22px;
  height: 22px;
  color: var(--brand);
  flex-shrink: 0;
}
.nav-arrow {
  width: 10px;
  height: 6px;
  margin-left: 3px;
  opacity: 0.5;
  flex-shrink: 0;
}

.trending-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  padding: 0 clamp(18px, 4vw, 54px);
  border-top: 1px solid var(--line);
  background: #fafafa;
  color: #475467;
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
}

.trending-bar span {
  color: var(--muted);
  font-weight: 700;
}

.trending-bar a {
  color: #344054;
  font-weight: 800;
}

.text-link:hover {
  color: var(--brand);
}

.nav-cta,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap; /* prevent text wrapping (was causing 免费咨询 to stack 4 lines) */
  flex-shrink: 0;
}

.nav-cta,
.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.secondary-button {
  border-color: #cfd6dd;
  color: var(--ink);
  background: #fff;
}

.hero {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: center;
  padding: clamp(54px, 8vw, 92px) clamp(20px, 6vw, 80px) 50px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--hero-overlay), url('/assets/hero-mbs-day3.jpg') center/cover no-repeat;
}

.hero-content {
  position: relative;
  max-width: 920px;
  color: #fff;
}
/* Homepage hero slogan — larger, bolder, more prominent than eyebrow pill */
.hero-slogan {
  display: block;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 20px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
  position: relative;
  padding-bottom: 16px;
}

.hero-slogan::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.7);
}
.hero h1 { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.hero .hero-subtitle { color: rgba(255,255,255,0.9); }
.hero .secondary-button { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.hero .secondary-button:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

.hero-brief {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.brief-block {
  padding: 18px 20px;
  background: #fff;
}

.brief-block.lead {
  padding-top: 22px;
  padding-bottom: 22px;
  border-top: 4px solid var(--brand);
}

.brief-label {
  display: block;
  margin-bottom: 9px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.brief-block a {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.42;
}

.brief-block p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.66;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-list a {
  width: max-content;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: #fafafa;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.path-mini {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
}

.path-mini span {
  position: relative;
  padding: 13px 20px;
  background: #fafafa;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.path-mini span:not(:last-child)::after {
  content: "↓";
  position: absolute;
  right: 18px;
  color: var(--brand);
}

/* ── Hero Pathway Visual ── */
.hero-pathway {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}
.pw-title {
  padding: 16px 24px 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
}
.pw-flow {
  padding: 20px 16px 16px;
}
.pw-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.pw-row-3 {
  justify-content: space-between;
}
.pw-row-5 {
  justify-content: space-between;
}
.pw-arrows {
  display: flex;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
}
.pw-arrows svg {
  width: 100%;
  height: 100%;
}
.pw-line {
  animation: pw-dash 1.5s ease-in-out forwards;
  stroke-dashoffset: 100;
}
@keyframes pw-dash {
  to { stroke-dashoffset: 0; }
}
.pw-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
  min-width: 0;
}
.pw-node:hover {
  background: #fff5f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(198,40,40,0.1);
  text-decoration: none;
}
.pw-icon {
  font-size: 22px;
  line-height: 1;
}
.pw-label {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.3;
}
.pw-sub {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
}
.pw-start {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1.5px solid #fca5a5;
  padding: 10px 24px;
  border-radius: 50px;
}
.pw-exam {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  flex: 1;
  border-radius: 10px;
}
.pw-course {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 6px 8px;
  border-radius: 8px;
  flex: 1;
  text-align: center;
}
.pw-course .pw-label {
  font-size: 12px;
}
.pw-mid {
  background: #fefce8;
  border: 1px solid #fde68a;
  flex: 1;
  border-radius: 10px;
}
.pw-goal {
  background: linear-gradient(135deg, #c62828, #b91c1c);
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  width: 100%;
}
.pw-goal .pw-icon {
  font-size: 24px;
}
.pw-goal .pw-label {
  color: #fff;
  font-size: 15px;
}
.pw-goal .pw-sub {
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  letter-spacing: 0.3px;
}
.pw-goal:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198,40,40,0.3);
}
.pw-cta {
  display: block;
  padding: 14px 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  border-top: 1px solid var(--line);
  background: var(--wash);
  text-decoration: none;
  transition: background 0.2s;
}
.pw-cta:hover {
  background: #fef2f2;
  text-decoration: none;
}

/* ── Platform Grid ── */
.platform-grid {
  padding: 60px clamp(20px, 6vw, 80px) 50px;
  background: #fff;
}
.platform-grid .section-head {
  text-align: center;
  margin-bottom: 36px;
}
.platform-grid h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--ink);
}
.pgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}
.pgrid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px 24px;
  border: 1px solid var(--line, #e2e5e9);
  border-radius: 16px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.25s;
}
.pgrid-card:hover {
  border-color: var(--brand, #c62828);
  box-shadow: 0 8px 32px rgba(198,40,40,0.1);
  transform: translateY(-4px);
  text-decoration: none;
}
.pgrid-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
}
.pgrid-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ink);
}
.pgrid-card p {
  font-size: 13px;
  color: var(--muted, #6c757d);
  margin: 0;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .pgrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .pgrid-card {
    padding: 20px 14px 18px;
  }
  .pgrid-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 680px;
  margin-bottom: 30px;
  color: #344054;
  font-size: clamp(20px, 3vw, 31px);
  line-height: 1.42;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

main > section:not(.hero) {
  padding: 62px clamp(20px, 6vw, 80px);
}

.section-head {
  max-width: 940px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.18;
}

.section-head.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  max-width: none;
}

.text-link {
  color: var(--brand-strong);
  font-weight: 800;
}

/* ── School Showcase / Logo Wall ── */
.school-showcase {
  background: var(--wash);
  border-top: 1px solid var(--line);
}

.school-showcase .section-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  max-width: 600px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.sc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.15s;
}

.sc-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--brand);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--ink);
}

.sc-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.3px;
  text-align: center;
  line-height: 1.2;
}

/* School colour themes */
.sc-logo.uwc      { background: linear-gradient(135deg, #1a56db, #2563eb); }
.sc-logo.tanglin  { background: linear-gradient(135deg, #1e6b3a, #22c55e); }
.sc-logo.acs      { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.sc-logo.stamford { background: linear-gradient(135deg, #0369a1, #38bdf8); }
.sc-logo.dulwich  { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.sc-logo.hci      { background: linear-gradient(135deg, #92400e, #f59e0b); }
.sc-logo.ri       { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }
.sc-logo.hwachong { background: linear-gradient(135deg, #991b1b, #dc2626); }
.sc-logo.nygh     { background: linear-gradient(135deg, #6d28d9, #c084fc); }
.sc-logo.scgs     { background: linear-gradient(135deg, #be185d, #f472b6); }
.sc-logo.acsb     { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.sc-logo.dunman   { background: linear-gradient(135deg, #065f46, #34d399); }

.sc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sc-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  width: fit-content;
}

.sc-tag.intl {
  background: #eff6ff;
  color: #1d4ed8;
}

.sc-tag.govt {
  background: #f0fdf4;
  color: #15803d;
}

.sc-tag.private {
  background: #fff7ed;
  color: #c2410c;
}

.showcase-more {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.showcase-more a {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.showcase-more a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .showcase-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

.search-section {
  background: #fafafa;
}

.route-section {
  padding-top: 44px;
  padding-bottom: 44px;
  background: var(--brand-light);
}

.route-panel {
  max-width: 940px;
}

.route-panel h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.16;
}

.route-panel p {
  max-width: 820px;
  color: #475467;
  font-size: 18px;
  line-height: 1.82;
}

.route-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.route-links span {
  padding: 8px 12px;
  border: 1px solid rgba(198, 40, 40, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-strong);
  font-weight: 800;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.article-grid,
.pathway-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.search-grid a {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 22px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
  color: var(--deep);
}

.search-grid a span {
  font-size: 20px;
  font-weight: 800;
}

.search-grid a small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.search-grid a:hover,
.article-card:hover,
.pathway-grid a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.content-band {
  background: #fff;
}

.article-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-card {
  min-height: 236px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  border-color: var(--accent);
}

.article-card a {
  display: flex;
  min-height: 236px;
  flex-direction: column;
  padding: 24px;
}

.tag {
  width: max-content;
  margin-bottom: 16px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff1f1;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.tag.alt {
  background: #ecfdf5;
  color: var(--teal);
}

.tag.rose {
  background: #fff1f2;
  color: var(--rose);
}

.article-card h3 {
  margin-bottom: 12px;
  font-size: 21px;
  line-height: 1.34;
}

.article-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.78;
}

.topic-section,
.parent-section,
.faq-section {
  background: #fff;
  border-top: 1px solid var(--line);
}

.alt-topic {
  background: #fafafa;
}

.topic-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 22px;
}

.topic-lead,
.topic-list,
.guide-grid,
.faq-list {
  border: 1px solid var(--line);
  background: #fff;
}

.topic-lead a {
  display: grid;
  align-content: start;
  min-height: 100%;
  padding: 28px;
}

.topic-lead h3 {
  margin-bottom: 14px;
  font-size: 30px;
  line-height: 1.22;
}

.topic-lead p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.topic-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}

.topic-list a {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 22px;
  background: #fff;
}

.topic-list strong,
.guide-grid strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.35;
}

.topic-list span,
.guide-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.database-section {
  background: #faf7f6;
}

.database-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 22px;
}

.filters,
.school-list {
  display: grid;
  gap: 12px;
}

.filter {
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  text-align: left;
  cursor: pointer;
}

.filter.active,
.filter:hover {
  border-color: rgba(198, 40, 40, 0.32);
  background: #fff1f1;
  color: var(--brand-strong);
}

.school-row {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.school-row h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.school-row p,
.contact-section p,
.site-footer p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.72;
}

.school-row span {
  color: var(--blue);
  font-weight: 800;
}

.pathway-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pathway-grid a {
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pathway-grid a:hover {
  border-color: var(--accent);
}

.pathway-grid strong,
.pathway-grid span {
  display: block;
}

.pathway-grid strong {
  margin-bottom: 12px;
  font-size: 20px;
}

.pathway-grid span {
  color: var(--muted);
  line-height: 1.65;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.guide-grid a {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 22px;
  background: #fff;
}

.faq-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.faq-list details {
  background: #fff;
}

.faq-list summary {
  padding: 20px 22px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.faq-list p {
  margin: 0;
  padding: 0 22px 22px;
  color: var(--muted);
  line-height: 1.75;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 52px;
  align-items: start;
  background: var(--deep);
  color: #fff;
}

.contact-section .eyebrow {
  color: #fecaca;
}

.contact-section h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.13;
}

.contact-section p {
  color: rgba(255, 255, 255, 0.76);
}

.lead-form {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.lead-form label,
.lead-form span {
  display: grid;
  gap: 7px;
}

.lead-form span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 700;
}

.lead-form input,
.lead-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.lead-form .primary-button {
  width: 100%;
  border: 0;
}

.contact-options {
  display: flex;
  gap: 12px;
}

.contact-options a {
  flex: 1;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 30px;
  padding: 36px clamp(20px, 6vw, 80px);
  border-top: 1px solid var(--line);
  background: #f9fafb;
}

.site-footer strong,
.site-footer span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 800;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
}

/* ── Hamburger Toggle ── */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 980px) {
  .header-main {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand {
    min-width: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    flex: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 8px;
    border-top: 1px solid var(--line);
    margin-top: 14px;
    background: #fff;
    overflow-y: auto;
    max-height: 70vh;
  }

  .main-nav.nav-open {
    display: flex;
  }

  .nav-link,
  .main-nav > .nav-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
  }
  .nav-link.active {
    background: var(--brand);
    color: #fff;
    border-radius: 8px;
    margin: 4px 0;
    min-height: 44px;
  }
  .nav-icon { width: 20px; height: 20px; }
  .nav-group > .nav-label { flex: 1; }

  .nav-group > .mega-dropdown a {
    min-height: 44px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
  }

  .nav-group > .mega-dropdown {
    display: none;
    padding: 0 0 4px 16px;
    position: static;
    transform: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    border-top: 0;
    min-width: 0;
  }
  .mega-two-col {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .mega-col:first-child { border-right: 0; }

  .nav-group.mobile-open > .mega-dropdown {
    display: flex;
    flex-direction: column;
  }

  .nav-group::after {
    content: "›";
    margin-left: 6px;
    font-size: 16px;
    color: var(--muted);
    transition: transform 0.2s ease;
  }

  .nav-group.mobile-open::after {
    transform: rotate(90deg);
  }

  .nav-cta {
    display: none;
  }

  .search-grid,
  .article-grid,
  .topic-layout,
  .topic-list,
  .guide-grid,
  .pathway-grid,
  .hero,
  .database-layout,
  .contact-section,
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }

  .database-layout,
  .contact-section {
    gap: 24px;
  }

  .school-row {
    grid-template-columns: 1fr;
  }
}

/* ── Mega Menu ── */
.main-nav {
  position: relative;
}

.nav-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 72px;
  padding: 0 clamp(12px, 1.6vw, 22px);
  font-weight: 700;
  cursor: default;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav-group > .nav-icon { color: var(--brand); }
.nav-group > .nav-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nav-group:hover {
  background: #fff5f5;
  color: var(--brand);
}

.nav-group > .mega-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 30;
  border-radius: 0 0 10px 10px;
}

.nav-group:hover > .mega-dropdown {
  display: grid;
}

/* Two-column mega dropdown */
.mega-two-col {
  grid-template-columns: 1fr 1fr;
  min-width: 440px;
}
.mega-col-title {
  padding: 14px 20px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.mega-col {
  display: flex;
  flex-direction: column;
}
.mega-col:first-child {
  border-right: 1px solid var(--line);
}

.mega-dropdown a {
  display: block;
  min-height: auto;
  padding: 11px 20px;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  color: #344054;
  line-height: 1.45;
  white-space: nowrap;
}

.mega-dropdown a:hover {
  background: #fff5f5;
  color: var(--brand);
  border: 0;
}

.mega-dropdown a small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px clamp(20px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--blue);
  font-weight: 600;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  color: var(--muted);
}

/* ── Content Hero Banners ── */

/* Compound + plain selector so it beats .page-hero's later padding shorthand
   (page pages have both classes; standalone content-body pages have only .content-hero) */
.page-hero.content-hero,
.content-hero {
  color: #fff;
  /* Horizontal padding aligns the hero text with the centered content
     below (max-width 1240px + 80px inner padding); falls back to 56px on
     narrow screens. Background stays full-width. */
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(40px, 6vw, 72px);
  padding-left: max(clamp(20px, 6vw, 56px), calc((100% - 1240px) / 2 + 80px));
  padding-right: max(clamp(20px, 6vw, 56px), calc((100% - 1240px) / 2 + 80px));
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start; /* left-align text (some heroes inherit align-items:center) */
  border-bottom: 0;
  /* Fallback background so standalone .content-hero (no variant class) is never white-on-white */
  background: linear-gradient(135deg, var(--deep) 0%, var(--brand-strong) 100%);
}

/* Override .page-hero defaults (compound selector beats single-class .page-hero) */
.content-hero::after { display: none; }
/* Higher specificity (0-3-0) to beat .page-hero .eyebrow's light-pink pill */
.page-hero.content-hero .eyebrow,
.content-hero .eyebrow {
  color: #fff;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
}
.content-hero h1 { color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,0.35); }
.content-hero .hero-subtitle { color: rgba(255,255,255,0.9); }
/* Breadcrumb nested inside a content-hero band (singapore-education pages) */
.content-hero .breadcrumb { background: transparent; padding: 0; margin-bottom: 14px; }
.content-hero .breadcrumb a { color: rgba(255,255,255,0.8); }
.content-hero .breadcrumb span { color: rgba(255,255,255,0.6); }

/* Standalone content-hero (content-body pages, no page-hero): the body is a
   narrower 880px centered column, so align the hero text to that instead of 1240px */
.content-hero:not(.page-hero) {
  padding-left: max(clamp(20px, 6vw, 40px), calc((100% - 880px) / 2 + 40px));
  padding-right: max(clamp(20px, 6vw, 40px), calc((100% - 880px) / 2 + 40px));
}

/* Category variants — compound selector for specificity over .page-hero */
/* Boat Quay+CBD+河+蓝天 — 考试/课程类 */
.content-hero.hero-exam {
  background: var(--hero-overlay),
    url('/assets/sg-px-20779788.jpg') center 40%/cover no-repeat;
}

/* MBS船顶仰拍+蓝天 — 学校页 */
.content-hero.hero-school {
  background: var(--hero-overlay),
    url('/assets/sg-px-36882343.jpg') center/cover no-repeat;
}

/* 摩天轮+Gardens+CBD+蓝天 — 升学路径类 */
.content-hero.hero-pathway {
  background: var(--hero-overlay),
    url('/assets/sg-px-6305534.jpg') center/cover no-repeat;
}

/* CBD天际线全景 — 实用指南类 */
.content-hero.hero-guide {
  background: var(--hero-overlay),
    url('/assets/sg-px-32818048.jpg') center/cover no-repeat;
}

/* MBS三塔+鱼尾狮 — 关于/学生类 */
.content-hero.hero-student {
  background: var(--hero-overlay),
    url('/assets/sg-px-37182575.jpg') center 20%/cover no-repeat;
}

/* School profile hero — compound selectors (0-2-0) so bg image and padding
   beat the later .page-hero light-gradient + padding-shorthand rules */
.page-hero.school-hero,
.school-hero {
  color: #fff;
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(40px, 6vw, 72px);
  padding-left: max(clamp(20px, 6vw, 56px), calc((100% - 1240px) / 2 + 80px));
  padding-right: max(clamp(20px, 6vw, 56px), calc((100% - 1240px) / 2 + 80px));
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  border-bottom: 0;
}
.page-hero.school-hero,
.school-hero {
  background: var(--hero-overlay),
    url('/assets/sg-px-14694917.jpg') center 30%/cover no-repeat;
}
.school-hero::after { display: none; }
.page-hero.school-hero .eyebrow,
.school-hero .eyebrow { color: rgba(255,255,255,0.9); margin-bottom: 10px; background: rgba(255,255,255,0.18); backdrop-filter: blur(4px); }
.school-hero h1 { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.school-hero .hero-subtitle { color: rgba(255,255,255,0.85); }

/* ── Article Visual Enhancements ── */

.content-main h2 {
  position: relative;
  padding-left: 18px;
}

.content-main h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.content-main .visual-break {
  margin: 40px 0;
  border-radius: var(--radius);
  overflow: hidden;
  height: 200px;
  background: linear-gradient(135deg, rgba(42,18,21,0.15), rgba(15,26,46,0.1));
  background-size: cover;
  background-position: center;
}

.content-main .info-card {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--wash);
}

.content-main .info-card .ic-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.content-main .info-card .ic-body h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.content-main .info-card .ic-body p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.content-main .highlight-box {
  padding: 24px 28px;
  margin: 28px 0;
  border-radius: var(--radius);
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, #fef7f7, #fff);
}

.content-main .highlight-box.blue {
  border-left-color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #fff);
}

.content-main .highlight-box.green {
  border-left-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4, #fff);
}

.content-main .highlight-box.amber {
  border-left-color: #d97706;
  background: linear-gradient(135deg, #fffbeb, #fff);
}

.content-main .highlight-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.content-main .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.content-main .stat-grid .sg-item {
  text-align: center;
  padding: 20px 12px;
  border-radius: var(--radius);
  background: var(--wash);
  border: 1px solid var(--line);
}

.content-main .stat-grid .sg-num {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.1;
}

.content-main .stat-grid .sg-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Article / Content Page Layout ── */

.page-hero h1 {
  max-width: 920px;
  margin-bottom: 16px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.16;
}

.page-hero .hero-subtitle {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(16px, 2.2vw, 22px);
}

.content-layout,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(24px, 2.5vw, 40px);
  padding: clamp(36px, 5vw, 62px) clamp(20px, 6vw, 80px);
  max-width: 1240px;
  margin: 0 auto;
}

.content-main,
.content-layout > .main-content,
.content-grid > .main-content {
  min-width: 0;
}

/* Single-column article (no sidebar) — constrain reading width */
.content-body {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 62px) clamp(20px, 6vw, 40px);
}

.content-main h2 {
  margin-top: 48px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand);
  font-size: clamp(24px, 3.5vw, 34px);
  line-height: 1.22;
}

.content-main h2:first-child {
  margin-top: 0;
}

.content-main h3 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.32;
}

.content-main p {
  margin-bottom: 18px;
  color: #344054;
  font-size: 16px;
  line-height: 1.88;
}

.content-main ul,
.content-main ol {
  margin: 0 0 20px;
  padding-left: 22px;
  color: #344054;
  font-size: 16px;
  line-height: 1.88;
}

.content-main li {
  margin-bottom: 8px;
}

.content-main strong {
  color: var(--ink);
}

/* ── Info Box ── */
.info-box {
  margin: 24px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--brand);
  background: var(--brand-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.info-box.tip {
  border-left-color: var(--blue);
  background: #f0f5ff;
}

.info-box.amber {
  border-left-color: var(--amber);
  background: #fff8ee;
}

.info-box p {
  margin-bottom: 0;
}

.info-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

/* ── Data Table ── */
.data-table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 15px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border: 1px solid var(--line);
  text-align: left;
  line-height: 1.55;
}

.data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

/* ── Content Sidebar ── */
.content-sidebar {
  display: grid;
  gap: 20px;
  align-self: start;
  position: sticky;
  top: 100px;
  /* max-height prevents the sidebar from exceeding the viewport.
     overflow-y:auto adds a scrollbar if content is taller than the visible area,
     avoiding the "frozen" problem while keeping the float-with-content behavior. */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.sidebar-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  border-radius: 4px;
}

.sidebar-nav a:last-child {
  border-bottom: 0;
}

.sidebar-nav a:hover {
  color: var(--brand);
  background: var(--brand-light);
}

.sidebar-nav a.active {
  color: var(--brand);
  background: var(--brand-light);
  border-left: 3px solid var(--brand);
}

.sidebar-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.sidebar-card h4 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
  font-size: 16px;
}

.sidebar-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-card li {
  border-bottom: 1px solid var(--line);
}

.sidebar-card li:last-child {
  border-bottom: 0;
}

.sidebar-card li a {
  display: block;
  padding: 10px 0;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.sidebar-card li a:hover {
  color: var(--brand);
}

.sidebar-cta {
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff;
  text-align: center;
}

.sidebar-cta h4 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  color: #fff;
  font-size: 18px;
}

.sidebar-cta p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.6;
}

.sidebar-cta .primary-button {
  width: 100%;
  font-size: 14px;
}

/* ── Related Articles ── */
.related-section {
  padding: 48px clamp(20px, 6vw, 80px);
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.related-section h2 {
  margin-bottom: 22px;
  font-size: 28px;
}

/* ── Comparison / VS Layout ── */
.vs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.vs-grid > div {
  padding: 20px;
  background: #fff;
}

.vs-grid > div:first-child {
  border-top: 3px solid var(--brand);
}

.vs-grid > div:last-child {
  border-top: 3px solid var(--blue);
}

.vs-grid h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.stat-item {
  padding: 20px;
  background: #fff;
  text-align: center;
}

.stat-item .stat-number {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 32px;
  font-weight: 800;
}

.stat-item .stat-label {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .content-layout,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .content-sidebar {
    position: static;
  }

  .nav-group > .mega-dropdown {
    position: static;
    transform: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    min-width: 0;
  }
  .mega-two-col { grid-template-columns: 1fr; min-width: 0; }
  .mega-col:first-child { border-right: 0; }

  .vs-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Pathway Finder Tool ── */
.finder-section {
  background: linear-gradient(135deg, #1a2332 0%, #2d1a1e 100%);
  color: #fff;
}

.finder-section .eyebrow {
  color: #ff8a80;
}

.finder-section h2 {
  color: #fff;
}

.finder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.finder-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #fff;
}

.finder-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.finder-card .finder-age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 138, 128, 0.25);
  color: #ff8a80;
  font-size: 14px;
  font-weight: 800;
}

.finder-card strong {
  font-size: 18px;
  line-height: 1.35;
}

.finder-card span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  line-height: 1.55;
}

/* ── Trust Stats Bar ── */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0 clamp(20px, 6vw, 80px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.trust-item:last-child {
  border-right: 0;
}

.trust-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 20px;
  flex-shrink: 0;
}

.trust-icon.blue { background: #fee2e2; }
.trust-icon.teal { background: #ccfbf1; }
.trust-icon.amber { background: #fef3c7; }
.trust-icon.rose { background: #ffe4e6; }

.trust-text strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.trust-text span {
  color: var(--muted);
  font-size: 13px;
}

/* ── Floating WeChat Button ── */
.wechat-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: #07c160;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(7, 193, 96, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.wechat-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(7, 193, 96, 0.45);
}

.wechat-float svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ── Improved Page Hero (content pages) ── */
.page-hero {
  padding: clamp(42px, 6vw, 72px) clamp(20px, 6vw, 80px) clamp(36px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, #fff5f5 0%, #ffffff 50%, #fef2f2 100%);
}

/* ── Category Color System ── */
.cat-exam { border-top-color: var(--brand); }
.cat-school { border-top-color: var(--teal); }
.cat-path { border-top-color: var(--blue); }
.cat-guide { border-top-color: var(--amber); }

/* ── Improved Data Table ── */
.data-table thead th {
  background: var(--deep);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.data-table tbody tr:hover {
  background: var(--brand-light);
}

.data-table .highlight {
  background: var(--brand-light);
  font-weight: 700;
}

/* ── Content Main Link Styling ── */
.content-main a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(198, 40, 40, 0.3);
  text-underline-offset: 2px;
}

.content-main a:hover {
  text-decoration-color: var(--brand);
}

@media (max-width: 680px) {
  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .brand-copy {
    padding-left: 0;
    border-left: 0;
  }

  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding-bottom: 52px;
  }

  /* Hide pathway diagram on mobile — takes too much space, confusing on small screen */
  .hero-pathway {
    display: none;
  }

  main > section:not(.hero) {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .section-head.split,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .search-grid,
  .article-grid,
  .topic-layout,
  .topic-list,
  .guide-grid,
  .pathway-grid,
  .finder-grid,
  .hero,
  .database-layout,
  .contact-section,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .trust-bar {
    grid-template-columns: 1fr 1fr;
  }

  .trust-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .article-card,
  .article-card a {
    min-height: 0;
  }

  .wechat-float span {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════
   UI Design Upgrade — 2026-05-17
   ══════════════════════════════════════════════════════ */

/* ── Stats Bar (school/university profile pages) ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--wash);
  overflow: hidden;
}

.stats-bar .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  text-align: center;
  transition: background 0.2s var(--ease);
}

.stats-bar .stat-item:last-child {
  border-right: 0;
}

.stats-bar .stat-item:hover {
  background: var(--brand-light);
}

.stats-bar .stat-item .num {
  color: var(--brand);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.stats-bar .stat-item .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 680px) {
  .stats-bar {
    grid-template-columns: 1fr 1fr;
  }

  .stats-bar .stat-item {
    border-bottom: 1px solid var(--line);
  }

  .stats-bar .stat-item:nth-child(2n) {
    border-right: 0;
  }

  .stats-bar .stat-item:nth-last-child(-n+2) {
    border-bottom: 0;
  }
}

/* ── Smoother Transitions Everywhere ── */
a, button, .filter, .article-card, .pathway-grid a, .search-grid a,
.sidebar-nav a, .sidebar-card li a, .finder-card, .school-row {
  transition: all 0.2s var(--ease);
}

/* ── Enhanced Card Hover Effects ── */
.article-card {
  box-shadow: var(--shadow-sm);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  border-color: var(--brand);
}

.search-grid a {
  transition: all 0.2s var(--ease);
}

.search-grid a:hover {
  background: var(--brand-light);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.pathway-grid a {
  box-shadow: var(--shadow-sm);
}

.pathway-grid a:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  border-color: var(--brand);
}

/* ── School Row Hover ── */
.school-row {
  transition: all 0.2s var(--ease);
}

.school-row:hover {
  border-color: rgba(198, 40, 40, 0.25);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ── Better Button Styles ── */
.primary-button {
  transition: all 0.2s var(--ease);
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.25);
}

.primary-button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(198, 40, 40, 0.35);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(198, 40, 40, 0.25);
}

.secondary-button {
  transition: all 0.2s var(--ease);
}

.secondary-button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
  transform: translateY(-1px);
}

.nav-cta {
  transition: all 0.2s var(--ease);
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.2);
}

.nav-cta:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

/* ── Enhanced Data Table ── */
.data-table {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.data-table th,
.data-table td {
  border-color: var(--line);
}

.data-table thead th {
  background: linear-gradient(135deg, var(--deep) 0%, #3d1e22 100%);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0.02em;
  padding: 14px 16px;
}

.data-table tbody td {
  font-size: 14px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s var(--ease);
}

.data-table tbody tr:hover {
  background: #fef2f2;
}

/* ── Better Page Hero ── */
.page-hero {
  position: relative;
  background: linear-gradient(160deg, #fef2f2 0%, #ffffff 35%, #f8fafc 70%, #fef2f2 100%);
}

.page-hero::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 40%;
  height: 100%;
  background: radial-gradient(ellipse at 80% 50%, rgba(198, 40, 40, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero .eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-light);
  font-size: 12px;
  margin-bottom: 16px;
}

/* ── Better Breadcrumb ── */
.breadcrumb {
  font-size: 13px;
  background: linear-gradient(90deg, #fafafa 0%, #fff 100%);
}

.breadcrumb::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  margin-right: 10px;
  background: var(--brand);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Improved FAQ ── */
.faq-list {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.faq-list details {
  transition: background 0.2s var(--ease);
}

.faq-list details[open] {
  background: #fefefe;
}

.faq-list summary {
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
  padding-right: 48px;
}

.faq-list summary:hover {
  color: var(--brand);
  background: #fef8f8;
}

.faq-list summary::marker {
  color: var(--brand);
}

.faq-list details[open] summary {
  color: var(--brand);
  background: var(--brand-light);
}

/* ── Better Sidebar ── */
.sidebar-nav {
  box-shadow: var(--shadow-sm);
}

.sidebar-card {
  box-shadow: var(--shadow-sm);
}

.sidebar-cta {
  box-shadow: 0 8px 32px rgba(198, 40, 40, 0.2);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.sidebar-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(198, 40, 40, 0.3);
}

/* ── Info Box Polish ── */
.info-box {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ── Smoother Section Spacing ── */
main > section:not(.hero) {
  padding-top: 52px;
  padding-bottom: 52px;
}

.section-head {
  margin-bottom: 24px;
}

/* ── Trust Bar Polish ── */
.trust-bar {
  box-shadow: inset 0 -1px 0 var(--line);
}

.trust-item {
  transition: background 0.2s var(--ease);
}

.trust-item:hover {
  background: #fef8f8;
}

.trust-icon {
  transition: transform 0.2s var(--ease);
}

.trust-item:hover .trust-icon {
  transform: scale(1.08);
}

/* ── Enhanced Footer ── */
.site-footer {
  background: linear-gradient(180deg, #f8fafb 0%, #f1f5f9 100%);
  padding-top: 42px;
  padding-bottom: 42px;
}

.site-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Contact Section Polish ── */
.contact-section {
  background: linear-gradient(135deg, #1a0a0c 0%, var(--deep) 50%, #2d1518 100%);
}

.lead-form {
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

/* ── Finder Cards Polish ── */
.finder-card {
  border-radius: var(--radius);
}

.finder-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* ── Floating WeChat Button Polish ── */
.wechat-float {
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  animation: wechat-pulse 3s ease-in-out infinite;
}

@keyframes wechat-pulse {
  0%, 100% { box-shadow: 0 8px 30px rgba(7, 193, 96, 0.35); }
  50% { box-shadow: 0 8px 30px rgba(7, 193, 96, 0.55), 0 0 0 6px rgba(7, 193, 96, 0.1); }
}

/* ── VS Grid Polish ── */
.vs-grid {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ── Scroll Reveal Animation ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-main h2 {
  animation: fadeUp 0.4s var(--ease) both;
}

/* ── Better Focus Styles ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
details summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Tag Polish ── */
.tag {
  transition: transform 0.2s var(--ease);
  letter-spacing: 0.02em;
}

.article-card:hover .tag {
  transform: translateY(-1px);
}

/* ── Topic List Card Hover ── */
.topic-list a {
  transition: all 0.2s var(--ease);
}

.topic-list a:hover {
  background: var(--brand-light);
}

.topic-lead a {
  transition: all 0.2s var(--ease);
}

.topic-lead a:hover {
  background: #fef8f8;
}

/* ── Guide Grid Hover ── */
.guide-grid a {
  transition: all 0.2s var(--ease);
}

.guide-grid a:hover {
  background: var(--brand-light);
}

/* ── Filter Button Polish ── */
.filter {
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
  font-weight: 700;
}

.filter:hover {
  transform: translateX(3px);
}

.filter.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

/* ── Content Main Image ── */
.content-main img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ── Selection Color ── */
::selection {
  background: rgba(198, 40, 40, 0.15);
  color: var(--deep);
}

/* ══════════════════════════════════════════════════════
   Mobile Responsiveness — Comprehensive
   ══════════════════════════════════════════════════════ */

/* ── Data Table Mobile Overflow ── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
}

.table-wrap .data-table {
  margin: 0;
  min-width: 600px;
}

@media (max-width: 680px) {
  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }
}

/* ── Zone Card Tables ── */
.zone-card .table-wrap {
  margin: 12px 0;
}

.zone-card .data-table {
  margin: 0;
  font-size: 14px;
}

.zone-card .data-table thead th {
  padding: 10px 14px;
  font-size: 12px;
}

.zone-card .data-table td {
  padding: 10px 14px;
}

/* ── HK University Detail Pages — Sidebar ── */
.sidebar {
  display: grid;
  gap: 20px;
  align-self: start;
}

.sidebar .sidebar-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.sidebar .sidebar-card h3 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
  font-size: 16px;
  font-weight: 700;
}

.sidebar .sidebar-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar .sidebar-card li {
  border-bottom: 1px solid var(--line);
}

.sidebar .sidebar-card li:last-child {
  border-bottom: 0;
}

.sidebar .sidebar-card li a {
  display: block;
  padding: 10px 0;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  transition: color 0.2s var(--ease);
}

.sidebar .sidebar-card li a:hover {
  color: var(--brand);
}

.sidebar .cta-card {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff;
  text-align: center;
}

.sidebar .cta-card h3 {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.3);
}

.sidebar .cta-card p {
  margin: 0 0 14px;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  line-height: 1.6;
}

.sidebar .cta-card .btn {
  display: inline-block;
  padding: 10px 24px;
  background: #fff;
  color: var(--brand);
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s var(--ease);
}

.sidebar .cta-card .btn:hover {
  background: var(--brand-light);
  text-decoration: none;
}

/* ── HK University Detail Pages — Footer Grid ── */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 24px;
  text-align: left;
}

.footer-grid h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.footer-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li {
  margin-bottom: 6px;
}

.footer-grid a {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s var(--ease);
}

.footer-grid a:hover {
  color: var(--brand);
}

.copyright {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ── FAQ Section inside content (HK detail pages) ── */
.content-main .faq-section {
  margin-top: 48px;
}

.content-main .faq-section h2 {
  margin-top: 0;
}

.content-main .faq-section details {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.content-main .faq-section summary {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.content-main .faq-section summary:hover {
  background: #fef8f8;
}

.content-main .faq-section details[open] summary {
  background: var(--brand-light);
  color: var(--brand);
}

.content-main .faq-section details p {
  padding: 0 20px 16px;
  margin: 0;
}

/* ── Mobile Touch Targets ── */
@media (max-width: 680px) {
  .nav-link,
  .main-nav > .nav-group {
    min-height: 48px;
  }

  .mega-dropdown a {
    min-height: 44px;
    padding: 12px 20px;
  }

  .faq-list summary {
    min-height: 52px;
    padding: 16px 20px;
    font-size: 16px;
  }

  .breadcrumb {
    padding: 10px 16px;
    font-size: 12px;
  }

  .breadcrumb::before {
    display: none;
  }

  .page-hero {
    padding: 32px 20px 28px;
  }

  .page-hero h1 {
    font-size: 26px;
  }

  .page-hero .hero-subtitle {
    font-size: 15px;
  }

  /* Better spacing for content */
  .content-layout {
    padding: 24px 16px;
    gap: 32px;
  }

  .content-main h2 {
    margin-top: 36px;
    font-size: 22px;
  }

  .content-main h3 {
    font-size: 18px;
  }

  .content-main p,
  .content-main ul,
  .content-main ol {
    font-size: 15px;
  }

  /* Sidebar stacks below content on mobile */
  .sidebar {
    position: static;
  }

  /* Footer grid stacks */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .site-footer {
    padding: 28px 16px;
  }

  /* Hide trending bar on small screens */
  .trending-bar {
    display: none;
  }

  /* WeChat float - compact */
  .wechat-float {
    bottom: 16px;
    right: 16px;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Info box mobile */
  .info-box {
    padding: 16px;
    margin: 16px 0;
  }

  /* Stats bar mobile */
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  /* VS grid */
  .vs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .brand-word {
    font-size: 24px;
  }

  .brand-logo {
    height: 26px;
  }

  .header-main {
    padding: 10px 12px;
  }

  h1 {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 16px;
  }
}

/* ── Body Lock When Nav Open ── */
body.nav-drawer-open {
  overflow: hidden;
}

/* ── Scroll CTA Popup ── */
.scroll-cta-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.scroll-cta-box {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.scroll-cta-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.scroll-cta-close:hover { color: #333; }
.scroll-cta-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.scroll-cta-box h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink, #1a1a2e);
  margin: 0 0 8px;
}
.scroll-cta-box p {
  font-size: 14px;
  color: #666;
  line-height: 1.7;
  margin: 0 0 20px;
}
.scroll-cta-btn {
  display: inline-block;
  padding: 12px 32px;
  background: #c62828;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s;
}
.scroll-cta-btn:hover { background: #b91c1c; text-decoration: none; color: #fff; }
.scroll-cta-channels {
  margin-top: 16px;
  font-size: 13px;
  color: #999;
}
.scroll-cta-channels a {
  color: #c62828;
  font-weight: 600;
  text-decoration: none;
  margin: 0 6px;
}

/* ── Exit Intent Popup ── */
.exit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,26,46,0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: exitFadeIn 0.25s ease;
  backdrop-filter: blur(3px);
}
@keyframes exitFadeIn { from { opacity:0; } to { opacity:1; } }

.exit-box {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 480px;
  width: 92%;
  overflow: hidden;
  box-shadow: 0 24px 72px rgba(15,26,46,0.25);
  animation: exitSlideUp 0.3s ease;
}
@keyframes exitSlideUp { from { transform:translateY(24px); opacity:0.6; } to { transform:translateY(0); opacity:1; } }

.exit-box-top {
  background: linear-gradient(135deg, var(--deep,#2a1215) 0%, var(--brand,#c62828) 100%);
  color: #fff;
  padding: 28px 32px 24px;
  text-align: center;
}
.exit-box-top .exit-emoji { font-size: 36px; display: block; margin-bottom: 10px; }
.exit-box-top h2 { font-size: 22px; font-weight: 800; margin: 0 0 8px; color: #fff; }
.exit-box-top p { font-size: 14px; opacity: 0.88; margin: 0; line-height: 1.6; }

.exit-box-body {
  padding: 24px 32px 28px;
}
.exit-points {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.exit-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink,#1a2332);
}
.exit-points li::before {
  content: '✓';
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand,#c62828);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.exit-btns {
  display: grid;
  gap: 10px;
}
.exit-btn-primary {
  display: block;
  text-align: center;
  padding: 14px;
  background: var(--brand,#c62828);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.18s;
}
.exit-btn-primary:hover { background: var(--brand-strong,#a51d1d); color: #fff; text-decoration: none; }
.exit-btn-secondary {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1.5px solid var(--line,#e2e8f0);
  color: var(--muted,#5f6d7e);
  font-size: 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s;
}
.exit-btn-secondary:hover { border-color: var(--brand,#c62828); color: var(--brand,#c62828); text-decoration: none; }

.exit-close {
  position: absolute;
  top: 12px; right: 14px;
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.exit-close:hover { background: rgba(255,255,255,0.3); }
.exit-dismiss {
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted,#999);
  cursor: pointer;
}
.exit-dismiss:hover { color: var(--ink,#333); }

/* ── Print Styles ── */
@media print {
  .site-header, .wechat-float, .sidebar-cta, .contact-section, .menu-toggle {
    display: none !important;
  }
  .content-layout {
    grid-template-columns: 1fr !important;
  }
  .content-main a {
    text-decoration: underline;
  }
  .content-main a::after {
    content: " (" attr(href) ")";
    font-size: 12px;
    color: #666;
  }
}

/* ── AI Chat Widget ── */
.ai-chat-trigger {
  position: fixed;
  bottom: 96px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(198,40,40,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 22px;
  line-height: 1;
}
.ai-chat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(198,40,40,0.5);
}
.ai-chat-trigger .ai-trigger-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #16a34a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.ai-chat-panel {
  position: fixed;
  bottom: 160px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 180px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(15,23,42,0.18);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: aiPanelIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes aiPanelIn {
  from { opacity: 0; transform: scale(0.85) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ai-chat-panel.closing {
  animation: aiPanelOut 0.18s ease forwards;
}
@keyframes aiPanelOut {
  to { opacity: 0; transform: scale(0.88) translateY(10px); }
}

.ai-panel-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ai-panel-header .ai-avatar {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ai-panel-header .ai-info { flex: 1; min-width: 0; }
.ai-panel-header .ai-name { font-size: 15px; font-weight: 700; }
.ai-panel-header .ai-status { font-size: 12px; opacity: 0.85; display: flex; align-items: center; gap: 4px; }
.ai-panel-header .ai-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.ai-panel-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.ai-panel-close:hover { background: rgba(255,255,255,0.3); }

.ai-quick-btns {
  display: flex;
  gap: 6px;
  padding: 10px 12px 8px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.ai-quick-btns::-webkit-scrollbar { display: none; }
.ai-quick-btn {
  white-space: nowrap;
  padding: 5px 10px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ai-quick-btn:hover, .ai-quick-btn.selected {
  background: var(--brand);
  color: #fff;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.ai-messages::-webkit-scrollbar { width: 4px; }
.ai-messages::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.ai-msg { display: flex; gap: 8px; align-items: flex-start; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg.assistant .ai-bubble {
  background: var(--wash);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.ai-msg.user .ai-bubble {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-typing { display: flex; gap: 4px; align-items: center; padding: 10px 12px; }
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: aiDot 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDot { 0%,80%,100%{transform:scale(0.6);opacity:0.4} 40%{transform:scale(1);opacity:1} }

.ai-wechat-card {
  margin: 4px 0;
  padding: 14px;
  background: linear-gradient(135deg, #fff8f8, #fff);
  border: 1px solid #fecaca;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
}
.ai-wechat-card strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.ai-wechat-card .ai-qr { width: 100px; height: 100px; margin: 8px auto; border-radius: 8px; object-fit: cover; }
.ai-wechat-card .ai-qr-placeholder { width: 100px; height: 100px; margin: 8px auto; background: var(--wash); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.ai-wechat-btn {
  display: block; width: 100%; padding: 9px; margin-top: 10px;
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s;
}
.ai-wechat-btn:hover { background: var(--brand-strong); }

.ai-composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.ai-composer input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.ai-composer input:focus { border-color: var(--brand); }
.ai-composer button {
  padding: 9px 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.ai-composer button:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.ai-composer button:not(:disabled):hover { background: var(--brand-strong); }

@media (max-width: 480px) {
  .ai-chat-panel { width: calc(100vw - 24px); right: 12px; bottom: 150px; }
  .ai-chat-trigger { bottom: 88px; right: 14px; }
}
