/* Reset & Variables */
:root {
  --primary-color: #059669; /* 活力薄荷綠 Mint Green */
  --primary-hover: #047857;
  --secondary-color: #f59e0b; /* Orange/Yellow highlight */
  --secondary-hover: #d97706;
  --accent-color: #3b82f6; /* 增加亮藍色作為對比點綴 */
  --dark-color: #1f2937;
  --light-bg: #f8f9fa; /* 改為質感淺灰色背景 */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --tag-green: #10b981;
  --tag-blue: #3b82f6;
  --tag-red: #ef4444;

  --section-spacing: 70px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, "文泉驛正黑", "WenQuanYi Zen Hei", "儷黑 Pro", "LiHei Pro", "微軟正黑體", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-md-6 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-md-4 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-md-8 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-lg-8 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-lg-4 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }

@media (min-width: 768px) {
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

@media (min-width: 992px) {
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-column { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.section-padding { padding: var(--section-spacing) 0; }
.bg-light { background-color: var(--light-bg); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  font-family: inherit;
}

.btn-primary {
  background-color: #24b540;
  color: var(--white);
}

.btn-primary:hover {
  background-color: #1e9a36; /* 稍微深一點的綠色作為懸停效果 */
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: box-shadow var(--transition-normal);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: bold;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-color);
  margin: 0;
  letter-spacing: 0.5px;
}

.site-subtitle {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav a {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-800);
  transition: color var(--transition-fast);
  position: relative;
}

.main-nav a:not(.btn):hover {
  color: var(--primary-color);
}

.main-nav a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-fast);
}

.main-nav a:not(.btn):hover::after {
  width: 100%;
}

.main-nav .nav-highlight {
  margin-left: 10px;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  transform: translateY(10px);
  background-color: var(--white);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  border-radius: 0 0 8px 8px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 1100;
  border-top: 3px solid var(--primary-color);
  /* 桌機顯示控制 */
  text-align: left;
}

.dropdown:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sub-menu li {
  display: block; /* 強制 li 為塊狀元素 */
  margin: 0;
  padding: 0;
}

.sub-menu a {
  display: block; /* 強制 a 為塊狀元素 */
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sub-menu a::after {
  display: none !important; /* 移除子選單連結的底線裝飾 */
}

.sub-menu a:hover {
  background-color: var(--light-bg);
  color: var(--primary-color) !important;
}

@media (max-width: 991px) {
  .sub-menu {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 20px;
    display: none; /* 手機摺疊控制 */
    background: transparent;
    transition: none;
  }

  .dropdown.active .sub-menu {
    display: block; /* JS 連動展開 */
  }

  .dropdown > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .main-nav a::after {
    display: none; /* 手機版不顯示底線 */
  }
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark-color);
  cursor: pointer;
}

@media (max-width: 991px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    padding: 20px;
  }
  
  .main-nav.active {
    display: block;
  }
  
  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .main-nav .nav-highlight {
    margin-left: 0;
    width: 100%;
  }
  
  .main-nav .btn {
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }
}

/* Hero */
.hero-section {
  position: relative;
    height: auto;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

/* 移除 Overlay */

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 20px;f
}

/* 移除文字陰影樣式 */

/* 移除倒數計時樣式 */

/* Quick Actions */
.quick-actions {
  margin-top: -100px;
  position: relative;
  z-index: 10;
  padding: 0 20px;
  background-color: transparent;
}

.action-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.action-card {
  flex: 1;
  min-width: 220px;
  max-width: 280px;
  background: var(--white);
  border-radius: 12px;
  padding: 25px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border-top: 4px solid var(--primary-color);
  position: relative;
  overflow: hidden;
}

.action-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.highlight-action {
  border-top: 4px solid var(--secondary-color);
  background: linear-gradient(to bottom, #fff, #fffaf0);
}

.action-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 15px;
  background: var(--light-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  transition: transform var(--transition-fast);
}

.highlight-action .action-icon {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: var(--secondary-color);
}

/* 第1個:成績查詢(藍) */
.action-grid a:nth-child(1) { border-top-color: #3b82f6; }
.action-grid a:nth-child(1) .action-icon { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); color: #2563eb; }

/* 第2個:每日賽程(綠) */
.action-grid a:nth-child(2) { border-top-color: #10b981; }
.action-grid a:nth-child(2) .action-icon { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: #059669; }

/* 第3個:線上報名(橘) - 沿用橘色 */
.action-grid a:nth-child(3) { border-top-color: #f59e0b; }
.action-grid a:nth-child(3) .action-icon { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); color: #d97706; }

/* 第4個:檔案下載(紫) */
.action-grid a:nth-child(4) { border-top-color: #8b5cf6; }
.action-grid a:nth-child(4) .action-icon { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); color: #7c3aed; }


.action-card:hover .action-icon {
  transform: scale(1.1);
}

.action-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 5px;
}

.action-desc {
  font-size: 0.9rem;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .quick-actions { margin-top: 30px; }
  .action-grid { gap: 15px; }
  .action-card { min-width: calc(50% - 15px); }
}
@media (max-width: 480px) {
  .action-card { min-width: 100%; }
}

/* News & Stats */
.core-info {
  margin-top: -100px; /* 拉近背景色以消除間隙 */
  padding-top: 150px !important; /* 增加頂部間距避開上方卡片 */
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 25px;
  position: relative;
  padding-left: 15px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 5px;
  background-color: var(--primary-color);
  border-radius: 5px;
}

.section-title span {
  font-size: 1rem;
  color: var(--gray-400);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.view-all {
  color: var(--primary-color);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.view-all:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* 最新公告 */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.news-card {
  display: flex;
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  border: 1px solid var(--gray-200);
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(5px);
  border-color: var(--primary-color);
}

.news-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 70px;
  background-color: var(--gray-100);
  border-radius: 8px;
  margin-right: 20px;
  border: 1px solid var(--gray-200);
}

.n-month {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
}

.n-day {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark-color);
  line-height: 1;
}

.news-content {
  flex: 1;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.tag-green { background-color: var(--tag-green); }
.tag-blue { background-color: var(--tag-blue); }
.tag-red { background-color: var(--tag-red); }

.news-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark-color);
}

.news-excerpt {
  font-size: 1.05rem;
  color: var(--gray-600);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 儀表板 */
.dashboard-widget {
  background: var(--white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--shadow-md); /* 加強陰影色感 */
  border: 1px solid var(--gray-200);
  border-top: 4px solid var(--accent-color);
  height: calc(100% - 63px); /* align with news list */
}

.db-item {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--gray-200);
}

.db-label {
  font-size: 1.15rem;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 8px;
}

.db-value.text-range {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark-color);
}

.db-stats {
  margin-top: 25px;
}

.stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
  padding: 20px 10px;
  border-radius: 10px;
  border: 1px solid var(--gray-100);
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-600);
}

@media (max-width: 991px) {
  .core-info .col-lg-8 { margin-bottom: 40px; }
  .dashboard-widget { height: auto; }
}
@media (max-width: 576px) {
  .news-card { flex-direction: column; }
  .news-date { margin-right: 0; margin-bottom: 15px; width: 100%; height: auto; padding: 10px 0; flex-direction: row; gap: 10px; }
}

/* Services */
.features-grid {
  background: var(--light-bg);
}

.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 48px; }

.section-title.justify-content-center {
  padding-left: 0;
  flex-direction: column;
}

.section-title.justify-content-center::before {
  display: none;
}

.section-title.justify-content-center::after {
  content: '';
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  margin-top: 10px;
  border-radius: 4px;
}

.feature-card {
  background-color: var(--white);
  border-radius: 16px;
  height: 100%;
  border: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
  transform: translateY(-8px);
}

/* 卡片頂部大面積顏色區塊 */
.fc-header {
  padding: 35px 25px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.fc-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0;
  color: inherit;
  z-index: 5;
  flex: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fc-icon {
  width: 70px;
  height: 70px;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  transition: all var(--transition-normal);
  flex-shrink: 0;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover .fc-icon {
  transform: scale(1.1) rotate(5deg);
  background-color: rgba(255, 255, 255, 0.25);
}

/* 裝飾性裝飾球 */
.fc-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.fc-body {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.fc-desc {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-bottom: 20px;
  flex-grow: 1;
}

/* 配色邏輯：作用於 fc-header */
/* Card 1: Blue */
.col-lg-4:nth-child(1) .fc-header { background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%); }
.col-lg-4:nth-child(1) .fc-links a:hover { color: #2563eb; }

/* Card 2: Green */
.col-lg-4:nth-child(2) .fc-header { background: linear-gradient(135deg, #10b981 0%, #065f46 100%); }
.col-lg-4:nth-child(2) .fc-links a:hover { color: #059669; }

/* Card 3: Orange */
.col-lg-4:nth-child(3) .fc-header { background: linear-gradient(135deg, #f59e0b 0%, #9a3412 100%); }
.col-lg-4:nth-child(3) .fc-links a:hover { color: #d97706; }

/* Card 4: Purple */
.col-lg-4:nth-child(4) .fc-header { background: linear-gradient(135deg, #8b5cf6 0%, #5b21b6 100%); }
.col-lg-4:nth-child(4) .fc-links a:hover { color: #7c3aed; }

/* Card 5: Cyan */
.col-lg-4:nth-child(5) .fc-header { background: linear-gradient(135deg, #06b6d4 0%, #155e75 100%); }
.col-lg-4:nth-child(5) .fc-links a:hover { color: #0891b2; }

/* Card 6: Rose */
.col-lg-4:nth-child(6) .fc-header { background: linear-gradient(135deg, #f43f5e 0%, #9f1239 100%); }
.col-lg-4:nth-child(6) .fc-links a:hover { color: #e11d48; }

.fc-links {
  border-top: 1px solid var(--gray-200);
  padding-top: 15px;
}

.fc-links li {
  margin-bottom: 8px;
}

.fc-links li:last-child {
  margin-bottom: 0;
}

.fc-links a {
  display: inline-block;
  color: var(--dark-color); /* 改為深黑色 */
  font-weight: 600;
  font-size: 1.15rem;
  transition: all var(--transition-fast);
}

.fc-links a:hover {
  text-decoration: none; /* 移除下底線 */
}


/* ===== Footer ===== */
.site-footer {
  background-color: var(--gray-900);
  color: var(--gray-300);
  padding: 60px 0 20px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info {
  flex: 2;
  min-width: 300px;
}

.footer-desc {
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: var(--gray-400);
}

.contact-info p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.contact-info strong {
  color: var(--white);
  font-weight: 500;
}

.footer-links {
  flex: 1;
  min-width: 150px;
}

.footer-heading {
  color: var(--white);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 40px;
  background-color: var(--primary-color);
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links ul li a {
  color: var(--gray-400);
  transition: color var(--transition-fast);
  font-size: 0.95rem;
}

.footer-links ul li a:hover {
  color: var(--white);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-500);
}

@media (max-width: 768px) {
  .footer-inner { flex-direction: column; gap: 30px; }
}