:root {
  --primary-color: #2196f3;
  --primary-color-rgb: 33, 150, 243;
  --secondary-color: #1a237e;
  --accent-color: #00bcd4;
  --background-color: #fafafa;
  --text-color: #212121;
  --card-bg-color: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none;
}

html {
  scroll-behavior: smooth;
}

.logo {
  display: flex;
  align-items: center;
  /* 確保 LOGO 和文字垂直對齊 */
  gap: 5px;
  /* LOGO 與文字間距 */
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
  text-decoration: none;
}

.logo img {
  height: 60px;
  /* 控制 LOGO 大小 */
  width: 60px;
}

body {
  font-family: 'Microsoft JhengHei', 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  overflow-x: hidden;
}


.cursor {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.2s ease;
  box-shadow: 2px 2px 5px #00000060;
}

.cursor-follower {
  width: 40px;
  height: 40px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.2s ease;
  box-shadow: 2px 2px 5px #00000060;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}


/* 導航欄樣式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.navbar.scroll-down {
  transform: translateY(-100%);
}

.navbar.scroll-up {
  transform: translateY(0);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.logo:hover::after {
  width: 100%;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-link {
  margin-left: 2rem;
  text-decoration: none;
  color: var(--text-color);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::before,
.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link::before {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.nav-link::after {
  right: 50%;
  bottom: 0;
  transform: translateX(50%);
}

.nav-link:hover::before,
.nav-link:hover::after {
  width: 100%;
}

/* 英雄區域樣式 */
.hero {
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.hero-slider {
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: space-around;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
}

.slide.active {
  opacity: 1;
}

.slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  padding: 2rem;
}

.slide-part {
  display: block;
}

.btn-part {
  display: block;
  position: absolute;
  z-index: 3;
  top: 60%;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: white;
  color: var(--primary-color);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-secondary:hover {
  background: white;
  color: var(--primary-color);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.tech-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveLines 20s linear infinite;
}

/* news */
.news-container {
  max-width: 100%;
  background-color: #ffffff60;
  margin: 0 auto;
  padding: 20px 0 0 24px;
  text-align: center;
}

.news-title {
  font-size: 32px;
  margin-bottom: 10px;
  font-weight: bold;
}

.news-subtitle {
  color: #666;
  margin-bottom: 40px;
}

.news-wrapper {
  max-width: 100%;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.news-track {
  max-width: 100%;
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 24px;
  padding: 20px 0;
}
.news-slide {
  flex: 0 0 400px;
  min-width: 400px;
  aspect-ratio: 1;
  background: #f5f5f7;
  border-radius: 16px;
  overflow: hidden;
  transform: translateZ(0);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.news-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.news-slide:hover img {
  transform: scale(1.05);
}

.news-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.news-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.news-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.news-prev {
  left: 10px;
}

.news-next {
  right: 10px;
}

/* 最新登場 */

.latest-products-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

.latest-products-title {
  font-size: 32px;
  margin-bottom: 10px;
  font-weight: bold;
}

.latest-products-subtitle {
  color: #666;
  margin-bottom: 40px;
}

.latest-products-wrapper {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  padding: 0 40px;
}

.latest-products-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 24px;
  padding: 20px 0;
}

.latest-products-slide {
  flex: 0 0 calc(33.333% - 16px);
  min-width: calc(33.333% - 16px);
  aspect-ratio: 1;
  background: #f5f5f7;
  border-radius: 16px;
  overflow: hidden;
  transform: translateZ(0);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.latest-products-slide:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.latest-products-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.latest-products-slide:hover img {
  transform: scale(1.05);
}

.latest-products-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.latest-products-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.latest-products-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.latest-products-prev {
  left: 0;
}

.latest-products-next {
  right: 0;
}


/* 產品區域樣式 */
.products {
  padding: 6rem 0;
  background: var(--background-color);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: attr(data-text);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-color);
  opacity: 0.1;
  font-size: 4rem;
  white-space: nowrap;
  z-index: -1;
}

.category-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.filter-item.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.filter-icon {
  font-size: 1.2rem;
}

.filter-text {
  font-weight: 500;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.product-card {
  perspective: 1000px;
  height: 400px;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.5s ease;
}

.product-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.card-front {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

.card-back {
  background: var(--primary-color);
  color: white;
  transform: rotateY(180deg);
}

.card-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.icon-wrapper {
  width: 100px;
  height: 100px;
  background: rgba(var(--primary-color-rgb), 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.icon-wrapper::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: linear-gradient(45deg,
      transparent,
      rgba(var(--primary-color-rgb), 0.3),
      transparent);
  transform: translateX(-100%);
  animation: shine 3s infinite;
}

.icon {
  font-size: 3rem;
  color: var(--primary-color);
  transition: transform 0.3s ease;
}

.product-card:hover .icon {
  transform: scale(1.1);
}

.tech-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tech-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.tech-dots span:nth-child(2) {
  animation-delay: 0.5s;
}

.tech-dots span:nth-child(3) {
  animation-delay: 1s;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
}

.feature-list li {
  margin: 0.8rem 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.card-action {
  margin-top: 2rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

/* 合作夥伴區域樣式 */
.partners {
  background: linear-gradient(to bottom, var(--background-color), #f5f5f5);
  padding: 5rem 0;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

.partner-card {
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2),
    -5px -5px 10px rgba(255, 255, 255, 0.8);
  /* 立體陰影 */
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

.partner-card:hover {
  transform: translateY(-5px);
  box-shadow: 8px 8px 15px rgba(0, 0, 0, 0.3),
    -8px -8px 15px rgba(255, 255, 255, 0.9);
}


.partner-card h3 {
  font-weight: bold;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}


.partner-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.partner-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.partner-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-logo img {
  width: 120px;
  /* 控制圖片大小 */
  height: 120px;
  /* 保持正方形比例 */
  border-radius: 50%;
  /* 讓圖片變圓形 */
  object-fit: cover;
  /* 確保圖片填滿整個圓形 */
  border: 4px solid #ffffff;
  /* 可選：添加白色邊框 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  /* 可選：添加陰影效果 */
}


.partner-card:hover .partner-logo img {
  filter: grayscale(0%);
}

.partner-link {
  text-decoration: none;
  /* 移除超連結底線 */
  color: inherit;
  /* 讓顏色保持一致 */
  display: block;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}



/* 聯絡我們區域樣式 */
.contact {
  position: relative;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: white;
  padding: 5rem 0;
  overflow: hidden;
}

.contact-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.1;
}

.contact-content {
  position: relative;
  z-index: 1;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.contact-item {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  /* 移除底線 */
  color: inherit;
  /* 讓字體顏色保持與原本設計一致 */
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-5px);
}

.contact-item i {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.contact-item h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.contact-item p {
  color: rgba(255, 255, 255, 0.8);
}

.contact-cta {
  text-align: center;
  margin-top: 4rem;
}

.contact-cta p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.footer {
  position: relative;
  /* 讓 footer 自然跟著內容排列，而非固定在視窗 */
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: white;
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
}

/* 返回頂部按鈕 */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--secondary-color);
  transform: translateY(-5px);
}

/* 動畫效果 */
@keyframes shine {
  0% {
    transform: translateX(-100%);
  }

  20%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes moveLines {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 50px 50px;
  }
}

@keyframes float {

  0%,
  100% {
    background-position: 50px 50px;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-2px, 2px);
  }

  40% {
    transform: translate(-2px, -2px);
  }

  60% {
    transform: translate(2px, 2px);
  }

  80% {
    transform: translate(2px, -2px);
  }

  100% {
    transform: translate(0);
  }
}

/* 響應式設計 */
@media screen and (max-width: 768px) {
  .nav-links {
    display: flex !important;
    /* 讓導覽列始終顯示 */
    flex-wrap: wrap;
    /* 允許內容自動換行 */
    justify-content: center;
    /* 置中排列 */
    gap: 10px;
    /* 調整間距 */
    padding: 10px 0;
  }

  .nav-link {
    font-size: 14px;
    /* 調整字體大小 */
    padding: 5px 10px;
    /* 增加點擊範圍 */
  }

  .burger {
    display: none !important;
    /* 隱藏漢堡選單 */
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .category-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-item {
    justify-content: center;
  }

  .partner-card {
    margin: 1rem;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }

  .contact-item {
    margin: 1rem;
  }

  .latest-products-slide {
    flex: 0 0 calc(50% - 12px);
    min-width: calc(50% - 12px);
  }

  .latest-products-wrapper {
    padding: 0 20px;
  }

  .latest-products-nav {
    width: 40px;
    height: 40px;
  }
}

@media screen and (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  .latest-products-slide {
    flex: 0 0 100%;
    min-width: 100%;
  }

  .product-card {
    height: 350px;
  }

  .icon-wrapper {
    width: 80px;
    height: 80px;
  }

  .icon {
    font-size: 2.5rem;
  }

  .news-slide {
    flex: 0 0 calc(100% - 24px);
    min-width: calc(100% - 24px);
  }
}