:root {
  --primary: #064663;      /* 深飛灣綠 */
  --secondary: #00B4D8;    /* 科技感藍 */
  --accent: #FF8C42;       /* 安全橘 */
  --bg: #F7F5ED;           /* 霧米白背景 */
  --text: #1F2933;
  --muted: #6B7280;
  --border: #E5E7EB;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* 通用布局 */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

main {
  padding: 2.5rem 0 4rem;
}

section + section {
  margin-top: 3rem;
}

h1, h2, h3, h4 {
  color: var(--primary);
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  letter-spacing: 0.04em;
}

h2 {
  font-size: 1.5rem;
  border-left: 4px solid var(--secondary);
  padding-left: 0.6rem;
}

h3 {
  font-size: 1.2rem;
}

/* 導覽列 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 237, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.2rem;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.brand-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-links a:hover {
  background: rgba(0, 180, 216, 0.12);
  color: var(--primary);
}

.nav-links a.active {
  background: var(--primary);
  color: #ffffff;
}

/* Hero 區塊 */

.hero {
  margin-top: 1.8rem;
  padding: 1.8rem 1.6rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 0% 0%, rgba(0, 180, 216, 0.18), transparent 55%),
              radial-gradient(circle at 100% 100%, rgba(6, 70, 99, 0.22), transparent 60%),
              #ffffff;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 1.6rem;
  align-items: center;
}

.hero-title {
  font-size: 2.1rem;
  margin-bottom: 0.4rem;
}

.hero-sub {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero-lead {
  font-size: 1rem;
  margin: 0.8rem 0 1.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.8rem;
}

/* Hero 側邊小卡 */

.hero-panel {
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 0.9rem;
  border: 1px solid rgba(229, 231, 235, 0.85);
}

.hero-panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.hero-panel-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
}

.hero-panel-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.hero-label {
  color: var(--muted);
}

.status-chip {
  font-size: 0.78rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.status-normal {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.6);
  color: #15803d;
}

.status-building {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.6);
  color: #92400e;
}

/* 按鈕 */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(6, 70, 99, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(6, 70, 99, 0.55);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(148, 163, 184, 0.9);
}

.btn-outline:hover {
  background: rgba(6, 70, 99, 0.06);
}

/* 卡片與格線 */

.grid {
  display: grid;
  gap: 1.2rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.card small {
  color: var(--muted);
}
/* 列車卡片與圖片 */

.train-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.train-image {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 220px;
  margin-bottom: 0.4rem;
}

.train-spec {
  list-style: none;
  padding-left: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.train-spec li + li {
  margin-top: 0.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(6, 70, 99, 0.06);
  color: var(--primary);
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
}

/* 表格 */

.table-wrapper {
  overflow-x: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

thead th {
  background: rgba(6, 70, 99, 0.05);
}

/* 列表與段落 */

.lead {
  font-size: 0.96rem;
  color: var(--muted);
}

ul.clean {
  list-style: none;
  padding-left: 0;
}

ul.clean li::before {
  content: "• ";
  color: var(--secondary);
}

/* footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.4rem 0 1.8rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* 響應式 */

@media (max-width: 840px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-links {
    justify-content: flex-end;
  }
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 1.4rem 1rem;
  }
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}
/* 下一班車的強調樣式 */
.next-train-highlight {
    text-align: center;
}
.next-train-time {
    font-size: 2.5rem;
    font-weight: bold;
    color: #d35400;
    margin: 10px 0;
    font-family: Consolas, monospace;
}
.next-train-info {
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.countdown {
    color: #555;
    font-size: 0.9rem;
}

/* =========================
   母親節活動模組
========================= */

.campaign-banner{
  margin: 40px 0;
  padding: 32px;
  border-radius: 24px;

  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;

  background:
    linear-gradient(
      135deg,
      #fff7fb 0%,
      #f7fbff 100%
    );

  border: 1px solid #e6eef7;
  align-items: center;
}

.campaign-tag{
  display: inline-block;

  padding: 6px 14px;
  border-radius: 999px;

  background: #ffeff5;
  color: #d65a8a;

  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.campaign-title{
  margin: 0 0 16px;
  font-size: 38px;
  line-height: 1.2;
  color: #123b72;
}

.campaign-desc{
  font-size: 17px;
  line-height: 1.8;
  color: #425466;
  margin-bottom: 24px;
}

.campaign-highlights{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  margin-bottom: 28px;
}

.campaign-highlights span{
  background: white;
  border: 1px solid #dde7f1;

  padding: 10px 14px;
  border-radius: 12px;

  font-size: 14px;
  color: #264b6f;
}

.campaign-price-box{
  background:
    linear-gradient(
      135deg,
      #ff7bac,
      #ff5c91
    );

  color: white;

  padding: 20px;
  border-radius: 18px;

  width: fit-content;
  margin-bottom: 24px;
}

.campaign-price-label{
  font-size: 14px;
  opacity: .9;
}

.campaign-price{
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
}

.campaign-price span{
  font-size: 20px;
  margin-left: 4px;
}

.campaign-actions{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.campaign-image{
  width: 100%;
  border-radius: 22px;

  box-shadow:
    0 10px 30px rgba(0,0,0,.08);
}

/* 響應式 */

@media (max-width: 900px){

  .campaign-banner{
    grid-template-columns: 1fr;
  }

  .campaign-title{
    font-size: 30px;
  }

  .campaign-price{
    font-size: 42px;
  }
}

/* 票務中心專用按鈕與車票樣式 */
.sys-btn-primary { 
  background: linear-gradient(135deg, #ff6ea8, #ff4f8b); 
  color: white; 
  transition: .2s;
  padding: 12px 24px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}
.sys-btn-primary:hover {
  transform: translateY(-2px);
  opacity: .96;
}
.refund-btn { 
  background: #fff8fb; 
  color: #d14e82; 
  border: 1px solid #ffd6e4; 
  padding: 8px 14px; 
  border-radius: 12px; 
  cursor: pointer; 
  font-weight: bold;
  transition: .2s;
}
.refund-btn:hover {
  background: #ff4f8b;
  color: white;
}
.ticket-item { 
  background: #f9fcff; 
  border: 1px solid #d7e2ee; 
  padding: 16px; 
  border-radius: 14px; 
  margin-bottom: 12px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.ticket-item strong { color: #1b4676; display: block; margin-bottom: 6px; font-size: 18px;}
.ticket-item span { color: #5c7088; font-size: 14px; line-height: 1.5; display: block;}
.login-input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #d7e2ee;
  box-sizing: border-box;
  margin-bottom: 16px;
}

/* 預設公司色 (深藍) */
#ticket-price-calc { color: #123b72; }

.sys-btn-primary { 
  background: linear-gradient(135deg, #123b72, #1b4676); 
  color: white; 
  transition: .2s;
  padding: 12px 24px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}
.sys-btn-primary:hover { transform: translateY(-2px); opacity: .96; }

.refund-btn { 
  background: #f5f8fc; 
  color: #123b72; 
  border: 1px solid #d7e2ee; 
  padding: 8px 14px; 
  border-radius: 12px; 
  cursor: pointer; 
  font-weight: bold;
  transition: .2s;
}
.refund-btn:hover { background: #123b72; color: white; }

/* === 偵測到母親節套票時的粉色主題 === */
.theme-pink #ticket-price-calc { color: #ff4f8b; }

.theme-pink .sys-btn-primary {
  background: linear-gradient(135deg, #ff6ea8, #ff4f8b);
}
.theme-pink .refund-btn {
  background: #fff8fb;
  color: #d14e82;
  border-color: #ffd6e4;
}
.theme-pink .refund-btn:hover {
  background: #ff4f8b;
  color: white;
}

/* 車票點擊區塊樣式 */
.ticket-info-clickable {
  cursor: pointer;
  flex-grow: 1;
  transition: opacity 0.2s;
}
.ticket-info-clickable:hover {
  opacity: 0.6;
}

/* 系統彈窗樣式 (共用) */
.sys-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(18, 59, 114, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
.sys-modal.active {
  display: flex;
}
/* 1. 壓縮彈窗本身的上下內邊距 */
.sys-modal-content {
  background: white;
  padding: 20px 24px; /* 上下縮減為 20px */
  border-radius: 20px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  animation: popIn 0.3s ease-out;
  text-align: center;
}

.nfc-icon {
  font-size: 32px; /* 稍微縮小圖示 (原本 40px) */
  margin-bottom: 4px; /* 減少與下方文字的距離 */
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}
}@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 2. 壓縮 QR 區塊的上下外/內邊距 */
.qr-container {
  margin: 12px 0; /* 縮小上下外邊距 */
  padding: 12px;  /* 縮小上下內邊距 */
  background: #f9fcff;
  border-radius: 16px;
  border: 1px solid #d7e2ee;
}

/* 3. QR Code 圖案再縮小一點，節省垂直空間 */
.qr-placeholder {
  width: 100px; /* 從 120px 縮小至 100px */
  height: 100px;
  margin: 0 auto 8px; /* 縮小與下方文字的距離 */
  background-color: white;
  background-image: 
    linear-gradient(45deg, #123b72 25%, transparent 25%, transparent 75%, #123b72 75%, #123b72), 
    linear-gradient(45deg, #123b72 25%, transparent 25%, transparent 75%, #123b72 75%, #123b72);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  border: 6px solid white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 4. 壓縮 NFC 區塊的上下間距與圖示大小 */
.nfc-animation {
  margin-top: 12px; /* 縮減距離 */
  padding-top: 12px; /* 縮減距離 */
  border-top: 1px dashed #d7e2ee;
}
.nfc-icon {
  font-size: 40px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}