@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;600;700&family=Noto+Sans+TC:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #17211d;
  --muted: #66706c;
  --paper: #f6f7f1;
  --white: #ffffff;
  --line: rgba(23, 33, 29, .11);
  --lime: #d7ff46;
  --green: #1f7a5a;
  --coral: #ff765c;
  --violet: #6c5ce7;
  --shadow: 0 18px 60px rgba(23, 33, 29, .13);
  --radius: 22px;
  font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); }
button, input, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(108, 92, 231, .38); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 999; top: 8px; left: 8px; transform: translateY(-150%); background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { transform: none; }

.app-shell { height: 100%; display: grid; grid-template-rows: 72px 58px minmax(0, 1fr); }
.topbar { z-index: 30; display: grid; grid-template-columns: 290px minmax(260px, 600px) 1fr; align-items: center; gap: 20px; padding: 0 24px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: inline-flex; width: max-content; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { position: relative; flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; background: var(--lime); border: 2px solid var(--ink); border-radius: 50% 50% 48% 52%; transform: rotate(-7deg); box-shadow: 3px 3px 0 var(--ink); }
.brand-mark::before, .brand-mark::after, .brand-mark i::before, .brand-mark i::after { content: ""; position: absolute; width: 3px; height: 8px; background: var(--ink); border-radius: 3px; }
.brand-mark::before { top: 5px; left: 17px; }
.brand-mark::after { bottom: 5px; left: 17px; }
.brand-mark i::before { left: 6px; top: 14px; transform: rotate(90deg); }
.brand-mark i::after { right: 6px; top: 14px; transform: rotate(90deg); }
.brand b { display: block; font: 800 1.08rem/1 "DM Sans", sans-serif; letter-spacing: .11em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; letter-spacing: .18em; }
.search { height: 44px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 0 12px 0 15px; background: #eff1eb; border: 1px solid transparent; border-radius: 15px; transition: .2s ease; }
.search:focus-within { background: #fff; border-color: rgba(108,92,231,.3); box-shadow: 0 0 0 4px rgba(108,92,231,.08); }
.search svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .92rem; }
.search input::placeholder { color: #8b928f; }
.search kbd { color: #8b928f; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; padding: 2px 7px; font: 600 .7rem "DM Sans", sans-serif; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.icon-button, .avatar, .round-button { position: relative; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; margin-top: 4px; }
.avatar { border: 0; background: var(--ink); color: var(--lime); font-weight: 800; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid #fff; border-radius: 10px; background: var(--coral); color: #fff; font: 700 .65rem/14px "DM Sans", sans-serif; }

.quick-nav { z-index: 25; display: flex; align-items: center; gap: 9px; padding: 0 24px; overflow-x: auto; scrollbar-width: none; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.quick-nav::-webkit-scrollbar, .category-row::-webkit-scrollbar { display: none; }
.quick-pill { flex: 0 0 auto; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; color: #4f5954; font-size: .84rem; font-weight: 600; transition: .18s ease; }
.quick-pill:hover { transform: translateY(-1px); border-color: #aeb5b1; }
.quick-pill.is-active { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 5px 14px rgba(23,33,29,.16); }
.quick-pill span { margin-right: 3px; }

.explore-layout { min-height: 0; display: grid; grid-template-columns: 430px minmax(0, 1fr); }
.discover-panel { z-index: 12; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 20px 28px 24px; background: var(--paper); border-right: 1px solid var(--line); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
h1 { max-width: 330px; margin: 0; font-size: clamp(1.45rem, 2.1vw, 2rem); line-height: 1.2; letter-spacing: -.04em; }
.mobile-close { display: none; }
.pulse-card { margin: 20px 0 18px; padding: 14px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; border: 1px solid rgba(31,122,90,.16); border-radius: 18px; background: linear-gradient(125deg, rgba(215,255,70,.5), rgba(255,255,255,.8)); }
.pulse-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--ink); color: var(--lime); font-size: 1.2rem; }
.pulse-card strong, .pulse-card span { display: block; }
.pulse-card strong { font-size: .84rem; }
.pulse-card span { margin-top: 2px; color: var(--muted); font-size: .73rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 205px; }
.pulse-card button { padding: 7px 10px; border: 0; border-radius: 10px; background: #fff; cursor: pointer; font-size: .72rem; font-weight: 700; box-shadow: 0 3px 10px rgba(23,33,29,.08); }
.category-row { display: flex; gap: 8px; margin-right: -20px; padding-right: 20px; overflow-x: auto; scrollbar-width: none; }
.category-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: .78rem; font-weight: 600; }
.category-chip.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.list-toolbar { height: 52px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.list-toolbar p { color: var(--muted); font-size: .8rem; }
.list-toolbar p strong { color: var(--ink); font: 700 .95rem "DM Sans", sans-serif; }
.list-toolbar label { color: var(--muted); font-size: .75rem; }
.list-toolbar select { appearance: none; margin-left: 4px; padding: 5px 22px 5px 6px; border: 0; background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 9px) 52%/5px 5px no-repeat, linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 5px) 52%/5px 5px no-repeat; color: var(--ink); font-size: .78rem; font-weight: 700; }
.event-list { padding-top: 4px; }
.source-note { margin: 9px 0 4px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.pulse-card button:disabled { opacity: .55; cursor: default; }
.pulse-card span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.event-card .price { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 65%; }
.source-link { display: inline-block; margin-top: 16px; color: var(--green); font-weight: 700; }
.place-events { display: grid; margin-top: 12px; }
.place-events button { padding: 12px 0; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.place-events small { display: block; color: var(--muted); }
.session-section { margin: 16px 0; padding: 12px 16px; background: var(--paper); border-radius: 16px; }
.session-section h3 { margin: 4px 0; font-size: 1rem; }
.session-section .place-events { max-height: 230px; overflow: auto; margin-top: 0; }
.session-all { border: 0; background: transparent; color: var(--green); padding: 10px 0; cursor: pointer; font-weight: 700; }
.dialog-close + #dialog-content > .detail-body:first-child { padding-right: 65px; }
.event-card { position: relative; width: 100%; display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 14px; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.event-card::after { content: ""; position: absolute; inset: 7px -8px; z-index: -1; border-radius: 17px; background: #fff; opacity: 0; transform: scale(.98); transition: .18s ease; }
.event-card:hover::after, .event-card.is-active::after { opacity: 1; transform: none; box-shadow: 0 8px 25px rgba(23,33,29,.06); }
.event-visual { position: relative; min-height: 108px; overflow: hidden; border-radius: 16px; background: var(--card-bg, #d5ecd9); isolation: isolate; }
.event-visual::before, .event-visual::after { content: ""; position: absolute; border-radius: 999px; background: rgba(255,255,255,.5); }
.event-visual::before { width: 95px; height: 95px; right: -28px; top: -24px; }
.event-visual::after { width: 65px; height: 65px; left: -25px; bottom: -30px; }
.event-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.75rem; filter: drop-shadow(0 8px 12px rgba(23,33,29,.12)); transform: rotate(-5deg); }
.event-day { position: absolute; z-index: 2; top: 8px; left: 8px; min-width: 37px; padding: 5px 6px; background: rgba(255,255,255,.9); border-radius: 9px; text-align: center; backdrop-filter: blur(5px); }
.event-day b, .event-day small { display: block; }
.event-day b { font: 800 .95rem/1 "DM Sans", sans-serif; }
.event-day small { margin-top: 2px; font-size: .55rem; font-weight: 700; }
.card-copy { min-width: 0; align-self: center; }
.card-meta { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: .7rem; font-weight: 700; }
.card-meta .hot { color: #e94f37; }
.card-copy h2 { margin: 6px 0 6px; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .98rem; line-height: 1.35; letter-spacing: -.01em; }
.card-copy p { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: .74rem; }
.card-foot { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .68rem; }
.price { color: var(--ink); font-weight: 700; }
.price.free { color: var(--green); }
.heart { position: absolute; z-index: 4; right: 8px; top: 20px; width: 31px; height: 31px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: #59615d; cursor: pointer; font-size: 1rem; box-shadow: 0 2px 10px rgba(23,33,29,.1); }
.heart.is-saved { background: var(--coral); color: #fff; }
.list-loading, .empty-state { min-height: 260px; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); text-align: center; }
.list-loading span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: bounce 1s infinite alternate; }
.list-loading span:nth-child(2) { animation-delay: .2s; }
.list-loading span:nth-child(3) { animation-delay: .4s; }
.list-loading p { margin: 8px 0; font-size: .8rem; }
@keyframes bounce { to { transform: translateY(-7px); opacity: .45; } }

.map-stage { position: relative; min-width: 0; background: #dce8dd; overflow: hidden; }
#map { position: absolute; inset: 0; }
.map-wash { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(246,247,241,.25), transparent 30%); }
.map-loader { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 10px; background: radial-gradient(circle at 60% 45%, #fff, #e5eee3); transition: opacity .35s ease, visibility .35s ease; }
.map-loader.is-hidden { opacity: 0; visibility: hidden; }
.map-loader .brand-mark { animation: float 1.4s ease-in-out infinite alternate; }
.map-loader p { margin: 0; color: var(--muted); font-size: .78rem; }
@keyframes float { to { transform: translateY(-8px) rotate(4deg); } }
.map-search-area { position: absolute; z-index: 6; top: 18px; left: 50%; transform: translateX(-50%); padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .78rem; font-weight: 700; box-shadow: 0 8px 25px rgba(23,33,29,.14); }
.map-tools { position: absolute; z-index: 5; right: 16px; top: 18px; display: grid; gap: 8px; }
.map-tool { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; box-shadow: 0 6px 18px rgba(23,33,29,.12); }
.map-tool svg { width: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
.map-legend { position: absolute; z-index: 4; right: 16px; bottom: 28px; display: flex; gap: 11px; padding: 8px 11px; border-radius: 10px; background: rgba(255,255,255,.9); color: var(--muted); font-size: .64rem; box-shadow: 0 4px 14px rgba(23,33,29,.08); backdrop-filter: blur(8px); }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.map-legend span:last-child i { background: #2878ff; box-shadow: 0 0 0 3px rgba(40,120,255,.2); }
.mobile-list-button { display: none; }
.event-marker { position: relative; width: 45px; height: 45px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50% 50% 50% 11px; background: var(--marker, var(--coral)); box-shadow: 0 7px 18px rgba(23,33,29,.25); transform: rotate(-45deg); cursor: pointer; transition: transform .18s ease; }
.event-marker span { transform: rotate(45deg); font-size: 1.16rem; }
.event-marker:hover, .event-marker.is-active { transform: rotate(-45deg) scale(1.17); z-index: 3; }
.event-marker span { font-weight: 800; }
.map-stage.is-overview .event-map-anchor { display: none; }
.event-marker.is-hot::after { content: ""; position: absolute; inset: -7px; border: 2px solid rgba(255,118,92,.35); border-radius: 50%; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 70%,100% { transform: scale(1.45); opacity: 0; } }
.user-marker { width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: #2878ff; box-shadow: 0 0 0 8px rgba(40,120,255,.18), 0 3px 10px rgba(23,33,29,.25); }
.maplibregl-ctrl-bottom-right { bottom: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; }

.event-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(780px, calc(100vh - 32px)); padding: 0; overflow: hidden auto; border: 0; border-radius: 26px; background: #fff; color: var(--ink); box-shadow: 0 30px 100px rgba(23,33,29,.28); }
.event-dialog::backdrop { background: rgba(23,33,29,.42); backdrop-filter: blur(5px); }
.dialog-close { position: sticky; z-index: 5; float: right; top: 15px; right: 15px; width: 38px; height: 38px; margin: 15px 15px -53px 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); cursor: pointer; font-size: 1.35rem; box-shadow: 0 5px 18px rgba(23,33,29,.12); }
.detail-hero { height: 230px; position: relative; display: grid; place-items: center; overflow: hidden; background: var(--card-bg); }
.detail-hero::before { content: ""; position: absolute; width: 260px; height: 260px; left: -70px; bottom: -130px; border-radius: 50%; background: rgba(255,255,255,.35); }
.detail-hero span { font-size: 5.5rem; filter: drop-shadow(0 14px 20px rgba(23,33,29,.15)); }
.detail-body { padding: 26px 30px 32px; }
.detail-kicker { color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .1em; }
.detail-body h2 { margin: 8px 0 12px; font-size: 1.65rem; line-height: 1.2; letter-spacing: -.04em; }
.detail-body > p { color: var(--muted); line-height: 1.7; font-size: .9rem; }
.detail-facts { display: grid; gap: 10px; margin: 20px 0; padding: 18px; border-radius: 18px; background: var(--paper); }
.detail-fact { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; font-size: .84rem; }
.detail-fact span:first-child { font-size: 1rem; }
.detail-fact b, .detail-fact small { display: block; }
.detail-fact small { margin-top: 2px; color: var(--muted); }
.detail-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.primary-action, .save-action { min-height: 48px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 800; }
.primary-action { background: var(--ink); color: #fff; }
.save-action { padding: 0 18px; background: var(--lime); color: var(--ink); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 22px; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: .8rem; box-shadow: var(--shadow); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .24s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .app-shell { grid-template-rows: 62px 54px minmax(0, 1fr); }
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; padding: 0 14px; gap: 12px; }
  .brand small { display: none; }
  .brand b { font-size: .9rem; }
  .brand-mark { width: 33px; height: 33px; }
  .brand-mark::before { top: 4px; left: 14px; }
  .brand-mark::after { bottom: 4px; left: 14px; }
  .brand-mark i::before { left: 5px; top: 12px; }
  .brand-mark i::after { right: 5px; top: 12px; }
  .search { height: 40px; padding-left: 12px; }
  .search kbd, .avatar { display: none; }
  .quick-nav { padding: 0 12px; }
  .explore-layout { display: block; position: relative; }
  .map-stage { position: absolute; inset: 0; }
  .discover-panel { position: absolute; z-index: 20; left: 8px; right: 8px; bottom: 8px; height: min(68vh, 650px); padding: 19px 16px 24px; border: 0; border-radius: 24px; box-shadow: 0 -8px 45px rgba(23,33,29,.2); transform: translateY(calc(100% + 16px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
  .discover-panel.is-open { transform: translateY(0); }
  .discover-panel::before { content: ""; display: block; width: 42px; height: 4px; margin: -9px auto 13px; border-radius: 4px; background: #c6cbc8; }
  .mobile-close { display: block; flex: 0 0 auto; font-size: 1.15rem; }
  .pulse-card { margin: 14px 0; }
  .event-card { grid-template-columns: 105px minmax(0,1fr); }
  .mobile-list-button { position: absolute; z-index: 8; left: 50%; bottom: 25px; display: block; transform: translateX(-50%); padding: 12px 18px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: .82rem; font-weight: 800; box-shadow: 0 8px 25px rgba(23,33,29,.25); }
  .map-legend { display: none; }
  .map-tools { top: 14px; right: 12px; }
  .map-search-area { top: 14px; }
}

@media (max-width: 520px) {
  .top-actions { gap: 0; }
  .icon-button { width: 38px; height: 38px; }
  .brand b { display: none; }
  .quick-pill { padding: 8px 12px; }
  .discover-panel { height: min(74vh, 680px); }
  .pulse-card span { max-width: 160px; }
  .event-dialog { width: 100%; max-width: none; max-height: 87vh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .detail-hero { height: 185px; }
  .detail-body { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

