:root {
  --navy: #0c2d6b;
  --navy-deep: #081f4a;
  --blue: #1b5fa3;
  --gold: #b8892d;
  --gold-soft: #e8d5a3;
  --ink: #1e232b;
  --muted: #5a6270;
  --paper: #f3efe6;
  --white: #fff;
  --line: #d9d1c3;
  --serif: "Noto Serif TC", "PMingLiU", "Songti TC", serif;
  --sans: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
  background: var(--white);
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.skip {
  position: absolute; left: -999px;
}
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 20; }

.topbar {
  background: var(--navy-deep);
  color: #d7deea;
  font-size: 13px;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.topbar a { color: #d7deea; text-decoration: none; }
.topbar .dot {
  display: inline-block;
  width: 4px; height: 4px;
  margin: 0 10px 2px;
  background: var(--gold);
  border-radius: 50%;
  vertical-align: middle;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  overflow: visible;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
  position: relative;
  overflow: visible;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
  min-width: 220px;
}
.brand img { width: 168px; }
.brand-text { display: none; }
.brand-text strong { font-family: var(--serif); font-size: 16px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .02em; }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  font: inherit;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav > ul {
  display: flex;
  gap: 4px;
}
.site-nav { overflow: visible; }
.site-nav > ul > li { position: relative; }
.site-nav > ul > li.has-mega { position: static; }
.site-nav > ul > li > a {
  display: block;
  padding: 14px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 2px solid transparent;
}
.site-nav > ul > li.is-active > a,
.site-nav > ul > li > a:hover {
  color: var(--navy);
  border-bottom-color: var(--gold);
}
.sub, .mega {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(8, 31, 74, .08);
  min-width: 240px;
  padding: 10px 0;
  display: none;
  z-index: 40;
  list-style: none;
}
.mega {
  display: none;
  left: 0;
  right: 0;
  width: auto;
  min-width: 0;
  max-width: none;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px 28px;
  padding: 20px 24px;
}
.mega:before, .sub:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}
.has-sub:hover .sub,
.has-sub:focus-within .sub { display: block; }
.has-sub:hover .mega,
.has-sub:focus-within .mega { display: grid; }
.sub a, .mega a {
  display: block;
  padding: 7px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.sub a:hover, .mega a:hover { background: var(--paper); }
.mega-title {
  margin: 0 0 8px;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}
.mega ul { list-style: none; margin: 0; padding: 0; }

.hero { position: relative; background: var(--navy-deep); color: #fff; overflow: hidden; }
.hero-track { position: relative; background: var(--navy-deep); }
.hero-slide {
  min-height: 420px;
  background-color: var(--navy-deep);
  background-size: cover;
  background-position: center;
  position: absolute;
  inset: 0;
  opacity: 0;
  /* Instant hide so two photos never blend (blend looks washed / “變淺”). */
  transition: opacity 0s linear;
  pointer-events: none;
  z-index: 0;
}
.hero-slide:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8,31,74,.9) 0%, rgba(8,31,74,.74) 48%, rgba(8,31,74,.64) 100%);
}
.hero-slide.is-on {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
  transition: opacity .55s ease;
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding: 72px 0;
  max-width: 640px;
  margin-left: max(20px, calc((100% - 1120px) / 2));
}
.hero-copy,
.hero-copy h1,
.hero-copy p {
  color: #fff;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.25;
  margin: 8px 0 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
.hero-copy p {
  color: #f4f6fa;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
}
.hero-nav {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  gap: 8px;
}
.hero-nav button {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.5);
  background: transparent;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.eyebrow {
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
  margin: 0 0 8px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--navy); line-height: 1.3; }
.hero h1 { color: #fff; }
.stats { background: var(--navy); color: #fff; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 36px 0;
}
.stats .kicker { margin: 0; color: var(--gold-soft); font-size: 13px; }
.stats .value { font-family: var(--serif); font-size: 32px; margin: 4px 0; color: #fff; }
.stats p { margin: 0; color: #d7deea; }

.band, .band-alt { padding: 64px 0; }
.band { background: var(--paper); }
.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}
.split h2, .panel h2 { margin-top: 0; font-size: 30px; }
.cards-2, .cards-3, .news-grid, .hub-grid, .quotes, .steps, .contact-grid {
  display: grid;
  gap: 24px;
}
.cards-2 { grid-template-columns: 1fr 1fr; padding: 64px 0; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.panel, .plain-card, .news-card, .hub-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 28px;
  text-decoration: none;
  color: inherit;
}
.plain-card h3, .news-card h2, .news-card h3, .hub-card h2 { margin: 0 0 10px; }
.plain-card:hover, .news-card:hover, .hub-card:hover { border-color: var(--navy); }
.btn, .btn-outline, .btn-gold {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 18px;
  text-decoration: none;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.btn-outline { background: transparent; color: var(--navy); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.text-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--navy);
  font-weight: 700;
}
.steps {
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  padding: 0 0 64px;
  margin: 0;
}
.steps span { color: var(--gold); font-family: var(--serif); font-size: 22px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.news-grid { grid-template-columns: repeat(3, 1fr); }
.news-grid-page { grid-template-columns: repeat(2, 1fr); padding-bottom: 64px; }
.news-card time, .tags span { color: var(--muted); font-size: 13px; }
.tags span { margin-right: 8px; }
.quotes { grid-template-columns: repeat(3, 1fr); padding-bottom: 48px; }
.quotes blockquote {
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 3px solid var(--gold);
}
.quotes img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; }
.quotes cite { font-style: normal; color: var(--muted); }

.page-head { background: var(--paper); padding: 36px 0 28px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 8px 0 0; font-size: clamp(28px, 3vw, 40px); }
.lead { color: var(--muted); max-width: 640px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.layout-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 40px;
  padding: 40px 0 72px;
}
.side h2 { font-size: 18px; }
.side ul { list-style: none; padding: 0; margin: 0 0 16px; }
.side li { border-bottom: 1px solid var(--line); }
.side a { display: block; padding: 8px 0; text-decoration: none; color: var(--ink); font-size: 15px; }
.prose { min-width: 0; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose p, .prose li { color: #333; }
.prose img { display: block; margin: 12px 0 20px; }
.prose ul,
.prose ol,
.service-migration {
  list-style: none;
  margin: 0.4em 0 1.2em;
  padding: 0;
}
.prose li,
.service-migration li {
  position: relative;
  list-style: none;
  margin: 0.45em 0;
  padding: 0.15em 0 0.15em 1.35em;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.78em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.prose > ul > li:has(> h2),
.prose > ul > li:has(> h3),
.prose > ul > li:has(> img),
.prose > ul > li[id^="submenu"] {
  padding-left: 0;
  margin: 0 0 1.4em;
}
.prose > ul > li:has(> h2)::before,
.prose > ul > li:has(> h3)::before,
.prose > ul > li:has(> img)::before,
.prose > ul > li[id^="submenu"]::before {
  content: none;
}
.service-migration {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 28px;
}
.service-migration li {
  padding: 10px 16px;
  background: var(--paper);
  border-left: 3px solid var(--gold);
}
.service-migration li::before {
  content: none;
}
.prose ul ul {
  margin: 8px 0 12px;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0 28px;
  font-size: 15px;
}
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--paper); }
.prose > ul > h2:first-child { display: none; }
.prose .article-nav, .prose .article-dropdown, .prose .title { display: none; }
.intro-prose { padding: 32px 0 8px; }
.hub-grid { grid-template-columns: repeat(3, 1fr); padding-bottom: 72px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 28px 0; }
.filters a {
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 12px;
  font-size: 14px;
}
.filters a.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
  padding-bottom: 64px;
}
.news-grid-page { padding-bottom: 0; }
.fb-side {
  position: sticky;
  top: 104px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}
.fb-side h2 { margin: 0 0 6px; font-size: 18px; }
.fb-side p { margin: 0 0 12px; font-size: 14px; }
.fb-embed-wrap {
  position: relative;
  min-height: 220px;
}
.fb-page-embed {
  display: block;
  width: 100%;
  max-width: 340px;
  height: 500px;
  background: #f6f7f9;
}
.fb-fallback {
  padding: 20px 16px;
  background: var(--paper);
  border-left: 3px solid var(--gold);
}
.fb-embed-wrap:not(.is-live) .fb-page-embed {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  height: 500px;
  opacity: 0;
  pointer-events: none;
}
.fb-embed-wrap.is-live .fb-fallback { display: none; }
.fb-embed-wrap.is-fallback .fb-page-embed { display: none; }
.fb-fallback-name { font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.fb-fallback p { margin: 0 0 14px; }
.fb-fallback .btn { display: inline-block; }

.contact-grid { grid-template-columns: 1fr 1fr; padding: 40px 0; }
.map { width: 100%; height: 240px; border: 0; margin-bottom: 16px; }
.office dl { margin: 0; }
.office div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; margin-bottom: 10px; }
.office dt { color: var(--muted); }
.form-wrap { padding-bottom: 72px; }
.enquiry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.enquiry label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.enquiry .full { grid-column: 1 / -1; }
.enquiry input, .enquiry select, .enquiry textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
}
.college-layout { padding: 40px 0 72px; }
.college-facts { background: var(--paper); padding: 16px 20px; margin-top: 24px; }
.college-facts ul { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 0; list-style: none; }
.college-icon { width: 36px; height: 36px; object-fit: contain; }
.college-header, .college-image { margin-bottom: 16px; }
.college-logo img { max-width: 180px; }
.college-tab { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tablinks {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
.tablinks.active, .tablinks.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.college-tabcontent { display: none; }
.college-tabcontent.is-on { display: block; }
.college-facts ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.college-facts li { padding-left: 0; margin: 0; }
.college-facts li::before { content: none; }
.flash { width: min(1120px, calc(100% - 40px)); margin: 16px auto 0; padding: 12px 16px; border: 1px solid var(--line); }
.flash-ok { background: #eef6ee; }
.flash-error { background: #f8ecec; }

.site-footer { background: var(--navy-deep); color: #d7deea; padding-top: 48px; }
.site-footer h2 { color: #fff; font-size: 18px; }
.site-footer a { color: #d7deea; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 32px; padding-bottom: 32px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badges img { height: 48px; background: #fff; padding: 4px; }
.legal { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0 28px; font-size: 13px; color: #9aa6b8; }

@media (max-width: 960px) {
  .brand-text { display: none; }
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: block; }
  .site-nav > ul { flex-direction: column; padding: 8px 20px 20px; }
  .sub, .mega {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    min-width: 0;
    grid-template-columns: 1fr;
  }
  .has-sub.is-open .sub { display: block; }
  .has-sub.is-open .mega { display: grid; }
  .stats-grid, .split, .cards-2, .cards-3, .steps, .news-grid, .quotes, .layout-page, .hub-grid, .contact-grid, .footer-grid, .enquiry, .news-grid-page, .news-layout {
    grid-template-columns: 1fr;
  }
  .fb-side { position: static; }
  .hero-copy { margin-left: 20px; padding-right: 20px; }
}
