/*
 * 渙潮科技有限公司 - 響應式設計
 * 採用移動優先策略
 */

/* ==========================================
   超大螢幕 (1440px+)
   ========================================== */
@media (min-width: 1440px) {
  :root {
    --text-base: 1.125rem;
    --text-6xl: 4.5rem;
  }

  .container {
    max-width: 1440px;
  }

  .hero-title {
    font-size: 5rem;
  }
}

/* ==========================================
   大螢幕 (1024px - 1439px)
   ========================================== */
@media (min-width: 1024px) and (max-width: 1439px) {
  .hero-title {
    font-size: var(--text-6xl);
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================
   平板橫向 (768px - 1023px)
   ========================================== */
@media (max-width: 1023px) {
  :root {
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
  }

  /* 導航欄調整 */
  .navbar-nav {
    gap: var(--spacing-sm);
  }

  .navbar-nav a {
    font-size: var(--text-sm);
    padding: var(--spacing-xs);
  }

  /* Hero 區域 */
  .hero-title {
    font-size: var(--text-5xl);
  }

  .hero-subtitle {
    font-size: var(--text-xl);
  }

  .hero-description {
    font-size: var(--text-base);
  }

  /* 服務卡片 */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* 技術區塊 */
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 按鈕 */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: var(--text-sm);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================
   平板直向與大手機 (480px - 767px)
   ========================================== */
@media (max-width: 767px) {
  :root {
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
    --spacing-2xl: 3rem;
    --text-6xl: 2.5rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
  }

  /* 通用間距 */
  section {
    padding: var(--spacing-xl) 0;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  /* 導航欄 */
  .navbar {
    padding: var(--spacing-xs) 0;
  }

  .navbar .container {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .navbar-brand {
    font-size: var(--text-lg);
  }

  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-xs);
  }

  .navbar-nav a {
    font-size: 0.8rem;
  }

  /* Hero 區域 */
  .hero-section {
    min-height: 80vh;
    padding: var(--spacing-xl) 0;
  }

  .hero-content {
    padding: var(--spacing-md);
  }

  .hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
    margin-bottom: var(--spacing-sm);
  }

  .hero-description {
    font-size: var(--text-sm);
    margin-bottom: var(--spacing-md);
  }

  .hero-cta {
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* 區塊標題 */
  .section-title h2 {
    font-size: var(--text-3xl);
  }

  .section-title p {
    font-size: var(--text-base);
  }

  /* 服務卡片 */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .service-card {
    padding: var(--spacing-md);
  }

  .service-icon {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }

  .service-card h3 {
    font-size: var(--text-xl);
  }

  .service-card p {
    font-size: var(--text-sm);
  }

  /* 技術區塊 */
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .tech-item {
    padding: var(--spacing-md);
  }

  .tech-number {
    font-size: var(--text-3xl);
  }

  .tech-label {
    font-size: var(--text-base);
  }

  /* CTA 區塊 */
  .cta-section {
    padding: var(--spacing-xl) var(--spacing-md);
    margin: var(--spacing-lg) var(--spacing-sm);
  }

  .cta-section h2 {
    font-size: var(--text-3xl);
  }

  .cta-section p {
    font-size: var(--text-base);
  }

  /* 按鈕 */
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: var(--text-sm);
  }

  /* Footer */
  .footer {
    padding: var(--spacing-lg) 0 var(--spacing-sm);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    text-align: center;
  }

  .footer-section h4 {
    font-size: var(--text-base);
  }

  .footer-section p,
  .footer-section a {
    font-size: 0.8rem;
  }
}

/* ==========================================
   小手機 (< 480px)
   ========================================== */
@media (max-width: 479px) {
  :root {
    --text-base: 0.9rem;
    --text-6xl: 2rem;
    --text-5xl: 1.75rem;
    --text-4xl: 1.5rem;
    --text-3xl: 1.25rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
  }

  /* Hero */
  .hero-title {
    font-size: 2rem;
    letter-spacing: -0.02em;
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .hero-description {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  /* 導航欄 */
  .navbar-brand {
    font-size: var(--text-base);
  }

  .navbar-nav {
    font-size: 0.75rem;
  }

  .lang-switch {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  /* 區塊標題 */
  .section-title h2 {
    font-size: var(--text-2xl);
  }

  .section-title p {
    font-size: 0.9rem;
  }

  /* 服務卡片 */
  .service-card {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .service-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
  }

  .service-card h3 {
    font-size: var(--text-lg);
  }

  .service-card p {
    font-size: 0.85rem;
  }

  .service-features li {
    font-size: 0.85rem;
  }

  /* 技術區塊 */
  .tech-grid {
    grid-template-columns: 1fr;
  }

  .tech-item {
    padding: var(--spacing-sm);
  }

  .tech-number {
    font-size: var(--text-2xl);
  }

  .tech-label {
    font-size: var(--text-sm);
  }

  /* CTA */
  .cta-section {
    padding: var(--spacing-lg) var(--spacing-sm);
    margin: var(--spacing-md) var(--spacing-xs);
  }

  .cta-section h2 {
    font-size: var(--text-2xl);
  }

  .cta-section p {
    font-size: 0.9rem;
  }

  /* 按鈕 */
  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }

  /* Footer */
  .footer-section h4 {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
  }

  .footer-section p,
  .footer-section a {
    font-size: 0.75rem;
  }
}

/* ==========================================
   觸控裝置優化
   ========================================== */
@media (hover: none) and (pointer: coarse) {
  /* 增大點擊區域 */
  .btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
  }

  .navbar-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* 移除 hover 效果 */
  .service-card:hover {
    transform: none;
  }

  /* 簡化動畫 */
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   橫向模式優化（手機）
   ========================================== */
@media (max-width: 767px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: var(--spacing-lg) 0;
  }

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

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .hero-description {
    display: none;
  }

  section {
    padding: var(--spacing-lg) 0;
  }
}

/* ==========================================
   列印樣式
   ========================================== */
@media print {
  /* 隱藏不必要元素 */
  .navbar,
  .hero-cta,
  .cta-section,
  .footer {
    display: none;
  }

  /* 調整顏色 */
  body {
    background: white;
    color: black;
  }

  .service-card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  /* 調整字體大小 */
  html {
    font-size: 12pt;
  }
}

/* ==========================================
   高對比模式支援
   ========================================== */
@media (prefers-contrast: high) {
  :root {
    --color-border: rgba(255, 255, 255, 0.3);
    --color-text-secondary: #e0e0e0;
  }

  .service-card {
    border-width: 2px;
  }
}

/* ==========================================
   減少動畫模式（用戶偏好）
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .float-animation,
  .pulse-glow,
  .gradient-animation,
  .rotate-slow {
    animation: none !important;
  }
}

/* ==========================================
   深色模式支援（預設已是深色）
   ========================================== */
@media (prefers-color-scheme: light) {
  /* 如果用戶偏好淺色模式，可以在這裡添加淺色主題 */
  /* 目前網站設計為深色，此處保留供未來擴展 */
}
