/* --- 全域設定與色彩變數 --- */
:root {
  --bg-dark: #121212;
  --surface-dark: #1e1e1e;
  --primary-color: #00bcd4; /* A techy teal color */
  --primary-hover: #0097a7;
  --text-light: #e0e0e0;
  --text-muted: #888;
  --border-color: #333;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans TC", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  line-height: 1.7;
}

/* --- 排版與容器 --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
}

h1,
h2,
h3,
h4 {
  font-family: "Poppins", "Noto Sans TC", sans-serif;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
}

h1 {
  font-size: 2.8rem;
}
h2 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  display: inline-block;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-top: 30px;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

/* --- 導覽列 --- */
.navbar {
  background-color: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.navbar-brand span {
  color: var(--primary-color);
}
.nav-link {
  color: var(--text-light);
  text-decoration: none;
  margin-left: 20px;
  font-weight: 600;
  transition: color 0.3s;
}
.nav-link:hover {
  color: var(--primary-color);
}

/* --- 頁首 (Hero Section) --- */
.hero {
  background: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 1)),
    url("https://images.unsplash.com/photo-1550439062-609e1531270e?q=80&w=2070&auto=format&fit=crop")
      no-repeat center center/cover;
  text-align: center;
  padding: 100px 20px;
}
.hero-title {
  margin-bottom: 15px;
}
.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px auto;
  color: var(--text-muted);
}
.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--bg-dark);
  padding: 15px 35px;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: background-color 0.3s, transform 0.2s;
  text-transform: uppercase;
}
.btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
}

/* --- 課程特色 --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}
.feature-card {
  background-color: var(--surface-dark);
  padding: 30px;
  border-radius: 10px;
  border-left: 5px solid var(--primary-color);
  transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.feature-card h3 {
  color: var(--primary-color);
  margin-top: 0;
}

/* --- 課程大綱 (Accordion & Link) --- */
.details-link {
  text-align: center;
  margin-top: 20px;
}
.details-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}
.accordion-item {
  background-color: var(--surface-dark);
  margin-bottom: 10px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.accordion-header {
  background-color: var(--surface-dark);
  padding: 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.2rem;
  transition: background-color 0.3s;
}
.accordion-header:hover {
  background-color: #2a2a2a;
}
.accordion-header::after {
  content: "+";
  font-size: 1.8rem;
  color: var(--primary-color);
  transition: transform 0.3s;
}
.accordion-header.active::after {
  transform: rotate(45deg);
}
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
  padding: 0 20px;
}
.accordion-content ul {
  list-style-position: inside;
  padding: 20px 0;
}
.accordion-content li {
  margin-bottom: 10px;
  color: var(--text-muted);
}
.accordion-content li strong {
  color: var(--text-light);
}

/* --- 講師介紹 --- */
.instructors-grid {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}
.instructor-card {
  background-color: var(--surface-dark);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  width: 300px;
}
.instructor-card .avatar {
  font-size: 3rem;
  margin-bottom: 15px;
}
.instructor-card h3 {
  color: var(--primary-color);
}
.instructor-card .role {
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 10px;
}

/* --- 學員真實心聲 --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.testimonial-card {
  background-color: var(--surface-dark);
  padding: 25px;
  border-radius: 10px;
  border-top: 5px solid var(--primary-color);
  font-style: italic;
}
.testimonial-card .quote {
  font-size: 1.1rem;
  margin-bottom: 15px;
}
.testimonial-card .author {
  text-align: right;
  font-weight: 700;
  color: var(--primary-color);
  font-style: normal;
}

/* --- 報名區塊 --- */
#enroll {
  background-color: var(--surface-dark);
  text-align: center;
  border-radius: 10px;
  padding: 40px;
}
#enroll p {
  margin-bottom: 30px;
  font-size: 1.1rem;
}
#enroll .price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}
#enroll .note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- 課程內容頁專用樣式 --- */
.page-header {
  padding: 60px 20px;
  background-color: var(--surface-dark);
  text-align: center;
}
.chapter-details {
  background-color: var(--surface-dark);
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 40px;
  border-left: 5px solid var(--primary-color);
}
.chapter-details ul {
  list-style-type: "✓ ";
  list-style-position: outside;
  padding-left: 25px;
}
.chapter-details li {
  margin-bottom: 12px;
}
.chapter-details code {
  background-color: var(--bg-dark);
  color: var(--primary-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
}
.chapter-details blockquote {
  margin-left: 20px;
  padding-left: 15px;
  border-left: 3px solid var(--text-muted);
  font-style: italic;
  color: var(--text-muted);
}

/* --- 頁尾 --- */
footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 50px;
}

/* --- 響應式設計 --- */
@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }
  h2 {
    font-size: 1.8rem;
  }
  .hero {
    padding: 60px 20px;
  }
  .navbar .container {
    flex-direction: column;
    gap: 10px;
  }
}

/* --- 在檔案底部或合適位置添加以下樣式 --- */

/* --- 文件式佈局 (Doc Layout) --- */
.doc-layout {
  display: grid;
  grid-template-columns: 260px 1fr; /* 左側 260px，右側佔滿剩餘空間 */
  grid-template-areas: "sidebar main";
  gap: 20px;
  max-width: 1400px; /* 擴大容器寬度以容納側邊欄 */
  margin: 40px auto;
  padding: 0 20px;
}

/* 左側邊欄 (Sidebar) */
.doc-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 100px; /* 距離頂部 100px (留出導覽列空間) */
  height: calc(100vh - 120px); /* 讓側邊欄可以滾動 */
  overflow-y: auto;
  padding-right: 20px;
}

.sidebar-nav-list {
  list-style: none;
  padding: 0;
}

.sidebar-nav-list li a {
  display: block;
  padding: 12px 15px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav-list li a:hover {
  background-color: var(--surface-dark);
  color: var(--text-light);
}

.sidebar-nav-list li a.active {
  background-color: var(--surface-dark);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

/* 右側主內容區 (Main Content) */
.doc-main {
  grid-area: main;
  min-width: 0; /* 防止內容過寬時擠壓佈局 */
}

/* 修改 chapter-details 的邊距，使其在文件佈局中更協調 */
.chapter-details {
  margin-bottom: 80px; /* 增加章節間距，方便滾動定位 */
  padding-top: 20px; /* 為錨點定位留出空間 */
}

/* --- 響應式設計調整 for Doc Layout --- */
@media (max-width: 992px) {
  .doc-layout {
    grid-template-columns: 1fr; /* 在平板和手機上變為單欄 */
    grid-template-areas:
      "sidebar"
      "main";
    gap: 0;
  }

  .doc-sidebar {
    position: static; /* 取消黏貼定位 */
    height: auto;
    overflow-y: visible;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
  }

  .sidebar-nav-list {
    display: flex; /* 在小螢幕上橫向排列選單 */
    flex-wrap: wrap;
    gap: 10px;
  }

  .sidebar-nav-list li a {
    border: 1px solid var(--border-color);
  }
}
