/* ============================================================
   化疗管理平台 — 青瓷薄荷治愈风设计（v5，2026-09-11 起）
   关键词：薄荷绿 / 圆角 / 温柔 / 低对比度 / 治愈系
   ============================================================ */

:root {
  /* —— 主色调：薄荷绿 —— */
  --primary:        #1D9E75;   /* 主操作色，柔和不刺眼 */
  --primary-dark:   #0F6E56;   /* 深绿，按下/重点 */
  --primary-soft:   #5DCAA5;   /* 浅绿，hover/二级 */
  --primary-light:  #E1F5EE;   /* 极浅绿，输入框底 */
  --blue-bg:        #D5F0E4;   /* 卡片/区块最浅背景 */

  /* —— 中性色：偏冷调，柔和不冷硬 —— */
  --bg:             #F4FBF8;   /* 主背景：极浅冷白 */
  --bg-soft:        #F0F8F4;   /* 次级背景：浅蓝灰 */
  --surface:        #FFFFFF;   /* 卡片表面：纯白 */
  --border:         #C8EBDD;   /* 描边：冷调浅蓝 */
  --border-soft:    #E8F4EE;   /* 极浅描边 */

  /* —— 文字 —— */
  --text:           #04342C;   /* 主文字：深蓝灰 */
  --text-soft:      #085041;   /* 副文字 */
  --text-light:     #5F5E5A;   /* 提示/标签 */
  --text-onprimary: #FFFFFF;

  /* —— 状态色：柔化不刺激 —— */
  --accent:         #FAC775;   /* 暖橙：警示（与冷蓝互补） */
  --accent-soft:    #FAEEDA;
  --danger:         #E24B4A;   /* 柔珊瑚：强烈提示 */
  --danger-soft:    #FCEBEB;
  --success:        #97C459;   /* 浅蓝绿：成功 */
  --success-soft:   #EAF3DE;
  --warning:        #BA7517;   /* 暖黄：特别提示 */

  /* —— 尺寸 —— */
  --radius-sm:      10px;
  --radius:         16px;
  --radius-lg:      22px;
  --radius-pill:    999px;

  /* —— 阴影：冷蓝调、低不透明度 —— */
  --shadow:         0 2px 12px rgba(29, 158, 117, 0.18);
  --shadow-lg:      0 8px 28px rgba(29, 158, 117, 0.25);
  --shadow-soft:    0 1px 4px rgba(29, 158, 117, 0.10);

  /* —— 间距 —— */
  --space-xs:       4px;
  --space-sm:       8px;
  --space:          12px;
  --space-md:       16px;
  --space-lg:       24px;

  /* —— 高度 —— */
  --nav-height:     64px;
  --header-height:  auto;
}

/* ============================================================
   全局：圆润字体、暖白底、丝滑过渡
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC",
               "Microsoft YaHei UI", -apple-system, BlinkMacSystemFont,
               "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  letter-spacing: 0.02em;
}

button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: var(--text); }

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

/* ============================================================
   头部：温柔问候 + 陪伴
   ============================================================ */
.app-header {
  background: linear-gradient(160deg, #E1F5EE 0%, #F0FBF6 50%, #FFFFFF 100%);
  padding: 22px 18px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  gap: 12px;
}

.app-greeting {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.app-greeting .greeting-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}

.app-greeting .greeting-moon {
  font-size: 20px;
}

.app-greeting .greeting-sub {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 400;
  margin-top: 2px;
}

.app-greeting .greeting-sub::before {
  content: "·";
  margin: 0 6px;
  color: var(--text-light);
}

.app-header .header-actions {
  position: absolute;
  top: 18px;
  right: 14px;
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
}

.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* ============================================================
   主内容区
   ============================================================ */
.app-main {
  flex: 1;
  padding: 12px 14px;
  padding-bottom: calc(var(--nav-height) + 24px);
  overflow-y: auto;
}

.tab-view { display: none; }
.tab-view.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ============================================================
   视图标题 + 添加按钮
   ============================================================ */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 4px 14px;
}

.view-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.view-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.view-subtitle {
  font-size: 12.5px;
  color: var(--text-light);
}

.btn-pill {
  background: var(--primary);
  color: var(--text-onprimary);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(29, 158, 117, 0.28);
  transition: all 0.25s;
}

.btn-pill:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.btn-pill:active {
  transform: translateY(0);
  background: var(--primary-dark);
}

.btn-pill.large {
  padding: 14px 22px;
  font-size: 15px;
  border-radius: var(--radius-pill);
  width: 100%;
  justify-content: center;
}

/* ============================================================
   卡片：极柔阴影 + 大圆角
   ============================================================ */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  border: 1px solid var(--border-soft);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

.card-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.card-body {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  background: var(--blue-bg);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
}

.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px dashed var(--border-soft);
  padding-top: 10px;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-light);
  padding: 4px 10px;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-text:hover { background: var(--blue-bg); color: var(--primary-dark); }
.btn-text.danger { color: var(--text-light); }
.btn-text.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   空状态：柔光、薄荷圆形、温柔文案
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 28px;
  color: var(--text-soft);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--blue-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.6;
}

.empty-state-text {
  font-size: 15px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 4px;
}

.empty-state-hint {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ============================================================
   模态：底部弹出，圆角更大
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 52, 44, 0.32);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  padding: 22px 18px 28px;
  animation: slideUp 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.btn-close {
  background: var(--blue-bg);
  border: none;
  font-size: 18px;
  color: var(--text-soft);
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ============================================================
   表单：圆角柔和、暖色描边
   ============================================================ */
.record-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label,
.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.2px;
}

.form-group label .optional {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
  margin-left: 4px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group.half { flex: 1; }

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
textarea,
select,
.search-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--blue-bg);
  transition: all 0.25s;
  color: var(--text);
}

input[type="date"] {
  color: var(--text-soft);
}

input:focus,
textarea:focus,
select:focus,
.search-input:focus {
  outline: none;
  border-color: var(--primary-soft);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-light);
  font-size: 14px;
}

textarea { resize: vertical; min-height: 80px; }

.textarea-wrapper { position: relative; }

.select-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235C6E80' stroke-width='2' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  background-color: var(--blue-bg);
  cursor: pointer;
}

/* ============================================================
   心情选择器：5 个独立薄荷小卡 + 标签
   ============================================================ */
.mood-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 4px 0;
}

.mood-emoji {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s;
  background: transparent;
  border: 1.5px solid transparent;
  filter: grayscale(0.6);
  opacity: 0.55;
}

.mood-emoji .face {
  font-size: 26px;
  line-height: 1;
}

.mood-emoji .label {
  font-size: 11px;
  color: var(--text-soft);
  white-space: nowrap;
}

.mood-emoji.selected {
  background: var(--primary-light);
  border-color: var(--primary-soft);
  filter: grayscale(0);
  opacity: 1;
  transform: translateY(-2px);
}

.mood-emoji.selected .label {
  color: var(--primary-dark);
  font-weight: 500;
}

.mood-label-row {
  font-size: 13px;
  color: var(--text-soft);
  margin: 8px 0 6px;
  font-weight: 500;
}

.mood-label-row .time-icon {
  display: inline-block;
  margin-right: 4px;
}

/* ============================================================
   滑块：柔绿轨道 + 圆滑块
   ============================================================ */
.sliders { display: flex; flex-direction: column; gap: 12px; }

.slider-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-label {
  width: 42px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.range-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(to right, var(--primary-light), var(--primary-soft));
  border-radius: var(--radius-pill);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(29, 158, 117, 0.4);
}

.range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.slider-value {
  width: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* "想记就记" 折叠区 */
.body-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.body-toggle-btn {
  background: var(--blue-bg);
  border: none;
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.body-toggle-btn:hover { background: var(--primary-light); }
.body-toggle-btn.expanded { background: var(--primary); color: white; }

.body-collapse { display: none; padding-top: 12px; }
.body-collapse.open { display: block; animation: fadeIn 0.25s ease; }

/* 副作用严重度 chip */
.severity-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.severity-chip {
  background: var(--blue-bg);
  border: 1px solid transparent;
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.severity-chip:hover { background: var(--primary-light); }
.severity-chip.active {
  background: var(--primary);
  color: white;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(29, 158, 117, 0.32);
}

/* ============================================================
   复选框
   ============================================================ */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 6px 12px;
  background: var(--blue-bg);
  border-radius: var(--radius-pill);
  transition: all 0.2s;
}

.checkbox-item:hover { background: var(--primary-light); }

.checkbox-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ============================================================
   照片上传：虚线柔边圆角
   ============================================================ */
.photo-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.photo-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  background: var(--blue-bg);
}

.photo-add-btn:hover {
  border-color: var(--primary-soft);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.photo-add-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.photo-add-btn .photo-add-text {
  font-size: 13px;
}

.photo-input { display: none; }

.card-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.card-photos img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

/* ============================================================
   保存按钮
   ============================================================ */
.btn-save {
  background: var(--primary);
  color: var(--text-onprimary);
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(29, 158, 117, 0.32);
  transition: all 0.25s;
}

.btn-save:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.btn-save:active {
  transform: translateY(0);
  background: var(--primary-dark);
}

/* ============================================================
   语音按钮 + 状态
   ============================================================ */
.voice-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--primary);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(29, 158, 117, 0.32);
}

.voice-btn.listening {
  background: var(--accent);
  animation: pulseGlow 1.2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250, 199, 117, 0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(250, 199, 117, 0); }
}

textarea + .voice-btn {
  bottom: 10px;
  right: 10px;
}

input + .voice-btn {
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
}

input + .voice-btn.listening { transform: translateY(-50%) scale(1.1); }

.voice-status {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(4, 52, 44, 0.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  backdrop-filter: blur(8px);
}

.voice-pulse {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

/* ============================================================
   底部导航：暖白胶囊式，高亮柔光
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border-soft);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-light);
  cursor: pointer;
  padding: 8px 14px;
  transition: all 0.25s;
  position: relative;
}

.nav-item .nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 28px;
  border-radius: var(--radius-pill);
  transition: all 0.3s;
}

.nav-item.active { color: var(--primary-dark); }
.nav-item.active .nav-icon-wrap {
  background: var(--blue-bg);
}

.nav-item.active svg { stroke: var(--primary); }

/* ============================================================
   子标签：胶囊式 pill switcher（替代下划线）
   ============================================================ */
.sub-tabs {
  display: flex;
  background: var(--blue-bg);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin: 4px 0 14px;
  gap: 2px;
}

.sub-tab {
  flex: 1;
  padding: 9px 12px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: all 0.25s;
}

.sub-tab:hover { color: var(--primary-dark); }

.sub-tab.active {
  background: var(--primary);
  color: white;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(29, 158, 117, 0.32);
}

.sub-tab-content { display: none; }
.sub-tab-content.active { display: block; animation: fadeIn 0.25s ease; }

/* ============================================================
   筛选 chips：胶囊，更柔
   ============================================================ */
.filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  background: var(--blue-bg);
  border: 1px solid transparent;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.chip:hover { background: var(--primary-light); }
.chip.active {
  background: var(--primary);
  color: white;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(29, 158, 117, 0.28);
}

/* ============================================================
   搜索框
   ============================================================ */
.search-input {
  flex: 1;
  max-width: none;
  padding-left: 36px;
  background: var(--blue-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2395A5B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
}

/* ============================================================
   趋势图
   ============================================================ */
.trend-chart-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  min-height: 200px;
  border: 1px solid var(--border-soft);
}

.trend-chart-container svg { width: 100%; height: auto; }

.trend-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 14px;
}

.trend-controls { margin-bottom: 12px; }

/* ============================================================
   To-Do 列表
   ============================================================ */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  transition: all 0.25s;
}

.todo-item:hover { box-shadow: var(--shadow-lg); }
.todo-item.completed { opacity: 0.65; background: var(--blue-bg); }
.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-light);
}

.todo-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.todo-content { flex: 1; min-width: 0; }
.todo-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.todo-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.todo-priority {
  font-size: 11.5px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.todo-priority.high {
  background: var(--accent-soft);
  color: var(--accent);
}
.todo-priority.medium {
  background: var(--blue-bg);
  color: var(--primary-dark);
}
.todo-priority.low {
  background: var(--success-soft);
  color: var(--success);
}

.todo-date {
  font-size: 12px;
  color: var(--text-light);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(4, 52, 44, 0.94);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  z-index: 400;
  max-width: 300px;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

/* ============================================================
   饮食卡片
   ============================================================ */
.diet-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.diet-card img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}

.diet-card-content { flex: 1; min-width: 0; }

.diet-meal-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 500;
}

/* ============================================================
   小贴士卡片
   ============================================================ */
.tip-card { cursor: pointer; }
.tip-card-title {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.tip-card-preview {
  font-size: 13.5px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.6;
}

/* ============================================================
   提示卡（虚线圆角浅色，常用于解释性说明）
   ============================================================ */
.hint-card {
  background: var(--blue-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
  border: 1px dashed var(--primary-soft);
}

.hint-card .hint-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

/* ============================================================
   小屏微调
   ============================================================ */
@media (max-width: 360px) {
  .mood-emoji .face { font-size: 22px; }
  .mood-emoji .label { font-size: 10px; }
  .app-greeting .greeting-title { font-size: 19px; }
}

/* ============================================================
   化验趋势：迷你图卡片 + 数值列表（v3.3）
   ============================================================ */
.trend-mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
}

.mini-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.mini-chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.mini-chart-title em {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-light);
}

.mini-chart-ref {
  font-size: 11.5px;
  color: var(--text-light);
  white-space: nowrap;
}

.mini-chart-card svg { width: 100%; height: auto; display: block; }

.lab-value-list {
  margin-top: 6px;
  border-top: 1px dashed var(--border-soft);
  max-height: 132px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lab-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border-soft);
}

.lab-value-row:last-child { border-bottom: none; }

.lab-value-row.abnormal .lab-value-num {
  color: var(--accent);
  font-weight: 600;
}

.lab-value-date {
  font-size: 12px;
  color: var(--text-light);
  width: 44px;
  flex: none;
}

.lab-value-num {
  font-size: 13.5px;
  color: var(--text);
  flex: 1;
}

.lab-value-flag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  flex: none;
}

.lab-value-flag.up   { background: var(--accent-soft); color: #854F0B; }
.lab-value-flag.down { background: var(--primary-light); color: var(--primary-dark); }

.lab-value-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

/* ============================================================
   用药打卡（v3.3）
   ============================================================ */
input[type="time"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--blue-bg);
  color: var(--text-soft);
  transition: all 0.25s;
}

input[type="time"]:focus {
  outline: none;
  border-color: var(--primary-soft);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.16);
}

/* 日期导航 */
.med-day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.med-day-nav .med-day-btn.back-today {
  flex: 1;
  text-align: center;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.med-day-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.med-day-btn:hover:not(:disabled) {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.med-day-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* 今日进度卡 */
.med-progress-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  margin-bottom: 12px;
}

.med-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.med-progress-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.med-progress-pct {
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 600;
}

.med-progress-bar {
  height: 6px;
  background: var(--primary-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.med-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.med-progress-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}

/* 时段卡片 */
.med-slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.med-slot {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
  transition: all 0.25s;
}

.med-slot.due {
  border-color: var(--accent);
  background: linear-gradient(160deg, #FDFEFB 0%, var(--surface) 40%);
}

.med-slot-time {
  width: 42px;
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  padding-top: 2px;
}

.med-slot.due .med-slot-time { color: #854F0B; }

.med-slot-body {
  flex: 1;
  min-width: 0;
}

.med-med-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.med-med-row.checked .med-name {
  color: var(--text-light);
  text-decoration: line-through;
}

.med-name {
  font-size: 14.5px;
  color: var(--text);
}

.med-dose {
  font-size: 12px;
  color: var(--text-light);
}

/* 圆形勾选框 */
.med-check {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
}

.med-check input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.med-check .med-checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #9FE1CB;
  background: transparent;
  transition: all 0.2s;
  pointer-events: none;
}

.med-check .med-checkmark svg { display: none; }

.med-check input:checked + .med-checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.med-check input:checked + .med-checkmark svg { display: block; }

.med-check:active .med-checkmark { transform: scale(0.88); }

/* 备注 + 提醒 */
.med-slot-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.med-note-text {
  font-size: 11.5px;
  color: var(--text-light);
  line-height: 1.5;
}

.med-warn-chip {
  font-size: 11px;
  color: #854F0B;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-weight: 500;
}

.med-due-text {
  font-size: 11px;
  color: #854F0B;
  font-weight: 500;
}

.med-all-btn {
  flex: none;
  align-self: center;
  background: var(--blue-bg);
  border: none;
  color: var(--primary-dark);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.med-all-btn:hover { background: var(--primary-light); }

/* 最近 7 天小方格 */
.med-history-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  margin-top: 14px;
}

.med-history-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.med-history-strip {
  display: flex;
  gap: 6px;
}

.med-day-square {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: none;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-soft);
  color: var(--text-light);
}

.med-day-square .med-day-count {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.med-day-square .med-day-week {
  font-size: 10.5px;
  line-height: 1.2;
}

.med-day-square.full  { background: var(--primary); color: #fff; }
.med-day-square.half  { background: var(--primary-soft); color: #fff; }
.med-day-square.miss  { background: var(--accent); color: #fff; }
.med-day-square.selected { outline: 2px solid var(--primary-dark); outline-offset: 1px; }

.med-history-legend {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 10px;
}

/* 药品清单管理 */
.med-manage-section {
  font-size: 12px;
  color: var(--text-light);
  margin: 14px 0 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

.med-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.med-manage-row.inactive { opacity: 0.6; background: var(--bg); }

.med-manage-info { flex: 1; min-width: 0; }

.med-manage-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.med-manage-dose {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}

.med-manage-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.5;
}

.med-manage-actions {
  display: flex;
  flex: none;
  gap: 2px;
}

/* ============================================================
   花销记录（v3.5.0）
   ============================================================ */
.expense-totals {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}

.expense-total-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.expense-total-card:nth-child(1) {
  background: var(--primary-light);
  border-color: var(--primary-soft);
}

.expense-total-label {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.expense-total-num {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.expense-total-num.insurance { color: var(--primary-dark); font-size: 14px; }
.expense-total-num.self-pay  { color: var(--danger); font-size: 14px; }

.expense-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  margin-bottom: 8px;
}

/* 主行：科目+日期 | 医保 | 自费 | 合计 | 操作 */
.expense-row-main {
  display: flex;
  align-items: center;
  gap: 0;
}

/* 备注行：整行铺满，第二行显示 */
.expense-comment {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.expense-row-subject {
  flex: 1.6;
  min-width: 0;
  padding-right: 8px;
}

.expense-row-subject .subject {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-row-subject .date {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.expense-cell {
  flex: 1;
  text-align: right;
  font-size: 13px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.expense-cell.insurance { color: var(--primary-dark); }
.expense-cell.self-pay  { color: var(--danger); }
.expense-cell.total     { color: var(--text); font-weight: 500; }

.expense-row-actions {
  flex: none;
  display: flex;
  gap: 2px;
  margin-left: 6px;
}

.expense-row-actions button {
  font-size: 12px;
  padding: 3px 8px;
  background: transparent;
  border: none;
  color: var(--text-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.expense-row-actions button:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.expense-row-actions button.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.expense-empty {
  text-align: center;
  padding: 32px 18px;
  color: var(--text-soft);
}

.expense-empty .subject-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.expense-empty .subject-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.6;
}

.expense-empty .hint-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.expense-empty .hint-sub {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}
