@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&family=Noto+Sans+TC:wght@400;500;700;900&display=swap");

/* Ultima brand tokens — SOT: Ultima Visual Identity guide v2.0
   The same tokens also exist in the independent ending page.
   Update both sites when a token changes. */
:root {
  --green: #bdff08;
  --green-2: #b1d871;
  --olive: #3e4233;
  --black: #11140f;
  --black-2: #0d0f0b;
  --white: #f3f4f0;
  --ink-2: rgba(243, 244, 240, 0.64);
  --ink-3: rgba(243, 244, 240, 0.42);
  --line: rgba(243, 244, 240, 0.12);
  --line-strong: rgba(189, 255, 8, 0.3);
  --card: #181c14;
  --card-2: #1d2218;
  --danger: #ff806f;
  --warning: #ffd66b;
  --disp: "Space Grotesk", "Noto Sans TC", "PingFang TC", sans-serif;
  --mono: "Space Mono", "Noto Sans TC", monospace;
  --maxw: 1160px;
  --radius: 18px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(189, 255, 8, 0.08), transparent 62%),
    var(--black);
  color: var(--white);
  font-family: var(--disp);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(189, 255, 8, 0.64);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.wrap {
  width: min(100%, var(--maxw));
  margin: 0 auto;
  padding-inline: 24px;
}

.page-shell {
  min-height: calc(100vh - 67px);
  padding: 58px 0 96px;
}

.section {
  position: relative;
  padding: 88px 0;
}

.section-muted {
  background: #0e110c;
  border-block: 1px solid rgba(243, 244, 240, 0.06);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 22px;
  height: 1px;
  background: var(--green);
  content: "";
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.page-head h1,
.page-head h2 {
  margin-top: 14px;
  font-size: clamp(31px, 5vw, 50px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.page-head p {
  max-width: 560px;
  margin-top: 13px;
  color: var(--ink-2);
  font-size: 16px;
}

.section-head {
  max-width: 720px;
  margin-bottom: 46px;
}

.section-head h2 {
  margin: 18px 0 15px;
  font-size: clamp(30px, 4.6vw, 48px);
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.section-head h2 em,
.accent {
  color: var(--green);
  font-style: normal;
}

.section-head p {
  color: var(--ink-2);
  font-size: 17px;
}

.site-nav {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 20, 15, 0.84);
  backdrop-filter: blur(16px);
}

.mobile-dock {
  display: none;
}

.nav-wrap {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.brand img {
  /* 官方 lockup 係兩行（2.28:1）。品牌守則禁止改動或拆開，所以只可以
     加高個位遷就佢。Daniel 交到橫排版就改返細。 */
  width: auto;
  height: 44px;
}

.brand span {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.nav-panel {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  min-height: 44px;
  padding: 12px 11px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(189, 255, 8, 0.08);
  color: var(--white);
}

.nav-link.active {
  color: var(--green);
}

.nav-menu {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.nav-menu > span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 1px;
  margin: 4px auto;
  background: var(--white);
}

.language-switch {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
}

.language-switch button {
  min-width: 28px;
  min-height: 28px;
  cursor: pointer;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
}

.language-switch button.active {
  background: var(--green);
  color: var(--black);
}

.demo-chip,
.status-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-primary {
  background: var(--green);
  color: var(--black);
}

.btn-primary:hover {
  box-shadow: 0 14px 38px rgba(189, 255, 8, 0.27);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--white);
}

.btn-ghost:hover {
  border-color: rgba(189, 255, 8, 0.55);
  color: var(--green);
}

.btn-quiet {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
}

.btn-danger {
  border: 1px solid rgba(255, 128, 111, 0.4);
  background: rgba(255, 128, 111, 0.08);
  color: var(--danger);
}

.btn-sm {
  min-height: 44px;
  padding: 10px 17px;
  font-size: 13px;
}

.btn-wide {
  width: 100%;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 94px;
}

.hero::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(1000px 540px at 74% -6%, rgba(189, 255, 8, 0.17), transparent 60%),
    radial-gradient(720px 520px at 5% 108%, rgba(62, 66, 51, 0.52), transparent 64%);
  content: "";
  pointer-events: none;
}

.hero::after {
  position: absolute;
  z-index: 0;
  inset: -20% -10%;
  opacity: 0.5;
  background: repeating-linear-gradient(
    122deg,
    transparent 0 78px,
    rgba(189, 255, 8, 0.04) 78px 80px,
    transparent 80px 150px,
    rgba(177, 216, 113, 0.045) 150px 152px
  );
  content: "";
  mask-image: linear-gradient(105deg, transparent 28%, #000 62%, transparent 94%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(300px, 0.62fr);
  align-items: center;
  gap: 64px;
}

.hero h1 {
  max-width: 850px;
  margin: 20px 0 24px;
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.99;
}

.hero-copy {
  max-width: 650px;
  color: var(--ink-2);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.75;
}

.landing-hero {
  min-height: min(780px, calc(100vh - 66px));
  display: flex;
  align-items: center;
  background-image:
    linear-gradient(90deg, rgba(17, 20, 15, 0.96) 0%, rgba(17, 20, 15, 0.82) 42%, rgba(17, 20, 15, 0.35) 100%),
    linear-gradient(180deg, rgba(17, 20, 15, 0.55) 0%, transparent 34%, rgba(17, 20, 15, 0.78) 100%),
    url("/assets/kv/hero.jpg");
  background-position: center, center, center right;
  background-size: cover, cover, cover;
  background-repeat: no-repeat;
}

/* The plate carries the subject on its right; on narrow screens the copy would
   sit on top of it, so pull the crop across and darken further. */
@media (max-width: 719px) {
  .landing-hero {
    background-image:
      linear-gradient(180deg, rgba(17, 20, 15, 0.72) 0%, rgba(17, 20, 15, 0.9) 55%, rgba(17, 20, 15, 0.97) 100%),
      url("/assets/kv/hero.jpg");
    background-position: center, 72% center;
    background-size: cover, cover;
  }
}

.landing-hero-wrap {
  max-width: 940px;
  margin-inline: auto;
}

.landing-course-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  overflow: hidden;
  border: 1px solid rgba(189, 255, 8, 0.22);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.course-poster {
  position: relative;
  display: flex;
  min-height: 460px;
  padding: clamp(28px, 5vw, 46px);
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 19, 12, 0.28) 0%, rgba(15, 19, 12, 0.72) 58%, rgba(15, 19, 12, 0.94) 100%),
    radial-gradient(420px 320px at 12% 6%, rgba(189, 255, 8, 0.18), transparent 62%),
    url("/assets/kv/course-kv.jpg") center / cover no-repeat,
    #0f130c;
}

.course-poster::after {
  position: absolute;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(189, 255, 8, 0.2);
  border-radius: 50%;
  content: "";
  inset: 44px -96px auto auto;
}

.course-poster-kicker {
  position: absolute;
  top: 34px;
  left: 38px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.course-poster strong {
  position: relative;
  z-index: 1;
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(52px, 8vw, 92px);
  letter-spacing: -0.09em;
  line-height: 0.85;
}

.course-poster > span:not(.course-poster-kicker) {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
}

.course-poster-line {
  width: 72px;
  height: 4px;
  margin-top: 22px;
  background: var(--green);
}

.landing-course-copy {
  display: flex;
  padding: clamp(30px, 6vw, 68px);
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.landing-course-copy h2 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.035em;
  line-height: 1;
}

.landing-course-copy > p {
  max-width: 570px;
  color: var(--ink-2);
  font-size: 17px;
}

.course-facts {
  display: grid;
  width: 100%;
  max-width: 520px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 30px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.course-facts span {
  display: grid;
  min-height: 90px;
  padding: 15px 12px;
  place-content: center;
  background: var(--black);
  text-align: center;
}

.course-facts b {
  color: var(--green);
  font-size: 27px;
  line-height: 1;
}

.course-facts small {
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 10px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.trust-chips,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.trust-chips {
  margin-top: 30px;
}

.chip {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(24, 28, 20, 0.56);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
}

.chip .dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
}

.chip.lock {
  opacity: 0.42;
  filter: grayscale(1);
}

.route-card {
  position: relative;
  padding: 24px;
  border: 1px solid rgba(189, 255, 8, 0.22);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(29, 34, 24, 0.96), rgba(17, 20, 15, 0.95));
  box-shadow: var(--shadow);
}

.route-card::before {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(189, 255, 8, 0.16), transparent 70%);
  content: "";
  inset: -50px -50px auto auto;
  pointer-events: none;
}

.route-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 19px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.route-level {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.route-level:first-of-type {
  border-top: 0;
}

.route-no {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
}

.route-level b {
  display: block;
  font-size: 14px;
}

.route-level small {
  color: var(--ink-3);
  font-size: 11px;
}

.route-level > span:last-child {
  color: var(--green);
  font-size: 12px;
}

.level-grid,
.feature-grid,
.resource-grid,
.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.level-card,
.feature-card,
.resource-card,
.event-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.level-card,
.feature-card,
.resource-card,
.event-card {
  overflow: hidden;
  padding: 24px 22px;
  transition: transform 0.22s, border-color 0.22s, background 0.22s;
}

.level-card:hover,
.feature-card:hover,
.resource-card:hover,
.event-card:hover {
  transform: translateY(-4px);
  border-color: rgba(189, 255, 8, 0.42);
  background: var(--card-2);
}

.level-card .no,
.card-meta {
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.level-card h3,
.feature-card h3,
.resource-card h3,
.event-card h3 {
  margin: 12px 0 8px;
  font-size: 19px;
  line-height: 1.25;
}

.level-card p,
.feature-card p,
.resource-card p,
.event-card p {
  color: var(--ink-2);
  font-size: 14px;
}

.level-card .card-foot,
.resource-card .card-foot,
.event-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
}

.course-page {
  background:
    radial-gradient(800px 420px at 92% -4%, rgba(189, 255, 8, 0.08), transparent 64%),
    var(--black);
}

.course-heading {
  max-width: 850px;
  margin: 0 auto 38px;
  text-align: center;
}

.course-back {
  display: block;
  width: fit-content;
  min-height: 44px;
  margin: -15px auto 28px;
  padding: 10px 2px;
  color: var(--ink-3);
  font-size: 13px;
}

.course-back:hover {
  color: var(--green);
}

.course-heading .eyebrow {
  justify-content: center;
}

.course-heading h1 {
  margin: 18px 0 13px;
  font-size: clamp(42px, 7vw, 72px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.course-heading p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--ink-2);
  font-size: 17px;
}

.course-status-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
}

.course-status-item {
  display: grid;
  min-height: 126px;
  padding: 22px 28px;
  place-content: center;
  border-left: 1px solid var(--line);
  text-align: center;
}

.course-status-item:first-child {
  border-left: 0;
}

.course-status-item > span {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.course-status-item > b {
  margin-top: 9px;
  color: var(--green);
  font-size: 24px;
}

.course-status-action .btn {
  margin-top: 10px;
}

.course-content {
  max-width: 980px;
  margin: 0 auto;
}

.course-modules {
  display: grid;
  gap: 12px;
}

.course-module {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.course-module[open] {
  border-color: rgba(189, 255, 8, 0.28);
}

.course-module > summary {
  display: grid;
  min-height: 88px;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
}

.course-module > summary::-webkit-details-marker {
  display: none;
}

.course-module-thumb {
  position: relative;
  display: grid;
  width: 96px;
  height: 60px;
  flex: 0 0 auto;
  place-items: end start;
  overflow: hidden;
  padding: 7px;
  border: 1px solid rgba(189, 255, 8, 0.2);
  border-radius: 12px;
  background: #0f130c center / cover no-repeat;
}

.course-module-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(17, 20, 15, 0.1), rgba(17, 20, 15, 0.72));
}

.course-module.locked .course-module-thumb {
  filter: grayscale(0.85) brightness(0.6);
}

.course-module-no {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 30px;
  height: 22px;
  place-items: center;
  padding: 0 7px;
  border-radius: 7px;
  background: rgba(9, 11, 8, 0.72);
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
}

@media (max-width: 719px) { /* 要同 .course-module > summary 轉 68px 欄嘅斷點一致，否則 560–719px 縮圖蓋字 */
  .course-module-thumb {
    width: 68px;
    height: 46px;
  }
}

/* Page banner used by /resources/ and /events/ */
.page-banner {
  height: clamp(120px, 22vw, 210px);
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0f130c center / cover no-repeat;
}

.course-module-copy b,
.course-module-copy small {
  display: block;
}

.course-module-copy b {
  font-size: 16px;
}

.course-module-copy small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.course-module-state {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.course-module-state.open,
.course-module-state.done {
  border-color: rgba(189, 255, 8, 0.25);
  color: var(--green);
}

.quiz-row {
  display: grid;
  gap: 8px;
}

.quiz-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.quiz-option input {
  accent-color: var(--green);
  margin-top: 3px;
}

.course-steps {
  display: grid;
  gap: 1px;
  padding: 0 20px 20px 84px;
}

.course-step {
  display: grid;
  min-height: 66px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  transition: background 0.2s;
}

a.course-step:hover {
  background: rgba(189, 255, 8, 0.05);
}

.course-step.locked {
  opacity: 0.56;
}

.course-step-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: rgba(189, 255, 8, 0.08);
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
}

.course-step-copy b,
.course-step-copy small {
  display: block;
}

.course-step-copy b {
  font-size: 13px;
}

.course-step-copy small {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
}

.course-step-tag {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.course-enter {
  min-height: 48px;
  margin-top: 13px;
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(189, 255, 8, 0.1);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.course-empty {
  padding: 18px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}

.feature-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 12px;
  background: rgba(189, 255, 8, 0.11);
  color: var(--green);
  font-size: 20px;
}

.footer {
  padding: 42px 0;
  border-top: 1px solid var(--line);
  background: var(--black-2);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
}

.footer-row img {
  width: auto;
  height: 25px;
}

.not-found {
  display: grid;
  min-height: calc(100vh - 67px);
  padding: 60px 24px;
  place-items: center;
}

.not-found-card {
  width: min(100%, 640px);
  padding: clamp(28px, 7vw, 58px);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    radial-gradient(500px 250px at 100% 0%, rgba(189, 255, 8, 0.12), transparent 62%),
    var(--card);
  box-shadow: var(--shadow);
}

.not-found-code {
  margin: 28px 0 4px;
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(54px, 13vw, 110px);
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.not-found-card h1 {
  margin: 24px 0 8px;
  font-size: clamp(28px, 5vw, 42px);
}

.not-found-card p {
  color: var(--ink-2);
}

.auth-page {
  display: grid;
  min-height: calc(100vh - 67px);
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.72fr);
}

.auth-story {
  display: flex;
  min-height: 690px;
  align-items: center;
  padding: 70px max(38px, 7vw);
  background:
    radial-gradient(700px 480px at 20% 90%, rgba(62, 66, 51, 0.62), transparent 64%),
    radial-gradient(620px 360px at 100% 0%, rgba(189, 255, 8, 0.14), transparent 62%),
    var(--black);
}

.auth-story h1 {
  max-width: 670px;
  margin: 18px 0;
  font-size: clamp(40px, 6vw, 70px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.auth-story p {
  max-width: 580px;
  color: var(--ink-2);
  font-size: 17px;
}

.auth-points {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.auth-point {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
}

.auth-point b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--black);
  font-size: 12px;
}

.auth-panel {
  display: flex;
  align-items: center;
  padding: 60px max(28px, 6vw);
  border-left: 1px solid var(--line);
  background: #131710;
}

.auth-box {
  width: min(100%, 460px);
  margin: 0 auto;
}

.auth-box h2 {
  margin: 14px 0 8px;
  font-size: 34px;
}

.auth-box > p {
  color: var(--ink-2);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 30px 0 24px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--black);
}

.auth-tabs button {
  min-height: 42px;
  cursor: pointer;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 700;
}

.auth-tabs button.active {
  background: var(--green);
  color: var(--black);
}

.form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.input,
.textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--black);
  color: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea {
  min-height: 104px;
  resize: vertical;
}

.input:focus,
.textarea:focus {
  border-color: rgba(189, 255, 8, 0.6);
  box-shadow: 0 0 0 4px rgba(189, 255, 8, 0.08);
}

.form-note {
  color: var(--ink-3);
  font-size: 12px;
}

.form-error {
  min-height: 24px;
  color: var(--danger);
  font-size: 13px;
}

.cols {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 230px;
  grid-template-areas: "rail stage badges";
  align-items: start;
  gap: 26px;
}

.rail {
  grid-area: rail;
}

.stage {
  grid-area: stage;
}

.badges {
  grid-area: badges;
}

.rail,
.badges {
  position: sticky;
  top: 90px;
}

.panel {
  padding: 20px;
}

.panel-title {
  margin-bottom: 16px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail-list {
  display: grid;
}

.rk {
  position: relative;
  display: grid;
  min-height: 64px;
  grid-template-columns: 17px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.rk::before {
  position: absolute;
  top: -13px;
  bottom: -13px;
  left: 11px;
  width: 3px;
  background: var(--line);
  content: "";
}

.rk:first-child::before {
  top: 50%;
}

.rk:last-child::before {
  bottom: 50%;
}

.rk .dot {
  z-index: 1;
  width: 17px;
  height: 17px;
  border: 4px solid var(--line);
  border-radius: 50%;
  background: var(--black);
}

.rk .rail-copy {
  min-width: 0;
}

.rk b {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
}

.rk small {
  display: block;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk.hit::before {
  background: var(--green);
}

.rk.hit .dot {
  border-color: var(--green);
}

.rk.current {
  background: rgba(189, 255, 8, 0.08);
}

.rk.current b,
.rk.current small {
  color: var(--white);
}

.rk.locked {
  cursor: not-allowed;
  opacity: 0.46;
}

.stage-card {
  padding: clamp(22px, 4vw, 34px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(460px 230px at 100% 0%, rgba(189, 255, 8, 0.1), transparent 65%),
    #171b13;
}

.stage-card h2 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.025em;
}

.stage-role {
  color: var(--ink-2);
  font-size: 15px;
}

.progress-line {
  height: 7px;
  overflow: hidden;
  margin-top: 24px;
  border-radius: 999px;
  background: var(--line);
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.35s ease;
}

.progress-caption {
  margin-top: 8px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.ability-block {
  margin: 27px 0;
}

.ability-block .panel-title {
  margin-bottom: 12px;
}

.task-list {
  display: grid;
  gap: 12px;
}

.content-separator {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 36px 0 18px;
}

.content-separator h2 {
  margin-top: 9px;
  font-size: clamp(22px, 3vw, 30px);
}

.task {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
}

.task[open] {
  border-color: rgba(189, 255, 8, 0.26);
}

.task summary {
  display: grid;
  min-height: 72px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
}

.task summary::-webkit-details-marker {
  display: none;
}

.task-no {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: rgba(189, 255, 8, 0.1);
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
}

.task-title b {
  display: block;
  font-size: 15px;
}

.task-title small {
  color: var(--ink-3);
  font-size: 11px;
}

.task-status {
  justify-self: end;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.task-status.done {
  color: var(--green);
}

.task-status.pending {
  color: var(--warning);
}

.task-status.rejected {
  color: var(--danger);
}

.task-body {
  padding: 0 16px 18px 67px;
  color: var(--ink-2);
  font-size: 14px;
}

.task-body p {
  margin-bottom: 15px;
}

.review-note {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  color: var(--warning);
  font-size: 12px;
}

.task-body .review-note {
  margin: 14px 0 0;
  color: var(--warning);
  font-size: 12px;
}

.task-body .approved-note {
  color: var(--green);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.task-body .task-actions {
  margin-bottom: 14px; /* scope 住：後台 .claim-card 都用 .task-actions */
}

.submit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 12px;
}

.submit-row .input {
  min-width: 0;
}

.empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--ink-2);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 18px;
  background: rgba(189, 255, 8, 0.1);
  color: var(--green);
  font-size: 24px;
}

.badge-grid {
  display: grid;
  gap: 10px;
}

.badge {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(17, 20, 15, 0.5);
}

.badge-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(189, 255, 8, 0.13);
  color: var(--green);
  font-size: 17px;
}

.badge b {
  display: block;
  font-size: 12px;
}

.badge small {
  color: var(--ink-3);
  font-size: 10px;
}

.badge.locked {
  opacity: 0.38;
  filter: grayscale(1);
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 24px;
}

.video-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050704;
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 0;
  inset: 0;
}

.video-copy {
  padding: 24px;
}

.video-copy h1 {
  margin: 9px 0 8px;
  font-size: clamp(24px, 4vw, 36px);
}

.video-copy p {
  color: var(--ink-2);
}

.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.lesson-back {
  margin-bottom: 20px;
  color: var(--ink-2);
  font-size: 13px;
}

.lesson-back a:hover {
  color: var(--green);
}

.lesson-sidebar {
  position: sticky;
  top: 90px;
}

.lesson-task-note {
  display: grid;
  gap: 3px;
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 3px solid var(--green);
  border-radius: 0 12px 12px 0;
  background: rgba(189, 255, 8, 0.06);
}

.lesson-task-note span {
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
}

.lesson-task-note b {
  font-size: 13px;
}

.section-list {
  display: grid;
  gap: 8px;
}

.section-link {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-2);
}

.section-link.current {
  border-color: rgba(189, 255, 8, 0.38);
  background: rgba(189, 255, 8, 0.07);
  color: var(--white);
}

.section-link.done {
  color: var(--green);
}

.section-link .mini-no {
  font-family: var(--mono);
  font-size: 10px;
}

.section-link b {
  font-size: 12px;
}

.section-link span:last-child {
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 24px; /* 徽章 section 被 me/index.html 搬咗去冇 gap 嘅 .wrap，要自己留位 */
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
}

.stat {
  padding: 25px 18px;
  background: var(--card);
  text-align: center;
}

.stat b {
  display: block;
  color: var(--green);
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 9px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 20px;
}

.profile-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.profile-card h2 {
  margin-bottom: 17px;
  font-size: 20px;
}

.profile-stack {
  display: grid;
  align-content: start;
  gap: 20px;
}

.identity-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.identity-list > div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.identity-list dt {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.identity-list dd {
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-size: 12px;
}

.compact-form {
  gap: 12px;
}

.profile-badges {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid rgba(189, 255, 8, 0.3);
  border-radius: 16px;
  background: rgba(189, 255, 8, 0.08);
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.event-date {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--green);
}

.event-date b {
  font-size: 35px;
  line-height: 1;
}

.event-date span {
  font-family: var(--mono);
  font-size: 10px;
}

.claim-list {
  display: grid;
  gap: 9px;
}

.claim-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.claim-row:last-child {
  border-bottom: 0;
}

.claim-row b {
  font-size: 13px;
}

.claim-row p {
  overflow-wrap: anywhere;
  color: var(--ink-3);
  font-size: 12px;
}

.admin-grid {
  display: grid;
  min-width: 0;
  gap: 22px;
}

.admin-grid > * {
  min-width: 0;
}

.admin-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.admin-section-head h2 {
  margin-top: 8px;
  font-size: 25px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.claim-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}

.claim-card h3 {
  margin: 5px 0;
  font-size: 15px;
}

.claim-card p {
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-size: 13px;
}

.claim-card small {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.claim-card .claim-time {
  display: block;
  margin-top: 9px;
}

.claim-review {
  display: grid;
  gap: 11px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.claim-review .field span {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
}

.textarea-compact {
  min-height: 62px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar-field {
  display: block;
  flex: 1 1 220px;
  min-width: 0;
}

.toolbar-field-narrow {
  flex: 0 1 190px;
}

.admin-toolbar .input {
  min-height: 44px;
}

.admin-toolbar .btn {
  flex: 0 0 auto;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.audit-action {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.audit-action[data-action="approve"],
.audit-action[data-action="grant"] {
  border-color: rgba(189, 255, 8, 0.4);
  color: var(--green);
}

.audit-action[data-action="reject"] {
  border-color: rgba(255, 128, 111, 0.4);
  color: var(--danger);
}

.audit-body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.audit-body b {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.audit-body small,
.audit-time {
  overflow-wrap: anywhere;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.audit-time {
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--card);
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
}

.data-table th {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.data-table td {
  color: var(--ink-2);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: 30px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 13px 20px;
  transform: translate(-50%, 18px);
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42);
  color: var(--black);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.reveal {
  transform: translateY(20px);
  opacity: 0;
  transition:
    opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.in {
  transform: none;
  opacity: 1;
}

@media (max-width: 1039px) {
  .nav-links {
    gap: 1px;
  }

  .nav-link {
    padding-inline: 8px;
    font-size: 12px;
  }

  .hero-grid {
    gap: 32px;
  }

  .cols {
    grid-template-columns: 230px minmax(0, 1fr);
    grid-template-areas:
      "rail stage"
      "badges badges";
  }

  .badges,
  .rail {
    position: static; /* 2 欄時徽章喺下面成行，sticky rail 會滑落去疊住佢；≤719 block 會重新宣告 sticky */
  }

  .badge-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .badge {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .badge-icon {
    margin: 0 auto;
  }
}

@media (max-width: 860px) {
  .nav-menu {
    display: block;
  }

  .nav-panel {
    position: absolute;
    top: 66px;
    right: 0;
    left: 0;
    display: none;
    padding: 16px 24px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(17, 20, 15, 0.98);
  }

  .nav-panel.open {
    display: grid;
    gap: 14px;
  }

  .nav-links {
    display: grid;
  }

  .nav-actions {
    justify-content: space-between;
  }

  .nav-link {
    min-height: 44px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .landing-course-card {
    grid-template-columns: 1fr;
  }

  .course-poster {
    min-height: 340px;
  }

  .route-card {
    max-width: 570px;
  }

  .level-grid,
  .feature-grid,
  .resource-grid,
  .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: auto;
    padding-block: 70px;
  }

  .auth-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .video-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    position: static;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 719px) {
  .wrap {
    padding-inline: 18px;
  }

  .has-mobile-dock .page-shell {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .page-shell {
    padding-top: 38px;
  }

  .section {
    padding: 66px 0;
  }

  .brand span {
    display: none;
  }

  .brand img {
    height: 40px;
  }

  .hero {
    padding: 72px 0;
  }

  .landing-hero {
    min-height: auto;
    padding: 86px 0 90px;
  }

  .hero h1 {
    font-size: clamp(39px, 12vw, 58px);
  }

  .landing-course-copy {
    padding: 30px 22px 34px;
  }

  .course-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 25px 0;
  }

  .course-status-card {
    grid-template-columns: 1fr;
    margin-bottom: 44px;
  }

  .course-status-item {
    min-height: 102px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .course-status-item:first-child {
    border-top: 0;
  }

  .course-module > summary {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    padding: 15px 14px;
  }

  .course-module-state {
    grid-column: 2;
    justify-self: start;
  }

  .course-steps {
    padding: 0 14px 14px;
  }

  .course-step {
    grid-template-columns: 30px minmax(0, 1fr);
    padding-inline: 5px;
  }

  .course-step-tag {
    grid-column: 2;
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .level-grid,
  .feature-grid,
  .resource-grid,
  .event-grid {
    grid-template-columns: 1fr;
  }

  .cols {
    grid-template-columns: 1fr;
    grid-template-areas:
      "rail"
      "stage"
      "badges";
  }

  .rail {
    position: sticky;
    z-index: 8;
    top: 74px;
    overflow-x: auto;
    padding-bottom: 5px;
    background: rgba(17, 20, 15, 0.94);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
  }

  .rail::-webkit-scrollbar {
    display: none;
  }

  .rail.panel {
    padding: 12px;
  }

  .rail .panel-title {
    margin: 4px 4px 10px;
  }

  .rail-list {
    display: flex;
    width: max-content;
    min-width: 100%;
    gap: 7px;
    scroll-snap-type: x proximity;
  }

  .rk {
    min-width: 122px;
    min-height: 58px;
    grid-template-columns: 13px 1fr;
    padding: 8px 10px;
    border: 1px solid var(--line);
    scroll-snap-align: start;
  }

  .rk::before {
    display: none;
  }

  .rk .dot {
    width: 13px;
    height: 13px;
    border-width: 3px;
  }

  .badges {
    position: static;
  }

  .badge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .badge {
    grid-template-columns: 1fr;
    padding: 10px 6px;
    text-align: center;
  }

  .badge-icon {
    margin: 0 auto;
  }

  .task summary {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .task-status {
    grid-column: 2;
    justify-self: start;
  }

  .task-body {
    padding: 0 16px 18px;
  }

  .submit-row {
    grid-template-columns: 1fr;
  }

  .submit-row .btn,
  .video-actions .btn {
    width: 100%;
  }

  .claim-card {
    grid-template-columns: 1fr;
  }

  .claim-card .task-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .claim-card .task-actions .btn {
    width: 100%;
  }

  .table-wrap {
    scrollbar-color: var(--green) var(--card);
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    z-index: 1;
    left: 0;
    background: var(--card);
  }

  .input,
  .textarea {
    font-size: 16px;
  }

  .mobile-dock {
    position: fixed;
    z-index: 70;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border: 1px solid rgba(243, 244, 240, 0.15);
    border-radius: 20px;
    background: rgba(17, 20, 15, 0.94);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(18px);
  }

  .mobile-dock:has(.dock-link:nth-child(5)) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .dock-link {
    display: grid;
    min-width: 0;
    min-height: 54px;
    place-items: center;
    align-content: center;
    gap: 1px;
    border-radius: 14px;
    color: var(--ink-3);
    font-size: 10px;
    font-weight: 700;
  }

  .dock-link.active {
    background: rgba(189, 255, 8, 0.11);
    color: var(--green);
  }

  .dock-icon {
    font-family: var(--mono);
    font-size: 19px;
    line-height: 1;
  }

  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .profile-badges {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .nav-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .nav-actions .btn {
    flex: 1;
  }

  .cta-row .btn {
    width: 100%;
  }

  .task-actions .btn {
    width: 100%;
  }

  .stage-card {
    padding: 19px 14px;
  }

  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .badge b {
    font-size: 10px;
  }

  .auth-story,
  .auth-panel {
    padding-inline: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@media (max-width: 560px) {
  .admin-toolbar .btn {
    width: 100%;
  }

  .audit-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .audit-time {
    grid-column: 1 / -1;
    white-space: normal;
  }
}

/* Level key visual banner inside the learning-area stage card. Negative margins
   match .stage-card's padding so it bleeds to the card edge. */
.stage-kv {
  height: clamp(104px, 17vw, 168px);
  margin:
    calc(-1 * clamp(22px, 4vw, 34px))
    calc(-1 * clamp(22px, 4vw, 34px))
    clamp(18px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
  background: #0f130c center / cover no-repeat;
  box-shadow: inset 0 -70px 70px -40px rgba(23, 27, 19, 0.95);
}

/* Animated landing hero. The still stays the source of truth: the video sits
   underneath the same overlays and simply replaces the static plate where it
   is welcome. */
.hero-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  pointer-events: none;
}

.landing-hero .landing-hero-wrap {
  position: relative;
  z-index: 2;
}

/* The gradient scrim that keeps the headline readable has to sit above the
   video, not just above the background-image layer it was written for. */
.landing-hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(17, 20, 15, 0.96) 0%, rgba(17, 20, 15, 0.82) 42%, rgba(17, 20, 15, 0.32) 100%),
    linear-gradient(180deg, rgba(17, 20, 15, 0.5) 0%, transparent 34%, rgba(17, 20, 15, 0.76) 100%);
  pointer-events: none;
}

/* Mobile data and reduced-motion users get the still, which is already the
   poster — nothing to load, nothing to decode. */
@media (max-width: 719px) {
  .hero-video {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }
}

/* Key-visual band at the top of a card. The negative margins match the card
   padding (24px 22px) so the image bleeds to the rounded edge; the card itself
   carries overflow:hidden to clip it. */
.feature-kv,
.card-kv {
  height: clamp(112px, 15vw, 148px);
  margin: -24px -22px 20px;
  border-bottom: 1px solid var(--line);
  background: #0f130c center / cover no-repeat;
}

/* With a picture above it the glyph is a label, not the hero — shrink it so the
   card does not grow a second focal point. */
.feature-card .feature-icon,
.resource-card .resource-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 13px;
  border-radius: 10px;
  font-size: 15px;
}

.resource-card .resource-icon {
  font-size: 10px;
}
/* Assessment and profile controls share the existing member-page layout. */
.assessment { padding-block: 24px; border-top: 1px solid #454545; }
.assessment h2 { font-size: 22px; }
.assessment .quiz-option { min-height: 44px; }
.assessment > p { white-space: pre-line; }
.course-outcomes { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.course-outcomes h3 { font-size: 18px; }
/* Source annotation targets the chapter sidebar: 300px increased by 20%. */
@media (min-width: 1040px) { .lesson-wrap .video-layout { grid-template-columns: minmax(0, 1fr) 360px; } .lesson-wrap .lesson-sidebar { zoom: 1.2; top: 75px; } } /* 客戶 j-f「整個模塊加大20%」：闊度 300→360 之外，入面字同行高都要跟住放大；top 75×1.2＝原本 90px */
.video-layout { max-width: 1440px; }
.lesson-wrap { width: min(1440px, calc(100% - 48px)); }
.risk-disclaimer { width:min(100%, var(--maxw));margin-inline:auto;padding:32px 24px 110px;color:var(--ink-3);font-size:13px;line-height:1.8; } /* 110px 底位頂住手機 dock，唔好減；--muted 從未定義 */
.risk-disclaimer strong { display:block;margin:0 0 10px;color:var(--ink-2, var(--ink-3));font-size:13px;letter-spacing:.04em; }
.risk-disclaimer p { margin:0 0 8px;max-width:64em; } /* 13px 字拉到 1200px 闊會好難追行 */
.risk-disclaimer a { color:inherit;text-decoration:underline;text-underline-offset:3px; }
.video-frame { position:relative; }
.brand-screen { position:absolute;inset:0;background:#11170f;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;text-align:center;gap:16px; }
.brand-screen[hidden] { display:none; }
.brand-screen img { width:240px;max-width:48%;height:auto; }
.brand-screen p { max-width:520px;font-size:14px;line-height:1.7;margin:0; }
@media (prefers-reduced-motion: no-preference) {
  .brand-screen:not([hidden]) img { animation: brand-in .9s cubic-bezier(.2,.7,.2,1) both; }
  .brand-screen:not([hidden]) p, .brand-screen:not([hidden]) button { animation: brand-in .7s .35s cubic-bezier(.2,.7,.2,1) both; }
  .brand-screen::after { content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--green, #bdff09);transform-origin:left;animation: brand-line 1.2s .2s ease-out both; }
}
@keyframes brand-in { from { opacity:0;transform:translateY(10px) scale(.96); } to { opacity:1;transform:none; } }
@keyframes brand-line { from { transform:scaleX(0); } to { transform:scaleX(1); } }
@media(max-width:600px){.brand-screen{padding:8px;gap:6px}.brand-screen img{width:120px}.brand-screen p{font-size:11px}.brand-screen button{min-height:36px;padding:5px 14px}.lesson-wrap{width:calc(100% - 24px)}}
#registration-fields { display: grid; gap: 16px; }
#registration-fields[hidden] { display: none; }
#student-table .identity-list { min-width: 180px; max-width: 300px; }
#student-table .identity-list dd { overflow-wrap: anywhere; }
#student-table .form { min-width: 220px; }
.course-status-item b { white-space: normal; overflow-wrap: anywhere; }
/* September meeting: clear task text and compact learner operations. */
.assessment-body { white-space: pre-line; line-height: 1.9; }
.assessment-note { font-size: 13px; line-height: 1.7; color: #b8bcb1; margin: 8px 0 24px; }
.answer-blank { display: inline-block; width: 5em; border-bottom: 1px solid currentColor; margin: 0 .25em; vertical-align: baseline; }
.contact-verification { margin: 16px 0; padding: 16px 0; border-block: 1px solid #48513b; }
.contact-verification .btn { margin: 8px 8px 0 0; }
.reset-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.progress-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.progress-metrics b { display: block; white-space: nowrap; color: #c4ff00; font-size: 22px; }
.course-status-item > span, .progress-metrics small { color: var(--ink-3); font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.progress-metrics small { display: block; margin-top: 6px; }
.course-outcomes h3 { font-size: 20px; font-weight: 700; line-height: 1.5; margin: 0 0 20px; }
.course-outcomes ul { list-style: disc; padding: 0 0 0 1.3em; margin: 0; } /* 客戶 5e：列點形式 */
.course-outcomes li::marker { color: var(--green); font-size: 1.1em; }
.course-outcomes li { margin: 0 0 18px; line-height: 1.7; }
.course-outcomes li strong { display: block; color: var(--accent, #bdff09); font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.course-outcomes li > span:not(.outcome-detail) { display: block; color: var(--text); font-size: 16px; font-weight: 400; }
.course-outcomes li .outcome-detail { display: block; }
.course-outcomes li .outcome-detail > strong { display: inline; color: var(--green); font-size: inherit; font-weight: 700; margin: 0; } /* 客戶 5e：列點＋highlight 重點 */
/* 學員 grid（Excel 式）：thead 兩行 sticky，逐欄可排序／篩選；欄闊 px（COLUMNS.w，預設總和 1332 → 1400 wrap 一屏放晒），th 右邊界可拖拉（localStorage），table 闊＝欄闊總和（JS 設）→ 闊過個框就喺框內橫捲（Daniel 2026-09-21） */
.student-table-scroll { max-height: min(680px, calc(100vh - 96px)); overflow: auto; scrollbar-color: auto; } /* 高度留返 sticky nav 位 → 框底橫 bar 一定見到；scrollbar-color:auto 蓋過 ≤719px .table-wrap 設定，否則 Chrome 唔理下面 ::-webkit-scrollbar */
.student-table-scroll::-webkit-scrollbar { width: 12px; height: 12px; } /* 自訂樣式 → macOS「捲動時先顯示」都唔會收埋捲軸 */
.student-table-scroll::-webkit-scrollbar-track, .student-table-scroll::-webkit-scrollbar-corner { background: #20251c; }
.student-table-scroll::-webkit-scrollbar-thumb { background: var(--green-2); border: 3px solid #20251c; border-radius: 6px; }
.student-table-scroll::-webkit-scrollbar-thumb:hover { background: var(--green); }
.student-table-scroll table { table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.student-table-scroll thead { position: sticky; top: 0; z-index: 2; }
.student-table-scroll thead th, .student-table-scroll thead td, .student-table-scroll thead th:first-child, .student-table-scroll thead td:first-child { background: #20251c; }
.student-table-scroll th, .student-table-scroll td { min-width: 0; padding: 8px 10px; font-size: 13px; color: #cbd0c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.student-table-scroll th:last-child, .student-table-scroll td:last-child { border-right: 0; }
.student-table-scroll thead th { position: relative; font-family: var(--disp); font-size: 12px; font-weight: 700; letter-spacing: 0; color: var(--white); text-align: left; white-space: normal; vertical-align: bottom; line-height: 1.3; } /* relative 俾拖拉把手定位；sticky 喺 thead，唔受影響；手機首欄 sticky 規則 specificity 較高照贏 */
.col-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; user-select: none; }
.student-table-scroll thead:hover .col-resize { box-shadow: inset -1px 0 var(--line-strong); }
.col-resize:hover, .col-resize:active { box-shadow: inset -2px 0 var(--green); }
@media (pointer: coarse) { .col-resize { display: none; } } /* 手指：8px 太細又會同橫掃打交；手機照用手指橫捲 */
.student-table-scroll th button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.student-table-scroll th button::after { content: " ↕"; color: var(--ink-3); }
.student-table-scroll th[aria-sort="ascending"] button::after { content: " ▲"; color: var(--green); }
.student-table-scroll th[aria-sort="descending"] button::after { content: " ▼"; color: var(--green); }
.student-table-scroll .filter-row td { padding: 4px 6px; }
.student-table-scroll .input { min-height: 30px; padding: 4px 8px; border-radius: 6px; }
@media (min-width: 720px) { .student-table-scroll .input { font-size: 12px; } } /* ≤719px 保留 16px 防 iOS focus zoom */
.student-table-scroll tbody tr:hover td { background: linear-gradient(rgba(189, 255, 8, 0.05), rgba(189, 255, 8, 0.05)) var(--card); } /* 不透明：手機 sticky 首欄唔會透底 */
.student-table-scroll thead tr:last-child td { border-bottom: 1px solid var(--line); }
.grid-actions { display: grid; gap: 4px; }
.btn-xs { min-height: 28px; padding: 4px 8px; font-size: 12px; }
.student-editor-dialog { width: min(680px, calc(100% - 32px)); max-height: 85vh; overflow: auto; padding: 24px; background: #171c14; color: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.student-editor-dialog::backdrop { background: rgba(0,0,0,.7); }
.student-editor-dialog { margin: auto; }
.student-editor-dialog h2 { margin: 0 0 16px; font-size: 24px; overflow-wrap: anywhere; }
.student-editor-dialog .identity-list { margin-top: 20px; }
.student-editor-dialog .form { min-width: 0; }
.student-editor-dialog select { max-width: 100%; }
.course-facts small, .course-status-item > span, .progress-metrics small, .stat > span { font-size: 14px; color: #b9c0b1; letter-spacing: 0; }
.auth-page { display: block; min-height: 0; max-width: 560px; margin: 0 auto; padding: 32px 24px; }
.auth-story { min-height: 0; padding: 0 0 24px; background: none; }
.auth-story h1 { font-size: 30px; line-height: 1.3; letter-spacing: 0; margin: 12px 0; }
.auth-story p { font-size: 16px; margin-bottom: 0; }
.auth-points { display: none; }
.auth-panel { padding: 24px 0; border-left: 0; border-top: 1px solid var(--line); background: none; }
.auth-box { width: 100%; }
.auth-box h2 { font-size: 24px; }
.auth-box .field { min-width: 0; }
#registration-fields { display: contents; }
#form-error:empty { display: none; }
/* 註冊表單分三段：個人資料 → 帳戶 → 聯絡方式（單欄，唔分左右） */
.form-step { margin: 10px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--green); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.form > .form-step:first-child { margin-top: 0; padding-top: 0; border-top: 0; } /* 只係表單直屬第一個；#contact-step 住喺 display:contents 容器入面，唔准撞中 */
.terms-row { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.terms-row input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green); }
.terms-row a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 861px) { .profile-grid { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); align-items: start; } } /* 冇包 media query 時會贏咗 ≤860 單欄規則 */
#phone-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
#phone-form > button { grid-column: 1 / -1; }
.profile-card .field { min-width: 0; }
.auth-box .field label, .auth-box .form-note, .terms-row label { font-size: 14px; color: #cbd0c4; }
@media (max-width: 700px) {
  .profile-grid, #phone-form { grid-template-columns: minmax(0,1fr); }
  .auth-page { padding: 24px 20px; }
  .auth-story { padding: 0 0 16px; }
  .auth-story h1 { font-size: 26px; }
  .auth-panel { padding: 20px 0; }
}
@media(max-width: 860px) { .progress-metrics { gap: 10px; } .progress-metrics b { font-size: 18px; } } /* 迫嘅係 720–840px，唔係 ≤600 */

/* ── 2026-09-20 上線後 layout 審計 ───────────────────────────────────────── */
.page-head p { overflow-wrap: anywhere; }
.page-head > .btn { flex: none; }
#profile-badges .btn { grid-column: 1 / -1; }
.student-editor-dialog > * + * { margin-top: 12px; } /* 唔准用 flex／grid：會蓋走 dialog:not([open]){display:none} */
.assessment > * + * { margin-top: 14px; }
@media (max-width: 860px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ── 下一步引導（/path/）：首屏條＋任務卡發光。動畫只喺冇 reduced-motion 時行 —— 舊 reduce 規則擋唔住 infinite ── */
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 22px; padding: 14px 16px; border: 1px solid rgba(189, 255, 8, 0.38); border-radius: 16px; background: rgba(189, 255, 8, 0.06); color: inherit; text-decoration: none; }
.next-step:hover { background: rgba(189, 255, 8, 0.1); }
.next-copy { flex: 1 1 200px; min-width: 0; }
.next-copy small { display: block; color: var(--green); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; }
.next-copy b { display: block; margin-top: 3px; font-size: 16px; overflow-wrap: anywhere; }
.next-step .btn { flex: none; }
.next-dot, .task.is-next .task-no::before { border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(189, 255, 8, 0.85); }
.next-dot { position: relative; flex: none; width: 10px; height: 10px; }
.next-dot::after, .task.is-next .task-no::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); opacity: 0; }
.task { scroll-margin-top: 100px; }
.task.is-next { border-color: rgba(189, 255, 8, 0.55); box-shadow: 0 0 28px rgba(189, 255, 8, 0.12); }
.task.is-next .task-no { position: relative; overflow: visible; }
.task.is-next .task-no::before, .task.is-next .task-no::after { content: ""; position: absolute; top: -3px; right: -3px; left: auto; bottom: auto; width: 8px; height: 8px; }
.task-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.task-next p { flex: 1 1 200px; margin: 0; color: var(--white); }
.task-next .btn { flex: none; }
@keyframes next-ring { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.4); opacity: 0; } }
@keyframes next-glow { 0% { box-shadow: 0 0 0 0 rgba(189, 255, 8, 0.45); } 70%, 100% { box-shadow: 0 0 0 10px rgba(189, 255, 8, 0); } }
@media (prefers-reduced-motion: no-preference) {
  .next-dot::after, .task.is-next .task-no::after { animation: next-ring 1.8s ease-out infinite; }
  .next-step .btn-primary, .task-next .btn-primary { animation: next-glow 1.8s ease-out infinite; }
}

/* ── WhatsApp 國際區號（profile-ui.js）：/me/ 兩欄窄位時自動折行 ── */
.dial-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dial-row select { flex: 0 0 132px; }
.dial-row input { flex: 1 1 140px; min-width: 0; }

/* 後台段落標題列入面嘅下拉（學務留言狀態）：窄身靠右，唔好橫跨成頁 */
.admin-section-head .input { flex: 0 1 190px; width: auto; min-height: 44px; }
.admin-section .empty-state { padding: 32px 24px; }
/* 段落標題同內容之間嘅說明句（例：審批紀錄「只顯示最近 200 條」）：同下面個框要有間距 */
.admin-section-head + .form-note { margin: -6px 0 14px; }

/* ---- 後台「團隊與權限」＋學員表內嵌分派（2026-09-20） ---- */
/* .assign-select 唔另外定字級：沿用 .student-table-scroll .input（≥720px 12px；手機 16px 防 iOS focus zoom） */
.team-table { table-layout: fixed; min-width: 720px; }
.team-table th:nth-child(1) { width: 20%; } .team-table th:nth-child(2) { width: 30%; }
.team-table th:nth-child(3) { width: 14%; } .team-table th:nth-child(4) { width: 12%; } .team-table th:nth-child(5) { width: 24%; }
.team-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.team-table td:nth-child(3) { white-space: normal; } /* 角色＋「待啟用」兩粒 chip 可以摺行 */
.team-table td.team-actions { white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.team-role-admin, .team-role-owner { color: var(--green); }
.team-pending { color: var(--ink-2); border-style: dashed; }
.team-self { color: var(--ink-3); }
.team-add { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.1fr) auto auto; gap: 14px; align-items: end; margin-top: 20px; } /* 電郵／名稱／權限／寄出邀請／改用臨時密碼 */
.team-said:empty { display: none; }
@media (min-width: 761px) and (max-width: 1180px) { .team-add { grid-template-columns: repeat(3, minmax(0, 1fr)); } } /* 半屏：三格一行，兩個掣落第二行 */
.team-add .field { margin: 0; }
.team-add .btn { min-height: 48px; white-space: nowrap; }
.team-issued { margin-top: 16px; padding: 18px 20px; border: 1px solid var(--green); border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; }
.team-issued b, .team-issued p { grid-column: 1 / -1; margin: 0; }
.team-issued .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
@media (max-width: 760px) {
  .team-add, .team-issued { grid-template-columns: minmax(0, 1fr); }
  .team-add .btn { width: 100%; }
}
