/* 今天吃什么 · 样式（浅色暖调，PC / 移动自适应） */
:root {
  --bg: #FFF9F2;
  --bg-soft: #FFF1E4;
  --card: #FFFFFF;
  --primary: #FF6B35;
  --primary-dark: #E24E1B;
  --primary-soft: #FFE9DE;
  --accent: #FFB13B;
  --text: #2F2A26;
  --muted: #8B7F75;
  --line: #F1E3D5;
  --shadow: 0 6px 20px rgba(228, 148, 96, .12);
  --shadow-lg: 0 18px 46px rgba(120, 72, 36, .18);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  /* 字体栈：全部为永久免费可商用授权，仅引用系统已装字体，不分发字体文件。
     PingFang SC / Microsoft YaHei / Hiragino Sans GB / Segoe UI —— 系统自带（引用安全）
     HarmonyOS Sans SC（华为开源免费商用）、Source Han Sans SC / Noto Sans SC（思源黑体，SIL OFL 1.1 永久免费商用）
     Roboto（Apache 2.0）、system-ui / -apple-system（系统默认） */
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC",
               "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; }
img { max-width: 100%; }

.app { max-width: 1180px; margin: 0 auto; padding: 0 20px 140px; }

/* ===== 顶部 ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 249, 242, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.logo-badge {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: var(--shadow);
}
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links button {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.nav-links button.active { background: var(--primary-soft); color: var(--primary-dark); }

/* ===== 语言切换 ===== */
.lang-switch { display: flex; gap: 4px; margin-left: 6px; }
.lang-btn {
  padding: 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--muted); border: 1px solid var(--line); background: #fff; white-space: nowrap;
}
.lang-btn:hover { background: var(--bg-soft); }
.lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 模式切换 ===== */
.mode-switch { display: inline-flex; background: var(--bg-soft); border-radius: 999px; padding: 4px; gap: 2px; }
.mode-switch button { padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.mode-switch button.active { background: #fff; color: var(--primary-dark); box-shadow: 0 2px 8px rgba(228,148,96,.18); }

/* ===== 城市选择 ===== */
.city-bar { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.city-current {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
}
.city-current .pin { color: var(--primary); }
.city-current .caret { color: var(--muted); font-size: 12px; }
.btn {
  border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 14px;
  background: #fff; border: 1px solid var(--line); color: var(--text); box-shadow: 0 2px 8px rgba(228,148,96,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none; box-shadow: 0 8px 18px rgba(255,107,53,.32); }
.btn-ghost { background: transparent; border: 1px dashed var(--line); box-shadow: none; }
.btn-block { width: 100%; }

/* ===== 城市贴士 ===== */
.city-panel { margin-top: 16px; background: linear-gradient(135deg, #FFF6EC, #FFEFE0); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.city-panel h2 { margin: 0 0 6px; font-size: 18px; }
.city-panel .tip { margin: 0; color: #6b5b4c; font-size: 14px; }
.city-panel .avoid { margin: 8px 0 0; font-size: 13px; color: #A1592B; background: #fff; border-radius: var(--radius-sm); padding: 8px 12px; }
.city-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ===== 筛选 ===== */
.filters { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row .label { font-size: 12px; color: var(--muted); width: 44px; flex: none; }
.chip {
  padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: #6b5b4c; transition: all .15s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.chip.warm.active { background: var(--accent); border-color: var(--accent); }

/* ===== 菜品网格 ===== */
.section-title { margin: 22px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.section-title h3 { margin: 0; font-size: 17px; }
.section-title .count { font-size: 13px; color: var(--muted); }

.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.dish-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.dish-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.dish-pic {
  position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.dish-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dish-card:hover .dish-pic img { transform: scale(1.05); }
.dish-pic img { transition: transform .35s ease; }
.dish-pic .dish-star {
  position: absolute; right: 8px; bottom: 6px; background: rgba(255,255,255,.92);
  padding: 2px 7px; border-radius: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.dish-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dish-head { display: flex; align-items: flex-start; gap: 8px; }
.dish-name { font-size: 16px; font-weight: 700; margin: 0; }
.dish-cn { font-size: 12px; color: var(--muted); font-weight: 500; flex: 0 0 auto; }
.dish-star { color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.dish-desc { margin: 0; font-size: 13px; color: #6f6259; min-height: 40px; }
.dish-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--bg-soft); color: #8a6c52; }
.tag.cat { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.tag.spicy0 { background: #EAF6EE; color: #3E8E5E; }
.tag.spicy1 { background: #FFF3DA; color: #B57A15; }
.tag.spicy2 { background: #FFE7D6; color: #D2611C; }
.tag.spicy3 { background: #FFDCD1; color: #C33A18; }
.dish-foot { display: flex; align-items: center; justify-content: flex-end; margin-top: 2px; }
.dish-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px;
  background: var(--bg-soft); color: #8a6c52; transition: all .15s ease;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }
.icon-btn.on { background: var(--primary); color: #fff; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .emoji { font-size: 46px; }

/* ===== 悬浮抽奖按钮 ===== */
.fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 45;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 30px rgba(255,107,53,.4);
}
.fab:hover { transform: translateY(-2px); }

/* ===== 弹层 ===== */
.mask {
  position: fixed; inset: 0; background: rgba(58, 38, 24, .45); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.mask.show { display: flex; }
.modal {
  background: var(--bg); border-radius: 22px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  box-shadow: var(--shadow-lg); animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 8px 20px 20px; }
.close-x { font-size: 22px; color: var(--muted); width: 32px; height: 32px; border-radius: 10px; }
.close-x:hover { background: var(--bg-soft); }

/* 城市选择弹层 */
.region-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.city-list { display: flex; flex-wrap: wrap; gap: 8px; }
.city-item { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.city-item.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.search-box { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; margin-bottom: 14px; }

/* ===== 轮盘 ===== */
.wheel-wrap { position: relative; width: 300px; max-width: 76vw; margin: 6px auto 0; aspect-ratio: 1; }
#wheelCanvas { width: 100%; height: 100%; display: block; }
.wheel-pointer {
  position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-top: 22px solid var(--primary-dark); filter: drop-shadow(0 3px 4px rgba(0,0,0,.18));
}
.wheel-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-lg);
  display: grid; place-items: center; font-weight: 800; color: var(--primary-dark); font-size: 14px; z-index: 2;
}
.wheel-result { margin-top: 12px; text-align: center; }
.wheel-result .picked {
  display: inline-block; padding: 12px 22px; border-radius: 14px; background: #fff; border: 1px dashed var(--primary);
  font-size: 18px; font-weight: 800; color: var(--primary-dark); box-shadow: var(--shadow);
}
.wheel-result .sub { font-size: 13px; color: var(--muted); margin-top: 8px; }
.cand-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 150px; overflow: auto; }
.cand {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line); font-size: 13px;
}
.cand .x { color: var(--muted); font-size: 12px; }
.cand-add { display: flex; gap: 8px; margin-top: 12px; }
.cand-add input { flex: 1; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); }

/* ===== 收藏 / 我的 ===== */
.fav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fav-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.fav-item .city { font-size: 12px; color: var(--muted); }
.fav-top { display: flex; gap: 10px; align-items: flex-start; }
.fav-main { flex: 1; min-width: 0; }
.fav-pic { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-soft); }
.pick-pic {
  width: 120px; height: 90px; border-radius: 12px; object-fit: cover; display: block; margin: 0 auto 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.setting-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.setting-block h4 { margin: 0 0 10px; font-size: 15px; }
.history-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.history-item:last-child { border-bottom: none; }
.history-item .time { color: var(--muted); font-size: 12px; }

/* ===== 底部导航（移动端） ===== */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
.tabbar button .ico { font-size: 20px; }
.tabbar button.active { color: var(--primary-dark); font-weight: 700; }

.view { display: none; }
.view.active { display: block; }

/* ===== 响应式：平板 ===== */
@media (max-width: 1000px) {
  .dish-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .app { padding: 0 14px 110px; }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .nav-links { display: none; }
  .lang-btn { padding: 6px 9px; font-size: 12px; }
  .logo { font-size: 17px; }
  .logo-badge { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }
  .dish-grid { grid-template-columns: 1fr; gap: 12px; }
  .dish-pic { aspect-ratio: 16 / 9; }
  .fav-grid { grid-template-columns: 1fr; }
  .filter-row .label { width: 38px; }
  .filter-row { max-height: none; }
  .filters .filter-row:nth-child(n+3) { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filters .filter-row:nth-child(n+3) .chip { flex: none; }
  .fab { right: 14px; bottom: 76px; padding: 12px 18px; font-size: 14px; }
  .tabbar { display: flex; }
  .mode-switch button { padding: 6px 12px; font-size: 13px; }
  .city-bar { gap: 8px; }
  .city-current { padding: 6px 12px; font-size: 14px; }
  .modal { max-height: 84vh; border-radius: 18px; }
  .wheel-wrap { width: 280px; }
  .hero-pic img { max-height: 300px; }
}

@media (max-width: 380px) {
  .wheel-wrap { width: 240px; }
}
