/* 顏色：沿用記帳網站那套溫暖的米色、咖啡色系 */
:root {
  --bg: #f4f0ec;
  --surface: #fbf8f4;
  --surface-2: #ece5dc;
  --text: #3a332c;
  --muted: #8c8074;
  --accent: #a0765d;
  --accent-soft: #efe2d8;
  --open: #5f8a66;
  --open-soft: #e3eee3;
  --closed: #a8726a;
  --closed-soft: #f3e4e1;
  --border: #e2d9cd;
  --shadow: 0 2px 10px rgba(60, 50, 30, 0.07);
  color-scheme: light;
}

/* 手機設成深色模式時自動換成深色 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #201c1a;
    --surface: #292420;
    --surface-2: #332c27;
    --text: #eae3dc;
    --muted: #b0a599;
    --accent: #d0a488;
    --accent-soft: #3d322b;
    --open: #93bc9c;
    --open-soft: #2c3a2e;
    --closed: #d69c90;
    --closed-soft: #3d2c29;
    --border: #453b33;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding-inline: 16px;
}

button { font: inherit; color: inherit; }

/* ---------- 頂端 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

h1 {
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: 0.04em;
}

/* 星期按鈕 */
.days {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.day {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 0 7px;
  font-size: 17px;
  cursor: pointer;
  line-height: 1.2;
}

.day small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  min-height: 1.2em;
}

.day[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.day[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.85); }

/* 搜尋欄 */
.search input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  outline: none;
}

.search input:focus { border-color: var(--accent); }

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 店家卡片 ---------- */
.list { display: grid; gap: 12px; margin-top: 16px; }

.card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

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

.card h2 { margin: 0; font-size: 19px; }

.tagline { color: var(--muted); font-size: 14px; margin: 2px 0 0; }

.card .meta { margin-top: 10px; color: var(--muted); font-size: 14px; }

.card .go {
  margin-top: 10px;
  color: var(--accent);
  font-size: 14px;
}

/* 營業中 / 休息中 小標籤 */
.status {
  flex: none;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status.open { background: var(--open-soft); color: var(--open); }
.status.closed { background: var(--closed-soft); color: var(--closed); }

.empty {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
}

/* ---------- 單一店家頁 ---------- */
.back {
  margin-top: 14px;
  border: none;
  background: none;
  padding: 6px 0;
  color: var(--accent);
  cursor: pointer;
}

.store-head {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.store-head h2 { margin: 0; font-size: 24px; }

.info {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 16px;
}

.info-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
}

.info-row:last-child { border-bottom: none; }

.info-row .k {
  flex: none;
  width: 4.5em;
  color: var(--muted);
}

/* 電話號碼：點了直接撥號 */
.info-row .tel {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.menu-date {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section { margin-top: 22px; }

.section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 4px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.menu li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-2);
}

.menu li:last-child { border-bottom: none; }

/* 菜名跟價格中間的點點虛線 */
.menu .dots {
  flex: 1;
  border-bottom: 2px dotted var(--border);
  transform: translateY(-4px);
  min-width: 12px;
}

.menu .price { font-variant-numeric: tabular-nums; font-weight: 600; }
.menu .price.text { font-weight: normal; color: var(--muted); font-size: 14px; }

mark {
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 0 2px;
}

/* 原始菜單照片（可展開） */
.photos {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 16px;
}

.photos summary {
  padding: 14px 0;
  cursor: pointer;
  color: var(--accent);
}

.photos img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 8px;
}

.photos p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

/* ---------- 搜尋結果 ---------- */
.result-store {
  margin-top: 18px;
}

.result-store h3 {
  margin: 0 0 8px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.result-store .days-text {
  font-size: 13px;
  font-weight: normal;
  color: var(--muted);
}

.result-store .menu li { cursor: pointer; }
