/* 基本樣式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}

body {
  background-color: #f5ecd5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* 頁首樣式 */
header {
  text-align: center;
  padding: 40px 0 20px;
  background-color: #5a8a6a;
  color: white;
}

header h1 {
  font-size: 36px;
  margin-bottom: 10px;
}

header h2 {
  font-size: 24px;
  font-weight: normal;
  margin-bottom: 20px;
}

/* 漢堡選單樣式 */
.hamburger-menu {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  cursor: pointer;
  width: 40px;
  height: 40px;
  background-color: rgba(58, 90, 74, 0.8);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  transform: rotate(0deg);
  transition: .5s ease-in-out;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #f5ecd5;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
  top: 0px;
}

.hamburger-icon span:nth-child(2) {
  top: 7px;
}

.hamburger-icon span:nth-child(3) {
  top: 14px;
}

.hamburger-icon.open span:nth-child(1) {
  top: 7px;
  transform: rotate(135deg);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.hamburger-icon.open span:nth-child(3) {
  top: 7px;
  transform: rotate(-135deg);
}

/* 導航樣式 */
nav {
  display: flex;
  justify-content: center;
  background-color: #5a8a6a;
  padding: 0 0 20px;
}

.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 800px;
}

.nav-button {
  background-color: #f5ecd5;
  border: 2px solid #3a5a4a;
  border-radius: 5px;
  color: #3a5a4a;
  padding: 8px 15px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-button:hover {
  background-color: #e5dcb5;
}

.nav-button.active {
  background-color: #3a5a4a;
  color: white;
}

.nav-button .number {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #f5a623;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* 主要內容樣式 */
main {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.section-title {
  color: #5a8a6a;
  text-align: center;
  font-size: 28px;
  margin: 30px 0;
  position: relative;
}

.section-title:after {
  content: "";
  display: block;
  width: 100px;
  height: 3px;
  background-color: #f5a623;
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.content-box {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-box p {
  margin-bottom: 15px;
  font-size: 16px;
}

.content-box h3 {
  color: #3a5a4a;
  margin: 20px 0 10px;
  font-size: 20px;
}

/* 圖片樣式 */
.image-container {
  text-align: center;
  margin: 20px 0;
}

.image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

.image-caption {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* 問答遊戲樣式 */
.quiz-container {
  background-color: #f0f8ff;
  padding: 20px;
  border-radius: 10px;
  margin-top: 30px;
}

.quiz-title {
  font-size: 22px;
  color: #3a5a4a;
  margin-bottom: 15px;
  text-align: center;
}

.quiz-description {
  margin-bottom: 20px;
  text-align: center;
}

.question-container {
  margin-bottom: 30px;
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 18px;
}

.options {
  list-style: none;
}

.option {
  padding: 10px;
  margin: 5px 0;
  background-color: #e9f0f8;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.option:hover {
  background-color: #d0e3f7;
}

.option.selected {
  background-color: #5a8a6a;
  color: white;
}

.option.correct {
  background-color: #5cb85c;
  color: white;
}

.option.incorrect {
  background-color: #d9534f;
  color: white;
}

.feedback {
  margin-top: 10px;
  padding: 10px;
  border-radius: 5px;
  display: none;
}

.feedback.correct {
  background-color: #dff0d8;
  color: #3c763d;
  display: block;
}

.feedback.incorrect {
  background-color: #f2dede;
  color: #a94442;
  display: block;
}

.explanation {
  margin-top: 10px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 5px;
  display: none;
}

.next-button, .submit-button, .restart-button {
  background-color: #5a8a6a;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 15px;
}

.next-button:hover, .submit-button:hover, .restart-button:hover {
  background-color: #3a5a4a;
}

.results {
  text-align: center;
  margin-top: 20px;
  padding: 20px;
  background-color: #f5f5f5;
  border-radius: 8px;
  display: none;
}

.score {
  font-size: 24px;
  font-weight: bold;
  color: #5a8a6a;
  margin-bottom: 10px;
}

.score-message {
  margin-bottom: 20px;
}

/* 頁尾樣式 */
footer {
  text-align: center;
  padding: 30px 0;
  background-color: #5a8a6a;
  color: white;
  margin-top: 40px;
}

footer p {
  font-size: 14px;
  margin-bottom: 5px;
}

footer a {
  color: white;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.disclaimer {
  max-width: 600px;
  margin: 10px auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* 響應式設計 */
@media (max-width: 768px) {
  header h1 {
    font-size: 28px;
  }
  
  header h2 {
    font-size: 18px;
  }
  
  .nav-button {
    font-size: 14px;
    padding: 6px 12px;
  }
  
  .section-title {
    font-size: 24px;
  }
  
  .content-box {
    padding: 20px;
  }
  
  .content-box h3 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 24px;
    padding-top: 10px;
  }
  
  /* 顯示漢堡選單 */
  .hamburger-menu {
    display: flex;
  }
  
  /* 導航在手機版隱藏，並設置為固定定位 */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background-color: #5a8a6a;
    z-index: 999;
    transition: right 0.3s ease;
    padding: 70px 20px 20px;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }
  
  nav.open {
    right: 0;
  }
  
  .nav-buttons {
    flex-direction: column;
    width: 100%;
    gap: 15px;
  }
  
  .nav-button {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    font-size: 16px;
  }
  
  .section-title {
    font-size: 20px;
  }
  
  .content-box {
    padding: 15px;
  }
  
  /* 添加背景遮罩 */
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }
  
  .overlay.active {
    display: block;
  }
}

/* 章節顯示控制 */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* 動畫效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}
