/* ==========================================================================
   羽書 YUSHU・即時特價雷達 — 設計系統（視覺定版 v1，2026-11-01）
   視覺語言：與標誌同一套——深航藍座艙底、朱紅航跡點綴、紙白卡面文字。
   色票、字級、斷點與元件規範記錄於 BUILD_NOTES.md「視覺設計系統」一節。
   ========================================================================== */

/* ---------- 設計變數 ---------- */
:root {
  --navy: #12233F;            /* 主調：深航藍 */
  --navy-deep: #0C1930;       /* 更深的底層與輸入欄位 */
  --verm: #D94F30;            /* 點綴：朱紅 */
  --verm-deep: #B93A20;
  --verm-soft: #FF9D85;       /* 朱紅淺色（深底上的文字與連結） */
  --paper: #F7F3EC;           /* 紙白：主要文字 */
  --mist: #C6D1E0;            /* 淺藍灰：次要文字 */
  --ink-dim: rgba(198, 209, 224, .78);
  --ink-faint: rgba(198, 209, 224, .55);
  --line: rgba(198, 209, 224, .16);
  --line-soft: rgba(198, 209, 224, .09);
  --glass: linear-gradient(165deg, rgba(247, 243, 236, .075), rgba(247, 243, 236, .028));
  --glass-strong: linear-gradient(165deg, rgba(247, 243, 236, .11), rgba(247, 243, 236, .045));
  --shadow: 0 12px 32px rgba(2, 8, 20, .45);
  --shadow-lift: 0 18px 42px rgba(2, 8, 20, .55);
  --radius: 14px;
  --radius-s: 10px;
  --wrap: 1140px;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif;
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", "Noto Serif CJK TC", serif;
  /* 狀態固定色（與規劃書標示規格對應，只換呈現、不換色義） */
  --st-unverified: #FFC531;
  --st-verified: #3ED598;
  --st-invalid: #FF7A68;
  --st-ended: #A7B4C0;
}

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--paper);
  background-color: var(--navy-deep);
  background-image:
    radial-gradient(1100px 520px at 88% -10%, rgba(217, 79, 48, .10), rgba(217, 79, 48, 0) 60%),
    radial-gradient(900px 620px at -12% -4%, rgba(70, 116, 184, .16), rgba(70, 116, 184, 0) 55%),
    linear-gradient(rgba(198, 209, 224, .045) 1px, rgba(198, 209, 224, 0) 1px),
    linear-gradient(90deg, rgba(198, 209, 224, .045) 1px, rgba(198, 209, 224, 0) 1px),
    linear-gradient(180deg, #10233F 0%, var(--navy-deep) 340px);
  background-size: auto, auto, 44px 44px, 44px 44px, auto;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  min-height: 100vh;
}
::selection { background: var(--verm); color: var(--paper); }
a { color: var(--verm-soft); text-decoration-color: rgba(217, 79, 48, .45); text-underline-offset: 3px; }
a:hover { color: #FFB4A0; }
:focus-visible { outline: 2px solid var(--verm); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 22px 20px 8px; }

/* 字級節奏：頁面標題／區塊標題／卡片標題／內文／註腳 */
h1 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4.6vw, 34px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .03em;
  margin: 6px 0 14px;
}
h2 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.4;
  margin: 26px 0 12px;
}
p { margin: 0 0 12px; }
.num, .deal-time, .deal-price, .plan-price, .admin-table td, .admin-table th {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 20px;
  background: rgba(12, 25, 48, .85);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(2, 8, 20, .35);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--paper);
}
.main-nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  margin-left: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  color: var(--mist);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 999px;
  transition: color .18s ease, background-color .18s ease;
}
.main-nav a:hover { color: var(--paper); background: rgba(247, 243, 236, .08); }
.header-actions { margin-left: 14px; flex: 0 0 auto; }
.header-actions .nav-cta {
  display: inline-block;
  color: #FFF1E6;
  text-decoration: none;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--verm), var(--verm-deep));
  box-shadow: 0 4px 16px rgba(217, 79, 48, .35);
}
.header-actions .nav-cta:hover { color: #fff; background: linear-gradient(135deg, #E55A39, var(--verm)); }

/* ---------- 頁尾連結列 ---------- */
.footer-links { margin-top: 10px; }
.footer-links a { color: var(--mist); text-decoration: none; }
.footer-links a:hover { color: var(--paper); text-decoration: underline; }

/* ---------- 分類頁交叉連結（機票 ↔ Bug Fare） ---------- */
.cat-cross { margin: 2px 0 10px; font-size: 14px; }
.cat-cross a { color: var(--verm); text-decoration: none; font-weight: 600; }
.cat-cross a:hover { text-decoration: underline; }

/* ---------- 手機底部導覽列（僅 ≤767px 顯示） ---------- */
.tabbar { display: none; }
.tabbar-item svg { display: block; }

/* ---------- 頁尾 ---------- */
.site-footer {
  max-width: var(--wrap);
  margin: 34px auto 0;
  padding: 18px 20px calc(30px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.7;
}
.site-footer p { margin: 0 0 6px; }

/* ---------- 即時指示 ---------- */
.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--st-verified);
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(62, 213, 152, .45);
  animation: live-pulse 2.2s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 213, 152, .45); }
  70% { box-shadow: 0 0 0 9px rgba(62, 213, 152, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 213, 152, 0); }
}
.wall-head h1 { display: flex; align-items: center; }
.wall-head h1 .live-dot { flex: none; }

/* ---------- 狀態晶片 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2.5px 10px 2.5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(198, 209, 224, .08);
  color: var(--mist);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .04em;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.chip-cat {
  background: linear-gradient(135deg, var(--verm), var(--verm-deep));
  border-color: rgba(217, 79, 48, .0);
  color: #FFF1E6;
  box-shadow: 0 3px 12px rgba(217, 79, 48, .30);
}
.chip-cat::before { display: none; }
.st-unverified { background: rgba(245, 179, 1, .15); border-color: rgba(245, 179, 1, .45); color: var(--st-unverified); }
.st-verified { background: rgba(29, 158, 108, .18); border-color: rgba(62, 213, 152, .42); color: var(--st-verified); }
.st-invalid { background: rgba(192, 57, 43, .18); border-color: rgba(255, 122, 104, .42); color: var(--st-invalid); }
.st-ended { background: rgba(122, 135, 148, .20); border-color: rgba(167, 180, 192, .38); color: var(--st-ended); }

/* ---------- 版本標示與通知 ---------- */
.version-badge {
  border-radius: var(--radius-s);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.7;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 0 0 18px;
}
.version-badge.is-live { border-color: rgba(62, 213, 152, .40); background: linear-gradient(165deg, rgba(29, 158, 108, .16), rgba(29, 158, 108, .05)); }
.version-badge.is-delayed { border-color: rgba(245, 179, 1, .38); background: linear-gradient(165deg, rgba(245, 179, 1, .13), rgba(245, 179, 1, .04)); }
.notice {
  background: var(--glass);
  border: 1px dashed rgba(198, 209, 224, .35);
  border-radius: var(--radius-s);
  padding: 14px 16px;
  color: var(--ink-dim);
  margin: 0 0 18px;
}
.unverified-banner {
  background: linear-gradient(165deg, rgba(192, 57, 43, .22), rgba(192, 57, 43, .10));
  border: 1.5px solid rgba(255, 122, 104, .55);
  color: #FFD9D3;
  border-radius: var(--radius-s);
  padding: 13px 16px;
  font-weight: 700;
  line-height: 1.7;
  margin: 0 0 16px;
  box-shadow: 0 10px 28px rgba(120, 20, 8, .35);
}

/* ---------- 消息卡片（即時牆／分類／台灣／後台佇列共用） ---------- */
.deal-list { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 8px; }
.deal-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 15px 21px;
  margin-bottom: 14px;
  overflow: hidden;
}
.deal-list .deal-card { margin-bottom: 0; }
.deal-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--verm), rgba(217, 79, 48, .12));
}
.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.deal-time { letter-spacing: .02em; white-space: nowrap; }
.deal-title {
  margin: 9px 0 5px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .01em;
}
.deal-title a { color: var(--paper); text-decoration: none; }
.deal-title a:hover { color: #FFD9CE; text-decoration: underline; text-decoration-color: rgba(217, 79, 48, .55); text-underline-offset: 4px; }
.deal-price {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .015em;
  color: var(--paper);
}

/* ---------- 單篇頁 ---------- */
.deal-detail h1 { margin-bottom: 16px; }
.deal-block {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin: 0 0 14px;
}
.deal-block h2 {
  font-size: 17px;
  margin: 0 0 10px;
  padding-left: 11px;
  border-left: 3px solid var(--verm);
  line-height: 1.35;
}
.deal-block ul { margin: 0; padding: 0; list-style: none; }
.deal-block ul li {
  padding: 7.5px 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-wrap: break-word;
}
.deal-block ul li:first-child { padding-top: 2px; }
.deal-block ul li:last-child { border-bottom: 0; padding-bottom: 2px; }
.deal-block p { margin: 0 0 8px; }
.deal-block p:last-child { margin-bottom: 0; }
.block-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.block-status .deal-time { color: var(--ink-dim); font-size: 13px; }
.btn-book {
  display: inline-block;
  background: linear-gradient(135deg, var(--verm), var(--verm-deep));
  color: #FFF4EC;
  padding: 13px 28px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: .03em;
  box-shadow: 0 8px 24px rgba(217, 79, 48, .38);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn-book:hover { color: #fff; box-shadow: 0 10px 30px rgba(217, 79, 48, .5); }
.deal-sources { font-size: 12.5px; color: var(--ink-faint); }
.deal-sources h2 { font-size: 14.5px; }
.deal-sources ul li { border-bottom-color: rgba(198, 209, 224, .06); }

/* ---------- 訂閱方案 ---------- */
.plan-list { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 6px 0 16px; }
.plan-card {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
  text-align: center;
}
.plan-card h2 { margin: 0 0 4px; font-size: 18px; }
.plan-price { font-size: 31px; font-weight: 800; line-height: 1.3; margin: 2px 0; color: var(--paper); }
.plan-perday { margin: 0; font-size: 13px; color: var(--ink-dim); }

/* ---------- 表單（登入／註冊／後台） ---------- */
.auth-form, .admin-form {
  display: grid;
  gap: 13px;
  max-width: 440px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 14px 0;
}
.admin-form { max-width: 520px; }
.auth-form label, .admin-form label {
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mist);
  text-align: left;
}
.auth-form input, .admin-form input, .admin-form select,
.admin-table input, .admin-table select, .inline-form input, .inline-form select {
  padding: 10px 12px;
  border: 1px solid rgba(198, 209, 224, .28);
  border-radius: 9px;
  font-size: 16px;
  font-family: inherit;
  color: var(--paper);
  background: rgba(9, 19, 36, .6);
  width: 100%;
}
.auth-form input:focus, .admin-form input:focus, .admin-form select:focus,
.admin-table input:focus, .admin-table select:focus,
.inline-form input:focus, .inline-form select:focus {
  border-color: var(--verm);
  box-shadow: 0 0 0 3px rgba(217, 79, 48, .22);
  outline: none;
}
.auth-form .btn-book { width: 100%; text-align: center; }
.form-note { font-size: 13.5px; color: var(--ink-dim); }
button {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper);
  background: rgba(247, 243, 236, .09);
  border: 1px solid rgba(198, 209, 224, .30);
  border-radius: 9px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}
button:hover { background: rgba(217, 79, 48, .22); border-color: rgba(217, 79, 48, .55); }
.btn-book { border: 0; } /* 漸層主按鈕不套用一般按鈕邊框 */

/* ---------- 後台表格 ---------- */
.tbl-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  background: rgba(10, 21, 39, .45);
}
.admin-table { border-collapse: collapse; width: 100%; font-size: 13.5px; background: transparent; }
.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid rgba(198, 209, 224, .05);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  color: var(--ink-dim);
}
.admin-table th {
  background: rgba(198, 209, 224, .09);
  color: var(--paper);
  font-weight: 700;
  letter-spacing: .03em;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table th:last-child, .admin-table td:last-child { border-right: 0; }
.cell-url { word-break: break-all; white-space: normal; min-width: 180px; max-width: 280px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; padding: 6px 9px; font-size: 14px; }
.input-num { width: 88px; flex: none; }
.admin-table .input-num { width: 84px; }

/* ---------- 斷點：平板兩欄 ---------- */
@media (min-width: 768px) {
  .deal-list { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .plan-list { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .deal-block.spec-block ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; }
  .deal-block.spec-block ul li:nth-child(2) { padding-top: 2px; }
  .deal-block.spec-block ul li:nth-last-child(2):nth-child(odd) { border-bottom: 0; padding-bottom: 2px; }
}

/* ---------- 斷點：桌機多欄 ---------- */
@media (min-width: 1200px) {
  .deal-list { grid-template-columns: repeat(3, 1fr); }
  .plan-list { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 互動細節（限可懸停裝置） ---------- */
@media (hover: hover) and (min-width: 768px) {
  .deal-card, .plan-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
  .deal-card:hover, .plan-card:hover {
    transform: translateY(-3px);
    border-color: rgba(198, 209, 224, .34);
    box-shadow: var(--shadow-lift);
  }
  .btn-book:hover { transform: translateY(-1px); }
}

/* ---------- 斷點：手機 ---------- */
@media (max-width: 767px) {
  body { font-size: 15px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .wrap { padding: 16px 14px 4px; }
  .site-header { padding: 8px 14px; gap: 6px 10px; flex-wrap: nowrap; }
  .brand-logo { height: 33px; }
  .brand-text { font-size: 17px; }
  .main-nav { display: none; }
  .header-actions { margin-left: auto; }
  .header-actions .nav-cta { font-size: 13.5px; padding: 7px 13px; }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(12, 25, 48, .92);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
    backdrop-filter: blur(14px) saturate(1.25);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(2, 8, 20, .35);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 7px 0 6px;
    color: var(--mist);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar-item svg { width: 22px; height: 22px; }
  .tabbar-item.is-active { color: var(--paper); }
  .tabbar-item.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: var(--verm);
  }
  .site-footer { padding-left: 14px; padding-right: 14px; }
  .deal-card { padding: 14px 15px 13px 18px; }
  .deal-title { font-size: 16.5px; }
  .deal-price { font-size: 19.5px; }
  .deal-block { padding: 14px 16px; }
  .btn-book { padding: 12px 24px; font-size: 16px; }
  .plan-price { font-size: 27px; }
  .auth-form, .admin-form { padding: 16px; }
}

/* ---------- 減動效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .deal-card, .plan-card, .btn-book, button, .main-nav a { transition: none; }
}
