/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #ff5e3a;
  --primary-light: #ff9a56;
  --bg: #fff7f2;
  --card: #ffffff;
  --text: #2b2118;
  --text-2: #8a7a6d;
  --line: #f0e4da;
  --ok: #2fb874;
  --shadow: 0 6px 24px rgba(255, 94, 58, .12);
  --tabbar-h: 62px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top) + 92px) 16px calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 84px);
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

/* ===== 灵动岛 ===== */
.island {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #111;
  color: #fff;
  border-radius: 24px;
  min-width: 150px;
  max-width: min(92vw, 460px);
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .45s cubic-bezier(.32, .72, .24, 1);
  box-shadow: 0 8px 30px rgba(0,0,0,.28);
  overflow: hidden;
  cursor: pointer;
}
.island.expanded {
  width: min(92vw, 440px);
  border-radius: 28px;
  padding: 14px 16px;
  justify-content: flex-start;
  background: linear-gradient(135deg, #1a1a1a, #2a1810);
}
.island-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  margin-right: 8px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.island-compact { font-size: 14px; white-space: nowrap; display: flex; align-items: center; }
.island-expanded { display: none; width: 100%; align-items: center; gap: 12px; }
.island.expanded .island-compact { display: none; }
.island.expanded .island-expanded { display: flex; }
.island-expanded-main { flex: 1; min-width: 0; }
.island-title { font-size: 12px; color: #c9b8a8; }
.island-food {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(90deg, #ffb347, var(--primary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.island-btn {
  flex-shrink: 0;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 8px 12px; border-radius: 16px;
  white-space: nowrap;
}
.island-close { flex-shrink: 0; color: #888; font-size: 20px; line-height: 1; padding: 4px; }

/* ===== 页面 ===== */
.page-head { text-align: center; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.page-head .sub { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card-title .src { font-size: 11px; color: #b7a89b; font-weight: 400; margin-left: 6px; }
.tip { font-size: 12px; color: var(--text-2); margin-top: 10px; text-align: center; }

/* ===== 九宫格转盘 ===== */
.grid-wrap { margin: 4px auto 20px; }
.grid-wheel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(90vw, 380px);
  margin: 0 auto;
  aspect-ratio: 1;
}
.grid-cell {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(255, 94, 58, .08);
  transition: background .12s, color .12s, transform .12s, box-shadow .12s;
  user-select: none;
}
.grid-cell:nth-child(even) { background: #fff8f3; }
.gc-name { line-height: 1.35; word-break: break-all; }
/* 跑马灯高亮：统一固定绿色 */
.grid-cell.active {
  background: #22c55e;
  border-color: transparent;
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(34, 197, 94, .65);
  z-index: 2;
}
.grid-cell.active .gc-name { color: #fff; }
.grid-cell.winner {
  animation: winBlink .45s ease 5;
  background: #22c55e;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(34, 197, 94, .65);
}
@keyframes winBlink {
  0%, 100% { transform: scale(1.06); box-shadow: 0 0 18px rgba(34, 197, 94, .55); }
  50% { transform: scale(1.14); box-shadow: 0 0 34px rgba(34, 197, 94, .95); }
}
.grid-go {
  display: block;
  margin: 18px auto 0;
  background: #22c55e;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 14px 52px;
  border-radius: 28px;
  box-shadow: 0 8px 22px rgba(34, 197, 94, .4);
  transition: transform .15s, opacity .2s;
}
.grid-go:active { transform: scale(.95); }
.grid-go:disabled { opacity: .55; }

.dish-manage {
  background: var(--card); border-radius: 18px; padding: 16px;
  box-shadow: var(--shadow);
}
.dish-manage-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 700; margin-bottom: 12px;
}
.dish-manage-actions { display: flex; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff2ea; color: var(--text);
  border: 1px solid #ffd9c7;
  font-size: 13px; padding: 7px 12px; border-radius: 20px;
  transition: transform .1s;
}
.chip:active { transform: scale(.94); }
.chip .x { color: #c8b6a8; font-size: 14px; line-height: 1; }
.chip .x:hover { color: var(--primary); }
.chip.filter { background: #f7f2ee; border-color: var(--line); color: var(--text-2); }
.chip.filter.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

.mini-btn {
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 7px 14px; border-radius: 16px;
  transition: transform .1s, opacity .2s;
}
.mini-btn:active { transform: scale(.94); }
.mini-btn.ghost { background: #f7f2ee; color: var(--text-2); }
.main-btn {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; font-size: 16px; font-weight: 800;
  padding: 12px 34px; border-radius: 24px;
  box-shadow: 0 6px 18px rgba(255,94,58,.35);
}
.main-btn:active { transform: scale(.96); }

/* ===== 解压 ===== */
.seg-tabs {
  display: flex; background: #f3e9e1; border-radius: 16px;
  padding: 4px; gap: 4px; margin-bottom: 16px;
}
.seg-tab {
  flex: 1; padding: 10px 4px; border-radius: 13px;
  font-size: 13px; font-weight: 700; color: var(--text-2);
  transition: all .25s;
}
.seg-tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tool-card {
  background: var(--card); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow); min-height: 320px;
}
.tool-bar { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 14px; }
.tool-bar b { color: var(--primary); }

.bubble-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.bubble {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95), rgba(180,220,255,.55) 45%, rgba(120,180,255,.35));
  box-shadow: inset 0 -4px 8px rgba(90,150,220,.25), 0 2px 6px rgba(0,0,0,.06);
  position: relative;
  transition: transform .12s;
}
.bubble::after {
  content: ""; position: absolute; top: 14%; left: 18%;
  width: 26%; height: 20%; border-radius: 50%;
  background: rgba(255,255,255,.9);
  filter: blur(1px);
}
.bubble:active { transform: scale(.9); }
.bubble.popped {
  background: radial-gradient(circle, rgba(255,180,140,.5), rgba(255,94,58,.18));
  box-shadow: inset 0 2px 6px rgba(255,94,58,.15);
  animation: pop .25s ease;
}
.bubble.popped::after { display: none; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.25); } 100% { transform: scale(1); } }

.breath-stage { display: flex; justify-content: center; padding: 20px 0 26px; }
.breath-circle {
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #b8e6d1, #2fb874);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 800;
  box-shadow: 0 0 0 0 rgba(47,184,116,.4);
  transition: transform 4s ease-in-out, box-shadow 4s ease-in-out;
}
.breath-circle.inhale { transform: scale(1.55); box-shadow: 0 0 0 18px rgba(47,184,116,.12); }
.breath-circle.hold { transform: scale(1.55); }
.breath-circle.exhale { transform: scale(1); box-shadow: 0 0 0 0 rgba(47,184,116,0); }
.breath-desc { font-size: 13px; color: var(--text-2); line-height: 1.7; text-align: center; }
.breath-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 14px; }
.breath-footer b { color: var(--ok); }

.fish-stage { position: relative; display: flex; justify-content: center; padding: 10px 0 20px; }
.fish-btn {
  width: 190px; height: 150px;
  background: radial-gradient(ellipse at 50% 35%, #b0713d, #7a4a22);
  border-radius: 50% 50% 46% 46%;
  position: relative;
  box-shadow: 0 12px 24px rgba(122,74,34,.35), inset 0 -8px 14px rgba(0,0,0,.25);
  transition: transform .08s;
}
.fish-btn:active { transform: scale(.96); }
.fish-eye {
  position: absolute; top: 42px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #5a3a1c, #2b1a0c);
  box-shadow: inset 0 0 0 5px rgba(255,220,180,.35);
}
.fish-mouth {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 10px;
  border-radius: 0 0 24px 24px;
  background: #4a2c12;
}
.fish-stick {
  position: absolute; right: -18px; top: -6px;
  font-size: 34px; color: #8a5a2e; font-weight: 900;
  transform-origin: bottom center;
  transition: transform .12s;
}
.fish-stick.knock { transform: rotate(-28deg); }
.float-layer { position: absolute; inset: 0; pointer-events: none; }
.float-text {
  position: absolute; left: 50%; top: 40px;
  color: var(--primary); font-weight: 800; font-size: 17px;
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -56px); }
}
.fish-count { text-align: center; font-size: 16px; margin-top: 8px; }
.fish-count b { color: var(--primary); font-size: 20px; }

/* ===== 菜谱 / 列表 ===== */
.search-box { margin-bottom: 12px; }
.search-box input {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; font-size: 14px; outline: none;
}
.search-box input:focus { border-color: var(--primary-light); }
.filter-chips { margin-bottom: 14px; }
.card-list { display: flex; flex-direction: column; gap: 12px; }
.recipe-card {
  background: var(--card); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
  transition: transform .12s;
}
.recipe-card:active { transform: scale(.98); }
.recipe-emoji {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 14px; background: #fff2ea;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.recipe-info { flex: 1; min-width: 0; }
.recipe-name { font-size: 16px; font-weight: 800; }
.recipe-meta { font-size: 12px; color: var(--text-2); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.recipe-meta .tag { background: #f7f2ee; padding: 2px 8px; border-radius: 8px; }
.recipe-meta .tag.hot { background: #ffe9e2; color: var(--primary); }
.recipe-go { color: #d8c8ba; font-size: 22px; flex-shrink: 0; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30,20,12,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-mask.center { align-items: center; }
.modal {
  background: #fff; width: 100%; max-width: 480px;
  animation: sheetUp .3s cubic-bezier(.2,.8,.3,1);
}
@keyframes sheetUp { from { transform: translateY(60%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet { border-radius: 22px 22px 0 0; max-height: 82vh; display: flex; flex-direction: column; }
.sheet-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 18px 10px;
}
.sheet-head h2 { font-size: 18px; }
.modal-close { font-size: 26px; color: #b7a89b; line-height: 1; padding: 2px 8px; }
.sheet-body { padding: 0 18px 26px; overflow-y: auto; }
.dialog {
  border-radius: 20px; padding: 22px; margin: 0 28px;
  width: auto; max-width: 340px;
  animation: popIn .25s ease;
}
@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog h3 { font-size: 17px; margin-bottom: 14px; }
.dialog input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 15px; outline: none; margin-bottom: 16px;
}
.dialog input:focus { border-color: var(--primary-light); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.weight-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.weight-row input { flex: 1; margin-bottom: 0; }
.weight-row span { color: var(--text-2); }

/* 菜谱详情 */
.rm-hero { text-align: center; padding: 6px 0 14px; }
.rm-hero .big { font-size: 52px; }
.rm-stats { display: flex; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.rm-stats .tag { background: #fff2ea; color: #c25a2e; font-size: 12px; padding: 4px 12px; border-radius: 10px; }
.rm-sec-title { font-size: 15px; font-weight: 800; margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.ing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ing-item {
  background: #faf6f2; border-radius: 10px; padding: 9px 12px;
  font-size: 13px; display: flex; justify-content: space-between;
}
.ing-item .amt { color: var(--text-2); }
.step-item { display: flex; gap: 12px; margin-bottom: 14px; }
.step-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step-text { font-size: 14px; line-height: 1.7; padding-top: 2px; }
.rm-tip {
  background: #fff8ec; border-radius: 12px; padding: 12px 14px;
  font-size: 13px; line-height: 1.7; color: #8a6d3b;
}

/* 安装指引 */
.install-guide { font-size: 14px; line-height: 1.8; }
.install-guide .os-block { margin-bottom: 16px; }
.install-guide .os-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.install-guide ol { padding-left: 22px; color: var(--text-2); }
.install-guide li { margin-bottom: 4px; }
.install-guide .note { background: #eef8f2; color: #2c7a52; border-radius: 12px; padding: 10px 14px; font-size: 13px; }

/* ===== 星座运势 ===== */
.sign-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.sign-cell {
  background: var(--card); border-radius: 14px; padding: 10px 4px;
  text-align: center; box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: transform .12s;
}
.sign-cell:active { transform: scale(.93); }
.sign-cell.active { border-color: var(--primary); background: #fff2ea; }
.sign-cell .sym { font-size: 24px; }
.sign-cell .nm { font-size: 12px; margin-top: 3px; font-weight: 700; }
.sign-cell .dt { font-size: 10px; color: var(--text-2); margin-top: 2px; }
.fortune-panel { animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sign-meta { display: flex; align-items: center; gap: 14px; }
.sign-meta .sym { font-size: 44px; }
.sign-meta .nm { font-size: 18px; font-weight: 800; }
.sign-meta .meta-line { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.moon-body { display: flex; align-items: center; gap: 16px; }
.moon-emoji { font-size: 54px; line-height: 1; }
.moon-info .phase { font-size: 17px; font-weight: 800; }
.moon-info .ill { font-size: 13px; color: var(--text-2); margin: 4px 0; }
.moon-info .next { font-size: 12px; color: var(--text-2); line-height: 1.7; }
.horo-body .en-text {
  font-size: 14px; line-height: 1.8; color: #4a3f35;
  background: #faf6f2; border-radius: 12px; padding: 12px 14px;
  border-left: 3px solid var(--primary);
}
.horo-body .date-line { font-size: 12px; color: var(--text-2); margin-top: 8px; text-align: right; }
.loading { color: var(--text-2); font-size: 13px; }
.lucky-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lucky-item { background: #faf6f2; border-radius: 12px; padding: 12px; text-align: center; }
.lucky-item .lab { font-size: 12px; color: var(--text-2); }
.lucky-item .val { font-size: 18px; font-weight: 800; margin-top: 4px; color: var(--primary); }

/* ===== 热量 ===== */
.today-card { display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #fff2ea, #ffe4d5); }
.today-main { display: flex; align-items: center; gap: 14px; }
.today-num { font-size: 15px; color: var(--text-2); }
.today-num b { font-size: 30px; color: var(--primary); font-weight: 900; }
.today-num span { font-size: 12px; margin-left: 3px; }
.today-info { font-size: 13px; color: var(--text); line-height: 1.5; }
.today-info small { color: var(--text-2); }
.food-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.food-item {
  background: var(--card); border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 3px 12px rgba(255,94,58,.07);
}
.food-item:active { transform: scale(.98); }
.food-emoji { font-size: 24px; }
.food-name { flex: 1; font-size: 14px; font-weight: 700; }
.food-name small { display: block; color: var(--text-2); font-weight: 400; font-size: 11px; margin-top: 2px; }
.food-kcal { font-size: 14px; color: var(--primary); font-weight: 800; white-space: nowrap; }
.food-kcal small { color: var(--text-2); font-weight: 400; font-size: 11px; }
.food-add {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-title { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.log-item {
  background: #fff; border-radius: 12px; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.log-item .meta { color: var(--text-2); font-size: 12px; }
.log-item .del { color: #d8c8ba; padding: 4px 8px; font-size: 16px; }
.empty-tip { text-align: center; color: var(--text-2); font-size: 13px; padding: 24px 0; }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 90;
}
.tab {
  flex: 1; padding: 8px 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--text-2);
}
.tab .tab-ico { font-size: 22px; filter: grayscale(.5); transition: transform .2s; }
.tab.active { color: var(--primary); font-weight: 800; }
.tab.active .tab-ico { filter: none; transform: translateY(-2px) scale(1.12); }

/* 安装浮动按钮 */
.install-fab {
  position: fixed; right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 14px);
  z-index: 80;
  background: #111; color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 11px 16px; border-radius: 22px;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  max-width: 480px;
  animation: fabBounce 2.4s infinite;
}
@keyframes fabBounce {
  0%, 92%, 100% { transform: translateY(0); }
  95% { transform: translateY(-6px); }
}
@media (min-width: 481px) {
  .install-fab { right: calc(50% - 240px + 16px); }
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 120px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,20,12,.9); color: #fff;
  font-size: 14px; padding: 10px 20px; border-radius: 20px;
  opacity: 0; pointer-events: none;
  transition: all .3s; z-index: 300;
  max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 实用工具入口宫格 ===== */
.tools-entry { margin-top: 16px; }
.tools-entry-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tool-tile {
  background: #fff8f3; border: 1px solid #ffe3d3; border-radius: 16px;
  padding: 14px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: transform .12s;
}
.tool-tile:active { transform: scale(.93); }
.tool-tile .tt-ico { font-size: 26px; }
.tool-tile .tt-name { font-size: 13px; font-weight: 700; color: var(--text); }
.tool-tile .tt-desc { font-size: 10px; color: var(--text-2); }

/* ===== 工具全屏覆盖层 ===== */
.tool-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto;
}
.tool-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 12px;
  background: var(--card); box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.tool-header h2 { font-size: 17px; font-weight: 800; }
.tool-back { font-size: 16px; font-weight: 700; color: var(--primary); padding: 4px 6px; width: 56px; text-align: left; }
.tool-header-sp { width: 56px; }
.tool-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 30px); }

.tool-addrow { display: flex; gap: 8px; margin-bottom: 10px; }
.tool-addrow input {
  flex: 1; min-width: 0; background: #fff; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 11px 14px; font-size: 15px; color: var(--text);
}
.tool-addrow input:focus { outline: none; border-color: var(--primary); }
.tool-addrow .w70 { flex: 0 0 76px; }

/* 买菜清单 */
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 13px 14px;
  box-shadow: 0 2px 8px rgba(255,94,58,.06); font-size: 15px;
}
.shop-item .ck {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #e0d2c6;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
}
.shop-item.done .ck { background: #22c55e; border-color: #22c55e; }
.shop-item .nm { flex: 1; }
.shop-item.done .nm { text-decoration: line-through; color: #b7a89b; }
.shop-item .del { color: #d8c7ba; font-size: 18px; padding: 2px 6px; }
.shop-empty { text-align: center; color: var(--text-2); font-size: 14px; padding: 40px 0; }

/* 冰箱库存 */
.fridge-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.fridge-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(255,94,58,.06);
  border-left: 5px solid #22c55e;
}
.fridge-item.warn { border-left-color: #f59e0b; }
.fridge-item.bad { border-left-color: #ef4444; }
.fridge-item .fi-name { font-size: 15px; font-weight: 700; flex: 1; }
.fridge-item .fi-day { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; }
.fridge-item.fresh .fi-day { background: #e8f9ef; color: #16a34a; }
.fridge-item.warn .fi-day { background: #fef3e2; color: #d97706; }
.fridge-item.bad .fi-day { background: #fdeaea; color: #dc2626; }
.fridge-item .del { color: #d8c7ba; font-size: 18px; padding: 2px 6px; }
.fridge-recipes .fr-title { font-size: 14px; font-weight: 800; margin: 6px 0 10px; }
.fr-recipe {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border-radius: 14px; padding: 13px 14px; margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(255,94,58,.06); font-size: 15px; font-weight: 600;
}
.fr-recipe .go { color: var(--primary); font-size: 13px; font-weight: 700; }

/* 喝水打卡 */
.water-hero { display: flex; align-items: center; gap: 20px; }
.water-cup {
  position: relative; width: 130px; height: 130px; flex: 0 0 auto;
  border-radius: 50%; background: #eaf4fb; overflow: hidden;
  border: 4px solid #cfe6f7; box-shadow: inset 0 2px 8px rgba(0,0,0,.06);
}
.water-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: linear-gradient(180deg, #56b4f0, #2f9be8);
  transition: height .5s ease;
}
.water-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: var(--text); z-index: 2;
}
.water-meta { flex: 1; }
.water-big { font-size: 22px; font-weight: 800; }
.water-ml { font-size: 14px; color: var(--text-2); margin: 4px 0 10px; }
.water-streak { font-size: 14px; font-weight: 700; color: var(--primary); }
.water-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.water-actions .main-btn { flex: 1; padding: 13px; font-size: 15px; }
.goal-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.goal-row input { width: 64px; background: #fff8f3; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; font-size: 15px; font-weight: 700; }
.goal-row label { font-weight: 700; }

/* 聚餐 AA */
.aa-row { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 12px; }
.aa-row label { width: 78px; font-weight: 700; flex: 0 0 auto; }
.aa-row input { flex: 1; min-width: 0; background: #fff8f3; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 16px; font-weight: 700; }
.aa-row input:focus { outline: none; border-color: var(--primary); }
.aa-row span { color: var(--text-2); font-size: 13px; flex: 0 0 auto; }
.aa-result { background: #f0fdf4; border: 1.5px solid #bbf7d0; }
.aa-line { font-size: 14px; color: #37504; color: #4b5b52; margin-bottom: 8px; }
.aa-line b { color: var(--text); }
.aa-per { font-size: 20px; font-weight: 800; color: #16a34a; margin: 6px 0 8px; }
.aa-per b { font-size: 26px; }
.aa-tip { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* ===== 小游戏入口横幅 ===== */
.game-banner {
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin-top: 12px;
  background: linear-gradient(135deg, #34d399, #16a34a);
  border-radius: 18px; padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(34,197,94,.32);
  text-align: left; transition: transform .12s;
}
.game-banner:active { transform: scale(.97); }
.game-banner .gb-ico { font-size: 34px; flex: 0 0 auto; }
.game-banner .gb-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.game-banner .gb-text b { color: #fff; font-size: 16px; font-weight: 800; }
.game-banner .gb-text small { color: rgba(255,255,255,.9); font-size: 11px; }
.game-banner .gb-go { color: #fff; font-size: 13px; font-weight: 800; background: rgba(255,255,255,.22); padding: 7px 12px; border-radius: 16px; flex: 0 0 auto; }

/* ===== 接美食游戏 ===== */
.game-hud {
  display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px;
}
.gh-item {
  flex: 1; background: var(--card); border-radius: 14px; text-align: center;
  padding: 10px 4px; font-size: 13px; color: var(--text-2); font-weight: 700;
  box-shadow: 0 2px 8px rgba(255,94,58,.06);
}
.gh-item b { font-size: 18px; color: var(--text); font-weight: 800; }
.gh-item.lives span { font-size: 15px; letter-spacing: 1px; }
.game-wrap {
  position: relative; width: 100%;
  border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow);
}
#gameCanvas {
  display: block; width: 100%;
  height: auto; aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, #bfe9ff 0%, #e8f7ff 45%, #fff3e6 100%);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.game-mask {
  position: absolute; inset: 0;
  background: rgba(20, 30, 40, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(2px);
}
.game-mask.hidden { display: none; }
.gm-card {
  background: #fff; border-radius: 20px; padding: 26px 24px;
  text-align: center; max-width: 280px; width: 100%;
  box-shadow: 0 12px 34px rgba(0,0,0,.25);
}
.gm-emoji { font-size: 52px; line-height: 1; margin-bottom: 10px; }
.gm-title { font-size: 21px; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.gm-desc { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 18px; }
.gm-desc b { color: var(--primary); }
.gm-score { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.gm-score .big { font-size: 30px; color: var(--primary); font-weight: 800; }
.gm-card { max-height: 94%; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* 排行榜 */
.gm-board {
  background: #fff8f0; border: 1px solid #ffe8d2; border-radius: 14px;
  padding: 12px; margin-bottom: 16px; text-align: left;
}
.lb-title { font-size: 14px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.lb-loading, .lb-empty, .lb-offline {
  font-size: 12px; color: var(--text-2); text-align: center; padding: 10px 0; line-height: 1.6;
}
.lb-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 6px; border-radius: 10px; font-size: 13px;
}
.lb-row:nth-child(odd) { background: rgba(255,255,255,.7); }
.lb-row.me { background: #dcfce7; font-weight: 800; }
.lb-rank { width: 30px; flex: 0 0 auto; text-align: center; font-weight: 800; color: var(--text-2); font-size: 13px; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-score { flex: 0 0 auto; font-weight: 800; color: var(--primary); }

/* 提交昵称行 */
.gm-submit-row { display: flex; gap: 8px; margin-bottom: 12px; }
.gm-submit-row input {
  flex: 1; min-width: 0; background: #fff8f3; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font-size: 14px;
}
.gm-submit-row input:focus { outline: none; border-color: var(--primary); }
.gm-submit-row .mini-btn { padding: 10px 14px; white-space: nowrap; }
.gm-rank {
  background: #ecfdf5; border: 1.5px solid #a7f3d0; color: #047857;
  border-radius: 12px; padding: 10px; text-align: center;
  font-size: 14px; font-weight: 800; margin-bottom: 12px;
}
.gm-rank .rk-big { font-size: 22px; color: #059669; }
