/* === 全域變數 === */
:root {
  --brand-blue: #4A6F8C;   /* 主色 */
  --brand-dark: #333844;   /* 深色漸變 */
  --brand-light: #B3B3B3;  /* 淺灰 */
  --text-main: #333333;
  --bg-light: #f5f5f5;
}

/* === Reset & 基礎 === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Arial", sans-serif;
  line-height: 1.6;
  background-color: #ffffff;
  color: var(--text-main);
}

/* ✅ 只在 splash 狀態時禁止滾動 */
body.splash-active {
  overflow: hidden;
}

/* === Splash 開場頁 === */
.splash {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(to bottom, rgba(74,111,140,0.8), rgba(51,56,68,0.8)),
    url('images/splash-bg.jpg') center/cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  overflow: hidden;

  /* ✅ 淡出過渡（縮短為 0.5s） */
  opacity: 1;
  transition: opacity 0.5s ease;
}

/* ✅ 當加上 hide class 時，淡出 */
.splash.hide {
  opacity: 0;
  pointer-events: none;
}

/* ✅ Splash 內容居中 (Logo + 標語) */
.splash-content {
  position: relative;
  z-index: 2100;
  text-align: center;
  color: #ffffff;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 5px;
}

/* Logo 淡入縮放 */
.splash-logo {
  width: 600px;
  max-width: 90%;   /* ✅ 保證不會超出螢幕 */
  cursor: default;
  opacity: 0;
  transform: scale(0.7);
  animation: logoFadeIn 0.6s ease forwards;
}
@keyframes logoFadeIn {
  to { opacity: 1; transform: scale(1); }
}

/* ✅ Logo 消失動畫（縮短為 0.5s） */
.splash-logo.fade-out {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 標語 */
.splash-tagline {
  font-size: 2.2em;
  letter-spacing: 2px;
  line-height: 1.2;
  opacity: 0;
  animation: taglineFadeIn 0.6s ease 0.3s forwards;
}
@keyframes taglineFadeIn {
  to { opacity: 1; }
}

/* ✅ 標語淡出動畫 */
.splash-tagline.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}



/* === 主頁淡入動畫 === */
#mainContent {
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#mainContent.show {
  opacity: 1;
}

/* === 響應式縮放 === */
@media (max-width: 768px) {
  .splash-logo {
    width: 400px;
  }
  .splash-tagline {
    font-size: 1.8em;
  }
}

@media (max-width: 480px) {
  .splash-logo {
    width: 260px;
  }
  .splash-tagline {
    font-size: 1.5em;
    letter-spacing: 1px;
  }
}

/* === 通用容器 === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Header 導覽列 === */
header {
  background: var(--brand-blue);
  color: white;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  display: none;
  /* height: 50px;
  margin-right: 10px; */
}

.logo h2 {
  font-size: 1.2em;
  line-height: 1.2;
}

.logo span {
  font-size: 0.8em;
  color: var(--brand-light);
}

/* === 導航選單 === */
.navbar { position: relative; }
.nav-menu {
  list-style: none;
  display: flex;
  gap: 20px;
  z-index: 1000;
}
.nav-item { position: relative; }

.nav-item > a {
  position: relative;
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 10px 15px;
  display: block;
  transition: color 0.3s;
}

.nav-item > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #aaa;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}
.nav-item > a:hover::after { width: 100%; }

.nav-item > a.active { color: #ffd700; }
.nav-item > a.active::after {
  background: #ffd700;
  left: 0;
  transform: none;
  width: 100%;
}

/* 下拉選單 */
.dropdown {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #333;
  min-width: 180px;
  border-radius: 5px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1100;
}

.dropdown li a {
  position: relative;
  padding: 10px 15px;
  color: white;
  display: block;
  text-decoration: none;
  transition: color 0.3s;
}
.dropdown li a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: #aaa;
  transition: width 0.3s ease;
}
.dropdown li a:hover::after { width: 100%; }
.dropdown li a.active { color: #ffd700; }
.dropdown li a.active::after {
  width: 100%;
  background: #ffd700;
}

.nav-item:hover .dropdown,
.dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 1100;
}

/* === Hero 區塊 === */
.hero {
  position: relative;
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.25); /* 淺色淡化效果 */
  z-index: -1;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 20px;
  text-shadow: 1px 1px 6px rgba(0,0,0,0.6);
}

.hero-content h1 {
  font-size: 3.5em;   /* 原本 3em → 放大 */
  margin-bottom: 0.5em;
}

.hero-content p {
  font-size: 1.8em;   /* 原本 1.3em → 放大 */
}


/* === Services 區塊 === */
.services {
  display: grid;                         
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 30px;                             
  padding: 60px 40px;
  background: var(--bg-light);
}

.service {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
  padding: 30px 20px;
  min-height: 220px;                     
  display: flex;                         
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.service i {
  font-size: 2.5em;
  color: var(--brand-blue);
  margin-bottom: 15px;
  transition: color 0.3s ease;
}

.service h3 {
  margin-bottom: 10px; 
  font-size: 1.3em;
  font-weight: bold;
  color: #333;
  transition: color 0.3s ease;
}

.service p {
  font-size: 0.95em;
  color: #555;
  line-height: 1.5;
  transition: color 0.3s ease;
}

/* Hover 效果 */
.service:hover { 
  transform: translateY(-5px) scale(1.03); 
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  background: var(--brand-blue);
}

.service:hover i,
.service:hover h3,
.service:hover p {
  color: white;
}


/* === Service 詳細頁面 === */
.service-detail {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 60px;
}

.service-text {
  flex: 1;
}

.service-media {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.service-media img {
  width: 100%;          
  max-height: 300px;    
  object-fit: cover;    
  border-radius: 8px;   
  margin-top: 10px;     /* 與前一個元素保持間距 */
}


.service-detail h2 {
  font-size: 1.6em;
  margin-bottom: 15px;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-detail p {
  font-size: 1em;
  color: #444;
  line-height: 1.6;
  margin-bottom: 10px;
}

.service-detail ul {
  margin-left: 20px;
  list-style: disc;
  color: #333;
  line-height: 1.6;
}

.service-detail img, 
.service-detail video {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2em; }
  .hero p  { font-size: 1em; }
  .menu-toggle { display: block; }

  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--brand-blue);
  }
  .nav-menu.active { display: flex; }

  .nav-item   { width: 100%; }
  .nav-item > a {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  /* ✅ 手機下拉選單改為嵌入，不浮動 */
  .dropdown {
    position: relative;    /* 關鍵！跟著 li 展開 */
    top: 0;
    left: 0;
    width: 100%;
    background: var(--brand-blue);
    opacity: 1;
    transform: none;
    pointer-events: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .dropdown li a {
    padding-left: 30px;   /* 縮排，顯示層級 */
    border-top: 1px solid rgba(255,255,255,0.2);
  }
}


/* === About Page === */
.about-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;   /* ✅ 修改後，上下沒有 padding */
}

.about-section {
  margin-bottom: 60px;
}

.about-section h2 {
  font-size: 1.6em;
  color: var(--brand-blue);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-section p, 
.about-section ul {
  font-size: 1em;
  color: #444;
  line-height: 1.8;
}

.about-section ul {
  list-style: disc;
  margin-left: 25px;
}

.about-section img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.certificates {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.certificates img {
  max-width: 200px;
  border-radius: 8px;
}


/* === 響應式調整 === */
.menu-toggle { display: none; font-size: 1.8em; cursor: pointer; color: white; }
@media (max-width: 768px) {
  .hero h1 { font-size: 2em; }
  .hero p  { font-size: 1em; }
  .menu-toggle { display: block; }
  .nav-menu   { display: none; flex-direction: column; width: 100%; background: var(--brand-blue); }
  .nav-menu.active { display: flex; }
  .nav-item   { width: 100%; }
  .nav-item > a { padding: 15px; border-top: 1px solid rgba(255,255,255,0.2); }
  .dropdown   { position: static; width: 100%; }
}
@media (max-width: 480px) {
  .page-title { font-size: 1.8em; }
  .container  { padding: 0 10px; }
  .service-detail img, .service-detail video { margin-top: 10px; border-radius: 5px; }
}

/* === Sticky Footer === */
html, body {
  height: 100%;              
  display: flex;
  flex-direction: column;
}

#mainContent {
  flex: 1;                   
}

footer {
  background: var(--brand-blue);
  color: white;
  text-align: center;
  padding: 15px 10px;
  font-size: 0.9em;
  width: 100%;
  margin-top: auto;          
}

/* === 統一 Page Title 樣式 === */
.page-title {
  font-size: 2em;
  font-weight: bold;
  color: transparent;
  margin: 40px auto;        /* 與 container 對齊，留出上下間距 */
  text-align: center;       /* ✅ 統一置中，保持一致感 */
}

/* === Page Layout 統一寬度 === */
.service-page,
.about-page,
.contact-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;   /* ✅ 上下無 padding，左右 20px */
}

/* === Contact Page === */
.contact-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.contact-info {
  flex: 1;
  font-size: 1em;
  line-height: 1.8;
}

.contact-form label {
  margin-top: 10px;
  font-weight: bold;
}

.contact-form {
  width: 100%;
  max-width: 450px;   /*  限制表單寬度 */
  margin: 0 auto;     /*  表單置中 */
}

.contact-form label {
  margin-top: 10px;
  margin-bottom: 5px; /*  增加間距 */
  font-weight: bold;
  display: block;
}

.contact-form input,
.contact-form textarea {
  width: 100%;        /*  統一寬度 */
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
  margin-bottom: 15px; /*  與下一個欄位保持距離 */
}

.contact-form button {
  width: 100%;        /*  改為滿寬按鈕 */
  background: var(--brand-blue);
  color: white;
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.contact-form button:hover {
  background: #365269;
  transform: scale(1.02);  /* ✅ hover 有微動畫 */
}


@media (max-width: 768px) {
  .contact-wrapper {
    flex-direction: column;
  }
}

/* 上方 Banner */
.contact-banner img {
  width: 100%;
  display: block;
}

/* 公司資訊 Grid */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin: 40px 0;
}
.contact-block {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.contact-block h3 {
  color: var(--brand-blue);
  margin-bottom: 10px;
}
.contact-block p {
  margin: 5px 0;
  color: #444;
}

/* QR Code */
.contact-qr {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 40px 0;
}
.contact-qr div {
  text-align: center;
}
.contact-qr img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 10px;
}
/* 聯絡人資訊 */
.contact-persons {
  margin: 60px auto;
}
.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin-top: 20px;
}
.person-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  line-height: 1.6;
}
.person-card h3 {
  color: var(--brand-blue);
  margin-bottom: 10px;
}
.person-card p {
  margin: 5px 0;
  color: #444;
}

/* 單一辦公室卡片樣式 */
.contact-block.single-office {
  max-width: 800px;
  margin: 0 auto 40px auto;
  background: #f9f9f9;           /* 淺灰底 */
  padding: 30px 25px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* 陰影 */
  text-align: left;
}

.contact-block.single-office h3 {
  color: var(--brand-blue);
  margin-bottom: 10px;
}

.contact-block.single-office p {
  margin: 8px 0;
  color: #444;
  line-height: 1.6;
}
