/* ==========================================================================
   我的生活工作台 · 样式表
   移动优先，桌面自适应
   ========================================================================== */
:root {
  /* 美拉德×奶油 配色 */
  --c-primary: #a9714b;        /* 焦糖棕 */
  --c-primary-soft: #f3ebe2;   /* 奶油杏（浅底） */
  --c-bg: #faf6f0;             /* 奶油白背景 */
  --c-card: #ffffff;
  --c-text: #3d3229;           /* 深咖文字 */
  --c-text-2: #8a7a6b;         /* 浅咖次级 */
  --c-text-3: #b8a996;         /* 燕麦灰 */
  --c-border: #ece4d8;         /* 米灰边框 */
  --c-income: #c05f4c;         /* 收入/涨 → 砖红（暖调） */
  --c-expense: #7d9471;        /* 支出/跌 → 橄榄绿 */
  --c-danger: #c05f4c;
  --c-grad-a: #b98a5f;         /* 渐变起点：焦糖 */
  --c-grad-b: #96633f;         /* 渐变终点：深棕 */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(90, 70, 50, .06);
  --shadow-lg: 0 -8px 40px rgba(90, 70, 50, .16);
  --c-shadow-rgb: 90, 70, 50;  /* 阴影基色 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 180ms;
  --dur-fast: 120ms;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 58px;

  /* ── 语义色：优先级 / 状态徽章 ── */
  --c-high-bg: #f6e3dc;   --c-high-fg: #b2543f;
  --c-mid-bg:  #f3e8d3;   --c-mid-fg:  #a9762f;
  --c-low-bg:  #f3ebe2;   --c-low-fg:  #a9714b;
  --c-danger-bg: #f6e3dc;
  --c-st-pending-bg: #f6e3d6; --c-st-pending-fg: #c0673a;
  --c-st-accept-bg:  #e7efe4; --c-st-accept-fg:  #5e7d54;
  --c-st-done-bg:    #efe9df; --c-st-done-fg:    #8a7a6b;
  --c-st-cancel-bg:  #f0e3e1; --c-st-cancel-fg:  #b07d7d;
  --c-row-del-active: #f6e3dc;
}
html[data-theme="dark"] {
  --c-primary-soft: #2e2419;
  --c-bg: #1c1712;
  --c-card: #292018;
  --c-text: #f0e8dd;
  --c-text-2: #b3a491;
  --c-text-3: #7d6f5e;
  --c-border: #382d22;
  --c-shadow-rgb: 0, 0, 0;
  /* 深色下的语义色：底色压暗，文字提亮 */
  --c-high-bg: #3d2620;   --c-high-fg: #e08a72;
  --c-mid-bg:  #3a2f1c;   --c-mid-fg:  #d9a95c;
  --c-low-bg:  #2e2419;   --c-low-fg:  #c89b70;
  --c-danger-bg: #3d2620;
  --c-danger: #e08a72;
  --c-st-pending-bg: #3a2a1c; --c-st-pending-fg: #e0956a;
  --c-st-accept-bg:  #22301f; --c-st-accept-fg:  #9cbf8e;
  --c-st-done-bg:    #2a241c; --c-st-done-fg:    #b3a491;
  --c-st-cancel-bg:  #33242a; --c-st-cancel-fg:  #c99a9a;
  --c-row-del-active: #3d2620;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ---------------- 布局 ---------------- */
#app { display: flex; flex-direction: column; height: 100dvh; }

#topbar {
  padding-top: var(--safe-top);
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; gap: 12px;
  position: relative;   /* 作为 .tb-title 绝对居中的参照 */
}
/* 工作台名称：真正居中（左右按钮数不同，用 flex 居中会偏，故绝对定位） */
.tb-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 190px);   /* 右侧 3 个按钮占位，避免长名字压到按钮 */
  font-size: 15px; font-weight: 800; letter-spacing: -.2px;
  color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center; pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--c-grad-a), var(--c-grad-b));
  color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.brand-text p { font-size: 12px; color: var(--c-text-3); margin-top: 1px; }
.topbar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; font-size: 17px;
  color: var(--c-text-2); background: var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.icon-btn:active { transform: scale(.93); background: var(--c-primary-soft); color: var(--c-primary); }

#main { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
#viewRoot { padding: 14px 14px calc(var(--tabbar-h) + var(--safe-bottom) + 76px); max-width: 780px; margin: 0 auto; }

/* ---------------- 底部导航 ---------------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  /* ⚠️ 性能红线：fixed 常驻元素不能用 backdrop-filter（滚动每帧全屏重采样） */
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--c-border);
  display: flex; align-items: stretch;
}
html[data-theme="dark"] #tabbar { background: rgba(41,32,24,.94); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--c-text-3); transition: .15s; padding-top: 5px;
}
.tab-ico { font-size: 19px; line-height: 1; }
.tab-txt { font-size: 10.5px; font-weight: 500; }
.tab.active { color: var(--c-primary); }
.tab.active .tab-ico { transform: translateY(-1px) scale(1.08); }
.tab:active { opacity: .6; }
/* 编辑模式：底部菜单图标轻微抖动，并出现移除角标（像手机桌面整理） */
.tab-edit { position: relative; cursor: grab; animation: tab-jiggle 1.8s ease-in-out infinite; }
.tab-edit:active { cursor: grabbing; }
@keyframes tab-jiggle { 0%,100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
.tab-remove { display: none; }
.tab-edit .tab-remove {
  display: block; position: absolute; top: 3px; right: 50%; transform: translateX(18px);
  width: 17px; height: 17px; line-height: 15px; text-align: center;
  background: #ef4444; color: #fff; border: 2px solid var(--c-card, #fff); border-radius: 50%;
  font-size: 11px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
html[data-theme="dark"] .tab-edit .tab-remove { border-color: #2a2018; }
/* 自定义底部菜单面板 */
.dock-sec { font-size: 13px; color: var(--c-text-2); margin: 16px 0 8px; font-weight: 600; }
.dock-edit-list { display: flex; flex-direction: column; gap: 8px; }
.dock-edit-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: 12px; padding: 10px 12px;
}
.de-ico { font-size: 18px; width: 24px; text-align: center; }
.de-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--c-text); }
.de-acts { display: flex; gap: 6px; }
.de-btn {
  min-width: 32px; height: 30px; border-radius: 8px; border: 1px solid var(--c-border);
  background: #fff; color: var(--c-text-2); font-size: 14px; font-weight: 600;
}
.de-btn.add { color: var(--c-primary); border-color: var(--c-primary); }
.de-btn.del { color: #ef4444; border-color: #ef4444; }
.de-btn:disabled { opacity: .35; }
html[data-theme="dark"] .de-btn { background: #33271d; color: var(--c-text-2); }

/* ---------------- FAB ---------------- */
#fab {
  position: fixed; right: 18px; z-index: 31;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-grad-a), var(--c-grad-b));
  color: #fff; font-size: 27px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(150,99,63,.35);
  transition: .18s;
}
#fab:active { transform: scale(.9); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--c-card); border-radius: var(--radius);
  padding: 15px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; }
.link-btn { font-size: 12.5px; color: var(--c-primary); font-weight: 500; }
.empty { font-size: 13px; color: var(--c-text-3); padding: 6px 0; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 12px; }
.stat-card {
  background: var(--c-card); border-radius: var(--radius); padding: 14px;
  text-align: left; box-shadow: var(--shadow); transition: .15s;
}
.stat-card:active { transform: scale(.97); }
.stat-num { font-size: 24px; font-weight: 700; letter-spacing: -.6px; color: var(--c-primary); }
.stat-label { font-size: 12.5px; color: var(--c-text-2); margin-top: 3px; font-weight: 500; }
.stat-sub { font-size: 11px; color: var(--c-text-3); margin-top: 1px; }
/* 概览页快捷统计：固定 2×2 四宫格（手机与电脑端都是 2 列） */
.dash-stat { grid-template-columns: repeat(2, 1fr); }

/* ---------------- 行 / 列表 ---------------- */
.list-wrap { display: flex; flex-direction: column; gap: 9px; }
.row-item {
  background: var(--c-card); border-radius: var(--radius); padding: 13px 14px;
  display: flex; align-items: center; gap: 11px; box-shadow: var(--shadow);
  transition: .15s; position: relative;
}
.row-item:active { transform: scale(.985); }
.row-item.is-done { opacity: .5; }
.row-item.is-done .row-title { text-decoration: line-through; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14.5px; font-weight: 500; word-break: break-word; }
.row-sub { font-size: 11.5px; color: var(--c-text-3); margin-top: 2px; }
.row-del {
  width: 26px; height: 26px; border-radius: 8px; font-size: 12px;
  color: var(--c-text-3); flex-shrink: 0; opacity: .55;
}
.row-del:active { background: var(--c-row-del-active); color: var(--c-danger); opacity: 1; }

.chk {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  border: 2px solid var(--c-border); background: transparent; transition: .15s;
}
.chk.on { background: var(--c-primary); border-color: var(--c-primary); position: relative; }
.chk.on::after {
  content: '✓'; color: #fff; font-size: 13px; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}

.prio {
  font-size: 10.5px; padding: 3px 8px; border-radius: 6px; font-weight: 600; flex-shrink: 0;
}
.p-high { background: var(--c-high-bg); color: var(--c-high-fg); }
.p-mid { background: var(--c-mid-bg); color: var(--c-mid-fg); }
.p-low { background: var(--c-low-bg); color: var(--c-low-fg); }

.sec-divider { font-size: 12px; color: var(--c-text-3); padding: 8px 4px 2px; font-weight: 500; }

.amount { font-size: 15px; font-weight: 700; flex-shrink: 0; }
.amount.income { color: var(--c-income); }
.amount.expense { color: var(--c-expense); }
.progress-pill {
  font-size: 12px; font-weight: 700; color: var(--c-primary); flex-shrink: 0;
  background: var(--c-primary-soft); padding: 4px 9px; border-radius: 7px;
}

/* ---------------- 空状态 ---------------- */
.empty-box { text-align: center; padding: 60px 20px; }
.empty-ico {
  width: 70px; height: 70px; margin: 0 auto 16px; border-radius: 22px;
  background: var(--c-card); display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--c-primary); box-shadow: var(--shadow);
}
.empty-box h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 5px; }
.empty-box p { font-size: 13px; color: var(--c-text-3); line-height: 1.6; max-width: 24em; margin: 0 auto; }
/* 空状态直达按钮：不用去右下角找 + */
.empty-box .empty-cta { margin-top: 18px; padding: 11px 22px; font-size: 14px; border-radius: 100px; }

/* ---------------- 更多分区 ---------------- */
/* （原「更多分区」样式已随该页面一起删除，入口改为左上角 ☰ 抽屉） */

/* ---------------- 看板 ---------------- */
.board-wrap {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.board-col { min-width: 74vw; max-width: 300px; scroll-snap-align: start; flex-shrink: 0; }
.board-col-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; padding: 0 4px 9px;
}
.board-col-head b {
  font-size: 11px; background: var(--c-card); color: var(--c-text-2);
  padding: 1px 7px; border-radius: 100px; font-weight: 600;
}
.kanban-card {
  background: var(--c-card); border-radius: var(--radius-sm); padding: 12px;
  margin-bottom: 9px; box-shadow: var(--shadow); transition: .15s;
}
.kanban-card:active { transform: scale(.98); }
.kc-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.kc-del { margin: -2px -4px 0 0; }
.kc-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--c-text-3); }
.kc-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.kc-actions button {
  font-size: 10.5px; padding: 3px 8px; border-radius: 6px;
  background: var(--c-bg); color: var(--c-text-2); font-weight: 500;
}
.kc-actions button:active { background: var(--c-primary-soft); color: var(--c-primary); }
.kanban-add {
  width: 100%; padding: 10px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--c-border); color: var(--c-text-3); font-size: 13px;
}

/* ---------------- 记账 ---------------- */
.ledger-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--c-card); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.ls-item { padding: 14px 8px; text-align: center; }
.ls-item span { display: block; font-size: 11px; color: var(--c-text-3); margin-bottom: 5px; }
.ls-item b { font-size: 15px; font-weight: 700; letter-spacing: -.3px; }
.ls-item b.income { color: var(--c-income); }
.ls-item b.expense { color: var(--c-expense); }
/* 记账页四列汇总（今日支出 / 本月收入 / 本月支出 / 结余）；窄屏收紧内边距避免拥挤 */
.ledger-4 { grid-template-columns: repeat(4, 1fr); }
.ledger-4 .ls-item { padding: 14px 4px; }
.ledger-4 .ls-item span { font-size: 10.5px; }
.ledger-4 .ls-item b { font-size: 13.5px; }

/* 本月分类支出 Top4：一排四格，分类名 + 金额 + 占比 */
.ledger-cats {
  background: var(--c-card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 12px; padding: 13px 14px 14px;
}
.lc-head {
  width: 100%; box-sizing: border-box; text-align: left; cursor: pointer;
  background: transparent; border: none; padding: 2px 0;
  font-size: 12px; color: var(--c-text-3); font-weight: 500;
  margin-bottom: 10px; display: flex; align-items: baseline; gap: 6px;
  font-family: inherit;
}
.lc-head:active { opacity: .65; }
.lc-head i { font-style: normal; font-size: 10.5px; color: var(--c-primary); opacity: .8; }
.lc-more { margin-left: auto; font-size: 11px; color: var(--c-primary); font-weight: 600; white-space: nowrap; }
.lc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lc-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--c-primary-soft); border-radius: 10px; padding: 9px 4px;
  min-width: 0;
}
.lc-name {
  font-size: 11px; color: var(--c-text-2); font-weight: 500;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lc-amt { font-size: 14px; font-weight: 700; color: var(--c-expense); letter-spacing: -.3px; }
.lc-pct { font-size: 10px; color: var(--c-text-3); }

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,17,23,.46);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px; background: var(--c-card);
  border-radius: 22px 22px 0 0; max-height: 88dvh;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.32,.72,0,1);
  padding-bottom: var(--safe-bottom);
}
.sheet.show { transform: translateY(0); }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: var(--c-border); margin: 9px auto 2px; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px 12px; border-bottom: 1px solid var(--c-border);
}
.sheet-head h3 { font-size: 16px; font-weight: 700; }
.close-btn {
  width: 30px; height: 30px; border-radius: 50%; background: var(--c-bg);
  color: var(--c-text-2); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.sheet-body { padding: 16px 18px 24px; overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }

/* ---------------- 表单 ---------------- */
.form { display: flex; flex-direction: column; gap: 13px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--c-text-2); }
.fld > span i { color: var(--c-danger); font-style: normal; }
.fld input, .fld textarea, .fld select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--c-border); background: var(--c-bg); color: var(--c-text);
  outline: none; transition: .15s; font-size: 15px;
}
.fld textarea { resize: vertical; line-height: 1.55; }
.fld input:focus, .fld textarea:focus, .fld select:focus {
  border-color: var(--c-primary); background: var(--c-card);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.fld input.err { border-color: var(--c-danger); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
/* 弹层内表单操作条吸底：小屏表单超高时「保存」按钮始终可见可点 */
.sheet-body .form-actions {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--c-card);
  padding: 10px 0 6px; margin: 10px -2px -6px;
  border-top: 1px solid var(--c-border);
}
.btn {
  flex: 1; padding: 12px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; transition: .15s; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--c-primary); color: #fff; }
.btn.ghost { background: var(--c-bg); color: var(--c-text-2); }
.btn.danger { background: var(--c-danger-bg); color: var(--c-danger); }

/* 详情 */
.detail { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.d-row { display: flex; flex-direction: column; gap: 4px; }
.d-label { font-size: 12px; color: var(--c-text-3); font-weight: 600; }
.d-val { font-size: 15px; line-height: 1.55; word-break: break-word; }

/* 设置 */
.settings { display: flex; flex-direction: column; gap: 18px; }
.set-group { padding-top: 4px; border-top: 1px solid var(--c-border); }
.set-group:first-child { border-top: none; padding-top: 0; }
.set-group h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.set-group .hint { font-size: 12px; color: var(--c-text-3); line-height: 1.6; }
.set-group .fld { margin-top: 9px; }

/* 云同步状态面板：两列对齐的小表格，一眼看清「数据在不在云上」 */
.sync-panel { margin-top: 9px; border-radius: 12px; background: var(--c-bg-2, #f6f1ea); padding: 4px 12px; }
.sync-row { display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; font-size: 12.5px; color: var(--c-text-2); }
.sync-row + .sync-row { border-top: 1px solid var(--c-border); }
.sync-row > span:last-child { font-weight: 600; color: var(--c-text); font-variant-numeric: tabular-nums; }
.sync-row .ok-text { color: #2f8f5b; }
.sync-row .warn-text { color: #c07a1f; }
.tag-soon {
  font-size: 10px; background: #f3e8d3; color: #a9762f;
  padding: 2px 7px; border-radius: 5px; font-weight: 600;
}
.hint-list { font-size: 12.5px; color: var(--c-text-2); padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.settings .fld > span { font-size: 12.5px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 80px);
  transform: translateX(-50%); z-index: 200;
  background: rgba(61,50,41,.92); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 100px; white-space: nowrap;
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------------- 桌面端 ---------------- */
@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  /* 概览页快捷统计在桌面端仍保持 2×2，不跟随上面的四列规则 */
  .dash-stat { grid-template-columns: repeat(2, 1fr); }
  .board-col { min-width: 280px; }
  #viewRoot { padding-bottom: 100px; }
}
@media (min-width: 1024px) {
  #viewRoot { max-width: 1000px; }
  .board-col { min-width: 300px; flex: 1; }
}

/* ---------- 食堂订单卡（接收端） ---------- */
.order-card { background: var(--c-card); border-radius: var(--radius); padding: 14px; margin-bottom: 11px; box-shadow: var(--shadow); border-left: 4px solid var(--c-primary); }
.order-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.order-time { font-size: 12px; color: var(--c-text-3); }
.status-badge { font-size: 11.5px; padding: 3px 9px; border-radius: 100px; font-weight: 600; }
.status-待接单 { background: var(--c-st-pending-bg); color: var(--c-st-pending-fg); }
.status-已接单 { background: var(--c-st-accept-bg); color: var(--c-st-accept-fg); }
.status-已完成 { background: var(--c-st-done-bg); color: var(--c-st-done-fg); }
.status-已取消 { background: var(--c-st-cancel-bg); color: var(--c-st-cancel-fg); }
.order-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.oi-row { display: flex; justify-content: space-between; font-size: 13.5px; }
.oi-name { font-weight: 500; }
.oi-sub { font-size: 11px; color: var(--c-text-3); margin-left: 6px; }
.order-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--c-border); padding-top: 9px; }
.order-total { font-size: 16px; font-weight: 700; color: var(--c-primary); }
.order-actions { display: flex; gap: 8px; }
.order-actions button { font-size: 12px; padding: 6px 13px; border-radius: 100px; font-weight: 600; }
.btn-del-order { background: #fdecec; color: var(--c-danger); }
.btn-del-order:active { background: #f6d6d6; }
.btn-accept { background: var(--c-primary); color: #fff; }
.btn-done { background: var(--c-primary-soft); color: var(--c-primary); }
.btn-cancel { background: #f6e3dc; color: var(--c-danger); }
.btn-detail { background: var(--c-bg); color: var(--c-text-2); border: 1px solid var(--c-border); }

/* 订单详情 */
.od-wrap { display: flex; flex-direction: column; gap: 12px; }
.od-meta { background: var(--c-bg); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.od-line { display: flex; gap: 10px; font-size: 13px; line-height: 1.55; align-items: flex-start; }
.od-line > span { flex: 0 0 60px; color: var(--c-text-3); font-size: 12px; padding-top: 1px; }
.od-line > b { flex: 1; min-width: 0; font-weight: 600; word-break: break-word; }
.od-line > b i.muted { color: var(--c-text-3); font-style: normal; font-weight: 400; }
.od-line .od-cost { color: var(--c-primary); font-weight: 700; }
.od-dish { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 7px; }
.od-dish-head { display: flex; align-items: center; gap: 8px; padding-bottom: 7px; border-bottom: 1px dashed var(--c-border); }
.od-dish-name { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; }
.od-spice { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; flex: none; }
.od-dish-qty { font-size: 13px; font-weight: 700; color: var(--c-text-2); flex: none; }
.od-method > b { white-space: pre-wrap; }
.od-img { margin-top: 4px; border-radius: 10px; overflow: hidden; }
.od-img img { width: 100%; max-height: 220px; object-fit: cover; }
.od-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.od-actions button { flex: 1 1 auto; font-size: 13px; padding: 10px 14px; border-radius: 100px; font-weight: 600; }
.od-actions .btn.ghost { background: var(--c-bg); color: var(--c-text-2); border: 1px solid var(--c-border); }

/* ==========================================================================
   小小怪健身房
   ========================================================================== */
.gym-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px; -webkit-overflow-scrolling: touch; }
.gym-tabs::-webkit-scrollbar { display: none; }
.gym-tab { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: 100px;
  background: var(--c-card); color: var(--c-text-2); font-size: 13px; font-weight: 500; border: 1px solid var(--c-border); white-space: nowrap; }
.gym-tab.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.gt-ico { font-size: 14px; }

.gym-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.gym-hero-cell { background: linear-gradient(135deg, var(--c-grad-a), var(--c-grad-b)); color: #fff;
  border-radius: var(--radius); padding: 14px 10px; text-align: center; box-shadow: var(--shadow); }
.gh-val { font-size: 21px; font-weight: 700; line-height: 1.2; }
.gh-unit { font-size: 11px; font-weight: 400; margin-left: 2px; opacity: .85; }
.gh-label { font-size: 11.5px; opacity: .9; margin-top: 4px; }
.gh-sub { font-size: 10.5px; opacity: .72; margin-top: 2px; }

.gym-note { font-size: 12px; color: var(--c-text-2); background: var(--c-primary-soft);
  padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; line-height: 1.6; }

.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kv-item { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  background: var(--c-bg); border-radius: var(--radius-sm); padding: 9px 11px; }
.kv-k { font-size: 12px; color: var(--c-text-3); flex: 0 0 auto; }
.kv-v { font-size: 13.5px; font-weight: 600; color: var(--c-text); text-align: right; word-break: break-all; }

.macro-row { display: flex; flex-direction: column; gap: 10px; }
.macro-item .mi-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; color: var(--c-text-2); }
.macro-item .mi-head b { color: var(--c-text); font-size: 12.5px; }
.mi-bar { height: 7px; border-radius: 100px; background: var(--c-border); overflow: hidden; }
.mi-bar i { display: block; height: 100%; border-radius: 100px; transition: width .35s; }

.gym-balance { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; }
.bal-ok { background: #eef4ec; color: #5e7d54; }
.bal-over { background: #fbeee8; color: #b5623c; }
.bal-under { background: #eaf1f6; color: #4d7492; }
html[data-theme="dark"] .bal-ok { background: #232d1f; }
html[data-theme="dark"] .bal-over { background: #32241c; }
html[data-theme="dark"] .bal-under { background: #1e2a33; }

.target-macro { font-size: 12.5px; color: var(--c-text-2); margin-top: 10px; }

.gym-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 130px; padding: 6px 0; }
.gb-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.gb-val { font-size: 10.5px; color: var(--c-text-3); height: 15px; }
.gb-track { flex: 1; width: 100%; max-width: 30px; background: var(--c-border); border-radius: 8px;
  display: flex; align-items: flex-end; overflow: hidden; }
.gb-track i { display: block; width: 100%; background: linear-gradient(180deg, var(--c-grad-a), var(--c-grad-b));
  border-radius: 8px; transition: height .35s; }
.gb-day { font-size: 11px; color: var(--c-text-3); margin-top: 6px; }
.gb-col.today .gb-day { color: var(--c-primary); font-weight: 700; }
.gb-col.today .gb-track { box-shadow: 0 0 0 2px var(--c-primary-soft); }

.gym-log-ico { font-size: 20px; flex: 0 0 auto; width: 30px; text-align: center; }
.gym-burn { font-size: 13px; font-weight: 700; color: var(--c-primary); flex: 0 0 auto; margin-right: 6px; }

.fld-row { display: flex; gap: 10px; }
.fld-row .fld { flex: 1; min-width: 0; }

/* ==========================================================================
   修复工具
   ========================================================================== */
.rep-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.rep-actions .btn { flex: 1; min-width: 130px; }
.rep-progress { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.rep-step { font-size: 12.5px; padding: 8px 11px; border-radius: var(--radius-sm); background: var(--c-bg); line-height: 1.5; }
.rep-step.ok { color: #5e7d54; background: #eef4ec; }
.rep-step.warn { color: #a0762e; background: #fdf4e3; }
.rep-step.fail { color: var(--c-danger); background: #fbeeea; }
html[data-theme="dark"] .rep-step.ok { background: #232d1f; }
html[data-theme="dark"] .rep-step.warn { background: #2f2718; }
html[data-theme="dark"] .rep-step.fail { background: #32241c; }

.rep-summary { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 13px; }
.rep-summary.all-ok { background: #eef4ec; color: #4f6b46; }
.rep-summary.has-fail { background: #fbeeea; color: #b5623c; }
.rep-summary span { font-size: 11.5px; opacity: .8; }
.rep-list { display: flex; flex-direction: column; gap: 6px; }
.rep-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--c-bg); flex-wrap: wrap; }
.rr-ico { flex: 0 0 auto; }
.rr-name { flex: 0 0 auto; font-weight: 600; }
.rr-detail { flex: 1; color: var(--c-text-2); min-width: 120px; }
.rep-row.fail .rr-detail { color: var(--c-danger); }

.rep-fix-list { display: flex; flex-direction: column; gap: 10px; }
.rep-fix { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; background: var(--c-bg); border-radius: var(--radius-sm); }
.rf-main { flex: 1; min-width: 0; }
.rf-title { font-size: 13.5px; font-weight: 600; }
.rf-desc { font-size: 11.5px; color: var(--c-text-3); margin-top: 2px; line-height: 1.45; }
.btn.small { padding: 7px 14px; font-size: 12.5px; flex: 0 0 auto; }

.gym-stat .stat-num { font-size: 22px; }

@media (max-width: 390px) {
  .gym-hero { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .gh-val { font-size: 18px; }
  .kv-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   版本检测与更新
   ========================================================================== */
.ver-box { display: flex; flex-direction: column; gap: 8px; }
.ver-loading { font-size: 13px; color: var(--c-text-3); padding: 12px; text-align: center; background: var(--c-bg); border-radius: var(--radius-sm); }
.ver-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ver-item { display: flex; flex-direction: column; gap: 3px; background: var(--c-bg); border-radius: var(--radius-sm); padding: 9px 11px; }
.vi-k { font-size: 11.5px; color: var(--c-text-3); }
.vi-v { font-size: 14px; font-weight: 700; color: var(--c-text); }

.ver-status { padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.55; }
.ver-status.is-latest { background: #eef4ec; color: #4f6b46; }
.ver-status.need-update { background: #fdf1e4; color: #b5722f; }
.ver-status span { font-size: 12px; opacity: .85; }
.ver-time { font-size: 11px; opacity: .7; margin-top: 4px; }
html[data-theme="dark"] .ver-status.is-latest { background: #232d1f; }
html[data-theme="dark"] .ver-status.need-update { background: #32271a; }

.ver-ok { font-size: 13px; color: #4f6b46; padding: 12px; text-align: center; background: #eef4ec; border-radius: var(--radius-sm); }
.ver-fail { font-size: 13px; color: var(--c-danger); padding: 12px; text-align: center; background: #fbeeea; border-radius: var(--radius-sm); line-height: 1.6; }
.ver-fail span { font-size: 11.5px; opacity: .8; }

@media (max-width: 360px) {
  .ver-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   设备能力检测
   ========================================================================== */
.cap-platform { display: flex; flex-direction: column; gap: 6px; background: var(--c-bg); border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 12px; }
.cp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cp-k { font-size: 12px; color: var(--c-text-3); }
.cp-v { font-size: 13.5px; font-weight: 600; color: var(--c-text); text-align: right; }

.cap-group { margin-bottom: 14px; }
.cap-group-head { font-size: 12.5px; font-weight: 600; color: var(--c-text-2); margin-bottom: 7px; padding-left: 2px; }
.cap-group-head b { color: var(--c-primary); font-size: 12px; }

.cap-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--c-bg); }
.cap-item.no { opacity: .78; }
.cap-ico { font-size: 15px; flex: 0 0 auto; }
.cap-main { flex: 1; min-width: 0; }
.cap-name { font-size: 13px; font-weight: 600; color: var(--c-text); }
.cap-note { font-size: 11.5px; color: var(--c-text-3); margin-top: 2px; line-height: 1.45; }
.cap-tag { font-size: 11px; padding: 3px 9px; border-radius: 100px; font-weight: 600; flex: 0 0 auto; }
.cap-tag.ok { background: #e7efe4; color: #5e7d54; }
.cap-tag.no { background: #efe9df; color: #9c8f80; }
html[data-theme="dark"] .cap-tag.ok { background: #232d1f; }
html[data-theme="dark"] .cap-tag.no { background: #2e251b; }

/* ==========================================================================
   触摸热区增强（第二批）
   小图标按钮视觉不变，但用透明伪元素把可点范围撑到 44×44（Apple/Google 建议的最小热区），
   解决「点删除点不中 / 手滑误触」的问题。
   ========================================================================== */
.row-del, .chk, .close-btn, .tab-edit .tab-remove { position: relative; }
.row-del::after, .chk::after, .close-btn::after, .tab-edit .tab-remove::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}

/* ==========================================================================
   侧边滑动返回（跟手动画）
   从屏幕左边缘往右滑时，整个 #app 跟随手指平移，
   左侧露出一条渐变阴影，模拟「把当前页掀开、下层页面被拉出」的原生手感。
   ========================================================================== */
#app { will-change: transform; }
/* 跟手期间禁用子元素的过渡，避免与位移动画打架产生错位抖动 */
#app.swipe-backing, #app.swipe-backing * { transition: none !important; }
/* 左侧阴影：位移越大越明显（由 JS 写入 --swipe-x） */
#app.swipe-armed::before {
  content: ''; position: fixed; left: 0; top: 0; bottom: 0; width: 2px; z-index: 60;
  background: transparent; pointer-events: none;
}
#app.swipe-backing::before {
  content: ''; position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; pointer-events: none;
  width: 16px;
  background: linear-gradient(to right, rgba(0,0,0,.20), rgba(0,0,0,0));
  opacity: var(--swipe-op, 1);
  transition: none;
}
/* 跟手期间禁止选中文字 / 触发长按菜单，避免滑动变成拖选 */
#app.swipe-armed { -webkit-user-select: none; user-select: none; }

/* ---------------- 记账：月份切换条（按月查看历史） ---------------- */
.ledger-monthnav { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 12px; }
.ledger-monthnav .lm-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--c-line, #e7e0d6); background: var(--c-card, #fff);
  font-size: 20px; line-height: 1; color: var(--c-text-2, #8a7a6b); cursor: pointer;
}
.ledger-monthnav .lm-btn:active { transform: scale(.92); }
.ledger-monthnav .lm-label { font-weight: 600; min-width: 132px; text-align: center; color: var(--c-text-1, #4a3f33); }

/* ---------------- 外观：主题分段选择 ---------------- */
.theme-seg {
  display: flex; gap: 6px; margin-top: 10px;
  background: var(--c-primary-soft); padding: 4px; border-radius: 12px;
}
.theme-seg button {
  flex: 1; padding: 9px 6px; border-radius: 9px; border: none;
  background: transparent; color: var(--c-text-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.theme-seg button.on {
  background: var(--c-card); color: var(--c-primary);
  box-shadow: 0 1px 4px rgba(var(--c-shadow-rgb), .12);
}

/* ---------------- 模块切换转场（仅切换时触发） ---------------- */
@keyframes xxgEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.module-enter { animation: xxgEnter var(--dur, 180ms) var(--ease, ease-out); }
@media (prefers-reduced-motion: reduce) {
  .module-enter { animation: none; }
}

/* ---------------- 全局搜索（1.2） ---------------- */
.search-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm, 12px);
  background: var(--c-bg); color: var(--c-text-1); font-size: 15px; outline: none;
  transition: border-color .15s var(--ease);
}
.search-input:focus { border-color: var(--c-primary); }
.search-results { margin-top: 12px; max-height: 56vh; overflow-y: auto; }
.sr-group { margin-bottom: 12px; }
.sr-group-head {
  font-size: 12px; font-weight: 700; color: var(--c-text-3);
  padding: 4px 2px 6px; letter-spacing: .5px;
}
.sr-item {
  padding: 10px 12px; border-radius: var(--radius-sm, 12px);
  background: var(--c-bg); margin-bottom: 6px; cursor: pointer;
  transition: background .15s var(--ease);
}
.sr-item:active { background: var(--c-card-2, var(--c-border)); }
.sr-item .row-title { font-size: 14px; font-weight: 600; color: var(--c-text-1); }
.sr-item .row-sub { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }

/* ---------------- 今日聚合卡（3.3） ---------------- */
.today-card { padding: 14px 14px 6px; }
.today-card .tc-date { font-size: 13px; font-weight: 700; color: var(--c-text-2); margin-bottom: 6px; }
.tc-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 2px; border: none; border-bottom: 1px solid var(--c-border);
  background: transparent; cursor: pointer; text-align: left;
  font-size: 13.5px; color: var(--c-text-1); box-sizing: border-box;
}
.tc-row:last-child { border-bottom: none; }
.tc-row:active { opacity: .7; }
.tc-ico { width: 20px; text-align: center; flex: 0 0 auto; }
.tc-txt { color: var(--c-text-2); flex: 0 0 auto; }
.tc-val { margin-left: auto; font-weight: 600; color: var(--c-text-1); }
.tc-warn { font-style: normal; color: var(--c-danger, #d0564b); font-weight: 700; }

/* ---------------- 记账筛选栏（2.1） ---------------- */
.ledger-filter {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.lf-kw {
  flex: 1; min-width: 0; padding: 8px 12px;
  border: 1.5px solid var(--c-border); border-radius: 100px;
  background: var(--c-card); color: var(--c-text-1); font-size: 13px; outline: none;
  transition: border-color .15s var(--ease);
}
.lf-kw:focus { border-color: var(--c-primary); }
.lf-kinds { display: flex; gap: 4px; flex: 0 0 auto; }
.lf-kind {
  padding: 7px 11px; border-radius: 100px; border: 1.5px solid var(--c-border);
  background: var(--c-card); color: var(--c-text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .15s var(--ease);
}
.lf-kind.on { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary, #fff); }

/* ---------------- 常记项目 chips（2.1） ---------------- */
.freq-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 2px 0 10px; border-bottom: 1px dashed var(--c-border); margin-bottom: 12px;
}
.fc-label { font-size: 12px; color: var(--c-text-3); font-weight: 600; }
.fc-chip {
  padding: 6px 12px; border-radius: 100px; border: 1.5px solid var(--c-border);
  background: var(--c-bg); color: var(--c-text-1); font-size: 12.5px; cursor: pointer;
  transition: all .15s var(--ease);
}
.fc-chip:active { transform: scale(.95); border-color: var(--c-primary); color: var(--c-primary); }

/* ---------------- 待办截止徽标（2.2） ---------------- */
.due-badge {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  padding: 3px 8px; border-radius: 100px; font-size: 10.5px; font-weight: 700;
  white-space: nowrap;
}
.due-badge.due-overdue { background: var(--c-danger-bg, #fdecea); color: var(--c-danger, #d0564b); }
.due-badge.due-today { background: rgba(var(--c-shadow-rgb, 169, 113, 75), .12); color: var(--c-primary); }

/* ---------------- 全部分类统计（独立整页） ---------------- */
.stats-kind { display: flex; gap: 6px; margin-bottom: 12px; }
.sk-btn {
  flex: 1; padding: 9px 0; border-radius: 100px;
  border: 1.5px solid var(--c-border); background: var(--c-card); color: var(--c-text-2);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .15s var(--ease);
}
.sk-btn.on { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary, #fff); }

.stats-total { text-align: center; padding: 16px 14px 14px; margin-bottom: 12px; }
.stats-total .st-label { font-size: 12px; color: var(--c-text-3); }
.stats-total .st-num { font-size: 30px; font-weight: 800; letter-spacing: -.8px; margin: 4px 0 2px; }
.stats-total .st-num.expense { color: var(--c-expense); }
.stats-total .st-num.income { color: var(--c-income); }
.stats-total .st-sub { font-size: 11.5px; color: var(--c-text-3); }
.stats-diff {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--c-border);
  font-size: 12px; color: var(--c-text-2); display: flex; flex-direction: column; gap: 3px;
}
/* 沿用主台配色语义：红 = 数值上升（多花/多赚），绿 = 下降 */
.stats-diff.up { color: var(--c-income); font-weight: 600; }
.stats-diff.down { color: var(--c-expense); font-weight: 600; }
.stats-diff .sd-prev { font-size: 11px; color: var(--c-text-3); font-weight: 400; }

.stats-list { padding: 6px 14px 8px; }
.sl-row { padding: 11px 0; border-bottom: 1px dashed var(--c-border); }
.sl-row:last-child { border-bottom: none; }
.sl-top { display: flex; align-items: baseline; gap: 8px; }
.sl-rank {
  flex: 0 0 auto; width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 6px; background: var(--c-primary-soft); color: var(--c-primary);
  font-size: 10.5px; font-weight: 700;
}
.sl-name {
  font-size: 13.5px; font-weight: 600; color: var(--c-text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.sl-amt { margin-left: auto; flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--c-text-1); }
.sl-bar {
  height: 7px; border-radius: 100px; background: var(--c-primary-soft);
  margin: 7px 0 6px; overflow: hidden;
}
.sl-bar-in {
  display: block; height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-2, var(--c-primary)));
  transition: width .35s var(--ease);
}
.sl-bottom { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--c-text-3); }
.sl-pct { color: var(--c-text-2); }
.sl-cat-up { margin-left: auto; color: var(--c-income); font-weight: 600; }
.sl-cat-down { margin-left: auto; color: var(--c-expense); font-weight: 600; }
.sl-cat-flat { margin-left: auto; }
.sl-cat-new { margin-left: auto; color: var(--c-primary); font-weight: 600; }

/* ---------------- 健身房：体重趋势 ---------------- */
.wt-range { display: flex; gap: 4px; }
.wt-r {
  padding: 4px 10px; border-radius: 100px; font-size: 11.5px;
  background: var(--c-bg); color: var(--c-text-3); border: 1px solid transparent;
}
.wt-r.active { background: var(--c-primary); color: #fff; font-weight: 600; }

.wt-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 4px; }
.wt-now { font-size: 26px; font-weight: 700; color: var(--c-text-1); line-height: 1; }
.wt-now span { font-size: 12px; font-weight: 500; color: var(--c-text-3); margin-left: 2px; }
.wt-delta { font-size: 12.5px; font-weight: 600; display: flex; align-items: baseline; gap: 6px; }
.wt-delta.up { color: var(--c-expense); }
.wt-delta.down { color: var(--c-income); }
.wt-delta.flat { color: var(--c-text-3); }
.wt-delta-sub { font-size: 11px; font-weight: 400; color: var(--c-text-3); }

.wt-svg { display: block; width: 100%; height: 108px; margin: 4px 0 0; overflow: visible; }
.wt-dot { fill: var(--c-card); stroke: var(--c-primary); stroke-width: 1.6; }
.wt-dot-end { fill: var(--c-primary); stroke: var(--c-card); stroke-width: 2; }
.wt-axis {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 10.5px; color: var(--c-text-3); margin-top: 4px;
}
.wt-axis span:nth-child(2) { flex: 1; text-align: center; }

.wt-empty { text-align: center; padding: 10px 0 4px; }
.wt-empty-ico { font-size: 30px; line-height: 1; margin-bottom: 8px; opacity: .9; }
.wt-empty-t { font-size: 13.5px; font-weight: 600; color: var(--c-text-1); margin: 0 0 6px; }
.wt-empty-d {
  font-size: 12px; color: var(--c-text-3); line-height: 1.65;
  max-width: 22em; margin: 0 auto 14px;
}
.wt-empty-btn { padding: 10px 22px; font-size: 13px; border-radius: 100px; }

/* ---------------- 健身房：常用食物快选 ---------------- */
.food-pick {
  background: var(--c-bg); border-radius: var(--radius-sm);
  padding: 10px 11px 11px; margin-bottom: 12px;
}
.fp-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.fp-head > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--c-text-1); }
.fp-hint { font-size: 11px; color: var(--c-text-3); margin-left: auto; }
.food-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.food-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 11px; border-radius: 100px; font-size: 12.5px;
  background: var(--c-card); color: var(--c-text-1);
  border: 1px solid var(--c-border); transition: transform .12s var(--ease);
}
.food-chip:active { transform: scale(.94); }
.fc-name { font-weight: 500; }
.fc-cal { font-size: 10.5px; color: var(--c-text-3); }

.food-portion {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding-top: 9px; border-top: 1px dashed var(--c-border);
  font-size: 12px; color: var(--c-text-2);
}
.fpo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpo-ctrl { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.fpo-ctrl b { font-size: 13px; color: var(--c-text-1); min-width: 20px; text-align: center; }
.fpo-btn {
  width: 26px; height: 26px; border-radius: 50%; font-size: 15px; line-height: 1;
  background: var(--c-card); color: var(--c-primary); border: 1px solid var(--c-border);
  display: inline-flex; align-items: center; justify-content: center;
}
.fpo-btn:active { background: var(--c-primary-soft); }
.fpo-clear { font-size: 11.5px; color: var(--c-text-3); padding: 4px 2px; flex: 0 0 auto; }

/* ---------------- 修修怪：主动浮出的提示条 ---------------- */
.repair-tip {
  position: fixed; left: 12px; right: 12px; top: -80px;
  z-index: 9998;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-danger, #d97757);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(var(--c-shadow-rgb, 0,0,0), .16);
  font-size: 12.5px;
  transition: top .28s var(--ease);
}
.repair-tip.in { top: calc(env(safe-area-inset-top, 0px) + 8px); }
.rt-ico { font-size: 15px; flex: 0 0 auto; }
.rt-txt {
  flex: 1; min-width: 0; color: var(--c-text-1); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rt-go {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--c-primary);
  padding: 4px 2px; background: none;
}
.rt-close {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; color: var(--c-text-3); background: var(--c-bg);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------------- 全部分区抽屉（左上角 ☰） ----------------
   替代原底部「更多」：分组展示所有分区，底部固定 模块管理/修修怪/设置中心 */
.tb-brand-hidden { display: none; }
.drawer-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(40, 30, 20, .42);
  opacity: 0; transition: opacity .22s ease;
}
.drawer-mask.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 901;
  width: 272px; max-width: 84vw;
  background: var(--c-bg);
  border-radius: 0 20px 20px 0;
  box-shadow: 8px 0 30px rgba(50, 35, 20, .22);
  transform: translateX(-103%);
  transition: transform .24s ease;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top, 0px) + 14px) 12px 12px;
}
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 9px; padding: 2px 6px 12px; flex-shrink: 0; }
.drawer-logo {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--c-grad-a), var(--c-grad-b));
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.drawer-title { font-size: 15.5px; font-weight: 800; color: var(--c-text); }
.drawer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dg-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 6px 5px; font-size: 13.5px; font-weight: 700; color: var(--c-text);
}
.dg-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.dg-arrow { margin-left: auto; font-size: 10px; color: var(--c-text-3); }
.di {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 8px 8px 14px; border: 0; background: none; text-align: left;
  border-radius: 10px; font-size: 13.5px; color: var(--c-text); cursor: pointer;
  transition: .12s;
}
.di:active { transform: scale(.98); }
.di .di-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--c-primary-soft); color: var(--c-primary); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.di .di-hint { margin-left: auto; font-size: 10.5px; color: var(--c-text-3); }
.di.cur { background: var(--c-primary); color: #fff; font-weight: 700; }
.di.cur .di-ico { background: rgba(255,255,255,.2); color: #fff; border: 0; }
.di.cur .di-hint { color: rgba(255,255,255,.75); }
.drawer-foot { border-top: 1px dashed var(--c-border); padding-top: 8px; margin-top: 6px; flex-shrink: 0; }
