/* ==========================================================
   食刻 · 视觉系统
   配色：鼠尾草绿 + 暖杏 + 奶油底，低饱和、轻阴影
   ========================================================== */
:root {
  --bg: #F5F6F2;
  --bg-grad: linear-gradient(180deg, #F7F8F4 0%, #F3F5F0 100%);
  --surface: #FFFFFF;
  --surface-2: #FAFBF7;
  --line: #E8EBE3;
  --line-soft: #F1F3ED;
  --text: #2B322C;
  --text-2: #5E675F;
  --muted: #98A199;
  --primary: #5B8C6E;
  --primary-dark: #4A7659;
  --primary-soft: #EBF2EC;
  --accent: #E9A178;
  --accent-soft: #FBEEE4;
  --blue: #7FA6C9;
  --blue-soft: #ECF2F8;
  --purple: #A98BC0;
  --purple-soft: #F2EDF6;
  --danger: #D96C5F;
  --danger-soft: #FBEBE8;
  --warn: #DFA24E;
  --warn-soft: #FCF3E3;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(43, 50, 44, .04), 0 10px 30px rgba(43, 50, 44, .045);
  --shadow-sm: 0 1px 2px rgba(43, 50, 44, .05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-grad);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--primary); text-decoration: none; }
ul { list-style: none; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 238px;
  flex: 0 0 238px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(140deg, #6E9C7E, #4F7A5B);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 122, 91, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 17px; letter-spacing: .5px; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--text-2); font-size: 14px;
  transition: background .18s, color .18s;
  text-align: left; width: 100%;
}
.nav-item .ic { opacity: .78; transition: opacity .18s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}
.nav-item.active .ic { opacity: 1; }
.nav-sep { height: 1px; background: var(--line-soft); margin: 10px 12px; }

.sidebar-foot { margin-top: auto; padding-top: 14px; }
.mini-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 11px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(140deg, #E9A178, #D98B63);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex: 0 0 34px;
}
.mini-profile-text { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; }
.mini-profile-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-profile-text span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main {
  flex: 1; min-width: 0;
  padding: 26px 34px 34px;
  max-width: 1320px;
  margin: 0 auto;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 22px;
}
.topbar h1 { font-size: 23px; font-weight: 650; letter-spacing: -.2px; }
.topbar p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.today-chip {
  font-size: 12.5px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: var(--surface);
  border: 1px solid var(--line); transition: all .18s;
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: #DDE2D8; }
.icon-btn.tiny { width: 28px; height: 28px; border-radius: 8px; border-color: transparent; background: transparent; }
.icon-btn.tiny:hover { background: var(--surface-2); }
.icon-btn.tiny.danger:hover { background: var(--danger-soft); color: var(--danger); }
.bell .badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 10px; font-style: normal; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

.foot { margin-top: 28px; font-size: 11.5px; color: #B3BAB2; text-align: center; }

/* ---------------- 通用卡片 ---------------- */
.view { display: flex; flex-direction: column; gap: 16px; }
/* 纵向 flex 子项的 min-width 默认是 auto，长文案会把卡片撑宽并让整页横向溢出 */
.view > * { min-width: 0; }
.fade-in { animation: fadeIn .32s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.card-head h3 { font-size: 15.5px; font-weight: 620; letter-spacing: -.1px; }
.card-sub { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.ta-r { text-align: right; }
.text-warn { color: var(--danger); }
.text-ok { color: var(--primary); }
.warn { color: var(--danger); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(125deg, #EEF4EC 0%, #F7F8F1 46%, #FBEFE4 100%);
  border: 1px solid #E4EADD;
  border-radius: 22px;
  padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 161, 120, .18), transparent 68%);
  pointer-events: none;
}
.hero-eyebrow { font-size: 12px; color: var(--primary-dark); letter-spacing: .6px; margin-bottom: 6px; font-weight: 500; }
.hero-title { font-size: 26px; font-weight: 660; letter-spacing: -.4px; }
.hero-sub { font-size: 13.5px; color: var(--text-2); margin-top: 8px; max-width: 520px; }
.hero-sub b { color: var(--primary-dark); }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.hero-ring-note { font-size: 11.5px; color: var(--text-2); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; transition: all .18s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 3px 10px rgba(91, 140, 110, .22);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 5px 16px rgba(91, 140, 110, .28); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: #DCE1D6; color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-soft:hover { background: #E0EBE2; }
.btn-danger-ghost { background: var(--surface); border-color: #F0DAD6; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 提醒条 ---------------- */
.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 14px;
  font-size: 13px; border: 1px solid transparent;
}
.alert-warn { background: var(--warn-soft); border-color: #F4E4C6; color: #8A6524; }
.alert-danger { background: var(--danger-soft); border-color: #F3D8D3; color: #9C4438; }
.alert-info { background: var(--primary-soft); border-color: #DCE9DE; color: var(--primary-dark); }
.alert-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-body b { font-weight: 600; }
.alert-body span { font-size: 12.5px; opacity: .9; }
.alert .ic { flex: 0 0 auto; }

/* ---------------- 统计卡 ---------------- */
.stat { padding: 17px 18px; display: flex; flex-direction: column; gap: 3px; }
.stat-head { font-size: 12.5px; color: var(--muted); }
.stat-val { font-size: 26px; font-weight: 660; letter-spacing: -.6px; line-height: 1.2; }
.stat-val i { font-size: 12px; font-weight: 500; color: var(--muted); font-style: normal; margin-left: 3px; }
.stat-sub { font-size: 11.5px; color: var(--muted); }
.progress { height: 5px; border-radius: 999px; background: #EFF1EC; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.progress.big { height: 8px; margin-top: 12px; }

/* ---------------- 今日餐食 ---------------- */
.meal-list { display: flex; flex-direction: column; }
.meal-line {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px dashed var(--line-soft);
}
.meal-line:last-child { border-bottom: none; }
.meal-ic {
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: center;
}
.meal-ic.breakfast { background: var(--warn-soft); color: #B5822F; }
.meal-ic.lunch { background: var(--primary-soft); color: var(--primary-dark); }
.meal-ic.dinner { background: var(--purple-soft); color: #7E639B; }
.meal-ic.snack { background: var(--accent-soft); color: #C07A50; }
.meal-line-body { flex: 1; min-width: 0; }
.meal-line-top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.meal-line-items {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meal-line-kcal { font-size: 15px; font-weight: 620; text-align: right; white-space: nowrap; }
.meal-line-kcal span { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* ---------------- 到期 ---------------- */
.expire-list { display: flex; flex-direction: column; }
.expire-line {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed var(--line-soft);
}
.expire-line:last-child { border-bottom: none; }
.expire-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.expire-dot.expired { background: var(--danger); }
.expire-dot.urgent { background: var(--warn); }
.expire-dot.soon { background: var(--blue); }
.expire-dot.fresh { background: var(--primary); }
.expire-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.expire-body b { font-size: 13.5px; font-weight: 550; }
.expire-body span { font-size: 11.5px; color: var(--muted); }

/* ---------------- 建议 ---------------- */
.advice-target {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.advice-target > div {
  flex: 1; background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column;
}
.advice-target b { font-size: 17px; font-weight: 640; }
.reason-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.reason-list li {
  position: relative; padding-left: 16px; font-size: 13px; color: var(--text-2);
}
.reason-list li::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.advice-ex { background: var(--surface-2); border-radius: 13px; padding: 13px 14px; }
.advice-ex-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; font-size: 13.5px; }
.advice-ex-head .ic { color: var(--accent); }
.advice-ex-head span { margin-left: auto; }
.ex-line { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 5px 0; flex-wrap: wrap; }
.ex-line b { font-weight: 550; }
.ex-line span { color: var(--primary-dark); }
.ex-line em { color: var(--muted); font-style: normal; font-size: 11.5px; }
.weight-foot {
  display: flex; gap: 18px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 10px;
}
.weight-foot b { color: var(--text); font-weight: 600; }

/* ---------------- 图表 ---------------- */
.chart { width: 100%; height: auto; display: block; }
.chart .ax { font-size: 10px; fill: #A5ADA4; font-family: var(--font); }
.chart .ax.accent { fill: var(--accent); font-weight: 600; }
.ring-val { font-size: 25px; font-weight: 660; font-family: var(--font); }
.ring-sub { font-size: 10.5px; font-family: var(--font); }
.ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ring-wrap svg { width: 100%; height: 100%; display: block; }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  pointer-events: none; text-align: center; padding: 0 8px;
}
.ring-center b { font-size: 25px; font-weight: 660; letter-spacing: -.8px; line-height: 1.05; color: var(--text); }
.ring-center span { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.mini-chart-label { font-size: 11.5px; color: var(--muted); margin: 4px 0 -2px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-row i { width: 9px; height: 9px; border-radius: 3px; }
.legend-name { color: var(--text-2); width: 32px; }
.legend-pct { font-weight: 600; }
.legend-sub { color: var(--muted); font-size: 11.5px; margin-left: auto; }

.mbar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: #EFF1EC; }
.mbar span { display: block; height: 100%; }
.mbar-legend { display: flex; gap: 14px; margin-top: 9px; font-size: 11.5px; color: var(--text-2); flex-wrap: wrap; }
.mbar-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* ---------------- 食材库 ---------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 9px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 0 13px; height: 38px;
  color: var(--muted); min-width: 240px;
}
.search input { border: none; outline: none; background: transparent; width: 100%; font-size: 13.5px; color: var(--text); }
.search input::placeholder { color: #B6BDB4; }

.cat-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.cat-tab {
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; transition: all .16s;
}
.cat-tab i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.cat-tab:hover { border-color: #D9DED2; }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-tab.active i { color: rgba(255, 255, 255, .72); }

.table-card { padding: 20px 22px 8px; }
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted);
  padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FCFDFA; }
.table tr.row-expired { background: #FEFAF9; }
.table tr.row-future td { color: var(--muted); }
.cell-main { font-weight: 550; }
.cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.table .icon-btn.tiny { margin-left: 2px; }

.chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.chip-fresh { background: var(--primary-soft); color: var(--primary-dark); }
.chip-soon { background: var(--blue-soft); color: #4B729A; }
.chip-urgent { background: var(--warn-soft); color: #97671F; }
.chip-expired { background: var(--danger-soft); color: #A14B3E; }
.chip-ok { background: var(--primary-soft); color: var(--primary-dark); }

.tip-card { background: linear-gradient(180deg, #FBFCF8, #FFFFFF); }
.tip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.tip { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-2); align-items: flex-start; }
.tip .ic { color: var(--primary); flex: 0 0 auto; margin-top: 2px; }

/* ---------------- 日期导航 / Tabs ---------------- */
.date-nav { display: flex; align-items: center; gap: 10px; }
.date-nav-label { display: flex; flex-direction: column; line-height: 1.3; min-width: 150px; }
.date-nav-label b { font-size: 15px; font-weight: 620; }
.date-nav-label span { font-size: 11.5px; color: var(--muted); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.tab {
  flex: 1; min-width: 108px; position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: 10px 12px; text-align: left;
  display: flex; flex-direction: column; gap: 1px; transition: all .16s;
}
.tab:hover { border-color: #D8DED1; }
.tab-d { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.tab-date { font-size: 11px; color: var(--muted); }
.tab .dot {
  position: absolute; top: 10px; right: 10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}
.tab.active { background: var(--primary); border-color: var(--primary); }
.tab.active .tab-d { color: #fff; }
.tab.active .tab-date { color: rgba(255, 255, 255, .75); }
.tab.active .dot { background: #fff; }

/* ---------------- 计划 ---------------- */
.plan-summary {
  display: flex; align-items: center; gap: 26px;
  background: linear-gradient(110deg, #FBFCF8, #F6F9F4);
  flex-wrap: wrap;
}
.ps-date { font-size: 12.5px; color: var(--muted); }
.ps-cal { display: flex; align-items: baseline; gap: 6px; }
.ps-cal b { font-size: 30px; font-weight: 660; letter-spacing: -1px; }
.ps-cal span { font-size: 12.5px; color: var(--muted); }
.ps-note { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.ps-macro { flex: 1; min-width: 220px; }
.ps-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.meal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.meal-card { padding: 18px 20px 16px; display: flex; flex-direction: column; }
.meal-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.meal-card-title { flex: 1; min-width: 0; }
.meal-card-title h4 { font-size: 14.5px; font-weight: 600; }
.meal-card-title span { display: block; }
.meal-kcal { font-size: 13.5px; font-weight: 620; color: var(--text); }
.meal-items { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--line-soft);
}
.item-row:last-child { border-bottom: none; }
.item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-grams { color: var(--muted); font-size: 12px; }
.item-cal { width: 46px; text-align: right; font-size: 12.5px; color: var(--text-2); }
.grams-input {
  width: 62px; height: 27px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  text-align: center; font-size: 12px; color: var(--text-2);
  padding: 0 2px; outline: none; transition: all .16s;
}
.grams-input:focus { border-color: var(--primary); background: #fff; color: var(--text); box-shadow: 0 0 0 3px rgba(91, 140, 110, .1); }
.grams-input::-webkit-outer-spin-button, .grams-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.grams-wrap { display: inline-flex; align-items: center; gap: 3px; }
.grams-wrap em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.meal-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line-soft); margin-top: 10px; padding-top: 10px;
  font-size: 11.5px; color: var(--muted);
}
.macro-mini { display: inline-flex; align-items: center; gap: 4px; }
.macro-mini i { width: 6px; height: 6px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.macro-mini i.mp { background: var(--primary); }
.macro-mini i.mf { background: var(--accent); }
.macro-mini i.mc { background: var(--blue); }

.empty-card { text-align: center; padding: 46px 24px; }
.empty-card h3 { font-size: 17px; margin-bottom: 8px; }
.empty-card p { font-size: 13.5px; color: var(--text-2); max-width: 460px; margin: 0 auto 6px; }
.empty-card .btn { margin-top: 16px; }
.empty { text-align: center; padding: 26px 12px; }
.empty.small { padding: 16px 10px; }
.empty-ic {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--surface-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line);
}
.empty p { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.shop-item {
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 11px 13px;
  display: flex; flex-direction: column; gap: 3px; background: var(--surface-2);
}
.shop-item b { font-size: 13.5px; font-weight: 550; }
.shop-qty { font-size: 11.5px; color: var(--muted); }
.shop-buy { font-size: 12.5px; color: var(--primary-dark); font-weight: 550; }

.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ex-card { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.ex-card-top { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 4px; }
.ex-card-top .ic { color: var(--accent); }
.ex-card-top span { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.ex-card p { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------------- 每日记录 ---------------- */
.log-summary { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.ls-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.ls-item { display: flex; flex-direction: column; }
.ls-item span { font-size: 11.5px; color: var(--muted); }
.ls-item b { font-size: 17px; font-weight: 620; }
.log-meals { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.meal-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.meal-card-actions .btn { flex: 1; }

.water-visual { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.glass {
  width: 15px; height: 20px; border-radius: 3px 3px 6px 6px;
  background: #EFF3F6; border: 1px solid #E1E8EE;
  transition: background .3s;
}
.glass.on { background: linear-gradient(180deg, #A9C7E0, #7FA6C9); border-color: #7FA6C9; }
.water-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.ex-log { display: flex; flex-direction: column; }
.ex-log-line {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--line-soft);
}
.ex-log-line:last-child { border-bottom: none; }
.ex-log-ic {
  width: 28px; height: 28px; border-radius: 9px; flex: 0 0 28px;
  background: var(--accent-soft); color: #C07A50;
  display: flex; align-items: center; justify-content: center;
}
.ex-log-body { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.ex-log-body b { font-size: 13px; font-weight: 550; }
.ex-log-body span { font-size: 11.5px; color: var(--muted); }
.ex-log-kcal { font-size: 12.5px; font-weight: 550; color: var(--text-2); }

.inline-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.field.inline { min-width: 150px; }
.field.inline.grow { flex: 1; min-width: 240px; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field input, .field select {
  height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 0 12px; font-size: 13.5px; color: var(--text);
  outline: none; transition: border .16s, box-shadow .16s;
  width: 100%;
}
.field input:focus, .field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 140, 110, .12);
}
.field input::placeholder { color: #B6BDB4; }
.field .hint { font-size: 11.5px; color: var(--muted); font-style: normal; }
.field .hint b { color: var(--primary-dark); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
form[data-form="settings"] { display: flex; flex-direction: column; gap: 15px; }
form[data-form="settings"] .form-actions { margin-top: 2px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.input-group select { width: 82px; }

.radio-row { display: flex; gap: 10px; }
.radio-card {
  flex: 1; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; transition: all .16s; background: var(--surface);
}
.radio-card input { display: none; }
.radio-card b { font-size: 13px; font-weight: 550; }
.radio-card span { font-size: 11px; color: var(--muted); line-height: 1.4; }
.radio-card.active { border-color: var(--primary); background: var(--primary-soft); }
.radio-card.active b { color: var(--primary-dark); }

.seg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.seg {
  padding: 7px 14px; border-radius: 9px; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
}
.seg.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------- 档案 ---------------- */
.profile-grid { grid-template-columns: 1.25fr .95fr; }
.profile-side { background: linear-gradient(180deg, #FBFCF8, #FFFFFF); }
.big-target { margin-bottom: 16px; }
.big-target-num { font-size: 38px; font-weight: 680; letter-spacing: -1.4px; color: var(--primary-dark); line-height: 1.1; }
.big-target-num span { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.big-target-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.target-cell {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column;
}
.target-cell span { font-size: 11.5px; color: var(--muted); }
.target-cell b { font-size: 18px; font-weight: 630; }
.target-cell b i { font-size: 10.5px; font-style: normal; color: var(--muted); margin-left: 2px; font-weight: 500; }
.target-cell em { font-size: 10.5px; color: var(--muted); font-style: normal; }

.bmi-box { margin-top: 16px; }
.bmi-left { display: flex; align-items: baseline; gap: 8px; }
.bmi-left span { font-size: 11.5px; color: var(--muted); }
.bmi-left b { font-size: 22px; font-weight: 660; }
.bmi-left em { font-size: 11.5px; font-style: normal; font-weight: 550; }
.bmi-bar { position: relative; height: 7px; border-radius: 999px; margin: 9px 0 5px;
  background: linear-gradient(90deg, #BCD4E6 0%, #BCD4E6 17%, #CBE0CE 17%, #CBE0CE 45%, #F3DFBE 45%, #F3DFBE 65%, #F0C6C0 65%, #F0C6C0 100%); }
.bmi-bar span { position: absolute; top: -3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--text); transform: translateX(-50%); }
.bmi-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.notice {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--surface-2); border-radius: 11px; padding: 10px 12px;
  font-size: 11.5px; color: var(--text-2); margin-top: 14px; line-height: 1.5;
}
.notice .ic { color: var(--primary); flex: 0 0 auto; margin-top: 2px; }
.notice + .btn { margin-top: 12px; }
.notice.warn { background: var(--warn-soft); color: #8A6524; }
.notice.warn .ic { color: var(--warn); }

.pref-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pref-item { display: flex; flex-direction: column; gap: 2px; }
.pref-item span { font-size: 11.5px; }
.pref-item b { font-size: 13.5px; font-weight: 550; }

/* ---------------- 周报 ---------------- */
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight {
  display: flex; gap: 11px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.insight-ic {
  width: 28px; height: 28px; border-radius: 9px; flex: 0 0 28px;
  display: flex; align-items: center; justify-content: center;
}
.insight-good .insight-ic { background: var(--primary-soft); color: var(--primary-dark); }
.insight-warn .insight-ic { background: var(--warn-soft); color: #97671F; }
.insight-leaf .insight-ic { background: var(--blue-soft); color: #4B729A; }
.insight b { font-size: 13px; font-weight: 600; display: block; margin-bottom: 2px; }
.insight p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

/* ---------------- 设置 ---------------- */
.data-actions { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.data-actions .btn { width: 100%; justify-content: flex-start; }
.file-btn { cursor: pointer; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.about-item { background: var(--surface-2); border-radius: 11px; padding: 11px 13px; }
.about-item b { font-size: 12.5px; }
.about-item p { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------------- 弹窗 ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(38, 44, 38, .32);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
.modal-card {
  background: var(--surface); border-radius: 20px;
  width: 100%; max-width: 520px; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(30, 38, 30, .22);
  animation: popIn .22s cubic-bezier(.2, .8, .3, 1);
}
.modal-card.wide { max-width: 720px; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { font-size: 16px; font-weight: 620; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px 18px; border-top: 1px solid var(--line-soft);
}
.modal-body .form-grid { gap: 12px; }
.modal-search { margin-bottom: 12px; min-width: 0; width: 100%; }
.food-pick-list {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 4px;
}
.food-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 9px 11px; border-radius: 8px;
  font-size: 13px; text-align: left; transition: background .14s;
}
.food-row:hover { background: var(--surface-2); }
.food-row.selected { background: var(--primary-soft); color: var(--primary-dark); font-weight: 550; }
.food-row em { font-size: 11px; color: var(--muted); font-style: normal; }
.cal-preview {
  min-height: 38px; display: flex; flex-direction: column; justify-content: center;
  background: var(--surface-2); border-radius: 10px; padding: 6px 12px;
  font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-soft);
}
.cal-preview b { font-size: 15px; color: var(--text); }
.reminder-list { display: flex; flex-direction: column; }
.reminder-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed var(--line-soft);
}
.reminder-body { flex: 1; display: flex; flex-direction: column; }
.reminder-body b { font-size: 13.5px; font-weight: 550; }
.reminder-body span { font-size: 11.5px; color: var(--muted); }

/* ---------------- Toast ---------------- */
.toast-root {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: #2E362F; color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(30, 38, 30, .25);
  animation: toastIn .26s cubic-bezier(.2, .8, .3, 1);
  transition: opacity .4s, transform .4s;
  max-width: 80vw;
}
.toast.warn { background: #B5544A; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .main { padding: 22px 24px 30px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .pref-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0;
    width: 100%; height: auto; flex-direction: row; align-items: center;
    padding: 8px 10px; border-right: none; border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand, .sidebar-foot, .nav-sep { display: none; }
  .nav { flex-direction: row; gap: 2px; width: 100%; justify-content: space-between; }
  .nav-item { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10px; flex: 1; white-space: nowrap; letter-spacing: -.2px; }
  .nav-item .ic { width: 19px; height: 19px; }
  .main { padding: 18px 16px 88px; }
  .toast-root { bottom: 82px; }
  .grid-2, .meal-grid, .log-meals { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-ring { align-self: center; }
  .topbar { flex-wrap: wrap; }
  .today-chip { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .ex-grid, .tip-grid, .about-grid { grid-template-columns: 1fr; }
  .ps-macro { min-width: 100%; }
  .ls-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 16px; border-radius: 16px; }
  .hero { padding: 20px; }
  .hero-title { font-size: 22px; }
  .radio-row { flex-direction: column; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .pref-row { grid-template-columns: 1fr 1fr; }
  .table-wrap { margin: 0 -16px; }
  .toolbar .search { min-width: 100%; }
}

/* ==========================================================
   小票识别
   ========================================================== */
.receipt-modal { max-width: 720px; }
.receipt-steps { display: flex; gap: 14px; margin-top: 7px; }
.rstep { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.rstep i {
  width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 9.5px; color: var(--muted);
}
.rstep.on { color: var(--primary-dark); font-weight: 600; }
.rstep.on i { background: var(--primary); border-color: var(--primary); color: #fff; }

.rtabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.rtab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; border-radius: 9px; font-size: 12.5px; color: var(--text-2);
  transition: all .16s; white-space: nowrap;
}
.rtab.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(43, 50, 44, .08); }

.dropzone {
  border: 1.5px dashed #D8DFD2; border-radius: 16px; padding: 26px 20px; text-align: center;
  background: linear-gradient(180deg, #FBFCF8, #F8FAF5); transition: all .18s;
}
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dz-ic {
  width: 54px; height: 54px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; color: var(--primary);
}
.dropzone b { font-size: 14.5px; display: block; }
.dropzone p { font-size: 12px; color: var(--muted); margin: 4px 0 14px; }
.dz-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dz-actions .btn { cursor: pointer; }
.dz-preview { margin-top: 16px; }
.dz-preview img { max-width: 100%; max-height: 190px; border-radius: 10px; border: 1px solid var(--line); }
.receipt-meta { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }

.textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  font-size: 13px; line-height: 1.7; resize: vertical; outline: none; font-family: inherit;
  background: var(--surface); color: var(--text);
}
.textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 140, 110, .12); }

.receipt-running { text-align: center; padding: 30px 10px; }
.receipt-running b { display: block; margin: 14px 0 4px; font-size: 14.5px; }
.receipt-running p { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.running-thumb { max-width: 160px; max-height: 120px; border-radius: 10px; margin-top: 16px; border: 1px solid var(--line); opacity: .92; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--primary-soft); border-top-color: var(--primary);
  margin: 0 auto; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.result-head b { font-size: 14.5px; display: block; }
.result-tools { display: flex; gap: 6px; }

.cand-list { display: flex; flex-direction: column; gap: 8px; max-height: 44vh; overflow-y: auto; padding-right: 2px; }
.cand-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2);
}
.cand-row.off { opacity: .45; }
.cand-row.unmatched { background: #FEFAF3; border-color: #F4E6CC; }
.cand-check { position: relative; flex: 0 0 18px; height: 18px; }
.cand-check input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; cursor: pointer; }
.cand-check span { display: block; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #CFD6C9; background: #fff; }
.cand-check input:checked + span { background: var(--primary); border-color: var(--primary); }
.cand-check input:checked + span::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 9px;
  border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(42deg);
}
.cand-main { flex: 1; min-width: 0; }
.cand-name {
  width: 100%; border: 1px solid transparent; background: transparent;
  font-size: 13.5px; font-weight: 550; padding: 3px 4px; border-radius: 6px; outline: none;
}
.cand-name:hover { background: #fff; border-color: var(--line); }
.cand-name:focus { background: #fff; border-color: var(--primary); }
.cand-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; padding-left: 4px; }
.cand-qty { display: flex; gap: 4px; align-items: center; }
.cand-qty input {
  width: 64px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; text-align: center; font-size: 12.5px; outline: none;
}
.cand-qty select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12px; padding: 0 4px; }
.receipt-meta-row { display: flex; align-items: flex-end; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.receipt-meta-row .field.inline { min-width: 150px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* 安装到手机 */
.install-card .card-head { margin-bottom: 14px; }
.install-state {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 14px; background: var(--primary-soft); color: var(--primary-dark);
  border: 1px solid #DEEAE1;
}
.install-state > div { flex: 1; min-width: 0; }
.install-state b { display: block; font-size: 13.5px; color: var(--text); }
.install-state span { display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-top: 2px; }
.install-state.done { background: var(--accent-soft); border-color: #F5E2D3; color: #C97C4E; }
.install-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.install-feat {
  padding: 11px 13px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.install-feat b { display: block; font-size: 12.5px; }
.install-feat span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.install-more { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.install-more summary {
  cursor: pointer; font-size: 12.5px; color: var(--primary-dark);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.install-more summary::-webkit-details-marker { display: none; }
.install-more summary::before {
  content: ""; width: 0; height: 0; border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .2s;
}
.install-more[open] summary::before { transform: rotate(90deg); }
.install-ol { margin: 10px 0 8px 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.9; }
.install-ol li { list-style: decimal; }
.install-card code {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 5px;
  padding: 1px 5px; font-size: 11.5px; color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (max-width: 640px) {
  .install-feats { grid-template-columns: 1fr; }
  .install-state { flex-wrap: wrap; }
  .install-state .btn { width: 100%; }
}

@media (max-width: 640px) {
  .modal-backdrop { padding: 10px; }
  .modal-card { max-height: 94vh; border-radius: 18px; }
  .cand-list { max-height: 36vh; }
  .cand-qty input { width: 54px; }
  .rtab { font-size: 11.5px; padding: 7px 6px; gap: 4px; }
  .receipt-steps { gap: 10px; }
}

/* 弹窗打开时把 toast 移到顶部，避免遮住弹窗底部的主按钮 */
@media (max-width: 980px) {
  body:has(.modal-backdrop) .toast-root {
    top: calc(14px + env(safe-area-inset-top, 0px));
    bottom: auto;
  }
}

/* iPhone 刘海屏安全区 */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 980px) {
    .sidebar { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    .main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    .toast-root { bottom: calc(82px + env(safe-area-inset-bottom)); }
    .topbar { padding-top: env(safe-area-inset-top); }
  }
}
