/* ══════ 晨间3分钟 · 全局样式 ══════ */

:root {
  --primary: #5BAB7A;
  --primary-dark: #489D6A;
  --primary-light: #E8F5EE;
  --accent: #E8A87C;
  --accent-light: #FAF0EA;
  --bg: #F5F7F5;
  --bg-card: #FFFFFF;
  --bg-light: #F8FAF8;
  --text: #2C3E50;
  --text-secondary: #8A9CAC;
  --text-muted: #B5C4CE;
  --border: #E5EAE7;
  --border-light: #F0F2F0;
  --shadow: 0 2px 20px rgba(91,171,122,0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ══════ 页面容器 ══════ */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.page {
  padding: 0 20px 100px;
  display: none;
}
.page.active { display: block; }

/* ══════ 顶部导航 ══════ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-title {
  font-size: 17px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--primary);
  letter-spacing: 2px;
}
.header-back {
  font-size: 22px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 8px;
  border: none;
  background: none;
  transition: color 0.2s;
}
.header-back:hover { color: var(--text); }

/* ══════ 首页 ══════ */
.greeting { font-size: 22px; font-weight: 600; margin-bottom: 2px; }
.greeting-sub { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }

.streak-badge {
  display: inline-flex; align-items: center;
  background: var(--primary-light); color: var(--primary-dark);
  padding: 3px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 500;
}
.streak-badge::before { content: "🔥"; margin-right: 4px; }

/* ══════ 评分圆环 ══════ */
.score-card {
  background: var(--bg-light);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.ring-wrapper { position: relative; width: 110px; height: 110px; margin: 0 auto; }
.ring-svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--primary); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease; }
.ring-fill.accent { stroke: var(--accent); }
.ring-fill.gray { stroke: var(--text-muted); opacity: 0.3; }
.ring-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.ring-score { font-size: 28px; font-weight: 700; display: block; line-height: 1.1; font-family: 'Noto Serif SC', serif; }
.ring-score.muted { color: var(--text-muted); }
.ring-label { font-size: 11px; color: var(--text-secondary); display: block; margin-top: 2px; }
.ring-label.accent { color: var(--primary); }
.score-hint { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }
.score-hint.accent { color: var(--primary); }

/* ══════ 按钮 ══════ */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 1px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ══════ 卡片 ══════ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.card.locked { opacity: 0.4; }
.card-header { display: flex; align-items: center; cursor: pointer; }
.card-emoji { font-size: 18px; margin-right: 12px; width: 24px; text-align: center; }
.card-title { flex: 1; font-size: 14px; font-weight: 500; }
.card-arrow { font-size: 16px; color: var(--text-muted); transition: transform 0.25s ease; }
.card-arrow.open { transform: rotate(90deg); }
.card.locked .card-title { color: var(--text-secondary); }
.card-body { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 14px; display: none; }
.card-body.open { display: block; }

.section-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); font-family: 'Noto Serif SC', serif; }

/* ══════ 打卡完成 ══════ */
.done-badge {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg-light); border-radius: var(--radius-sm);
  padding: 12px; font-size: 13px; font-weight: 500; color: var(--primary-dark);
  margin-bottom: 12px; border: 1px solid var(--border);
}

/* ══════ TabBar ══════ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}
.tab-item {
  flex: 1; text-align: center; padding: 4px 0;
  font-size: 10px; color: var(--text-muted); cursor: pointer;
  transition: color 0.2s; background: none; border: none;
}
.tab-item.active { color: var(--primary); }
.tab-item .tab-icon { font-size: 18px; display: block; margin-bottom: 2px; }

/* ══════ 步点 ══════ */
.step-indicators { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
}
.step-dot.active { background: var(--primary); color: white; }
.step-dot.current { background: var(--primary); color: white; box-shadow: 0 0 0 4px rgba(91,171,122,0.12); }

/* ══════ 打卡步骤标题 ══════ */
.step-page { padding: 0 0 100px; }
.checkin-step { padding: 24px 0 18px; text-align: center; }
.checkin-step .step-emoji { font-size: 34px; display: block; margin-bottom: 6px; }
.checkin-step .step-title { font-size: 20px; font-weight: 700; display: block; font-family: 'Noto Serif SC', serif; }
.checkin-step .step-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; display: block; }

/* ══════ 精力选择 ══════ */
.energy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.energy-item {
  padding: 16px 12px; border-radius: 12px; border: 1px solid var(--border);
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--bg-card);
}
.energy-item .e-emoji { font-size: 26px; display: block; }
.energy-item .e-label { font-size: 13px; margin-top: 4px; color: var(--text); }
.energy-item.active { border-color: var(--accent); background: var(--accent-light); }
.energy-item.active .e-label { color: var(--accent); font-weight: 600; }

/* ══════ 胶囊 ══════ */
.capsule-group { display: flex; flex-wrap: wrap; gap: 8px; }
.capsule {
  padding: 7px 16px; border-radius: 8px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  cursor: pointer; transition: all 0.2s;
}
.capsule.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ══════ 滑条 ══════ */
.slider-section { margin: 16px 0; }
.slider-section .label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 12px; }
.slider-track { height: 5px; background: var(--border); border-radius: 3px; position: relative; margin-bottom: 6px; }
.slider-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.slider-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); position: absolute; top: -6.5px; transform: translateX(-50%); box-shadow: 0 2px 6px rgba(91,171,122,0.15); }
.slider-value { text-align: center; font-size: 12px; color: var(--text-secondary); }

/* ══════ 睡眠质量 ══════ */
.emoji-group { display: flex; justify-content: space-between; gap: 6px; margin: 12px 0; }
.emoji-opt {
  display: flex; flex-direction: column; align-items: center; padding: 10px 6px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card);
  cursor: pointer; transition: all 0.2s; flex: 1;
}
.emoji-opt .e { font-size: 22px; }
.emoji-opt .el { font-size: 10px; margin-top: 4px; color: var(--text-secondary); }
.emoji-opt.active { border-color: var(--accent); background: var(--accent-light); }
.emoji-opt.active .el { color: var(--accent); font-weight: 500; }

/* ══════ 症状标签 ══════ */
.symptom-section { margin: 12px 0; }
.symptom-section .cat { font-size: 11px; color: var(--text-secondary); margin: 12px 0 8px; font-weight: 500; letter-spacing: 1px; }
.tag-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 6px 14px; border-radius: 8px; font-size: 12px;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border); cursor: pointer;
  transition: all 0.2s;
}
.tag.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ══════ 布里斯托 ══════ */
.bristol-row { display: flex; justify-content: center; gap: 4px; margin: 16px 0; }
.bristol-item {
  display: flex; flex-direction: column; align-items: center; padding: 10px 5px;
  border-radius: 12px; border: 1px solid var(--border); cursor: pointer; transition: all 0.2s;
  background: var(--bg-card); min-width: 40px;
}
.bristol-item.active { border-color: var(--accent); background: var(--accent-light); }
.bristol-item .b-emoji { font-size: 24px; }
.bristol-item .b-num { font-size: 10px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }

/* ══════ 饮水 ══════ */
.water-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0; }
.water-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.water-dot.active { border-color: var(--primary); background: var(--primary); }
.water-dot.active::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: white; }
.water-val { font-size: 14px; font-weight: 600; color: var(--primary); margin-left: 8px; }

/* ══════ 步导航 ══════ */
.step-nav { display: flex; gap: 12px; margin-top: 24px; }
.step-nav .btn { flex: 1; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; text-align: center; transition: all 0.2s; }
.step-nav .btn-prev { background: var(--bg-light); color: var(--text); border: 1px solid var(--border); }
.step-nav .btn-prev:hover { background: var(--border); }
.step-nav .btn-next { background: var(--primary); color: white; border: none; }
.step-nav .btn-next:hover { background: var(--primary-dark); }

/* ══════ 报告页 ══════ */
.report-score { text-align: center; padding: 16px 0; }
.report-level { padding: 4px 14px; border-radius: 6px; font-size: 12px; display: inline-block; font-weight: 500; margin-top: 8px; letter-spacing: 1px; }
.report-level.good { background: var(--primary-light); color: var(--primary); }

.ai-block {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}

/* ══════ 评分条形 ══════ */
.score-bars { margin: 12px 0; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .bl { width: 30px; font-size: 11px; color: var(--text-secondary); }
.bar-row .bt { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar-row .bf { height: 100%; border-radius: 3px; }
.bar-row .bv { width: 28px; font-size: 12px; font-weight: 600; text-align: right; }

/* ══════ 舌苔 ══════ */
.tongue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.tongue-card {
  padding: 16px 10px; border-radius: 12px; border: 1px solid var(--border);
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--bg-card);
}
.tongue-card .t-icon { font-size: 30px; display: block; margin-bottom: 4px; }
.tongue-card .t-label { font-size: 12px; color: var(--text); display: block; }
.tongue-card .t-sub { font-size: 10px; color: var(--text-secondary); display: block; margin-top: 2px; }
.tongue-card.active { border-color: var(--accent); background: var(--accent-light); }
.tongue-card.active .t-label { color: var(--accent); font-weight: 500; }
.tongue-tip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--bg-light); border-radius: 8px;
  margin-top: 12px; font-size: 11px; color: var(--text); line-height: 1.6; border: 1px solid var(--border);
}

/* ══════ 体质 ══════ */
.constitution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.const-item {
  padding: 14px 10px; border-radius: 12px; border: 1px solid var(--border);
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--bg-card);
}
.const-item .c-icon { font-size: 24px; display: block; margin-bottom: 4px; }
.const-item .c-label { font-size: 12px; color: var(--text); display: block; font-weight: 500; }
.const-item .c-sub { font-size: 10px; color: var(--text-secondary); display: block; margin-top: 2px; }
.const-item.active { border-color: var(--accent); background: var(--accent-light); }
.const-item.active .c-label { color: var(--accent); font-weight: 600; }

/* ══════ 个人中心 ══════ */
.user-card { display: flex; align-items: center; gap: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.user-detail { flex: 1; }
.user-name { font-size: 15px; font-weight: 600; display: block; }
.user-meta { font-size: 12px; color: var(--text-secondary); display: block; margin-top: 2px; }

.stats-row { display: flex; justify-content: space-around; padding: 16px 0; }
.stat-item { text-align: center; }
.stat-item .sn { font-size: 22px; font-weight: 700; font-family: 'Noto Serif SC', serif; }
.stat-item .sl { font-size: 11px; color: var(--text-secondary); }

.menu-item { display: flex; align-items: center; padding: 12px 4px; cursor: pointer; transition: background 0.2s; border-radius: 8px; }
.menu-item:hover { background: var(--bg-light); }
.menu-item .mi-icon { font-size: 14px; margin-right: 12px; width: 22px; text-align: center; }
.menu-item .mi-label { flex: 1; font-size: 13px; color: var(--text); }
.menu-item .mi-arrow { color: var(--text-muted); font-size: 14px; }
.menu-divider { height: 1px; background: var(--border); margin: 0 4px; }

/* ══════ 历史 ══════ */
.calendar { margin: 12px 0; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-cell { padding: 6px 0; border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; }
.cal-cell .c-day { font-size: 12px; display: block; color: var(--text); }
.cal-cell .c-score { font-size: 9px; color: var(--primary); margin-top: 2px; }
.cal-cell.today { background: var(--primary-light); }
.cal-cell .c-score.empty { color: var(--border); }

/* ══════ 设置表单 ══════ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; color: var(--text);
  background: var(--bg-card); outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }

/* ══════ 登录页 ══════ */
.login-page {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh; padding: 40px 20px;
  text-align: center;
}
.login-page h1 { font-size: 28px; font-weight: 700; font-family: 'Noto Serif SC', serif; color: var(--primary); letter-spacing: 4px; margin-bottom: 8px; }
.login-page p { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }
.login-page .demo-hint { font-size: 11px; color: var(--text-muted); margin-top: 16px; }

/* ══════ 加载中 ══════ */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--text-secondary); font-size: 14px;
}
.loading::after {
  content: ''; width: 20px; height: 20px; margin-left: 8px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════ 免责 ══════ */
.disclaimer { font-size: 10px; color: var(--text-muted); text-align: center; margin: 16px 0; line-height: 1.6; letter-spacing: 0.5px; }

/* ══════ Toast ══════ */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white; padding: 10px 20px;
  border-radius: 8px; font-size: 13px; z-index: 1000;
  opacity: 0; transition: opacity 0.3s;
  max-width: 90%;
}
.toast.show { opacity: 1; }

/* ══════ 模式标签 ══════ */
.mode-tag { font-size: 11px; color: var(--text-secondary); padding: 4px 10px; border-radius: 6px; background: var(--bg-light); border: 1px solid var(--border); }
