/* ═══════════════════════════════════════════════════
   cheese · 你的专业食物推荐网站
   奶油底色 + 彩虹标题 + 圆角食物卡
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #fdf6e7;
  --card: #ffffff;
  --ink: #33291f;
  --muted: #8a7a66;
  --accent: #f0a92e;          /* 奶酪黄 */
  --accent-deep: #d98a12;
  --line: #f0e6d2;
  --shadow: 0 10px 30px rgba(97, 72, 22, 0.10);
  --radius: 20px;
  --font-display: "ZCOOL KuaiLe", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 169, 46, 0.10) 0 22px, transparent 23px),
    radial-gradient(circle at 88% 22%, rgba(240, 169, 46, 0.08) 0 34px, transparent 35px),
    radial-gradient(circle at 70% 85%, rgba(240, 169, 46, 0.07) 0 26px, transparent 27px),
    radial-gradient(circle at 25% 70%, rgba(240, 169, 46, 0.06) 0 18px, transparent 19px),
    var(--bg);
  min-height: 100vh;
}

/* ── 布局骨架 ─────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: 0 0 232px;
  display: flex; flex-direction: column; gap: 22px;
  padding: 26px 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 14px;
  cursor: pointer; user-select: none;
}
.brand-mark { font-size: 30px; filter: drop-shadow(0 3px 6px rgba(97,72,22,.25)); }
.brand-name {
  font-family: var(--font-display); font-size: 27px; letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ff5f6d, #ffa54c, #e8b90c, #4fd18b, #4fa9ff, #b072ff, #ff5f6d);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hue-slide 7s linear infinite;
}

.nav { display: flex; flex-direction: column; gap: 10px; }

.nav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  font: 600 15.5px/1 var(--font-body); color: var(--ink);
  background: transparent; border: 1.5px solid transparent;
  border-radius: 14px; cursor: pointer; text-align: left;
  transition: background .18s, border-color .18s, transform .12s;
}
.nav-btn:hover { background: #fff; border-color: var(--line); transform: translateX(2px); }
.nav-btn.active {
  background: #fff; border-color: var(--accent);
  box-shadow: var(--shadow);
}
.nav-ic { width: 24px; height: 24px; flex: 0 0 24px; }
.gear { transform-origin: 50% 50%; }
.nav-btn:hover .gear { animation: spin 3.6s linear infinite; }
.nav-btn.active .gear { animation: spin 7s linear infinite; }

.side-foot { margin-top: auto; }
.prefs-mini {
  font-size: 12.5px; color: var(--muted);
  background: #fff8ea; border: 1px dashed var(--accent);
  border-radius: 12px; padding: 10px 12px; line-height: 1.6;
}
.prefs-mini b { color: var(--accent-deep); }

/* ── 主舞台 ───────────────────────────────────────── */
.stage { flex: 1; padding: 46px 52px 80px; max-width: 1240px; }

.hero { text-align: center; padding: 34px 0 26px; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.18;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ht-en {
  font-size: clamp(58px, 9vw, 104px); letter-spacing: 2px;
  background: linear-gradient(92deg, #ff5f6d 0%, #ff9a3d 18%, #ffd93d 34%, #6bde8f 52%, #4fa9ff 70%, #b072ff 86%, #ff5f6d 100%);
  background-size: 280% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hue-slide 6s linear infinite;
  filter: drop-shadow(0 6px 0 rgba(97, 72, 22, 0.07));
}
.ht-cn {
  font-size: clamp(26px, 4.2vw, 44px);
  background: linear-gradient(92deg, #b072ff, #4fa9ff, #6bde8f, #ffd93d, #ff9a3d, #ff5f6d, #b072ff);
  background-size: 280% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hue-slide 6s linear infinite reverse;
}

.hero-sub { color: var(--muted); margin-top: 16px; font-size: 16px; }

.hero-actions { display: flex; gap: 14px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

@keyframes hue-slide { to { background-position: 280% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 按钮 ─────────────────────────────────────────── */
.btn {
  font: 700 15px/1 var(--font-body);
  padding: 13px 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .12s, box-shadow .18s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff; background: linear-gradient(120deg, var(--accent), var(--accent-deep));
  box-shadow: 0 8px 20px rgba(217, 138, 18, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-text { background: none; color: var(--muted); }
.btn-text:hover { color: var(--ink); }

/* ── 卡片网格 ─────────────────────────────────────── */
.feed { margin-top: 40px; }
.feed-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.feed-head h2, .view-title { font-family: var(--font-display); font-weight: 400; font-size: 30px; }
.feed-note { color: var(--muted); font-size: 13.5px; }

.grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
}

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .16s, box-shadow .16s;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.card:hover { transform: translateY(-5px) rotate(-.3deg); box-shadow: 0 18px 38px rgba(97,72,22,.16); }

.tile {
  height: 148px; display: grid; place-items: center; position: relative;
  background:
    radial-gradient(120% 130% at 28% 18%, rgba(255,255,255,.55), transparent 46%),
    linear-gradient(160deg, var(--c, #f0a92e), color-mix(in srgb, var(--c, #f0a92e) 62%, #241a08));
}
.tile .emoji { font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.28)); }
.tile img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: rgba(36, 26, 8, 0.45); backdrop-filter: blur(4px);
  padding: 4px 10px; border-radius: 999px;
}
.tile .badge.match { background: linear-gradient(120deg, #ff5f6d, #b072ff); }

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-blurb { font-size: 12.8px; color: var(--muted); line-height: 1.55; flex: 1; }

.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: #fbf3e1; color: #91631b; border: 1px solid #f3e3bf;
}
.tag.cuisine { background: #eef4ff; color: #3d6cb0; border-color: #d8e5fb; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; border: 1px solid rgba(0,0,0,.12);
}

/* ── 食谱 / 探索 视图头 ───────────────────────────── */
.view-head { margin-bottom: 26px; }
.view-sub { color: var(--muted); margin: 8px 0 20px; font-size: 14.5px; }

.searchbar { max-width: 640px; }
.search-input {
  width: 100%; font: 500 15.5px var(--font-body);
  padding: 15px 22px; border-radius: 999px;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  box-shadow: var(--shadow); outline: none; transition: border-color .18s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: #c2b29a; }

.browse { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.chip-btn {
  font: 600 13.5px var(--font-body); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.chip-btn:hover { border-color: var(--accent); }
.chip-btn.on { background: linear-gradient(120deg, var(--accent), var(--accent-deep)); color: #fff; border-color: transparent; }

.color-row { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.color-dot {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.18);
  transition: transform .15s, outline-color .15s;
  outline: 2.5px solid transparent; outline-offset: 2px;
  position: relative;
}
.color-dot:hover { transform: scale(1.14); }
.color-dot.on { outline-color: var(--ink); }
.color-row .color-label { font-size: 13px; color: var(--muted); margin-right: 2px; }

.empty { text-align: center; color: var(--muted); padding: 70px 0; font-size: 17px; }

/* ── 弹窗（设置向导 / 详情） ──────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(45, 32, 10, 0.42); backdrop-filter: blur(6px);
  animation: fade .18s ease-out;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.modal-card {
  background: #fff; border-radius: 26px; box-shadow: 0 30px 80px rgba(45,32,10,.35);
  width: min(620px, 92vw); max-height: 88vh; overflow: auto;
  padding: 30px 32px;
  animation: pop .22s cubic-bezier(.34, 1.56, .64, 1);
  position: relative;
}
@keyframes pop { from { transform: scale(.92) translateY(14px); opacity: 0; } }

.modal-x {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 15px; cursor: pointer;
}
.modal-x:hover { color: var(--ink); border-color: var(--accent); }

/* 向导 */
.wizard-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.wizard-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 25px; }
.wizard-hint { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.gear-big {
  width: 54px; height: 54px; flex: 0 0 54px;
  animation: spin 9s linear infinite; transform-origin: 50% 50%;
}

.dots { display: flex; gap: 8px; justify-content: center; margin: 6px 0 20px; }
.dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: #eadfc8; transition: all .2s;
}
.dots i.on { background: linear-gradient(120deg, #ff5f6d, #ffd93d, #4fa9ff); transform: scale(1.3); }

.chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 6px 0 12px; min-height: 150px; align-content: flex-start; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px var(--font-body);
  padding: 12px 20px; border-radius: 999px; cursor: pointer;
  background: #fdf6e7; border: 2px solid var(--line);
  transition: all .16s; user-select: none;
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.chip.on {
  background: linear-gradient(120deg, #fff3d6, #ffe3f3);
  border-color: var(--accent-deep); color: var(--accent-deep);
  box-shadow: 0 6px 16px rgba(217,138,18,.22);
  transform: translateY(-2px) scale(1.04);
}
.chip .chip-emoji { font-size: 19px; }

.wizard-foot { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.wizard-foot .spacer { flex: 1; }

/* 详情 */
.detail .tile { height: 190px; border-radius: 18px; margin-bottom: 18px; }
.detail .tile .emoji { font-size: 84px; }
.detail h3 { font-family: var(--font-display); font-weight: 400; font-size: 28px; margin-bottom: 6px; }
.detail .meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.detail .sec-title { font-size: 15px; font-weight: 800; color: var(--accent-deep); margin: 18px 0 10px; }
.detail .ings { display: flex; flex-wrap: wrap; gap: 8px; }
.detail .steps { counter-reset: st; display: flex; flex-direction: column; gap: 12px; }
.detail .steps li {
  list-style: none; display: flex; gap: 12px; align-items: baseline;
  font-size: 14.5px; line-height: 1.65;
}
.detail .steps li::before {
  counter-increment: st; content: counter(st);
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-deep));
  color: #fff; font-weight: 800; font-size: 13px;
  display: inline-grid; place-items: center;
  transform: translateY(3px);
}
.detail .plain-note { color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ── Toast ────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(36, 26, 8, 0.88); color: #fff7e6;
  font-size: 14px; padding: 12px 22px; border-radius: 999px;
  z-index: 99; animation: pop .2s;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

/* ── 响应式：窄屏侧栏变底部导航 ───────────────────── */
@media (max-width: 880px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: auto; height: auto; position: sticky; top: auto; bottom: 0; order: 2;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 14px; border-right: none; border-top: 1px solid var(--line);
  }
  .brand { padding: 0 6px 0 0; }
  .brand-mark { font-size: 22px; }
  .brand-name { font-size: 20px; }
  .nav { flex-direction: row; gap: 4px; flex: 1; justify-content: space-around; }
  .nav-btn { flex-direction: column; gap: 3px; padding: 8px 10px; font-size: 12px; }
  .nav-label { font-size: 11px; }
  .side-foot { display: none; }
  .stage { padding: 28px 18px 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .ht-en, .ht-cn, .brand-name { animation: none; }
  .nav-btn .gear, .gear-big { animation: none; }
}
