:root {
  --blue-950: #071b49;
  --blue-900: #003b90;
  --blue-700: #0866c6;
  --blue-500: #2ea8ff;
  --blue-100: #eaf7ff;
  --cyan: #20d5d2;
  --green: #7bd972;
  --yellow: #ffd44d;
  --pink: #ff6fb1;
  --ink: #152033;
  --muted: #637083;
  --line: #d8e5f2;
  --paper: #f7fbff;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(0, 59, 144, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(46, 168, 255, .18), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(32, 213, 210, .18), transparent 26rem),
    linear-gradient(180deg, #f2f9ff 0%, #ffffff 28%, #f7fbff 100%);
  font-family: "Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;
  line-height: 1.75;
  min-height: 100vh;
}

a { color: inherit; }

/* ---- Site nav (shared with home) ---- */
.site-nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  margin: 14px auto 0;
  width: min(96vw, 1180px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,59,144,.12);
  box-shadow: 0 14px 32px rgba(0,59,144,.1);
}
.site-nav .brand-mini { display: flex; align-items: center; gap: 10px; font-weight: 1000; font-size: 13px; color: var(--blue-900); text-decoration: none; white-space: nowrap; }
.site-nav .brand-mini img { width: 84px; height: auto; display: block; }
.site-nav-links { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--blue-900);
  background: rgba(234,247,255,.6);
  border: 1px solid rgba(0,59,144,.1);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  transition: background .18s ease;
  white-space: nowrap;
}
.site-nav-links a:hover,
.site-nav-links a.active { background: rgba(46,168,255,.22); }
@media (max-width: 620px) {
  .site-nav { flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; }
  .site-nav-links { justify-content: flex-start; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  margin: 28px auto 0;
  width: min(96vw, 1180px);
  padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 64px);
  border-radius: 18px;
  border: 1px solid rgba(0,59,144,.14);
  background:
    radial-gradient(circle at 88% 18%, rgba(32,213,210,.22), transparent 16rem),
    radial-gradient(circle at 8% 92%, rgba(255,212,77,.22), transparent 16rem),
    linear-gradient(135deg, rgba(255,255,255,.98) 0 52%, rgba(234,248,255,.92) 52% 78%, rgba(236,251,247,.94) 78%);
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 12px;
  background: linear-gradient(180deg, var(--blue-900), var(--cyan), var(--yellow));
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-900);
  font-weight: 1000;
  letter-spacing: .12em;
  font-size: 12px;
  text-transform: uppercase;
}
.hero-eyebrow::before { content: ""; width: 36px; height: 4px; background: linear-gradient(90deg, var(--blue-900), var(--cyan), var(--yellow)); }

.hero h1 {
  margin: 16px 0 14px;
  color: var(--blue-950);
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
  font-weight: 1000;
  text-shadow: .04em .04em 0 rgba(32, 213, 210, .18);
}
.hero-subtitle {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(90deg, #0b6ea8, #32aaa1);
  font-size: clamp(15px, 1.8vw, 19px);
  font-weight: 950;
  letter-spacing: .04em;
  box-shadow: 0 14px 28px rgba(0,59,144,.18);
}
.hero-lead {
  margin: 20px 0 0;
  max-width: 56rem;
  color: #3a4a64;
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 700;
  line-height: 1.7;
}
.hero-meta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--blue-900);
  background: white;
  border: 1px solid rgba(0,59,144,.16);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0,59,144,.08);
}
.hero-meta span::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue-700);
}
.hero-meta span:nth-child(2)::before { background: var(--cyan); }
.hero-meta span:nth-child(3)::before { background: var(--green); }
.hero-meta span:nth-child(4)::before { background: var(--yellow); }
.hero-meta span:nth-child(5)::before { background: var(--pink); }

/* ---- Sections ---- */
.section {
  width: min(96vw, 1180px);
  margin: 32px auto 0;
}
.section h2 {
  margin: 0 0 18px;
  color: var(--blue-900);
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 1000;
}
.section h2::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 4px;
  margin-right: 14px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--blue-900), var(--cyan), var(--yellow));
  border-radius: 999px;
}

/* ---- Gallery ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.gallery figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #eef6ff;
  border: 1px solid rgba(0,59,144,.12);
  box-shadow: 0 14px 32px rgba(0,59,144,.1);
  aspect-ratio: 4 / 3;
}
.gallery figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform .4s ease;
}
.gallery figure:hover img { transform: scale(1.04); }
.gallery figure figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  color: white;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
  background: linear-gradient(180deg, transparent, rgba(0,28,72,.78));
}
.gallery .feature { grid-column: span 6; aspect-ratio: 16 / 10; }
.gallery .half    { grid-column: span 6; }
.gallery .third   { grid-column: span 4; }
.gallery .quarter { grid-column: span 3; }
@media (max-width: 920px) {
  .gallery .feature { grid-column: span 12; }
  .gallery .half { grid-column: span 12; }
  .gallery .third { grid-column: span 6; }
  .gallery .quarter { grid-column: span 6; }
}
@media (max-width: 520px) {
  .gallery .third,
  .gallery .quarter { grid-column: span 12; }
}

/* ---- Article copy ---- */
.copy-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 920px) { .copy-grid { grid-template-columns: 1fr; } }

.article {
  padding: clamp(24px, 3vw, 40px);
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0,59,144,.08);
  color: #2a3a55;
  font-size: 16px;
  line-height: 1.85;
  font-weight: 540;
}
.article p { margin: 0 0 1em; }
.article h3 {
  margin: 28px 0 12px;
  color: var(--blue-900);
  font-size: 21px;
  line-height: 1.3;
  font-weight: 1000;
}
.article h3:first-child { margin-top: 0; }
.article h3::before {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--blue-700), var(--cyan));
  box-shadow: 0 6px 14px rgba(0,59,144,.18);
}
.article ul, .article ol { margin: 0 0 1em; padding-left: 1.4em; }
.article li { margin-bottom: 6px; }

/* Highlight aside */
.sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 96px;
  align-self: start;
}
.sidebar-card {
  padding: 22px;
  border-radius: 16px;
  border: 1px solid rgba(0,59,144,.14);
  background: linear-gradient(150deg, rgba(0,59,144,.94), rgba(8,102,198,.92));
  color: white;
  box-shadow: var(--shadow);
}
.sidebar-card.light {
  background: white;
  color: var(--ink);
}
.sidebar-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 1000;
  color: var(--yellow);
}
.sidebar-card.light h4 { color: var(--blue-700); }
.sidebar-card p { margin: 0; line-height: 1.7; font-size: 14.5px; font-weight: 580; }
.sidebar-card.light p { color: #3a4a64; }

.kv-list { display: grid; gap: 8px; }
.kv-list div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 14px; }
.kv-list b { color: var(--blue-700); font-weight: 1000; }
.sidebar-card.dark .kv-list b { color: var(--yellow); }

/* Course cards (used by 東昇 page) */
.courses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 12px; }
@media (max-width: 720px) { .courses { grid-template-columns: 1fr; } }
.course-card {
  position: relative;
  padding: 22px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(0,59,144,.08);
}
.course-card::before {
  content: "";
  position: absolute;
  left: 22px; top: 0;
  width: 60px; height: 6px;
  border-radius: 0 0 6px 6px;
  background: var(--blue-700);
}
.course-card:nth-child(2)::before { background: var(--cyan); }
.course-card:nth-child(3)::before { background: var(--green); }
.course-card:nth-child(4)::before { background: var(--yellow); }
.course-card .course-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 24px;
  background: #eaf7ff;
  margin-bottom: 14px;
}
.course-card h3 {
  margin: 0 0 6px;
  color: var(--blue-900);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 1000;
}
.course-card .course-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.course-card p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: #364a66; }
.course-card ul { margin: 0; padding-left: 1.1em; color: #364a66; font-size: 13.5px; line-height: 1.6; }
.course-card ul li { margin-bottom: 4px; }

/* Outcomes block */
.outcomes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 720px) { .outcomes { grid-template-columns: repeat(2, 1fr); } }
.outcome-tile {
  padding: 18px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(0,59,144,.08);
}
.outcome-tile b {
  display: block;
  margin-bottom: 4px;
  color: var(--blue-900);
  font-size: 16px;
}
.outcome-tile span { display: block; color: #46586f; font-size: 13.5px; line-height: 1.55; font-weight: 580; }

/* Single footer with built-in back-to-home CTA */
.site-footer {
  margin: 40px auto 0;
  width: min(96vw, 1180px);
  padding: 24px clamp(22px, 3vw, 34px) 26px;
  border-radius: 16px;
  color: rgba(255,255,255,.92);
  background:
    radial-gradient(circle at 12% 30%, rgba(46,168,255,.28), transparent 16rem),
    radial-gradient(circle at 92% 80%, rgba(32,213,210,.22), transparent 14rem),
    linear-gradient(135deg, #001f54, #003b90 60%, #0866c6);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  line-height: 1.7;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.site-footer-text strong { display: block; color: white; font-size: 17px; line-height: 1.4; margin-bottom: 4px; font-weight: 1000; }
.site-footer-text span { display: block; color: rgba(255,255,255,.72); }
.site-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 999px;
  color: var(--blue-950);
  background: var(--yellow);
  font-weight: 1000;
  text-decoration: none;
  font-size: 14px;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
  transition: transform .18s ease;
  white-space: nowrap;
}
.site-footer-cta:hover { transform: translateY(-2px); }
@media (max-width: 620px) {
  .site-footer { grid-template-columns: 1fr; gap: 14px; }
  .site-footer-cta { justify-self: start; }
}

/* ---- Floating audio player (same as home) ---- */
#audio-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #0b6ea8, #20d5d2);
  box-shadow: 0 14px 32px rgba(0,59,144,.36), inset 0 0 0 2px rgba(255,255,255,.25);
  display: grid;
  place-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
#audio-toggle:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(0,59,144,.4); }
#audio-toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(32,213,210,.55);
  opacity: 0;
  animation: audioPulse 2s ease-out infinite;
}
#audio-toggle.playing::before { opacity: 1; }
@keyframes audioPulse {
  0% { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.4); opacity: 0; }
}
#audio-toggle .icon-play,
#audio-toggle .icon-pause { width: 22px; height: 22px; display: none; }
#audio-toggle:not(.playing) .icon-play { display: block; }
#audio-toggle.playing .icon-pause { display: block; }
#audio-toggle .icon-play { margin-left: 3px; }
@media (max-width: 620px) {
  #audio-toggle { right: 14px; bottom: 14px; width: 52px; height: 52px; }
}

/* === Mobile (≤768px) — keep layout but reflow vertically === */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  /* Cleaner mobile nav: logo only + horizontal scroll pills (matches home page) */
  .site-nav {
    width: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    margin: 14px 12px 0;
    padding: 8px 6px 8px 14px;
    gap: 10px;
    border-radius: 18px;
    flex-direction: row;
    overflow: hidden;
  }
  .site-nav .brand-mini { font-size: 0; gap: 0; flex: 0 0 auto; }
  .site-nav .brand-mini span { display: none; }
  .site-nav .brand-mini img { width: 72px; height: auto; }
  .site-nav-links {
    flex: 1 1 0;
    min-width: 0;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 4px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent);
            mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent);
  }
  .site-nav-links::-webkit-scrollbar { display: none; }
  .site-nav-links a {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 900;
    background: linear-gradient(135deg, #f3faff, #e6f4ff);
    border: 1px solid rgba(0,59,144,.16);
  }
  .site-nav-links a.active { background: linear-gradient(135deg, #0866c6, #20d5d2); color: white; border-color: transparent; }

  /* Hero compaction */
  .hero {
    margin: 16px 12px 0;
    width: auto;
    padding: 22px 18px 24px;
    border-radius: 14px;
  }
  .hero::before { width: 8px; }
  .hero h1 { font-size: 26px; line-height: 1.15; margin: 12px 0 12px; }
  .hero-subtitle { font-size: 14px; padding: 7px 16px; }
  .hero-lead { margin-top: 14px; font-size: 13.5px; line-height: 1.65; }
  .hero-meta { margin-top: 16px; gap: 6px; }
  .hero-meta span { padding: 5px 10px; font-size: 11.5px; }

  /* Sections */
  .section { width: auto; margin: 24px 12px 0; }
  .section h2 { font-size: 19px; line-height: 1.25; }
  .section h2::before { width: 24px; height: 3px; margin-right: 10px; }

  /* Gallery — already 12-col adapts via @media 520, but tighten further */
  .gallery { gap: 8px; }
  .gallery figure figcaption { font-size: 11px; padding: 8px 10px; }

  /* Copy grid */
  .copy-grid { gap: 16px; }
  .article { padding: 18px; font-size: 14.5px; line-height: 1.8; }
  .article h3 { font-size: 18px; margin: 20px 0 8px; }
  .article h3::before { width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; }

  /* Sidebar — release sticky on small screens */
  .sidebar { position: static; gap: 12px; }
  .sidebar-card { padding: 16px; }
  .sidebar-card h4 { font-size: 13px; }
  .sidebar-card p { font-size: 13.5px; }
  .kv-list div { grid-template-columns: 70px 1fr; font-size: 13px; }

  /* Course cards */
  .course-card { padding: 16px; }
  .course-card h3 { font-size: 17px; }
  .course-card p { font-size: 13px; line-height: 1.7; }
  .course-card ul { font-size: 12.5px; }

  /* Outcomes — already 2-col below 720px, refine */
  .outcomes { gap: 8px; }
  .outcome-tile { padding: 14px; }
  .outcome-tile b { font-size: 14.5px; }
  .outcome-tile span { font-size: 12.5px; line-height: 1.5; }

  /* Footer */
  .site-footer {
    width: auto;
    margin: 28px 12px 0;
    padding: 20px;
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
  }
  .site-footer-text strong { font-size: 15px; }
  .site-footer-text span { font-size: 12.5px; line-height: 1.65; }
  .site-footer-cta { justify-self: center; padding: 10px 20px; font-size: 13px; }
}
