:root {
  /* 主要色彩 */
  --primary-color: #008080;
  --primary-light: #00a0a0;
  
  /* 文字色彩 */
  --dark-text: #333;
  --light-text: #666;
  
  /* 背景色彩 */
  --bg-light-gray: #f4f7f6;
  --bg-white: #fff;
  --bg-gray: #e9ecef;
  
  /* 邊框和間距 */
  --border-color: #e0e0e0;
  --border-radius: 8px;
  --border-radius-large: 25px;
  
  /* 字型 */
  --base-font-size: 1rem;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* 陰影 */
  --shadow-light: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  
  /* 轉場動畫 */
  --transition-fast: 0.3s ease;
  --transition-smooth: 0.3s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 優化渲染效能 - 為動畫元素設定 will-change */
.nav-toggle,
.hamburger,
.hamburger::before,
.hamburger::after,
.main-nav {
  will-change: transform;
}

/* 為按鈕 hover 效果優化 */
.btn {
  will-change: background-color;
}

/* 優化圖片載入效能 */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

body {
  font-family: var(--font-family);
  color: var(--dark-text);
  line-height: 1.6;
}

.logo img {
  width: 200px;
  height: auto;
}

/* 手機選單打開時禁止背景滾動 */
body.nav-open {
  overflow: hidden;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 0;
}

h1,
h2,
h3 {
  margin-bottom: 1rem;
  line-height: 1.3;
}

h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 2.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--light-text);
}

.btn {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color var(--transition-fast);
}

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

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

.btn-secondary {
  background-color: var(--bg-white);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: #f8f8f8;
}

.img-placeholder {
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 圖片尺寸設定 */
.problem-card .img-placeholder img {
  aspect-ratio: 3/2;
}

.feature-item .icon-placeholder img {
  aspect-ratio: 1/1;
}

/* Hero 圖片樣式 */
.img-placeholder-wrapper .img-placeholder {
  border-radius: 0;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder-wrapper .img-placeholder img {
  object-fit: contain;
  object-position: center;
  width: 100%;
  height: 100%;
}

/* 頁首 */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 1100px;
  margin: 10px auto 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  z-index: 1001;
}

/* 手機版導航 */
.is-resizing .main-nav {
  transition: none;
}

.main-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  height: 100%;
  background-color: var(--bg-white);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
}

.main-nav.is-active {
  transform: translateX(0);
}

.main-nav > a {
  color: var(--dark-text);
  text-decoration: none;
  font-size: 1.2rem;
  margin: 1rem 0;
}

.main-nav .nav-buttons {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 漢堡選單按鈕 */
.nav-toggle {
  display: block;
  position: relative;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  margin-right: 10px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  background-color: var(--dark-text);
  height: 3px;
  width: 100%;
  border-radius: 2px;
  position: absolute;
  transition: all var(--transition-smooth);
}

.hamburger {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger::before {
  top: -10px;
}

.hamburger::after {
  bottom: -10px;
}

/* 漢堡按鈕 "X" 變形 */
.nav-toggle.is-active .hamburger {
  background-color: transparent;
}

.nav-toggle.is-active .hamburger::before {
  transform: translateY(10px) rotate(45deg);
}

.nav-toggle.is-active .hamburger::after {
  transform: translateY(-10px) rotate(-45deg);
}

.hero {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 500px;
  margin: 0 auto;
}

.img-placeholder-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 手機版樣式調整 */
@media (max-width: 430px) {
  :root {
    --base-font-size: 0.8rem;
  }

  /* Hero 區域調整 */
  .hero .container {
    display: grid;
  }

  .hero-content {
    max-width: 100%;
    padding: 2rem 0;
    text-align: center;
  }

  .hero h1 {
    font-size: 30px;
  }

  .img-placeholder-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    margin-top: 2rem;
    grid-row: 1/2;
  }

  .img-placeholder-wrapper .img-placeholder {
    height: 300px;
    min-height: 300px;
  }

  /* Problems 區域調整 */
  .problems .grid-container {
    width: 80%;
    margin: 0 auto;
  }

  .problems .container h2 {
    font-size: 20px;
  }

  .problem-card p {
    font-size: 16px;
  }

  /* Features 區域調整 */
  .features .container h2 {
    font-size: 20px;
  }

  .feature-item p {
    font-size: 12px;
  }

  /* Info sections 調整 */
  .info-section-stacked .text-content h2,
  .info-section-sided .text-content h2 {
    font-size: 20px;
  }

  .info-section-stacked .text-content p,
  .info-section-sided .text-content p {
    font-size: 12px;
  }
}

.hero-content p {
  font-size: calc(var(--base-font-size) * 1.1);
  color: var(--light-text);
}

.hero-content-list p {
  font-size: calc(var(--base-font-size) * 0.75);
  color: var(--light-text);
}

.hero h1 {
  font-size: calc(var(--base-font-size) * 2.0);
}

.buttons {
  display: flex;
  flex-direction: column;
  width: 80%;
  gap: 30px;
  margin: 0 auto 30px auto;
}

.problems .grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.problem-card {
  background-color: var(--bg-gray);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-large);
  padding: 1.5rem;
  text-align: center;
}

.problem-card p {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--dark-text);
}

.problem-card h3 {
  font-size: 1.2rem;
  color: var(--dark-text);
}

.problem-card .img-placeholder {
  margin-top: 1rem;
}

.features {
  background-color: var(--bg-white);
}

.features .grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.feature-item {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: center;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
}

.feature-item .icon-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feature-item h3 {
  margin-bottom: 16px;
}

.info-section-stacked {
  text-align: center;
}

.info-section-stacked .text-content {
  margin-bottom: 2rem;
}

.info-section-sided .grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.info-section-sided .text-content {
  text-align: center;
}

.grid-container .text-content h2 {
  text-align: center;
}

.grid-container .text-content p {
  text-align: center;
}

.info-section-sided.bg-white {
  background-color: var(--bg-white);
}

.info-section-sided.bg-gray {
  background-color: var(--bg-light-gray);
}

/* 頁尾 */
.main-footer {
  background-color: var(--bg-white);
  color: var(--dark-text);
}

.main-footer .container {
  padding-top: 40px;
  padding-bottom: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 30px;
}

.footer-col hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin-bottom: 1rem;
}

.footer-col h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.footer-col p,
.footer-col a {
  color: var(--light-text);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--primary-color);
}

.footer-copyright {
  text-align: center;
  padding: 20px 0;
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}


/* 桌面版樣式 */
@media (min-width: 768px) {
  :root {
    --base-font-size: 1.2rem;
  }

  /* 容器和基本樣式 */
  .container {
    padding: 60px 0;
  }

  h2 {
    font-size: 2.0rem;
  }

  /* 導航欄調整 */
  .main-nav {
    position: static;
    width: auto;
    height: auto;
    background-color: transparent;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    transform: none;
    transition: none;
    gap: 20px;
  }

  .main-nav a {
    margin: 0;
    font-size: 1rem;
  }

  .main-nav .nav-buttons {
    margin: 5px 0 5px 20px;
    flex-direction: row;
    gap: 10px;
  }

  .nav-toggle {
    display: none;
  }

  /* Hero 區域調整 */
  .hero {
    text-align: left;
  }

  .hero .container {
    position: relative;
    display: grid;
    grid-template-columns: 460px 640px;
    align-items: stretch;
    gap: 0;
    justify-content: center;
  }

  .img-placeholder-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-content {
    min-width: 490px;
    margin: 0;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2rem 2rem 0;
  }

  .hero .buttons {
    margin: 20px 0 0 0;
    display: block;
  }

  .hero .buttons .btn {
    margin: 5px;
  }

  /* Problems 區域調整 */
  .problems .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .problem-card {
    display: flex;
    flex-direction: column;
    text-align: left;
  }

  .problem-card .img-placeholder {
    flex-grow: 1;
  }

  /* Features 區域調整 */
  .feature-item .icon-placeholder {
    width: 100px;
    height: auto;
  }

  /* Info sections 調整 */
  .info-section-sided.reverse .grid-container .text-content {
    order: 2;
  }

  .info-section-sided.reverse .grid-container .img-placeholder {
    order: 1;
  }

  /* Footer 調整 */
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* 中等螢幕調整 */
@media (max-width: 1100px) {
  .main-header {
    margin-left: 10px;
    margin-right: 10px;
  }
}