:root {
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --blue: #2f6fd6;
  --sky: #8fcbf2;
  --gold: #d6b37a;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1a2333;
  --muted: #5d6b82;
  --line: #e1e6ef;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(11, 31, 58, 0.08);
  --max: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans TC", system-ui, -apple-system, "Microsoft JhengHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- 導覽列 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 31, 58, .96);
  backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.brand span { color: var(--sky); }
.nav { display: flex; gap: 4px; }
.nav a {
  color: #cfdbec; text-decoration: none; padding: 8px 14px; border-radius: 999px;
  font-size: .95rem; transition: background .2s, color .2s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: var(--navy); background: var(--sky); font-weight: 600; }
.nav-toggle {
  display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer;
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--navy); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

/* ---------- 頁首橫幅 ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 56px 0 48px;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.page-hero p { color: #c3d3ea; margin: 0; max-width: 640px; }
.eyebrow {
  display: inline-block; color: var(--gold); font-weight: 600; letter-spacing: .12em;
  font-size: .85rem; margin-bottom: 8px;
}

main { min-height: 60vh; }
.section { padding: 56px 0; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-title p { color: var(--muted); margin: 0; }

/* ---------- 首頁 ---------- */
/* 背景圖左上角偏亮，左側用較深的遮罩讓白字清楚 */
.hero {
  background:
    linear-gradient(90deg, rgba(11,31,58,.92) 0%, rgba(11,31,58,.7) 45%, rgba(11,31,58,.3) 100%),
    url("/assets/img/hero-bg.jpg") center / cover no-repeat,
    var(--navy);
  color: #fff; overflow: hidden;
}
@media (max-width: 760px) {
  .hero {
    background:
      linear-gradient(180deg, rgba(11,31,58,.88) 0%, rgba(11,31,58,.75) 55%, rgba(11,31,58,.45) 100%),
      url("/assets/img/hero-bg.jpg") center / cover no-repeat,
      var(--navy);
  }
}
.hero .container {
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: end; gap: 24px;
  padding-top: 48px;
}
.hero-text { padding-bottom: 64px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .2em; }
.hero h1 small { display: block; font-size: .45em; color: var(--gold); font-weight: 600; margin-top: .4em; }
.hero .tagline { font-size: clamp(1.1rem, 2.4vw, 1.4rem); color: var(--sky); font-weight: 600; margin: 16px 0; }
.hero-roles { list-style: none; padding: 0; margin: 0 0 28px; color: #d7e2f2; }
.hero-roles li { padding-left: 1.2em; position: relative; }
.hero-roles li::before { content: ""; position: absolute; left: 0; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.hero-photo { align-self: end; justify-self: center; max-width: 380px; }
.hero-photo img { filter: drop-shadow(0 20px 40px rgba(0,0,0,.35)); }
@media (max-width: 760px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-text { padding-bottom: 0; }
  .hero-photo { max-width: 260px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; font-size: 1rem; font-family: inherit;
  transition: transform .15s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--sky); color: var(--navy); }
.btn-outline { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px;
}
.card h3 { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px dashed var(--line); }
.check-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 8px; width: 20px; height: 20px;
  border-radius: 50%; background: #e6f1fc; color: var(--blue); font-size: .75rem;
  display: grid; place-items: center; font-weight: 700;
}

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.skill { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; border-top: 4px solid var(--blue); }
.skill:nth-child(2) { border-top-color: var(--gold); }
.skill:nth-child(3) { border-top-color: #3aa6a0; }
.skill:nth-child(4) { border-top-color: #8a6fd1; }
.skill ul { padding-left: 1.1em; margin: 0; color: var(--muted); }

.contact {
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff;
  border-radius: var(--radius); padding: 40px; text-align: center;
}
.contact p { color: #c3d3ea; }
.contact .phone { font-size: 1.6rem; font-weight: 700; color: #fff; text-decoration: none; }

/* ---------- 證照 ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.cert {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s;
}
.cert:hover { transform: translateY(-3px); }
.cert-img {
  aspect-ratio: 4 / 3; background: #eef2f8; position: relative;
  cursor: zoom-in; border: 0; padding: 0; width: 100%;
}
.cert-img img {
  position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px);
  object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.15));
}
.cert-body { padding: 18px 20px 22px; }
.cert-body h3 { font-size: 1.08rem; margin-bottom: 4px; }
.meta { color: var(--muted); font-size: .9rem; }
.cert-body p { margin: 8px 0 0; font-size: .93rem; }

/* ---------- 課程 ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.course-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  border: 2px solid transparent; transition: border-color .2s, transform .2s;
}
.course-card:hover { border-color: var(--sky); transform: translateY(-3px); }
.course-no { color: var(--gold); font-weight: 700; font-size: .85rem; letter-spacing: .1em; }
.course-card h3 { font-size: 1.15rem; color: var(--navy); margin: 6px 0 10px; }
.course-card p {
  color: var(--muted); font-size: .93rem; margin: 0 0 16px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.more { color: var(--blue); font-weight: 600; font-size: .93rem; }

.course-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .course-detail { grid-template-columns: 1fr; } }
.course-detail .card.wide { grid-column: 1 / -1; }
.num-list { counter-reset: n; list-style: none; padding: 0; margin: 0; }
.num-list li { counter-increment: n; padding: 10px 0 10px 44px; position: relative; border-bottom: 1px dashed var(--line); }
.num-list li:last-child { border-bottom: 0; }
.num-list li::before {
  content: counter(n); position: absolute; left: 0; top: 9px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem;
}
.back-link { color: #c3d3ea; text-decoration: none; display: inline-block; margin-bottom: 12px; }
.back-link:hover { color: #fff; }

/* ---------- 課堂照片 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 6px 16px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: .93rem;
}
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.masonry { columns: 3 280px; column-gap: 16px; }
.photo {
  break-inside: avoid; margin: 0 0 16px; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.photo button { border: 0; padding: 0; width: 100%; cursor: zoom-in; background: none; display: block; }
.photo img { width: 100%; transition: transform .4s; }
.photo:hover img { transform: scale(1.03); }
.photo figcaption { padding: 12px 16px; font-size: .93rem; }
.photo figcaption .meta { display: block; font-size: .82rem; }

/* ---------- 共用 ---------- */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.loading { text-align: center; color: var(--muted); padding: 40px; }

.lightbox {
  position: fixed; inset: 0; background: rgba(5, 12, 25, .92); z-index: 100;
  display: none; align-items: center; justify-content: center; flex-direction: column;
  padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: 6px; }
.lightbox p { color: #fff; margin: 12px 0 0; text-align: center; }

.site-footer { background: var(--navy); color: #9fb2cf; padding: 32px 0; margin-top: 40px; font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: #cfdbec; text-decoration: none; }
.site-footer .admin-link {
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 2px 12px; font-size: .85rem;
}
.site-footer .admin-link:hover { color: #fff; border-color: var(--sky); }
