/* style.css - 響應式現代化輪播與頁面樣式 */

/* === 全局重置與防溢出 === */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  padding-top: 60px; /* 避開頂部固定導覽列 */
  background-color: #0b0f19; /* 深色科技底色 */
  color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
  overflow-x: hidden;
}

/* === Hero 頁首區域 === */
.hero-section {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: radial-gradient(circle at center, #1a2236 0%, #0b0f19 100%);
  color: #ffffff;
  padding: 40px 20px;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 3.5vw, 1.8rem);
  font-weight: 300;
  color: #94a3b8;
  max-width: 800px;
}

/* === 服務項目區塊 === */
.services-main {
  width: 100%;
  overflow-x: hidden;
  padding-bottom: 60px;
}

.feature-section {
  padding: 60px 16px;
  text-align: center;
  background: transparent;
  position: relative;
}

.feature-section:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.section-header {
  margin-bottom: 35px;
  padding: 0 10px;
}

.section-header h2 {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #f8fafc;
  letter-spacing: 1px;
}

.section-header p {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: #94a3b8;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 區塊滑入效果 (預設可見，避免白畫面) */
.section {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   響應式立體置中焦點輪播 (CoverFlow Center Mode Carousel)
   ========================================== */
.carousel-container {
  position: relative;
  max-width: 1350px;
  margin: 0 auto;
  width: 100%;
  padding: 0 45px;
  user-select: none;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: 18px;
  padding: 35px 0; /* 為中間卡片的放大與發光留出空間，避免被裁切 */
}

.carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* 瞬間重置位置專用：全面關閉軌道與所有卡片的動畫，避免瞬移時產生縮放與亮度跳閃 */
.carousel-track.no-transition,
.carousel-track.no-transition .slide,
.carousel-track.no-transition .slide img,
.carousel-track.no-transition .slide-overlay {
  transition: none !important;
}

/* 卡片與投影片設定 (兩側縮小、中間置中突出) */
.slide {
  flex: 0 0 420px; /* 桌面預設寬度 */
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #141b2d;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
  transform: scale(0.88);
  opacity: 0.45;
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* 正中間焦點卡片 (立體放大 + 霓虹光暈) */
.slide.active {
  transform: scale(1.08);
  opacity: 1;
  z-index: 10;
  border-color: rgba(0, 210, 255, 0.7);
  box-shadow: 0 12px 40px rgba(0, 210, 255, 0.35), 0 0 25px rgba(0, 210, 255, 0.25);
}

.slide:hover:not(.active) {
  opacity: 0.8;
  transform: scale(0.92);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.slide.active img {
  transform: scale(1.02);
}

/* 預覽卡片自定義覆蓋標籤 */
.slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px 18px 15px 18px;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.6) 60%, transparent 100%);
  color: #fff;
  text-align: left;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.slide-overlay h3 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #00d2ff;
  letter-spacing: 0.5px;
}

.slide-overlay p {
  margin: 0;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.4;
}

/* 輪播切換按鈕 (玻璃擬態風) */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(20, 27, 45, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #00d2ff;
  font-size: 18px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.carousel-btn:hover {
  background: #00d2ff;
  color: #0b0f19;
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.7);
}

.prev-btn {
  left: 0px;
}

.next-btn {
  right: 0px;
}

/* 輪播導航指示點 (Dots) */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.carousel-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.35s ease;
}

.carousel-dots .dot:hover {
  background: rgba(0, 210, 255, 0.6);
}

.carousel-dots .dot.active {
  width: 28px;
  background: #00d2ff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.8);
}

/* ==========================================
   RWD 響應式斷點 (平板與手機適配)
   ========================================== */

/* 平板尺寸 (768px ~ 1023px) */
@media screen and (max-width: 1023px) {
  .carousel-container {
    padding: 0 35px;
  }
  
  .slide {
    flex: 0 0 340px;
    transform: scale(0.9);
  }

  .slide.active {
    transform: scale(1.05);
  }
}

/* 手機尺寸 (小於 768px)：全螢幕大卡片置中，兩側露出邊緣 */
@media screen and (max-width: 767px) {
  body {
    padding-top: 60px;
  }

  .feature-section {
    padding: 35px 8px;
  }

  .carousel-container {
    padding: 0 5px;
  }

  .carousel-viewport {
    padding: 20px 0;
  }

  .carousel-track {
    gap: 14px;
  }

  /* 手機版：每張卡片佔 78vw，置中後左右各露出約 10% 前後卡片，手感極佳 */
  .slide {
    flex: 0 0 78vw;
    aspect-ratio: 16 / 10;
    opacity: 0.5;
    transform: scale(0.92);
  }

  .slide.active {
    opacity: 1;
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.35);
  }

  /* 手機版導航按鈕縮小並維持半透明 */
  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
    opacity: 0.85;
  }

  .prev-btn {
    left: 2px;
  }

  .next-btn {
    right: 2px;
  }
}

/* ==========================================
   圖片放大燈箱模態框 (Lightbox Modal)
   ========================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
}

.lightbox-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 35px;
  color: #fff;
  font-size: 38px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  line-height: 1;
  z-index: 10001;
}

.lightbox-close:hover {
  color: #00d2ff;
  transform: scale(1.15) rotate(90deg);
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 210, 255, 0.3);
  transform: scale(0.9);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-modal.show .lightbox-img {
  transform: scale(1);
}

.lightbox-caption {
  margin-top: 15px;
  color: #cbd5e1;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  text-align: center;
}

/* === 頁尾樣式 === */
.site-footer {
  text-align: center;
  padding: 30px 20px;
  color: #64748b;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}





