:root {
  --bg: #F6F0E8;
  --bg-elev: #FFFBF6;
  --ink: #2C2420;
  --ink-soft: #6B6158;
  --green: #2C6A58;
  --green-2: #3D8B74;
  --green-soft: #E7F3EE;
  --coral: #D2654A;
  --coral-soft: #FBE8E2;
  --gold: #E8B86D;
  --gold-soft: #FBF1DC;
  --line: #E8DFD2;
  --chip: #FFFFFF;
  --shadow: 0 8px 28px rgba(44, 36, 32, 0.08);
  --shadow-soft: 0 2px 10px rgba(44, 36, 32, 0.05);
  --radius: 18px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
}
button, input { font: inherit; color: inherit; }
a { color: var(--green); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: calc(10px + var(--safe-top)) 16px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.brand-icon { width: 36px; height: 36px; border-radius: 10px; display: block; }
.brand-text h1 {
  margin: 0; font-size: 1.15rem; letter-spacing: 0.02em; line-height: 1.2;
}
.brand-text p {
  margin: 0; font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.04em;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 6px 0 14px;
  min-height: 46px;
  box-shadow: var(--shadow-soft);
}
.search-icon { width: 18px; height: 18px; color: var(--ink-soft); flex: 0 0 auto; }
.search-wrap input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  min-width: 0;
  height: 46px;
  font-size: 16px;
}
.search-clear {
  border: 0; background: var(--line); width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--ink-soft);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 10px -16px 0;
  padding: 2px 16px 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  white-space: nowrap;
}
.chip:active { transform: scale(0.97); }
.chip.is-on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.main {
  flex: 1;
  padding: 12px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
}
.panel { animation: fadeUp 0.28s ease; }
.panel.hidden { display: none; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.meta-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 2px 2px 12px; color: var(--ink-soft); font-size: 0.82rem;
}

.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--bg-elev);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, #fff);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card:active { transform: scale(0.99); }
.card-top { display: flex; gap: 12px; align-items: flex-start; }
.badge {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--green-soft); flex: 0 0 auto;
}
.badge.event { background: var(--coral-soft); }
.card-title { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.card-en { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.8rem; }
.fav-btn {
  margin-left: auto;
  border: 0; background: transparent;
  width: 44px; height: 44px; border-radius: 12px;
  cursor: pointer; font-size: 1.15rem; flex: 0 0 auto;
  margin-top: -6px; margin-right: -6px;
}
.fav-btn.is-on { color: var(--coral); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.pill {
  font-size: 0.72rem;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 999px;
  padding: 3px 8px;
  letter-spacing: 0.02em;
}
.pill.paid { background: var(--coral-soft); color: #9A3F2C; }
.pill.warm { background: var(--gold-soft); color: #8A5A14; }

.note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note.full { display: block; -webkit-line-clamp: unset; }

.actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--ink-soft);
}
.empty h2 { margin: 0 0 8px; color: var(--ink); font-size: 1.1rem; }

.event-date {
  font-size: 0.8rem;
  color: var(--coral);
  font-weight: 650;
  margin: 0 0 2px;
}

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 4px 8px var(--safe-bottom);
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 30;
}
.tab {
  border: 0;
  background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  min-height: 52px;
  border-radius: 14px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}
.tab-icon { font-size: 1.15rem; line-height: 1; }
.tab.is-active { color: var(--green); background: var(--green-soft); }

.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(44, 36, 32, 0.4);
  z-index: 40;
  animation: fade 0.2s ease;
}
.sheet-backdrop[hidden], .sheet[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: var(--bg-elev);
  border-radius: 24px 24px 0 0;
  z-index: 50;
  box-shadow: 0 -12px 40px rgba(44, 36, 32, 0.16);
  overflow: auto;
  padding: 8px 18px calc(20px + var(--safe-bottom));
  animation: slideUp 0.28s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(24px); opacity: 0.6; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 42px; height: 5px; border-radius: 99px;
  background: var(--line); margin: 6px auto 12px;
}
.sheet h2 { margin: 0 0 4px; font-size: 1.25rem; }
.sheet .card-en { margin-bottom: 8px; }
.sheet .note { margin-top: 8px; }
.sheet .addr {
  margin: 10px 0 0; color: var(--ink-soft); font-size: 0.9rem;
}

.about {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}
.about h2 { margin: 0 0 10px; font-size: 1.15rem; }
.about p { margin: 0 0 12px; color: var(--ink); }
.about ol, .about ul { margin: 0 0 14px; padding-left: 1.2em; }
.about li { margin: 0 0 6px; }
.install {
  background: var(--green-soft);
  border-radius: 14px;
  padding: 14px;
  margin: 14px 0;
}
.install h3 { margin: 0 0 6px; font-size: 0.98rem; color: var(--green); }
.warn {
  background: var(--gold-soft);
  border-radius: 14px;
  padding: 14px;
  font-size: 0.92rem;
}

@media (min-width: 720px) {
  body { background: #ebe3d6; }
  .app { min-height: 100vh; box-shadow: var(--shadow); background: var(--bg); }
}
