@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
    U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url("/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #fffaf3;
  --surface: #ffffff;
  --surface-soft: #fff3e4;
  --border: #eedec9;
  --text: #2a241f;
  --muted: #6e6359;
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: #ffedd5;
  --green: #15803d;
  --green-soft: #dcfce7;
  --blue: #0369a1;
  --blue-soft: #e0f2fe;
  --gold: #b45309;
  --gold-soft: #fef3c7;
  --shadow: 0 8px 24px -8px rgba(74, 47, 20, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Twemoji Country Flags", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  padding-bottom: 96px;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 頂部導覽列 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 250, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-outline {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

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

.btn-outline.active {
  background: var(--gold-soft);
  border-color: #f59e0b;
  color: var(--gold);
}

/* 主視覺＆雙模式切換 */
.hero {
  padding: 24px 0 18px;
}

.hero-card {
  background: linear-gradient(135deg, #fff7ed 0%, #fefce8 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

/* 篩選面板 */
.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  min-width: 112px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.chip.rescue.active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.chip.hot {
  border-color: #f97316;
  background: #fff7ed;
  color: #c2410c;
}

.chip.hot.active {
  background: linear-gradient(135deg, #ef4444, #ea580c);
  border-color: #dc2626;
  color: #ffffff;
}

.search-bar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.search-input-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.sort-select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

/* 結果統計列 */
.results-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}

.results-meta strong {
  color: var(--primary);
}

/* 卡片網格 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.spot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.spot-card:hover {
  transform: translateY(-2px);
  border-color: #fdba74;
}

.event-banner {
  background: linear-gradient(135deg, #fee2e2, #ffedd5);
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-limited {
  background: #dc2626;
  color: #ffffff;
}

.badge-gem {
  background: #ede9fe;
  color: #6d28d9;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.badge-region {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.badge-cat {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-free {
  background: var(--green-soft);
  color: var(--green);
}

.energy-meter {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.highlights-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.highlight-pill {
  font-size: 12px;
  background: var(--surface-soft);
  color: #7c2d12;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 600;
}

.spec-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.spec-item {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 8px;
}

.spec-map-link {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 3px 9px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.spec-map-link:hover {
  background: #dbeafe;
  color: #1e40af;
}

.tip-box {
  background: #fdfbf7;
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  color: var(--text);
}

.tip-box p {
  margin: 0 0 6px;
}

.tip-box p:last-child {
  margin-bottom: 0;
}

/* 站長分潤視角框 */
.admin-monetization-box {
  display: none;
  background: var(--gold-soft);
  border: 1.5px dashed #d97706;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #78350f;
}

body.admin-mode .admin-monetization-box {
  display: block;
}

.daily-promo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 15px;
  background: linear-gradient(135deg, #fff1f2 0%, #fffbeb 65%, #fef3c7 100%);
  border: 1.5px solid #fda4af;
  border-radius: 14px;
  font-size: 12.5px;
}

.daily-promo-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #881337;
  font-weight: 700;
}

.daily-promo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e11d48;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
}

.daily-promo-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.daily-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #fb7185;
  color: #be123c;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.daily-promo-btn:hover {
  background: #ffe4e6;
  color: #9f1239;
}

.flight-deal-bar[hidden] {
  display: none !important;
}

.flight-deal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 11px 15px;
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 55%, #fff7ed 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
}

.flight-deal-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.flight-deal-route {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e3a8a;
}

.flight-deal-price {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ea580c;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.flight-deal-note {
  font-size: 12.5px;
  color: #475569;
  font-weight: 600;
}

.flight-deal-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 15px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease;
}

.flight-deal-cta:hover {
  background: #1d4ed8;
}

.gear-bar {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
  padding: 12px 15px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  font-size: 12.5px;
}

.gear-bar.jp-mode {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.gear-bar.jp-mode .gear-bar-label {
  color: #3730a3;
}

.gear-bar.asia-mode {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.gear-bar.asia-mode .gear-bar-label {
  color: #065f46;
}

.gear-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.gear-bar-label {
  font-weight: 800;
  font-size: 13.5px;
  color: #92400e;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gear-toggle-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gear-toggle-btn:hover {
  background: #ffffff;
}

.gear-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gear-bar.collapsed .gear-rows {
  display: none;
}

.gear-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.gear-row-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin-right: 2px;
}

.gear-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #f59e0b;
  color: #b45309;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.gear-pill:hover {
  background: #fef3c7;
  color: #92400e;
}

.gear-pill.trip {
  border-color: #6366f1;
  color: #4338ca;
  background: #eef2ff;
}

.gear-pill.trip:hover {
  background: #e0e7ff;
  color: #312e81;
}

.gear-pill.hotel {
  border-color: #3b82f6;
  color: #1d4ed8;
  background: #eff6ff;
}

.gear-pill.hotel:hover {
  background: #dbeafe;
  color: #1e40af;
}

.gear-pill.ticket {
  border-color: #14b8a6;
  color: #0f766e;
  background: #f0fdfa;
}

.gear-pill.ticket:hover {
  background: #ccfbf1;
  color: #115e59;
}

.shopee-tip-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #d97706;
  text-decoration: none;
}

.shopee-tip-link:hover {
  text-decoration: underline;
  color: #b45309;
}

.promo-banner {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-promo-hint {
  margin: 6px 0 2px;
  padding: 6px 10px;
  border-radius: 9px;
  background: #fff7ed;
  border: 1px dashed #fdba74;
  color: #9a3412;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
}

.card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}

.card-actions.grid-2x2 > a,
.card-actions.grid-2x2 > button {
  flex: 1 1 calc(50% - 4px);
}

.btn-cta,
.btn-cta-agoda,
.btn-cta-kkday,
.btn-cta-booking,
.btn-cta-trip {
  flex: 1;
  min-width: 120px;
  text-decoration: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-cta:hover {
  background: var(--primary-hover);
}

.btn-cta-agoda {
  background: #2563eb;
}

.btn-cta-agoda:hover {
  background: #1d4ed8;
}

.btn-cta-booking {
  background: #003b95;
}

.btn-cta-booking:hover {
  background: #002b6e;
}

.btn-cta-trip {
  background: #4f46e5;
}

.btn-cta-trip:hover {
  background: #4338ca;
}

.btn-cta-kkday {
  background: #0891b2;
}

.btn-cta-kkday:hover {
  background: #0e7490;
}

.btn-plan {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-plan.selected {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}

/* 空狀態 */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 18px;
}

/* 底部浮動 LINE 提案列 */
.floating-plan-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 720px;
  background: #2a241f;
  color: #ffffff;
  border-radius: 16px;
  padding: 12px 18px;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
  z-index: 40;
}

.btn-picked-toggle {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-picked-toggle.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #1f2937;
}

.floating-plan-bar.visible {
  display: flex;
}

.btn-line-open {
  background: #06c755;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* 彈窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  max-height: 88vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  border: none;
  background: var(--bg);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
}

.line-format-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.line-fmt-btn {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.line-fmt-btn.active {
  background: #ecfdf5;
  border-color: #06c755;
  color: #047857;
}

.line-textarea {
  width: 100%;
  min-height: 210px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: #15803d;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 640px) {
  .hero h2 {
    font-size: 20px;
  }
  .mode-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}
