:root {
  --ink: #221f26;
  --muted: #69626e;
  --paper: #fff;
  --soft: #f5f2f6;
  --plum: #43285c;
  --plum-deep: #2d193f;
  --plum-light: #ede6f2;
  --gold: #c8a45d;
  --gold-light: #f1e5c9;
  --sage: #49675b;
  --line: #ded8e2;
  --max: 1120px;
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 12px); }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; line-height: 1.75; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; display: block; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 8px 12px; transform: translateY(-150%); background: #fff; color: var(--plum); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 100; min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px max(24px, calc((100% - var(--max)) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; background: var(--plum); color: #fff; font-family: "Noto Serif TC", Georgia, serif; font-size: 18px; }
.brand-copy strong, .brand-copy small { display: block; letter-spacing: 0; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: var(--muted); font-size: 11px; }
.site-nav { display: flex; align-items: center; gap: 16px; color: #4d4651; font-size: 13px; }
.site-nav a { padding: 8px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a:focus-visible { border-bottom-color: var(--gold); color: var(--plum); }
.site-nav .nav-cta { min-height: 40px; display: inline-flex; align-items: center; padding: 0 15px; border: 1px solid var(--plum); border-radius: 4px; color: var(--plum); font-weight: 800; }
.menu-btn { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; }
.menu-btn span { width: 22px; height: 2px; display: block; margin: 4px auto; background: var(--plum); transition: transform .2s ease, opacity .2s ease; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-backdrop { display: none; }

.page-hero { position: relative; min-height: 500px; display: grid; align-items: end; overflow: hidden; background: var(--plum-deep); color: #fff; }
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--hero-image); background-position: center; background-size: cover; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30,15,42,.9), rgba(30,15,42,.55) 64%, rgba(30,15,42,.28)); }
.hero-inner { position: relative; z-index: 1; width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 100px 0 72px; }
.eyebrow { margin: 0 0 10px; color: #f0d99d; font-size: 12px; font-weight: 900; letter-spacing: 0; }
.page-hero h1 { max-width: 840px; margin: 0 0 18px; font-family: "Noto Serif TC", Georgia, serif; font-size: 52px; font-weight: 600; line-height: 1.25; letter-spacing: 0; }
.hero-lead { max-width: 700px; margin: 0 0 26px; color: rgba(255,255,255,.9); font-size: 18px; }
.hero-subtitle { max-width: 760px; margin: -6px 0 12px; color: #f0d99d; font-size: 22px; font-weight: 800; }
.status-line { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; background: rgba(255,255,255,.1); font-size: 13px; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; border: 1px solid transparent; border-radius: 4px; font-weight: 900; line-height: 1.35; text-align: center; }
.button-gold { background: var(--gold); color: #211a24; }
.button-primary { background: var(--plum); color: #fff; }
.button-secondary { border-color: var(--line); background: #fff; color: var(--plum); }
.button-ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.button-disabled { cursor: default; border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.12); color: rgba(255,255,255,.76); }
.button:hover, .button:focus-visible { filter: brightness(1.06); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.section { padding: 78px max(24px, calc((100% - var(--max)) / 2)); }
.section[id], main [id] { scroll-margin-top: calc(var(--header-height) + 12px); }
.section-soft { background: var(--soft); }
.section-dark { background: #211c25; color: #fff; }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.section-heading .eyebrow { color: #99732f; }
.section h2 { margin: 0 0 14px; font-family: "Noto Serif TC", Georgia, serif; font-size: 38px; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.section-heading p, .section-copy > p { color: var(--muted); }
.section-dark .section-heading p { color: rgba(255,255,255,.72); }
.breadcrumb { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 17px 0; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: var(--plum); }

.category-grid, .course-grid, .info-grid, .tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.category-card, .course-card, .info-card, .tool-card { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.category-card { min-height: 230px; justify-content: space-between; }
.course-card { min-height: 245px; }
.course-card.has-image, .category-card.has-image { padding: 0; overflow: hidden; }
.course-card.has-image .card-body, .category-card.has-image .card-body { min-height: 250px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 22px; }
.course-image { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--plum-light); }
.category-card:hover, .course-card:hover { border-color: var(--gold); box-shadow: 0 16px 34px rgba(35,24,42,.09); transform: translateY(-2px); }
.category-card, .course-card { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card-kicker, .tag { display: inline-block; margin-bottom: 9px; color: #8a6728; font-size: 12px; font-weight: 900; }
.status-tag { display: inline-flex; margin-top: auto; padding: 5px 8px; border: 1px solid #dacba6; border-radius: 3px; background: #fbf7ec; color: #75591f; font-size: 11px; font-weight: 900; }
.status-tag.soon { border-color: #cbbbd5; background: var(--plum-light); color: var(--plum); }
.category-card h2, .course-card h2, .info-card h3, .tool-card h3 { margin: 0 0 10px; font-family: "Noto Serif TC", Georgia, serif; font-size: 24px; line-height: 1.4; letter-spacing: 0; }
.category-card p, .course-card p, .info-card p, .tool-card p { margin: 0 0 18px; color: var(--muted); }
.course-card .card-link { margin-top: auto; color: var(--plum); font-weight: 900; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 54px; align-items: start; }
.detail-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.detail-list li { padding: 16px 18px; border-left: 3px solid var(--gold); background: var(--soft); }
.pending-box { padding: 22px; border: 1px solid #dacba6; border-radius: 6px; background: #fbf7ec; }
.pending-box strong { display: block; margin-bottom: 7px; color: #6b511e; }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gift-grid.single { grid-template-columns: minmax(0, 760px); }
.gift-item { min-height: 150px; padding: 20px; border: 1px dashed #cdbd97; border-radius: 6px; background: #fff; }
.gift-item.confirmed { border-style: solid; border-color: var(--gold); }
.gift-item span { color: #8a6728; font-size: 12px; font-weight: 900; }
.gift-item h3 { margin: 8px 0; font-size: 18px; }
.gift-item p { margin: 0; color: var(--muted); font-size: 13px; }
.faq-list { display: grid; gap: 12px; }
.faq-list details { padding: 17px 19px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.faq-list summary { cursor: pointer; color: var(--plum); font-weight: 900; }
.faq-list p { margin: 10px 0 0; color: var(--muted); }
.notice { padding: 16px 18px; border-left: 3px solid var(--sage); background: #eef4f1; color: #355046; }
.link-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.link-list a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); background: #fff; color: var(--plum); font-weight: 800; }
.step-list { counter-reset: steps; display: grid; gap: 16px; padding: 0; list-style: none; }
.step-list li { position: relative; min-height: 64px; padding: 8px 0 8px 70px; }
.step-list li::before { counter-increment: steps; content: counter(steps); position: absolute; top: 0; left: 0; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--plum); font-weight: 900; }
.syllabus-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.syllabus-list li { min-height: 58px; display: flex; align-items: center; padding: 14px 18px 14px 46px; border: 1px solid var(--line); background: #fff; position: relative; }
.syllabus-list li::before { content: ""; position: absolute; left: 19px; width: 10px; height: 10px; border: 2px solid var(--gold); border-radius: 50%; }
.platform-notice { max-width: 900px; padding: 30px; border: 1px solid var(--gold); border-radius: 6px; background: #fbf7ec; }
.platform-notice h2 { margin-top: 0; }
.platform-notice dl { display: grid; gap: 10px; margin: 24px 0 0; }
.platform-notice dl div { display: grid; grid-template-columns: minmax(140px, .35fr) 1fr; gap: 14px; padding-top: 10px; border-top: 1px solid #dfd2b1; }
.platform-notice dt { color: var(--plum); font-weight: 900; }
.platform-notice dd { margin: 0; color: var(--muted); }
.final-cta { text-align: center; }
.final-cta .hero-actions { justify-content: center; }

.site-footer { padding: 54px max(24px, calc((100% - var(--max)) / 2)); background: #1f1b22; color: #fff; }
.footer-main { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 36px; }
.site-footer p, .site-footer nav { color: rgba(255,255,255,.66); font-size: 13px; }
.site-footer nav { display: grid; gap: 8px; }
.site-footer a:hover, .site-footer a:focus-visible { color: #efd48c; }
.footer-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.55); font-size: 11px; }

@media (max-width: 1080px) {
  :root { --header-height: calc(64px + env(safe-area-inset-top)); }
  body.nav-open { overflow: hidden; }
  .site-header { min-height: var(--header-height); padding: max(9px, env(safe-area-inset-top)) 16px 9px; }
  .brand-copy small { display: none; }
  .menu-btn { display: block; flex: 0 0 44px; }
  .site-nav { position: fixed; top: var(--header-height); right: 0; bottom: auto; left: 0; z-index: 102; display: none; width: 100%; height: calc(100dvh - var(--header-height)); overflow-x: hidden; overflow-y: auto; align-items: stretch; align-content: start; gap: 0; padding: 10px 16px max(18px, env(safe-area-inset-bottom)); border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 18px 34px rgba(28,19,35,.18); }
  .site-nav.open { display: grid; }
  .site-nav a { min-height: 48px; display: flex; align-items: center; padding: 0 4px; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { justify-content: center; margin-top: 10px; border: 1px solid var(--plum); }
  .menu-backdrop.open { position: fixed; inset: var(--header-height) 0 0; z-index: 99; display: block; border: 0; background: rgba(25,17,29,.48); }
  .detail-layout { grid-template-columns: 1fr; gap: 30px; }
  .gift-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .brand-copy strong { max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .page-hero { min-height: 460px; }
  .hero-inner { width: calc(100% - 36px); padding: 86px 0 54px; }
  .page-hero h1 { font-size: 38px; }
  .hero-lead { font-size: 16px; }
  .hero-actions { display: grid; width: 100%; }
  .hero-actions .button { width: 100%; }
  .section { padding: 60px 18px; }
  .section h2 { font-size: 30px; }
  .category-grid, .course-grid, .info-grid, .tool-grid, .gift-grid { grid-template-columns: 1fr; }
  .category-card, .course-card { min-height: 0; }
  .course-card.has-image .card-body, .category-card.has-image .card-body { min-height: 0; }
  .platform-notice { padding: 22px 18px; }
  .platform-notice dl div { grid-template-columns: 1fr; gap: 2px; }
  .footer-main { grid-template-columns: 1fr; gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
