:root {
  --bg: #f7f3ea;
  --panel: #fff;
  --ink: #242424;
  --muted: #6f6a5f;
  --line: #e4d8bf;
  --brand: #2f2f2f;
  --brand-dark: #1f1f1f;
  --accent: #b89b5e;
  --soft: #f0e6d2;
  --danger: #b43820;
  --danger-soft: #fff5f2;
  --shadow: 0 16px 45px rgba(31, 41, 51, 0.1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1rem; font-weight: 900; letter-spacing: .04em; }
h2 { margin-bottom: 0; font-size: clamp(1.35rem, 2.4vw, 2rem); }
h3 { margin-bottom: 14px; font-size: 1.08rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 80px;
  padding: 0 clamp(18px, 10vw, 168px);
  border-bottom: 1px solid rgba(0,0,0,.05);
  background: rgba(247, 243, 234, .92);
  color: var(--ink);
  backdrop-filter: blur(14px);
}
.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; align-items: center; }
.topbar > div:first-child .eyebrow {
  margin: 0 0 2px;
  color: #2b2b2b;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: none;
}
.topbar h1 {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .28em;
}
.brand-subtitle { margin: 2px 0 0; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .28em; }
.eyebrow { margin-bottom: 6px; color: var(--accent); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
.muted { color: var(--muted); line-height: 1.65; }
.view-tabs { display: inline-flex; gap: clamp(24px, 4vw, 54px); padding: 0; border: 0; border-radius: 0; background: transparent; }
.view-tabs button { min-height: 40px; border: 0; border-radius: 0; padding: 0; background: transparent; color: #3d3d3d; font-weight: 900; }
.view-tabs button.active { background: transparent; color: var(--accent); }
.auth-chip, .bell-button, .outline-on-dark {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  padding: 0 13px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}
.bell-button { position: relative; border-radius: 6px; }
.bell-button i { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: #ff725e; }
.outline-on-dark { border-radius: 6px; background: var(--brand); color: #fff; }

main { width: min(1440px, 100%); margin: 0 auto; padding: clamp(20px, 4vw, 48px); }
main { width: 100%; max-width: none; padding: 0; }
.page-heading, .shop-layout { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }
.page-heading { margin-top: 42px; }
.view { display: none; }
.view.active { display: block; }
.page-heading, .filter-header, .section-title-row, .metric-grid, .action-row, .quick-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.page-heading { margin-bottom: 24px; }
.result-count, .stat-sub { color: var(--muted); font-weight: 800; }
.shop-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.entry-hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 0;
  border-radius: 0;
  min-height: calc(100vh - 80px);
  padding: clamp(92px, 12.5vh, 150px) clamp(28px, 5.1vw, 104px) clamp(80px, 12vh, 140px);
  background:
    linear-gradient(90deg, rgba(31,31,31,.6), rgba(31,31,31,.08) 60%, rgba(31,31,31,.03)),
    linear-gradient(0deg, rgba(31,31,31,.7), rgba(31,31,31,0) 45%),
    url("https://fuyuntravel.com/hero-bus-sunny.png") center/cover;
  color: #fff;
  box-shadow: var(--shadow);
}
.entry-copy h2 { max-width: none; margin: 30px 0 52px; color: #ffe600; font-size: clamp(3.6rem, 5.15vw, 5.3rem); line-height: 1.02; white-space: nowrap; text-shadow: 0 4px 18px rgba(0,0,0,.85); }
.entry-copy p:not(.eyebrow) { display: none; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 14px; align-self: flex-start; }
.entry-actions .primary-button, .entry-actions .secondary-button { width: 100%; }
.entry-actions .primary-button, .entry-actions .secondary-button { width: auto; min-width: 158px; min-height: 68px; padding-inline: 34px; font-size: 1.08rem; }
.link-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.brand-quick-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: -138px clamp(28px, 5.1vw, 104px) 34px;
  position: relative;
  z-index: 2;
}
.brand-quick-links button {
  min-height: 126px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 24px;
  background: rgba(0,0,0,.62);
  color: #fff;
  text-align: left;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.brand-quick-links button:hover {
  transform: translateY(-4px);
  background: #c8ad72;
  color: #242424;
}
.brand-quick-links strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.55rem;
}
.brand-quick-links span {
  font-weight: 800;
  opacity: .82;
}
.top-inquiry { min-height: 46px; background: var(--brand); color: #fff; }
.top-login { min-height: 46px; border-color: #c40000; color: var(--ink); background: transparent; font-size: 1.15rem; font-weight: 500; }
.floating-bell { display: none; position: fixed; right: 18px; bottom: 18px; z-index: 25; background: var(--brand); color: #fff; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.info-card { min-height: 190px; }
.platform-dock { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; width: min(1280px, calc(100% - 48px)); margin: 0 auto 34px; }
.platform-dock button { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 0 14px; background: #fff; color: var(--brand); font-weight: 900; }
.filter-panel, .card, .login-card, .admin-panel, .notification-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.filter-panel { position: sticky; top: 18px; padding: 22px; }
.search-box, label { display: grid; gap: 8px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 90px; padding-top: 10px; resize: vertical; }
.filter-group { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.filter-group-title { margin-bottom: 12px; font-weight: 900; }
.tag-list, .admin-options { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-checkbox input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tag-checkbox span { display: inline-flex; min-height: 36px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 0 13px; background: #fff; font-weight: 800; }
.tag-checkbox input:checked + span { border-color: var(--brand); background: var(--soft); color: var(--brand-dark); }

.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tour-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.tour-image { position: relative; min-height: 190px; background: #dde6e3; }
.tour-image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.badge-row { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge, .role-badge, .status-badge { display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; padding: 0 10px; background: rgba(15,51,54,.88); color: #fff; font-size: .8rem; font-weight: 900; }
.role-badge, .status-badge { background: var(--soft); color: var(--brand-dark); }
.tour-content { padding: 16px; }
.tour-title { min-height: 54px; margin-bottom: 10px; line-height: 1.45; }
.tour-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: .92rem; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.price { color: var(--accent); font-size: 1.2rem; font-weight: 900; }
.stock { color: var(--brand-dark); font-weight: 900; }

.primary-button, .secondary-button, .ghost-button, .detail-button, .danger-button, .small-button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 900;
}
.primary-button, .detail-button { background: var(--brand); color: #fff; }
.primary-button:hover, .detail-button:hover { background: var(--brand-dark); }
.secondary-button, .small-button { border-color: var(--line); background: #fff; color: var(--brand-dark); }
.ghost-button { min-height: 34px; background: transparent; color: var(--brand); padding: 0; }
.danger-button { border-color: #f4b4a4; background: var(--danger-soft); color: var(--danger); }
.empty-state { border: 1px dashed var(--line); border-radius: 8px; padding: 44px 24px; background: #fff; color: var(--muted); text-align: center; font-weight: 900; }
.hidden { display: none !important; }

.auth-page { min-height: 62vh; display: none; place-items: center; }
.auth-page.active { display: grid; }
.login-card { width: min(520px, 100%); padding: 28px; display: grid; gap: 16px; }
.quick-login-row .secondary-button { flex: 1; }
.register-box { display: grid; gap: 10px; border-radius: 8px; padding: 14px; background: var(--soft); }

.detail-layout, .admin-grid, .member-grid, .checkout-layout, .account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}
.card, .admin-panel { padding: 22px; }
.hero-photo { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.review-list, .order-list, .notification-list { display: grid; gap: 12px; }
.review-item, .order-item, .notification-item { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; }
.checkout-with-seats {
  display: block;
  width: min(1152px, calc(100% - 48px));
  margin: 42px auto;
}
.checkout-with-seats > form.card {
  display: grid;
  gap: 14px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.checkout-with-seats > form.card > label,
.checkout-with-seats > form.card > .primary-button,
.checkout-with-seats > form.card > .form-message,
.checkout-with-seats > aside.card {
  max-width: 720px;
}
.checkout-with-seats > form.card > label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.checkout-with-seats > aside.card {
  margin-top: 18px;
}
.bus-seat-layer {
  display: grid;
  gap: 24px;
  margin: 10px 0 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.seat-layer-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid #dbe3ee;
  padding-bottom: 18px;
}
.seat-layer-header h3 {
  margin-bottom: 8px;
  color: #020617;
  font-size: 1.5rem;
}
.bus-seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #475569;
  font-weight: 800;
}
.seat-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.seat-state::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: inline-block;
}
.seat-state.available::before { background: #e0f2fe; border: 2px solid #7dd3fc; }
.seat-state.selected::before { background: #10b981; border: 2px solid #10b981; }
.seat-state.occupied::before { background: #cbd5e1; border: 2px solid #cbd5e1; }
.bus-front {
  min-height: 70px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 900;
}
.bus-columns,
.bus-seat-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 12px;
}
.bus-columns {
  color: #64748b;
  font-weight: 900;
  text-align: center;
}
.bus-seat-map { align-items: stretch; }
.seat-button,
.bus-aisle,
.bus-front-space {
  min-height: 4.35rem;
  border-radius: 8px;
}
.seat-button {
  border: 1px solid #7dd3fc;
  background: #e0f2fe;
  color: #0c4a6e;
  padding: 10px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.4;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.seat-button.available:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.16);
  background: #bae6fd;
}
.seat-button.selected {
  border-color: #059669;
  background: #10b981;
  color: #fff;
  box-shadow: 0 8px 16px rgba(16, 185, 129, .18);
}
.seat-button.occupied,
.seat-button:disabled {
  border-color: #cbd5e1;
  background: #cbd5e1;
  color: #64748b;
}
.bus-aisle {
  border: 1px dashed #dbe3ee;
  background: #fff;
}
.bus-front-space {
  border: 1px dashed #dbe3ee;
  background: #f8fafc;
}
.seat-selected-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}
.seat-selected-box p {
  margin-bottom: 6px;
  color: #64748b;
  font-size: .85rem;
  font-weight: 900;
}
.seat-selected-box strong {
  color: #020617;
  font-size: 1.2rem;
}
.seat-selected {
  margin-bottom: 0;
  color: var(--brand-dark);
  font-weight: 900;
}
.metric-grid { align-items: stretch; }
.metric { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; }
.metric strong { display: block; font-size: 1.6rem; color: var(--brand-dark); }
.admin-stack { display: grid; gap: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .86rem; }
.table-title { font-weight: 900; }
.table-sub { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.form-message { min-height: 22px; margin-bottom: 0; color: var(--brand-dark); font-weight: 900; }
.notification-panel { position: fixed; right: 18px; top: 94px; width: min(380px, calc(100vw - 36px)); z-index: 20; padding: 16px; }
.toast-root { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 30; }
.toast { width: min(360px, calc(100vw - 36px)); border-radius: 8px; padding: 14px; background: #0f3336; color: #fff; box-shadow: var(--shadow); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.preview-card { display: grid; gap: 12px; align-content: start; min-height: 190px; }
.preview-card .primary-button, .preview-card .secondary-button { width: 100%; }
.push-consent {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(720px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.push-consent p { margin-bottom: 0; color: var(--muted); }
.ft-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}
.ft-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .62);
  backdrop-filter: blur(6px);
}
.ft-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(940px, 100%);
  max-height: min(90vh, 980px);
  overflow: auto;
  border: 1px solid #e2d6bd;
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}
.ft-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.ft-modal-head h2 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}
.ft-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ft-field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}
.ft-field span {
  color: #5f5648;
  font-size: .92rem;
}
.ft-field.full { grid-column: 1 / -1; }
.ft-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ft-check {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fffaf0;
}
.ft-check input { width: auto; min-height: auto; }
.ft-security-note {
  margin: 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 800;
}
.ft-inquiry-admin {
  display: grid;
  gap: 14px;
}
.ft-audit {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffaf0;
}
.ft-audit summary {
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 960px) {
  .topbar, .page-heading { align-items: stretch; flex-direction: column; }
  .topbar-actions, .view-tabs { width: 100%; }
  .view-tabs button, .outline-on-dark, .bell-button { flex: 1; }
  .shop-layout, .detail-layout, .admin-grid, .member-grid, .checkout-layout, .account-layout, .entry-hero, .brand-quick-links { grid-template-columns: 1fr; }
  .brand-quick-links { margin: -36px 0 28px; }
  .filter-panel { position: static; }
}
@media (max-width: 600px) {
  main { padding-inline: 14px; }
  .tour-grid, .form-grid { grid-template-columns: 1fr; }
  .card-footer, .metric-grid { flex-direction: column; align-items: stretch; }
  .entry-actions { grid-template-columns: 1fr; }
  .entry-hero { padding-inline: 18px; }
  .entry-copy h2 {
    max-width: 100%;
    white-space: normal;
    font-size: clamp(2.6rem, 12vw, 3.4rem);
  }
  .checkout-with-seats {
    width: calc(100% - 24px);
    margin-top: 24px;
  }
  .checkout-with-seats > form.card {
    min-width: 0;
  }
  .bus-seat-layer {
    min-width: 0;
    overflow-x: auto;
    padding: 14px;
  }
  .seat-layer-header {
    min-width: 600px;
  }
  .bus-front,
  .bus-columns,
  .bus-seat-map,
  .seat-selected-box {
    min-width: 600px;
  }
  .bus-columns,
  .bus-seat-map {
    grid-template-columns: repeat(5, minmax(104px, 1fr));
  }
  .ft-form-grid {
    grid-template-columns: 1fr;
  }
  .ft-modal-head {
    flex-direction: column;
  }
}
