/* ==========================================================================
   虎智學習中心 — 主樣式
   風格參考:HaHow / 知識衛星(乾淨、大字、卡片式)
   ========================================================================== */

:root {
  /* Brand */
  --brand: #eca42b;
  --brand-hover: #d68e18;
  --brand-soft: #FFF6E6;
  --brand-dark: #b06f0a;

  /* Ink */
  --ink: #262626;
  --ink-2: #4B4B48;
  --ink-3: #8A8A82;

  /* Surface */
  --bg: #FBFAF6;
  --bg-soft: #F5F3EC;
  --line: #E5E1D7;
  --line-strong: #CBC7BC;

  /* Semantic */
  --success: #5C9020;
  --danger: #C33E2A;

  /* Level colors */
  --l1: #8BC34A;
  --l2: #26C4B8;
  --l3: #3B82F6;
  --l4: #8B5CF6;
  --l5: #EC4899;

  /* Type */
  --font-tw: 'Noto Sans TC', -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font-en: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  /* Shadow */
  --sh-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --sh-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-tw);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  background: rgba(251,250,246,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 14px var(--s5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s5);
}
.nav-brand { display: flex; align-items: center; }
.nav-brand img { height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: var(--s5); font-size: 15px; font-weight: 600; }
.nav-links a:not(.btn) { color: var(--ink-2); }
.nav-links a:not(.btn):hover { color: var(--brand); }
.nav-links .btn { padding: 9px 18px; font-size: 14px; }
@media (max-width: 720px) {
  .nav-inner { padding: 12px var(--s4); }
  .nav-brand img { height: 32px; }
  .nav-links { gap: var(--s3); font-size: 13px; }
  .nav-links a:not(.btn) { display: none; }
  .nav-links a.always-show, .nav-links .btn { display: inline-flex; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 700;
  border: none; transition: all 0.15s ease; cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { background: #fff; border-color: var(--brand); color: var(--brand-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-xl { padding: 20px 40px; font-size: 18px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ==========================================================================
   Layout
   ========================================================================== */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--s5); }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--s5); }
.section { padding: var(--s9) 0; }
.section-lg { padding: 128px 0; }
.section-sm { padding: var(--s7) 0; }

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: clamp(26px, 3.5vw, 40px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
.kicker { display: inline-block; color: var(--brand); font-weight: 800; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--s3); }
.lead { font-size: 18px; color: var(--ink-2); line-height: 1.75; max-width: 780px; }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); } .mt-7 { margin-top: var(--s7); }

/* ==========================================================================
   Homepage — Hero
   ========================================================================== */
.hero {
  padding: 96px 0 80px;
  background: linear-gradient(180deg, var(--bg) 0%, #fff 100%);
  position: relative;
  overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s8); align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: var(--s6); } }
.hero-eyebrow { color: var(--brand); font-weight: 800; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--s3); display: inline-block; }
.hero h1 { margin-bottom: var(--s5); }
.hero-sub { font-size: 19px; color: var(--ink-2); line-height: 1.7; margin-bottom: var(--s6); max-width: 560px; }
.hero-cta { display: flex; gap: var(--s3); flex-wrap: wrap; }

.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; padding: var(--s5); }
.hero-visual .lv-tower {
  display: flex; flex-direction: column; gap: 10px;
  transform: rotate(-2deg);
}
.hero-visual .lv-tile {
  display: flex; align-items: center; gap: var(--s3);
  padding: 14px 20px; border-radius: var(--r-lg);
  background: #fff; box-shadow: var(--sh-md);
  min-width: 320px;
  transition: transform 0.25s ease;
}
.hero-visual .lv-tile:hover { transform: translateX(6px); }
.hero-visual .lv-tile.l1 { border-left: 6px solid var(--l1); }
.hero-visual .lv-tile.l2 { border-left: 6px solid var(--l2); }
.hero-visual .lv-tile.l3 { border-left: 6px solid var(--l3); transform: translateX(24px); }
.hero-visual .lv-tile.l4 { border-left: 6px solid var(--l4); transform: translateX(12px); }
.hero-visual .lv-tile.l5 { border-left: 6px solid var(--l5); }
/* L3、L4 有靜態偏移,hover 時要在原偏移基礎上再往右晃,不然會退回 */
.hero-visual .lv-tile.l3:hover { transform: translateX(30px); }
.hero-visual .lv-tile.l4:hover { transform: translateX(18px); }
.hero-visual .lv-tile .tag { font-weight: 900; font-family: var(--font-en); color: var(--ink-3); font-size: 15px; }
.hero-visual .lv-tile .name { font-weight: 800; font-size: 17px; }
.hero-visual .lv-tile .oneline { font-size: 13px; color: var(--ink-3); margin-left: auto; }
@media (max-width: 900px) { .hero-visual .lv-tile { min-width: 280px; } }
@media (max-width: 600px) { .hero-visual .lv-tile .oneline { display: none; } }

/* ==========================================================================
   Course grid(首頁 course listing / HaHow 卡片風)
   ========================================================================== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s5);
  margin-top: var(--s6);
}
.course-card {
  background: #fff; border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: all 0.25s ease;
  cursor: pointer;
  display: flex; flex-direction: column;
  border: 1px solid transparent;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
  border-color: var(--brand);
}
.course-card .cover {
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  color: #fff; position: relative; overflow: hidden;
}
.course-card .cover::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 60%);
}
.course-card .cover .level-mark {
  font-family: var(--font-en); font-weight: 900; font-size: 56px;
  letter-spacing: -0.02em; line-height: 1;
  z-index: 1; text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.course-card .cover .free-tag {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  background: rgba(255,255,255,0.95); color: var(--ink);
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 800;
}
.course-card .cover .lv-tag {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  background: rgba(0,0,0,0.35); color: #fff;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700;
  backdrop-filter: blur(4px);
}
.course-card .body { padding: var(--s5); flex: 1; display: flex; flex-direction: column; }
.course-card .body .cat { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-bottom: var(--s2); }
.course-card .body h3 { font-size: 20px; font-weight: 800; margin-bottom: var(--s2); }
.course-card .body .desc { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin-bottom: var(--s4); flex: 1; }
.course-card .body .meta { display: flex; gap: var(--s4); font-size: 13px; color: var(--ink-3); margin-bottom: var(--s3); }
.course-card .body .meta span { display: inline-flex; align-items: center; gap: 4px; }
.course-card .body .price {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: var(--s3); border-top: 1px solid var(--line);
}
.course-card .body .price .amount { font-size: 22px; font-weight: 900; color: var(--brand); }
.course-card .body .price .amount.free { color: var(--l1); }
.course-card .body .price .subsidy { font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* ==========================================================================
   Why section(首頁三個 pillars)
   ========================================================================== */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); margin-top: var(--s7); }
@media (max-width: 800px) { .pillars { grid-template-columns: 1fr; } }
.pillar { background: #fff; padding: var(--s6); border-radius: var(--r-lg); border: 1px solid var(--line); }
.pillar .num { color: var(--brand); font-family: var(--font-en); font-weight: 900; font-size: 32px; line-height: 1; margin-bottom: var(--s3); }
.pillar h3 { margin-bottom: var(--s3); }
.pillar p { color: var(--ink-2); font-size: 15px; line-height: 1.7; }

/* ==========================================================================
   Path visualization(五級路徑)
   ========================================================================== */
.path {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s3);
  margin-top: var(--s7); padding: var(--s6); background: #fff;
  border-radius: var(--r-lg); border: 1px solid var(--line);
}
@media (max-width: 800px) { .path { grid-template-columns: 1fr; } }
.path-node { text-align: center; position: relative; padding: var(--s3); }
.path-node:not(:last-child)::after {
  content: '→'; position: absolute; right: -12px; top: 24px;
  color: var(--ink-3); font-size: 20px; font-weight: 800;
}
@media (max-width: 800px) {
  .path-node:not(:last-child)::after { display: none; }
}
.path-node .n {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-en); font-weight: 900; font-size: 15px;
  color: #fff; margin: 0 auto var(--s2);
}
.path-node.n1 .n { background: var(--l1); }
.path-node.n2 .n { background: var(--l2); }
.path-node.n3 .n { background: var(--l3); }
.path-node.n4 .n { background: var(--l4); }
.path-node.n5 .n { background: var(--l5); }
.path-node .name { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.path-node .oneline { font-size: 12px; color: var(--ink-3); }

/* ==========================================================================
   Course Detail Page
   ========================================================================== */
.course-hero {
  padding: 64px 0 var(--s6);
  background: linear-gradient(180deg, var(--bg-soft) 0%, transparent 100%);
}
.course-hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s7); align-items: center; }
@media (max-width: 900px) { .course-hero .wrap { grid-template-columns: 1fr; } }
.course-hero .lv-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--r-pill);
  font-weight: 800; font-size: 13px;
  margin-bottom: var(--s4);
}
.course-hero h1 { margin-bottom: var(--s4); font-size: clamp(32px, 5vw, 52px); }
.course-hero .lead { font-size: 19px; margin-bottom: var(--s5); }
.course-hero .badge-line { color: var(--ink-3); font-size: 14px; font-weight: 600; }

.course-cover-big {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--sh-lg);
}
.course-cover-big::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.25), transparent 55%);
}
.course-cover-big .lv-huge {
  font-family: var(--font-en); font-weight: 900; font-size: 180px;
  line-height: 0.9; letter-spacing: -0.04em;
  text-shadow: 0 6px 30px rgba(0,0,0,0.2);
}
.course-cover-big .lv-name {
  position: absolute; bottom: 30px; left: 30px; right: 30px;
  font-size: 24px; font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* Thesis 卡片(單一 punchline) */
.thesis-box {
  background: #fff; border-left: 6px solid var(--brand);
  padding: var(--s6);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  margin: var(--s6) 0;
  box-shadow: var(--sh-sm);
}
.thesis-box .t {
  font-size: clamp(22px, 3vw, 32px); font-weight: 800;
  line-height: 1.4; margin-bottom: var(--s3);
}
.thesis-box .b { color: var(--ink-2); font-size: 17px; line-height: 1.8; }

/* Fit yes/no */
.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s5); }
@media (max-width: 700px) { .fit-grid { grid-template-columns: 1fr; } }
.fit-col {
  border-radius: var(--r-lg); padding: var(--s5);
  border: 1.5px solid;
}
.fit-col.yes { background: #F4FAEE; border-color: rgba(139,195,74,0.3); }
.fit-col.no { background: #FBF4F4; border-color: rgba(195,62,42,0.2); }
.fit-col h3 { font-size: 16px; margin-bottom: var(--s3); }
.fit-col.yes h3 { color: var(--success); }
.fit-col.no h3 { color: var(--danger); }
.fit-col ul { list-style: none; }
.fit-col li { padding: 6px 0 6px 24px; position: relative; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.fit-col.yes li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 900; }
.fit-col.no li::before { content: '✕'; position: absolute; left: 0; color: var(--danger); font-weight: 900; }

/* Outcomes(觀念/實作/心態) */
.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); margin-top: var(--s5); }
@media (max-width: 800px) { .outcomes { grid-template-columns: 1fr; } }
.outcome-col h3 {
  font-size: 13px; color: var(--brand); font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: var(--s3); padding-bottom: var(--s2);
  border-bottom: 2px solid var(--brand);
}
.outcome-col ul { list-style: none; }
.outcome-col li {
  padding: var(--s2) 0 var(--s2) var(--s4);
  position: relative; font-size: 14px; color: var(--ink); line-height: 1.6;
}
.outcome-col li::before {
  content: ''; position: absolute; left: 4px; top: 15px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}

/* Modules(課程大綱) */
.modules { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s5); }
.mod {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s5);
  transition: border-color 0.15s;
}
.mod:hover { border-color: var(--brand); }
.mod-head {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; margin-bottom: var(--s3);
}
.mod-head .t { font-size: 17px; font-weight: 800; }
.mod-head .dur {
  color: var(--brand); font-size: 13px; font-weight: 700;
  background: var(--brand-soft); padding: 4px 12px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.mod ul { list-style: none; padding-left: var(--s3); }
.mod li {
  padding: 5px 0 5px var(--s4); position: relative;
  font-size: 14px; color: var(--ink-2); line-height: 1.6;
}
.mod li::before {
  content: '·'; position: absolute; left: 0;
  color: var(--brand); font-weight: 900; font-size: 20px; line-height: 1;
}

/* Takeaways(帶走什麼) */
.takeaways {
  background: var(--ink); color: #fff;
  border-radius: var(--r-xl); padding: var(--s7);
  margin-top: var(--s5);
}
.takeaways h3 { color: #fff; font-size: 22px; margin-bottom: var(--s4); }
.takeaways ul { list-style: none; }
.takeaways li {
  padding: var(--s2) 0 var(--s2) var(--s5); position: relative;
  font-size: 15px; line-height: 1.7;
}
.takeaways li::before {
  content: '✓'; position: absolute; left: 0; color: var(--brand);
  font-weight: 900; font-size: 18px;
}

/* FAQ */
.faq-list { margin-top: var(--s5); }
.faq-item { border-bottom: 1px solid var(--line); padding: var(--s5) 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item .q {
  font-weight: 800; font-size: 17px; margin-bottom: var(--s3);
  color: var(--ink);
}
.faq-item .q::before { content: 'Q. '; color: var(--brand); font-family: var(--font-en); }
.faq-item .a { color: var(--ink-2); font-size: 15px; line-height: 1.75; padding-left: var(--s5); }

/* Enroll CTA sticky bar */
.enroll-bar {
  position: sticky; bottom: 0;
  background: #fff; border-top: 1px solid var(--line);
  padding: var(--s4) 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 40;
}
.enroll-bar .wrap {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s5);
  flex-wrap: wrap;
}
.enroll-bar .price-info { display: flex; align-items: baseline; gap: var(--s3); }
.enroll-bar .price-info .big { font-size: 24px; font-weight: 900; color: var(--brand); }
.enroll-bar .price-info .big.free { color: var(--l1); }
.enroll-bar .price-info .small { color: var(--ink-3); font-size: 13px; }

/* ==========================================================================
   Modal / Form
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: var(--s5);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--r-xl); padding: var(--s7);
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--sh-lg);
}
.modal h2 { font-size: 24px; margin-bottom: var(--s4); }
.modal .modal-close {
  background: transparent; border: none; font-size: 24px; color: var(--ink-3);
  cursor: pointer; float: right; margin-top: -8px;
}

.form-group { margin-bottom: var(--s4); }
.form-group label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--ink-2); margin-bottom: var(--s2);
}
.form-group label .req { color: var(--danger); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px var(--s3); border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong); font-size: 15px;
  font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--brand);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--ink-3); margin-top: var(--s2); line-height: 1.5; }
.form-actions { display: flex; gap: var(--s3); justify-content: flex-end; margin-top: var(--s5); }

.form-success {
  background: #F4FAEE; border: 1.5px solid rgba(139,195,74,0.3);
  border-radius: var(--r-lg); padding: var(--s5);
  text-align: center;
}
.form-success h3 { color: var(--success); margin-bottom: var(--s2); }
.form-success p { color: var(--ink-2); font-size: 14px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #fff; border-top: 1px solid var(--line);
  padding: var(--s7) 0 var(--s5);
  margin-top: var(--s9);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s6);
  margin-bottom: var(--s6);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid img { height: 42px; margin-bottom: var(--s3); }
.footer-grid p { color: var(--ink-2); font-size: 14px; max-width: 320px; line-height: 1.6; }
.footer-grid h4 {
  font-size: 13px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: var(--s3);
}
.footer-grid a {
  display: block; color: var(--ink-2); font-size: 14px;
  padding: 4px 0; transition: color 0.15s;
}
.footer-grid a:hover { color: var(--brand); }
.footer-legal {
  border-top: 1px solid var(--line); padding-top: var(--s4);
  font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.7;
}
