:root {
  --bg: #fff7f0;
  --card: #ffffff;
  --primary: #ff6b35;
  --primary-dark: #e2551c;
  --text: #2b2b2b;
  --muted: #888;
  --border: #f0e0d6;
}
:root[data-theme="dark"] {
  --bg: #1c1712;
  --card: #2a231c;
  --primary: #ff8a5c;
  --primary-dark: #ffab85;
  --text: #f0e6da;
  --muted: #a89a8a;
  --border: #4a3d30;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .2s ease, color .2s ease;
}
.theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-size: 22px; font-weight: 700; color: var(--primary); }
#auth-area { display: flex; align-items: center; gap: 10px; }
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.block { width: 100%; margin-top: 10px; }
#user-box { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; }
main { max-width: 760px; margin: 0 auto; padding: 20px; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  margin-bottom: 24px;
}
.card h2 { margin-top: 0; }
.map { width: 100%; height: 280px; border-radius: 12px; margin-bottom: 10px; background: #eee; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.search-row .input { margin-bottom: 0; flex: 1; }
.search-row .btn { white-space: nowrap; padding: 11px 14px; }
.input {
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  margin-bottom: 10px;
  font-family: inherit;
}
.input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.file-label {
  display: inline-block;
  background: #fff0e8;
  color: var(--primary-dark);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.preview { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.preview img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; }
.posts { display: grid; gap: 18px; }
.post {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.post .photos { display: grid; grid-template-columns: 1fr; gap: 2px; }
.post .photos.multi { grid-template-columns: 1fr 1fr; }
.post .photos img.photo { width: 100%; display: block; height: 260px; object-fit: cover; }
.post .photos:not(.multi) img.photo { height: auto; max-height: 420px; }
/* 奇數張（3/5張）照片時，最後一張落單在下一列只佔左半格，右邊會空一塊；
   讓它撐滿整列寬度補上這個缺口 */
.post .photos.multi img.photo:last-child:nth-child(odd) { grid-column: 1 / -1; }
.post .body { padding: 14px 16px; }
.post .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.post .meta img { width: 26px; height: 26px; border-radius: 50%; }
.post .place { font-weight: 700; color: var(--primary-dark); }
.post .caption { margin: 6px 0 0; white-space: pre-wrap; }
.post .map-link { font-size: 13px; color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2b2b2b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 50;
}

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.filter-tab {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.catalog-title { margin: 4px 0 10px; font-size: 15px; color: var(--text); }
.region-catalog-all { margin-bottom: 12px; }
.region-catalog-all .filter-tab { font-weight: 700; padding: 7px 18px; }
.region-catalog { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.region-group { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.region-group-title {
  flex-shrink: 0;
  width: 40px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.region-group-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.post .region-tag { display: inline-block; font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; margin-left: 6px; }

.post .actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.share-btn {
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
}
.share-btn:hover { color: var(--primary-dark); }
.post.highlight { outline: 2px solid var(--primary); }

.ad-banner {
  background: linear-gradient(90deg, #ee4d2d, #ff7337);
  padding: 10px 16px;
  text-align: center;
}
.ad-banner a {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ad-banner a:hover { opacity: 0.9; }
.shopee-card { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 8px; padding: 6px; max-width: 640px; margin: 0 auto; text-decoration: none; text-align: left; }
.shopee-card-img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.shopee-card-info { min-width: 0; }
.shopee-card-title { color: #333; font-weight: 700; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopee-card-cta { color: #ee4d2d; font-weight: 700; font-size: 0.78rem; margin-top: 2px; }

.ad-slot { max-width: 760px; margin: 0 auto 20px; text-align: center; }

.site-footer {
  text-align: center;
  padding: 24px 20px 40px;
  font-size: 12px;
  color: var(--muted);
}
.site-footer .disclaimer {
  max-width: 560px;
  margin: 10px auto 0;
  font-size: 11px;
  color: var(--muted);
  opacity: .8;
  line-height: 1.6;
}

/* ---------- 今日美食情報（RSS策展卡片） ---------- */
.foodnews-list { display: grid; gap: 14px; }
.foodnews-card {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--bg);
}
.foodnews-card img.foodnews-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}
.foodnews-body { min-width: 0; flex: 1; }
.foodnews-source {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  background: #fff0e8;
  border-radius: 8px;
  padding: 1px 8px;
  margin-bottom: 4px;
}
:root[data-theme="dark"] .foodnews-source { background: rgba(255,138,92,.15); }
.foodnews-title { font-weight: 700; margin: 0 0 4px; font-size: 15px; line-height: 1.4; }
.foodnews-excerpt { font-size: 13px; color: var(--muted); margin: 0 0 6px; line-height: 1.5; }
.foodnews-comment {
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 8px;
}
.foodnews-comment::before { content: "💬 小編說："; font-weight: 700; color: var(--primary-dark); }
.foodnews-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.foodnews-time { font-size: 11px; color: var(--muted); }
.foodnews-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.foodnews-link:hover { color: var(--primary-dark); }
@media (max-width: 480px) {
  .foodnews-card { flex-direction: column; }
  .foodnews-card img.foodnews-thumb { width: 100%; height: 160px; }
}
