/* ============ 基础重置 ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #f7f5f2;
  color: #3d3d3d;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ============ 主题变量 ============ */
:root {
  --primary: #5b8c5a;
  --primary-light: #8fb88e;
  --primary-dark: #4a7349;
  --primary-soft: #e8f2e8;
  --secondary: #6b7b8d;
  --secondary-soft: #eef2f6;
  --danger: #c45c4a;
  --danger-soft: #fbe9e6;
  --success: #5b8c5a;
  --success-soft: #e8f2e8;
  --warning: #d4a03c;
  --warning-soft: #fdf3e0;
  --bg: #f7f5f2;
  --card: #ffffff;
  --card-hover: #fafaf8;
  --border: #e8e4de;
  --border-light: #f0ece6;
  --text: #3d3d3d;
  --text-light: #8a8a8a;
  --text-lighter: #b5b5b5;
  --nav-bg: #ffffff;
  --nav-border: #e8e4de;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: all 0.25s var(--ease-out);
}

/* ============ 应用容器 ============ */
#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0));
}

/* ============ 页面切换 ============ */
.page {
  display: none;
  padding: 20px 18px;
  padding-top: 28px;
  animation: pageIn 0.35s var(--ease-out);
}
.page.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 24px;
  padding: 0 2px;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.page-header.with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.greeting {
  color: var(--text-light);
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}

/* ============ 底部导航 ============ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
  z-index: 100;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.04);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px 4px;
  color: var(--text-lighter);
  transition: var(--transition);
  position: relative;
}
.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
  transition: transform 0.3s var(--ease-spring);
}
.nav-item.active {
  color: var(--primary);
}
.nav-item.active::before {
  transform: translateX(-50%) scaleX(1);
}
.nav-item:active {
  transform: scale(0.94);
}
.nav-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 3px;
  transition: transform 0.2s var(--ease-spring);
}
.nav-item.active .nav-icon {
  transform: scale(1.1);
}
.nav-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ============ 首页摘要卡片 ============ */
.summary-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.card {
  flex: 1;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-light);
}
.card:active {
  transform: scale(0.97);
  background: var(--card-hover);
}
.card-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
}
.card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.card-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

/* ============ 快捷按钮 ============ */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  padding: 11px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  letter-spacing: 0.2px;
}
.btn:active {
  transform: scale(0.96);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91,140,90,0.25);
}
.btn-primary:active {
  background: var(--primary-dark);
  box-shadow: 0 1px 4px rgba(91,140,90,0.2);
}
.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary);
}
.btn-secondary:active {
  background: #dcead c;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196,92,74,0.25);
}
.btn-danger:active {
  background: #b04a3a;
}
.btn-ghost {
  background: transparent;
  color: var(--text-light);
}
.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  line-height: 38px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(91,140,90,0.25);
  transition: var(--transition);
}
.btn-icon:active {
  background: var(--primary-dark);
  transform: scale(0.92);
}

/* ============ 工具栏 ============ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.date-input, .search-input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  flex: 1;
  min-width: 140px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.date-input:focus, .search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,140,90,0.12);
}
.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--secondary-soft);
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
}
.chip:active {
  transform: scale(0.95);
}
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(91,140,90,0.2);
}

/* ============ 列表项通用 ============ */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.list-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  animation: itemIn 0.3s var(--ease-out);
}
@keyframes itemIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.list-item:active {
  background: var(--card-hover);
}
.empty-hint {
  text-align: center;
  color: var(--text-light);
  padding: 60px 20px;
  font-size: 14px;
  line-height: 2;
}
.empty-hint::before {
  content: '🌱';
  display: block;
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ============ 计划条目 ============ */
.plan-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.plan-status-dot {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-top: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  transition: var(--transition);
}
.plan-status-dot:active {
  transform: scale(0.9);
}
.plan-status-dot.todo {
  border-color: var(--border);
  background: transparent;
}
.plan-status-dot.doing {
  border-color: var(--warning);
  background: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,160,60,0.3); }
  50%      { box-shadow: 0 0 0 4px rgba(212,160,60,0); }
}
.plan-status-dot.done {
  border-color: var(--success);
  background: var(--success);
}
.plan-item.done .plan-content {
  text-decoration: line-through;
  color: var(--text-lighter);
}
.plan-body {
  flex: 1;
  min-width: 0;
}
.plan-content {
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}
.plan-meta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-light);
}
.priority-tag {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}
.priority-high { background: var(--danger-soft); color: var(--danger); }
.priority-mid  { background: var(--warning-soft); color: var(--warning); }
.priority-low  { background: var(--success-soft); color: var(--success); }
.item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.item-btn {
  padding: 6px 10px;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.item-btn:active {
  background: var(--secondary-soft);
  color: var(--text);
}
.item-btn.danger:active {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ============ 健康条目 ============ */
.health-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.health-main { flex: 1; }
.health-date {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 500;
}
.health-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  font-size: 14px;
}
.health-fields span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.health-fields span b {
  color: var(--text);
  font-weight: 600;
}
.health-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-light);
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
}

/* ============ 书单条目 ============ */
.book-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.book-cover {
  width: 52px;
  height: 70px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e8e0d4, #d4c8b8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #9a8a7a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: var(--transition);
}
.book-item:active .book-cover {
  transform: scale(0.95);
}
.book-body {
  flex: 1;
  min-width: 0;
}
.book-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}
.book-author {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 3px;
}
.book-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.status-tag {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}
.status-wish    { background: var(--secondary-soft); color: var(--secondary); }
.status-reading { background: var(--warning-soft); color: var(--warning); }
.status-done     { background: var(--success-soft); color: var(--success); }
.status-abandon  { background: #f0f0f0; color: var(--text-lighter); }
.stars {
  color: var(--warning);
  font-size: 14px;
  letter-spacing: 2px;
}
.recommend-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--warning-soft);
  color: #d4a03c;
  font-size: 10px;
  font-weight: 500;
  margin-left: 6px;
}
.recommend-section-title {
  font-size: 13px;
  color: var(--text-light);
  padding: 10px 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.book-thought {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-style: italic;
}

/* ============ 复盘条目 ============ */
.review-item { }
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.review-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.review-section {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}
.review-section:last-child { margin-bottom: 0; }
.review-section:nth-child(1) { border-left-color: var(--primary); }
.review-section:nth-child(2) { border-left-color: var(--warning); }
.review-section:nth-child(3) { border-left-color: var(--danger); }
.review-section:nth-child(4) { border-left-color: var(--secondary); }
.review-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.review-section-content {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s var(--ease-out);
  backdrop-filter: blur(4px);
}
.modal-sheet {
  background: var(--card);
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 22px calc(28px + env(safe-area-inset-bottom, 0));
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.35s var(--ease-spring);
  box-shadow: var(--shadow-lg);
}
.modal-sheet.centered {
  border-radius: var(--radius-xl);
  margin: auto;
  width: 88%;
  max-width: 380px;
  align-self: center;
  animation: popIn 0.3s var(--ease-spring);
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text);
}
.modal-field {
  margin-bottom: 16px;
}
.modal-label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 500;
}
.modal-input, .modal-textarea, .modal-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
}
.modal-input:focus, .modal-textarea:focus, .modal-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(91,140,90,0.12);
}
.modal-textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.modal-actions .btn {
  flex: 1;
  text-align: center;
  padding: 12px 20px;
}

/* ============ 确认弹窗 ============ */
.confirm-body {
  text-align: center;
  padding: 16px 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ============ Toast ============ */
#toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.toast {
  background: rgba(50,50,50,0.92);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s var(--ease-spring);
  box-shadow: var(--shadow-md);
  letter-spacing: 0.3px;
}
.toast.hide {
  animation: toastOut 0.25s var(--ease-out) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

/* ============ 区块标题 ============ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 2px 10px;
}
.section-title {
  font-size: 15.5px; font-weight: 600; color: var(--text);
}
.section-add {
  font-size: 13px; color: var(--primary-dark); font-weight: 500;
  padding: 6px 14px; border-radius: var(--radius-full);
  background: var(--primary-soft);
}
.section-add:active { transform: scale(0.97); }

/* ============ 体检关注卡片 ============ */
.report-card {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  border: 1px solid var(--border-light);
}
.report-head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; text-align: left;
}
.report-badge {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--warning-soft); display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.report-head-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.report-title { font-size: 15px; font-weight: 600; color: var(--text); }
.report-sub { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }
.report-chev {
  font-size: 12px; color: var(--primary-dark); background: var(--primary-soft);
  padding: 5px 12px; border-radius: var(--radius-full); flex: none;
}
.report-body { padding: 0 16px 16px; border-top: 1px solid var(--border-light); }

.report-basics {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px 0 10px;
}
.report-basic {
  background: #faf9f7; border-radius: var(--radius-sm); padding: 8px 10px;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.rb-label { font-size: 11.5px; color: var(--text-light); }
.rb-value { font-size: 13.5px; font-weight: 600; color: var(--text); }
.rb-tag {
  font-size: 10.5px; padding: 1px 7px; border-radius: var(--radius-full);
  background: var(--success-soft); color: var(--primary-dark); margin-left: auto;
}

.report-item {
  border-left: 3px solid var(--border); padding: 11px 0 11px 12px; margin-bottom: 2px;
}
.report-item.lv-warn { border-left-color: var(--danger); }
.report-item.lv-watch { border-left-color: var(--warning); }
.report-item.lv-note { border-left-color: var(--primary-light); }
.ri-head { display: flex; align-items: center; gap: 7px; }
.ri-icon { font-size: 15px; }
.ri-title { font-size: 14.5px; font-weight: 600; color: var(--text); flex: 1; }
.ri-level { font-size: 10.5px; padding: 2px 8px; border-radius: var(--radius-full); flex: none; }
.lv-warn .ri-level { background: var(--danger-soft); color: var(--danger); }
.lv-watch .ri-level { background: var(--warning-soft); color: #a8741f; }
.lv-note .ri-level { background: var(--primary-soft); color: var(--primary-dark); }
.ri-detail { font-size: 12.5px; color: var(--text-light); margin-top: 6px; line-height: 1.55; }
.ri-action {
  font-size: 13px; color: var(--text); margin-top: 7px; line-height: 1.55;
  background: #faf9f7; border-radius: var(--radius-sm); padding: 9px 11px;
}
.ri-due { font-size: 11.5px; color: var(--warning); margin-top: 6px; font-weight: 500; }
.ri-state {
  display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: var(--radius-full);
  background: #f2efea; color: var(--text-light); margin-left: 6px; font-weight: 400;
}
.ri-state.now { background: var(--warning-soft); color: #a8741f; }
.ri-state.late { background: var(--danger-soft); color: var(--danger); }

.report-life { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.rl-title { font-size: 12.5px; color: var(--text-light); margin-bottom: 7px; }
.rl-item { font-size: 12.5px; padding: 7px 10px; border-radius: var(--radius-sm); margin-bottom: 6px; }
.rl-item.warn { background: var(--danger-soft); color: #a24a3b; }
.rl-item.ok { background: var(--success-soft); color: var(--primary-dark); }
.report-foot {
  font-size: 11px; color: var(--text-lighter); margin-top: 12px; line-height: 1.6;
  padding-top: 10px; border-top: 1px solid var(--border-light);
}

/* ============ 饮食汇总 ============ */
.diet-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
}
.diet-top { display: flex; align-items: baseline; justify-content: space-between; }
.diet-kcal b { font-size: 26px; font-weight: 700; color: var(--primary-dark); letter-spacing: -0.5px; }
.diet-kcal span { font-size: 12px; color: var(--text-light); }
.diet-date {
  font-size: 11.5px; color: var(--text-light); background: #faf9f7;
  padding: 3px 9px; border-radius: var(--radius-full);
}
.diet-bar {
  height: 7px; border-radius: var(--radius-full); background: #f0ece6;
  margin: 10px 0 6px; overflow: hidden;
}
.diet-bar i { display: block; height: 100%; border-radius: var(--radius-full); transition: width 0.4s var(--ease-out); }
.diet-bar.ok i { background: linear-gradient(90deg, var(--primary-light), var(--primary)); }
.diet-bar.low i { background: linear-gradient(90deg, #e8c98a, var(--warning)); }
.diet-bar.over i { background: linear-gradient(90deg, #e0968a, var(--danger)); }
.diet-hint { font-size: 11.5px; color: var(--text-light); }
.diet-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.macro-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; color: var(--text-light);
}
.macro-line b { font-size: 14px; color: var(--text); font-weight: 600; }
.macro-line i { font-size: 10.5px; font-style: normal; color: var(--text-lighter); margin-left: 1px; }
.macro-bar { height: 4px; border-radius: var(--radius-full); background: #f0ece6; margin: 5px 0 4px; overflow: hidden; }
.macro-bar i { display: block; height: 100%; background: var(--primary-light); border-radius: var(--radius-full); }
.macro-goal { font-size: 10px; color: var(--text-lighter); }

.diet-list { margin-top: 8px; }
.diet-group {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-light); padding: 10px 4px 4px; font-weight: 500;
}
.diet-group span:last-child { color: var(--primary-dark); }
.diet-item { align-items: center; }
.diet-main { flex: 1; min-width: 0; }
.diet-food { font-size: 14.5px; font-weight: 500; color: var(--text); }
.diet-grams {
  font-size: 11px; color: var(--text-light); background: #faf9f7;
  padding: 1px 6px; border-radius: var(--radius-full); margin-left: 6px;
}
.diet-nutri { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* 食物联想 */
.food-suggest { display: none; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.food-chip {
  font-size: 12px; padding: 6px 10px; border-radius: var(--radius-full);
  background: var(--primary-soft); color: var(--primary-dark);
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3;
}
.food-chip i { font-style: normal; font-size: 10px; color: var(--text-light); }
.diet-preview {
  margin-top: 14px; padding: 12px; border-radius: var(--radius-md);
  background: #faf9f7; font-size: 12px; color: var(--text-light); line-height: 1.7;
}
.diet-preview.on { background: var(--primary-soft); color: var(--primary-dark); }
.diet-preview.warn { background: var(--danger-soft); color: #a24a3b; }
.pv-kcal { font-size: 17px; font-weight: 700; margin-left: 4px; }
.pv-p { margin-left: 8px; font-weight: 500; }
.pv-sub { display: block; font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ============ 今日评估 ============ */
.eval-card {
  background: linear-gradient(180deg, #f7faf7, #ffffff);
  border: 1px solid var(--primary-soft); border-radius: var(--radius-lg);
  padding: 16px; margin-top: 14px; box-shadow: var(--shadow-sm);
}
.eval-head { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.eval-head.sub { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.eval-icon { font-size: 16px; }
.eval-summary { font-size: 13px; color: var(--text); line-height: 1.65; margin-top: 8px; }
.eval-body { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.body-chip {
  font-size: 11.5px; padding: 4px 10px; border-radius: var(--radius-full);
  background: #f2efea; color: var(--text-light);
}
.body-chip.ok { background: var(--success-soft); color: var(--primary-dark); }
.body-chip.mid { background: var(--warning-soft); color: #a8741f; }
.body-chip.low { background: var(--danger-soft); color: #a24a3b; }
.sync-tip {
  font-size: 11.5px; color: var(--text-light); background: var(--primary-soft);
  padding: 8px 11px; border-radius: var(--radius-sm); margin: 2px 0 14px; line-height: 1.5;
}
.eval-advice { margin-top: 8px; }
.eval-advice li { display: flex; gap: 8px; font-size: 13px; line-height: 1.6; color: var(--text); margin-bottom: 9px; }
.eval-advice li span:last-child { flex: 1; }
.advice-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary-light);
  flex: none; margin-top: 8px;
}

/* ============ 表单内部：两列 ============ */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 380px) {
  .row-2 { grid-template-columns: 1fr; }
}

/* ============ 健康日期切换 ============ */
.health-date-switch {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 12px;
}
.date-nav {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border-light);
  color: var(--text); font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
  flex: none;
}
.date-nav:active { transform: scale(0.92); }
.date-display {
  flex: 1; text-align: center; font-size: 14px; font-weight: 600; color: var(--text);
}
.date-today {
  font-size: 12px; padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--primary-soft); color: var(--primary-dark);
}

/* ============ 当日健康记录卡片 ============ */
.hr-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
}
.hr-fields {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 6px;
}
.hr-field {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 10px; background: #faf9f7; border-radius: var(--radius-sm);
  gap: 2px;
}
.hr-icon { font-size: 13px; }
.hr-label { font-size: 11px; color: var(--text-light); }
.hr-value { font-size: 14px; font-weight: 600; color: var(--text); }
.hr-sport { font-size: 13px; color: var(--text); margin-top: 10px; padding: 8px 10px; background: #faf9f7; border-radius: var(--radius-sm); }
.hr-note { font-size: 13px; color: var(--text); line-height: 1.55; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.hr-card .item-actions { margin-top: 12px; justify-content: flex-end; }

/* ============ 趋势图 ============ */
.trend-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
}
.trend-tabs {
  display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.trend-tab {
  font-size: 12px; padding: 5px 12px; border-radius: var(--radius-full);
  background: #f2efea; color: var(--text-light);
}
.trend-tab.active { background: var(--primary); color: #fff; }
.trend-meta {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px;
}
.trend-cur { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.trend-delta { font-size: 12px; padding: 2px 8px; border-radius: var(--radius-full); }
.trend-delta.down { background: var(--success-soft); color: var(--primary-dark); }
.trend-delta.up { background: var(--danger-soft); color: var(--danger); }
.trend-delta.flat { background: #f2efea; color: var(--text-light); }
.trend-chart svg { display: block; }
.trend-empty { text-align: center; font-size: 12px; color: var(--text-lighter); padding: 20px 0; }

/* ============ 星级 ============ */
.star-rating {
  display: inline-flex;
  gap: 6px;
  padding: 4px 0;
}
.star-btn {
  font-size: 26px;
  color: #e0dcd6;
  padding: 0 2px;
  transition: var(--transition);
  cursor: pointer;
}
.star-btn:active {
  transform: scale(1.2);
}
.star-btn.active {
  color: var(--warning);
  text-shadow: 0 0 8px rgba(212,160,60,0.3);
}

/* ============ 开关 ============ */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text);
}
.switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: #ddd;
  border-radius: var(--radius-full);
  transition: var(--transition);
  cursor: pointer;
}
.switch.on {
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(91,140,90,0.25);
}
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.25s var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.switch.on .switch-knob {
  left: 25px;
}

/* ============ 首页特殊样式 ============ */
#page-home .page-header {
  margin-bottom: 28px;
}
#page-home .page-header h1 {
  font-size: 26px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============ 微信读书区块 ============ */
#weread-section {
  margin-bottom: 20px;
}
.weread-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 4px 10px;
}
.weread-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}
.weread-header-title em {
  font-style: normal;
  color: var(--primary);
}
.weread-sync-time {
  font-size: 11px;
  color: var(--text-lighter);
}
.weread-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 10px;
  overflow: hidden;
  animation: itemIn 0.3s var(--ease-out);
}
.weread-book {
  display: flex;
  gap: 12px;
  padding: 14px 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.weread-book:active {
  background: var(--card-hover);
}
.weread-cover {
  width: 48px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  background: linear-gradient(135deg, #e8e0d4, #d4c8b8);
}
.weread-info {
  flex: 1;
  min-width: 0;
}
.weread-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.weread-author {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weread-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.weread-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}
.weread-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 3px;
  transition: width 0.6s var(--ease-out);
}
.weread-progress-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
}
.weread-meta-line {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 5px;
}
.weread-go {
  flex-shrink: 0;
  color: var(--text-lighter);
  font-size: 20px;
  padding: 0 2px;
}
.weread-marks-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 9px 14px;
  font-size: 12px;
  color: var(--text-light);
  border-top: 1px solid var(--border-light);
  background: var(--card-hover);
  transition: var(--transition);
}
.weread-marks-toggle:active {
  background: var(--secondary-soft);
}
.weread-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-lighter);
}
.weread-marks {
  padding: 4px 14px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--card-hover);
}
.weread-mark-chapter {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-lighter);
  margin: 10px 0 6px;
}
.weread-mark {
  padding: 9px 11px;
  margin-bottom: 6px;
  background: var(--card);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.weread-mark-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.weread-mark-date {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 4px;
  text-align: right;
}
.weread-marks-more {
  display: block;
  width: 100%;
  padding: 7px 0 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  text-align: center;
  transition: var(--transition);
}
.weread-marks-more:active {
  opacity: 0.6;
}

/* ============ 全部划线弹窗 ============ */
.marks-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.marks-chapter-select {
  position: relative;
  flex: 1;
  min-width: 0;
}
.marks-chapter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.marks-chapter-btn:active {
  border-color: var(--primary);
}
.marks-chapter-btn-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marks-chapter-btn-arrow {
  font-size: 10px;
  color: var(--text-lighter);
  flex-shrink: 0;
}
.marks-chapter-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 40vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  padding: 4px;
}
.marks-chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--text);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: var(--transition);
}
.marks-chapter-item:active {
  background: var(--secondary-soft);
}
.marks-chapter-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.marks-chapter-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marks-chapter-item-count {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-lighter);
}
.marks-chapter-item.active .marks-chapter-item-count {
  color: var(--primary);
}
.marks-jump {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.marks-jump-input {
  width: 92px;
  padding: 9px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.marks-jump-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,140,90,0.12);
}
.marks-jump-btn {
  padding: 9px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(91,140,90,0.25);
  transition: var(--transition);
}
.marks-jump-btn:active {
  background: var(--primary-dark);
  transform: scale(0.96);
}
.marks-modal-list {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 2px;
}
.marks-modal-chapter {
  position: sticky;
  top: -1px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-lighter);
  background: var(--card);
  padding: 8px 2px 6px;
  margin-top: 4px;
  z-index: 1;
}
.marks-modal-chapter:first-child {
  margin-top: 0;
  padding-top: 2px;
}
.marks-modal-chapter span {
  font-weight: 400;
  font-size: 11px;
  flex-shrink: 0;
}
.marks-modal-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--card-hover);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.marks-modal-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.marks-modal-date {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 6px;
  text-align: right;
}
.weread-tip {
  font-size: 11px;
  color: var(--text-lighter);
  text-align: center;
  padding: 6px 10px 2px;
  line-height: 1.6;
}

/* ============ 推荐入口横幅 ============ */
.rec-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fdf6e3, #fcefe0);
  border: 1px solid #f3e3c3;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  animation: itemIn 0.3s var(--ease-out);
}
.rec-banner:active {
  transform: scale(0.98);
  background: linear-gradient(135deg, #fbf0d4, #fae7d2);
}
.rec-banner-icon {
  font-size: 20px;
  line-height: 1;
}
.rec-banner-text {
  flex: 1;
  text-align: left;
  font-size: 13px;
  color: #8a6d3b;
  line-height: 1.4;
}
.rec-banner-text em {
  font-style: normal;
  font-weight: 700;
  color: var(--warning);
}
.rec-banner-go {
  color: #c9a86a;
  font-size: 20px;
  line-height: 1;
}

/* ============ 推荐书籍卡片 ============ */
.rec-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.rec-card:active {
  background: var(--card-hover);
}
.rec-cover {
  width: 52px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #f6e8d8, #ecd9c0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.rec-cat {
  font-size: 9px;
  color: #a08464;
  margin-top: 3px;
}
.rec-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.rec-score {
  font-size: 15px;
  font-weight: 700;
  color: var(--warning);
  line-height: 1;
}
.rec-stars {
  font-size: 11px;
  color: var(--warning);
  letter-spacing: 1px;
}
.rec-reason {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  padding: 8px 10px;
  background: var(--card-hover);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============ 滚动条美化 ============ */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-lighter);
}
