/*!
 * 最后更新：2026-10-12
 * 今天吃什么 · 样式
 * 移动端优先；桌面端居中成一张 560px 的应用卡
 */

:root {
  --bg: #fdf6ef;
  --bg-grad: radial-gradient(120% 60% at 50% 0%, #fff3e3 0%, #fdf6ef 55%, #fdf6ef 100%);
  --card: #ffffff;
  --card-2: #fbf3ec;
  --ink: #2a201a;
  --ink-2: #6b5a4d;
  --muted: #9a8878;
  --line: #f0e3d8;
  --brand: #ff4d2d;
  --brand-2: #ff9a1f;
  --brand-soft: #fff0e8;
  --good: #1f9d63;
  --good-soft: #e8f7ef;
  --warn: #c77700;
  --shadow: 0 1px 2px rgba(60, 36, 18, .04), 0 8px 24px rgba(60, 36, 18, .06);
  --shadow-lg: 0 4px 12px rgba(255, 77, 45, .18), 0 14px 40px rgba(60, 36, 18, .12);
  --r: 16px;
  --r-sm: 10px;
  --tab-h: 58px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #14100e;
  --bg-grad: radial-gradient(120% 60% at 50% 0%, #241a15 0%, #14100e 60%, #14100e 100%);
  --card: #1e1916;
  --card-2: #262019;
  --ink: #f3e9e2;
  --ink-2: #c3b3a6;
  --muted: #918376;
  --line: #322a24;
  --brand: #ff6a3d;
  --brand-2: #ffab3f;
  --brand-soft: #33211a;
  --good: #4cc38a;
  --good-soft: #16281f;
  --warn: #e0a33c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

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

/* 作者样式里的 display 会盖掉浏览器默认的 [hidden]，这里统一兜住 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 14px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 2px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px;
  display: block; object-fit: cover;
}
.brand h1 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.brand .greet { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-2); }
.icon-btn {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { display: block; }
.icon-btn:active { transform: scale(.94); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--r); padding: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  margin-bottom: 12px;
}
.card h2 {
  margin: 0 0 10px; font-size: 13px; font-weight: 600;
  color: var(--muted); letter-spacing: .8px;
}
.card h2 .sub { font-weight: 400; letter-spacing: 0; color: var(--muted); }

/* ---------- 抽签卡 ---------- */
.slotcard { padding: 20px 16px 16px; text-align: center; position: relative; overflow: hidden; }
.segbar {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap;
}
.seg {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2);
}
.seg.on { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 600; }

.slot { min-height: 116px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.slot .slot-name {
  font-size: clamp(26px, 8.4vw, 36px); font-weight: 800; letter-spacing: .5px;
  line-height: 1.25; transition: filter .08s linear, transform .08s linear;
}
.slot.rolling .slot-name { filter: blur(.6px); opacity: .72; }
.slot .slot-idle { font-size: 26px; font-weight: 800; color: var(--ink); }
.slot .slot-hint { margin-top: 8px; font-size: 13px; color: var(--muted); }
.slot .slot-price { margin-top: 6px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* 抽中后的揭示动画 */
@keyframes pop { 0% { transform: scale(.86); opacity: 0 } 60% { transform: scale(1.04) } 100% { transform: scale(1); opacity: 1 } }
.reveal { animation: pop .34s cubic-bezier(.2, .9, .3, 1.2) both; }

/* ---------- 结果详情 ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px;
  background: var(--card-2); color: var(--ink-2); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip.hot { background: var(--brand-soft); color: var(--brand); border-color: transparent; font-weight: 600; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.tag { font-size: 11.5px; color: var(--muted); background: transparent; border: 1px dashed var(--line); padding: 2px 8px; border-radius: 999px; }
.desc { margin: 12px auto 0; font-size: 13.5px; color: var(--ink-2); max-width: 42ch; }
.why {
  margin: 12px auto 0; font-size: 12.5px; color: var(--brand);
  background: var(--brand-soft); border-radius: var(--r-sm); padding: 7px 11px;
  display: inline-block; max-width: 100%;
}
.alt { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; font-weight: 600;
  padding: 11px 16px; border-radius: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; transition: transform .08s ease, box-shadow .16s ease, background .16s;
}
.btn:active { transform: scale(.975); }
.btn.primary {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent; box-shadow: var(--shadow-lg);
}
.btn.primary:disabled { opacity: .55; box-shadow: none; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.big { font-size: 17px; padding: 16px; border-radius: 15px; min-height: 56px; letter-spacing: .5px; }
.btn.tiny { font-size: 12.5px; padding: 6px 10px; min-height: 34px; border-radius: 9px; font-weight: 500; }
.btn.danger { color: #d74b3f; }
.actions { display: flex; gap: 8px; margin-top: 16px; }
.actions .btn { flex: 1; }
.actions-2 { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.actions-2 > .btn { flex: 1 1 auto; }
/* 结果卡下面那排小按钮数量多，按内容宽度排列、允许换行，避免挤成竖排字 */
.actions-2.many { gap: 6px; justify-content: center; }
.actions-2.many > .btn { flex: 0 0 auto; white-space: nowrap; }

/* ---------- 筛选 ---------- */
.frow { margin-bottom: 12px; }
.frow:last-child { margin-bottom: 0; }
.flabel { font-size: 12px; color: var(--muted); margin-bottom: 7px; display: flex; justify-content: space-between; }
.chips {
  display: flex; gap: 7px; overflow-x: auto; padding: 1px 0 3px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.pill {
  flex: 0 0 auto; font-size: 13px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2);
  white-space: nowrap; user-select: none; min-height: 34px;
  display: inline-flex; align-items: center;
}
.pill.on { background: var(--brand); color: #fff; border-color: transparent; font-weight: 600; }
.pill.on.soft { background: var(--brand-soft); color: var(--brand); }

/* 开关 */
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.switchrow:first-of-type { border-top: 0; }
.switchrow .sr-label { font-size: 14px; }
.switchrow .sr-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 48px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .18s; pointer-events: none; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; pointer-events: none; }
.switch input:checked ~ .track { background: var(--brand); }
.switch input:checked ~ .thumb { transform: translateX(20px); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 22px 6px; }
.empty .big { font-size: 34px; }
.empty p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.empty .fixbtn { margin-top: 14px; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--line);
}
.item:first-child { border-top: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-size: 14.5px; font-weight: 600; }
.item .sub2 { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.item .right { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
.stars { color: var(--brand-2); font-size: 12.5px; letter-spacing: .5px; white-space: nowrap; }
.item input[type="checkbox"] {
  flex: 0 0 auto; width: 20px; height: 20px; min-height: auto; margin: 0;
  accent-color: var(--brand);
}
.item .right { text-align: right; line-height: 1.45; }

/* 券口令 */
.codebox {
  margin-top: 6px; padding: 6px 8px; border-radius: 8px;
  background: var(--card-2); border: 1px dashed var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5; color: var(--ink-2);
  word-break: break-all;
}
a.btn { text-decoration: none; color: inherit; }

/* 统计 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.stat { background: var(--card-2); border-radius: var(--r-sm); padding: 10px 8px; text-align: center; }
.stat .v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; display: flex; margin-top: 10px; }
.bar .a { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.bar .b { background: var(--good); opacity: .75; }

/* ---------- 表单 ---------- */
label.field { display: block; margin-bottom: 10px; }
label.field .fl { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 5px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 11px;
  min-height: 44px;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }

input[type="range"] { accent-color: var(--brand); width: 100%; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 2px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1 1 0; max-width: 150px; background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; border-radius: 12px; color: var(--muted); font: inherit;
  font-size: 11.5px; min-height: 46px;
}
.tabbar button .ico { width: 22px; height: 22px; display: block; }
.tabbar button.on { color: var(--brand); font-weight: 600; background: var(--brand-soft); }

/* ---------- 提示条 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px); z-index: 60;
  background: rgba(38, 26, 18, .94); color: #fff; font-size: 13px;
  padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: 86vw; text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 55; }

/* ---------- 关于 ---------- */
.about { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.about code { background: var(--card-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

@media (min-width: 620px) {
  .app { padding-top: 22px; }
  .card { padding: 18px; }
  .slot .slot-name { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  * { transition: none !important; }
}
