* { box-sizing: border-box; }

:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --line: #e8ecf4;
  --line-2: #d8deea;
  --text: #222;
  --text-2: #555;
  --text-3: #666;
  --purple: #6a5acd;
  --purple-2: #6959d1;
  --purple-light: #f0eeff;
  --coral: #ff7a59;
  --coral-2: #ff6242;
  --coral-light: #fff0ec;
  --sun: #ffb648;
  --sun-light: #fff6e8;
  --ink: #08202d;
  --ink-2: #0f2d3c;
  --plum: #48324f;
  --plum-2: #5c4266;
  --gold: #f8c68a;
  --gold-2: #cf9a54;
  --gold-light: #faf1e2;
  --taupe: #7e7267;
  --blue-bg: #eef8ff;
  --blue-text: #1565c0;
  --orange-bg: #fff4e5;
  --orange-text: #b26a00;
  --green-bg: #f3fff5;
  --green-text: #2e7d32;
  --red-bg: #fff5f5;
  --red-text: #c62828;
  --shadow: 0 10px 28px rgba(0,0,0,0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --container: min(1100px, calc(100% - 32px));
  --sidebar-w: 232px;
  --font-display: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; background: var(--bg); color: var(--text); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.page-wrap { width: var(--container); margin: 0 auto; padding: 24px 0 48px; }
.page-header { text-align: center; margin-bottom: 28px; }
.page-title { margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); font-weight: 700; font-family: var(--font-display); letter-spacing: -0.2px; }
.page-subtitle { margin: 0; font-size: 14px; color: var(--text-3); }

.status-box { margin-bottom: 20px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.status-box.loading { color: var(--purple); font-weight: 700; }
.status-box.error { color: var(--red-text); background: var(--red-bg); border-color: #ffd7d7; }
.status-box.success { color: var(--green-text); background: var(--green-bg); border-color: #cfead2; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h3 { margin: 0 0 10px; font-size: 17px; }

.btn { display: inline-block; padding: 12px 20px; border: none; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--purple), var(--purple-2)); color: #fff; font-weight: 800; font-size: 15px; transition: 0.2s; }
.btn:hover:not(:disabled) { opacity: 0.92; transform: translateY(-1px); }
.btn:disabled { background: #c8ccd8; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--purple); border: 1px solid var(--purple); }
.btn.danger { background: var(--red-text); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.coral { background: linear-gradient(135deg, var(--ink), var(--plum)); box-shadow: 0 10px 22px rgba(8,32,45,0.22); }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--ink); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-md);
  font-size: 15px; outline: none; transition: 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(106,90,205,0.1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.tour-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tour-card .meta { color: var(--text-3); font-size: 13px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.open { background: var(--green-bg); color: var(--green-text); }
.badge.full { background: var(--orange-bg); color: var(--orange-text); }
.badge.closed { background: var(--red-bg); color: var(--red-text); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--text-3); font-weight: 700; }

.traveler-block { border: 1px dashed var(--line-2); border-radius: var(--radius-md); padding: 14px; margin-bottom: 12px; position: relative; }
.traveler-block .remove-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--red-text); font-size: 13px; }

#loginOverlay { position: fixed; inset: 0; background: linear-gradient(135deg, #ede9ff 0%, #f0f4ff 100%); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.login-card { background: #fff; border-radius: var(--radius-xl); box-shadow: 0 24px 60px rgba(106,90,205,0.15); padding: 40px 32px; width: min(380px, calc(100% - 32px)); text-align: center; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-md); margin-bottom: 10px; text-align: center; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--purple-light); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.login-error { color: var(--red-text); margin-top: 10px; font-size: 13px; min-height: 16px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.topbar a { color: var(--purple); text-decoration: none; font-weight: 700; margin-left: 14px; }

.seat-map-wrap { overflow-x: auto; padding-bottom: 8px; }
.seat-map { display: grid; gap: 10px; }
.seat-cell-base, .seat, .block, .empty-cell { min-width: 68px; min-height: 56px; border-radius: 10px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; }
.seat { background: var(--purple-light); color: var(--purple); cursor: pointer; border: 1px solid var(--line-2); flex-direction: column; gap: 2px; }
.seat:hover { opacity: 0.85; }
.seat.taken { background: #e2e2e2; color: #999; cursor: not-allowed; }
.seat.selected { background: var(--purple); color: #fff; font-weight: 800; }
.block { background: #f1f1f1; color: var(--text-3); font-weight: 700; white-space: pre-line; }
.empty-cell { background: transparent; }

/* ================= 前台旅遊網站風格（星宇航空質感參考） ================= */

.site-header { background: rgba(255,255,255,0.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; transition: background 0.25s, box-shadow 0.25s, border-color 0.25s; }
.site-header.scrolled { box-shadow: 0 6px 22px rgba(8,32,45,0.1); }
.site-header-inner { width: var(--container); margin: 0 auto; padding: 16px 0; display: flex; align-items: center; justify-content: space-between; }
.site-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: 0.2px; text-decoration: none; font-family: var(--font-display); color: var(--ink); transition: color 0.25s; }
.site-brand .brand-mark { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--ink), var(--plum)); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.site-nav { display: flex; align-items: center; gap: 30px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.site-nav a { text-decoration: none; color: var(--text-2); position: relative; transition: color 0.25s; }
.site-nav a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px; background: var(--gold-2); transition: width 0.2s; }
.site-nav a:not(.nav-cta):hover::after { width: 100%; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.nav-cta { color: var(--ink); border: 1px solid var(--ink); padding: 8px 20px; font-weight: 600; letter-spacing: 0.3px; }
.site-nav a.nav-cta:hover { background: var(--ink); color: #fff; }

/* overlay header：僅首頁 hero 使用，疊在照片上，捲動後轉為實色 */
.site-header.overlay { position: absolute; top: 0; left: 0; right: 0; background: transparent; border-bottom-color: transparent; backdrop-filter: none; }
.site-header.overlay .site-brand,
.site-header.overlay .site-nav a:not(.nav-cta) { color: #fff; }
.site-header.overlay .site-nav a.nav-cta { border-color: rgba(255,255,255,0.7); color: #fff; }
.site-header.overlay.scrolled { position: fixed; background: rgba(255,255,255,0.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header.overlay.scrolled .site-brand,
.site-header.overlay.scrolled .site-nav a:not(.nav-cta) { color: var(--ink); }
.site-header.overlay.scrolled .site-nav a.nav-cta { border-color: var(--ink); color: var(--ink); }

.hero { position: relative; min-height: min(56vh, 480px); display: flex; align-items: center; overflow: hidden; background: linear-gradient(155deg, var(--ink) 0%, var(--plum) 100%); }
.hero-inner { position: relative; z-index: 2; width: var(--container); margin: 0 auto; padding: 108px 0 56px; color: #fff; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 24px; }
.hero-eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.hero-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 4.8vw, 48px); letter-spacing: 0.3px; margin: 0 0 20px; line-height: 1.35; max-width: 640px; }
.hero-subtitle { font-size: 15.5px; font-weight: 400; color: rgba(255,255,255,0.8); max-width: 460px; line-height: 1.9; margin: 0; }
@media (max-width: 700px) { .hero { min-height: 420px; } .hero-inner { padding: 100px 0 48px; } }

.hero-highlights { display: flex; flex-wrap: wrap; gap: 16px 44px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.hero-highlight { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.hero-highlight .ico { font-size: 15px; color: var(--plum); flex-shrink: 0; }

.filter-tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line); margin: 4px 0 36px; overflow-x: auto; }
.filter-tab { padding: 4px 1px 15px; font-size: 13.5px; font-weight: 500; color: var(--text-3); background: none; border: none; cursor: pointer; position: relative; white-space: nowrap; transition: color 0.15s; }
.filter-tab:hover { color: var(--ink); }
.filter-tab.active { color: var(--ink); font-weight: 700; }
.filter-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold-2); }

.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin: 76px 0 30px; flex-wrap: wrap; gap: 8px; }
.section-title-row:first-child { margin-top: 0; }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 2.2vw, 24px); letter-spacing: -0.1px; margin: 0; color: var(--ink); }
.section-hint { font-size: 12.5px; color: var(--text-3); }

.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 36px 28px; }
.tour-gcard { background: transparent; border: none; box-shadow: none; border-radius: 0; overflow: visible; display: flex; flex-direction: column; animation: fadeInUp 0.5s ease both; }
.tour-gcard-img { height: 230px; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--ink), var(--plum)); }
.tour-gcard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.tour-gcard:hover .tour-gcard-img img { transform: scale(1.045); }
.tour-gcard-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,32,45,0) 52%, rgba(8,32,45,0.68) 100%); pointer-events: none; }
.tour-gcard-caption { position: absolute; left: 16px; right: 16px; bottom: 13px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; color: #fff; font-size: 12.5px; font-weight: 500; letter-spacing: 0.2px; text-shadow: 0 1px 8px rgba(0,0,0,0.35); }
.tour-gcard-tag { color: var(--gold); font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; font-size: 10.5px; }
.tour-gcard-body { padding-top: 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.tour-gcard-name { font-size: 16px; font-weight: 700; line-height: 1.45; margin: 0; color: var(--ink); }
.tour-gcard-status { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.tour-gcard-status.full { color: var(--red-text); }
.tour-gcard-status.hot { color: var(--gold-2); }
.tour-gcard-footer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.tour-gcard-price { font-size: 17px; font-weight: 700; color: var(--ink); }
.tour-gcard-price span { font-size: 11.5px; color: var(--text-3); font-weight: 400; }

.empty-block { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-block .emoji { font-size: 40px; margin-bottom: 10px; }

.features-section { padding: 12px 0 8px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px 28px; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 38px; }
.feature-card { text-align: left; }
.feature-icon { font-size: 19px; color: var(--plum); margin-bottom: 16px; }
.feature-title { font-weight: 700; font-size: 14.5px; margin: 0 0 8px; color: var(--ink); }
.feature-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.8; margin: 0; }

.steps-section { background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%); color: #fff; padding: 68px 40px; margin: 84px 0 24px; }
.steps-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(21px, 2.4vw, 27px); letter-spacing: -0.1px; text-align: center; margin: 0 0 10px; }
.steps-subtitle { text-align: center; color: rgba(255,255,255,0.55); font-size: 12.5px; margin: 0 0 48px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.step-item { text-align: center; }
.step-num { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); background: transparent; font-weight: 500; font-size: 15px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.step-title { font-weight: 600; font-size: 14px; margin: 0 0 8px; }
.step-desc { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.8; margin: 0; }

.site-footer { background: var(--taupe); color: rgba(23,17,10,0.72); padding: 0; margin-top: 68px; }
.footer-inner { width: var(--container); margin: 0 auto; padding: 56px 0 28px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: #1c140c; margin-bottom: 14px; font-family: var(--font-display); }
.footer-desc { font-size: 12.5px; line-height: 1.95; max-width: 320px; color: rgba(28,20,12,0.7); }
.footer-col-title { color: #1c140c; font-weight: 700; font-size: 12.5px; margin: 0 0 16px; letter-spacing: 0.5px; }
.footer-col a { display: block; color: rgba(28,20,12,0.66); text-decoration: none; font-size: 12.5px; margin-bottom: 13px; transition: 0.15s; }
.footer-col a:hover { color: #1c140c; }
.footer-bottom { border-top: 1px solid rgba(28,20,12,0.15); text-align: center; padding: 18px 0; font-size: 11.5px; color: rgba(28,20,12,0.55); }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ================= 後台系統排版（側邊選單） ================= */

.admin-shell { display: none; min-height: 100vh; }
.admin-sidebar { width: var(--sidebar-w); flex-shrink: 0; background: #1f1b3a; color: #cfc9ef; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 17px; color: #fff; padding: 6px 10px 22px; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--purple), var(--coral)); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-md); text-decoration: none; color: #cfc9ef; font-size: 14px; font-weight: 700; transition: 0.15s; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: linear-gradient(135deg, var(--purple), #8b7ff0); color: #fff; }
.sidebar-nav .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-logout { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-md); text-decoration: none; color: #a79fe0; font-size: 14px; font-weight: 700; margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; }
.sidebar-logout:hover { color: #fff; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topheader { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.admin-page-title { margin: 0; font-size: 20px; font-weight: 900; }
.admin-user { font-size: 13px; color: var(--text-3); font-weight: 700; background: var(--purple-light); color: var(--purple); padding: 6px 14px; border-radius: 999px; }
.admin-content { padding: 24px 28px 48px; width: 100%; max-width: 1180px; }

.mobile-nav-toggle { display: none; }

@media (max-width: 880px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
  .sidebar-brand { padding: 4px 8px; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; flex: none; }
  .sidebar-logout { margin: 0 0 0 auto; border-top: none; padding-top: 11px; }
  .admin-content { padding: 18px 16px 40px; }
  .admin-topheader { padding: 14px 16px; }
}
