/* ============================================================
 * 健身搭子 (FitLog) — 视觉系统 v2.0
 * 设计语言：火焰橙 → 玫红 渐变能量 / 薄荷绿在线 / 通透深色
 * 说明：本文件为「纯视觉层」，不改动任何 DOM 结构与 JS 逻辑，
 *       仅覆盖既有 class，新增少量容器类（circle-filter / cp-meta 等）。
 * ============================================================ */

:root {
  /* —— 品牌能量色 —— */
  --brand: #ff5a3c;            /* 火焰橙（主识别色，保留） */
  --brand-2: #ff8a3c;          /* 琥珀（渐变辅色） */
  --brand-3: #ff3d6e;          /* 活力玫红（能量渐变/强调） */
  --brand-grad: linear-gradient(135deg, #ff6a3d 0%, #ff3d6e 100%);
  --brand-grad-soft: linear-gradient(135deg, #ff7a45 0%, #ff5a6e 100%);
  --brand-soft: rgba(255, 90, 60, .14);
  --brand-soft-2: rgba(255, 61, 110, .12);
  --brand-glow: rgba(255, 90, 60, .32);

  /* —— 在线 / 连续打卡 —— */
  --ok: #2bd9a0;
  --ok-soft: rgba(43, 217, 160, .14);
  --warn: #ffb020;
  --danger: #ff4d5e;
  --danger-soft: rgba(255, 77, 94, .12);

  /* —— 深色（默认）—— */
  --bg: #0a0c10;
  --bg-blur: rgba(12, 14, 19, .82);
  --bg-elev: #15181f;
  --card: #181c26;
  --card-2: #21262f;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);

  --tx: #f4f6fa;
  --tx-2: #98a1b0;
  --tx-3: #5e6675;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 18px;
  --r-xl: 26px;

  --sh-sm: 0 2px 10px rgba(0, 0, 0, .22);
  --sh: 0 10px 30px rgba(0, 0, 0, .34);
  --sh-lg: 0 18px 50px rgba(0, 0, 0, .45);
  --sh-brand: 0 8px 22px rgba(255, 90, 60, .34);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabh: 62px;
  --topbar-h: 70px;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

html[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-blur: rgba(243, 245, 249, .86);
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-2: #eef1f6;
  --line: rgba(16, 24, 40, .09);
  --line-strong: rgba(16, 24, 40, .16);
  --tx: #14181f;
  --tx-2: #5b6472;
  --tx-3: #8a93a3;
  --brand-soft: rgba(255, 90, 60, .10);
  --brand-soft-2: rgba(255, 61, 110, .08);
  --ok-soft: rgba(43, 217, 160, .14);
  --sh-sm: 0 2px 8px rgba(20, 30, 60, .08);
  --sh: 0 8px 24px rgba(20, 30, 60, .12);
  --sh-lg: 0 16px 40px rgba(20, 30, 60, .16);
  --sh-brand: 0 8px 20px rgba(255, 90, 60, .24);
}

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

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--tx);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body { transition: background .3s ease, color .3s ease; }

input, button, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand); text-decoration: none; }
::-webkit-scrollbar { width: 0; height: 0; }
/* 隐藏页面滚动条（保留滚动能力）：WebKit 已由上行覆盖，这里是 Firefox/标准写法 */
html, body { scrollbar-width: none; -ms-overflow-style: none; }

/* ---------------- 应用外壳 ---------------- */
#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100%;
  position: relative;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(255, 90, 60, .10), transparent 62%),
    var(--bg);
  overflow-x: hidden;
}

.screen { display: none; padding-bottom: calc(var(--tabh) + var(--safe-b) + 18px); }
.screen.active { display: block; animation: fadeUp .26s var(--ease); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------------- 顶栏（毛玻璃 + 能量描边） ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--safe-t) + 14px) 16px 12px;
  background: var(--bg-blur);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tb-left { display: flex; align-items: center; gap: 10px; }
.stats-title { display: flex; flex-direction: column; }
.topbar h1 {
  margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.5px;
}
.topbar .sub { font-size: 12.5px; color: var(--tx-3); margin-top: 2px; letter-spacing: .1px; }
/* 训练数据页顶部标题：左侧品牌色短下划线，作为页面分区标识，视觉更聚焦 */
#screen-stats .topbar { position: relative; }
#screen-stats .topbar::after {
  content: ''; position: absolute; left: 16px; bottom: -1px; width: 34px; height: 3px;
  border-radius: 3px; background: var(--brand-grad);
}

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 17px;
  transition: transform .12s ease, background .18s, border-color .18s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn:hover { border-color: var(--line-strong); }

/* ---------------- 通用容器 ---------------- */
.wrap { padding: 14px 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px;
  box-shadow: var(--sh-sm);
}
.card + .card { margin-top: 12px; }

/* v1.188：个人备注——防止超长无空格文本被 .card 的 overflow:hidden 横向裁切；折叠「展开全文」按钮 */
.day-note-text { overflow-wrap: anywhere; word-break: break-word; }
.day-note-more {
  margin-top: 8px; padding: 6px 14px; font-size: 13px; line-height: 1;
  color: var(--brand); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.day-note-more:hover { background: var(--brand-soft); border-color: var(--brand); }

.sec-title {
  font-size: 12px; font-weight: 800; letter-spacing: 1px;
  color: var(--tx-3); text-transform: uppercase;
  margin: 22px 0 11px;
  display: flex; align-items: center; gap: 7px;
}
.sec-title::before {
  content: ''; width: 4px; height: 13px; border-radius: 3px;
  background: var(--brand-grad);
}
.sec-title:first-child { margin-top: 4px; }

.muted { color: var(--tx-3); font-size: 13px; }
.empty { text-align: center; padding: 46px 20px; color: var(--tx-3); }
.empty .big { font-size: 42px; margin-bottom: 10px; opacity: .75; }
.empty p { margin: 6px 0; font-size: 14px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 18px; border-radius: var(--r-m);
  background: var(--card-2); color: var(--tx);
  font-weight: 700; font-size: 15px;
  border: 1px solid var(--line);
  transition: transform .12s ease, opacity .18s, box-shadow .18s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--brand-grad);
  color: #fff; border: none;
  box-shadow: 0 8px 22px rgba(255, 70, 70, .34);
}
.btn-primary:active { transform: scale(.97); box-shadow: 0 4px 14px rgba(255, 70, 70, .4); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255, 77, 94, .34); }
.btn-danger:active { background: var(--danger-soft); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 11px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
/* v1.119：AI 分析按钮禁用态（灰显但保留点击，用于点击后给出原因提示；不用 pointer-events:none 以免吞掉点击） */
.btn.ai-off { opacity: .45; cursor: default; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--tx-2); margin-bottom: 7px; letter-spacing: .2px;
}
.input, select.input, textarea.input {
  width: 100%; padding: 13px 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  color: var(--tx); outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
  -webkit-appearance: none; appearance: none;
}
.input:focus {
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input::placeholder { color: var(--tx-3); }
textarea.input { resize: none; min-height: 74px; line-height: 1.55; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235e6675' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 34px;
}
.form-err {
  background: var(--danger-soft);
  border: 1px solid rgba(255, 77, 94, .3);
  color: #ff8b96;
  padding: 11px 13px; border-radius: var(--r-m);
  font-size: 13.5px; margin-bottom: 14px; line-height: 1.5;
}
html[data-theme="light"] .form-err { color: #c0303f; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* 带单位切换的负重输入 */
.weight-box { display: flex; gap: 0; }
.weight-box .input { border-radius: var(--r-m) 0 0 var(--r-m); border-right: none; }
.unit-switch {
  display: flex; background: var(--card-2);
  border: 1px solid var(--line); border-left: none;
  border-radius: 0 var(--r-m) var(--r-m) 0;
  overflow: hidden;
}
.unit-switch button {
  padding: 0 13px; font-size: 13px; font-weight: 700;
  color: var(--tx-3); transition: all .18s;
}
.unit-switch button.on { background: var(--brand); color: #fff; }

/* RPE 选择器 */
.rpe-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.rpe-grid button {
  padding: 10px 0; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 700; color: var(--tx-2);
  transition: all .15s;
}
.rpe-grid button.on {
  background: var(--brand-grad); color: #fff; border-color: transparent;
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(255, 70, 70, .3);
}

/* 出生年月/部位选择 通用 chip 态 */
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--tx-2);
  transition: all .18s; white-space: nowrap;
}
.chip.on { background: var(--tx); color: var(--bg); border-color: var(--tx); }

/* ---------------- 登录页 ---------------- */
#screen-auth {
  display: none; min-height: 100vh; padding: 0 22px;
  flex-direction: column; justify-content: center;
}
#screen-auth.active { display: flex; }
.auth-logo { text-align: center; margin-bottom: 30px; animation: fadeUp .4s var(--ease); }
.auth-logo .mark {
  width: 76px; height: 76px; margin: 0 auto 16px;
  border-radius: 24px;
  background: var(--brand-grad);
  display: grid; place-items: center; font-size: 38px;
  box-shadow: 0 14px 36px rgba(255, 70, 70, .4);
}
.auth-logo h1 {
  margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.6px;
  background: linear-gradient(120deg, var(--tx), var(--brand));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-logo p { margin: 7px 0 0; color: var(--tx-3); font-size: 14px; }

.tabs-seg {
  display: flex; background: var(--card-2); padding: 4px;
  border-radius: var(--r-m); margin-bottom: 20px;
}
.tabs-seg button {
  flex: 1; padding: 10px 0; border-radius: 10px;
  font-size: 14.5px; font-weight: 700; color: var(--tx-3);
  transition: all .2s;
}
.tabs-seg button.on { background: var(--card); color: var(--tx); box-shadow: var(--sh-sm); }

.pwd-hint { font-size: 12px; margin-top: 6px; }
.pwd-hint.ok { color: var(--ok); }
.pwd-hint.bad { color: var(--danger); }

.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--tx-3); }

/* ---------------- 底部 Tab（毛玻璃 + 能量高亮） ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 40;
  display: none; grid-template-columns: repeat(4, 1fr);
  background: var(--bg-elev);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar.show { display: flex; }
.tabbar button {
  position: relative;
  flex: 1 1 0;
  height: var(--tabh);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--tx-3); font-size: 10.5px; font-weight: 700;
  transition: color .18s;
}
/* 隐藏的底部 Tab（搭子圈）：保留 DOM 与 section，待后续上线再移除 hidden-tab */
.tabbar button.hidden-tab { display: none; }
.tabbar button .ic { font-size: 20px; line-height: 1; transition: transform .18s; }
.tabbar button.on { color: var(--brand); }
.tabbar button.on .ic { transform: translateY(-2px); filter: drop-shadow(0 3px 6px var(--brand-glow)); }

/* 日历 tab 图标：小日历 + 当天数字 */
.cal-ic { position: relative; width: 22px; height: 22px; display: inline-block; font-size: 0; }
.cal-ic::before {
  content: ''; position: absolute; inset: 1px;
  border: 1.8px solid currentColor; border-radius: 5px;
  background: rgba(127, 127, 127, .12);
}
.tabbar button.on .cal-ic::before { background: rgba(255, 90, 60, .2); }
.cal-ic::after {
  content: ''; position: absolute; top: 1px; left: 4px; right: 4px; height: 6px;
  background: currentColor; border-radius: 3px 3px 0 0; opacity: .85;
}
.cal-ic .cal-d {
  position: absolute; top: 6px; left: 0; right: 0;
  text-align: center; font-size: 11px; font-weight: 800; line-height: 1;
  font-style: normal; color: currentColor;
}

/* Tab 红点 */
.tab-badge {
  position: absolute; top: 6px; right: 50%; margin-right: -20px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-elev);
}

/* ---------------- 训练日历（主视觉：打卡热力） ---------------- */
.cal-top-actions {
  position: sticky; top: var(--topbar-h); z-index: 29;
  display: flex; gap: 10px;
  margin: 12px 14px 0;
  padding: 10px;
  background: var(--bg-blur);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--sh);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
#day-detail { scroll-margin-top: calc(var(--topbar-h) + 96px); }
.cta-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 0; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--tx);
  font-size: 14px; font-weight: 800;
  transition: transform .12s ease, box-shadow .18s;
}
.cta-btn .cta-ic { font-size: 16px; line-height: 1; }
.cta-btn.primary {
  background: var(--brand-grad); border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(255, 70, 70, .32);
}
.cta-btn:active { transform: scale(.97); }

/* v1.169：训练日历 / 训练数据 三标签切换（训练记录·饮食记录·体重记录） */
.cal-tabs, .stat-tabs {
  display: flex; gap: 6px; margin: 14px 14px 0; padding: 5px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px;
}
.cal-tab, .stat-tab {
  flex: 1; padding: 9px 4px; border: none; border-radius: 10px;
  background: transparent; color: var(--tx-2);
  font-size: 13.5px; font-weight: 700; cursor: pointer; transition: all .18s;
}
.cal-tab.on, .stat-tab.on {
  background: var(--brand-grad); color: #fff;
  box-shadow: 0 4px 12px rgba(255, 70, 70, .28);
}
.cal-tab:active, .stat-tab:active { transform: scale(.97); }

/* v1.169：饮食记录（日历饮食标签 + 记录食物弹窗） */
.diet-actions { display: flex; gap: 10px; margin: 12px 0; }
.diet-actions .cta-btn { box-shadow: var(--sh-sm); }
/* v1.174：今日合计 Hero 大卡（与每餐小卡形成「总—分」视觉层级） */
.diet-today {
  margin: 4px 0 12px; padding: 14px 15px; border-radius: 16px; color: #fff;
  background: var(--brand-grad); box-shadow: 0 8px 20px var(--brand-glow);
  position: relative; overflow: hidden;
}
.diet-today::after {
  content: ''; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none;
}
.diet-today .dt-hd { display: flex; align-items: center; justify-content: space-between; }
.diet-today .dt-label { font-size: 12px; font-weight: 800; letter-spacing: .5px; opacity: .92; }
.diet-today .dt-cnt {
  font-size: 11px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .2);
  padding: 2px 9px; border-radius: 20px;
}
.diet-today .dt-kcal { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 10px; }
.diet-today .dt-num { font-size: 38px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.diet-today .dt-unit { font-size: 13px; font-weight: 700; opacity: .85; }
.diet-today .dt-macros { display: flex; gap: 7px; }
.diet-today .dt-m {
  flex: 1; text-align: center; padding: 7px 2px 6px; border-radius: 10px;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(2px);
}
.diet-today .dt-mk { display: block; font-size: 10px; font-weight: 600; opacity: .8; }
.diet-today .dt-mv { display: block; font-size: 14px; font-weight: 800; margin-top: 2px; }
.diet-meal { margin-bottom: 12px; }
.diet-meal-hd {
  font-size: 14px; font-weight: 800; margin-bottom: 7px; color: var(--tx);
}
.diet-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px;
}
.diet-item-main { flex: 1; min-width: 0; }
.diet-name { font-size: 14px; font-weight: 700; color: var(--tx); }
.diet-name-amt { font-weight: 400; color: var(--tx-3); font-size: 12.5px; }
.diet-sub { font-size: 12px; color: var(--tx-3); margin-top: 2px; }
.diet-del {
  flex: 0 0 auto; width: 26px; height: 26px; border: none; border-radius: 8px;
  background: var(--card-2); color: var(--tx-3); font-size: 13px; cursor: pointer;
}
.diet-del:active { transform: scale(.92); }
.diet-empty { padding: 8px 2px; font-size: 12.5px; }

/* v1.170：饮食记录增强 */
.diet-hint { font-size: 11.5px; color: var(--tx-3); margin: -4px 0 8px; }
.diet-item { cursor: pointer; transition: transform .12s; }
.diet-item:active { transform: scale(.985); }
/* 计算按钮与分量输入整齐排列 */
.diet-calc-row {
  display: flex; gap: 8px; align-items: flex-end; margin-bottom: 4px;
}
.diet-calc-row .field { min-width: 0; }
.diet-calc-row .btn {
  height: 40px; flex: 0 0 auto; white-space: nowrap; margin-bottom: 0;
  border-radius: 10px;
}
.chips.mini { flex-wrap: nowrap; }
.chips.mini .chip { font-size: 12px; padding: 6px 10px; }
/* AI 多食物识别卡片 */
.diet-ai-card {
  padding: 10px 11px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px;
}
.diet-ai-card-hd { display: flex; align-items: center; gap: 8px; }
.diet-ai-idx {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-grad); color: #fff; font-size: 11.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.diet-ai-name-input { flex: 1; min-width: 0; height: 38px; font-weight: 700; }
.diet-ai-x {
  flex: 0 0 auto; width: 26px; height: 26px; border: none; border-radius: 8px;
  background: var(--card-2); color: var(--tx-3); font-size: 13px; cursor: pointer;
}
.diet-ai-x:active { transform: scale(.92); }
.diet-nutri-sum {
  margin-top: 6px; padding: 7px 9px; font-size: 12px; color: var(--brand);
  background: var(--brand-soft); border-radius: 8px; line-height: 1.5;
}
/* v1.171：早餐/午餐/晚餐/加餐 分别计算（v1.174：次级小卡，弱化于今日合计大卡之下） */
.diet-meal-sums {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 14px;
}
.diet-meal-sum {
  padding: 10px 12px; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px;
}
.diet-meal-sum .ms-t {
  font-size: 12.5px; font-weight: 800; color: var(--tx); display: flex; align-items: center; gap: 6px;
}
.diet-meal-sum .ms-c {
  font-size: 10.5px; font-weight: 600; color: var(--tx-3); background: var(--card);
  border-radius: 20px; padding: 1px 7px;
}
.diet-meal-sum .ms-k { font-size: 16px; font-weight: 800; color: var(--brand); margin: 4px 0 2px; }
.diet-meal-sum .ms-ku { font-size: 10px; font-weight: 600; color: var(--tx-3); }
.diet-meal-sum .ms-m { font-size: 10.5px; color: var(--tx-3); line-height: 1.5; }
/* 单位下拉选择（v1.171） */
.unit-select {
  width: 100%; height: 40px; padding: 0 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--tx); background: var(--card);
  border: 1px solid var(--line); appearance: auto;
}
.diet-calc-row .unit-select { min-width: 92px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 13px 10px; text-align: center;
  box-shadow: var(--sh-sm);
  transition: transform .15s ease;
}
.stat:active { transform: translateY(-2px); }
.stat .n { font-size: 21px; font-weight: 800; letter-spacing: -.5px; color: var(--tx); }
.stat .n .u { font-size: 12px; font-weight: 700; color: var(--tx-3); margin-left: 2px; }
.stat .l { font-size: 11px; color: var(--tx-3); margin-top: 3px; }

.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 2px 14px;
}
.cal-head .ym { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.cal-nav { display: flex; gap: 8px; }
.cal-nav button {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--card-2); border: 1px solid var(--line);
  color: var(--tx-2); font-size: 16px; transition: all .15s;
}
.cal-nav button:active { transform: scale(.92); background: var(--card); }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 11.5px; color: var(--tx-3); text-align: center;
  font-weight: 700; margin-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; grid-auto-rows: 54px; }
.cal-cell {
  border-radius: 12px;
  background: var(--card);
  border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2px; gap: 2px;
  position: relative;
  overflow: hidden;
  min-width: 0; min-height: 0;
  transition: transform .12s, border-color .18s, background .18s;
}
.cal-cell:active { transform: scale(.93); }
.cal-cell.blank { background: transparent; pointer-events: none; border: none; }
/* v1.181：日期数字移到格子左上角，让出中部/底部空间给部位与热量数字 */
.cal-cell .d {
  position: absolute; top: 4px; left: 7px;
  font-size: 12px; font-weight: 700; color: var(--tx-2); transition: color .18s; line-height: 1;
}
.cal-cell.has { background: linear-gradient(160deg, rgba(255, 90, 60, .16), rgba(255, 61, 110, .08)); border-color: rgba(255, 90, 60, .22); }
.cal-cell.has .d { color: var(--tx); }
.cal-cell.today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.cal-cell.today .d { color: var(--brand); }
.cal-cell.sel { background: var(--brand-grad); border-color: transparent; box-shadow: 0 6px 16px rgba(255, 70, 70, .3); }
.cal-cell.sel .d { color: #fff; }
.cal-cell.sel .cal-dots i { box-shadow: 0 0 0 1px rgba(255,255,255,.4); }

.cal-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 100%; }
.cal-dots i { width: 4px; height: 4px; border-radius: 50%; display: block; flex: 0 0 auto; }
.cal-parts {
  display: flex; flex-wrap: nowrap; justify-content: center; gap: 0 2px;
  max-width: 100%; line-height: 1.05; margin-top: 0;
  overflow: hidden;
}
.cal-parts span { font-size: 9.5px; font-weight: 800; letter-spacing: 0; text-shadow: 0 1px 2px rgba(0,0,0,.25); white-space: nowrap; flex: 0 0 auto; }
.cal-parts .more { color: var(--tx-3) !important; font-weight: 700; text-shadow: none; }
/* v1.177/1.182：日历格子热量数字（v1.182 起取消色块染色，仅数字简洁清晰；底部居中全宽） */
.cal-cell .cal-kcal {
  position: absolute; left: 2px; right: 2px; bottom: 3px;
  text-align: center;
  font-size: 9.5px; font-weight: 800; letter-spacing: .2px; line-height: 1;
  color: var(--tx-2);
  pointer-events: none;
}
.cal-cell.sel .cal-kcal { color: rgba(255, 255, 255, .9); }   /* 选中日品牌渐变底上白字 */
.cal-cell .rest { font-size: 9px; color: var(--tx-3); }
.cal-cell .cell-cmt-dot {
  position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--card);
}
.cmt-new-ic {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); margin-left: 5px; vertical-align: middle;
}

.legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 14px 2px 2px; font-size: 11.5px; color: var(--tx-3);
}
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; }

.cal-entry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.cal-entry-btn {
  width: 100%; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line);
  padding: 14px 16px; box-shadow: var(--sh-sm);
  transition: transform .12s ease, border-color .18s;
}
.cal-entry-btn:active { transform: scale(.98); border-color: var(--line-strong); }
.cal-entry-btn .ar { color: var(--tx-3); }

/* ---------------- 当日详情 ---------------- */
.day-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.day-head .dt { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.day-head .wd { font-size: 12.5px; color: var(--tx-3); margin-left: 6px; font-weight: 600; }

.part-group { margin-bottom: 14px; }
.part-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; margin-bottom: 9px;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.ex-block {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 13px 14px; margin-bottom: 9px;
  box-shadow: var(--sh-sm);
  transition: border-color .18s;
}
.ex-block:active { border-color: var(--line-strong); }
.ex-block .name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.ex-block .meta { font-size: 11.5px; color: var(--tx-3); margin-bottom: 9px; }

.set-line {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 0; border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.set-line:first-of-type { border-top: none; }
.set-no {
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
  background: var(--card-2); color: var(--tx-3);
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
}
.set-side {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 2px 8px;
  border-radius: 6px; background: var(--brand-soft); color: var(--brand);
}
/* 记一组表单：侧别选择（单臂→左手/右手，单腿→左脚/右脚；双侧动作不渲染） */
.side-grid { display: flex; gap: 8px; }
.side-grid button {
  flex: 1; padding: 10px; border-radius: 10px;
  background: var(--card-2); font-weight: 650; transition: all .18s;
}
.side-grid button.on {
  background: var(--brand); color: #fff;
  box-shadow: 0 3px 10px rgba(255, 90, 60, .3);
}
.set-main { flex: 1; min-width: 0; }
.set-main b { font-weight: 700; }
.set-main .x { color: var(--tx-3); margin: 0 4px; font-weight: 400; }
.set-rpe {
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand); flex: 0 0 auto;
}
.set-note {
  font-size: 11.5px; color: var(--tx-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.set-wrap { border-top: 1px solid var(--line); }
.set-wrap:first-of-type { border-top: none; }
.set-wrap .set-line { border-top: none; padding: 8px 0 4px; }
.log-cmts {
  margin: 0 0 6px 31px; padding: 5px 10px;
  background: var(--card-2); border-radius: var(--r-s);
}
.log-cmt { font-size: 12.5px; line-height: 1.55; padding: 2px 0; }
.lc-name { font-weight: 800; color: var(--brand); margin-right: 6px; }
.lc-body { color: var(--tx-2); word-break: break-word; }
.log-cmt-input { display: flex; gap: 6px; margin: 2px 0 8px 31px; }
.log-cmt-input .input { flex: 1; min-width: 0; font-size: 12.5px; padding: 6px 10px; }
.log-cmt-input .btn { flex: 0 0 auto; padding: 6px 12px; font-size: 12.5px; }
.quick-chip-wrap .log-cmt-input { margin-left: 40px; }
.bdv-log-cmt-in { flex: 1; min-width: 0; }
.bdv-log-cmt-send { flex: 0 0 auto; }

/* 当日头部常驻评论输入框 */
.day-cmt-inline { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; max-width: 320px; }
.day-cmt-inline .input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 13px; border-radius: 12px; }
.day-cmt-inline .btn { padding: 9px 14px; font-size: 13px; border-radius: 12px; white-space: nowrap; }
.card .day-cmt-inline { max-width: none; margin: 10px 0 2px; }

/* 每日体重 */
.day-wt .wt-rows { display: flex; gap: 10px; margin: 2px 0 12px; }
.day-wt .wt-row { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.day-wt .wt-row label { font-size: 12px; color: var(--tx-3); font-weight: 700; }
.day-wt .wt-row .input { text-align: center; }

/* ---------------- 动作库 ---------------- */
.search-bar { position: relative; margin-bottom: 12px; }
.search-bar .input { padding-left: 38px; }
.search-bar .ic {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--tx-3); font-size: 14px; pointer-events: none;
}
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chips::-webkit-scrollbar { display: none; }

.ex-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--sh-sm);
  transition: transform .12s, border-color .18s;
}
.ex-item:active { transform: scale(.985); border-color: var(--line-strong); }
.ex-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ex-info { flex: 1; min-width: 0; }
.ex-info .n { font-size: 15px; font-weight: 700; }
.ex-info .e {
  font-size: 11.5px; color: var(--tx-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ex-tag {
  font-size: 10.5px; color: var(--tx-3); padding: 2.5px 7px;
  border-radius: 6px; background: var(--card-2); flex: 0 0 auto;
}
.fav-btn { font-size: 18px; padding: 4px 2px; flex: 0 0 auto; opacity: .32; transition: all .18s; }
.fav-btn.on { opacity: 1; transform: scale(1.12); }

.count-note { font-size: 12px; color: var(--tx-3); padding: 2px 2px 10px; }

/* 动作库二级分组 */
.ex-sec { margin-bottom: 14px; }
.ex-sec-hd { font-size: 13px; font-weight: 800; color: var(--tx-2); margin: 4px 2px 8px; display: flex; align-items: center; gap: 6px; }
.ex-sec-hd .muted { font-weight: 500; font-size: 11.5px; }

/* 自定义动作标记 */
.cust-dot {
  display: inline-block; font-size: 10px; line-height: 1; font-weight: 800;
  color: var(--brand); background: var(--brand-soft);
  border: 1px solid rgba(255, 90, 60, .35);
  padding: 2px 5px; border-radius: 6px; margin-left: 2px; vertical-align: middle;
}
.del-btn {
  border: none; background: transparent; color: var(--tx-3);
  font-size: 15px; width: 30px; height: 32px; border-radius: 8px; flex: none;
}
.del-btn:active { background: var(--danger-soft); color: var(--danger); }

/* 快速打卡列表 */
.quick-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.quick-chip-wrap { display: flex; flex-direction: column; gap: 4px; }
.quick-chip-wrap .log-cmts { margin: 0 0 0 40px; }
.set-cmt-q { margin-left: auto; }
.quick-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 10px 12px;
  transition: border-color .15s;
}
.quick-chip:active { border-color: var(--line-strong); }
.q-ic {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.q-main { flex: 1; min-width: 0; }
.q-t { font-size: 13.5px; font-weight: 700; }
.q-n { font-size: 12px; color: var(--tx-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-go { color: var(--tx-3); font-size: 18px; flex: none; }

/* 动作讲解（可展开） */
.explain {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r-s); margin-bottom: 14px; overflow: hidden;
}
.explain-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-size: 14px; font-weight: 700; }
.explain-hd .ar { color: var(--tx-3); font-size: 13px; transition: transform .15s; }
.explain-bd { padding: 0 14px 14px; }
.exp-block { margin-top: 10px; }
.exp-block:first-child { margin-top: 0; }
.exp-t {
  display: inline-block; font-size: 11.5px; font-weight: 800; color: var(--brand);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 6px; margin-bottom: 6px;
}
.exp-c { font-size: 13.5px; line-height: 1.75; color: var(--tx-2); }
.tip-line { font-size: 13px; line-height: 1.7; color: var(--tx-2); margin-top: 3px; }
.pr-date { font-size: 11px; color: var(--tx-3); font-weight: 500; }

/* ---------------- AI 训练分析 / 教练输出 ---------------- */
.ai-warn {
  background: rgba(255, 193, 7, .12); border: 1px solid rgba(255, 193, 7, .35);
  color: #b8860b; border-radius: 12px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.6; margin-bottom: 12px;
}
[data-theme="dark"] .ai-warn { color: #ffd666; }
.ai-meta { margin-bottom: 6px; }
.ai-meta-in {
  background: var(--card-2); border: 1px dashed var(--line-strong);
  border-radius: 10px; padding: 10px 12px;
  font-size: 11.5px; line-height: 1.7; color: var(--tx-3);
  max-height: 150px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.ai-out {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-top: 6px;
  font-size: 13.5px; line-height: 1.8; color: var(--tx-2);
  box-shadow: var(--sh-sm);
}
.md-h { font-weight: 800; color: var(--tx); margin: 12px 0 6px; line-height: 1.4; }
.md-h1 { font-size: 16px; }
.md-h2 { font-size: 14.5px; }
.md-h3 { font-size: 13.5px; color: var(--brand); }
.md-p { margin: 6px 0; }
.ai-out ul, .ai-out ol, .ai-ul { margin: 6px 0; padding-left: 22px; }
.ai-out li, .ai-ul li { margin: 4px 0; line-height: 1.7; }
.ai-out b, .ai-p b { color: var(--tx); }
.ai-p { margin: 6px 0; line-height: 1.7; }
.ai-h2 { font-weight: 800; margin: 10px 0 4px; }

.ai-quota-row { font-size: 13px; color: var(--tx-2); margin: 4px 0 6px; }
.ai-token-note { font-size: 11.5px; color: var(--tx-3); background: var(--card-2); border-radius: 10px; padding: 8px 10px; line-height: 1.6; margin-bottom: 10px; }
.ai-quota-warn { font-size: 12px; color: var(--danger); margin-top: 8px; line-height: 1.6; }
.ai-quota-note { font-size: 12px; color: var(--tx-3); margin-top: 8px; line-height: 1.6; }
.ai-history { margin-top: 6px; }
.ai-hist-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: background .15s; }
.ai-hist-item:active { background: var(--card-2); }
.ai-hist-tag { font-size: 13px; font-weight: 700; color: var(--brand); }
.ai-hist-t { font-size: 11px; color: var(--tx-3); margin: 2px 0 4px; }
.ai-hist-s { font-size: 12.5px; color: var(--tx-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 按日 AI 分析块（保留兼容） */
.day-ai { margin-top: 18px; }
.day-ai-hd { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.day-ai-quota { font-size: 11.5px; font-weight: 600; }
.day-ai .btn-block { margin-top: 4px; }

/* ---------------- Bottom Sheet ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: opacity .25s;
  backdrop-filter: blur(2px);
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: 520px; z-index: 100;
  background: var(--bg-elev);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line);
  max-height: 92vh; display: flex; flex-direction: column;
  transition: transform .32s var(--ease);
  box-shadow: 0 -8px 44px rgba(0, 0, 0, .45);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet-grab { width: 40px; height: 4px; border-radius: 3px; background: var(--line-strong); margin: 10px auto 4px; flex: 0 0 auto; }
.sheet-head {
  padding: 8px 18px 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.sheet-head .sub { font-size: 11.5px; color: var(--tx-3); margin-top: 2px; }
.sheet-body { padding: 16px 18px; overflow-y: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); flex: 0 0 auto; display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }

/* ---------------- Toast ---------------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabh) + var(--safe-b) + 22px);
  transform: translate(-50%, 14px); z-index: 200;
  background: rgba(20, 22, 28, .96); color: #fff;
  padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: all .26s var(--ease);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
  max-width: 86%; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #d63a48; }
#toast.ok { background: #16a35a; }

/* ---------------- 浮动 AI 教练（可拖动 + 边缘吸附） ---------------- */
/* v1.175：全站隐藏 AI 教练入口（悬浮球）。保留 HTML 与 JS 逻辑，未来恢复只需删除本行 + !important */
#fab-coach { display: none !important; }
.fab-coach {
  position: fixed; right: 16px; bottom: calc(var(--tabh) + 18px + var(--safe-b)); z-index: 60; border: none; cursor: grab; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: transparent; color: var(--brand);
  border-radius: 50%; width: 60px; height: 60px; padding: 0;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .3));
  transition: width .2s ease, height .2s ease, left .25s ease, top .25s ease, opacity .15s;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.fab-coach.dragging { cursor: grabbing; transition: none; opacity: .92; }
.fab-coach.edge { width: 42px; height: 42px; }
.fab-coach.edge .fc-img { width: 34px; height: 34px; }
.fab-coach.edge .fc-tx { display: none; }
@media (min-width: 560px) { .fab-coach { right: calc(50% - 260px + 16px); } }
.fab-coach .fc-img {
  width: 50px; height: 50px; border-radius: 50%; object-fit: cover;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-2), var(--card-2)) padding-box,
    var(--brand-grad) border-box;
  pointer-events: none;
}
.fab-coach .fc-tx { font-size: 10px; font-weight: 800; color: var(--brand); text-shadow: 0 1px 3px rgba(0,0,0,.5); margin-top: 1px; pointer-events: none; }
.fab-coach:active { transform: scale(.92); }
.fab-coach.dragging { cursor: grabbing; transition: none; transform: none; opacity: .92; }
.fab-coach::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--brand-soft); animation: fabPulse 2.4s ease-in-out infinite;
}
.fab-coach.edge::after { inset: -2px; }
@keyframes fabPulse { 0%, 100% { opacity: .4; transform: scale(1); } 50% { opacity: 0; transform: scale(1.18); } }

/* AI 教练对话 */
.coach-head { display: flex; align-items: center; gap: 11px; padding: 2px 2px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.coach-notes-btn { flex: 0 0 auto; appearance: none; border: 1px solid var(--line); background: var(--card-2); color: var(--tx); font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 12px; border-radius: 10px; cursor: pointer; transition: background .12s ease, transform .12s ease; }
.coach-notes-btn:active { transform: translateY(1px); }
.coach-notes-list { max-height: 48vh; overflow-y: auto; padding: 4px 0 10px; }
.coach-note-row { display: flex; align-items: flex-start; gap: 8px; padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--card); }
.coach-note-row .note-i { flex: 0 0 auto; font-weight: 800; color: var(--brand); }
.coach-note-row .note-t { flex: 1; line-height: 1.55; font-size: 14px; word-break: break-word; }
.coach-note-row .note-ops { flex: 0 0 auto; display: flex; gap: 4px; }
.coach-note-row .note-edit, .coach-note-row .note-del { appearance: none; border: none; background: transparent; color: var(--tx-3); font-family: inherit; font-size: 12px; cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.coach-note-row .note-edit:active { background: rgba(80,120,255,.12); color: var(--brand); }
.coach-note-row .note-del:active { background: rgba(255,80,80,.12); color: #ff5252; }
/* v1.104（#5）：记忆条目可点击跳转对话 + 时间标记 */
.coach-note-row { cursor: pointer; transition: background .12s ease; }
.coach-note-row:active { background: var(--card-2); }
.coach-note-row .note-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.coach-note-row .note-main .note-i { flex: 0 0 auto; font-weight: 800; color: var(--brand); margin-right: 4px; }
.coach-note-row .note-main .note-t { line-height: 1.55; font-size: 14px; word-break: break-word; }
.coach-note-row .note-time { font-size: 11px; color: var(--tx-3); }
/* v1.104（#5）：对话跳转高亮 */
.coach-flash { animation: coachFlash 1.6s ease; border-radius: 10px; }
@keyframes coachFlash {
  0%, 60% { background: rgba(80,120,255,.16); }
  100% { background: transparent; }
}
/* v1.104（#7）：训练计划卡片 */
.ai-out .ai-brief { color: var(--tx-2); }
.ai-out .ai-toggle { color: var(--brand); border-color: var(--line); }
.coach-note-day { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--tx-2); padding: 10px 2px 6px; border-top: 1px dashed var(--line); margin-top: 4px; }
.coach-note-day:first-child { border-top: none; margin-top: 0; }
.coach-note-day .muted { font-weight: 400; }
.coach-sec { margin-top: 6px; }
.coach-sec-hd { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--brand); padding: 12px 2px 8px; border-top: 1px solid var(--line); margin-top: 6px; }
.coach-sec:first-child .coach-sec-hd { border-top: none; margin-top: 0; padding-top: 2px; }
.coach-sec-hd .muted { font-weight: 400; color: var(--tx-3); }
/* #5：记忆板块分组按钮总览 */
.coach-sec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 6px 0 10px; }
.coach-sec-btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--tx); font-family: inherit; cursor: pointer; border-radius: 12px; padding: 14px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: background .12s ease, transform .12s ease, border-color .12s ease; }
.coach-sec-btn:active { transform: translateY(1px); }
.coach-sec-btn:not([disabled]):hover { border-color: var(--brand); background: var(--card-2); }
.coach-sec-btn[disabled] { opacity: .45; cursor: default; }
.coach-sec-btn .csb-name { font-size: 14px; font-weight: 700; }
.coach-sec-btn .csb-cnt { flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.coach-sec-btn[disabled] .csb-cnt { background: var(--tx-3); }
.coach-status .cq-num { color: var(--brand); font-size: 14px; }
.coach-notes-actions { display: flex; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.coach-notes-actions .btn { flex: 1; }
.coach-ava { width: 44px; height: 44px; border-radius: 50%; background: url('../images/coach.png') center/cover no-repeat; border: 2px solid transparent; background-clip: padding-box; box-shadow: 0 0 0 2px var(--brand); }
/* v1.141（需求2）：头像与「改头像」归为一组，按钮置于头像正下方并缩小 */
.coach-ava-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 0 auto; }
.coach-av-edit { appearance: none; border: none; background: none; color: var(--brand); font-family: inherit; font-size: 11px; font-weight: 700; padding: 1px 4px; line-height: 1.1; cursor: pointer; margin-top: 1px; }
.coach-av-edit:active { transform: translateY(1px); }
.coach-meta { flex: 1; min-width: 0; }
.coach-name { font-size: 15.5px; font-weight: 800; }
.coach-status { font-size: 11.5px; color: var(--tx-3); margin-top: 2px; }
.coach-box { height: 52vh; overflow-y: auto; padding: 6px 2px; }
/* v1.139：教练人设提示词编辑面板（置于对话区上方，可折叠） */
.coach-persona { border: 1px solid var(--line); background: var(--card-2); border-radius: var(--r-m); padding: 10px 12px; margin-bottom: 8px; }
.coach-persona-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coach-persona-title { font-size: 13px; font-weight: 800; color: var(--tx); }
.coach-persona-toggle { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--tx); font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 9px; cursor: pointer; transition: background .12s ease, transform .12s ease; }
.coach-persona-toggle:active { transform: translateY(1px); }
.coach-persona-preview { font-size: 12.5px; line-height: 1.6; color: var(--tx-2); margin-top: 7px; max-height: 60px; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.coach-persona-preview .muted { color: var(--tx-3); }
.coach-persona-edit { margin-top: 9px; }
.coach-persona-edit .input { width: 100%; min-height: 64px; font-size: 13px; line-height: 1.55; }
.coach-persona-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.coach-persona-hint { font-size: 11.5px; color: var(--brand); margin-top: 6px; min-height: 14px; }
/* v1.142：人设编辑面板——头像编辑块（改头像移入此处） */
.pf-av-edit { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.pf-av-edit .coach-ava { width: 52px; height: 52px; flex: 0 0 auto; }
.pf-av-edit-ops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* v1.142：性格/语气分组 chip 单选 UI */
.pf-block { margin-bottom: 10px; }
.pf-block-label { display: block; font-size: 12.5px; color: var(--tx-2); font-weight: 800; margin-bottom: 6px; }
.pf-chips { display: flex; flex-direction: column; gap: 8px; }
.pf-chip-group { }
.pf-chip-gtitle { font-size: 11px; color: var(--tx-3); font-weight: 700; margin: 0 0 4px 1px; }
.pf-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; line-height: 1.2;
  padding: 6px 11px; border-radius: 999px;
  color: var(--tx-2); background: var(--card); border: 1px solid var(--line);
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .08s ease;
}
.chip:active { transform: scale(.96); }
.chip.on {
  color: #fff; background: var(--brand-grad); border-color: transparent;
  box-shadow: 0 3px 10px rgba(255, 70, 70, .28);
}
/* 次级按钮（恢复默认等） */
.btn.ghost { background: var(--card); color: var(--tx-2); border: 1px solid var(--line); }
.btn.ghost:active { transform: translateY(1px); }
/* v1.140：教练头像自定义（img 覆盖默认 coach.png 背景）；头部按钮组；人设字段行 */
.coach-ava-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.coach-head-btns { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; align-items: flex-end; }
.coach-head-btns .btn { white-space: nowrap; }
.pf-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pf-row label { flex: 0 0 auto; width: 84px; font-size: 12.5px; color: var(--tx-2); font-weight: 700; }
.pf-row .input { flex: 1; min-width: 0; height: 34px; font-size: 13px; }
.coach-empty { color: var(--tx-3); font-size: 13.5px; line-height: 1.85; padding: 14px 6px; }
.coach-row { display: flex; gap: 8px; align-items: flex-end; margin: 9px 0; animation: popIn .2s ease; }
.coach-row.me { flex-direction: row-reverse; }
.coach-ava-sm { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: url('../images/coach.png') center/cover no-repeat; border: 1.5px solid var(--brand); }
.coach-bubble { max-width: 76%; margin: 0; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.7; word-break: break-word; }
.coach-bubble.me { background: var(--brand-grad); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 4px 14px rgba(255, 70, 70, .28); }
.coach-bubble.ai { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.coach-bubble.ai .md-h { font-size: 15px; font-weight: 800; margin: 8px 0 4px; }
.coach-bubble.ai .md-p { margin: 6px 0; }
.coach-bubble.ai ul, .coach-bubble.ai ol { margin: 4px 0; padding-left: 20px; }
.coach-typing { display: inline-flex; gap: 5px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px; padding: 13px 15px; }
.coach-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--tx-3); animation: coachBlink 1.2s infinite ease-in-out; }
.coach-typing span:nth-child(2) { animation-delay: .2s; }
.coach-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes coachBlink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.coach-quota { font-size: 12.5px; color: var(--tx-3); text-align: center; padding: 8px 0 4px; }
.coach-quota b { color: var(--brand); }
.coach-input { position: sticky; bottom: 0; display: flex; gap: 8px; margin-top: 10px; }
.coach-input .input { flex: 1; }
.coach-quick { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 10px 12px; margin: 4px 0 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; }
.coach-quick-btn { flex: 0 0 auto; appearance: none; border: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; color: #fff; background: var(--brand-grad); padding: 9px 16px; border-radius: 11px; box-shadow: 0 4px 12px rgba(255, 70, 70, .28); transition: transform .12s ease; }
.coach-quick-btn:active { transform: translateY(1px) scale(.98); }
.coach-quick-btn:disabled { opacity: .6; cursor: default; }
.coach-quick-note { flex: 1; min-width: 130px; font-size: 11.5px; line-height: 1.5; color: var(--tx-3); }

/* ---------------- 我的 / 设置 ---------------- */
.profile-card {
  background: var(--brand-grad);
  border-radius: var(--r-l); padding: 20px; color: #fff;
  margin-bottom: 16px; position: relative; overflow: hidden;
  box-shadow: 0 12px 32px rgba(255, 70, 70, .32);
  display: flex; gap: 14px; align-items: center;
}
.profile-card::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255, 255, 255, .12);
}
.profile-card .pc-av { flex: 0 0 auto; cursor: pointer; position: relative; z-index: 1; }
.profile-card .pc-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.profile-card .ph { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.profile-card .sub { font-size: 12.5px; opacity: .92; margin-top: 3px; }
.profile-card .pc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; opacity: .95; }
.profile-card .pc-meta span { white-space: nowrap; }
.profile-card .pc-cloud { position: absolute; top: 10px; right: 12px; font-size: 14px; opacity: .9; z-index: 1; }
.profile-card .buddy-av, .profile-card .av { background: rgba(255, 255, 255, .3); }
.profile-card .pc-edit-btn {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, .2); color: #fff; border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  position: relative; z-index: 1;
}
.profile-card .pc-edit-btn:active { background: rgba(255, 255, 255, .36); }

.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .28); padding-top: 14px; position: relative; z-index: 1;
}
.profile-stats div { text-align: center; }
.profile-stats .n { font-size: 19px; font-weight: 800; }
.profile-stats .l { font-size: 10.5px; opacity: .85; }

/* 头像 */
.av, .buddy-av, .cmt-av, .av-lg, .bdv-av-lg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .28); flex: 0 0 auto; font-size: 22px; line-height: 1;
}
.av-lg { width: 56px; height: 56px; font-size: 32px; background: rgba(255, 255, 255, .3); }
.bdv-av-lg { width: 36px; height: 36px; font-size: 19px; background: var(--brand-soft); }
.buddy-av { background: var(--brand); color: #fff; }
.cmt-av { background: var(--brand-soft); color: var(--brand); }

.av-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.av-pick {
  aspect-ratio: 1 / 1; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card-2); font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: transform .12s, border-color .18s;
}
.av-pick.on { border-color: var(--brand); background: var(--brand-soft); }
.av-pick:active { transform: scale(.94); }

.av-prev { display: flex; justify-content: center; margin: 4px 0 10px; }
.av-prev img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--card-2); }
.av-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
img.av, img.av-lg, img.buddy-av, img.cmt-av, img.bdv-av-lg { object-fit: cover; border-radius: 50%; background: var(--card-2); }

.mini-copy {
  background: rgba(255, 255, 255, .22); color: #fff; border: none;
  border-radius: 8px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; margin-left: 6px;
}
.mini-copy:active { background: rgba(255, 255, 255, .4); }
.mini-copy.on-light { background: var(--brand-soft); color: var(--brand); }

.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m); margin-bottom: 9px;
  box-shadow: var(--sh-sm);
  transition: transform .12s, border-color .18s;
}
.list-item:active { transform: scale(.99); border-color: var(--line-strong); }
.list-item .ic { font-size: 18px; width: 24px; text-align: center; flex: 0 0 auto; }
.list-item .tt { flex: 1; font-size: 14.5px; font-weight: 600; }
.list-item .vv { font-size: 12.5px; color: var(--tx-3); }
.list-item .ar { color: var(--tx-3); font-size: 14px; }

.switch {
  width: 46px; height: 27px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line);
  position: relative; transition: background .22s; flex: 0 0 auto;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--tx-3); transition: all .22s;
}
.switch.on { background: var(--brand-grad); border-color: transparent; }
.switch.on::after { left: 21px; background: #fff; }

.rd {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--tx-3); flex: 0 0 auto; box-sizing: border-box; position: relative;
}
.rd.on { border-color: var(--brand); }
.rd.on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }

.badge-cloud { font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.badge-cloud.on { background: var(--ok-soft); color: var(--ok); }
.badge-cloud.off { background: var(--card-2); color: var(--tx-3); }

.code-box {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 12px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px; line-height: 1.65; color: var(--tx-2);
  white-space: pre; overflow-x: auto; margin: 10px 0;
}
.steps { padding-left: 18px; margin: 8px 0; font-size: 13.5px; color: var(--tx-2); line-height: 1.85; }
.steps li { margin-bottom: 4px; }

.readonly-box { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 15px; font-weight: 800; letter-spacing: 1px; color: var(--brand); }
.divider { height: 1px; background: var(--line); margin: 6px 0 14px; }

.birth-sel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.birth-sel select.input { flex: 0 1 auto; width: auto; min-width: 72px; padding: 9px 8px; }

.me-sub-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.me-sub-head > div { flex: 1; min-width: 0; }
.me-sub-head .ph { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.me-sub-head .sub { font-size: 12px; color: var(--tx-3); margin-top: 1px; }

/* ---------------- 健身搭子（微信好友风） ---------------- */
.buddy-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 13px; margin-bottom: 10px; box-shadow: var(--sh-sm); }
.buddy-top { display: flex; align-items: center; gap: 11px; }
.buddy-top .buddy-name { flex: 1; font-weight: 700; font-size: 15px; }
.buddy-top .buddy-num { font-size: 11.5px; color: var(--tx-3); text-align: right; }
.buddy-meta { margin-top: 6px; font-size: 12.5px; color: var(--tx-2); }
.buddy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13.5px; }
.buddy-row .muted { color: var(--tx-3); }
.req-tag { font-size: 11px; color: var(--warn); font-weight: 700; }

.buddy-friend { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.buddy-friend.tap { cursor: pointer; }
.buddy-friend.tap:active { background: var(--card-2); }
.bf-av { flex: 0 0 auto; cursor: pointer; }
.bf-main { flex: 1; min-width: 0; }
.bf-name { font-size: 15px; font-weight: 700; }
.bf-meta { font-size: 12px; color: var(--tx-2); margin-top: 2px; }
.bf-status { font-size: 12px; color: var(--tx-3); margin-top: 2px; }

.buddy-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.buddy-detail-head .bdh-name { font-size: 18px; font-weight: 800; }
.buddy-detail-head .bdh-meta { font-size: 13px; color: var(--tx-2); margin-top: 2px; font-weight: 600; }
.buddy-detail-head .bdh-sub { font-size: 12px; color: var(--tx-3); margin-top: 2px; }

/* 搭子按日视图 */
.bdy-tool { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; }
.bdy-dates { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding-bottom: 4px; }
.bdy-dates::-webkit-scrollbar { display: none; }
.bdy-date {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--card-2); color: var(--tx-2); border: 1px solid var(--line);
}
.bdy-date.on { background: var(--brand-grad); color: #fff; border-color: transparent; }
.bdy-cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px; margin: 6px 0 10px; }
.bdy-cal-hd { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; font-size: 13px; font-weight: 700; }
.bdy-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bdy-cal-grid .w { text-align: center; font-size: 11px; color: var(--tx-3); padding: 3px 0; }
.bdy-cell {
  aspect-ratio: 1; border: none; border-radius: 9px; background: var(--card-2);
  color: var(--tx-2); font-size: 12.5px; font-weight: 600; position: relative; cursor: pointer;
}
.bdy-cell.has::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand);
}
.bdy-cell.on { background: var(--brand-grad); color: #fff; }
.bdy-cell.on.has::after { background: #fff; }
.bdy-cell:active { opacity: .7; }

/* 查看搭子记录 */
.buddy-day { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 6px; }
.buddy-day:last-child { border-bottom: none; }
.set-cmt-day { margin-left: auto; }
.set-cmt { font-size: 15px; cursor: pointer; flex: none; padding: 2px 4px; border-radius: 7px; }
.set-cmt:active { background: var(--card-2); }
/* ＋ 按钮：在某条记录旁快速新建下一组（基于本条内容预填） */
.set-add { font-size: 16px; font-weight: 700; line-height: 1; width: 24px; height: 24px; flex: none;
  color: var(--brand); background: var(--brand-soft); border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer; }
.set-add:active { transform: scale(0.92); }

/* ---------------- 消息 / 通知 ---------------- */
.notif-item { display: flex; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.notif-item.unread { background: linear-gradient(90deg, rgba(255,90,60,.1), transparent); }
.notif-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-top: 6px; flex: none; }
.notif-item.read { opacity: .6; }
.notif-item.read .notif-dot { background: transparent; }
.notif-main { flex: 1; }
.notif-txt { font-size: 14px; line-height: 1.5; color: var(--tx-2); }
.notif-time { font-size: 11.5px; color: var(--tx-3); margin-top: 3px; }
.notif-type { font-size: 11px; color: var(--brand); font-weight: 700; }

/* 评论 */
.cmt { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: none; }
.cmt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cmt-av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.cmt-name { font-size: 13px; font-weight: 700; }
.cmt-time { font-size: 11px; color: var(--tx-3); margin-left: auto; }
.cmt-body { font-size: 13.5px; line-height: 1.6; color: var(--tx-2); padding-left: 34px; }
.cmt-del { font-size: 11.5px; color: var(--tx-3); margin-left: auto; }
.cmt-input { display: flex; gap: 8px; margin-top: 10px; }
.cmt-input .input { flex: 1; }
.cmt-list { max-height: 46vh; overflow: auto; margin-bottom: 8px; }

/* 分享链接卡片 */
.share-link { background: var(--card-2); border: 1px dashed var(--brand); border-radius: 12px; padding: 12px; font-size: 12.5px; line-height: 1.7; color: var(--tx-2); word-break: break-all; }
.share-link.expired { border-color: var(--line); opacity: .65; }
.sl-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 700; }
.sl-exp { font-weight: 500; color: var(--tx-3); font-size: 11.5px; }
.sl-url { word-break: break-all; background: var(--card); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; color: var(--tx-2); margin-bottom: 8px; }
.sl-acts { display: flex; gap: 8px; }
.share-warn { background: rgba(255,193,7,.12); border: 1px solid rgba(255,193,7,.35); color: #b8860b; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 12px; }
[data-theme="dark"] .share-warn { color: #ffd666; }

/* ---------------- 搭子圈（朋友圈） ---------------- */
.circle-filter {
  display: flex; gap: 8px; padding: 10px 14px 0;
  max-width: 560px; margin: 0 auto;
}
.circle-filter .chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--tx-2);
  transition: all .18s; white-space: nowrap;
}
.circle-filter .chip.on { background: var(--brand-grad); color: #fff; border-color: transparent; }

.circle-post {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 14px 14px 0; margin-bottom: 12px;
  box-shadow: var(--sh-sm);
}
.cp-head { display: flex; align-items: flex-start; gap: 10px; }
.cp-av, img.cp-av {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--brand-soft); color: var(--brand);
  object-fit: cover;
}
.cp-meta { flex: 1; min-width: 0; padding-top: 1px; }
.cp-head .cp-main { flex: 1; min-width: 0; padding-top: 1px; }
.cp-name { font-size: 15px; font-weight: 800; color: #5b7bb5; display: flex; align-items: center; }
.cp-time { font-size: 11.5px; color: var(--tx-3); margin-top: 2px; }
.post-del { background: none; border: none; color: var(--tx-3); font-size: 11px; padding: 0 0 0 10px; margin-left: auto; }
.post-del:active { color: var(--danger); }
.cp-content { font-size: 14.5px; line-height: 1.7; margin: 5px 0 4px; white-space: pre-wrap; word-break: break-word; }

.post-img { margin: 10px 0 2px; }
.post-img.single img { width: 100%; border-radius: 12px; display: block; background: var(--card-2); }
.post-imgs { display: grid; gap: 5px; margin: 10px 0 2px; }
.post-imgs.cols-2 { grid-template-columns: repeat(2, 1fr); }
.post-imgs.cols-3 { grid-template-columns: repeat(3, 1fr); }
.post-imgs .pi { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--card-2); }
.post-imgs .pi img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-prev { display: grid; gap: 6px; margin-top: 4px; }
.post-prev.cols-1 { grid-template-columns: repeat(1, 1fr); }
.post-prev.cols-2 { grid-template-columns: repeat(2, 1fr); }
.post-prev.cols-3 { grid-template-columns: repeat(3, 1fr); }
.post-prev .pp { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--card-2); }
.post-prev .pp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-prev .pp-del {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; border: none;
  font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.pp-add {
  aspect-ratio: 1; border-radius: 8px; cursor: pointer;
  border: 1px dashed var(--line-strong);
  background: var(--card-2); color: var(--tx-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 400;
}
.pp-add:active { opacity: .7; }

.cp-like-cmt {
  margin-top: 10px; border-radius: 10px; overflow: hidden;
  background: var(--card-2); padding: 2px 11px;
}
.cp-likes { display: flex; align-items: center; gap: 7px; padding: 7px 0; font-size: 13px; color: var(--tx-2); line-height: 1.5; }
.cp-likes .like-heart { font-size: 13px; flex: 0 0 auto; }
.cp-likes .like-names { flex: 1; min-width: 0; word-break: break-word; }
.cp-comments { border-top: 1px solid rgba(120, 130, 150, .18); padding: 1px 0 6px; }
.cmt-row { padding: 5px 0; font-size: 13.5px; line-height: 1.6; word-break: break-word; }
.cmt-row .cmt-name { color: #5b7bb5; font-weight: 700; margin-right: 6px; }
.cmt-row .cmt-txt { color: var(--tx); }
.cmt-row .cmt-del { background: none; border: none; color: var(--tx-3); font-size: 11px; padding: 0 2px 0 6px; vertical-align: middle; opacity: .7; }
.cmt-row .cmt-del:active { color: var(--danger); opacity: 1; }

.cp-acts {
  display: flex; justify-content: flex-end; gap: 26px;
  margin-top: 8px; padding: 8px 2px 12px; border-top: 1px solid var(--line);
}
.cp-acts button {
  background: none; border: none; color: var(--tx-2); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 0;
}
.cp-acts .like-ic { font-size: 15px; }
.post-like.on { color: var(--danger); }
.post-like.on .like-ic { animation: likePop .28s ease; }
@keyframes likePop { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }

.post-comments { margin-top: 8px; padding-bottom: 12px; }
.post-cmt-box { display: flex; gap: 8px; background: var(--card-2); border-radius: 10px; padding: 5px; }
.post-cmt-box .input { flex: 1; border: none; background: transparent; font-size: 13.5px; padding: 7px 9px; }
.post-cmt-input { flex: 1; min-width: 0; }
.post-cmt-send { flex: 0 0 auto; }
.post-cmt-toggle { background: none; border: none; color: var(--tx-2); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.post-cmt-toggle:active { opacity: .6; }

/* ============ 历史记录条 ============ */
.hist-day { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hist-day:last-child { border-bottom: none; }
.hist-day .dd { font-weight: 700; }
.hist-day .ss { color: var(--tx-3); font-size: 12.5px; }
.swipe-actions { display: flex; gap: 8px; margin-top: 10px; }
.swipe-actions .btn { flex: 1; }

/* ============ 训练数据 → 体重变化版块 ============ */
.wt-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.wt-item:first-of-type { border-top: none; }
.wt-date { color: var(--tx-2); font-weight: 650; }
.wt-vals { display: flex; gap: 14px; color: var(--tx); }
.wt-vals .muted { color: var(--tx-3); }
.wt-diff { font-size: 12.5px; font-weight: 800; padding: 3px 9px; border-radius: 8px; }
.wt-diff.up { color: var(--danger); background: rgba(255, 77, 94, .1); }
.wt-diff.down { color: var(--ok, #2bd9a0); background: rgba(43, 217, 160, .12); }
.wt-diff.flat { color: var(--tx-3); background: var(--card-2); }

/* ============ 我的 → 资料：出生年月/部位选择 ============ */
.part-pick { /* 复用 .chip 视觉，作为动作部位选择 */ }
/* 快速记录里的「休息」选项：与身体部位语义不同，独立成行、静谧夜色调，避免混在 8 个部位里被忽略 */
.rest-sep { display: flex; align-items: center; gap: 10px; margin: 14px 2px 10px; color: var(--tx-3); font-size: 12px; }
.rest-sep::before, .rest-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rest-pick {
  display: flex; width: 100%; justify-content: center; align-items: center; gap: 6px;
  padding: 11px 14px; margin-top: 2px;
  background: linear-gradient(135deg,#eef2f7,#dfe6ef); color: #475569; border-color: #d3dce8;
  font-weight: 700;
}
.rest-pick:hover { filter: brightness(.98); }
.rest-pick.on {
  background: linear-gradient(135deg,#334155,#1e293b); color: #fff; border-color: #1e293b;
  box-shadow: 0 6px 16px rgba(30,41,59,.22);
}

/* ============ 公开查看页（view.html 兜底，主样式在内联 style） ============ */
.view-wrap { max-width: 560px; margin: 0 auto; padding: 16px 14px 40px; }
.view-head { text-align: center; padding: 18px 0; }
.view-head .mark { font-size: 40px; }
.view-banner { background: rgba(255,90,60,.1); border: 1px solid rgba(255,90,60,.3); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.view-exp { font-size: 11.5px; color: var(--tx-3); text-align: center; margin-top: 20px; }

/* ============ 兼容补充（index.html 直接使用的类，原版遗漏部分） ============ */
.bdv-top-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.bdv-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden;
}
.bdv-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.bdv-perm-mini {
  width: 32px; height: 32px; font-size: 15px; flex: 0 0 auto;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 50%;
  opacity: .82; transition: opacity .15s, transform .12s;
}
.bdv-perm-mini:active { transform: scale(.92); opacity: 1; }
/* 搭子查看页子页切换：训练日历 / 训练数据 */
.bdv-tabs { display:flex; gap:6px; background:var(--card-2); padding:4px; border-radius:14px; margin:14px 0 4px; border:1px solid var(--line); }
.bdv-tab { flex:1; padding:10px; border-radius:10px; font-size:14px; font-weight:700; color:var(--tx-2); transition:all .18s; }
.bdv-tab.on { background:var(--card); color:var(--brand); box-shadow:0 2px 8px rgba(16,24,40,.08); }
.me-msg-bell { position: relative; }
.me-msg-bell .badge-dot {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-elev);
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; }

/* 朋友圈点赞按钮内 文本 / 计数 */
.post-like .like-tx { font-weight: 700; }
.post-like .like-cnt { margin-left: 3px; font-weight: 800; }

/* ============================================================
 * 全局隐藏滚动条（保留全部滚动能力）
 * 覆盖所有浏览器与所有可滚动容器（页面 / Sheet / AI教练对话 / 评论列表等）
 * 仅视觉隐藏，不影响鼠标滚轮 / 触摸 / 键盘上下滑动
 * ============================================================ */
* { scrollbar-width: none !important; -ms-overflow-style: none !important; scrollbar-color: transparent transparent !important; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; background: transparent !important; -webkit-appearance: none !important; }
*::-webkit-scrollbar-thumb, *::-webkit-scrollbar-track, *::-webkit-scrollbar-button, *::-webkit-scrollbar-corner, *::-webkit-resizer { display: none !important; width: 0 !important; height: 0 !important; background: transparent !important; -webkit-appearance: none !important; }
html, body { scrollbar-width: none !important; scrollbar-color: transparent transparent !important; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; background: transparent !important; -webkit-appearance: none !important; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track,
html::-webkit-scrollbar-button, body::-webkit-scrollbar-button,
html::-webkit-scrollbar-corner, body::-webkit-scrollbar-corner { display: none !important; width: 0 !important; height: 0 !important; -webkit-appearance: none !important; }

/* ============================================================
 * 训练日历右上角「分享给教练/搭子」方框按钮入口
 * ============================================================ */
.cal-share-btn {
  display: flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 13px; border-radius: 12px;
  border: none; background: var(--brand-grad); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 4px 14px rgba(255, 70, 70, .28);
  transition: transform .12s ease, box-shadow .18s, filter .18s;
  flex: 0 0 auto;
}
.cal-share-btn .cs-ic { font-size: 15px; line-height: 1; }
.cal-share-btn:active { transform: scale(.94); box-shadow: 0 2px 8px rgba(255, 70, 70, .22); }
.cal-share-btn:hover { filter: brightness(1.06); }

/* 训练日历顶部操作区：训练数据（左）+ 分享（右）并列，统一高度与视觉 */
.cal-top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tb-title { min-width: 0; }
.cal-top-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 14px; border-radius: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .2px; color: var(--tx);
  background: var(--card-2); border: 1px solid var(--line);
  transition: transform .12s ease, background .18s, border-color .18s;
}
.cal-top-btn .ic { font-size: 14px; line-height: 1; }
.cal-top-btn:active { transform: scale(.96); border-color: var(--line-strong); }
.cal-top-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ============ 隐藏评论功能（仅隐藏，云端数据保留，未来可恢复） ============ */
.set-cmt, .set-cmt-day, .set-cmt-q, .cmt-input, .cmt-list, .cmt-new-ic,
.log-cmts, .log-cmt-input, .day-cmt-inline, .day-cmt-btn, #day-cmt-sheet, .day-cmt-box,
.day-cmt, .bd-cmt-btn, #bd-cmt-sheet { display: none !important; }

/* ============ v1.146 训练记录动作手动排序 ============ */
.ex-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-order { display: flex; gap: 4px; flex: none; }
.ex-mv {
  width: 26px; height: 24px; line-height: 1; border: 1px solid #e5e7eb; background: #f1f5f9;
  border-radius: 7px; color: #475569; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.ex-mv:hover { background: #e2e8f0; }
.ex-mv:active { transform: scale(.92); }

/* ============ v1.146 改进建议作者微信 ============ */
.fb-author {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(99, 102, 241, .08); color: #4338ca; font-size: 13px; line-height: 1.6;
}
.fb-author b { letter-spacing: .3px; }

/* ===== 备案底部信息 v1.197 ===== */
#site-footer{
  margin-top:18px;
  padding:14px 16px calc(14px + var(--safe-b));
  text-align:center;
  background:var(--bg);
  border-top:1px solid var(--line);
  font-size:12px; line-height:1.9; color:var(--tx-2);
}
#site-footer .sf-line{ margin:2px 0; }
#site-footer .sf-copy{ opacity:.85; }
#site-footer .sf-beian{ color:var(--tx-2); text-decoration:none; margin-left:4px; }
#site-footer .sf-beian:hover{ color:var(--brand); }
#site-footer .sf-pending{ opacity:.7; }
#site-footer .sf-gongan-ic{ height:13px; vertical-align:-2px; margin-right:4px; }
/* 仅在有底部固定导航的页面（训练日历）避让 tabbar，分享页保持紧凑 */
body:has(#tabbar) #site-footer{ padding-bottom: calc(var(--tabh) + var(--safe-b) + 14px); }
