/* ==========================================
   1. 基礎重設與全局變數 (Variables)
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 💡 暮晨藍文青風色票定義 */
  --primary: #46607d; /* 暮晨藍主色 */
  --primary-light: #617f9b; /* 暮晨淺藍（用於 Hover、漸層微調） */
  --secondary: #8c7662; /* 大地咖啡色 */
  --accent: #b59e87; /* 燕麥褐 */

  --dark: #2b3a4a; /* 暮晨深藍 */
  --dark-light: #3a4d61;

  --gray-900: #18222c;
  --gray-700: #43505e; /* 內文文字顏色（帶有一點藍灰色調） */
  --gray-500: #738496;
  --gray-300: #c5d0dc;
  --gray-100: #eef3f8; /* 輕微的藍灰白 */
  --gray-50: #f4f7f9; /* 網頁基礎淡色背景 */
  --white: #ffffff;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow:
    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);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
  /* 💡 科技黑體鏈：優先跑現代幾何體 Inter，中文全面採用俐落的思源黑體與微軟正黑體 */
  font-family:
    "Geist Sans", "Inter", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--primary-light),
    var(--secondary)
  );
  z-index: 10000;
  transition: width 0.1s ease;
  box-shadow: 0 2px 10px rgba(70, 96, 125, 0.4);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--dark);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

p {
  color: var(--gray-700);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* ==========================================
   新增：Logo Ｑ彈特效
   ========================================== */
.logo-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 0.5rem;
  position: relative;
  /* 綁定無限循環的呼吸燈動畫，每 3 秒溫柔閃爍一次 */
  animation: logoPulse 3s infinite ease-in-out;
  transition: var(--transition);
}

/* 🚀 滑鼠懸浮（Hover）時：停止呼吸燈，改為強烈的科技高光與皮克斯式Ｑ彈放大 */
.logo-link:hover {
  animation: none; /* 停止常態呼吸 */
  transform: scale(1.05); /* 優雅放大 5% */
  filter: drop-shadow(
    0 0 12px rgba(97, 127, 155, 0.6)
  ); /* 綻放明顯的暮晨藍光暈 */
}

/* 滑鼠點擊（Active）瞬間的物理下壓反饋 */
.logo-link:active {
  transform: scale(0.98);
}

/* ── 💡 核心動畫：引導使用者點擊的「暮晨藍微光呼吸波浪」 ── */
@keyframes logoPulse {
  0% {
    filter: drop-shadow(0 0 2px rgba(70, 96, 125, 0.2));
  }
  50% {
    /* 呼吸到最深時，光暈優雅擴張，提示感十足 */
    filter: drop-shadow(0 0 10px rgba(70, 96, 125, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 2px rgba(70, 96, 125, 0.2));
  }
}

/* ==========================================
   2. 導覽列 (Navbar) - 滾動解鎖固定於頂部
   ========================================== */
.navbar {
  /* 核心：利用 fixed 死死固定在畫面最頂端 */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: transparent;
  z-index: 1000;
  padding: 0.8rem 0 1.2rem 0; /* 💡 配合置中偏上，整體微微上提 */
  transition: var(--transition);
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95); /* 轉為優雅的清透磨砂白底 */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.6rem 0; /* 滾動後內襯精簡，釋放更多空間 */
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--gray-100);
}

.nav-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* 讓內容對齊最頂部，達成偏上質感 */
}

.nav-logo {
  margin-top: 0.4rem;
}

/* 圖標初始尺寸優化 */
.page-img {
  height: 85px;
  width: auto;
  transition: var(--transition);
  display: block;
}

/* 網頁滾動後，圖標自動縮小 */
.navbar.scrolled .page-img {
  height: 45px;
}

.nav-links {
  display: flex;
  gap: 3rem;
  margin-top: 0.5rem; /* 固定在右上方 */
}

.nav-links a {
  color: var(--white); /* 預設在首頁背景前呈現白字 */
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  transition: var(--transition);
  padding: 0.5rem 0;
}

/* 網頁滾動後，導覽字體自動換成深色 */
.navbar.scrolled .nav-links a {
  color: var(--gray-700);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 1px;
}

.nav-links a:hover {
  color: var(--primary-light);
}

.nav-links a:hover::after {
  width: 100%;
}

/* 行動裝置選單按鈕預設基礎樣式 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--white);
  margin: 5px 0;
  transition: var(--transition);
  border-radius: 1px;
}

.navbar.scrolled .mobile-menu-btn span {
  background-color: var(--gray-700);
}

/* ==========================================
   3. 主視覺區 (Hero Section) - 字在圖前靠左偏上
   ========================================== */
.hero {
  height: 100vh;
  width: 100vw;
  background-image: url("img/ase_logo.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
}

/* 深色鏡面遮罩（照片清晰） */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 32, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 1;
}

/* 環境鏡面漸層 */
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.01) 40%,
    transparent 70%
  );
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 1400px;
  padding: 0 4rem 0 8vw; /* 左側舒適留白 */
  opacity: 0;
  animation: fadeInHero 1.5s ease forwards;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 22vh; /* 置中偏上 */
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero-text {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.typing-text {
  display: inline-block;
}

.hero-cta {
  margin-top: 4rem;
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.19, 1, 0.22, 1) 1.5s forwards;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 5;
}

/* 暮晨藍玻璃鏡面 Enter 按鈕 */
.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(97, 127, 155, 0.45) 0%,
    rgba(70, 96, 125, 0.65) 100%
  );
  color: rgba(255, 255, 255, 0.95);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(160, 190, 220, 0.3);
  box-shadow:
    0 4px 0 rgba(40, 55, 75, 0.6),
    0 10px 25px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.15);
  transform: translateY(0);
}

.cta-button:hover {
  background: linear-gradient(
    135deg,
    rgba(115, 145, 175, 0.55) 0%,
    rgba(80, 110, 140, 0.75) 100%
  );
  border-color: rgba(190, 215, 240, 0.45);
  transform: translateY(2.5px);
  box-shadow:
    0 1.5px 0 rgba(40, 55, 75, 0.6),
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 6px rgba(255, 255, 255, 0.25);
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.7),
    0 0 15px rgba(97, 127, 155, 0.6);
}

.cta-button:active {
  transform: translateY(4px);
  box-shadow:
    0 0 0 rgba(0, 0, 0, 0),
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.magnetic-button {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 皮克斯字體彈跳排版 */
.pixar-bounce {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

h1.pixar-bounce {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 2.5rem;
  line-height: 1.3;
  color: var(--white);
  white-space: nowrap;
  letter-spacing: 0.08em;
  text-shadow:
    0 4px 20px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(0, 0, 0, 0.6);
  text-align: left;
}

h2.pixar-bounce.sub-text {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
  line-height: 1.5;
  color: rgba(238, 242, 240, 0.95);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  text-align: left;
  width: 100%;
}

.pixar-bounce span {
  display: inline-block;
  opacity: 0;
  transform: translateY(-150px) scaleY(1.4);
  animation: pixarDrop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pixarDrop {
  0% {
    opacity: 0;
    transform: translateY(-150px) scaleY(1.4);
  }
  60% {
    opacity: 1;
    transform: translateY(10px) scaleY(0.8);
  }
  80% {
    transform: translateY(-5px) scaleY(1.1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

/* ==========================================
   4. 主要內容排版區 (Main & Section 滾動解鎖)
   ========================================== */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section {
  margin-bottom: 10rem;
  scroll-margin-top: 8rem;
  position: relative;
  opacity: 0;
  transform: translateY(50px);
  transition:
    opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.section.animate {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
  position: relative;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.section-icon svg {
  width: 32px;
  height: 32px;
}

h2 {
  font-size: 3rem;
  color: var(--dark);
  font-weight: 800;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--gray-500);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================
   5. 公司介紹與環境區域 (微光標籤 + 段落淡入滑行版)
   ========================================== */
#company {
  min-height: auto;
  height: auto;
  box-sizing: border-box;
  padding: 6rem 4rem;
  margin-bottom: 8rem !important;
  background: var(--gray-50);
  border-radius: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#company:hover {
  transform: translateY(-5px);
  background-color: var(--white);
  border-color: rgba(70, 96, 125, 0.15);
  box-shadow:
    0 15px 40px rgba(70, 96, 125, 0.06),
    0 30px 60px rgba(70, 96, 125, 0.04);
}

#company .section-header {
  margin-bottom: 3rem;
}

#company .section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

#company:hover .section-header h2 {
  color: var(--primary);
}

#company .section-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 950px;
  margin: 0 auto;
}

.company-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
}

.tag-item {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--primary);
  background: rgba(70, 96, 125, 0.06);
  padding: 0.4rem 1.2rem;
  border-radius: 2rem;
  border: 1px solid rgba(70, 96, 125, 0.12);
  letter-spacing: 0.03em;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#company:hover .tag-item {
  background: var(--white);
  color: var(--primary-light);
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(70, 96, 125, 0.1);
  transform: scale(1.03);
}

#company .content-text p {
  font-size: 1.15rem;
  line-height: 1.9;
  margin-bottom: 2rem;
  text-align: justify;
  text-justify: inter-ideograph;
  letter-spacing: 0.06em;
}

.company-environment {
  margin-top: 4rem;
  width: 100%;
  max-width: 950px;
}

#company .subsection-header {
  margin-bottom: 2.5rem;
}

.subsection-header h3 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--dark);
}

.subsection-divider {
  width: 60px;
  height: 3px;
  background: var(--primary-light);
  margin: 0 auto;
  border-radius: 2px;
  transition:
    width 0.6s cubic-bezier(0.25, 1, 0.5, 1),
    background-color 0.6s ease;
}

#company:hover .subsection-divider {
  width: 140px;
  background: var(--primary);
}

.environment-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

.environment-text p {
  font-size: 1.15rem;
  line-height: 1.9;
  margin-bottom: 2rem;
  text-align: justify;
  text-justify: inter-ideograph;
  letter-spacing: 0.06em;
}

.fade-slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1s cubic-bezier(0.215, 0.61, 0.355, 1),
    transform 1s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.section.animate .fade-slide-up {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   6. 工作內容卡片區 (四塊暮晨藍拼圖大卡片版)
   ========================================== */
.work-mosaic-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: rgba(70, 96, 125, 0.1);
  padding: 10px;
  border-radius: 2rem;
  perspective: 2000px;
}

.puzzle-piece {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 280px;
  position: relative;
  perspective: 1500px;
}

.puzzle-piece .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  transform-style: preserve-3d;
}

.puzzle-piece:hover .card-inner {
  transform: rotateY(180deg);
}

.puzzle-piece .card-front,
.puzzle-piece .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  padding: 2.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.puzzle-piece .card-front {
  background: linear-gradient(
    135deg,
    rgba(244, 247, 252, 0.96) 0%,
    rgba(225, 233, 245, 0.98) 100%
  );
  border: 1px solid rgba(70, 96, 125, 0.15);
  transform: rotateY(0deg);
  z-index: 2;
}

.puzzle-piece .card-back {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
  transform: rotateY(180deg);
  z-index: 1;
  border-radius: 0;
}

.tl-piece .card-front {
  border-radius: 1.5rem 0 0 0;
}
.tr-piece .card-front {
  border-radius: 0 1.5rem 0 0;
}
.bl-piece .card-front {
  border-radius: 0 0 0 1.5rem;
}
.br-piece .card-front {
  border-radius: 0 0 1.5rem 0;
}

.tl-piece .card-back {
  border-radius: 1.5rem 0 0 0;
}
.tr-piece .card-back {
  border-radius: 0 1.5rem 0 0;
}
.bl-piece .card-back {
  border-radius: 0 0 0 1.5rem;
}
.br-piece .card-back {
  border-radius: 0 0 1.5rem 0;
}

/* 🧩 拼圖幾何卡榫特效 */
.puzzle-piece::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  background: inherit;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  transition: var(--transition);
}

.tl-piece::after {
  top: calc(50% - 18px);
  right: -18px;
  background: rgba(225, 233, 245, 1);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.03);
}
.tr-piece::after {
  bottom: -18px;
  left: calc(50% - 18px);
  background: rgba(225, 233, 245, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}
.bl-piece::after {
  top: -18px;
  right: calc(50% - 18px);
  background: rgba(244, 247, 252, 1);
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
}
.br-piece::after {
  top: calc(50% - 18px);
  left: -18px;
  background: rgba(225, 233, 245, 1);
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.03);
}

.puzzle-piece:hover::after {
  transform: scale(1.1);
  background: var(--primary-light);
}

/* ── 05 任務組 ── */
.full-width-row {
  width: 100%;
  margin-top: 1rem;
}
.full-width-row .full-wide-card {
  max-width: 100%;
  min-height: 240px;
}
.full-wide-card .card-front {
  background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
  border: 1px solid var(--gray-300);
  border-radius: 1.5rem;
}
.full-wide-card .card-back {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  border-radius: 1.5rem;
  padding: 2.5rem 4rem;
}

.work-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.work-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 0.8;
  font-family: "Inter", sans-serif;
}
.work-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  color: var(--dark);
  letter-spacing: 0.02em;
}
.work-content p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--gray-700);
  text-align: justify;
}

.card-back-content h3 {
  color: #ffffff;
  margin-bottom: 0.6rem;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
}
.card-back-content p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* ==========================================
   7. 日常學習成果區 (暮晨藍發光垂直時間軸版)
   ========================================== */
#learning {
  background: var(--gray-50);
  padding: 6rem 2rem;
  border-radius: 2.5rem;
  position: relative;
}

.timeline-container {
  position: relative;
  max-width: 950px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  left: 31px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    to bottom,
    rgba(70, 96, 125, 0.1) 0%,
    var(--primary) 20%,
    var(--primary-light) 80%,
    rgba(97, 127, 155, 0.1) 100%
  );
  border-radius: 2px;
  z-index: 1;
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
  padding-left: 80px;
  z-index: 2;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 15px;
  top: 30px;
  width: 36px;
  height: 36px;
  background: var(--white);
  border: 4px solid var(--primary);
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 0 0 rgba(70, 96, 125, 0.4);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes dotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(70, 96, 125, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(70, 96, 125, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(70, 96, 125, 0);
  }
}

.timeline-item:nth-child(1) .timeline-dot {
  animation: dotPulse 2s infinite ease-in-out;
}
.timeline-item:nth-child(2) .timeline-dot {
  animation: dotPulse 2s infinite ease-in-out 0.6s;
}
.timeline-item:nth-child(3) .timeline-dot {
  animation: dotPulse 2s infinite ease-in-out 1.2s;
}

.timeline-card {
  background: var(--white);
  border-radius: 1.5rem;
  padding: 2.5rem;
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
  position: relative;
  transform: translateX(15px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.section.animate .timeline-card {
  opacity: 1;
  transform: translateX(0);
}

.section.animate .timeline-item:nth-child(1) .timeline-card {
  transition-delay: 0.1s;
}
.section.animate .timeline-item:nth-child(2) .timeline-card {
  transition-delay: 0.3s;
}
.section.animate .timeline-item:nth-child(3) .timeline-card {
  transition-delay: 0.5s;
}

.timeline-item:hover .timeline-card {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--primary-light);
  box-shadow: 0 12px 30px rgba(70, 96, 125, 0.08);
}

.timeline-item:hover .timeline-dot {
  background: var(--primary-light);
  border-color: var(--white);
  transform: scale(1.2);
  box-shadow: 0 0 15px var(--primary);
}

.timeline-badge {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--white);
  background: var(--primary);
  padding: 0.2rem 0.8rem;
  border-radius: 2rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.timeline-card h3 {
  font-size: 1.4rem;
  color: var(--dark);
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.timeline-card p {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--gray-700);
  text-align: justify;
  margin-bottom: 0;
  letter-spacing: 0.04em;
}

/* ==========================================
   8. 心得感想區 (上置橫式精簡分頁 + 引言書籤版)
   ========================================== */
.reflection-tab-menu.horizontal-tabs {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  width: 100%;
  max-width: 950px;
  margin: 0 auto 2rem auto;
}

.horizontal-tabs .tab-btn {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 0.6rem;
  padding: 0.9rem 1.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: var(--shadow-sm);
}

.horizontal-tabs .tab-btn .tab-num {
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.horizontal-tabs .tab-btn .tab-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}

.horizontal-tabs .tab-btn:hover {
  transform: translateY(-3px);
  border-color: var(--primary-light);
  background: var(--gray-50);
}

.horizontal-tabs .tab-btn.active {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(70, 96, 125, 0.12);
}

.horizontal-tabs .tab-btn.active .tab-num {
  color: var(--accent);
}
.horizontal-tabs .tab-btn.active .tab-title {
  color: var(--white);
}

.reflection-dashboard.horizontal-layout {
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
}

.reflection-panel-container {
  width: 100%;
  background: var(--white);
  border-radius: 1.5rem;
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow);
  min-height: 330px;
  position: relative;
  overflow: hidden;
}

.reflection-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 3rem;
  box-sizing: border-box;
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reflection-panel.active {
  position: relative;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.panel-header {
  margin-bottom: 1.5rem;
}

.reflection-badge {
  font-size: 0.85rem;
  background: rgba(70, 96, 125, 0.06);
  color: var(--primary);
  padding: 0.3rem 1rem;
  border-radius: 0.6rem;
  font-weight: 700;
  border: 1px solid rgba(70, 96, 125, 0.12);
  letter-spacing: 0.02em;
}

.reflection-body-text p {
  font-size: 1.12rem;
  line-height: 1.9;
  color: var(--gray-700);
  text-align: justify;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.reflection-body-text p:last-child {
  margin-bottom: 0;
}

.reflection-body-text mark {
  display: block;
  background: transparent;
  color: var(--gray-700);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.8;
  border-left: 4px solid var(--primary-light);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0;
  text-shadow: none;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.reflection-panel.active .reflection-body-text mark {
  opacity: 1;
  transform: translateY(0);
  color: var(--dark);
  border-left-color: var(--primary);
  transition-delay: 0.35s;
}

/* ==========================================
   9. 動畫定義與小工具
   ========================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeInHero {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pop-char {
  display: inline-block;
  opacity: 0;
  transform-origin: center;
  animation: chaoticJump 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes chaoticJump {
  0% {
    opacity: 0;
    transform: scale(0.2)
      translate(calc(var(--rand-x) * 1.5px), calc(var(--rand-y) * 1.5px))
      rotate(var(--rand-deg));
  }
  30% {
    opacity: 1;
    transform: scale(1.4)
      translate(calc(var(--rand-x) * -2px), calc(var(--rand-y) * -2px))
      rotate(calc(var(--rand-deg) * -1));
  }
  60% {
    transform: scale(0.9)
      translate(calc(var(--rand-x) * 0.5px), calc(var(--rand-y) * 0.5px))
      rotate(calc(var(--rand-deg) * 0.3));
  }
  100% {
    opacity: 1;
    transform: scale(1) translate(0, 0) rotate(0deg);
  }
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 45px;
  height: 45px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* ==========================================
   10. 頁尾區域 (深暮晨藍 - 沉穩落地總結版)
   ========================================== */
footer {
  background: linear-gradient(135deg, #1d2936 0%, var(--primary) 100%);
  padding: 4.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  margin-top: 6rem;
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-logo .footer-logo-img {
  height: 60px;
  width: auto;
  filter: brightness(0) invert(1); /* 💡 自動將圖片轉為冰晶純白色 */
  opacity: 0.35;
  transition: var(--transition);
}

footer:hover .footer-logo .footer-logo-img {
  opacity: 0.85;
}

.footer-text p {
  font-family: "Inter", "Noto Serif TC", serif;
  font-size: 0.9rem;
  color: var(--accent); /* 溫潤的暖調燕麥褐 */
  letter-spacing: 0.08em;
  margin-bottom: 0;
  opacity: 0.8;
}

/* ==========================================
   11. 手機選單安全防護 (防溢出核心修正)
   ========================================== */
/* 手機版獨立面版預設必須隱藏，防打架 */
.mobile-menu {
  display: none;
}

/* 當在寬大螢幕（大於768px）時，強制手機版選單徹底封鎖，防止外溢出現在最頂部 */
@media (min-width: 769px) {
  .mobile-menu {
    display: none !important;
  }
}
