/* =========================================
   台灣觀光列車 — 全域基礎
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --haifeng:  #5ec8b0;
  --haifeng-light: #e0f7f2;
  --haifeng-dark: #2a9d80;
  --mingri:   #e07b39;
  --mingri-light: #fdf0e6;
  --mingri-dark: #b85c1a;
  --breezy:   #3a8fd4;
  --breezy-light: #e3f1fb;
  --breezy-dark: #1a6aad;
  --fosen:    #c49a1a;
  --fosen-light: #fdf5dc;
  --fosen-dark: #7a5e00;
  --dark: #1a1a2e;
  --text: #333;
  --text-light: #666;
  --white: #fff;
  --radius: 20px;
  --shadow: 0 20px 60px rgba(0,0,0,0.12);
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text);
  background: #f8f9fa;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

img { display: block; max-width: 100%; }

/* =========================================
   HERO
   ========================================= */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: 
    linear-gradient(135deg,
      rgba(26,26,46,0.85) 0%,
      rgba(30,50,80,0.75) 50%,
      rgba(60,100,80,0.65) 100%),
    url('https://images.unsplash.com/photo-1528360983277-13d401cdc186?w=1600&q=80') center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(26,26,46,0.6) 100%);
}

.hero-content {
  position: relative;
  text-align: center;
  color: var(--white);
  padding: 20px;
  z-index: 2;
}

.hero-sub {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 6px;
  opacity: 0.8;
  margin-bottom: 16px;
  animation: fadeDown 1s ease both;
}

.hero-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 24px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: fadeDown 1s ease 0.2s both;
}

.hero-desc {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  opacity: 0.9;
  line-height: 1.8;
  margin-bottom: 40px;
  animation: fadeDown 1s ease 0.4s both;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.7);
  color: var(--white);
  padding: 14px 36px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 2px;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  animation: fadeDown 1s ease 0.6s both;
}

.hero-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: var(--white);
  transform: translateY(-2px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero-scroll-hint span {
  display: block;
  width: 2px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.7));
  margin: 0 auto;
  animation: scrollLine 2s ease infinite;
}

/* =========================================
   STICKY NAV
   ========================================= */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sticky-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.sticky-nav ul li a {
  display: block;
  padding: 16px 24px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px;
  transition: color 0.3s, background 0.3s;
  position: relative;
}

.sticky-nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  border-radius: 2px;
  transition: width 0.3s ease;
  background: currentColor;
}

.sticky-nav ul li a:hover,
.sticky-nav ul li a.active {
  color: var(--white);
}

.sticky-nav ul li a:hover::after,
.sticky-nav ul li a.active::after {
  width: 60%;
}

/* =========================================
   TRAIN SECTIONS — 通用
   ========================================= */
.train-section {
  position: relative;
  padding: 120px 0;
  overflow: hidden;
}

.section-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(6rem, 18vw, 16rem);
  font-weight: 900;
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  color: var(--dark);
}

.section-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.section-layout.reverse {
  direction: rtl;
}

.section-layout.reverse > * {
  direction: ltr;
}

/* 圖片區塊 */
.section-image-wrap {
  position: relative;
}

.image-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
}

.image-frame::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius) + 4px);
  z-index: -1;
}

.haifeng-frame::before { background: linear-gradient(135deg, var(--haifeng), var(--haifeng-dark)); }
.mingri-frame::before  { background: linear-gradient(135deg, var(--mingri),  var(--mingri-dark));  }
.breezy-frame::before  { background: linear-gradient(135deg, var(--breezy),  var(--breezy-dark));  }
.fosen-frame::before   { background: linear-gradient(135deg, var(--fosen),   var(--fosen-dark));   }

.train-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.image-frame:hover .train-img {
  transform: scale(1.05);
}

/* 圖片標籤徽章 */
.image-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 50px;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.haifeng-badge { background: rgba(94, 200, 176, 0.85); }
.mingri-badge  { background: rgba(224, 123, 57, 0.85); }
.breezy-badge  { background: rgba(58, 143, 212, 0.85); }
.fosen-badge   { background: rgba(196, 154, 26, 0.85); }

/* 文字區塊 */
.section-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.train-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 6px 16px;
  border-radius: 50px;
  width: fit-content;
}

.haifeng-label { background: var(--haifeng-light); color: var(--haifeng-dark); }
.mingri-label  { background: var(--mingri-light);  color: var(--mingri-dark);  }
.breezy-label  { background: var(--breezy-light);  color: var(--breezy-dark);  }
.fosen-label   { background: var(--fosen-light);   color: var(--fosen-dark);   }

.train-name {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--dark);
}

.train-en {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 4px;
  color: var(--text-light);
  margin-top: -12px;
}

.train-intro {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-light);
}

.train-intro strong {
  color: var(--dark);
  font-weight: 700;
}

/* 特色列表 */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--white);
  flex-shrink: 0;
}

.haifeng-icon { background: linear-gradient(135deg, var(--haifeng), var(--haifeng-dark)); }
.mingri-icon  { background: linear-gradient(135deg, var(--mingri),  var(--mingri-dark));  }
.breezy-icon  { background: linear-gradient(135deg, var(--breezy),  var(--breezy-dark));  }
.fosen-icon   { background: linear-gradient(135deg, var(--fosen),   var(--fosen-dark));   }

.feature-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* 標籤 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.haifeng-tag { background: var(--haifeng-light); color: var(--haifeng-dark); border: 1.5px solid var(--haifeng); }
.mingri-tag  { background: var(--mingri-light);  color: var(--mingri-dark);  border: 1.5px solid var(--mingri);  }
.breezy-tag  { background: var(--breezy-light);  color: var(--breezy-dark);  border: 1.5px solid var(--breezy);  }
.fosen-tag   { background: var(--fosen-light);   color: var(--fosen-dark);   border: 1.5px solid var(--fosen);   }

/* =========================================
   SECTION 背景色
   ========================================= */
.haifeng { background: linear-gradient(160deg, #f0faf8 0%, #ffffff 60%, #e0f7f2 100%); }
.mingri  { background: linear-gradient(160deg, #fff8f3 0%, #ffffff 60%, #fdf0e6 100%); }
.breezy  { background: linear-gradient(160deg, #f0f6fc 0%, #ffffff 60%, #e3f1fb 100%); }
.fosen   { background: linear-gradient(160deg, #fdfaf0 0%, #ffffff 60%, #fdf5dc 100%); }

/* =========================================
   COMPARISON SECTION
   ========================================= */
.compare-section {
  padding: 100px 0;
  background: var(--dark);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--white);
  margin-bottom: 12px;
}

.section-header p {
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  letter-spacing: 3px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.compare-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  transition: var(--transition);
  cursor: default;
}

.compare-card:hover {
  transform: translateY(-12px);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
}

.compare-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
  color: var(--white);
}

.haifeng-card .compare-icon { background: linear-gradient(135deg, var(--haifeng), var(--haifeng-dark)); }
.mingri-card  .compare-icon { background: linear-gradient(135deg, var(--mingri),  var(--mingri-dark));  }
.breezy-card  .compare-icon { background: linear-gradient(135deg, var(--breezy),  var(--breezy-dark));  }
.fosen-card   .compare-icon { background: linear-gradient(135deg, var(--fosen),   var(--fosen-dark));   }

.compare-card h3 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
}

.compare-card ul {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-card ul li {
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-card ul li .fa-check {
  font-size: 0.75rem;
}

.haifeng-card ul li .fa-check { color: var(--haifeng); }
.mingri-card  ul li .fa-check { color: var(--mingri);  }
.breezy-card  ul li .fa-check { color: var(--breezy);  }
.fosen-card   ul li .fa-check { color: var(--fosen);   }

.compare-style {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--white);
}

.haifeng-card .compare-style { background: rgba(94, 200, 176, 0.25); border: 1px solid var(--haifeng); }
.mingri-card  .compare-style { background: rgba(224, 123, 57, 0.25); border: 1px solid var(--mingri);  }
.breezy-card  .compare-style { background: rgba(58, 143, 212, 0.25); border: 1px solid var(--breezy);  }
.fosen-card   .compare-style { background: rgba(196,154,26, 0.25);   border: 1px solid var(--fosen);   }

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: #0f0f1e;
  padding: 60px 24px;
  text-align: center;
  color: rgba(255,255,255,0.5);
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--white);
  font-family: 'Noto Serif TC', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-logo .fas { font-size: 1.6rem; color: var(--haifeng); }

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.footer-links span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links .fas { color: var(--haifeng); }

.footer-copy {
  font-size: 0.78rem;
  opacity: 0.5;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  margin-top: 8px;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollLine {
  0%   { height: 0; opacity: 0; }
  40%  { height: 50px; opacity: 1; }
  100% { height: 50px; opacity: 0; transform: translateY(30px); }
}

/* Reveal on scroll */
.reveal-left,
.reveal-right,
.reveal-up {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left  { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.reveal-up    { transform: translateY(40px); }

.reveal-left.visible,
.reveal-right.visible,
.reveal-up.visible {
  opacity: 1;
  transform: none;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .compare-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .train-section { padding: 80px 0; }

  .section-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .section-layout.reverse {
    direction: ltr;
  }

  .section-layout.reverse .section-image-wrap {
    order: -1;
  }

  .compare-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .sticky-nav ul li a {
    padding: 12px 14px;
    font-size: 0.8rem;
  }

  .section-bg-text {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .hero-btn {
    padding: 12px 28px;
    font-size: 0.9rem;
  }
}
