/* 全局樣式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
}

/* 導航欄樣式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
}

.lang-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.lang-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.lang-btn:hover {
  border-color: var(--primary-color);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

/* Hero 區域 */
.hero {
  margin-top: 70px;
  height: calc(100vh - 70px);
  min-height: 500px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path d="M0,300 Q300,100 600,300 T1200,300 L1200,600 L0,600 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: cover;
  opacity: 0.3;
}

.hero-content {
  max-width: 800px;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  animation: fadeInUp 0.8s ease 0.2s backwards;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: white;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease 0.4s backwards;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  /* background: transparent; */
  /* color: white; */
  cursor: pointer;
  border: 2px solid white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

.product-card .btn,
.product-card .btn-outline {
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

/* 內容區域通用樣式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 3rem;
}

/* 產品網格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.product-image::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

.product-info {
  padding: 1.5rem;
}

.product-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.product-description {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.product-price {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 1rem;
}

/* 關於我們區域 */
.about-section {
  background: var(--bg-light);
}

.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.about-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
}

.about-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.about-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.about-card p {
  color: var(--text-light);
  line-height: 1.8;
}

.icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* 產品詳情頁 */
.product-detail {
  margin-top: 90px;
  padding: 2rem 0;
}

.product-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.product-detail-image {
  width: 100%;
  height: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 5rem;
  box-shadow: var(--shadow-lg);
}

.product-detail-info h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.product-detail-info .price {
  font-size: 2rem;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.product-detail-info .description {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.product-specs {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.product-specs h3 {
  margin-bottom: 1rem;
  color: var(--text-color);
}

.specs-list {
  list-style: none;
}

.specs-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

.specs-list li:last-child {
  border-bottom: none;
}

.spec-label {
  font-weight: 600;
  color: var(--text-color);
}

.spec-value {
  color: var(--text-light);
}

.action-buttons {
  display: flex;
  gap: 1rem;
}

/* 頁腳 */
.footer {
  background: var(--text-color);
  color: white;
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: white;
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* 動畫 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* 響應式設計 */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: white;
    flex-direction: column;
    padding: 2rem;
    transition: left 0.3s ease;
    box-shadow: var(--shadow);
  }

  .nav-menu.active {
    left: 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-detail-container {
    grid-template-columns: 1fr;
  }

  .product-detail-image {
    height: 300px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 1rem;
  }

  .container {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .product-detail-info h1 {
    font-size: 1.8rem;
  }
}

/* 加載動畫 */
.fade-in {
  animation: fadeInUp 0.6s ease;
}

/* 返回頂部按鈕 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
}

/* 輪播Banner樣式 */
.banner-slider {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  max-height: 700px;
  overflow: hidden;
  padding-top: 72px;
  box-sizing: border-box;
}

.banner-slide {
  position: absolute;
  top: 72px;
  left: 0;
  width: 100%;
  height: calc(100% - 72px);
  opacity: 0;
  transition: opacity 1s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-slide.active {
  opacity: 1;
  z-index: 1;
}

.banner-slide-1 {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9) 0%, rgba(30, 64, 175, 0.9) 100%),
              url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path d="M0,300 Q300,100 600,300 T1200,300 L1200,600 L0,600 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: cover;
  background-position: center;
}

.banner-slide-2 {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%),
              url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><circle cx="200" cy="200" r="100" fill="rgba(255,255,255,0.1)"/><circle cx="800" cy="400" r="150" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: cover;
  background-position: center;
}

.banner-slide-3 {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%),
              url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect x="0" y="0" width="1200" height="600" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="2"/><line x1="0" y1="0" x2="1200" y2="600" stroke="rgba(255,255,255,0.1)" stroke-width="2"/></svg>');
  background-size: cover;
  background-position: center;
}

.banner-content {
  max-width: 1200px;
  padding: 2rem;
  text-align: center;
  color: white;
  z-index: 2;
}

.banner-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: slideInDown 0.8s ease;
}

.banner-content p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.8s ease 0.2s backwards;
}

.banner-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.4s backwards;
}

/* 輪播導航點 */
.banner-dots {
  position: absolute;
  bottom: .5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  z-index: 3;
}

.banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.banner-dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
  border-color: white;
}

.banner-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* 輪播箭頭 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(204, 204, 204, 0.8);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 3;
  font-size: 1.5rem;
  line-height: 1.5rem;
  user-select: none;
}

.banner-arrow:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--primary-color);
}

.banner-arrow-left {
  left: 2rem;
}

.banner-arrow-right {
  right: 2rem;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 新聞資訊樣式 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.news-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.news-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.news-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.news-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-title {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-light);
}

.news-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-read-more {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.news-read-more:hover {
  text-decoration: underline;
}

/* 新聞詳情頁樣式 */
.news-detail {
  margin-top: 90px;
  padding: 2rem 0;
}

.news-detail-header {
  max-width: 900px;
  margin: 0 auto 3rem;
  text-align: center;
}

.news-detail-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  line-height: 1.3;
}

.news-detail-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 0.95rem;
}

.news-detail-content {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.news-detail-image {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 5rem;
  margin-bottom: 2rem;
}

.news-detail-content p {
  color: var(--text-color);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.news-detail-content h2 {
  color: var(--text-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.news-detail-content h3 {
  color: var(--text-color);
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
}

.news-detail-content ul,
.news-detail-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  line-height: 1.8;
  color: var(--text-color);
}

.news-detail-content li {
  margin-bottom: 0.5rem;
}

/* 響應式：輪播和新聞 */
@media (max-width: 768px) {
  .banner-slider {
    min-height: 400px;
  }

  .banner-content h1 {
    font-size: 2rem;
  }

  .banner-content p {
    font-size: 1rem;
  }

  .banner-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .banner-arrow-left {
    left: 1rem;
  }

  .banner-arrow-right {
    right: 1rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-detail-title {
    font-size: 1.8rem;
  }

  .news-detail-content {
    padding: 2rem 1.5rem;
  }

  .news-detail-image {
    height: 250px;
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .banner-content h1 {
    font-size: 1.5rem;
  }

  .banner-content p {
    font-size: 0.9rem;
  }

  .banner-buttons {
    flex-direction: column;
  }

  .banner-arrow {
    width: 35px;
    height: 35px;
  }
}


/* 修復圖片顯示被切割問題 */
img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* 修復商品和新聞圖片顯示 */
.product-image,
.news-image,
.product-card-image,
.news-card-image {
  background-size: auto 100%;
  background-position: center;
  background-repeat: no-repeat;
}
