
/* =========================
   全域變數
========================= */
:root {
  --nav-h: 56px;
  --ocean-dark:   #0A6DCB;
  --ocean-mid:    #1a7fd4;
  --ocean-light:  #42A8FF;
  --danger-red:   #e63946;
  --orange:       #ff8c42;
  --teal:         #2ec4b6;
  --white:        #ffffff;
  --bg:           #f8fbff;
  --text:         #1a2340;
  --text-gray:    #6b7a99;

  --radius-card:  18px;
  --shadow-card:  0 6px 24px rgba(0,0,0,0.07);
  --shadow-hover: 0 12px 36px rgba(10,109,202,0.15);
}

/* =========================
   Reset & Base
========================= */
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  padding-top: var(--nav-h);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  line-height: 1.7; color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }

/* =========================
   導覽列
========================= */
nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h);
  z-index: 9999; background: rgba(10,109,202,.82);
  backdrop-filter: blur(10px); box-shadow: 0 2px 8px rgba(0,0,0,.2);
  padding: 0 1.2rem;
}
.nav-container {
  max-width: 1200px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
nav img { height: 40px; display: block; }
.nav-links a {
  color: #fff; font-weight: 700; text-decoration: none;
  margin-left: 1.1rem; font-size: 14px; transition: color .2s;
}
.nav-links a:hover { color: #63e6be; }
.nav-links a i { margin-right: 4px; }

@media (max-width: 580px) {
  nav img { height: 34px; }
  .nav-links a { font-size: 13px; margin-left: .7rem; }
  .nav-links a i { display: none; }
}

/* =========================
   HERO 主視覺
========================= */
.hero {
  position: relative; height: 60vh; min-height: 400px;
  background: linear-gradient(180deg, rgba(0,60,120,0.55), rgba(0,20,60,0.4)),
              url('../圖片/DSC_3811.avif') center/cover no-repeat;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; overflow: hidden;
}
.hero-overlay {
  background: rgba(0,0,0,0.38); padding: 36px 44px; border-radius: 16px;
  color: white; width: 90%; max-width: 660px;
  backdrop-filter: blur(4px); animation: floatUp 1s ease-out;
  border: 1px solid rgba(255,255,255,0.12);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(230,57,70,0.85); color: white;
  font-size: 12px; font-weight: 700; padding: 5px 14px;
  border-radius: 20px; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-overlay h1 {
  font-size: 42px; font-weight: 900; margin: 0 0 10px;
  line-height: 1.15; text-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.hero-overlay p { font-size: 16px; opacity: 0.9; margin: 0; }

/* 波浪 */
.ocean-waves {
  position: absolute; bottom: -1px; left: 0; width: 100%;
  overflow: hidden; line-height: 0; z-index: 5;
}
.waves { width: 100%; height: 80px; max-height: 80px; }
.parallax > use { animation: waveMove 10s cubic-bezier(.55,.5,.45,.5) infinite; }
.parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 11s; }
.parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 13s; }
.parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 15s; }
@keyframes waveMove {
  0%   { transform: translate3d(-90px,0,0); }
  100% { transform: translate3d(85px,0,0); }
}

/* 海龜軌道 */
.hero-divider { position: relative; margin-top: -2px; }
.big-waves { display: block; width: 100%; margin-top: -40px; }
.turtle-track {
  position: relative; width: 100%; height: 60px;
  margin-top: -20px; z-index: 50; overflow: visible;
}
.emoji-turtle-area {
  position: absolute; top: 0; left: 0; width: 100%; height: 60px;
  overflow: visible; pointer-events: none;
}
.emoji-turtle {
  position: absolute; left: -60px; font-size: 32px;
  animation: swim var(--turtle-speed) linear forwards, float 3s ease-in-out infinite;
}
@keyframes swim {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 140px)); }
}
@keyframes float {
  0%,100% { margin-top: 0; }
  50%     { margin-top: -10px; }
}
@keyframes floatUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   容器 & 標題
========================= */
.container { max-width: 1100px; margin: 20px auto 60px; padding: 0 22px; }
.section-title {
  font-size: 26px; font-weight: 800;
  border-left: 6px solid var(--ocean-light); padding-left: 16px;
  margin: 50px 0 24px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.section-title i { color: var(--ocean-dark); }

/* =========================
   通用 Card
========================= */
.card {
  background: var(--white); border-radius: var(--radius-card);
  border: 1px solid rgba(0,0,0,0.05); padding: 30px 36px;
  margin-bottom: 32px; box-shadow: var(--shadow-card);
  animation: cardEntrance 0.7s cubic-bezier(0.22,1,0.36,1) backwards;
}
@keyframes cardEntrance {
  0%   { opacity: 0; transform: translateY(30px) scale(0.97); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0) scale(1);       filter: blur(0); }
}

/* =========================
   緊急電話 Grid
========================= */
.emergency-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 10px;
}
.call-card {
  background: white; border-radius: 16px; text-decoration: none;
  display: flex; align-items: center; gap: 18px; padding: 22px 24px;
  border: 1.5px solid #eef2fb; box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  transition: transform .25s, box-shadow .25s;
}
.call-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.call-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.call-info { display: flex; flex-direction: column; }
.call-number { font-size: 20px; font-weight: 900; letter-spacing: .5px; line-height: 1.1; }
.call-label  { font-size: 13px; color: var(--text-gray); margin-top: 2px; }

.call-card.red    .call-icon   { background: #fff0f0; color: var(--danger-red); }
.call-card.red    .call-number { color: var(--danger-red); }
.call-card.red                 { border-left: 5px solid var(--danger-red); }
.call-card.orange .call-icon   { background: #fff5ee; color: var(--orange); }
.call-card.orange .call-number { color: var(--orange); }
.call-card.orange              { border-left: 5px solid var(--orange); }
.call-card.blue   .call-icon   { background: #eef5ff; color: var(--ocean-dark); }
.call-card.blue   .call-number { color: var(--ocean-dark); }
.call-card.blue                { border-left: 5px solid var(--ocean-dark); }
.call-card.teal   .call-icon   { background: #edfaf9; color: var(--teal); }
.call-card.teal   .call-number { color: var(--teal); }
.call-card.teal                { border-left: 5px solid var(--teal); }

/* =========================
   地圖
========================= */
.map-card { padding: 12px; position: relative; }
#map { height: 560px; border-radius: 14px; z-index: 1; }
.map-btn {
  position: absolute; bottom: 50px; right: 28px; z-index: 1000;
  background: var(--ocean-dark); color: white; border: none;
  padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 14px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(10,109,202,.35);
  transition: background .2s, transform .15s;
  display: flex; align-items: center; gap: 8px;
}
.map-btn:hover { background: var(--ocean-mid); transform: translateY(-2px); }

/* =========================
   AED 地點 Grid
========================= */
.aed-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin-bottom: 10px;
}
.aed-item {
  background: white; border-radius: 16px; padding: 22px;
  border: 1.5px solid #eef2fb; box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  transition: transform .25s, box-shadow .25s;
  animation: cardEntrance 0.6s cubic-bezier(0.22,1,0.36,1) backwards;
}
.aed-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.aed-item-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.aed-type-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; background: #eef5ff; color: var(--ocean-dark); flex-shrink: 0;
}
.aed-item h3 { font-size: 16px; font-weight: 800; margin: 0; color: var(--text); }
.aed-detail {
  font-size: 13px; color: var(--text-gray);
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 7px; line-height: 1.5;
}
.aed-detail i { color: var(--ocean-light); margin-top: 2px; width: 14px; flex-shrink: 0; }
.aed-open {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 4px 12px;
  border-radius: 20px; margin-top: 10px;
}
.aed-open.h24      { background: #edfaf4; color: #1a9e6a; }
.aed-open.limited  { background: #fff8ee; color: #b07d00; }

/* =========================
   CPR 指揮中心
========================= */
.cpr-magazine-card {
  text-align: center;
  background: linear-gradient(145deg, #ffffff, #f4f8ff);
  border: 2px solid #deeeff;
}
.cpr-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 34px; flex-wrap: wrap; gap: 12px;
}
.mode-tabs { display: flex; gap: 8px; }
.mode-btn {
  background: #eef2fb; border: none; padding: 9px 20px;
  border-radius: 9px; font-weight: 700; font-size: 14px;
  cursor: pointer; color: var(--text-gray);
  transition: background .2s, color .2s, transform .15s;
  display: flex; align-items: center; gap: 7px;
  font-family: 'Noto Sans TC', sans-serif;
}
.mode-btn:hover { transform: translateY(-1px); }
.mode-btn.active {
  background: var(--ocean-dark); color: white;
  box-shadow: 0 4px 14px rgba(10,109,202,.3);
}
.timer-display {
  font-family: 'Orbitron', sans-serif; font-size: 22px;
  color: var(--ocean-dark); letter-spacing: 2px;
  display: flex; align-items: center; gap: 8px;
}

/* 計數器 */
.counter-group {
  display: flex; justify-content: center; align-items: center;
  gap: 30px; margin-bottom: 28px;
}
.counter-item { text-align: center; }
.counter-label {
  font-size: 13px; font-weight: 700; color: var(--text-gray);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 6px; letter-spacing: .5px;
}
.digital-num {
  font-family: 'Orbitron', sans-serif; font-size: 72px; font-weight: 900;
  color: var(--ocean-light); line-height: 1;
}
.digital-num.red { color: var(--danger-red); }
.counter-divider { font-size: 36px; color: #c8d8f0; margin-top: 10px; font-weight: 300; }

/* 進度條 */
.progress-track {
  height: 10px; background: #dde8f7; border-radius: 10px; overflow: hidden;
  margin-bottom: 28px; max-width: 500px; margin-left: auto; margin-right: auto;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ocean-dark), var(--ocean-light));
  width: 0%; transition: width .3s ease; border-radius: 10px;
}

/* 脈搏燈 */
.pulse-indicator {
  width: 22px; height: 22px; background: var(--danger-red); border-radius: 50%;
  margin: 0 auto 16px; opacity: 0.2; transition: opacity .1s;
  box-shadow: 0 0 12px rgba(230,57,70,0.4);
}

/* 主按鈕 */
.press-btn-main {
  width: 100%; max-width: 420px; padding: 22px;
  background: linear-gradient(135deg, var(--ocean-dark), var(--ocean-mid));
  color: white; border: none; border-radius: 16px;
  font-size: 20px; font-weight: 900; cursor: pointer;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 8px 24px rgba(10,109,202,.35);
  font-family: 'Noto Sans TC', sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
}
.press-btn-main:hover  { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(10,109,202,.45); }
.press-btn-main:active { transform: scale(0.97); }
.mode-hint {
  margin-top: 14px; font-size: 13px; color: var(--text-gray);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* =========================
   AED 步驟區
========================= */
.aed-steps {
  margin-top: 44px; border-top: 1.5px solid #deeeff; padding-top: 32px;
}
.steps-title {
  font-size: 18px; font-weight: 800; color: var(--text);
  margin: 0 0 26px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.steps-title i { color: var(--ocean-dark); }
.steps-grid {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: wrap; margin-bottom: 28px;
}
.step-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 80px;
}
.step-num {
  width: 22px; height: 22px; background: var(--ocean-dark); color: white;
  border-radius: 50%; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.step-icon {
  width: 56px; height: 56px; background: #eef5ff; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--ocean-dark); transition: background .2s, color .2s;
}
.step-item:hover .step-icon { background: var(--ocean-dark); color: white; }
.step-text { font-size: 12px; font-weight: 700; color: var(--text-gray); text-align: center; line-height: 1.3; }
.step-arrow { font-size: 13px; color: #c8d8f0; margin-bottom: 24px; }

/* 電極片提示 */
.electrode-tip {
  display: flex; align-items: flex-start; gap: 14px;
  background: #eef9ff; border-left: 5px solid var(--ocean-light);
  border-radius: 12px; padding: 16px 20px;
  font-size: 14px; color: #1a3a5c; line-height: 1.7;
  margin-bottom: 24px; text-align: left;
}
.electrode-tip > i { color: var(--ocean-dark); margin-top: 2px; font-size: 18px; flex-shrink: 0; }

/* CPR 要點卡片 Grid */
.cpr-tips-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; text-align: left;
}
.cpr-tip-item {
  background: #f9fbff; border: 1.5px solid #deeeff; border-radius: 12px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .2s, transform .2s;
}
.cpr-tip-item:hover { box-shadow: 0 6px 16px rgba(10,109,202,0.1); transform: translateY(-2px); }
.cpr-tip-item > i   { font-size: 20px; color: var(--ocean-dark); }
.cpr-tip-item strong { font-size: 14px; font-weight: 800; color: var(--text); }
.cpr-tip-item span   { font-size: 13px; color: var(--text-gray); line-height: 1.5; }

/* =========================
   訪問統計
========================= */
.visitor-stat {
  text-align: center; padding: 40px 20px; font-size: 15px;
  font-weight: 700; color: var(--text-gray);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.visitor-stat i { color: var(--ocean-light); }

/* =========================
   Footer
========================= */
.footer {
  background: linear-gradient(135deg, #0a1a40, #0a3a7a);
  color: rgba(255,255,255,0.8); text-align: center; padding: 36px 20px;
}
.footer-inner p {
  margin: 6px 0; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.footer-inner p:first-child { font-size: 15px; font-weight: 700; color: white; }
.footer-sub { font-size: 13px; opacity: .65; }

/* =========================
   RWD
========================= */
@media (max-width: 768px) {
  .hero { height: 58vh; min-height: 360px; }
  .hero-overlay { max-width: 90%; padding: 24px 22px; }
  .hero-overlay h1 { font-size: 30px; }
  .container { padding: 0 16px; }
  .card { padding: 22px 18px; }
  .digital-num { font-size: 54px; }
  .counter-group { gap: 18px; }
  .cpr-header { flex-direction: column; align-items: flex-start; }
  .steps-grid { gap: 2px; }
  .step-item { width: 68px; }
  .step-icon { width: 48px; height: 48px; font-size: 18px; }
  .step-text { font-size: 11px; }
  #map { height: 360px; }
  .map-btn { right: 16px; bottom: 16px; }
  .section-title { font-size: 20px; }
  .emergency-grid { grid-template-columns: 1fr 1fr; }
  .cpr-tips-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .emergency-grid { grid-template-columns: 1fr; }
  .hero-overlay h1 { font-size: 26px; }
  .digital-num { font-size: 46px; }
  .press-btn-main { font-size: 17px; padding: 18px; }
  .step-arrow { display: none; }
  .steps-grid { gap: 8px; }
  .step-item { width: 60px; }
  .cpr-tips-grid { grid-template-columns: 1fr; }
}

.map-btn {
  /* 增加點擊時的視覺回饋 */
  active {
    transform: scale(0.9);
  }
}

/* 讓定位出的藍色圓點有呼吸燈效果 (選用) */
.leaflet-interactive {
  transition: all 0.3s;
}