/* ============================================================
   移动端适配 / 新版布局组件 / AI 工作台 / 任务清单 / 财务 / 回收站
   由 style.css 按原顺序拆分，层叠顺序未变
   引用顺序：base → modules → pages，不要调换
   ============================================================ */

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: none; }

  .site-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--bg-alt);
    border-bottom: none;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 60;
  }

  .site-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 10px;
    padding: 4px 1px;
    border-radius: 10px;
  }

  .site-nav .nav-icon { display: none; }
  body { padding-bottom: 70px; }

  .section { padding: 48px 0; }
  .page-head { padding: 44px 0 32px; }
}

/* ===== 新版布局组件 ===== */
.nav-icon { display: none; }

.hero-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
}
.hero-num {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.15;
}
.hero-num.locked-num { font-size: 2.2rem; }
.hero-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.dual-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dual-hero.single { grid-template-columns: 1fr; }

.diamond-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.diamond-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 4px;
  border-radius: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s ease;
}
.diamond-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.diamond-icon { font-size: 1.7rem; line-height: 1; }
.diamond-label { font-size: 0.8rem; }
.diamond-item.disabled { opacity: 0.55; cursor: not-allowed; }
.diamond-item.disabled:hover { transform: none; border-color: var(--border); }
.diamond-item.disabled .diamond-label::after { content: ' · 开发中'; color: var(--text-muted); }

.entry-stream { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .entry-stream { grid-template-columns: 1fr 1fr; } }

.group-list {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.group-head {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.group-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.group-row:last-child { border-bottom: none; }
.group-row .row-label { font-size: 0.9rem; }
.group-row .row-desc { width: 100%; color: var(--text-muted); font-size: 0.8rem; }

/* ===== AI 工作台 ===== */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
@media (max-width: 820px) { .chat-layout { grid-template-columns: 1fr; } }
.conv-side { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.conv-side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; }
.conv-list { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.conv-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.conv-item:hover { background: rgba(255, 255, 255, 0.05); }
.conv-item.active { border-color: var(--accent); background: var(--accent-soft); }
.conv-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conv-title { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 0.72rem; color: var(--text-muted); }
.conv-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; padding: 2px 4px; }
.conv-del:hover { color: #f87171; }

.chat-main { display: flex; flex-direction: column; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 420px; }
.msg-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-height: 520px; min-height: 300px; }
.ai-welcome { text-align: center; margin: auto; color: var(--text-muted); max-width: 420px; line-height: 1.7; }
.msg-row { display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant { justify-content: flex-start; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; line-height: 1.65; font-size: 0.95rem; }
.msg-row.user .bubble { background: var(--accent); color: #04121f; border-bottom-right-radius: 4px; }
.msg-row.assistant .bubble { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble code { background: rgba(0, 0, 0, 0.25); padding: 1px 5px; border-radius: 5px; font-size: 0.85em; }
.code-block { background: #0b1220; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 0.82rem; line-height: 1.5; margin: 6px 0; }
.md-li { margin: 2px 0; }
.cursor { animation: blink 1s step-start infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.input-row { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.input-row textarea {
  flex: 1;
  resize: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  max-height: 160px;
}
.input-row textarea:focus { outline: none; border-color: var(--accent); }

/* ===== 今日复习（间隔重复） ===== */
.review-box { display: flex; flex-direction: column; gap: 10px; }
.review-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--bg-alt); }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 4px; }
.review-date { font-size: 0.85rem; color: var(--text-muted); }
.review-stage { font-size: 0.78rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
.review-body { font-size: 0.95rem; line-height: 1.6; margin: 4px 0; }
.review-fey { font-size: 0.88rem; color: var(--text-muted); background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; margin: 4px 0; }
.review-hidden { filter: blur(6px); user-select: none; pointer-events: none; }
.review-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ===== 日记照片 ===== */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; align-items: center; }
.photo-thumb-wrap { position: relative; width: 84px; height: 84px; }
.photo-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.photo-del {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #c93a3f; color: #fff; border: 2px solid var(--bg-alt);
  cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
}
.photo-badge { font-size: 0.75rem; color: var(--text-muted); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-grid img.photo-cell {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 10px; cursor: zoom-in; border: 1px solid var(--border);
}
.photo-viewer {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92); z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
}
.photo-viewer img { max-width: 96%; max-height: 86vh; border-radius: 10px; }

/* ===== 手机体验优化 ===== */
@media (max-width: 720px) {
  .btn { min-height: 44px; }
  .icon-btn { min-height: 40px; min-width: 40px; }
  .toolbar-row { flex-wrap: wrap; }
  .toolbar-row .text-input { flex: 1 1 100%; }
  .toolbar-row .btn { flex: 0 0 auto; }
  .mode-row { gap: 6px; }
  .mode-btn { padding: 8px 12px; font-size: 13px; }
  .hero-num { font-size: 2.2rem; }
  .page-head { padding: 32px 0 24px; }
  .page-head h1 { font-size: 1.5rem; }
  .section { padding: 32px 0; }
  .diamond-grid { gap: 10px; }
  .diamond-icon { font-size: 1.5rem; }
  .calendar-card { padding: 12px; }
  .calendar-grid .cell { min-height: 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dual-hero { gap: 10px; }
  /* 编辑/详情弹层改为底部抽屉，手机更好操作 */
  .editor-overlay { padding: 0; align-items: flex-end; }
  .editor-overlay .editor-box {
    width: 100%; max-width: 100%; border-radius: 20px 20px 0 0;
    max-height: 92dvh; overflow-y: auto;
  }
  .lock-overlay .lock-box { width: 92%; padding: 24px 20px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  /* 防 iOS 聚焦输入框自动放大 */
  input, textarea, select { font-size: 16px; }
}

/* ===== 任务清单：纸墨账本风格（细横线 + 方框勾选 + 朱红优先级竖线） ===== */
.task-panel { display: flex; flex-direction: column; }
.task-toolbar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 6px; }
.task-toolbar .text-input {
  flex: 1; border: none; border-bottom: 1px solid var(--border);
  background: transparent; border-radius: 0; padding: 10px 2px 8px;
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1rem; color: var(--text);
}
.task-toolbar .text-input:focus { border-bottom-color: var(--accent); }
.task-toolbar .btn-primary { border-radius: 6px; padding: 9px 18px; }

.task-list { display: flex; flex-direction: column; }
.task-group { border-top: 1px solid var(--border); }
.task-group:first-child { border-top: none; }
.task-group-title {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 0.8rem; color: var(--text-muted); margin: 14px 0 0;
  letter-spacing: 0.1em;
}
.task-group-title::before { content: "·"; color: var(--accent); margin-right: 6px; }

.task-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
  background: transparent; border-radius: 0;
  position: relative;
}
.task-row:last-child { border-bottom: none; }
.task-check {
  width: 24px; height: 24px; flex: 0 0 auto; margin-top: 0;
  border: 1.5px solid #c9bfa9; border-radius: 4px;
  background: transparent; color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; line-height: 1;
}
.task-row.done .task-check { border-color: var(--accent); }
.task-title { flex: 1; word-break: break-word; font-size: 1rem; line-height: 1.5; }
.task-row.done .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-row.pri-high { padding-left: 10px; }
.task-row.pri-high::before {
  content: ''; position: absolute; left: 0; top: 15px; bottom: 15px;
  width: 3px; background: var(--accent); border-radius: 2px;
}
.task-row.pri-low .task-title { color: var(--text-muted); }

.task-meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-muted); white-space: nowrap;
}
.task-pri { color: var(--text-muted); }
.task-row.pri-high .task-pri { color: var(--accent); }
.task-due.overdue { color: var(--accent); }
.task-repeat { color: var(--accent); }
.task-subcount { color: var(--text-muted); }
.task-open, .task-del, .task-forget {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.95rem; padding: 6px 8px; line-height: 1;
  min-width: 24px; min-height: 24px;
  opacity: 0.35; transition: opacity 0.15s ease, color 0.15s ease;
}
.task-row:hover .task-open, .task-row:hover .task-del, .task-row:hover .task-forget { opacity: 1; }
.task-del:hover, .task-forget:hover { color: var(--accent); }
.task-open:hover { color: var(--text); }

/* 详情面板 */
#taskDetail .editor-box { display: flex; flex-direction: column; gap: 6px; }
#taskDetail label { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
#taskDetail .editor-row { display: flex; gap: 10px; }
#taskDetail .editor-row > div { flex: 1; }
.td-subs { display: flex; flex-direction: column; margin-top: 4px; }
.td-sub {
  display: flex; align-items: center; gap: 10px; padding: 8px 2px;
  border-bottom: 1px solid var(--border);
}
.td-sub:last-child { border-bottom: none; }
.td-sub-check {
  width: 18px; height: 18px; border: 1.5px solid #c9bfa9; border-radius: 4px;
  background: transparent; color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1; font-size: 0.75rem;
}
.td-sub-title { flex: 1; font-size: 0.9rem; }
.td-sub-del { background: none; border: none; color: var(--text-muted); cursor: pointer; }
#td-pri, #td-repeat { width: 100%; }

@media (max-width: 720px) {
  #taskDetail { padding: 0; align-items: flex-end; }
  #taskDetail .editor-box {
    width: 100%; max-width: 100%; border-radius: 20px 20px 0 0;
    max-height: 92dvh; overflow-y: auto;
  }
  .task-open, .task-del, .task-forget { opacity: 0.55; }
}

/* ===== 复习任务（并入任务清单，纸墨版） ===== */
.task-titlewrap { flex: 1; min-width: 0; }
.task-row.review .task-title { cursor: pointer; }
.task-row.review .task-title:hover { color: var(--accent); }
.rv-detail {
  margin-top: 8px; padding: 10px 14px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem; line-height: 1.7; word-break: break-word;
}
.rv-detail[hidden] { display: none; }
.rv-fey { margin-top: 6px; color: var(--accent); }
.review-stage { color: var(--accent); }
.review-hint { color: var(--text-muted); opacity: 0.75; }

/* ===== 首页「今日」区块 ===== */
.today-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.today-block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.today-stats {
  font-size: 0.85rem; color: var(--text-muted);
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
}
.today-block .checkin-btn {
  width: 100%; padding: 14px; font-size: 1.05rem;
  letter-spacing: 0.06em;
}

/* ===== Steam 顶部统计 ===== */
.steam-stats {
  display: flex; gap: 12px; margin: 14px 0;
  flex-wrap: wrap;
}
.steam-stat {
  flex: 1; min-width: 110px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: center;
  box-shadow: none;
}
.ss-num {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1.35rem; font-weight: 700; color: var(--text);
  display: block;
}
.ss-label { font-size: 0.8rem; color: var(--text-muted); }

/* ===== 财务中心 ===== */
.fin-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.fin-card {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: none;
  display: flex; flex-direction: column; gap: 4px;
}
.fin-label { font-size: 0.8rem; color: var(--text-muted); }
.fin-num {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1.3rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}
.fin-sub { font-size: 1rem; margin: 20px 0 8px; color: var(--text); font-weight: 700; }
.fin-list { display: flex; flex-direction: column; }
.fin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--border);
  position: relative;
}
.fin-row:last-child { border-bottom: none; }
.fin-row.muted { opacity: 0.55; }
.fin-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-cat { font-weight: 700; font-size: 0.95rem; }
.fin-merchant { font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.fin-amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1rem; }
.fin-amount.pos { color: var(--success); }
.fin-amount.neg { color: var(--text); }
.fin-amount.refund { color: var(--text-muted); }
.fin-date { font-size: 0.78rem; color: var(--text-muted); }
.fin-edit, .fin-del {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.85rem; padding: 4px 6px; opacity: 0.4;
}
.fin-row:hover .fin-edit, .fin-row:hover .fin-del { opacity: 1; }
.fin-del:hover { color: var(--danger); }
.fin-edit:hover { color: var(--text); }

.budget-row { padding: 10px 2px; border-bottom: 1px solid var(--border); position: relative; }
.budget-row:last-child { border-bottom: none; }
.budget-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.budget-cat { font-weight: 700; }
.budget-nums { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.budget-nums .over { color: var(--danger); font-weight: 700; }
.budget-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.budget-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.2s ease; }
.budget-del { position: absolute; right: 2px; top: 10px; }

.csv-map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.csv-map-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-muted); }

@media (max-width: 720px) {
  .fin-hero { grid-template-columns: repeat(2, 1fr); }
  .csv-map-grid { grid-template-columns: 1fr; }
  .fin-edit, .fin-del { opacity: 0.55; }
}

/* ===== 回收站 ===== */
.trash-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-alt);
}
.trash-main { flex: 1; min-width: 0; }
.trash-date { font-size: 0.8rem; color: var(--text-muted); margin-right: 8px; }
.trash-title { font-weight: 700; }
.trash-preview {
  display: block; font-size: 0.85rem; color: var(--text-muted);
  margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trash-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 720px) {
  .trash-item { flex-direction: column; align-items: flex-start; }
  .trash-actions { width: 100%; }
}

/* 财务：分类排行 */
.cat-row { padding: 9px 2px; border-bottom: 1px solid var(--border); }
.cat-row:last-child { border-bottom: none; }
.cat-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.cat-name { font-weight: 700; }
.cat-num { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cat-num.pos { color: var(--success); font-weight: 700; }

/* 财务：环形饼图 */
.pie-wrap {
  display: flex; align-items: center; gap: 26px;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  flex-wrap: wrap;
}
.pie-chart-box { width: 200px; height: 200px; flex: 0 0 200px; }
.pie-total {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 13px; font-weight: 700; fill: var(--text);
}
.pie-sub { font-size: 8px; fill: var(--text-muted); }
.pie-legend { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 9px; }
.pie-leg-item { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.pie-leg-name { flex: 1; }
.pie-leg-val { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
@media (max-width: 720px) {
  .pie-wrap { flex-direction: column; align-items: stretch; gap: 14px; }
  .pie-chart-box { width: 100%; height: 190px; flex: none; }
}

/* ===== 运动模块 ===== */
.sport-type-row { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; padding: 2px 0; }
.sport-type-pill {
  flex: 0 0 auto; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-alt); color: var(--text);
  font-size: 0.95rem; cursor: pointer; white-space: nowrap;
}
.sport-type-pill.active { background: var(--text); color: var(--bg-alt); border-color: var(--text); }
.sport-quick-row { display: flex; gap: 8px; }
.sport-quick-row .text-input { flex: 1; }
.sport-quick-presets { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.sport-preset {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-alt); color: var(--text-muted); font-size: 0.8rem; cursor: pointer;
}
.sport-preset:active { background: var(--accent-soft); color: var(--accent); }

.sport-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: 2px; vertical-align: top; }
.cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }

.sport-set-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.sport-set-row .text-input { width: 0; min-width: 0; padding: 9px 10px; }
.sport-set-row .set-ex { flex: 2 1 0; }
.sport-set-row .set-reps, .sport-set-row .set-weight { flex: 1 1 0; }
.sport-sets { margin-top: 6px; }

/* ===== 更多抽屉 + 导航按钮 ===== */
.nav-more {
  background: none; border: none; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; color: var(--text-muted);
  font-size: 0.95rem;
}
.nav-more:hover { color: var(--text); background: var(--accent-soft); }
.nav-more.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-group-title { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin: 14px 0 6px; }
.more-group-title:first-child { margin-top: 0; }
@media (max-width: 720px) {
  .more-grid { grid-template-columns: repeat(2, 1fr); }
}
.more-item {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--bg-alt);
}
.more-item .mi { color: var(--text-muted); font-size: 1.05rem; }
.more-item:hover { border-color: var(--accent); }
@media (max-width: 720px) {
  .nav-more { padding: 4px 1px; font-size: 10px; }
  .nav-more .nav-icon { display: none; }
}

/* ===== 数据页 ===== */
.data-grid { display: flex; flex-direction: column; gap: 12px; }
.data-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--bg-alt);
}
.data-icon { font-size: 1.35rem; color: var(--accent); }
.data-info { flex: 1; min-width: 0; }
.data-info h3 { margin: 0 0 2px; font-size: 1.05rem; }
.data-snap { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.data-enter { color: var(--text-muted); font-size: 1.2rem; }
.data-card:hover { border-color: var(--accent); }

/* ===== 首页今日工作台 ===== */
.state-strip {
  display: flex; align-items: baseline; gap: 8px;
  padding: 14px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-alt);
}
.state-strip-label { color: var(--text-muted); font-size: 0.95rem; }
.state-strip-num { font-size: 1.6rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.state-strip-unit { color: var(--text-muted); font-size: 0.85rem; }

.snapshot-row { display: flex; gap: 10px; }
.snap-item {
  flex: 1; text-align: center; padding: 14px 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-alt);
}
.snap-num { display: block; font-size: 1.35rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.snap-label { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.78rem; }

.fab {
  position: fixed; right: 18px; bottom: 82px; z-index: 70;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--text); color: var(--bg-alt);
  border: none; font-size: 1.5rem; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow);
}
.fab-menu {
  position: fixed; right: 18px; bottom: 144px; z-index: 70;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.fab-item {
  padding: 10px 16px; border-radius: 999px;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); text-decoration: none;
  font-size: 0.9rem; cursor: pointer; box-shadow: var(--shadow);
}

/* ============ 运动计划（v4） ============ */
.plan-weeks { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin: 12px 0; }
.plan-week {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.75rem; color: var(--text-muted); background: var(--bg-alt);
}
.plan-week b { font-size: 0.8rem; color: var(--text); }
.plan-week.part { background: var(--accent-soft); }
.plan-week.full { background: var(--accent-soft); border-color: var(--accent); }
.plan-week.now { border-color: var(--accent); color: var(--accent); }
.plan-week.now b { color: var(--accent); }

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.plan-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-muted); }

.plan-task { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 0.9rem; line-height: 1.5; }
.plan-task input { margin-top: 4px; flex: none; }

.plan-check { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.plan-check:last-child { border-bottom: none; }
.plan-check b { font-size: 0.92rem; }
.plan-check ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 0.86rem; line-height: 1.6; }

.plan-log-form { display: grid; grid-template-columns: 1fr 0.9fr; gap: 8px; }
.plan-log-form .text-input { width: 100%; }
.plan-log-form .btn { grid-column: 1 / -1; }
.plan-log-form select.text-input { background: var(--bg-alt); }

.plan-rules { margin: 8px 0 0; padding-left: 18px; font-size: 0.88rem; line-height: 1.7; color: var(--text-muted); }

@media (max-width: 640px) {
  .plan-weeks { grid-template-columns: repeat(4, 1fr); }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-log-form { grid-template-columns: 1fr; }
}
.plan-task input[type="checkbox"] { width: 16px; height: 16px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }

.plan-start-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-start-row .toolbar-row { margin: 0; }
.plan-log-form .btn { grid-column: auto; }

.plan-hint-line { margin: 4px 0 0; font-size: 0.82rem; color: var(--text-muted); }

/* 今日计划卡 + 日历计划标记 */
.today-plan { background: var(--bg-alt); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.today-plan.rest { border-color: var(--border); }
.today-plan-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.today-plan-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.today-plan-actions .btn { white-space: nowrap; }
.today-done-tag { color: var(--accent); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.today-plan-head b { font-size: 0.92rem; }
.plan-badge { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.75rem; }
.today-plan-title { margin: 8px 0 4px; font-weight: 700; }
.today-plan-items { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 0.88rem; line-height: 1.7; }
.sport-ring { display: inline-block; width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--accent); margin-left: 2px; vertical-align: top; }
.plan-migrate { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--accent); border-radius: 10px; font-size: 0.86rem; }

/* 已完成折叠条：完成的从列表消失，只留一行计数 */
.task-done-wrap { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.task-done-wrap summary { cursor: pointer; font-size: 0.85rem; color: var(--text-muted); list-style: none; }
.task-done-wrap summary::-webkit-details-marker { display: none; }
.task-done-wrap summary::before { content: "✓ "; color: var(--accent); }
.task-done-wrap[open] summary { margin-bottom: 6px; }

/* 删除撤销条 */
.task-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  background: var(--text); color: var(--bg-alt);
  padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
  font-size: 0.88rem; z-index: 90; max-width: calc(100vw - 32px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.task-toast.out { opacity: 0; transform: translateX(-50%) translateY(8px); }
.task-toast-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-toast-undo { background: none; border: 1px solid var(--bg-alt); color: var(--bg-alt); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 0.82rem; }

/* 运动记录：一行摘要 + 点开明细 */
.sport-record-detail { padding: 2px 12px 10px; border-bottom: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); }
.sport-record-detail ul { margin: 0 0 4px; padding-left: 18px; line-height: 1.7; }
.sport-record-detail p { margin: 2px 0; }

/* 近 8 周趋势 */
.sport-trend { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px 4px; }
.trend-bar-s { fill: var(--accent); }
.trend-bar-c { fill: var(--accent); opacity: 0.35; }
.trend-label { font-size: 6px; fill: var(--text-muted); }

.trend-svg { width: 100%; height: auto; display: block; }
.trend-slot { fill: var(--bg); }
.trend-label { font-size: 12px; fill: var(--text-muted); }

/* 部位徽章 + 更多折叠 */
.area-tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; font-style: normal; }
.more-inner { margin-top: 6px; }
.more-inner .week-card { margin-top: 8px !important; }

/* 移动端：输入框字号不低于 16px，避免聚焦时浏览器自动缩放 */
@media (max-width: 720px) {
  input, textarea, select { font-size: 16px !important; }
}

/* App 内：隐藏网页自己的底部导航，避免和原生 tab 叠成两条 */
html.in-app .site-nav { display: none !important; }
html.in-app body { padding-bottom: 0 !important; }


/* 只在 App 的 WebView 里显示的行（html.in-app 由页面 head 里的 UA 判断加上） */
.in-app-only { display: none; }
html.in-app .in-app-only { display: flex; }
