/* ============================================================
   第３款 首頁 — Figma 414:1106（已登入 Footer收合）／399:8686（未登入 Footer展開）
   畫布 1920 × 5451｜內容欄 1720（x 100–1820）｜頁尾欄 1680（x 120–1800）
   ============================================================ */

@font-face { font-family: "Material Icons"; src: url("figma/fonts/MaterialIcons-Regular.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: block; }
@font-face { font-family: "Material Icons Outlined"; src: url("figma/fonts/MaterialIconsOutlined-Regular.otf") format("opentype"); font-style: normal; font-weight: 400; font-display: block; }

:root {
  color-scheme: light;

  /* 品牌綠 */
  --brand: #1a685d;
  --brand-deep: #0f4f45;
  --brand-mid: #2a8078;

  /* 檸檬綠強調 */
  --lime: #a3e536;
  --lime-soft: #d9f99d;
  --lime-mint: #ecfccb;
  --lime-pale: #f4ffe1;
  --olive: #4d7c0f;

  /* 文字 */
  --ink: #0f172a;
  --ink-card: #1b1b23;
  --ink-body: #24364d;
  --ink-muted: #64748b;
  --ink-nav: #334155;

  /* 面 */
  --header-bg: #fbfef6;
  --mint-band: #effcf8;
  --news-card: #f4fcfa;
  --chip: #f1f5f9;
  --hairline: #e6ebf1;

  /* 類別卡 */
  --cat-teal: #2a8078;
  --cat-blue: #1b619d;
  --cat-green: #4a9d5f;

  --card-shadow: 0 6px 18px rgb(15 60 50 / 0.08), 0 1px 3px rgb(15 60 50 / 0.06);
  --lift-shadow: 0 16px 34px rgb(15 60 50 / 0.16), 0 3px 8px rgb(15 60 50 / 0.08);

  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;

  --col: 1720px;
  --col-footer: 1680px;
  --gutter: 40px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; background: #fff; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: #fff;
  color: var(--ink-body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

.mi, .mi-o { font-style: normal; line-height: 1; user-select: none; }
.mi { font-family: "Material Icons"; }
.mi-o { font-family: "Material Icons Outlined"; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:where(a, button, input):focus-visible { outline: 3px solid #0ea5e9; outline-offset: 2px; border-radius: 6px; }

.col { width: min(var(--col), 100% - var(--gutter) * 2); margin-inline: auto; }
.col-footer { width: min(var(--col-footer), 100% - var(--gutter) * 2); margin-inline: auto; }

/* ============================================================
   上方功能列 1920 × 42
   ============================================================ */
.util-bar {
  height: 42px;
  background: var(--brand);
  color: #fff;
}
.util-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  height: 100%;
  font-size: 14px;
}
.util-inner a { transition: color .18s; }
.util-inner a:hover { color: var(--lime); }
.util-inner .sep { width: 1px; height: 15px; background: rgb(236 252 203 / 0.35); }
.util-lang { display: inline-flex; align-items: center; gap: 2px; }
.util-lang .mi { font-size: 20px; }

/* ============================================================
   Header 1920 × 80，底色 #fbfef6
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 80px;
  background: var(--header-bg);
  border-bottom: 1px solid rgb(26 104 93 / 0.08);
}
.header-inner { display: flex; align-items: center; height: 100%; }

.site-brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-right: 32px; }
.site-brand .brand-symbol { width: 50px; height: 44px; }
.site-brand .brand-wordmark { width: 246px; height: 27px; }

.primary-nav { display: flex; align-items: center; gap: 16px; }
.primary-nav a,
.primary-nav .nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 47px;
  padding-inline: 16px;
  border-radius: 999px;
  color: var(--ink-nav);
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .18s, color .18s;
}
.primary-nav a:hover { background: rgb(26 104 93 / 0.08); color: var(--brand); }
.primary-nav .nav-pill {
  color: var(--brand);
  background: rgb(163 229 54 / 0.22);
  border: 1px solid rgb(26 104 93 / 0.18);
  font-weight: 700;
}
.primary-nav .nav-pill .mi-o { font-size: 18px; }
.primary-nav .nav-pill:hover { background: rgb(163 229 54 / 0.34); }

.header-tools { display: flex; align-items: center; margin-left: auto; }

/* 探索膠囊 123 × 51 */
.explore-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 51px;
  padding: 0 16px;
  margin-right: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f8f6f, #1a685d);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgb(26 104 93 / 0.28);
  transition: filter .18s, transform .18s;
}
.explore-pill:hover { filter: brightness(1.08); transform: translateY(-1px); }
.explore-pill .mi { font-size: 18px; color: #fff4d3; }

/* 搜尋 360 × 48 */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 360px;
  height: 48px;
  padding: 0 6px 0 16px;
  border: 1px solid rgb(26 104 93 / 0.18);
  border-radius: 999px;
  background: #fff;
}
.header-search > .mi { font-size: 20px; color: rgb(0 0 0 / 0.45); }
.header-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  font-size: 15px;
  color: var(--ink-body);
}
.header-search input::placeholder { color: rgb(0 0 0 / 0.6); }
.header-search input:focus { outline: none; }
.header-search .tune {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}
.header-search .tune .mi-o { font-size: 20px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: 12px;
  border-radius: 999px;
  color: var(--brand);
  transition: background-color .18s;
}
.icon-button:hover { background: rgb(26 104 93 / 0.1); }
.icon-button .mi-o { font-size: 24px; }

.login-button {
  height: 40px;
  padding: 0 22px;
  margin-left: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f8f6f, #1a685d);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  transition: filter .18s;
}
.login-button:hover { filter: brightness(1.1); }

/* 帳號選單 */
.profile-wrap { position: relative; margin-left: 16px; }
.profile-trigger { display: flex; align-items: center; gap: 2px; height: 40px; border-radius: 999px; padding-right: 4px; }
.profile-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.profile-trigger .mi { font-size: 22px; color: var(--brand); }

.profile-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--lift-shadow);
  display: none;
}
.profile-menu.open { display: block; }
.profile-summary { padding: 10px 12px 12px; border-bottom: 1px solid var(--hairline); margin-bottom: 6px; }
.profile-summary strong { display: block; font-size: 15px; color: var(--ink); }
.profile-summary span { font-size: 13px; color: var(--ink-muted); }
.profile-menu-group { padding: 4px 0; border-bottom: 1px solid var(--hairline); }
.profile-menu-group:last-child { border-bottom: 0; }
.profile-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: var(--ink-body); text-align: left;
  transition: background-color .16s;
}
.profile-menu-item:hover { background: rgb(26 104 93 / 0.08); }
.profile-menu-item.current { background: rgb(163 229 54 / 0.2); color: var(--brand); font-weight: 700; }
.profile-menu-item img { width: 20px; height: 20px; }
.profile-menu-item.logout { color: #b91c1c; }

/* ============================================================
   Hero 1920 × 652
   ============================================================ */
.ai-hero {
  position: relative;
  min-height: 652px;
  overflow: hidden;
  background: url("figma/assets/ai-hero-texture.png") center 55% / cover no-repeat;
}
.ai-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, rgb(71 160 79 / 0.08) 0%, rgb(45 157 82 / 0.16) 48%, rgb(24 133 73 / 0.26) 100%),
    radial-gradient(240px 240px at 88% 46%, rgb(255 255 255 / 0.16), transparent 70%),
    radial-gradient(180px 180px at 34% 62%, rgb(255 255 255 / 0.12), transparent 70%);
  pointer-events: none;
}
.ai-hero::after {
  content: "";
  position: absolute;
  left: -15.9375%;
  top: 60.276%;
  width: 126.875%;
  aspect-ratio: 2436 / 722.155;
  background: url("figma/assets/ai-hero-clouds.svg") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1704px, 100% - var(--gutter) * 2);
  margin-inline: auto;
  padding-top: 46px;
  padding-bottom: 78px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 35px;
  padding: 0 18px;
  border: 1px solid rgb(26 104 93 / 0.28);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.42);
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
}
.hero-eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--brand);
}

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 432px;
  gap: 32px;
  align-items: start;
  min-height: 386px;
}

.hero-copy { position: relative; z-index: 3; max-width: 640px; }
.hero-copy h1 {
  margin-top: 24px;
  font-size: 66px;
  line-height: 83px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--ink);
}
.hero-copy h1 .line { display: block; }
.hero-copy h1 .line.inverse { color: #fff; text-shadow: 0 2px 10px rgb(15 79 69 / 0.28); }
.hero-copy h1 .highlight { color: #ffe14d; }
.hero-copy h1 em { font-style: normal; color: var(--brand); }
.hero-copy p {
  max-width: 627px;
  margin-top: 24px;
  font-size: 17px;
  line-height: 27px;
  color: rgb(0 0 0 / 0.8);
}

/* 人物照 732 × 410，置於文案與達標卡之間 */
.hero-people {
  position: absolute;
  left: 37.35%;   /* 設計稿 x=717 / 1920 */
  top: 56px;      /* 設計稿 y=178，Hero 起點 122 */
  width: 38.13%;  /* 設計稿 732 / 1920 */
  height: auto;
  z-index: 2;
  pointer-events: none;
}

/* 達標卡 432 × 292 */
.goal-card {
  position: relative;
  z-index: 3;
  right: -58px;
  width: 432px;
  min-height: 292px;
  margin-top: 40px;
  padding: 26px 28px;
  border: 1px solid #e4ffd0;
  border-radius: 24px;
  background: rgb(23 82 66 / 0.42);
  backdrop-filter: blur(12px);
  color: #fff;
  box-shadow: 0 18px 40px rgb(12 62 48 / 0.28);
}
.goal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.goal-top .goal-label { display: inline-flex; align-items: center; gap: 8px; }
.goal-top .goal-label i { font-style: normal; opacity: .5; }
.identity-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.18);
  font-size: 13px;
}
.identity-switch span { padding: 3px 10px; border-radius: 999px; color: rgb(255 255 255 / 0.95); }
.identity-switch .active { background: var(--lime); color: #08263a; font-weight: 700; }

.goal-number { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; }
.goal-number strong { font-size: 56px; line-height: 1; font-weight: 900; }
.goal-number span { font-size: 20px; font-weight: 700; color: #a3e536; }

.goal-track {
  height: 10px;
  margin-top: 20px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.38);
  overflow: hidden;
}
.goal-track span {
  display: block;
  width: 60%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a3e536, #22d3ee);
}
.goal-hint { margin-top: 12px; font-size: 14px; }
.goal-divider { height: 1px; margin-top: 22px; background: rgb(255 255 255 / 0.16); }
.goal-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 19px; }
.goal-bottom small { display: block; font-size: 13px; color: rgb(255 255 255 / 0.7); }
.goal-bottom strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 700; }
.goal-bottom button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--lime);
  color: #1a2e05;
  font-size: 14px;
  font-weight: 700;
  transition: filter .18s;
}
.goal-bottom button:hover { filter: brightness(1.06); }

/* 搜尋列 1704 × 107 */
.hero-search {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 107px;
  margin-top: 34px;
  padding: 0 120px;
  border: 1px solid #fff;
  border-radius: 24px;
  background: rgb(255 255 255 / 0.2);
  backdrop-filter: blur(10px);
}
.search-segment { width: 240px; flex: 0 0 auto; padding-inline: 14px 16px; }
.search-segment small { display: block; font-size: 14px; color: rgb(0 0 0 / 0.6); }
.search-segment .seg-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  color: #1a2e05;
}
.search-segment .seg-value .mi { font-size: 20px; }
.search-divider {
  width: 1px;
  height: 30px;
  flex: 0 0 1px;
  margin-inline: 18px;
  background: #e6f0cf;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgb(0 0 0 / 0.2);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  color: var(--ink-body);
}
.hero-search input::placeholder { color: rgb(0 0 0 / 0.6); }
.hero-search input:focus { outline: none; }
.hero-search .go-search {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 150px;
  height: 48px;
  margin-left: 18px;
  border: 1px solid #fff;
  border-radius: 12px;
  background: var(--brand);
  color: var(--lime-mint);
  font-size: 17px;
  font-weight: 700;
  transition: filter .18s;
}
.hero-search .go-search:hover { filter: brightness(1.12); }
.hero-search .go-search .mi { font-size: 20px; }

/* ============================================================
   區塊標題：8×62 漸層直條 + 英文小標 + 中文標題
   ============================================================ */
.sec-head { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.sec-bar {
  width: 8px;
  height: 62px;
  flex: 0 0 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #84cc16 0%, #22c55e 45%, #0ea5e9 100%);
}
.sec-title small {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--olive);
}
.sec-title h2 {
  margin-top: 6px;
  font-size: 32px;
  line-height: 43px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .5px;
}
.sec-spacer { margin-left: auto; }

/* 圓形箭頭 52 × 52 */
.arrow-round {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgb(26 104 93 / 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  box-shadow: var(--card-shadow);
  transition: background-color .18s, color .18s, transform .18s;
}
.arrow-round .mi { font-size: 24px; }
.arrow-round:hover { background: var(--brand); color: #fff; transform: scale(1.06); }

.dots { display: flex; align-items: center; justify-content: center; gap: 8px; height: 10px; }
.dots span { width: 14px; height: 6px; border-radius: 999px; background: #cbd5e1; transition: width .2s, background-color .2s; }
.dots span.active { width: 40px; background: linear-gradient(90deg, #84cc16, #22c55e); }

/* ============================================================
   我的學習紀錄（已登入）— 1920 × 294，卡片 560 × 120
   ============================================================ */
.my-record { padding: 52px 0 0; }
.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}
.record-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 120px;
  padding: 20px 24px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s;
}
.record-card:hover { transform: translateY(-3px); box-shadow: var(--lift-shadow); }
.record-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
}
.record-icon img { position: absolute; }
.record-icon .record-board, .record-icon .record-stack { width: 56px; height: auto; }
.record-icon .record-stack.back { transform: translate(-6px, -5px); }
.record-icon .record-mark { width: 22px; height: auto; }
.record-icon .record-mark.mark-a { transform: translate(-9px, 3px); }
.record-icon .record-mark.mark-b { transform: translate(9px, 3px); }
.record-copy { flex: 1; min-width: 0; }
.record-copy span { display: block; font-size: 18px; font-weight: 500; color: var(--ink-body); }
.record-copy small { display: block; margin-top: 2px; font-size: 15px; color: var(--ink-muted); }
.record-copy small b { color: var(--olive); }
.record-total {
  flex: 0 0 auto;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  color: var(--olive);
}

/* ============================================================
   推薦課程 — 卡片 409 × 549，gap 28
   ============================================================ */
.recommend { padding: 80px 0 0; }
.filter-tabs { display: flex; align-items: center; gap: 24px; height: 48px; }
.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 158px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--chip);
  color: #4d657e;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .18s, box-shadow .18s, transform .18s, background-color .18s;
}
.filter-tab:hover { transform: translateY(-1px); }
.filter-tab .tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  color: #fff;
  font-size: 17px;
}
.filter-tab[data-tab="ai"] .tab-icon { border-radius: 9px; background: linear-gradient(140deg, #a855f7, #6366f1); }
.filter-tab[data-tab="latest"] .tab-icon { background: linear-gradient(140deg, #34c48d, #16a34a); }
.filter-tab[data-tab="popular"] .tab-icon { background: linear-gradient(140deg, #38a3e8, #1d7fd0); }
.filter-tab[aria-pressed="true"] {
  background: #fff;
  border-color: #a855f7;
  color: #6d28d9;
  font-weight: 700;
  box-shadow: 0 4px 14px rgb(168 85 247 / 0.2);
}

.course-viewport { position: relative; margin-top: 36px; }
.course-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.side-arrow { position: absolute; top: 300px; z-index: 5; }
.side-arrow.next { right: -80px; }
.side-arrow.prev { left: -80px; }

.course-card {
  display: flex;
  flex-direction: column;
  min-height: 549px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--lift-shadow); }
.course-cover { position: relative; height: 222px; border-radius: 12px; overflow: hidden; background: #12263f; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-type {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 6px;
  background: #12263f;
  color: #fff;
  font-size: 13px;
}
.course-type.orange { background: #f97316; }
.course-type.amber { background: #fbbf24; color: #452c03; }

.course-body { display: flex; flex-direction: column; flex: 1; padding-top: 12px; }
.course-body h3 {
  min-height: 56px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  color: var(--ink-card);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-tags { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.course-tags p {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  font-size: 14px; color: var(--ink-muted);
  white-space: nowrap;
}
.course-tags strong { color: var(--ink-body); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.agency-badge {
  display: inline-block;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgb(163 229 54 / 0.22);
  color: var(--brand);
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agency-badge.blue { background: #dfeefb; color: #1b619d; }

.course-meta { margin-top: 16px; display: grid; gap: 4px; }
.course-meta span { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 24px; color: var(--ink-muted); }
.course-meta .mi-o { font-size: 16px; color: #94a3b8; }
.course-meta strong { color: var(--ink-body); font-weight: 700; }

.course-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px; border-top: 1px solid #eef2f6;
}
.course-footer .learners { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--ink-body); }
.course-footer .learners .mi-o { font-size: 18px; color: #94a3b8; font-weight: 400; }
.course-footer .detail-link { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-body); transition: color .18s; }
.course-footer .detail-link:hover { color: var(--brand); }
.course-footer .detail-link .mi { font-size: 16px; }

.recommend .dots { margin-top: 46px; }

/* ============================================================
   最新消息 — 卡片 555 × 188
   ============================================================ */
.news { padding: 80px 0 0; }
.more-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-nav);
  font-size: 17px;
  box-shadow: var(--card-shadow);
  transition: transform .18s, box-shadow .18s;
}
.more-button:hover { transform: translateY(-1px); box-shadow: var(--lift-shadow); }
.more-button .mi { font-size: 18px; color: rgb(0 0 0 / 0.6); }

.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 36px; }
.news-card {
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 24px;
  border: 1px solid rgb(26 104 93 / 0.1);
  border-radius: 14px;
  background: var(--news-card);
  transition: transform .18s, box-shadow .18s;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--lift-shadow); }
.news-card h3 {
  font-size: 17px;
  line-height: 27px;
  font-weight: 700;
  color: #101828;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta { display: flex; align-items: center; gap: 20px; margin-top: 10px; font-size: 14px; color: var(--ink-body); }
.news-meta span { display: inline-flex; align-items: center; gap: 6px; }
.news-meta .mi-o { font-size: 16px; }
.news-actions { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 16px; }
.tag-chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border: 1px solid rgb(26 104 93 / 0.16); border-radius: 8px;
  background: #fff; font-size: 14px; color: var(--ink-body);
}
.read-more {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border-radius: 8px; background: var(--brand); color: var(--lime-mint);
  font-size: 14px; transition: filter .18s;
}
.read-more:hover { filter: brightness(1.15); }

/* ============================================================
   課程類別 — 3 張大卡 523 / 571 / 571 × 323
   ============================================================ */
.categories { padding: 80px 0 0; }
.cat-grid { display: grid; grid-template-columns: 523fr 571fr 571fr; gap: 28px; margin-top: 36px; }
.cat-card {
  position: relative;
  min-height: 323px;
  padding: 28px 32px;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 12px 28px rgb(15 60 50 / 0.18);
  transition: transform .2s, box-shadow .2s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgb(15 60 50 / 0.26); }
.cat-card.teal  { background: linear-gradient(150deg, #2a8078 0%, #22706c 100%); }
.cat-card.blue  { background: linear-gradient(150deg, #1b619d 0%, #1a5486 100%); }
.cat-card.green { background: linear-gradient(150deg, #57a463 0%, #47915a 100%); }
.cat-card::before,
.cat-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}
.cat-card::before { width: 240px; height: 240px; right: -59px; top: -39px; background: rgb(255 255 255 / 0.18); }
.cat-card::after  { width: 160px; height: 160px; right: 0; bottom: -30px; background: rgb(255 255 255 / 0.05); }

.cat-inner { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; min-height: 267px; }
.cat-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: rgb(255 255 255 / 0.16);
  border: 1px solid rgb(255 255 255 / 0.24);
}
.cat-icon img { width: 46px; height: 46px; filter: brightness(0) invert(1); }
.cat-inner small { margin-top: 26px; font-size: 13px; font-weight: 700; letter-spacing: 1.6px; }
.cat-inner h3 { margin-top: 6px; font-size: 32px; line-height: 43px; font-weight: 700; }
.cat-inner p { margin-top: 8px; font-size: 15px; color: rgb(255 255 255 / 0.9); }
.cat-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: auto; padding-top: 18px;
  border-top: 1px solid rgb(255 255 255 / 0.22);
  font-size: 15px; font-weight: 700;
}
.cat-foot .go {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 999px;
}
.cat-foot .go .mi { font-size: 18px; }

/* ============================================================
   熱門課程專區（淡薄荷底）／主打課程專區 — 卡片 392 × 311
   ============================================================ */
.hot-zone { padding: 80px 0 84px; background: var(--mint-band); }
.featured { padding: 80px 0 0; }

.zone-row, .feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 36px;
  padding-inline: 40px;
}
.feature-grid { row-gap: 32px; }

.zone-card, .feature-card {
  display: block;
  min-height: 311px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.zone-card:hover, .feature-card:hover {
  transform: translateY(-4px);
  border-color: rgb(26 104 93 / 0.35);
  box-shadow: var(--lift-shadow);
}
.zone-card img, .feature-card img { width: 100%; height: 232px; border-radius: 10px; object-fit: cover; }
.zone-card h3, .feature-card h3 {
  display: grid; place-items: center;
  height: 51px;
  font-size: 16px; font-weight: 700; color: var(--ink-body); text-align: center;
}

/* ============================================================
   相關網站 — 4 × 409 × 116
   ============================================================ */
.partners { padding: 80px 0 40px; }
.partner-viewport { position: relative; margin-top: 36px; }
.partner-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 409px)); gap: 24px; }
.partner-card {
  display: grid;
  place-items: center;
  height: 116px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fff;
  transition: transform .18s, box-shadow .18s;
}
.partner-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow); }
.partner-card img { width: 100%; height: 100%; object-fit: contain; }
.partners .side-arrow { top: 85px; }
.partners .dots { gap: 20px; margin-top: 36px; }
.partners .dots span { width: 20px; height: 10px; }
.partners .dots span.active { width: 60px; }

/* ============================================================
   統計帶 1920 × 200（區塊 280）
   ============================================================ */
.stats {
  margin-top: 80px;
  height: 200px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(520px 520px at 12% 120%, rgb(255 255 255 / 0.16), transparent 70%),
    radial-gradient(560px 560px at 22% -180%, rgb(255 255 255 / 0.12), transparent 70%),
    linear-gradient(100deg, #52b872 0%, #4ab375 46%, #5eba7e 100%);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(1809px, 100% - var(--gutter) * 2);
  text-align: center;
}
.stat-item { position: relative; }
.stat-item + .stat-item::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 1px;
  background: rgb(255 255 255 / 0.3);
}
.stat-item strong {
  display: block;
  font-size: clamp(26px, 2.4vw, 46px);
  line-height: 1.15;
  font-weight: 900;
  color: #fff;
  letter-spacing: .5px;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgb(12 62 48 / 0.2);
}
.stat-item span {
  display: block;
  margin-top: 16px;
  font-size: clamp(13px, .95vw, 17px);
  font-weight: 500;
  color: #1a2e05;
  white-space: nowrap;
}

/* ============================================================
   頁尾 1920 × 714，底色 #1a685d
   ============================================================ */
.site-footer { background: var(--brand); color: #fff; }
.footer-accent {
  height: 6px;
  background: linear-gradient(90deg, #84cc16 0%, #22c55e 22%, #22d3ee 50%, #0ea5e9 100%);
}
.footer-main { padding: 30px 0 34px; }

.footer-brand-row { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-logo .brand-symbol { width: 56px; height: 50px; }
.footer-logo .brand-wordmark { width: 282px; height: 32px; }
.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-size: 16px;
  color: var(--lime-pale);
}
.footer-links a { transition: color .18s; }
.footer-links a:hover { color: var(--lime); text-decoration: underline; }
.footer-links .sep { width: 1px; height: 16px; background: rgb(255 255 255 / 0.3); }
.footer-badge { width: 119px; height: auto; margin-left: 28px; }

.accordion { margin-top: 28px; }
.accordion-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 0;
  font-size: 20px; font-weight: 700; color: var(--lime);
}
.accordion-trigger .mi { font-size: 20px; transition: transform .22s; }
.accordion-trigger[aria-expanded="false"] .mi { transform: rotate(180deg); }
.accordion-panel {
  margin-top: 12px;
  padding: 16px 24px;
  border-radius: 12px;
  background: rgb(252 252 255 / 0.1);
  font-size: 16px;
  line-height: 38px;
  color: #fff;
}
.accordion-trigger[aria-expanded="false"] + .accordion-panel { display: none; }
.accordion-panel .divider { margin: 0 8px; color: rgb(255 255 255 / 0.5); }
.accordion-panel strong { font-weight: 700; }
.accordion-panel a { color: var(--lime-soft); font-weight: 700; text-decoration: underline; }
.support-line { display: flex; flex-wrap: wrap; column-gap: 80px; }
.support-cols { display: grid; grid-template-columns: 448px minmax(0, 1fr); }
.accordion-panel ol { margin: 0; padding-left: 24px; }
.accordion-panel ul { margin: 0; padding-left: 12px; list-style: none; }
.accordion-panel ul li::before { content: "・"; margin-right: 2px; }
.support-cols .span-2 { grid-column: 1 / -1; }
.accordion-panel ul li a { color: var(--lime-soft); }

.footer-bottom { border-top: 1px solid rgb(255 255 255 / 0.2); }
.footer-bottom .col-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 80px;
  font-size: 15px;
  color: rgb(255 255 255 / 0.7);
}

/* ============================================================
   浮動工具 64 × 207
   ============================================================ */
.floating-tools {
  position: fixed;
  right: 20px;
  top: 660px;
  z-index: 50;
  width: 64px;
  padding: 4px 0;
  border-radius: 16px;
  background: #fcfcfc;
  box-shadow: 0 8px 24px rgb(15 60 50 / 0.2);
}
.floating-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 64px; padding: 10px 0;
  color: #3b3b3b; font-size: 12px;
  transition: transform .18s;
}
.floating-action:hover { transform: translateY(-2px); }
.floating-action .action-circle {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgb(15 60 50 / 0.2);
  overflow: hidden;
}
.floating-action .action-circle img { width: 100%; height: 100%; object-fit: cover; }
.floating-divider { height: 1px; margin: 0 8px; background: rgb(0 0 0 / 0.12); }

.toast {
  position: fixed; left: 50%; bottom: 40px; z-index: 90;
  transform: translate(-50%, 20px);
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 20px; border-radius: 999px;
  background: rgb(15 79 69 / 0.95); color: #fff; font-size: 15px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 登入狀態切換 */
body:not(.logged-in) [data-when="logged-in"] { display: none !important; }
body.logged-in [data-when="logged-out"] { display: none !important; }

/* ============================================================
   響應式
   ============================================================ */
@media (max-width: 1860px) {
  .floating-tools { top: auto; bottom: 28px; right: 16px; }
}
@media (max-width: 1700px) {
  .side-arrow.next, .side-arrow.prev { display: none; }
  .zone-row, .feature-grid { padding-inline: 0; }
  .partner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .goal-card { right: 0; }
}
/* 視窗窄於設計稿 1920 時，收緊 header 以免右側頭像被擠出 */
@media (max-width: 1560px) {
  .site-brand { margin-right: 20px; }
  .site-brand .brand-wordmark { width: 208px; height: 23px; }
  .primary-nav { gap: 6px; }
  .primary-nav a, .primary-nav .nav-pill { padding-inline: 12px; font-size: 16px; }
  .explore-pill { margin-right: 14px; padding-inline: 14px; }
  .header-search { width: 300px; }
}
@media (max-width: 1440px) {
  .hero-copy h1 { font-size: 54px; line-height: 70px; }
  .hero-people { max-width: 42%; top: 90px; }
  .hero-search { padding-inline: 40px; }
}
@media (max-width: 1280px) {
  .primary-nav a, .primary-nav .nav-pill { padding-inline: 10px; font-size: 15px; }
  .header-search { width: 260px; }
  .explore-pill { margin-right: 12px; font-size: 15px; }
  .hero-row { grid-template-columns: minmax(0, 1fr) 380px; }
  .goal-card { width: 100%; }
  .hero-people { display: none; }
  .course-grid, .zone-row, .feature-grid, .partner-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .course-grid > :nth-child(4), .zone-row > :nth-child(4), .partner-grid > :nth-child(4) { display: none; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  :root { --gutter: 24px; }
  .site-header { height: auto; padding: 10px 0; }
  .header-inner { flex-wrap: wrap; row-gap: 10px; }
  .primary-nav { order: 3; width: 100%; overflow-x: auto; }
  .hero-row { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-top: 24px; max-width: none; }
  .goal-card { margin-top: 24px; }
  .hero-search { flex-wrap: wrap; gap: 16px; padding: 20px 24px; }
  .search-segment { width: calc(33.333% - 12px); }
  .search-divider { display: none; }
  .hero-search input { flex: 1 1 240px; }
  .hero-search .go-search { margin-left: 0; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid > :nth-child(3) { grid-column: 1 / -1; }
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .record-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { height: auto; padding: 32px 0; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 24px; }
  .stat-item + .stat-item::before { display: none; }
  .support-cols { grid-template-columns: minmax(0, 1fr); }
  .support-line { column-gap: 32px; }
  .footer-brand-row { flex-wrap: wrap; }
  .footer-links { margin-left: 0; }
}
@media (max-width: 768px) {
  .sec-head { min-height: 0; padding-block: 8px; }
  .sec-title h2 { font-size: 26px; line-height: 34px; }
  .sec-bar { height: 52px; }
  .hero-copy h1 { font-size: 38px; line-height: 52px; }
  .filter-tabs { width: 100%; overflow-x: auto; gap: 12px; padding-bottom: 4px; }
  .filter-tab { min-width: 0; font-size: 15px; }
  .course-grid, .zone-row, .feature-grid, .partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-grid > :nth-child(n + 3), .zone-row > :nth-child(n + 3), .partner-grid > :nth-child(n + 3) { display: none; }
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .news-grid > :nth-child(3) { grid-column: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-bottom .col-footer { flex-direction: column; align-items: flex-start; padding-block: 18px; }
  .footer-logo .brand-wordmark { width: 210px; height: 24px; }
}
@media (max-width: 520px) {
  .course-grid, .zone-row, .feature-grid, .partner-grid { grid-template-columns: minmax(0, 1fr); }
  .course-grid > :nth-child(n + 2), .zone-row > :nth-child(n + 2), .partner-grid > :nth-child(n + 2) { display: none; }
  .feature-grid > :nth-child(n + 5) { display: none; }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .search-segment { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
