:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1f1c18;
  --muted: #6d665c;
  --line: #e7e0d5;
  --brand: #c2410c;
  --brand-ink: #ffffff;
  --brand-soft: #fdeee4;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 4px 16px rgba(40, 30, 20, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Noto Sans TC", system-ui, -apple-system, "Microsoft JhengHei", sans-serif;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* ---------- 首頁頂部 ---------- */
.hero {
  background: linear-gradient(135deg, #7c2d12 0%, #c2410c 55%, #ea8a3a 100%);
  color: #fff; padding: 36px 0 32px;
}
.brand { color: #fff; text-decoration: none; font-weight: 900; font-size: 32px; letter-spacing: .04em; }
.tagline { margin: 4px 0 20px; opacity: .92; }
.search { display: flex; gap: 8px; max-width: 640px; }
.search input {
  flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 0;
  font-size: 16px; color: var(--ink); background: #fff;
}
.search input:focus { outline: 3px solid rgba(255,255,255,.55); }
.search button {
  padding: 0 22px; border: 0; border-radius: 999px; background: #1f1c18; color: #fff;
  font-weight: 700; cursor: pointer;
}

.holiday {
  background: #fff7d6; border-bottom: 1px solid #f0e2a8; padding: 10px 16px;
  text-align: center; font-size: 15px;
}
.holiday button {
  margin-left: 8px; border: 0; background: none; color: var(--brand); font-weight: 700;
  cursor: pointer; text-decoration: underline;
}

/* ---------- 篩選 ---------- */
.filters { padding-top: 20px; padding-bottom: 4px; display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.label { font-weight: 700; color: var(--muted); font-size: 14px; width: 2.5em; flex: none; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 14px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip .n { color: var(--muted); font-size: 12px; }
.chip[aria-pressed="true"] { border-color: var(--c, var(--ink)); background: var(--c, var(--ink)); color: #fff; }
.chip[aria-pressed="true"] .n { color: rgba(255,255,255,.8); }
.chip[aria-pressed="true"] .dot { background: #fff; }
#city {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px;
}

/* ---------- 結果 ---------- */
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 12px; flex-wrap: wrap; }
.result-bar p { margin: 0; font-weight: 500; }
.sort { font-size: 14px; color: var(--muted); }
.sort select { margin-left: 6px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; cursor: pointer; text-align: left; border: 0; padding: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(40,30,20,.08), 0 10px 28px rgba(40,30,20,.12); }
.card:focus-visible { outline: 3px solid var(--brand); }
.thumb { aspect-ratio: 16 / 9; position: relative; background: var(--c, #9a8f80); overflow: hidden; }
.thumb img, .d-hero img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-feat { z-index: 2; }
.thumb .ph, .d-hero .ph {
  position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.95);
  font-weight: 900; font-size: 26px; letter-spacing: .1em;
  background: linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.22) 100%);
}
.badge-feat {
  position: absolute; top: 10px; left: 10px; background: #fde047; color: #422006;
  font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
}
.card .body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--c, var(--brand)); font-weight: 500; border: 1px solid currentColor; }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--muted); }
.more { text-align: center; margin: 24px 0; }
.more button {
  border: 1px solid var(--line); background: var(--surface); padding: 10px 28px; border-radius: 999px; cursor: pointer; font-weight: 500;
}

.foot { padding-top: 24px; padding-bottom: 40px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 24px; }
.foot p { margin: 4px 0; }

/* ---------- 詳情 ---------- */
dialog {
  width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0;
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); background: var(--surface);
}
dialog::backdrop { background: rgba(20, 15, 10, .55); }
.close {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 22px; cursor: pointer;
}
.d-hero { aspect-ratio: 21 / 9; background: var(--c, #9a8f80); position: relative; overflow: hidden; }
.d-body { padding: 18px 22px 26px; }
.d-body h2 { margin: 6px 0 12px; font-size: 22px; line-height: 1.4; }
.facts { display: grid; grid-template-columns: 4.5em 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.d-body h4 { margin: 20px 0 8px; font-size: 15px; }
.desc { white-space: pre-line; color: #3b362f; font-size: 15px; }
.sessions, .nearby { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.sessions li, .nearby li { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.nearby li { display: flex; justify-content: space-between; gap: 12px; }
.nearby .km { color: var(--muted); white-space: nowrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--brand); color: var(--brand-ink);
  text-decoration: none; font-weight: 700; font-size: 14px;
}
.btn.ghost { background: none; color: var(--brand); border: 1px solid var(--brand); }
.src { font-size: 12px; color: var(--muted); margin-top: 18px; }

@media (max-width: 560px) {
  .hero { padding: 24px 0 22px; }
  .brand { font-size: 26px; }
  .label { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .d-body { padding: 14px 16px 22px; }
}
