body {
  box-sizing: border-box;
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  background-color: #fef7e8;
  color: #333;
  height: 100%;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
}

header {
  background-color: #fef7e8;
  padding: 10px 30px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 0 40px;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 36px;
}

.navbar-links {
  flex: 1.5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 50px;
  padding-left: 275px;
}

nav a {
  font-size: 20px;
  color: #887d00;
  font-weight: bold;
  padding: 6px 12px;
}

nav a:hover {
  color: #2a8491;
  text-decoration: underline;
  transition: 0.3s;
}

.buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.buttons a {
  padding: 6px 12px;
  border-radius: 6px;
  background-color: #f0c837;
  color: white;
  text-decoration: none;
  font-size: 14px;
}

.buttons a:hover {
  background-color: #b9953d;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: 0.3s;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 75px;
  width: auto;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  text-align: left;
}

.logo-title {
  font-size: 30px;
  font-weight: bold;
  display: inline-block;
  white-space: nowrap;
}

.logo-blue {
  color: #418693;
}

.logo-orange {
  color: #f37c3a;
}

.logo-subtitle {
  font-size: 20px;
  color: #21414C;
  margin-top: 2px;
  font-weight: bold;
}

.hero {
  position: relative;
  height: 750px;
  background-image: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.4);
  inset: 0;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  color: white;
  line-height: 1.6;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6);
}

.hero-content h1 {
  font-size: 56px;
  font-weight: bold;
  margin: 0;
  color: white;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-content::after {
  /* content: "|"; */
  animation: blink 1s infinite;
  margin-left: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.section-title {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 0px;
  font-size: 26px;
  font-weight: bold;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
}

.card {
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #418693, #2a8491);
  color: white;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  background-size: cover;
  background-position: center;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

.card-content {
  position: relative;
  z-index: 2;
}

.card-title {
  font-size: 24px;
  margin-bottom: 8px;
}

.card-description {
  font-size: 16px;
  opacity: 0.9;
  font-weight: normal;
}

.card:nth-child(1) {
  background-image: url('https://images.unsplash.com/photo-1461749280684-dccba630e2f6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(2) {
  background-image: url('https://images.unsplash.com/photo-1558655146-d09347e92766?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(3) {
  background-image: url('https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(4) {
  background-image: url('https://images.unsplash.com/photo-1544947950-fa07a98d237f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(5) {
  background-image: url('https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(6) {
  background-image: url('https://images.unsplash.com/photo-1502920917128-1aa500764cbd?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(7) {
  background-image: url('https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(8) {
  background-image: url('https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
}

.card:nth-child(9) {
  background-image: url('https://images.unsplash.com/photo-1434030216411-0b793f4b4173?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
}

.site-footer {
  background-color: #b4b4b4;
  color: #333;
  padding: 30px 20px 10px;
  font-size: 14px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo img {
  height: 70px;
  width: auto;
  object-fit: contain;
}

.footer-links a {
  display: block;
  color: #424242;
  text-decoration: none;
  margin: 4px 0;
}

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

.footer-contact p {
  margin: 4px 0;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  border-top: 1px solid #999;
  padding-top: 10px;
  font-size: 12px;
  color: #666;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-links .link-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 課程詳細頁面樣式 */
.course-detail {
  background-color: #fef7e8;
  min-height: 100%;
}

.course-header {
  background: linear-gradient(135deg, #418693, #2a8491);
  color: white;
  padding: 20px 0 40px 0;
}

.back-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  margin: 0 40px 20px 40px;
  transition: background 0.3s;
}

.back-btn:hover {
  background: rgba(255,255,255,0.3);
}

.course-hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  gap: 40px;
  align-items: center;
}

.course-info {
  flex: 1;
}

.course-info h1 {
  font-size: 36px;
  margin-bottom: 10px;
  font-weight: bold;
}

.course-info p {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.course-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.course-meta span {
  background: rgba(255,255,255,0.2);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.course-price {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.original-price {
  text-decoration: line-through;
  opacity: 0.7;
  font-size: 18px;
}

.current-price {
  font-size: 28px;
  font-weight: bold;
  color: #f0c837;
}

.discount {
  background: #f37c3a;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.enroll-btn {
  background: #f0c837;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.enroll-btn:hover {
  background: #d4b02a;
}

.course-image {
  flex: 0 0 400px;
}

.course-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.course-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
  display: flex;
  gap: 40px;
}

.course-main {
  flex: 2;
}

.course-sidebar {
  flex: 1;
}

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

.course-section h2 {
  color: #21414C;
  margin-bottom: 20px;
  font-size: 24px;
  border-bottom: 2px solid #418693;
  padding-bottom: 10px;
}

.course-section h3 {
  color: #418693;
  margin: 20px 0 10px 0;
}

.course-section ul {
  padding-left: 20px;
}

.course-section li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.curriculum .module {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #418693;
}

.instructor {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.instructor-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
}

.instructor-info h3 {
  margin: 0 0 5px 0;
  color: #21414C;
}

.instructor-title {
  color: #418693;
  font-weight: bold;
  margin-bottom: 10px !important;
}

.instructor-stats {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.instructor-stats span {
  background: #f0f8ff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  color: #418693;
}

.reviews .review {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  border-left: 4px solid #f0c837;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.reviewer-name {
  font-weight: bold;
  color: #21414C;
}

.sidebar-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar-card h3 {
  color: #21414C;
  margin-bottom: 20px;
  font-size: 20px;
  border-bottom: 2px solid #418693;
  padding-bottom: 10px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.detail-item .label {
  font-weight: bold;
  color: #666;
}

.detail-item .value {
  color: #333;
}

.course-includes {
  list-style: none;
  padding: 0;
}

.course-includes li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.related-course {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: background 0.3s;
}

.related-course:hover {
  background: #e9ecef;
}

.related-course img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.related-course h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: #21414C;
}

.related-course p {
  margin: 0;
  color: #418693;
  font-weight: bold;
}

/* ========== 任務列表區域 ========== */
.task-section {
  padding: 60px 20px;
  background-color: #fef7e8;
  min-height: 100vh;
}

.task-section .section-title {
  text-align: center;
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin-bottom: 40px;
}

/* 篩選按鈕 */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 30px;
  border: 2px solid #ddd;
  border-radius: 25px;
  background-color: #fff;
  color: #666;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: #2a8491;
  color: #2a8491;
}

.filter-btn.active {
  background-color: #2a8491;
  border-color: #2a8491;
  color: #fff;
}

/* 任務網格 */
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 任務卡片 */
.task-card {
  background-color: #fff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #2a8491, #ff9800);
}

.task-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* 卡片頭部 */
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.task-category {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.task-category.科技程式 {
  background-color: #2a8491;
}

.task-category.藝術文化 {
  background-color: #ff7043;
}

.task-category.生活技能 {
  background-color: #ffa726;
}

.task-publisher {
  font-size: 14px;
  color: #666;
}

/* 任務標題 */
.task-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.4;
  min-height: 50px;
}

/* 任務詳情 */
.task-details {
  margin-bottom: 20px;
}

.task-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 15px;
  color: #555;
}

.task-detail-item .icon {
  font-size: 18px;
}

/* 接受任務按鈕 */
.task-accept-btn {
  width: 100%;
  padding: 12px;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.task-accept-btn:hover {
  background-color: #555;
}

.task-accept-btn:active {
  transform: scale(0.98);
}

/* ========== 課程詳細頁面樣式 ========== */
.course-detail-new {
  padding: 40px 20px;
  background-color: #fef7e8;
  min-height: 100vh;
}

.back-to-list-btn {
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 30px;
  transition: background-color 0.3s ease;
  color: #333;
}

.back-to-list-btn:hover {
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.course-detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.course-detail-card {
  background-color: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.course-detail-title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.course-info-item {
  font-size: 16px;
  margin-bottom: 15px;
  line-height: 1.6;
  color: #333;
}

.course-info-item strong {
  font-weight: 600;
  color: #555;
  min-width: 80px;
  display: inline-block;
}

.course-section-block {
  margin-top: 35px;
  margin-bottom: 35px;
}

.course-section-block h2 {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.course-section-block p {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
  text-align: justify;
}

.course-section-block ul {
  list-style: none;
  padding-left: 0;
}

.course-section-block ul li {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
}

.course-section-block ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2a8491;
  font-weight: bold;
}

/* ========== 確認彈窗樣式 ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background-color: #fff;
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  z-index: 10000;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.modal-info {
  margin-bottom: 25px;
}

.modal-info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  font-size: 16px;
  line-height: 1.6;
}

.modal-info-item strong {
  font-weight: 600;
  color: #666;
  min-width: 100px;
  flex-shrink: 0;
}

.modal-info-item span {
  color: #333;
  flex: 1;
}

.modal-price {
  color: #2a8491;
  font-weight: bold;
  font-size: 18px;
}

.modal-contact {
  color: #2a8491;
  font-weight: bold;
}

.modal-notice {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 25px;
  text-align: center;
  border-left: 4px solid #2a8491;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: space-between;
}

.modal-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-cancel {
  background-color: #f0f0f0;
  color: #666;
}

.modal-btn-cancel:hover {
  background-color: #e0e0e0;
}

.modal-btn-confirm {
  background-color: #2a8491;
  color: #fff;
}

.modal-btn-confirm:hover {
  background-color: #1f6a75;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 132, 145, 0.3);
}

.modal-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .navbar-links {
    padding-left: 0;
    gap: 20px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .hero-content {
    font-size: 18px;
    padding: 0 20px;
  }

  .hero-content h1 {
    font-size: 24px;
  }

  .course-hero-content {
    flex-direction: column;
    text-align: center;
  }

  .course-image {
    flex: none;
    max-width: 100%;
  }

  .course-content {
    flex-direction: column;
    padding: 20px;
  }

  .course-info h1 {
    font-size: 28px;
  }

  .instructor {
    flex-direction: column;
    text-align: center;
  }

  .instructor-stats {
    justify-content: center;
  }

  .task-grid {
    grid-template-columns: 1fr;
  }

  .filter-buttons {
    flex-direction: column;
    align-items: center;
  }

  .filter-btn {
    width: 100%;
    max-width: 300px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-links {
    align-items: center;
  }

  .footer-contact {
    margin-top: 10px;
  }

  .course-detail-card {
    padding: 25px;
  }

  .modal-content {
    padding: 30px 25px;
    width: 95%;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-info-item {
    flex-direction: column;
    gap: 5px;
  }

  .modal-info-item strong {
    min-width: auto;
  }

  .modal-buttons {
    flex-direction: column;
  }
}
