/* ========================================
   主要樣式文件 - main.css
   基於 Bootstrap 5.3 框架的自定義樣式
======================================== */

/* CSS 自定義屬性（變量） */
:root {
  /* 主色調 */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;

  /* 次要色調 */
  --secondary-50: #f9fafb;
  --secondary-100: #f3f4f6;
  --secondary-200: #e5e7eb;
  --secondary-300: #d1d5db;
  --secondary-400: #9ca3af;
  --secondary-500: #6b7280;
  --secondary-600: #4b5563;
  --secondary-700: #374151;
  --secondary-800: #1f2937;
  --secondary-900: #111827;
  --secondary-950: #030712;

  /* 強調色 */
  --accent-50: #fefce8;
  --accent-100: #fef9c3;
  --accent-200: #fef08a;
  --accent-300: #fde047;
  --accent-400: #facc15;
  --accent-500: #eab308;
  --accent-600: #ca8a04;
  --accent-700: #a16207;
  --accent-800: #854d0e;
  --accent-900: #713f12;

  /* 功能色彩 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  /* 字體設定 */
  --font-family-primary: 'PingFang TC','Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-heading: 'PingFang TC','Noto Sans TC', 'Inter', sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Monaco', 'Consolas', monospace;

  /* 字體大小 */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;

  /* 間距 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* 圓角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* 陰影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* 過渡效果 */
  --transition-fast: all 0.15s ease;
  --transition-base: all 0.3s ease;
  --transition-slow: all 0.5s ease;

  /* 漸變背景 */
  --gradient-primary: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--secondary-600) 0%, var(--secondary-800) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-400) 0%, var(--accent-600) 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-900) 50%, var(--secondary-900) 100%);

  /* Z-index 層級 */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* ========================================
   全局樣式重置與基礎設定
======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family-primary);
  line-height: 1.7;
  color: var(--secondary-900);
  background-color: var(--secondary-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 標題字體 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--secondary-900);
  margin-bottom: 0.75em;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

/* 段落與文本 */
p {
  margin-bottom: 1.25em;
  color: var(--secondary-700);
}

.lead {
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: var(--secondary-600);
}

/* 連結樣式 */
a {
  color: var(--primary-600);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

/* 選擇文本樣式 */
::selection {
  background-color: var(--primary-600);
  color: white;
}

/* 滾動條樣式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--secondary-100);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-400);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

/* ========================================
   載入畫面
======================================== */
.loading-screen {
  background: var(--gradient-primary);
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  color: white;
}

.loading-text {
  font-size: var(--font-size-lg);
  font-weight: 500;
}

/* ========================================
   導航欄樣式
======================================== */
.navbar {
  backdrop-filter: blur(20px);
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid var(--secondary-200);
  transition: var(--transition-base);
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.98) !important;
  box-shadow: var(--shadow-lg);
}

.navbar-brand {
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--secondary-900) !important;
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-nav .nav-link {
  font-weight: 500;
  font-size: var(--font-size-base);
  padding: 0.75rem 1.25rem !important;
  position: relative;
  color: var(--secondary-950);
  transition: var(--transition-base);
}

.navbar-nav .nav-link:hover {
  color: var(--primary-600) !important;
}

.navbar-nav .nav-link.active {
  color: var(--primary-600) !important;
  font-weight: 600;
}

.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--primary-600);
  border-radius: var(--radius-full);
}

/* 頂部信息欄 */
.top-bar {
  background: var(--gradient-primary);
  color: white;
  font-size: var(--font-size-sm);
  padding: 0.5rem 0;
}

.top-bar a {
  color: white;
  text-decoration: none;
}

.top-bar a:hover {
  color: var(--accent-200);
}

/* 下拉菜單 */
.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  min-width: 280px;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  transition: var(--transition-fast);
  border-radius: 0;
  font-size: var(--font-size-sm);
}

.dropdown-item:hover {
  background-color: var(--primary-50);
  color: var(--primary-700);
}

.dropdown-header {
  font-weight: 600;
  color: var(--secondary-700);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   Hero 區域樣式
======================================== */
.hero-section {
  background: var(--gradient-hero);
  min-height: 80vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-section::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 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
  animation: float 30s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: white;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--accent-300);
  margin-bottom: 1rem;
}

.hero-description {
  font-size: var(--font-size-lg);
  color: var(--secondary-200);
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero-image {
  position: relative;
  z-index: 1;
}

.hero-image img {
  max-height: 600px;
  width: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* 浮動元素 */
.floating-element {
  position: absolute;
  opacity: 0.1;
  animation: floatSlow 20s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(5deg); }
}

.floating-element-1 {
  top: 10%;
  right: 10%;
  font-size: 8rem;
  animation-delay: 0s;
}

.floating-element-2 {
  bottom: 20%;
  left: 5%;
  font-size: 6rem;
  animation-delay: 10s;
}

/* ========================================
   按鈕樣式
======================================== */
.btn {
  font-weight: 600;
  border-radius: var(--radius-lg);
  padding: 0.75rem 2rem;
  font-size: var(--font-size-base);
  border: 2px solid transparent;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-xl);
  filter: brightness(1.1);
}

.btn-outline-primary {
  border-color: var(--primary-600);
  color: var(--primary-600);
  background: transparent;
}

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

.btn-accent {
  background: var(--gradient-accent);
  color: var(--secondary-900);
  border: none;
}

.btn-accent:hover {
  background: var(--gradient-accent);
  filter: brightness(1.1);
  color: var(--secondary-900);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.btn-outline-light:hover {
  background: white;
  color: var(--secondary-900);
  border-color: white;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
}

/* 按鈕動畫效果 */
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn span,
.btn i {
  position: relative;
  z-index: 1;
}

/* ========================================
   卡片樣式
======================================== */
.card {
  border: none;
  border-radius: var(--radius-2xl);
  background: white;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  overflow: hidden;
}

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

.card-header {
  background: linear-gradient(135deg, var(--secondary-50), white);
  border-bottom: 1px solid var(--secondary-200);
  font-weight: 600;
  padding: 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background: var(--secondary-50);
  border-top: 1px solid var(--secondary-200);
  padding: 1.5rem;
}

/* 特殊卡片變體 */
.card-product {
  transition: var(--transition-base);
}

.card-product:hover {
  transform: translateY(-12px) scale(1.02);
}

.card-product img {
  height: 240px;
  object-fit: cover;
  transition: var(--transition-base);
}

.card-product:hover img {
  transform: scale(1.1);
}

.card-feature {
  text-align: center;
  padding: 2rem;
  height: 100%;
  background: white;
  border: 1px solid var(--secondary-100);
}

.card-feature:hover {
  border-color: var(--primary-200);
  background: var(--primary-50);
}

.card-testimonial {
  background: white;
  border-left: 4px solid var(--primary-600);
  position: relative;
  padding: 2rem;
}

.card-testimonial:hover {
  border-left-color: var(--accent-500);
}

.card-testimonial::before {
  content: '"';
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 4rem;
  color: var(--primary-200);
  font-family: serif;
  line-height: 1;
  opacity: 0.7;
}

/* ========================================
   統計數據樣式
======================================== */
.stats-section {
  background: white;
  border-radius: var(--radius-2xl);
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-xl);
  padding: 3rem 0;
}

.stats-item {
  text-align: center;
  padding: 1.5rem;
}

.stats-number {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--primary-600);
  line-height: 1;
  margin-bottom: 0.5rem;
  display: block;
}

.stats-label {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--secondary-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-icon {
  font-size: 3rem;
  color: var(--primary-500);
  margin-bottom: 1rem;
  opacity: 0.8;
}

/* ========================================
   時間軸樣式
======================================== */
.timeline {
  position: relative;
  padding-left: 3rem;
  margin: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-200), var(--primary-600), var(--primary-200));
  border-radius: var(--radius-full);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary-600);
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 0 0 4px var(--primary-200);
  z-index: 2;
  transition: var(--transition-base);
}

.timeline-item:hover::before {
  background: var(--accent-500);
  transform: scale(1.3);
  box-shadow: 0 0 0 4px var(--accent-200);
}

.timeline-content {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}

.timeline-item:hover .timeline-content {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.timeline-year {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--primary-600);
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--secondary-900);
  margin-bottom: 1rem;
}

.timeline-description {
  color: var(--secondary-600);
  line-height: 1.6;
}

/* ========================================
   徽章樣式
======================================== */
.badge {
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-new {
  background: linear-gradient(45deg, #ef4444, #dc2626);
  color: white;
  animation: pulse 2s infinite;
}

.badge-featured {
  background: linear-gradient(45deg, #10b981, #059669);
  color: white;
}

.badge-hot {
  background: var(--gradient-accent);
  color: var(--secondary-900);
}

.badge-bestseller {
  background: linear-gradient(45deg, #8b5cf6, #7c3aed);
  color: white;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ========================================
   表單樣式
======================================== */
.form-control {
  border: 2px solid var(--secondary-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  font-size: var(--font-size-base);
  transition: var(--transition-base);
  background: white;
}

.form-control:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px var(--primary-100);
  background-color: var(--primary-25);
}

.form-control::placeholder {
  color: var(--secondary-400);
}

.form-label {
  font-weight: 600;
  color: var(--secondary-700);
  margin-bottom: 0.75rem;
  font-size: var(--font-size-sm);
}

.form-text {
  color: var(--secondary-500);
  font-size: var(--font-size-sm);
}

.input-group-text {
  background: var(--secondary-100);
  border: 2px solid var(--secondary-200);
  color: var(--secondary-600);
  font-weight: 500;
}

.form-select {
  border: 2px solid var(--secondary-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* ========================================
   模態框樣式
======================================== */
.modal-content {
  border: none;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
}

.modal-header {
  background: var(--gradient-primary);
  color: white;
  border-bottom: none;
  padding: 2rem;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  background: var(--secondary-50);
  border-top: 1px solid var(--secondary-200);
  padding: 1.5rem 2rem;
}

.btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.btn-close:hover {
  opacity: 1;
}

/* ========================================
   浮動元素樣式
======================================== */
.floating-elements {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: var(--z-fixed);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.floating-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.floating-btn:hover {
  transform: scale(1.1);
}

.floating-btn-back {
  background: var(--secondary-600);
  color: white;
  box-shadow: var(--shadow-lg);
}

.floating-btn-back:hover {
  background: var(--secondary-700);
  box-shadow: var(--shadow-xl);
}

.floating-btn-inquiry {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-lg);
  animation: bounce 2s infinite;
}

.floating-btn-inquiry:hover {
  animation: none;
  transform: scale(1.1);
}

.floating-btn-lang {
  background: var(--accent-500);
  color: var(--secondary-900);
  box-shadow: var(--shadow-lg);
}

.floating-btn-lang:hover {
  background: var(--accent-600);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

/* ========================================
   頁腳樣式
======================================== */

.footer-bg {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
    position: relative;
    overflow: hidden;
}

/* 添加细微的纹理效果 */
.footer-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    opacity: 0.5;
    z-index: 1;
}

.footer-bg > * {
    position: relative;
    z-index: 2;
}

.footer {
  background: var(--gradient-secondary);
  color: var(--secondary-300);
  position: relative;
  overflow: hidden;
}

.footer::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 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

.footer-content {
  position: relative;
  z-index: 1;
}

.footer h5 {
  color: white;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: var(--font-size-lg);
}

.footer a {
  color: var(--secondary-300);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer a:hover {
  color: var(--accent-300);
  text-decoration: none;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--secondary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
}

.footer-social a:hover {
  border-color: var(--accent-400);
  background: var(--accent-400);
  color: var(--secondary-900);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid var(--secondary-700);
  padding-top: 2rem;
  margin-top: 3rem;
}

/* ========================================
   搜尋樣式
======================================== */
.search-highlight {
  background: var(--accent-200);
  color: var(--secondary-900);
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

.search-item {
  padding: 1rem;
  border-bottom: 1px solid var(--secondary-200);
  transition: var(--transition-fast);
}

.search-item:hover {
  background: var(--primary-50);
}

.search-item:last-child {
  border-bottom: none;
}

/* ========================================
   Cookie 同意樣式
======================================== */
.cookie-consent {
  background: rgba(31, 41, 55, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--secondary-600);
  z-index: var(--z-toast);
}

.cookie-consent .btn {
  font-size: var(--font-size-sm);
  padding: 0.5rem 1.5rem;
}

/* ========================================
   動畫效果
======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* 錯開動畫時間 */
.animate-delay-1 { animation-delay: 0.1s; transition-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; transition-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; transition-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; transition-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; transition-delay: 0.5s; }
.animate-delay-6 { animation-delay: 0.6s; transition-delay: 0.6s; }

/* ========================================
   工具類樣式
======================================== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-pattern {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23pattern)"/></svg>');
}

.shadow-colored {
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
}

.shadow-colored:hover {
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.25);
}

.border-gradient {
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
              var(--gradient-primary) border-box;
}

.icon-box {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  background: var(--primary-100);
  color: var(--primary-600);
  font-size: 2rem;
  transition: var(--transition-base);
}

.icon-box:hover {
  background: var(--primary-600);
  color: white;
  transform: rotate(5deg) scale(1.1);
}

.section-title {
  position: relative;
  text-align: center;
  margin-bottom: 3rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

.section-subtitle {
  color: var(--secondary-600);
  font-size: var(--font-size-lg);
  margin-bottom: 0;
  text-align: center;
}

/* ========================================
   響應式設計
======================================== */
@media (max-width: 1200px) {
  .hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
  }
  
  .stats-section {
    margin: -3rem 0.5rem 0;
  }
}

@media (max-width: 992px) {
  .hero-section {
    min-height: 80vh;
    text-align: center;
  }
  
  .timeline {
    padding-left: 2rem;
  }
  
  .timeline::before {
    left: 1rem;
  }
  
  .timeline-item::before {
    left: -2.5rem;
  }
  
  .floating-elements {
    bottom: 1rem;
    right: 1rem;
  }
  
  .floating-btn {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-xl);
  }
  
  .hero-description {
    font-size: var(--font-size-base);
  }
  
  .stats-number {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
  
  .timeline-content {
    padding: 1.5rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .btn-lg {
    padding: 0.875rem 2rem;
    font-size: var(--font-size-base);
  }
  
  .modal-header,
  .modal-body {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    min-height: 70vh;
    padding: 2rem 0;
  }
  
  .stats-section {
    margin: -2rem 0.25rem 0;
    padding: 2rem 0;
  }
  
  .stats-item {
    padding: 1rem;
  }
  
  .timeline {
    padding-left: 1.5rem;
  }
  
  .timeline-item {
    margin-bottom: 2rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .floating-elements {
    bottom: 0.5rem;
    right: 0.5rem;
  }
  
  .footer h5 {
    margin-bottom: 1rem;
  }
}

/* ========================================
   打印樣式
======================================== */
@media print {
  .navbar,
  .floating-elements,
  .cookie-consent,
  .modal,
  .btn {
    display: none !important;
  }
  
  .hero-section {
    background: none !important;
    color: black !important;
    min-height: auto !important;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
  
  @page {
    margin: 2cm;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
}

/* ========================================
   無障礙支援
======================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-600);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: 9999;
}

.skip-link:focus {
  top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating-btn-inquiry {
    animation: none !important;
  }
  
  .hero-section::before {
    animation: none !important;
  }
}

@media (prefers-contrast: high) {
  .btn-primary {
    background: #000 !important;
    border-color: #000 !important;
  }
  
  .btn-outline-primary {
    border-color: #000 !important;
    color: #000 !important;
  }
  
  .card {
    border: 2px solid #000 !important;
  }
}

@media (prefers-color-scheme: dark) {
  .navbar {
    background-color: rgba(31, 41, 55, 0.95) !important;
  }
  
  .card {
    background-color: var(--secondary-800) !important;
    color: var(--secondary-100) !important;
  }
  
  .modal-content {
    background-color: var(--secondary-800) !important;
    color: var(--secondary-100) !important;
  }
}


.top-bar .dropdown-menu{
  z-index:1030;
  background-color:var( --primary-600);
}
.top-bar .dropdown-menu a:hover{
  color:#000;
}