:root {
  --primary-color: #4f84b9;
  --secondary-color: #e0f2f7;
  --text-color: #333;
  --light-grey: #f8f8f8;
  --border-color: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.06);
  --transition-speed: 0.25s;
}

body {
  font-family: 'Montserrat', 'Noto Sans TC', sans-serif;
  background-color: var(--light-grey);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.4;
  font-size: 14px;

  /* === 新增以下兩行來改善字體清晰度 === */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 600px;
  margin: 15px auto;
  padding: 12px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px var(--shadow-color);
}

/* Headings */
h1 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 25px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111;
  margin: 20px 0 12px;
}
h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #444;
}

/* Modules */
.module {
  background-color: #fff;
  border-radius: 5px;
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
  transition: box-shadow var(--transition-speed) ease;
}
.module:hover {
  box-shadow: 0 3px 10px var(--shadow-color);
}

.module h2 {
  cursor: pointer;
  background-color: var(--secondary-color);
  padding: 8px 12px;
  border-left: 3px solid var(--primary-color);
  font-size: 0.95rem;
  margin: 0;
  font-weight: 500;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color var(--transition-speed) ease;
}
.module h2:hover {
  background-color: #d2ecf4;
}
.module h2::after {
  content: '▼';
  font-size: 0.65rem;
  transition: transform var(--transition-speed) ease;
}
.module.active h2::after {
  content: '▲';
  transform: rotate(0deg);
}

.lesson-list {
  padding: 0px 12px 10px;
  background-color: #fff;
  display: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out, padding 0.35s ease-out;
}
.module.active .lesson-list {
  display: block;
  max-height: 300px;
  padding: 10px 12px;
}
.lesson-list a {
  display: block;
  text-decoration: none;
  color: var(--primary-color);
  margin: 3px 0; /* 間隔 5->3 變小一點 */
  font-size: 0.95rem;
  padding: 3px 0;
  transition: color var(--transition-speed) ease;
}
.lesson-list a:hover {
  color: #4a7aa3;
  text-decoration: underline;
}

/* Course subtitle */
.course-intro {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-color);
  margin: -15px auto 15px auto;
  max-width: 500px;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 500px) {
  .container {
    margin: 10px auto;
    padding: 8px;
  }
  h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  .module h2 {
    font-size: 0.9rem;
    padding: 8px 10px;
  }
  .lesson-list {
    padding: 6px 10px;
  }
  .lesson-list a {
    font-size: 0.8rem;
  }
}
