:root {
  --paper: #f7f3e8;
  --paper-strong: #fffdf7;
  --ink: #182534;
  --muted: #607080;
  --line: #d8cfbd;
  --navy: #102a43;
  --navy-deep: #081a2c;
  --blue: #2a75bb;
  --yellow: #ffcb05;
  --shadow: 0 16px 38px rgba(8, 26, 44, .1);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(16, 42, 67, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 36px;
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.72;
  letter-spacing: -.006em;
}

a,
button { -webkit-tap-highlight-color: transparent; }

:where(a, button):focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.teacher-site-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  padding: clamp(68px, 9vw, 112px) max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 4px solid var(--yellow);
  background:
    radial-gradient(circle at 89% 30%, rgba(255, 203, 5, .14) 0 7%, transparent 7.3%),
    linear-gradient(120deg, rgba(42, 117, 187, .18), transparent 48%),
    var(--navy-deep);
  color: #fff;
}

.teacher-site-head::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -92px;
  bottom: -160px;
  width: 360px;
  height: 360px;
  border: 2px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.teacher-site-head p {
  max-width: 720px;
  margin: 0;
  color: #c8d5df;
  font-weight: 700;
}

.teacher-site-head div > p:first-child {
  color: var(--yellow);
  font-size: .78rem;
  letter-spacing: .12em;
}

.teacher-site-head h1 {
  margin: 10px 0 12px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.teacher-site-head nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.teacher-site-head a,
.teacher-site-head button {
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.teacher-site-head a:first-child {
  border-color: #e0ad00;
  background: var(--yellow);
  color: var(--navy-deep);
}

.teacher-site-head a:hover,
.teacher-site-head button:hover {
  border-color: var(--yellow);
  background: rgba(255, 203, 5, .12);
  transform: translateY(-1px);
}

.teacher-site-head a:first-child:hover { background: #ffd43b; }

main {
  width: min(1120px, calc(100% - 48px));
  margin: clamp(64px, 8vw, 104px) auto;
}

.teacher-lesson {
  --lesson-accent: var(--blue);
  min-width: 0;
  margin: 0 0 clamp(74px, 10vw, 116px);
}

#lesson-02 { --lesson-accent: #f4c43c; }
#lesson-03 { --lesson-accent: #cf674b; }
#lesson-04 { --lesson-accent: #668baa; }
#lesson-05 { --lesson-accent: #4f8f71; }
#lesson-06 { --lesson-accent: #7356a2; }

.teacher-lesson > header {
  position: sticky;
  z-index: 2;
  top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 28px;
  padding: 26px 30px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-top: 5px solid var(--lesson-accent);
  border-radius: 16px;
  background: rgba(16, 42, 67, .97);
  color: #fff;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.teacher-lesson > header p {
  grid-column: 1 / -1;
  margin: 0;
  color: #c8d5df;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.teacher-lesson > header h2 {
  min-width: 0;
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.teacher-lesson > header strong {
  grid-column: 1 / 2;
  color: #d7e2ec;
  overflow-wrap: anywhere;
}

.teacher-lesson > header a {
  grid-row: 2 / 4;
  grid-column: 2;
  align-self: center;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid #e0ad00;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--navy-deep);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, transform .2s ease;
}

.teacher-lesson > header a:hover {
  background: #ffd43b;
  transform: translateY(-1px);
}

.teacher-chapter {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 28px;
  margin-top: 16px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  box-shadow: 0 5px 16px rgba(8, 26, 44, .045);
}

.chapter-time {
  align-self: start;
  padding: 15px 14px;
  border-left: 5px solid var(--lesson-accent);
  border-radius: 8px;
  background: #edf2f5;
}

.chapter-time strong {
  display: block;
  color: var(--navy);
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -.035em;
}

.chapter-time span { color: var(--muted); font-weight: 800; }

.teacher-chapter h3 {
  margin: 3px 0 10px;
  color: var(--navy);
  font-size: clamp(1.35rem, 2.6vw, 1.78rem);
  line-height: 1.28;
  letter-spacing: -.018em;
}

.teacher-chapter h4 {
  margin: 22px 0 4px;
  color: var(--navy);
  font-size: .82rem;
  letter-spacing: .06em;
}

.teacher-chapter p,
.teacher-chapter ul { margin: 5px 0; }
.teacher-chapter ul { padding-left: 1.35em; }

.phase {
  color: var(--blue);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .1em;
}

footer {
  padding: 30px 24px;
  border-top: 4px solid var(--yellow);
  background: var(--navy-deep);
  color: #c8d5df;
  text-align: center;
}

@media (max-width: 760px) {
  .teacher-site-head {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 64px 24px;
  }

  .teacher-site-head nav { justify-content: flex-start; }
  main { width: min(100% - 32px, 1120px); margin-block: 56px; }

  .teacher-lesson > header {
    position: static;
    grid-template-columns: 1fr;
    padding: 22px;
    border-radius: 14px;
  }

  .teacher-lesson > header a {
    grid-area: auto;
    justify-self: start;
    white-space: normal;
  }

  .teacher-chapter {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 21px;
    border-radius: 12px;
  }

  .chapter-time {
    width: fit-content;
    display: flex;
    gap: 12px;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  .teacher-site-head nav { display: none; }
  .teacher-site-head { padding: 24px; border: 0; background: #fff; color: #000; }
  .teacher-site-head::after { display: none; }
  .teacher-site-head h1 { font-size: 3rem; }
  .teacher-site-head p,
  .teacher-site-head div > p:first-child { color: #333; }
  main { width: 100%; margin: 0; }
  .teacher-lesson { margin-bottom: 20px; }
  .teacher-lesson > header {
    position: static;
    break-after: avoid;
    border: 1px solid #999;
    background: #fff;
    color: #000;
    box-shadow: none;
  }
  .teacher-lesson > header p,
  .teacher-lesson > header strong { color: #333; }
  .teacher-lesson > header a { border: 1px solid #999; background: #fff; color: #000; }
  .teacher-chapter { break-inside: avoid; box-shadow: none; }
}
