/* ==========================================================================
   萬派消費者探索頁 — 「溫泉水墨」設計系統
   --------------------------------------------------------------------------
   核心比喻：把找店家、看空班，想成在溫泉池邊看水紋擴散——深色如夜間池水的
   搜尋區、浮在水面上的紙感搜尋卡、以及「現在可約」用漣漪脈動來表示，而不是
   單純的一個綠點。這個漣漪語彙同時用在三個地方：背景裝飾、卡片的「可預約」
   狀態指示、以及讀取中的骨架效果——不是純裝飾，是貫穿全頁的一個視覺系統。
   ========================================================================== */

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

:root {
  /* ── 水墨深色（Hero / 搜尋區）── */
  --ink-deep: #142c27;
  --ink-mid: #1d3f37;
  --ink-edge: #0e211d;

  /* ── 紙感淺色（內容區 / 卡片）── */
  --paper: #fdfaf3;
  --paper-dim: #f4eee0;
  --paper-line: rgba(43, 38, 30, 0.1);

  /* ── 文字 ── */
  --text: #2b2620;
  --text-soft: rgba(43, 38, 30, 0.68);
  --muted: #8a7d69;
  --on-ink: #f3ede0;
  --on-ink-soft: rgba(243, 237, 224, 0.72);

  /* ── 品牌強調色 ── */
  --amber: #d9a441;
  --amber-deep: #b9812b;
  --amber-glow: rgba(217, 164, 65, 0.35);
  --moss: #6f8a68;
  --moss-deep: #45604a;
  --clay: #c17a53;

  --shadow-card: 0 18px 40px -18px rgba(20, 44, 39, 0.28);
  --shadow-lift: 0 24px 60px -20px rgba(20, 44, 39, 0.4);
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --r-full: 999px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: var(--paper-dim);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.consumer-hidden {
  display: none !important;
}

/* ── 頂欄 ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(20, 44, 39, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(243, 237, 224, 0.08);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark .ring {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--amber);
  border-bottom-color: transparent;
  border-left-color: transparent;
  flex-shrink: 0;
}

.brand-mark .word {
  font-family: "Noto Serif TC", serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.28em;
  color: var(--on-ink);
}

.pill {
  border: 1px solid rgba(243, 237, 224, 0.22);
  border-radius: var(--r-full);
  padding: 7px 13px;
  color: var(--on-ink-soft);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ── 尚未開放 ─────────────────────────────────────────────────────── */
.closed-wrap {
  min-height: calc(100svh - 60px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(640px 420px at 20% 0%, rgba(217, 164, 65, 0.16), transparent 60%),
    radial-gradient(700px 480px at 100% 100%, rgba(111, 138, 104, 0.14), transparent 55%),
    linear-gradient(180deg, var(--ink-deep), var(--ink-mid));
}

.closed {
  max-width: 460px;
  text-align: center;
}

.closed .ripple-mark {
  width: 64px; height: 64px;
  margin: 0 auto 22px;
  position: relative;
}

.closed .ripple-mark span {
  position: absolute; inset: 0;
  border: 1px solid var(--amber);
  border-radius: 50%;
  opacity: 0;
  animation: closedRipple 3.2s ease-out infinite;
}
.closed .ripple-mark span:nth-child(2) { animation-delay: 1s; }
.closed .ripple-mark span:nth-child(3) { animation-delay: 2s; }
@keyframes closedRipple {
  0% { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

.closed h1 {
  margin: 0 0 12px;
  font-family: "Noto Serif TC", serif;
  font-weight: 700;
  font-size: 25px;
  color: var(--on-ink);
}

.closed p {
  margin: 0;
  color: var(--on-ink-soft);
  line-height: 1.9;
  font-size: 14.5px;
}

/* ── HERO：夜色池水 + 搜尋浮島 ────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(175deg, var(--ink-deep) 0%, var(--ink-mid) 78%, var(--ink-mid) 100%);
  overflow: hidden;
  padding: 40px 20px 96px;
}

.hero-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}

.hero-rings svg { position: absolute; }
.hero-rings .r1 { top: -60px; right: -80px; width: 320px; height: 320px; }
.hero-rings .r2 { bottom: -120px; left: -100px; width: 380px; height: 380px; opacity: 0.6; }

.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding-top: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  font-weight: 600;
  margin-bottom: 18px;
}
.eyebrow::before, .eyebrow::after {
  content: "";
  width: 20px; height: 1px;
  background: var(--amber);
  opacity: 0.6;
}

.hero-title {
  margin: 0 0 14px;
  font-family: "Noto Serif TC", serif;
  font-weight: 700;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.35;
  color: var(--on-ink);
  letter-spacing: 0.01em;
}

.hero-title .accent {
  color: var(--amber);
  position: relative;
  padding: 0 2px;
}

.hero-sub {
  margin: 0 auto;
  max-width: 460px;
  color: var(--on-ink-soft);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ── 搜尋浮島 ─────────────────────────────────────────────────────── */
.search-island {
  position: relative;
  max-width: 860px;
  margin: 34px auto 0;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.search-row {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr auto;
  gap: 10px;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-wrap svg {
  position: absolute;
  left: 15px;
  width: 17px; height: 17px;
  color: var(--muted);
  pointer-events: none;
}

input, select {
  width: 100%;
  border: 1px solid var(--paper-line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 14px 14px 14px 40px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

#city {
  padding-left: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238a7d69' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}

input:focus, select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

button {
  border: 0;
  border-radius: var(--r-md);
  padding: 0 24px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(160deg, var(--amber), var(--amber-deep));
  color: #302206;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
button:hover { filter: brightness(1.05); }
button:active { transform: scale(0.97); }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-full);
  padding: 0 15px;
  background: var(--paper-dim);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: none;
}

.filter-chip svg { width: 14px; height: 14px; flex-shrink: 0; }

.filter-chip.active {
  background: rgba(111, 138, 104, 0.14);
  border-color: rgba(111, 138, 104, 0.4);
  color: var(--moss-deep);
}

.filter-chip.chip-location.active {
  background: rgba(217, 164, 65, 0.16);
  border-color: rgba(217, 164, 65, 0.5);
  color: var(--amber-deep);
}

.sort-select {
  margin-left: auto;
  width: auto;
  min-height: 38px;
  border-radius: var(--r-full);
  padding: 8px 34px 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  background-color: var(--paper-dim);
  border-color: var(--paper-line);
}

/* ── 內容區 ───────────────────────────────────────────────────────── */
.content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 44px 0 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
}

.section-head span {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

/* ── 消費者登入 / 我的預約 ───────────────────────────────────────── */
.account-panel {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.account-copy {
  min-width: 0;
}

.account-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--amber-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.account-panel h2 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.45;
}

.account-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.account-actions button {
  min-height: 44px;
}

.account-actions button:disabled {
  cursor: default;
  opacity: 0.72;
}

.account-secondary {
  background: #fff;
}

.booking-list {
  display: grid;
  gap: 10px;
}

.booking-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.booking-card h3 {
  margin: 4px 0;
  font-size: 15px;
}

.booking-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.booking-status {
  color: var(--moss-deep);
  font-size: 11px;
  font-weight: 900;
}

.booking-price {
  flex-shrink: 0;
  color: var(--amber-deep);
  font-size: 13px;
  font-weight: 900;
}

.booking-loading,
.booking-empty {
  padding: 18px;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--paper-line);
  border-radius: var(--r-md);
  font-size: 13px;
  text-align: center;
}

/* ── 精選推薦 ─────────────────────────────────────────────────────── */
.featured-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 14px;
  scroll-snap-type: x proximity;
}
.featured-strip::-webkit-scrollbar { height: 5px; }
.featured-strip::-webkit-scrollbar-thumb { background: rgba(43,38,30,0.16); border-radius: 999px; }

.featured-card {
  scroll-snap-align: start;
  flex: 0 0 272px;
  min-height: 168px;
  background:
    radial-gradient(160% 120% at 100% 0%, rgba(217, 164, 65, 0.28), transparent 55%),
    linear-gradient(155deg, var(--ink-mid), var(--ink-deep));
  color: var(--on-ink);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.featured-card .reason {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.featured-card h3 {
  margin: 10px 0 4px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
}

.featured-card .area {
  color: var(--on-ink-soft);
  font-size: 12.5px;
}

.featured-card .actions { margin-top: 14px; }

/* ── 店家卡片格線 ─────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.store-card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  min-height: 232px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.store-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}

.badge {
  border-radius: var(--r-full);
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: rgba(111, 138, 104, 0.13);
  color: var(--moss-deep);
  white-space: nowrap;
}
.badge.founding { background: rgba(217, 164, 65, 0.18); color: var(--amber-deep); }
.badge.recommended { background: rgba(193, 122, 83, 0.14); color: var(--clay); }

/* 漣漪脈動：可預約狀態的訊號燈，語彙跟 hero 背景的水紋呼應 */
.ripple-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--moss);
  flex-shrink: 0;
}
.ripple-dot::before, .ripple-dot::after {
  content: "";
  position: absolute; inset: -4px;
  border: 1px solid var(--moss);
  border-radius: 50%;
  opacity: 0;
  animation: dotRipple 2.6s ease-out infinite;
}
.ripple-dot::after { animation-delay: 1.3s; }
@keyframes dotRipple {
  0% { transform: scale(0.5); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}
.ripple-dot.idle { background: var(--muted); }
.ripple-dot.idle::before, .ripple-dot.idle::after { display: none; }

.store-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
}

.meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.fact {
  background: var(--paper-dim);
  border-radius: var(--r-sm);
  padding: 10px 11px;
}

.fact.highlight {
  background: rgba(217, 164, 65, 0.14);
}

.fact b {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
}

.fact span {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.01em;
}

.actions {
  display: flex;
  gap: 8px;
}

.ghost {
  background: #fff;
  color: var(--moss-deep);
  border: 1px solid var(--paper-line);
}

.actions a, .actions button {
  flex: 1;
  text-align: center;
  text-decoration: none;
  border-radius: var(--r-sm);
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-link {
  background: linear-gradient(160deg, var(--moss), var(--moss-deep));
  color: #fff;
}

.featured-card .ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--on-ink);
  border-color: rgba(255, 255, 255, 0.2);
}
.featured-card .primary-link {
  background: linear-gradient(160deg, var(--amber), var(--amber-deep));
  color: #302206;
}

.disabled-btn {
  background: var(--paper-dim);
  color: var(--muted);
  border: 1px solid var(--paper-line);
  cursor: not-allowed;
}

/* ── 讀取中 / 空狀態 ──────────────────────────────────────────────── */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.skeleton-card {
  height: 232px;
  border-radius: var(--r-lg);
  background: linear-gradient(100deg, var(--paper) 30%, var(--paper-dim) 50%, var(--paper) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,0.6);
}
@keyframes shimmer {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 46px 24px;
  background: var(--paper);
  border: 1px dashed var(--paper-line);
  border-radius: var(--r-lg);
  font-size: 13.5px;
  line-height: 1.8;
}
.empty .ripple-mark { width: 40px; height: 40px; margin: 0 auto 14px; position: relative; }
.empty .ripple-mark span {
  position: absolute; inset: 0;
  border: 1px solid var(--moss);
  border-radius: 50%;
  opacity: 0;
  animation: closedRipple 3s ease-out infinite;
}
.empty .ripple-mark span:nth-child(2) { animation-delay: 1s; }

/* ── RWD ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hero { padding: 28px 16px 76px; }
  .hero-title { font-size: 26px; }
  .search-island { margin-top: 26px; padding: 16px; border-radius: 20px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row button { min-height: 48px; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .sort-select { grid-column: 1 / -1; width: 100%; margin-left: 0; text-align: left; }
  .grid, .skeleton-grid { grid-template-columns: 1fr; }
  .content { padding: 0 16px 64px; }
  .featured-card { flex-basis: 240px; }
  .account-panel,
  .booking-card {
    align-items: stretch;
    flex-direction: column;
  }
  .account-actions {
    width: 100%;
    flex-direction: column;
  }
}
