/* ============================================
   小青梅的工作台 — 深绿色主题
   移动端仿APP单页工作台
   ============================================ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --green-dark: #1b5e20;
  --green-deep: #2e7d32;
  --green-mid:  #43a047;
  --green-light: #66bb6a;
  --mint-bg:    #e8f5e9;
  --mint-light: #f1f8f4;
  --cream:      #fffdf7;
  --gold:       #d4a843;
  --gold-light: #e6c068;
  --orange:     #ff8a65;
  --pink:       #f48fb1;
  --card-bg:    #ffffff;
  --text-main:  #1a3c1a;
  --text-sub:   #5a7a5a;
  --text-light: #9ab09a;
  --border:     #e0eee0;
  --shadow:     0 2px 12px rgba(27, 94, 32, 0.06);
  --shadow-md:  0 4px 20px rgba(27, 94, 32, 0.08);
  --radius:     16px;
  --radius-sm:  10px;
  --sidebar-w:  68px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #d7eedd;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ===== App 容器 (手机模拟) ===== */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  background: var(--mint-bg);
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* ===== 左侧导航栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--green-dark) 0%, var(--green-deep) 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  flex-shrink: 0;
}
.sidebar::-webkit-scrollbar { width: 0; }

.sidebar-logo {
  text-align: center;
  padding: 14px 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 4px;
}

.nav-list { list-style: none; flex: 1; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border-radius: 12px;
  margin: 2px 6px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); }
.nav-item.active {
  background: rgba(102, 187, 106, 0.35);
  box-shadow: inset 0 0 0 1px rgba(102,187,106,0.3);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--gold-light);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 22px;
  height: 22px;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}
.nav-item.active .nav-icon { color: #fff; }
.nav-item span {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  line-height: 1.2;
  transition: color 0.2s;
}
.nav-item.active span { color: #fff; font-weight: 600; }

/* ===== 主内容区 ===== */
.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
  padding: 0 12px 24px;
}

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 页面头部 ===== */
.page-header {
  padding: 16px 4px 12px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-dark);
}
.page-sub {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-slogan {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  color: #fff;
}
.slogan-date {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 6px;
}
.slogan-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}
.card-link {
  font-size: 12px;
  color: var(--green-mid);
  cursor: pointer;
}
.badge {
  background: var(--mint-bg);
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}

/* ===== 进度环 ===== */
.progress-row { display: flex; align-items: center; gap: 16px; }
.progress-ring {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--mint-bg); stroke-width: 7; }
.ring-fg {
  fill: none;
  stroke: var(--green-mid);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 213.6;
  stroke-dashoffset: 213.6;
  transition: stroke-dashoffset 0.5s ease;
}
.ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
}
.progress-info { display: flex; gap: 20px; }
.progress-stat { text-align: center; }
.progress-stat .stat-num {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--green-dark);
}
.progress-stat .stat-label {
  font-size: 11px;
  color: var(--text-light);
}

/* ===== 进度条 ===== */
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--mint-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar {
  height: 100%;
  background: var(--green-mid);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.calorie-bar { background: var(--orange); }

/* ===== 快捷入口网格 ===== */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--mint-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-item:active { transform: scale(0.96); background: var(--mint-bg); }
.quick-emoji { font-size: 24px; }
.quick-item span:last-child {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}

/* ===== 数据统计网格 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-box {
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.stat-box .stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.stat-box .stat-value {
  display: block;
  font-size: 17px;
  font-weight: 700;
}
.stat-box.income { background: #e8f5e9; }
.stat-box.income .stat-value { color: var(--green-dark); }
.stat-box.expense { background: #fff3e0; }
.stat-box.expense .stat-value { color: var(--orange); }
.stat-box.balance { background: #fce4ec; }
.stat-box.balance .stat-value { color: var(--pink); }
.stat-box.month { background: #f3e5f5; }
.stat-box.month .stat-value { color: #8e24aa; }
.stat-box.exercise { background: #e0f7fa; }
.stat-box.exercise .stat-value { color: #00838f; }
.stat-box.diet { background: #fff8e1; }
.stat-box.diet .stat-value { color: var(--gold); }

/* ===== 倒计时项 ===== */
.countdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.countdown-item:last-child { border-bottom: none; }
.countdown-name {
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}
.countdown-type {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--mint-bg);
  color: var(--green-deep);
}
.countdown-days {
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
}
.countdown-days.urgent { color: var(--orange); }
.countdown-days .day-unit { font-size: 12px; font-weight: 400; }

/* ===== 热点列表 ===== */
.hotspot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.hotspot-item:last-child { border-bottom: none; }
.hotspot-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hotspot-tag.gold { background: #fff8e1; color: var(--gold); }
.hotspot-tag.pink { background: #fce4ec; color: var(--pink); }
.hotspot-tag.green { background: #e8f5e9; color: var(--green-dark); }
.hotspot-tag.blue { background: #e3f2fd; color: #1565c0; }
.hotspot-tag.orange { background: #fff3e0; color: var(--orange); }
.hotspot-text { font-size: 12px; color: var(--text-sub); line-height: 1.4; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 5px;
  font-weight: 500;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-main);
  background: var(--mint-light);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green-light);
  background: #fff;
}
.form-input.full, .form-select.full { width: 100%; }
.form-textarea {
  min-height: 64px;
  resize: vertical;
}
.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.form-row .form-input, .form-row .form-select { flex: 1; }
.form-file {
  font-size: 12px;
  color: var(--text-sub);
}
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-toggle {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  background: var(--mint-light);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-toggle.active {
  background: var(--green-deep);
  color: #fff;
  border-color: var(--green-deep);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-family: inherit;
}
.btn-primary {
  background: var(--green-deep);
  color: #fff;
}
.btn-primary:active { background: var(--green-dark); transform: scale(0.98); }
.btn-sm {
  width: auto;
  padding: 4px 12px;
  font-size: 12px;
}
.btn-danger {
  background: #ffebee;
  color: #c62828;
}

/* ===== 任务列表 ===== */
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--green-light);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.task-check.done {
  background: var(--green-mid);
  border-color: var(--green-mid);
}
.task-check.done::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.task-content { flex: 1; min-width: 0; }
.task-name {
  font-size: 13px;
  color: var(--text-main);
  word-break: break-word;
}
.task-item.done .task-name {
  text-decoration: line-through;
  color: var(--text-light);
}
.task-priority {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 500;
}
.task-priority.普通 { background: #f5f5f5; color: #757575; }
.task-priority.重要 { background: #fff3e0; color: var(--orange); }
.task-priority.紧急 { background: #ffebee; color: #c62828; }
.task-del {
  font-size: 16px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
}

/* ===== 记录列表项 ===== */
.record-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.record-item:last-child { border-bottom: none; }
.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.record-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}
.record-amount {
  font-size: 14px;
  font-weight: 700;
}
.record-amount.income { color: var(--green-dark); }
.record-amount.expense { color: var(--orange); }
.record-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}
.record-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--mint-bg);
  color: var(--green-deep);
}

/* ===== 萱萱日常照片 ===== */
.xx-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.xx-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}
.xx-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.xx-card:last-child { border-bottom: none; }
.xx-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.xx-event { font-size: 14px; font-weight: 600; color: var(--text-main); }
.xx-note { font-size: 12px; color: var(--text-sub); line-height: 1.5; }

/* ===== 备忘录 ===== */
.memo-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.memo-item:last-child { border-bottom: none; }
.memo-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}
.memo-content {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}
.memo-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  align-items: center;
}

/* ===== 饮食热量 ===== */
.calorie-display {
  text-align: center;
  margin-bottom: 8px;
}
.calorie-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--orange);
}
.calorie-unit {
  font-size: 14px;
  color: var(--text-light);
  margin-left: 4px;
}
.calorie-target {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
}
.meal-section {
  margin-top: 10px;
}
.meal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-deep);
  margin-bottom: 6px;
}
.meal-food {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
  padding: 4px 0;
}

/* ===== 运动记录 ===== */
.ex-record {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ex-record:last-child { border-bottom: none; }
.ex-type {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--mint-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* ===== 健康记录 ===== */
.health-overview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.health-overview-item:last-child { border-bottom: none; }
.health-overview-label { font-size: 13px; color: var(--text-sub); }
.health-overview-value { font-size: 15px; font-weight: 600; color: var(--green-dark); }

/* ===== 电商看板 ===== */
.ec-metric {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.ec-metric:last-child { border-bottom: none; }
.ec-metric-label { font-size: 12px; color: var(--text-sub); }
.ec-metric-value { font-size: 14px; font-weight: 600; }
.ec-suggestion {
  background: var(--mint-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}

/* ===== 复盘 ===== */
.review-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.review-card:last-child { border-bottom: none; }
.review-section { margin-bottom: 8px; }
.review-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-deep);
  margin-bottom: 3px;
}
.review-section-content {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}
.review-section-content.good { color: var(--green-dark); }
.review-section-content.problem { color: var(--orange); }
.review-section-content.action { color: #1565c0; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 24px 0;
  color: var(--text-light);
  font-size: 13px;
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 92%;
  max-height: 92%;
  border-radius: 8px;
}

/* ===== 桌面端居中限制 ===== */
@media (min-width: 431px) {
  body { background: #c8e6c9; padding: 0; }
  .app {
    border-radius: 0;
    box-shadow: 0 0 60px rgba(0,0,0,0.12);
  }
}
