:root {
  --bg: #151515;
  --card: #202020;
  --text: #f2f2f2;
  --muted: #b8b8b8;
  --brand: #3d3d3d;
  --brand-2: #686868;
  --brand-soft: #2d2d2d;
  --border: #3a3a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #101010 0%, var(--bg) 42%, #1d1d1d 100%);
  line-height: 1.6;
}

.top {
  background: #242424;
  color: white;
  padding: 1.5rem;
}

.nav {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.menu a {
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.92;
}

.brand {
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.hero {
  max-width: 1024px;
  margin: 2.5rem auto;
}

.hero-tag {
  opacity: 0.95;
}

.hero h1 {
  margin: 0.4rem 0 0.8rem;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.hero-sub {
  max-width: 680px;
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  padding: 0.65rem 1rem;
  border-radius: 0.7rem;
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: white;
}

main {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--card);
  padding: 1.2rem;
  border-radius: 1rem;
  margin: 1.2rem 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.teacher-card {
  background: linear-gradient(135deg, #252525, #202020 55%, #191919);
  border: 1px solid var(--border);
}

.teacher-badge {
  display: inline-block;
  margin-bottom: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #343434;
  color: #f2f2f2;
  font-size: 0.9rem;
  font-weight: 700;
}

.teacher-layout {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.2rem;
  align-items: center;
}

.teacher-avatar {
  width: 110px;
  height: 110px;
  border-radius: 1.4rem;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.35);
}

.teacher-role {
  margin-top: -0.3rem;
  color: #d0d0d0;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

.module {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  background: #242424;
}

.module-btn {
  margin-top: 0.5rem;
  border: none;
  background: var(--brand-soft);
  color: var(--text);
  border-radius: 0.55rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.steps {
  display: grid;
  gap: 0.8rem;
}

.steps div {
  background: #242424;
  border-left: 5px solid var(--brand-2);
  padding: 0.8rem;
  border-radius: 0.6rem;
}

.steps span {
  font-size: 1.1rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

.faq-list {
  display: grid;
  gap: 0.8rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  overflow: hidden;
  background: #242424;
}

.faq-question {
  width: 100%;
  border: none;
  background: transparent;
  padding: 1rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.faq-answer {
  display: none;
  padding: 0 1rem 1rem;
  color: var(--text);
}

.faq-item.open .faq-answer {
  display: block;
}

.course-menu {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.course-option {
  border: 1px solid var(--border);
  background: #262626;
  color: var(--text);
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font-weight: 700;
}

.course-option.selected {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: white;
  border-color: transparent;
}

.register-form {
  display: grid;
  gap: 0.6rem;
  max-width: 480px;
}

input {
  width: 100%;
  padding: 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #262626;
  color: var(--text);
}

button[type="submit"] {
  margin-top: 0.3rem;
  padding: 0.65rem;
  border: none;
  border-radius: 0.5rem;
  color: white;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  font-weight: 700;
  cursor: pointer;
}

.message {
  min-height: 1.2rem;
  color: #d0d0d0;
  font-weight: 600;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

@media (max-width: 768px) {
  .menu {
    justify-content: flex-end;
  }

  .teacher-layout {
    grid-template-columns: 1fr;
  }

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

  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }
}
