/* ── Reset & Tokens ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Custom Cursor ───────────────────────── */
@media (pointer: fine) {
  * { cursor: none !important; }
}
#cur-dot {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .15s, height .15s, background .15s, opacity .15s;
  mix-blend-mode: normal;
  will-change: transform;
}
#cur-ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(201,169,110,.7);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .22s, height .22s, border-color .22s, opacity .22s;
  will-change: transform;
}
body.cur-hover #cur-dot  { width: 12px; height: 12px; background: var(--gold); }
body.cur-hover #cur-ring { width: 52px; height: 52px; border-color: var(--gold); opacity: .5; }
body.cur-click #cur-dot  { width: 6px; height: 6px; opacity: .6; }
body.cur-click #cur-ring { width: 28px; height: 28px; }
#cur-canvas {
  position: fixed; inset: 0; z-index: 9997;
  width: 100%; height: 100%;
  pointer-events: none;
}

:root {
  --gold:    #c9a96e;
  --gold-lt: #e0c99a;
  --gold-dk: #9e7c45;
  --navy:    #1a2e38;
  --navy-lt: #243f4d;
  --navy-dk: #0f1e26;
  --bg0:     #081e2a;   /* deepest section bg — deep ocean teal */
  --bg1:     #0b2535;   /* main section bg */
  --bg2:     #0d2d40;   /* alternate section bg */
  --card:    rgba(74,143,168,.09);
  --card-hv: rgba(74,143,168,.16);
  --border:  rgba(74,143,168,.2);
  --border-g:rgba(201,169,110,.25);
  --text:    rgba(255,255,255,.88);
  --text-md: rgba(255,255,255,.6);
  --text-lt: rgba(255,255,255,.38);
  --gold-glow: 0 0 20px rgba(201,169,110,.15);
  --teal:    #4a8fa8;
  --teal-lt: #62a8c2;
  --teal-dk: #2d6b84;
  --teal-glow: 0 0 24px rgba(74,143,168,.22);
  --ff-ser:  'Playfair Display', Georgia, serif;
  --ff-san:  'Noto Sans TC', 'PingFang TC', sans-serif;
  --shadow:  0 4px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.5);
  --radius:  12px;
  --tr:      .3s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--ff-san);
  background: var(--bg0);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Scroll Progress ─────────────────────── */
.progress-bar {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--gold-dk), var(--gold-lt));
  z-index: 1000; transition: width .1s linear;
}

/* ── Nav ─────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(8,30,42,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,169,110,.25);
  transition: background var(--tr), box-shadow var(--tr);
}
#nav.solid {
  background: rgba(8,30,42,.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  border-bottom-color: rgba(201,169,110,.35);
}
.nav-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 14px 40px; height: auto; min-height: 100px;
  display: flex; align-items: center; gap: 0;
}
.nav-logo { flex-shrink: 0; display: flex; align-items: center; }
.nav-logo:hover .nav-logo-img { opacity: .82; }
/* ── Nav connector line ── */
.nav-connector {
  flex: 1;
  position: relative;
  height: 12px;
  margin: 0 16px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 18%, black 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 18%, black 82%, transparent 100%);
}
/* base line — long fade-in on left, fade-out on right */
.nav-connector::after {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    transparent 0%,
    transparent 10%,
    rgba(201,169,110,.18) 30%,
    rgba(201,169,110,.28) 45%,
    rgba(74,143,168,.15) 65%,
    transparent 100%
  );
}
/* travelling shimmer */
.nav-connector::before {
  content: '';
  position: absolute;
  top: 50%; left: -50%;
  width: 50%; height: 2px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(201,169,110,.3) 30%,
    rgba(255,245,210,.75) 50%,
    rgba(201,169,110,.3) 70%,
    transparent 100%
  );
  filter: blur(1.2px);
  animation: ncShimmer 8s ease-in-out infinite;
}
@keyframes ncShimmer {
  0%   { left: -50%; opacity: 0; }   /* 0–1.4s: 等星星點亮 */
  18%  { left: -50%; opacity: 0; }
  22%  { opacity: 1; }               /* 1.4s 開始出發 */
  80%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }   /* 8s 結束，下一輪重頭 */
}
/* three constellation dots */
.nc-dot {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(201,169,110,.65);
  box-shadow: 0 0 5px rgba(201,169,110,.5);
  z-index: 1;
}
.nc-dot:nth-child(1) { left: 25%; animation: ncPulse 8s 2.8s ease-in-out infinite; }
.nc-dot:nth-child(2) { left: 50%; animation: ncPulse 8s 4.0s ease-in-out infinite; }
.nc-dot:nth-child(3) { left: 75%; animation: ncPulse 8s 5.2s ease-in-out infinite; }
@keyframes ncPulse {
  0%,100% { opacity: .25; transform: translateY(-50%) scale(1); }
  6%      { opacity: 1; transform: translateY(-50%) scale(2);
            box-shadow: 0 0 10px rgba(201,169,110,.9); }
  18%     { opacity: .3; transform: translateY(-50%) scale(1); }
}

.nav-logo { position: relative; }
.nav-logo-img {
  height: 100px; width: auto;
  display: block;
  transition: opacity var(--tr);
}
.logo-star-halo { display: none; }

.nav-menu { display: flex; gap: 32px; margin-left: 0; }

/* ── Nav 用戶區塊 ── */
.nav-user-info {
  display: flex; align-items: center; gap: 12px;
  margin-left: 24px; padding-left: 20px;
  border-left: 1px solid rgba(74,143,168,.25);
  flex-shrink: 0;
}
.nav-uname { font-size: .8rem; color: var(--text-md); }
.nav-admin-link {
  font-size: .75rem; padding: 4px 10px;
  border: 1px solid rgba(201,169,110,.35);
  border-radius: 20px; color: var(--gold);
  text-decoration: none; transition: background .2s;
}
.nav-admin-link:hover { background: rgba(201,169,110,.1); }
.nav-logout {
  font-size: .75rem; padding: 4px 12px;
  border: 1px solid rgba(74,143,168,.3);
  border-radius: 20px; background: transparent;
  color: var(--text-md); cursor: pointer;
  font-family: inherit; transition: .2s;
}
.nav-logout:hover { background: rgba(74,143,168,.12); color: var(--text); }
.nav-login-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; padding: 5px 14px;
  border: 1px solid rgba(201,169,110,.35);
  border-radius: 20px; color: var(--gold);
  text-decoration: none; transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.nav-login-btn:hover { background: rgba(201,169,110,.1); border-color: rgba(201,169,110,.6); }
.nav-login-btn svg { opacity: .85; flex-shrink: 0; }
.nav-menu a {
  font-size: .875rem; color: var(--text-md);
  letter-spacing: .04em;
  transition: color var(--tr); position: relative;
}
.nav-menu a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--teal);
  transition: width var(--tr);
}
.nav-menu a:hover, .nav-menu a.active { color: var(--teal-lt); }
.nav-menu a:hover::after, .nav-menu a.active::after { width: 100%; }

.nav-ham {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  margin-left: auto; padding: 4px;
}
.nav-ham span {
  display: block; width: 24px; height: 2px;
  background: var(--gold-lt); border-radius: 2px;
  transition: var(--tr);
}
.nav-drawer {
  display: none; flex-direction: column;
  background: rgba(8,30,42,.97);
  backdrop-filter: blur(16px);
  padding: 16px 32px 24px; gap: 4px;
  border-top: 1px solid var(--border-g);
}
.nav-drawer a {
  color: var(--text-md); font-size: .95rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--tr);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--teal-lt); }
.nav-drawer.open { display: flex; }

@media (max-width: 720px) {
  .nav-menu { display: none; }
  .nav-ham  { display: flex; }
}

/* ── Shared Layout ───────────────────────── */
.wrap {
  max-width: 1140px; margin: 0 auto; padding: 0 32px;
  position: relative; z-index: 1;
}
section { padding: 96px 0; position: relative; overflow: hidden; }

.sec-hd { text-align: center; margin-bottom: 56px; }
.sec-hd h2 {
  font-family: var(--ff-ser);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--gold-lt);
  margin: 8px 0 14px; line-height: 1.25;
}
.sec-hd p { color: var(--text-md); max-width: 540px; margin: 0 auto; font-size: .95rem; }

.eyebrow {
  display: inline-block; font-size: .68rem; font-weight: 700;
  letter-spacing: .2em; color: var(--teal); text-transform: uppercase;
  margin-bottom: 4px;
}

/* ── Reveal ──────────────────────────────── */
.rv {
  opacity: 0; transform: translateY(28px);
  transition: opacity .65s var(--d,0s) ease,
              transform .65s var(--d,0s) cubic-bezier(.2,.8,.2,1);
}
.rv.in { opacity: 1; transform: none; }

/* ── Hero ────────────────────────────────── */
#hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg0); overflow: hidden;
}
/* Hero 底部漸層收尾，自然銜接下方亮色 section */
#hero::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 120px;
  background: linear-gradient(to bottom, transparent 0%, #f7f4ef 100%);
  pointer-events: none; z-index: 3;
}
#starsCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; pointer-events: none;
}
#hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%,  rgba(201,169,110,.1)  0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(74,143,168,.15)  0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(8,30,42,.4)     0%, transparent 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2; text-align: center;
  padding: 120px 32px 80px; max-width: 800px;
}
.hero-eyebrow {
  font-size: .72rem; font-weight: 500; letter-spacing: .24em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 24px;
}
.hero-h1 {
  font-family: var(--ff-ser);
  font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700;
  color: #fff; line-height: 1.2; margin-bottom: 24px;
}
.hero-h1 em { font-style: italic; color: var(--gold); }
.hero-desc {
  font-size: 1rem; color: rgba(255,255,255,.5);
  min-height: 1.7em; margin-bottom: 40px; letter-spacing: .02em;
}
.hero-levels {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 10px; margin-bottom: 48px;
}
.hlvl {
  padding: 8px 18px;
  border: 1px solid var(--border-g);
  border-radius: 999px; font-size: .82rem;
  color: rgba(255,255,255,.7);
  background: rgba(201,169,110,.07);
  backdrop-filter: blur(4px);
  transition: background var(--tr), border-color var(--tr), color var(--tr); cursor: pointer;
}
.hlvl:hover {
  background: rgba(201,169,110,.18);
  border-color: var(--gold); color: var(--gold-lt);
}
.hero-stats {
  display: flex; align-items: center;
  justify-content: center; flex-wrap: wrap;
  border: 1px solid var(--border-g);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04); backdrop-filter: blur(8px);
  overflow: hidden;
}
.hs {
  flex: 1; min-width: 90px; padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hs strong { font-family: var(--ff-ser); font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.hs span   { font-size: .68rem; color: rgba(255,255,255,.4); letter-spacing: .06em; }
.hs-sep    { width: 1px; height: 36px; background: var(--border-g); flex-shrink: 0; }

.scroll-down {
  position: absolute; bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 2;
}
.scroll-down span {
  display: block; width: 1px; height: 22px;
  background: linear-gradient(to bottom, transparent, rgba(201,169,110,.5));
  animation: scrollPulse 2s ease-in-out infinite;
}
.scroll-down span:nth-child(2) { animation-delay: .35s; }
@keyframes scrollPulse {
  0%,100% { opacity: .25; transform: scaleY(.7); }
  50%      { opacity: 1;   transform: scaleY(1.3); }
}

/* ── Light section theme (below hero) ──────── */
#tracks, #catalog, #materials, #roadmap {
  /* Override CSS vars so all descendants inherit light palette */
  --text:      #1b2e3a;
  --text-md:   rgba(27,46,58,.6);
  --text-lt:   rgba(27,46,58,.38);
  --card:      #ffffff;
  --card-hv:   #f5f2ed;
  --border:    rgba(27,46,58,.1);
  --border-g:  rgba(201,169,110,.3);
  --shadow:    0 2px 16px rgba(27,46,58,.07);
  --shadow-lg: 0 10px 36px rgba(27,46,58,.13);
  background: #f7f4ef;
}


/* Remove nebula overlays on other light sections */
#catalog::before, #materials::before, #roadmap::before { display: none; }

/* Section headings → dark navy on light bg */
#tracks .sec-hd h2, #catalog .sec-hd h2,
#materials .sec-hd h2, #roadmap .sec-hd h2 { color: #1b2e3a; }

/* "規劃中" soon badge on light bg */
.tcard-badge.soon { background: rgba(27,46,58,.08); color: rgba(27,46,58,.4); }

/* Catalog: module container areas */
#catalog .mods     { background: rgba(27,46,58,.04); }
#catalog .mod      { background: #ffffff; }
#catalog .mod-body { background: #f8f5f1; }
#catalog .mod-head:hover { background: rgba(27,46,58,.03); }

/* Materials: progress bar track */
#materials .pb-track { background: rgba(27,46,58,.1); }

/* Roadmap: quarter headers → lighter tints on cream */
#roadmap .rq1 { background: linear-gradient(135deg,rgba(210,50,50,.1),rgba(150,15,15,.06)); border-bottom-color: rgba(210,50,50,.12); }
#roadmap .rq2 { background: linear-gradient(135deg,rgba(200,155,0,.1),rgba(150,95,0,.06)); border-bottom-color: rgba(200,155,0,.1); }
#roadmap .rq3 { background: linear-gradient(135deg,rgba(25,135,55,.1),rgba(10,75,25,.06)); border-bottom-color: rgba(55,175,75,.1); }
#roadmap .ri-who { background: rgba(27,46,58,.07); }

/* Section separator line — subtle gold on light bg */
section + section::after {
  content: ''; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 80%; max-width: 600px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,.2), transparent);
  z-index: 2; pointer-events: none;
}

/* ── Tracks ──────────────────────────────── */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.tcard {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 22px;
  display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow var(--tr), transform var(--tr), border-color var(--tr), background var(--tr);
  color: var(--text);
}
.tcard:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-5px);
  background: var(--card-hv); border-color: var(--border-g);
}
.tcard-on {
  border-color: rgba(74,143,168,.35); cursor: pointer;
  background: rgba(74,143,168,.06);
  box-shadow: var(--teal-glow);
}
.tcard-on:hover { border-color: var(--teal); box-shadow: 0 0 32px rgba(74,143,168,.3); }

/* 亮色 section 中：hover 金色高亮 */
#tracks .tcard:hover {
  background: rgba(201,169,110,.12);
  border-color: rgba(201,169,110,.55);
  box-shadow: 0 10px 36px rgba(201,169,110,.18);
}
#tracks .tcard-on {
  border-color: var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
#tracks .tcard-on:hover {
  background: rgba(201,169,110,.12);
  border-color: rgba(201,169,110,.55);
  box-shadow: 0 10px 36px rgba(201,169,110,.18);
}

.tcard-badge {
  position: absolute; top: -1px; right: 20px;
  padding: 3px 12px;
  background: var(--gold); color: var(--navy-dk);
  font-size: .66rem; font-weight: 700; letter-spacing: .08em;
  border-radius: 0 0 8px 8px; text-transform: uppercase;
}
.tcard-badge.soon {
  background: rgba(255,255,255,.1); color: var(--text-md);
}
.tcard-icon { font-size: 2rem; line-height: 1; }
.tcard h3  { font-family: var(--ff-ser); font-size: 1.08rem; color: var(--gold-lt); font-weight: 600; }
.tcard p   { font-size: .858rem; color: var(--text-md); line-height: 1.65; flex: 1; }
.tcard ul  { font-size: .79rem; color: var(--text-lt); display: flex; flex-direction: column; gap: 5px; }
.tcard ul li { padding-left: 14px; position: relative; }
.tcard ul li::before { content: '—'; position: absolute; left: 0; color: var(--gold-dk); }
.tcard-cta { font-size: .8rem; font-weight: 600; color: var(--gold); letter-spacing: .04em; }

/* ── Catalog Tabs ────────────────────────── */
.cat-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.cat-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text-md);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s, box-shadow .2s;
  line-height: 1.2;
}
.cat-tab span {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-lt);
}
.cat-tab:hover {
  border-color: rgba(201,169,110,.5);
  background: rgba(201,169,110,.08);
  color: var(--text);
}
.cat-tab.active {
  border-color: var(--gold);
  background: rgba(201,169,110,.13);
  color: var(--text);
  box-shadow: 0 2px 12px rgba(201,169,110,.18);
}
.cat-tab.active span { color: var(--gold); }

/* ── Catalog ─────────────────────────────── */
.lvl-block { margin-bottom: 40px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

.lvl-hd {
  padding: 20px 28px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.lv0 { background: linear-gradient(135deg, #1e3d1a, #2a5424); border-top: 1px solid rgba(255,255,255,.08); }
.lv1 { background: linear-gradient(135deg, #0d2a35, #164d60); border-top: 2px solid var(--teal); }
.lv2 { background: linear-gradient(135deg, #3a1610, #5a2818); border-top: 1px solid rgba(255,255,255,.08); }
.lv3 { background: linear-gradient(135deg, #0f1e26, #1a2e38); border-top: 2px solid var(--gold); }

.lvl-em { font-size: 2rem; flex-shrink: 0; }
.lvl-hd > div:nth-child(2) { flex: 1; min-width: 160px; }
.lvl-tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .14em; color: rgba(255,255,255,.5); text-transform: uppercase; margin-bottom: 2px; }
.lvl-hd h3 { font-family: var(--ff-ser); font-size: 1.25rem; color: #fff; font-weight: 600; }
.lvl-hd p  { font-size: .76rem; color: rgba(255,255,255,.45); margin-top: 3px; }

.lvl-goal {
  background: rgba(0,0,0,.25);
  border-radius: 8px; padding: 10px 16px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 0 0 auto; max-width: 280px;
  border: 1px solid rgba(255,255,255,.07);
}
.lvl-goal strong { font-size: .64rem; letter-spacing: .12em; color: var(--gold-lt); text-transform: uppercase; }
.lvl-goal span   { font-size: .8rem; color: rgba(255,255,255,.8); line-height: 1.5; }

/* Level progress badge */
.lvl-prog {
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; padding: 4px 14px;
  font-size: .7rem; color: rgba(255,255,255,.5);
  flex-shrink: 0; margin-left: auto;
}
.lp-n { font-family: var(--ff-ser); font-size: .92rem; font-weight: 700; color: var(--gold-lt); }
.lp-sep { opacity: .4; }

/* Module cards */
.mods {
  background: rgba(0,0,0,.4);
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.mod {
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,.04);
  transition: box-shadow var(--tr), background var(--tr);
}
.mod:hover { box-shadow: 0 0 0 1px var(--border-g); background: rgba(255,255,255,.06); }
.mod.done .mod-head { background: rgba(61,122,53,.12); }
.mod.done .mod-row h4 { text-decoration: line-through; opacity: .5; }

.mod-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  background: transparent; transition: background var(--tr);
}
.mod-head:hover { background: rgba(255,255,255,.04); }
.mod-icon    { font-size: 1.2rem; flex-shrink: 0; }
.mod-titles  { flex: 1; min-width: 0; }
.mod-row     { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.mod-n       { font-size: .66rem; font-weight: 700; color: var(--text-lt); letter-spacing: .08em; flex-shrink: 0; }
.mod-row h4  { font-family: var(--ff-ser); font-size: .92rem; color: var(--gold-lt); font-weight: 600; }
.mod-titles p { font-size: .76rem; color: var(--text-md); line-height: 1.5; }

.tag-req { font-size: .6rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: rgba(201,169,110,.15); color: var(--gold); letter-spacing: .04em; flex-shrink: 0; }
.tag-opt { font-size: .6rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: rgba(74,143,168,.18); color: #6ec4d8; letter-spacing: .04em; flex-shrink: 0; }

.exbtn {
  flex-shrink: 0; background: none;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 10px; font-size: .74rem; color: var(--text-md);
  cursor: pointer; font-family: var(--ff-san);
  transition: background var(--tr), border-color var(--tr), color var(--tr);
  white-space: nowrap;
}
.exbtn:hover, .exbtn.open { background: var(--teal); border-color: var(--teal); color: #fff; }

.done-btn {
  flex-shrink: 0; width: 28px; height: 28px;
  border-radius: 50%; border: 2px solid var(--border);
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: var(--text-lt);
  transition: all var(--tr); margin-left: 4px;
}
.done-btn:hover { border-color: #4a9a3e; color: #4a9a3e; transform: scale(1.12); }
.mod.done .done-btn { background: #3d7a35; border-color: #3d7a35; color: #fff; }

.mod-body { max-height: 0; overflow: hidden; transition: max-height .38s cubic-bezier(.4,0,.2,1); background: rgba(0,0,0,.25); }
.mod-body.open { max-height: 800px; }

.item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 16px; font-size: .81rem;
  border-top: 1px solid var(--border); line-height: 1.55; color: var(--text-md);
}
.item::before {
  flex-shrink: 0; font-size: .64rem; font-weight: 700;
  letter-spacing: .04em; padding: 2px 7px; border-radius: 4px;
}
.item-r::before { content: '閱讀'; background: rgba(30,90,180,.35);  color: #7eb8f0; }
.item-p::before { content: '練習'; background: rgba(30,120,50,.35);  color: #7adb8a; }
.item-t::before { content: '任務'; background: rgba(180,90,0,.35);   color: #f0b06a; }
.item-o::before { content: '工具'; background: rgba(120,60,180,.35); color: #c89ef0; }
.item-k::before { content: '重點'; background: rgba(201,169,110,.2); color: var(--gold); }
.item-w::before { content: '待補'; background: rgba(180,30,30,.3);   color: #f08080; }

.doclink {
  flex-shrink: 0; font-size: .7rem; font-weight: 600;
  color: var(--teal-lt); border: 1px solid rgba(74,143,168,.3);
  border-radius: 4px; padding: 2px 8px;
  transition: background var(--tr), color var(--tr), border-color var(--tr); white-space: nowrap;
}
.doclink:hover { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ── Materials ───────────────────────────── */
.mat-progress {
  display: flex; align-items: center; gap: 24px;
  background: var(--card); border: 1px solid var(--border-g);
  border-radius: var(--radius); padding: 20px 28px; margin-bottom: 8px;
}
.mps { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.mps strong { font-family: var(--ff-ser); font-size: 2.2rem; color: #5cba52; line-height: 1; }
.mps.warn strong { color: #f0a050; }
.mps span { font-size: .68rem; color: var(--text-lt); white-space: nowrap; }
.mps-bar { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.mps-header { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-md); }
.mps-pct    { font-weight: 700; color: var(--gold); }
.mps-bar p  { font-size: .7rem; color: var(--text-lt); margin-top: 2px; }

.pb-track { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.pb-fill  { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold-dk), var(--gold)); width: 0%; transition: width 1s .2s cubic-bezier(.4,0,.2,1); }

.mat-section-label { margin: 40px 0 18px; }

.mat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 48px;
}
.mc {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  padding: 20px 16px 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: var(--text); overflow: hidden;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr), border-color var(--tr);
}
.mc:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); background: var(--card-hv); border-color: var(--border-g); }
.mc-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.mc-cat { font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.mc-icon { font-size: 1.9rem; line-height: 1; }
.mc h4   { font-family: var(--ff-ser); font-size: .88rem; color: var(--gold-lt); font-weight: 600; line-height: 1.3; }
.mc p    { font-size: .74rem; color: var(--text-md); line-height: 1.5; flex: 1; }
.mc-open { font-size: .7rem; font-weight: 700; color: var(--gold); opacity: 0; transform: translateY(4px); transition: opacity var(--tr), transform var(--tr); }
.mc:hover .mc-open { opacity: 1; transform: none; }
.mc-secret { color: #f08080 !important; }

.mat-missing { display: flex; flex-direction: column; gap: 7px; }
.mm {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px;
  transition: box-shadow var(--tr), transform var(--tr), background var(--tr);
}
.mm:hover { box-shadow: var(--shadow); transform: translateX(5px); background: var(--card-hv); }
.mm-pri { flex-shrink: 0; font-size: .75rem; min-width: 48px; font-weight: 600; }
.mm > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mm strong { font-size: .84rem; color: var(--text); font-weight: 600; }
.mm em     { font-size: .7rem; color: var(--text-lt); font-style: normal; }
.mm-meta   { flex-shrink: 0; font-size: .68rem; color: var(--text-lt); text-align: right; white-space: nowrap; }

/* ── Roadmap ─────────────────────────────── */
.rmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.rq {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--tr), transform var(--tr), background var(--tr);
}
.rq:hover { box-shadow: var(--shadow); transform: translateY(-3px); background: var(--card-hv); }

.rq-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 12px;
}
.rq1 { background: linear-gradient(135deg, rgba(180,30,30,.3), rgba(120,10,10,.2)); border-bottom: 1px solid rgba(220,80,80,.2); }
.rq2 { background: linear-gradient(135deg, rgba(180,140,0,.25), rgba(120,90,0,.2)); border-bottom: 1px solid rgba(220,180,0,.15); }
.rq3 { background: linear-gradient(135deg, rgba(30,120,50,.25), rgba(10,80,30,.2)); border-bottom: 1px solid rgba(80,200,80,.12); }

.rq-left { display: flex; align-items: center; gap: 12px; }
.rq-num {
  font-family: var(--ff-ser); font-size: 1.6rem; font-weight: 700;
  color: var(--gold-lt); line-height: 1;
}
.rq-left strong { display: block; font-size: .88rem; color: var(--text); }
.rq-left span   { font-size: .72rem; color: var(--text-md); }
.rq-dl { font-size: .7rem; color: var(--text-lt); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

.rq-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.ri { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--text-md); flex-wrap: wrap; }
.ri-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; }
.rd1 { background: #e05050; } .rd2 { background: #d4a820; } .rd3 { background: #50b850; }
.ri > span:nth-child(2) { flex: 1; min-width: 120px; color: var(--text); }
.ri-who { font-size: .7rem; background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 4px; color: var(--text-md); white-space: nowrap; }
.ri-fmt { font-size: .68rem; color: var(--text-lt); white-space: nowrap; }

/* ── Progress Widget ─────────────────────── */
#progWidget {
  position: fixed; bottom: 28px; right: 28px; z-index: 800;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
  transition: transform var(--tr);
}
#progWidget:hover { transform: scale(1.06); }
.pgw-ring {
  position: relative; width: 58px; height: 58px;
  background: var(--navy-dk); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-g);
}
.pgw-ring svg { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); }
#pgwArc { transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1); }
.pgw-ring span { font-size: .68rem; font-weight: 700; color: var(--gold); font-family: var(--ff-ser); position: relative; z-index: 1; }
.pgw-label { font-size: .6rem; font-weight: 600; color: var(--gold-lt); letter-spacing: .06em; background: rgba(15,30,38,.9); border: 1px solid var(--border-g); padding: 2px 8px; border-radius: 999px; }

/* ── Toast ───────────────────────────────── */
.toast {
  position: fixed; bottom: 104px; right: 28px;
  background: var(--navy-lt); color: var(--text);
  padding: 10px 18px; border-radius: 10px;
  font-size: .82rem; border-left: 3px solid var(--gold);
  box-shadow: var(--shadow-lg); z-index: 900; max-width: 260px;
  animation: toastIn .3s cubic-bezier(.2,.8,.2,1) forwards;
}
.toast.out { animation: toastOut .28s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(16px) scale(.95); } to { opacity:1; transform:none; } }
@keyframes toastOut { to   { opacity:0; transform:translateX(16px) scale(.95); } }

/* ── Footer ──────────────────────────────── */
footer {
  background: var(--bg0);
  border-top: 1px solid var(--border-g);
  color: var(--text-lt); padding: 40px 32px;
}
.ft { display: flex; align-items: flex-start; gap: 48px; flex-wrap: wrap; }
.ft-logo { font-family: var(--ff-ser); font-size: 1.2rem; color: var(--gold); letter-spacing: .1em; margin-bottom: 6px; }
.ft-brand p { font-size: .8rem; color: var(--text-lt); line-height: 1.8; }
.ft-note { font-size: .72rem !important; color: rgba(255,255,255,.2) !important; margin-top: 6px; }
.ft-nav { display: flex; flex-direction: column; gap: 8px; }
.ft-nav a { font-size: .82rem; color: var(--text-md); transition: color var(--tr); }
.ft-nav a:hover { color: var(--teal-lt); }
.ft-contact p { font-size: .8rem; color: var(--text-lt); line-height: 1.8; }

/* ── Missing tag ─────────────────────────── */
.tag-miss { font-size: .6rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: rgba(220,60,60,.18); color: #f08080; letter-spacing: .04em; flex-shrink: 0; }

/* ── Inner Page Header ───────────────────── */
.page-hdr {
  position: relative;
  min-height: 260px;
  background: var(--bg0);
  overflow: hidden;
  display: flex; align-items: flex-end;
}
.page-hdr #starsCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; pointer-events: none;
}
.page-hdr::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 100% 150% at 50% -30%, rgba(74,143,168,.45) 0%, transparent 58%),
    radial-gradient(ellipse 60%  80%  at 10% 120%, rgba(201,169,110,.06) 0%, transparent 55%);
}
.page-hdr-inner {
  position: relative; z-index: 1;
  max-width: 1140px; margin: 0 auto; padding: 0 32px 44px; width: 100%;
}
.page-hdr-inner .eyebrow { display: block; margin-bottom: 10px; }
.page-hdr h1 {
  font-family: var(--ff-ser);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #fff; font-weight: 700;
  margin: 0 0 8px; line-height: 1.2;
}
.page-hdr p { color: var(--text-md); font-size: .9rem; max-width: 520px; }

/* Back link on inner pages */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--text-md);
  margin-bottom: 16px;
  transition: color var(--tr);
}
.back-link:hover { color: var(--teal-lt); }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  section { padding: 64px 0; }
  .wrap { padding: 0 20px; }
  .hero-inner { padding: 100px 20px 60px; }
  .lvl-hd { padding: 16px 20px; gap: 12px; flex-wrap: wrap; }
  .lvl-goal { max-width: 100%; }
  .mods { padding: 10px; }
  .hero-stats { flex-direction: column; }
  .hs-sep { width: 80%; height: 1px; }
  .nav-wrap { padding: 0 20px; }
  .nav-drawer { padding: 12px 20px 20px; }
  .mat-progress { flex-direction: column; gap: 16px; }
  .mat-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .mm { flex-wrap: wrap; gap: 8px; }
  .mm-meta { width: 100%; text-align: left; }
  #progWidget { bottom: 16px; right: 16px; }
  .toast { right: 16px; bottom: 88px; max-width: calc(100vw - 32px); }
  .ft { gap: 24px; }
  .rmap { grid-template-columns: 1fr; }
}
