/* ==========================================================================
   hub.css — AI 學習中心首頁
   設計 token 與課程內頁一致：極簡無彩、pill 圓角、細線陰影、大字級、手機優先。
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --canvas:    #f5f5f5;
  --surface-2: #fafafa;
  --surface:   #ffffff;
  --line:      #e5e5e5;
  --text:      #0a0a0a;
  --text-2:    #737373;
  --r-int:     18px;
  --r-card:    24px;
  --shadow:    0 0 0 1px rgba(23,23,23,.05),
               0 1px 3px rgba(0,0,0,.08),
               0 1px 2px -1px rgba(0,0,0,.08);
  --bar-h:     58px;
  --font-ui:   "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

html[data-theme="dark"] {
  --canvas:    #0a0a0a;
  --surface-2: #141414;
  --surface:   #171717;
  --line:      #2a2a2a;
  --text:      #fafafa;
  --text-2:    #8f8f8f;
  --shadow:    0 0 0 1px rgba(255,255,255,.06), 0 1px 3px rgba(0,0,0,.4);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  /* 背景全寬（蓋住底下捲動的內容），但標題要對齊卡片的文字邊緣。
     .wrap 是 640px 外框、桌機再內縮 28px，所以這裡要把那 28px 一起算進來，
     否則桌機上標題會比卡片往左突出一截。 */
  padding: env(safe-area-inset-top) max(16px, calc((100% - 640px) / 2 + 28px)) 0;
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar__t { flex: 1; font-weight: 600; font-size: 17px; letter-spacing: -.2px; }
.bar__act {
  width: 42px; height: 42px; border: 0; background: none; color: var(--text);
  font-size: 22px; border-radius: 999px; cursor: pointer;
}
.bar__act:active { background: var(--surface-2); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 640px; margin: 0 auto;
  /* 上方留白刻意壓到最小：進站第一眼就要是課程選單，不是文案 */
  padding: calc(var(--bar-h) + env(safe-area-inset-top) + 18px) 16px
           calc(env(safe-area-inset-bottom) + 48px);
}

.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-2);
  margin: 0 0 12px 4px;
}

h1 {
  font-size: 34px; line-height: 1.15; font-weight: 600;
  letter-spacing: -1.2px; margin: 0 0 14px;
}
h2 { font-size: 23px; line-height: 1.3; font-weight: 600; letter-spacing: -.5px; margin: 0 0 12px; }
p { margin: 0 0 14px; }
.lede { color: var(--text-2); font-size: 17px; line-height: 1.6; margin-bottom: 18px; }
.lede b { color: var(--text); font-weight: 600; }

/* ---------- Course card ---------- */
.course {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform .1s ease;
}
a.course:active { transform: scale(.99); }
.course--soon { opacity: .55; box-shadow: none; background: var(--surface-2); border-style: dashed; }

.course__icon {
  width: 52px; height: 52px; flex: none; border-radius: var(--r-int);
  background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.course--soon .course__icon { background: transparent; }
.course__body { flex: 1; min-width: 0; }
.course__tag {
  font-size: 12px; font-weight: 500; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-2); margin-bottom: 6px;
}
.course__t { font-size: 21px; margin: 0 0 8px; letter-spacing: -.4px; }
.course__d { font-size: 16px; color: var(--text-2); line-height: 1.6; margin: 0 0 12px; }
.course__go {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 500; font-size: 16px; margin-top: 4px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip {
  font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}

/* ---------- Progress ---------- */
.prog { margin: 14px 0 4px; }
.prog__row {
  display: flex; justify-content: space-between;
  font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 7px;
}
.bar-track, .bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar__fill { height: 100%; background: var(--text); border-radius: 999px; }

/* ---------- Note grid ----------
   刻意不做成卡片：卡片外觀（白底＋陰影＋圓角）在這個頁面代表
   「可以點進去的課程」。說明文字用純排版，讀者一眼就知道兩者不同類。 */
.note { margin-top: 44px; }
.grid {
  display: grid;
  row-gap: 22px; column-gap: 32px;
}
.cell { background: none; border: 0; box-shadow: none; padding: 0; }
.cell__h {
  font-weight: 600; font-size: 17px; margin-bottom: 4px; letter-spacing: -.2px;
}
.cell p { font-size: 16px; color: var(--text-2); line-height: 1.6; margin: 0; }

/* ---------- Foot ---------- */
.foot {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--text-2); font-size: 15px; line-height: 1.65;
}
.foot p { margin: 0 0 12px; }
.foot p:last-child { margin-bottom: 0; }
.foot b { color: var(--text); font-weight: 600; }

@media (min-width: 640px) {
  body { font-size: 18px; }
  h1 { font-size: 42px; letter-spacing: -1.6px; }
  .wrap { padding-left: 28px; padding-right: 28px; }
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
