/* =========================================
   1. 變數與 Reset
   ========================================= */
:root {
  /* 主色調：科技青綠 */
  --primary: #008fa2;
  --primary-dark: #006c7a;
  
  /* 輔助色：活力黃 & 深色背景 */
  --accent: #FFD200;
  --accent-orange: #FF9A00; 
  --dark-bg: #1a252f;
  
  /* 背景層次 */
  --bg-white: #ffffff;
  --bg-light: #f4f7f8; 
  
  /* 文字 */
  --text-main: #333333;
  --text-gray: #555555;
  
  /* 尺寸與陰影 */
  --header-height: 100px;
  --shadow-card: 0 10px 30px rgba(0,0,0,0.05);
  --shadow-hover: 0 15px 40px rgba(0, 143, 162, 0.15);
  --shadow-glow: 0 0 20px rgba(255, 210, 0, 0.4);
}

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

body {
  /* [修正] 將英文字體 (Roboto, Helvetica Neue, Arial) 移到最前面 */
  /* 這樣英文與數字會優先使用英文字體渲染，解決標點符號過寬的問題 */
  font-family: "Roboto", "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
  color: var(--text-main);
  line-height: 1.7;
  font-size: 17px; 
  background-color: var(--bg-white);
  overflow-x: hidden;
  padding-top: var(--header-height);
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; margin: 0; padding: 0; }
li { margin-bottom: 5px; }

/* =========================================
   2. Layout Utilities
   ========================================= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.text-center { text-align: center; }

.section {
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.section-white { background: var(--bg-white); }
.section-pattern {
  background-color: var(--bg-light);
  background-image: radial-gradient(#d1dbe0 1px, transparent 1px);
  background-size: 20px 20px;
}
.section-dark {
  background: var(--dark-bg);
  color: #fff;
}

/* 獎項區塊背景 */
.section-awards {
  background: radial-gradient(circle at center top, #fffae3 0%, #ffffff 70%);
  position: relative;
}
.section-awards::before,
.section-awards::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
}
.section-awards::before { background: var(--primary); top: -50px; left: -100px; }
.section-awards::after { background: var(--accent); bottom: 0; right: -50px; }

/* 標題樣式 */
.section-header { margin-bottom: 50px; position: relative; z-index: 1;}
.section-header .tag {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  position: relative;
}
.section-header .tag::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin: 5px auto 0;
  border-radius: 2px;
}
.section-header h2 { font-size: 2.6rem; margin-bottom: 10px; font-weight: 700; }
.section-header .subtitle { font-size: 1.25rem; color: var(--text-gray); font-weight: 400; }

/* =========================================
   3. Header & Navigation
   ========================================= */
.site-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  transition: height 0.3s ease;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.logo img { 
  height: auto; 
  max-height: 85px;
  width: auto; 
  vertical-align: middle; 
  transition: max-height 0.3s ease;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
  text-align: center;
  line-height: 1.2;
  padding: 5px 10px;
}
.nav-link small {
  display: block;
  font-size: 0.85rem;
  color: var(--text-gray);
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 400;
}
.nav-link:hover { color: var(--primary); }

.nav-register {
  background: linear-gradient(135deg, var(--primary) 0%, #3bbccf 100%);
  color: #fff !important;
  padding: 8px 24px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(0, 143, 162, 0.3);
}
.nav-register small { color: rgba(255,255,255,0.9); }
.nav-register:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 143, 162, 0.4); }

.menu-toggle {
  display: none; 
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1002;
}
.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: 0.3s;
}

/* =========================================
   4. Hero Banner
   ========================================= */
/* Hero 區塊修正 */
  .hero { 
      /* [修正] 取消強制高度，改為自動高度，讓圖片撐開容器 */
      min-height: auto; 
      height: auto;
      /* 移除 clip-path 確保手機版不會有奇怪的切角 */
      clip-path: none; 
  }

  .hero-img {
      /* [修正] 圖片寬度 100%，高度自動，這樣就能看到整張圖 */
      width: 100%;
      height: auto;
      min-height: auto; /* 取消最小高度限制，防止強迫放大 */
      object-fit: contain; /* 確保圖片內容完整顯示 */
  }

/* =========================================
   5. Content Sections
   ========================================= */
.content-block p { margin-bottom: 20px; text-align: justify; font-size: 1.05rem; }
.content-block .en { 
    color: #555; 
    font-size: 1rem;
    line-height: 1.6;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.feature-card {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  border-top: 4px solid var(--primary);
  transition: transform 0.3s;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.feature-card h3 { font-size: 1.6rem; margin-bottom: 20px; }
.feature-card ul { padding-left: 20px; list-style-type: disc; }
.feature-card ul li { margin-bottom: 15px; font-size: 1.05rem; }
.card-icon {
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(0, 143, 162, 0.1);
  position: absolute;
  top: 20px;
  right: 20px;
}
.en-text-sm {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Timeline */
.timeline-wrapper { max-width: 900px; margin: 0 auto; }
.timeline-row {
  display: flex;
  background: #fff;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  border-left: 5px solid transparent;
  transition: 0.3s;
}
.timeline-row:hover { border-left-color: var(--primary); transform: translateX(5px); }
.timeline-row.highlight { border-left-color: var(--accent); background: #fffcf0; }

.date-col {
  background: var(--bg-light);
  padding: 20px;
  width: 180px; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
  position: relative;
  border-right: 1px solid #eee;
}

.date-full {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary); 
    line-height: 1.4;
    white-space: nowrap;
}
.date-full .year {
    color: var(--primary); 
    margin-right: 4px;
}
.date-range-sep {
    display: block;
    color: #999;
    font-size: 0.9rem;
    margin: 4px 0;
}
.date-note {
    font-size: 0.9rem;
    color: #999;
    margin-top: 8px;
    display: block;
    font-weight: 400;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.content-col { padding: 30px 40px; flex-grow: 1; }
.content-col h3 { font-size: 1.4rem; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px;}
.en-sub-title { display:block; font-size: 1rem; color:#777; margin-top:5px; font-weight:400; line-height: 1.4; }
.desc-list { list-style: disc; margin-left: 20px; margin-bottom: 15px; }
.desc-list.en { color: #666; font-size: 1rem; margin-top: -10px; }
.desc-intro { font-weight: bold; margin-bottom: 5px; }
.desc-intro.en { font-weight: normal; color:#666; margin-top:10px; font-size: 1rem; }

/* Criteria */
#criteria {
  background: linear-gradient(180deg, #eaf6f7 0%, #ffffff 100%);
  color: var(--text-main);
}
#criteria .section-header h2 { color: var(--primary-dark); }
#criteria .section-header .subtitle { color: var(--text-gray); opacity: 0.8; }

.score-card {
  background: #ffffff;
  padding: 40px;
  border-radius: 24px;
  border: 1px solid rgba(0, 143, 162, 0.15);
  box-shadow: 0 15px 40px rgba(0, 143, 162, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%; 
}
.score-card:hover { transform: translateY(-8px); box-shadow: 0 20px 50px rgba(0, 143, 162, 0.15); }
.score-card h4 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 30px;
  padding-bottom: 15px;
  position: relative;
  font-weight: 800;
}
.score-card h4::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 60px; height: 4px;
  background-color: var(--accent); border-radius: 2px;
}
.score-card h4 small {
  display: block; font-size: 0.9rem; color: #999; font-weight: 400; margin-top: 5px; letter-spacing: 0.5px;
}
.score-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed #e0e0e0;
}
.score-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.score-info { flex: 1; padding-right: 15px; }
.score-info strong { display: block; font-size: 1.2rem; color: #333; margin-bottom: 4px; }
.score-info .en { font-size: 0.95rem; color: var(--primary); font-weight: 500; display: block; margin-bottom: 8px; }
.criteria-text { font-size: 1rem; color: #666; line-height: 1.6; margin: 0; }
.criteria-text .en-sm { display: block; font-size: 0.9rem; color: #999; margin-top: 4px; }
.score-total {
  margin-top: 30px; padding-top: 20px; border-top: 2px solid #f5f5f5;
  text-align: right; font-size: 1.4rem; font-weight: 900; color: var(--primary-dark); letter-spacing: 1px;
}

/* Awards */
.prize-pool-text {
  font-size: 4.5rem;
  font-weight: 900;
  margin: 10px 0 40px;
  line-height: 1.1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #B88A00 0%, #FFD200 50%, #B88A00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 15px rgba(255, 210, 0, 0.3));
}

.awards-flex { display: flex; justify-content: center; align-items: flex-end; gap: 20px; margin-bottom: 40px; }
.award-box {
  background: #fff; border-radius: 16px 16px 0 0; padding: 20px; text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08); width: 32%; position: relative; transition: transform 0.3s;
}
.award-box:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }
.award-box.rank-1 { height: auto; min-height: 340px; border-top: 8px solid #FFD700; z-index: 2; padding-top: 50px; }
.award-box.rank-2 { height: auto; min-height: 300px; border-top: 8px solid #C0C0C0; }
.award-box.rank-3 { height: auto; min-height: 280px; border-top: 8px solid #CD7F32; }
.medal { font-size: 4rem; margin-bottom: 5px; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.1)); }
.winner-count { font-size: 1rem; color:#888; margin-bottom: 5px; }
.money { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin: 10px 0; }
.award-detail { font-size: 1rem; line-height: 1.5; color: #555; }
.award-detail small { color: #888; font-size: 0.9rem; }

/* [新增/修改] 針對第一名 (rank-1) 的獎盃圖示放大 */
.award-box.rank-1 .medal {
    font-size: 8rem; /* 原本大約是 4rem，這裡改為 8rem 讓它變兩倍大 */
    margin-bottom: 15px; /* 增加一點底部距離以免太擠 */
    line-height: 1;
}

.awards-merit-container { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.merit-box { 
  background: #fff; padding: 25px 40px; border-radius: 50px; box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  text-align: center; flex: 1; min-width: 280px; max-width: 450px; transition: transform 0.3s;
  border: 1px solid rgba(255, 210, 0, 0.2);
}
.merit-box:hover { transform: translateY(-5px); box-shadow: var(--shadow-glow); }
.money-sm { font-size: 1.3rem; font-weight: 700; color: var(--primary); margin: 5px 0; }
.award-detail-sm small { font-size: 0.9rem; color: #888; }

/* [修正] 增加上方間距 (30px -> 50px) 並設定文字靠左對齊 */
.awards-extra, .timeline-extra {
    background: #fffcf0; 
    border: 1px solid #faeab8; 
    padding: 25px; 
    border-radius: 8px; 
    font-size: 1rem; 
    color: #666; 
    text-align: left; /* 改為靠左對齊，閱讀更舒適 */
    margin-top: 50px; /* 加大間距，與上方內容區隔開來 */
}

/* 確保段落與英文小字有適當間距 */
.awards-extra p, .timeline-extra p { margin-bottom: 15px; }
.awards-extra p:last-child, .timeline-extra p:last-child { margin-bottom: 0; }
.awards-extra .en-text-sm, .timeline-extra .en-text-sm { display: block; color: #888; font-size: 1rem; margin-top: 4px; }

/* FAQ */
.faq-container { max-width: 800px; margin: 0 auto; }
details {
  background: #fff; margin-bottom: 15px; border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03); overflow: hidden; transition: all 0.3s;
}
details[open] { box-shadow: 0 5px 15px rgba(0,143,162,0.1); }
summary {
  padding: 25px; font-weight: 700; cursor: pointer; list-style: none; 
  position: relative; padding-right: 50px; line-height: 1.4; font-size: 1.1rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+'; position: absolute; right: 25px; top: 25px; font-size: 1.5rem;
  color: var(--primary); transition: 0.3s;
}
details[open] summary::after { content: '-'; transform: rotate(180deg); }
summary .en-sub { 
    display: block; font-size: 1rem; font-weight: 400; color: var(--text-gray); 
    margin-top: 8px; line-height: 1.4;
}
.faq-content { padding: 0 25px 25px; border-top: 1px solid #f0f0f0; color: #555; animation: slideDown 0.3s ease-out; }
.faq-content p { margin-top: 10px; font-size: 1.05rem; }
.en-ans { font-size: 1rem; color: #777; line-height: 1.5; }

/* Info Card */
.info-card {
  background: #fff; border: 1px solid #eee; padding: 40px; border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05); height: 100%;
  display: flex; flex-direction: column; justify-content: flex-start; 
  align-items: center; text-align: center;
}
.info-card h2 { font-size: 2rem; color: var(--primary-dark); margin-bottom: 20px; position: relative; display: inline-block; }
.info-card h2::after {
  content: ''; display: block; width: 50px; height: 3px; background: var(--accent);
  margin: 10px auto 0; border-radius: 2px;
}

/* Contact Upper Info */
.contact-item { margin-bottom: 20px; font-size: 1.05rem; }
.contact-label { display: block; font-weight: 700; color: #333; margin-bottom: 2px; }
.contact-value { color: #444; font-weight: 500; }
.contact-sub { font-size: 0.9rem; color: #777; display: block; margin-top: 2px; font-family: sans-serif; }
.contact-service-hours { margin-top: 30px; padding-top: 20px; border-top: 1px dashed #ddd; }

/* Buttons */
.download-links { display: flex; flex-direction: column; gap: 15px; width: 100%; max-width: 350px; margin-top: 20px; }
.btn { 
    display: inline-block; padding: 12px 30px; border-radius: 50px; font-weight: 500; margin: 5px; 
    text-align: center; font-size: 1.05rem; border: 2px solid transparent; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn-outline { 
    border-color: var(--primary); color: var(--primary); background: #fff; width: 100%; transition: all 0.3s ease;
}
.btn-outline:hover { 
    background: var(--primary); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 143, 162, 0.2); 
}
.download-area .btn-outline { width: auto; display: inline-block; margin: 5px; padding: 12px 35px; }

/* =========================================
   Main Footer (單層橫向排版 - 主辦單位樣式)
   ========================================= */
.main-footer { 
    background-color: #ffffff;
    color: #444; 
    padding: 0;
    margin-top: 80px;
    border-top: 1px solid #eee;
    position: relative;
}

.footer-wide-container {
    width: 95%; /* 寬版 */
    max-width: 1800px; 
    margin: 0 auto;
    padding: 0 20px;
}

.footer-row-flex {
    display: flex;
    justify-content: flex-start; /* 靠左 */
    align-items: flex-start; /* 靠上對齊 */
    gap: 60px; 
    padding: 50px 0;
    flex-wrap: wrap; 
}

/* Logo 區 */
.footer-logo-group {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    flex-shrink: 0; 
}
.footer-logo-item img {
    height: 55px; 
    width: auto;
    object-fit: contain;
    filter: none;
    transition: transform 0.3s;
}
.footer-logo-item img:hover { transform: scale(1.05); }

/* 分隔線 */
.logo-divider { width: 1px; height: 30px; background-color: #ddd; display: inline-block; }

/* 資訊區 */
.footer-info-group {
    display: flex;
    flex-direction: column; /* 垂直排列標題與內容 */
    align-items: flex-start;
    gap: 10px;
}

/* 主辦單位標題：藍色字+黃色方塊 */
.footer-organizer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary); /* 藍綠色 */
    margin-bottom: 8px;
    position: relative;
    padding-left: 16px; /* 留給方塊的空間 */
    display: inline-block;
}
.footer-organizer-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%); /* 垂直置中 */
    width: 8px;  /* 黃色小方塊寬 */
    height: 16px; /* 黃色小方塊高 */
    background-color: var(--accent); /* 黃色 */
    border-radius: 2px;
}

/* 內容區塊 */
.footer-text-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}
.footer-text-content p {
    margin: 4px 0;
}
.footer-text-content a {
    color: #444;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
    transition: 0.2s;
}
.footer-text-content a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.en-sub {
    font-size: 0.85rem;
    color: #888;
    margin-left: 5px;
    font-family: sans-serif;
}
.en-sub.block { display: block; margin-left: 0; margin-top: 2px; }

/* 版權區 */
.copyright-bar {
    background-color: #B6CF61; 
    color: #fff;
    text-align: center;
    padding: 15px 0;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

#scroll-progress {
  position: fixed; top: 0; left: 0; height: 4px; background: var(--accent-orange); width: 0%; z-index: 9999; transition: width 0.1s; box-shadow: 0 0 10px var(--accent);
}
.fade-up { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* =========================================
   6. RWD Mobile (全面適配)
   ========================================= */
@media (max-width: 900px) {
  :root { --header-height: 80px; }
  .logo img { max-height: 60px; }
  
  .menu-toggle { display: flex; }
  .main-nav {
    position: fixed; top: var(--header-height); left: 0; width: 100%; background: #fff;
    flex-direction: column; padding: 20px 0; box-shadow: 0 10px 10px rgba(0,0,0,0.05);
    display: none; height: calc(100vh - var(--header-height)); overflow-y: auto;
  }
  .main-nav.active { display: flex; animation: slideDown 0.3s ease; }
  .nav-link { width: 100%; padding: 15px 0; border-bottom: 1px solid #f0f0f0; }
  .nav-register { width: 80%; text-align: center; margin-top: 15px; }
  
  .grid-2 { grid-template-columns: 1fr; gap: 20px; }
  
  .awards-flex { flex-direction: column; align-items: center; }
  .award-box { width: 90%; height: auto !important; margin-bottom: 20px; border-radius: 16px; border-top-width: 8px; }
  .award-box.rank-1 { order: 1; } .award-box.rank-2 { order: 2; } .award-box.rank-3 { order: 3; }
  .awards-merit-container { flex-direction: column; } .merit-box { width: 100%; }
  
  .prize-pool-text { font-size: 2.5rem; }
  .section-header h2 { font-size: 2.2rem; }
  
  .timeline-row { flex-direction: column; }
  .date-col { 
      width: 100%; flex-direction: row; gap: 10px; padding: 15px; background: #eef2f3; 
      justify-content: flex-start; align-items: center; text-align: left; border-right: none; border-bottom: 1px solid #eee;
  }
  
  .content-col { padding: 25px; }
  .faq-container { width: 100%; }
  
  /* [重點修正] Hero 圖片自適應 */
  .hero { 
      min-height: auto; 
      height: auto; 
      clip-path: none; /* 確保無切角 */
  }
  .hero-img {
      width: 100%;
      height: auto;
      min-height: auto; /* 關鍵：移除最小高度 */
      object-fit: contain; /* 關鍵：完整顯示 */
  }

  /* Footer Mobile */
  .footer-row-flex { flex-direction: column; align-items: flex-start; gap: 40px; }
  .footer-logo-group { width: 100%; justify-content: flex-start; gap: 20px; }
  .logo-divider { display: none; }
  .footer-info-group { width: 100%; }
  .en-sub { display: block; margin-left: 0; }
}