/* 家庭健康管家 · 网页版 样式 */
:root {
  --brand: #0D9488;
  --brand-light: #CCFBF1;
  --food: #F59E0B;
  --food-light: #FEF3C7;
  --care: #F43F5E;
  --care-light: #FFE4E6;
  --calm: #3B82F6;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #1E293B;
  --text-sub: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; position: relative; background: var(--bg); box-shadow: 0 0 30px rgba(0,0,0,0.05); }

/* 顶部 */
.header { padding: 16px 20px 8px; }
.header h1 { font-size: 22px; font-weight: 800; color: var(--text); }
.header .sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* 内容区 */
.body { flex: 1; padding: 0 20px; overflow-y: auto; padding-bottom: 80px; }
.panel { display: none; }
.panel.active { display: block; }

/* 卡片 */
.card {
  background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(15,118,110,0.06);
}

/* 区块标题 */
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; font-size: 17px; font-weight: 700; color: var(--text); }
.section-header .action { font-size: 13px; font-weight: 600; color: var(--brand); cursor: pointer; }

/* 按钮 */
.btn {
  display: block; width: 100%; border: none; border-radius: 12px; padding: 14px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 12px;
}
.btn:disabled { background: var(--border); cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text-sub); border: 1px solid var(--border); }

/* 标签 Chip */
.chip {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: 13px; color: var(--text-sub); cursor: pointer; margin: 0 8px 8px 0;
  user-select: none; transition: all 0.15s;
}
.chip.selected { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

/* 统计 */
.stats-row { display: flex; gap: 8px; margin-top: 8px; }
.stat-card { flex: 1; background: var(--card); border-radius: 14px; padding: 12px; text-align: center; border: 1px solid var(--border); }
.stat-card .v { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-card .l { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.stat-card .bar { height: 3px; border-radius: 2px; margin-top: 8px; }

/* 输入 */
.label { font-size: 12px; font-weight: 700; color: var(--text-sub); margin: 12px 0 6px; }
.input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 12px; font-size: 15px; color: var(--text); outline: none;
}
.input:focus { border-color: var(--brand); }
textarea.input { min-height: 60px; resize: vertical; }

/* 底部导航 */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--border); display: flex; z-index: 100;
}
.tab-item { flex: 1; text-align: center; padding: 8px 0 10px; cursor: pointer; }
.tab-item .icon { font-size: 20px; }
.tab-item .label { font-size: 11px; color: var(--text-sub); margin: 0; font-weight: 600; }
.tab-item.active .label { color: var(--brand); font-weight: 800; }
.tab-item .dot { width: 4px; height: 4px; border-radius: 2px; background: var(--brand); margin: 3px auto 0; display: none; }
.tab-item.active .dot { display: block; }

/* 健康子标签 */
.health-tabs { display: flex; background: #F1F5F9; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.health-tab { flex: 1; text-align: center; padding: 9px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-sub); cursor: pointer; }
.health-tab.active { background: #fff; color: var(--brand); font-weight: 800; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }

/* 进度条 */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.progress-fill { height: 8px; background: var(--brand); border-radius: 4px; transition: width 0.3s; }

/* 药物打卡 */
.med-head { display: flex; align-items: center; margin-bottom: 12px; }
.med-dot { width: 10px; height: 10px; border-radius: 5px; margin-right: 8px; }
.med-name { font-size: 16px; font-weight: 700; }
.med-meta { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.dose-row { display: flex; gap: 8px; }
.dose-btn {
  flex: 1; min-height: 62px; border-radius: 8px; border: 1.5px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
  padding: 8px; user-select: none; transition: all 0.15s;
}
.dose-btn.taken { color: #fff; }
.dose-btn .dl { font-size: 17px; font-weight: 800; }
.dose-btn .dt { font-size: 11px; color: var(--text-sub); margin-top: 3px; }
.dose-btn.taken .dt { color: rgba(255,255,255,0.9); }

/* 布里斯托 */
.bristol-row { display: flex; gap: 2px; }
.bristol-btn { flex: 1; text-align: center; padding: 8px 0; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--bg); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.35); display: none; align-items: flex-end; justify-content: center; z-index: 200; }
.modal-mask.show { display: flex; }
.modal-sheet { background: #fff; width: 100%; max-width: 480px; border-radius: 24px 24px 0 0; padding: 24px 20px 36px; max-height: 85vh; overflow-y: auto; }
.modal-sheet h3 { font-size: 18px; font-weight: 800; margin-bottom: 16px; }

/* 其他 */
.tip { font-size: 12px; color: var(--text-sub); margin: -6px 0 12px; }
.empty { text-align: center; padding: 40px 0; color: var(--text-sub); }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.text-sub { color: var(--text-sub); font-size: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.delete-btn { color: var(--care); font-size: 12px; cursor: pointer; border: none; background: none; }
.mt { margin-top: 8px; }

/* 血压 */
.bp-big { font-size: 40px; font-weight: 800; }
.bp-slash { font-size: 26px; color: var(--text-sub); margin: 0 4px; }
.bp-chart { display: flex; align-items: flex-end; justify-content: space-between; height: 140px; }
.bp-col { flex: 1; text-align: center; }
.bp-bar { width: 18px; margin: 0 auto; border-radius: 4px; min-height: 4px; }

/* 响应式 */
@media (max-width: 480px) {
  #app { box-shadow: none; }
}
