/* ==========================================
   1. 基礎重設與全局變數 (Variables)
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3d5a45; /* 莫蘭迪深綠（用於主導覽、按鈕、主要強調色） */
  --primary-light: #5a7862; /* 淺深綠（用於按鈕 Hover、漸層微調） */
  --secondary: #8c7662; /* 大地咖啡色（用於次要強調色、點綴色） */
  --accent: #b59e87; /* 燕麥褐（用於暖調點綴） */

  --dark: #202923; /* 極深墨綠（取代原本的死黑，讓文字更有質感） */
  --dark-light: #323d35; /* 深綠灰 */

  --gray-900: #1c221e;
  --gray-700: #4a544e; /* 內文文字顏色（帶有一點綠灰色調） */
  --gray-500: #7d8a82;
  --gray-300: #c2cbc5;
  --gray-100: #eef2f0; /* 輕微的綠灰白（用於淡色區塊背景） */
  --gray-50: #f4f6f5; /* 網頁基礎淡色背景（比純白更溫柔） */
  --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 {
  /* 💡 文青宋體（中英字體優雅融合） */
  font-family:
    "Inter",
    "Noto Serif TC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    serif;
  line-height: 1.7;
  color: var(--gray-700);
  background: var(--white);
  overflow-x: hidden;
  font-size: 16px;
}

.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(61, 90, 69, 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;
}

/* ==========================================
   2. 導覽列 (Navbar) & 行動裝置選單
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: transparent;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 1rem 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: center;
}

.logo-img {
  height: 60px;
  width: auto;
  transition: var(--transition);
}

.navbar.scrolled .logo-img {
  height: 42px;
}

.nav-links {
  display: flex;
  gap: 3rem;
}

.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);
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 350px;
  height: 100vh;
  background-color: var(--white);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 6rem 2rem 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow-xl);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu a {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}

.mobile-menu a:hover {
  color: var(--primary);
  padding-left: 1rem;
}

/* ==========================================
   新增：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(90, 120, 98, 0.7)
  ); /* 🌟 綻放精緻的莫蘭迪綠色光暈 */
}

/* 滑鼠點擊（Active）瞬間的物理下壓反饋 */
.logo-link:active {
  transform: scale(0.98);
}

/* ── 核心動畫：引導使用者點擊的「莫蘭迪綠微光呼吸波浪」 ── */
@keyframes logoPulse {
  0% {
    filter: drop-shadow(0 0 2px rgba(61, 90, 69, 0.2));
  }
  50% {
    /* 呼吸到最深時，綠色光暈優雅擴張，提示感十足 */
    filter: drop-shadow(0 0 12px rgba(61, 90, 69, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 2px rgba(61, 90, 69, 0.2));
  }
}

/* ==========================================
   3. 主視覺區 (Hero Section) & 特效
   ========================================== */
.hero {
  height: 100vh;
  background-image: url("images/HolyStoneBuilding.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 28, 0.6);
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 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 2rem;
  opacity: 0;
  animation: fadeInHero 1.5s ease forwards;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-text {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.hero h1 {
  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.7),
    0 0 35px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.hero h2 {
  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.6);
  text-align: center;
  width: 100%;
}

/* 💡 這裡精確補上：大螢幕下照片與副標題橫向 Flex 並排與玻璃感樣式 */
.hero-profile-container {
  display: flex;
  align-items: center; /* 照片與文字群垂直居中 */
  justify-content: center; /* 整體在畫面中央 */
  gap: 2.5rem; /* 照片與文字之間的舒適留白 */
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.hero-avatar-box {
  position: relative;
  width: 165px; /* 照片尺寸 */
  height: 185px;
  border-radius: 35%; /* 裁切正圓形 */
  overflow: hidden;
  border: 2px solid rgba(140, 180, 150, 0.35); /* 輕微綠色玻璃高光邊框 */
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(61, 90, 69, 0.25);
  transition: var(--transition);
}

.hero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 避免相片變形 */
  object-position: center 25%; /* 調整半身照上下視覺焦點 */
  filter: grayscale(10%) brightness(0.95); /* 帶有一點淡淡文青灰度 */
  transition: var(--transition);
}

.hero-subtitles {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* 🌟 核心：並排時，強迫四行字整齊靠左對齊 */
  text-align: left;
}

.hero-subtitles h2 {
  text-align: left !important; /* 強制覆蓋原本全局的 text-align: center */
  margin-bottom: 0.4rem; /* 稍微收緊行距，更精緻 */
}

/* 滑鼠滑入頭像時的微光動態 */
.hero-avatar-box:hover {
  transform: scale(1.05);
  border-color: rgba(165, 210, 175, 0.6);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(90, 120, 98, 0.5);
}

.hero-avatar-box:hover .hero-avatar-img {
  filter: grayscale(0%) brightness(1.02);
}

.typing-text {
  display: inline-block;
}

.hero-cta {
  margin-top: 3.5rem;
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.19, 1, 0.22, 1) 1.5s forwards;
  display: flex;
  justify-content: center;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;

  /* 💡 核心優化 1：使用莫蘭迪淺綠到深綠的半透明漸層，打造翡翠般溫潤的玻璃質感 */
  background: linear-gradient(
    135deg,
    rgba(90, 120, 98, 0.45) 0%,
    /* 左上角透亮的淺深綠 (--primary-light 的半透明版) */ rgba(61, 90, 69, 0.65)
      100% /* 右下角深邃的墨綠色 (--primary 的半透明版) */
  );

  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;
  z-index: 5;

  /* 💡 核心優化 2：毛玻璃折射效果，讓按鈕能霧化並透出後方 HolyStone 大樓相片 */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  /* 💡 核心優化 3：極精細的「綠光玻璃邊框」與「立體物理厚度陰影」 */
  border: 1px solid rgba(140, 180, 150, 0.3); /* 頂部微透綠光邊緣，取代原本的紅光 */
  box-shadow:
    0 4px 0 rgba(40, 60, 46, 0.55),
    /* 綠色玻璃側面的厚度感 */ 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 {
  /* 💡 Hover 時稍微提高半透明綠色的飽和度與亮度 */
  background: linear-gradient(
    135deg,
    rgba(110, 145, 120, 0.55) 0%,
    rgba(70, 102, 79, 0.75) 100%
  );

  border-color: rgba(165, 210, 175, 0.45); /* 邊框的綠色高光變得更明顯 */

  /* 物理下壓：向下位移 2.5px，立體側面縮短，陰影收攏 */
  transform: translateY(2.5px);
  box-shadow:
    0 1.5px 0 rgba(40, 60, 46, 0.55),
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 6px rgba(255, 255, 255, 0.25); /* 內部折射變強 */

  /* 🌟 讓 Enter 字體透出細緻的翡翠核心微光，呼應全局莫蘭迪綠 */
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.7),
    0 0 15px rgba(90, 120, 98, 0.6);
}

.cta-button:active {
  /* 點擊壓到底的物理回饋 */
  transform: translateY(4px);
  box-shadow:
    0 0 0 rgba(40, 60, 46, 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);
}

/* ==========================================
   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: 100vh;
  height: 100vh;
  box-sizing: border-box;

  /* 💡 修正點 1：上下內襯稍微收緊（2vh -> 1vh），把更多螢幕高度留給內容 */
  padding: 1vh 4rem;

  /* 💡 修正點 2：強迫在卡片最下方塞入 12rem（大約 192px）的巨大外邊距安全感！ */
  margin-bottom: 12rem !important;

  background: var(--gray-50);
  border-radius: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* 以下硬體加速與過渡動態維持不變 */
  will-change: transform, box-shadow, background-color, border-color;
  border: 1px solid transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
  transition:
    transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.5s cubic-bezier(0.25, 1, 0.5, 1),
    background-color 0.5s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── 🚀 觸發大卡片特效：當滑鼠放上這個區域，整張大圓弧卡片優雅懸浮、亮起微光 ── */
#company:hover {
  transform: translateY(-5px); /* 輕盈向上漂浮 5px */
  background-color: var(--white); /* 溫潤地褪變成純白色，視覺層次感暴增 */
  border-color: rgba(
    90,
    120,
    98,
    0.15
  ); /* 邊框亮起若隱若現的莫蘭迪綠色高光線 */

  /* 下方投射出大面積、極其淡雅的深綠環境微光陰影 */
  box-shadow:
    0 15px 40px rgba(61, 90, 69, 0.06),
    0 30px 60px rgba(61, 90, 69, 0.04);
}

#company .section-header {
  margin-bottom: 2.5vh;
}

#company .section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.3rem;
  transition: var(--transition);
}

/* Hover 時大標題悄悄變成更有質感的極深墨綠 */
#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 .content-text {
  position: relative;
  width: 100%;
}

#company .content-text p {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 1.5vh;
  text-align: justify;
  text-justify: inter-ideograph;
  letter-spacing: 0.08em;
}

#company .content-visual,
.environment-images {
  display: none;
}

#company .content-text::before {
  display: none;
}

.company-environment {
  margin-top: 2vh;
  width: 100%;
  max-width: 950px;
}

.subsection-header {
  margin-bottom: 1.5vh;
}

.subsection-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
  text-align: center;
}

/* ── 💡 核心小細節：辦公室環境下方的綠色裝飾短線 ── */
.subsection-divider {
  width: 60px; /* 初始寬度 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: 120px; /* 寬度大氣地翻倍成 120px */
  background: var(--primary); /* 顏色悄悄變深，指引閱讀視線 */
}

.environment-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

.environment-text {
  position: relative;
  width: 100%;
  padding-right: 0;
}

.environment-text::before {
  display: none;
}

.environment-text p {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 1.5vh;
  text-align: justify;
  text-justify: inter-ideograph;
  letter-spacing: 0.08em;
}
/* ==========================================
   6. 工作內容卡片區 (圖文不對稱交錯 + 尾端通欄長卡版)
   ========================================== */
.work-mosaic-container {
  display: flex;
  flex-direction: column;
  gap: 4.5rem; /* 每組任務之間的垂直安全距離 */
  max-width: 1200px; /* 鎖定精緻中段寬度，讓交錯感看起來非常協調 */
  margin: 0 auto;
  padding: 2rem 0;
}

/* 一列圖文組合基礎設定 */
.work-row {
  display: flex;
  align-items: center;
  gap: 4rem; /* 圖片與卡牌之間的橫向舒適空隙 */
  width: 100%;
}

/* 💡 核心魔法 1：利用 Flex-direction 自適應反轉，輕鬆達成一左一右交錯 */
.work-row.reverse {
  flex-direction: row-reverse;
}

/* 照片展示盒設定 */
.work-img-box {
  flex: 1;
  max-width: 50%;
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--gray-100);
}

.work-img-box img {
  width: 100%;
  height: 280px;
  object-fit: cover; /* 剪裁照片確保完美填滿 */
  display: block;
  transition: var(--transition);
  filter: grayscale(20%) brightness(0.95); /* 帶有一點溫潤的復古文青灰度 */
}

/* 照片微小標籤 */
.img-caption {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  background: rgba(32, 41, 35, 0.75);
  backdrop-filter: blur(5px);
  color: var(--white);
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* 滑鼠滑入照片時輕微亮起放大 */
.work-row:hover .work-img-box img {
  transform: scale(1.04);
  filter: grayscale(0%) brightness(1);
}

/* ── 💡 01~04 交錯卡牌大小鎖定 ── */
.work-row .card-3d {
  flex: 1;
  max-width: 50%;
  height: 280px; /* 與照片高度切齊，畫面極其整齊對稱 */
  position: relative;
}

/* ── 💡 05 巨型卡牌全寬橫長通欄排版 ── */
.full-width-row {
  width: 100%;
  margin-top: 1.5rem;
}

.full-width-row .full-wide-card {
  flex: 1;
  width: 100%;
  max-width: 100%; /* 強迫橫向 100% 鋪滿螢幕 */
  height: 240px; /* 橫長型卡牌高度不需要太高 */
}

/* ── 💡 沿用原地極速淡入、不翻轉防當特效核心 ── */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform: none !important;
}

.card-front,
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 1.5rem;
  padding: 2.2rem 2.5rem;
  box-sizing: border-box;
  transition:
    opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-front {
  background: var(--white);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 1;
  opacity: 1;
}

.card-back {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  border: 1px solid var(--primary);
  box-shadow: 0 12px 35px rgba(61, 90, 69, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: scale(0.98);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}

/* 🚀 觸發原地淡入 */
.card-3d:hover .card-front {
  opacity: 0.1;
}
.card-3d:hover .card-back {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* 文字微調 */
.work-header {
  display: flex;
  gap: 1.5rem;
}
.work-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 0.9;
  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: 1rem;
  line-height: 1.6;
  color: var(--gray-700);
  text-align: justify;
}

/* 綠色背面內容調整 */
.card-back-content h3 {
  color: var(--white);
  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;
}

/* ── 💡 05 巨型卡牌內部排版特殊擴張 ── */
.full-wide-card .work-content p {
  font-size: 1.05rem;
  line-height: 1.7;
}
.full-wide-card .card-back {
  padding: 2rem 4rem; /* 左右給予更寬闊的空間看 C# 轉型成果 */
}

/* ==========================================
   7. 日常學習成果區 (純淨圖文通欄版)
   ========================================== */
#learning {
  background: var(--gray-50);
  padding: 5rem 2rem;
  border-radius: 2rem;
}

.tech-list {
  display: flex;
  flex-direction: column;
  gap: 3rem; /* 卡片跟卡片之間的舒適距離 */
  max-width: 1100px; /* 稍微收攏，讓字體大小跟右側圖片看起來比例最美 */
  margin: 0 auto;
}

.tech-item {
  background: var(--white);
  border-radius: 1.5rem;
  padding: 2.8rem 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}

.tech-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.tech-item h3 {
  font-size: 1.4rem;
  color: var(--dark);
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* 核心圖文 Flex 橫向佈局 */
.tech-content {
  display: flex;
  align-items: center; /* 垂直置中 */
  justify-content: space-between;
  gap: 3.5rem; /* 文字與右側圖片的橫向留白 */
}

/* 左側文字 */
.tech-text {
  flex: 1; /* 自動填滿剩餘寬度 */
}

.tech-text p {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--gray-700);
  text-align: justify;
  margin-bottom: 0;
  letter-spacing: 0.04em;
}

/* 右側獨立圖片展示盒 */
.tech-img-box {
  flex: 0 450px; /* 鎖定精緻的圖片寬度 */
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-300);
  background: var(--gray-50);
}

.tech-img-box img {
  width: 100%;
  height: 190px;
  object-fit: cover; /* 自動裁切圖片，不擠壓變形 */
  display: block;
  transition: var(--transition);
}

/* 圖片下方的霧面黑色標籤 */
.tech-img-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(32, 41, 35, 0.8);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.45rem 0;
  letter-spacing: 0.05em;
}

/* Hover 卡片時圖片輕微放大 */
.tech-item:hover .tech-img-box img {
  transform: scale(1.04);
}

/* ==========================================
   RWD 手機端防撞自適應
   ========================================== */
@media (max-width: 992px) {
  .tech-content {
    flex-direction: column; /* 手機端自動變為單欄：字在上、圖在下 */
    align-items: stretch;
    gap: 1.5rem;
  }

  .tech-img-box {
    flex: none;
    width: 100%; /* 圖片自動拉伸成 100% 滿版 */
    max-width: 100%;
  }
}

/* ==========================================
   8. 心得感想區 (2026 文青螢光筆劃線焦點版)
   ========================================== */
.reflection-book-layout {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 950px; /* 呼應前面公司介紹的舒適窄版 */
  margin: 0 auto;
}

/* 每一篇心得卡牌底座 */
.reflection-article {
  background: var(--white);
  border-radius: 1.5rem;
  padding: 3.5rem;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

/* 頂部標題列排版 */
.reflection-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
  border-bottom: 1px dashed var(--gray-300); /* 優雅的襯底裝飾虛線 */
  padding-bottom: 1.2rem;
}

.reflection-num-tag {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--secondary); /* 大地暖色點綴 */
  letter-spacing: 0.05em;
}

.reflection-title-row h3 {
  font-size: 1.4rem;
  color: var(--dark);
  font-weight: 700;
  margin: 0;
}

.reflection-badge {
  font-size: 0.82rem;
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.2rem 0.8rem;
  border-radius: 2rem;
  font-weight: 500;
}

/* 內文宋體空間校正 */
.reflection-body-text p {
  font-size: 1.15rem; /* 大字體 */
  line-height: 1.9;
  color: var(--gray-700);
  text-align: justify;
  letter-spacing: 0.06em; /* 寬字距 */
  margin-bottom: 1.5rem;
}

.reflection-body-text p:last-child {
  margin-bottom: 0;
}

/* ── 💡 核心魔法：模擬實體螢光筆劃線的初始狀態 ── */
.reflection-body-text mark {
  background: linear-gradient(
    to right,
    rgba(90, 120, 98, 0.22) 50%,
    transparent 50%
  );
  background-size: 200% 100%;
  background-position: 100% 0; /* 預設把螢光綠色藏在右邊看不見 */
  color: inherit; /* 顏色維持跟一般文字一樣 */
  padding: 0 4px;
  border-radius: 4px;

  /* 超絲滑的實體劃線拉過去的動態時間 */
  transition: background-position 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── 🚀 觸發亮起：當滑鼠放進這篇心得時，卡牌原地亮起邊框，且核心重點在 0.6 秒內自動刷上綠色螢光！ ── */
.reflection-article:hover {
  border-color: var(--primary-light);
  box-shadow: 0 15px 35px rgba(61, 90, 69, 0.06);
}

/* 當卡片被 Hover 時，強迫裡面的 mark 標籤將背景漸層快速拉回 0 的位置，形成橫向刷過去的視覺震撼 */
.reflection-article:hover .reflection-body-text mark {
  background-position: 0 0;
  color: var(--dark); /* 劃完線後，重點字體悄悄變深，質感無敵 */
  font-weight: 700; /* 稍微加粗 */
}

/* ==========================================
   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. 響應式排版修正 (RWD)
   ========================================== */
@media (max-width: 992px) {
  /* 手機端解除上3下2，全部卡牌恢復一列滿版 */
  .card-3d,
  .work-grid .card-3d:nth-child(4),
  .work-grid .card-3d:nth-child(5) {
    flex: 1 1 100%;
    max-width: 100%;
    height: auto;
    min-height: auto;
  }

  /* 行動裝置無法 Hover，讓技術面板常態展開在下方，最安全 */
  .card-front {
    overflow: visible;
    position: relative;
    height: auto;
  }
  .card-back {
    position: relative;
    bottom: 0 !important;
    width: 100%;
    height: auto;
    border-radius: 0 0 1.5rem 1.5rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
  }
}

/* 💡 這裡精確補上：手機平板等窄螢幕下，首頁照片改為垂直置中排列，防止文字和照片打架 */
@media (max-width: 768px) {
  .hero-profile-container {
    flex-direction: column; /* 窄版螢幕下改為上下堆疊 */
    gap: 1.2rem;
  }
  .hero-subtitles {
    align-items: center; /* 手機版文字恢復置中對齊 */
    text-align: center;
  }
  .hero-subtitles h2 {
    text-align: center !important; /* 強制覆蓋靠左設定 */
  }
  .hero-avatar-box {
    width: 110px; /* 手機版頭像尺寸微縮 */
    height: 110px;
  }
  footer {
    padding: 3rem 1.5rem; /* 手機端縮減內襯 */
  }
  .footer-text p {
    letter-spacing: 0.04em; /* 手機端字距微調防爆開 */
  }
}

/* ==========================================
   頁尾區域 (深莫蘭迪綠 - 沉穩壓軸版)
   ========================================== */
footer {
  /* 💡 換上帶有灰調的文青深墨綠，給網頁一個完美的沉穩落地 */
  background: linear-gradient(135deg, #2d4233 0%, var(--primary) 100%);
  padding: 4.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* 💡 讓禾伸堂的 Logo 在深綠底色上呈現剔透白 */
.footer-logo .footer-logo-img {
  height: 30px;
  width: auto;
  /* 運用白化濾鏡，讓原本的標誌變成優雅的透白色 */
  filter: brightness(0) invert(1);
  opacity: 0.4;
  transition: var(--transition);
}

footer:hover .footer-logo .footer-logo-img {
  opacity: 0.8; /* 滑鼠滑入時優雅亮起 */
}

/* 💡 版權宣告文字微調 */
.footer-text p {
  font-family: "Inter", "Noto Serif TC", serif;
  font-size: 0.9rem;
  color: var(--accent); /* 🌟 改用淡淡的燕麥褐暖調文字，在深綠底色上質感炸裂 */
  letter-spacing: 0.1em; /* 大器放寬字距 */
  margin-bottom: 0;
  opacity: 0.85;
}
