:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f6f6f2;
  --border: #e8e8e3;
  --border-strong: #d7d7d0;
  --ink: #1c1c1a;
  --muted: #71716b;
  --faint: #9a9a93;
  --accent: #3f7d5b;
  --accent-ink: #2f5f44;
  --accent-soft: #eef4f0;
  --amber: #b8821e;
  --amber-soft: #fbf3e3;
  --danger: #b3402f;
  --danger-soft: #faece9;
  --shadow: 0 1px 2px rgba(28, 28, 26, 0.04), 0 4px 16px rgba(28, 28, 26, 0.05);
  --radius: 14px;
  --radius-sm: 10px;
  --serif: 'Fraunces', ui-serif, Georgia, 'Songti SC', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 18px 64px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; }
.brand-text h1 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.1;
}
.brand-text p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-date {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.offline-dot {
  font-size: 11px; line-height: 1; padding: 4px 9px; border-radius: 999px;
  background: var(--amber-soft); color: var(--amber-ink, #9a6b1f);
  border: 1px solid color-mix(in srgb, var(--amber, #e0a83c) 35%, var(--border));
  letter-spacing: .03em; white-space: nowrap;
}
.offline-dot[hidden] { display: none; }

.build-info {
  position: fixed; left: 10px; bottom: 8px; z-index: 6;
  font-size: 10px; letter-spacing: .03em;
  color: var(--faint); opacity: .55;
  user-select: none; pointer-events: none;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.tab {
  appearance: none;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  position: relative;
  transition: color 0.18s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 600; }
.tab.is-active::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Views ---------- */
.view { display: none; animation: fade 0.22s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Today head ---------- */
.today-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
}
.ring-wrap { position: relative; width: 120px; height: 120px; flex: none; }
.ring { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-label {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.ring-num { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-cap { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.today-greeting { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.today-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- Cards ---------- */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card.done { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card .ico {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 22px;
  background: var(--surface-2);
}
.card .body { flex: 1; min-width: 0; }
.card .name { font-size: 16px; font-weight: 600; }
.card .meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.card .meta .pill {
  display: inline-flex; align-items: center; gap: 4px;
}
.tag {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  white-space: nowrap;
}
.tag.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); color: var(--amber-ink, var(--amber)); }
.tag.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); color: var(--danger); }
.tag.ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); color: var(--accent-ink); }

/* check toggle (dosage == 1) */
.check {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.check svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; transform: scale(0.5); transition: all 0.2s ease; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on svg { opacity: 1; transform: scale(1); }

/* stepper (dosage > 1) */
.stepper { display: flex; align-items: center; gap: 10px; flex: none; }
.stepper button {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.stepper button:hover { background: var(--surface-2); }
.stepper .count { font-family: var(--serif); font-size: 17px; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper.full .count { color: var(--accent-ink); }

/* dose chips (multi-dose schedule) */
.doses { display: flex; align-items: center; gap: 7px; flex: none; }
.dose {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer; color: var(--muted);
  display: grid; place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dose:hover { background: var(--surface-2); }
.dose.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.doses.full .dose.on { box-shadow: 0 0 0 2px var(--accent-soft); }

/* card actions (library) */
.actions { display: flex; gap: 6px; flex: none; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface);
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  font-size: 16px; color: var(--muted); line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* empty state */
.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface);
}
.empty .big { font-size: 34px; margin-bottom: 10px; }
.empty p { font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 10px;
  transition: filter 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--border); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Daily health tip ---------- */
.tip-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow: hidden;
}
/* 今日页：小知识置于打卡列表下方（打卡是核心，小知识为额外收获） */
.view-today #tipCard { margin-top: 16px; margin-bottom: 0; }
.tip-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--tip-color, var(--accent));
}
.tip-emoji { font-size: 22px; line-height: 1.4; flex: none; }
.tip-main { flex: 1; min-width: 0; }
.tip-cat {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px;
  color: var(--tip-color, var(--accent-ink));
  background: var(--tip-soft, var(--accent-soft));
  margin-bottom: 6px;
}
.tip-text { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.tip-src {
  margin-top: 8px; font-size: 12px; color: var(--faint);
  display: flex; align-items: center; gap: 5px;
}
.tip-src a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.tip-src a:hover { color: var(--tip-color, var(--accent-ink)); border-color: var(--tip-color, var(--accent)); }

/* ---------- 小知识（历史留存） ---------- */
.tips-intro { margin: -4px 0 4px; line-height: 1.6; }
/* 小知识分类筛选菜单栏 */
.tips-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.tip-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.tip-chip:hover { color: var(--ink); border-color: var(--accent); }
.tip-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.tip-chip .tc-emoji { font-size: 14px; line-height: 1; }
.tips-count { margin: 2px 0 14px; }
.tip-hist { margin: 0; }
.tip-date {
  font-family: var(--serif);
  font-size: 13px; font-weight: 600; color: var(--muted);
  margin: 18px 2px 8px;
}
.tip-hist .tip-card { margin-bottom: 0; }

/* ---------- Stats (history) ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  text-align: center;
}
.stat .v { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Heat grid ---------- */
.heat {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}
.heat .cell {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; color: var(--faint);
  position: relative;
  cursor: default;
}
.heat .cell.lvl1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: transparent; }
.heat .cell.lvl2 { background: color-mix(in srgb, var(--accent) 48%, var(--surface)); border-color: transparent; }
.heat .cell.lvl3 { background: color-mix(in srgb, var(--accent) 78%, var(--surface)); border-color: transparent; color: #fff; }
.heat .cell.full { background: var(--accent); border-color: transparent; color: #fff; }
.heat .cell .d { font-variant-numeric: tabular-nums; }
.heat .cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28, 28, 26, 0.32);
  display: grid; place-items: center; padding: 18px; z-index: 50;
  animation: fade 0.18s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface); width: 100%; max-width: 440px;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  border-radius: 18px; border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(28, 28, 26, 0.18);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.form { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field input, .field textarea {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 10px 12px; background: var(--surface); width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-block { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field-hint { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.field-hint b { color: var(--accent-ink); font-family: var(--serif); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; z-index: 60; box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Responsive ---------- */
/* ---------- Lock (single-user privacy) ---------- */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.lock {
  position: fixed; inset: 0; background: rgba(28, 28, 26, 0.96);
  display: grid; place-items: center; z-index: 80; padding: 18px;
  animation: fade 0.18s ease;
}
.lock[hidden] { display: none; }
.lock-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px 24px; width: 100%; max-width: 340px;
  text-align: center; box-shadow: 0 12px 40px rgba(28, 28, 26, 0.25);
}
.lock-mark { font-size: 34px; }
.lock-card h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 10px 0 4px; }
.lock-sub { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.lock-hint { color: var(--faint); font-size: 12px; margin: 0 0 16px; line-height: 1.5; }
.lock-card input {
  width: 100%; font-size: 16px; padding: 11px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  text-align: center; margin-bottom: 12px; font-family: var(--sans);
}
.lock-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lock-card .btn { width: 100%; }
.lock-err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Daily completion chart (history) ---------- */
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px 12px; box-shadow: var(--shadow);
}
.chart-wrap { position: relative; width: 100%; }
#chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tip {
  position: absolute; z-index: 5; min-width: 184px; max-width: 244px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px;
  pointer-events: auto; transform: translateX(-50%);
}
.chart-tip .tip-date { font-family: var(--serif); font-size: 14px; font-weight: 600; }
.chart-tip .tip-rate { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--accent-ink); line-height: 1.1; margin-top: 1px; }
.chart-tip .tip-rows { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.chart-tip .tip-row {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  color: var(--muted); cursor: pointer; padding: 2px 0; border-radius: 6px;
}
.chart-tip .tip-row:hover { color: var(--ink); background: var(--surface-2); }
.chart-tip .tip-row .mk { width: 14px; text-align: center; font-size: 13px; }
.chart-tip .tip-row .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chart-tip .tip-row.on .mk { color: var(--accent); }
.chart-tip .tip-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-tip .tip-row .ct { font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cl-line, .cl-dot { transition: opacity .12s ease; }
#chart.focusing .cl-line:not(.hot), #chart.focusing .cl-dot:not(.hot) { opacity: .15; }
.legend-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); cursor: pointer; user-select: none;
  transition: color 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}
.legend-chip .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-chip .sw.ref {
  background: var(--border-strong);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, #fff 2px, #fff 4px);
}
.legend-chip.on { color: var(--ink); }
.legend-chip.off { opacity: 0.5; text-decoration: line-through; }

/* ---------- Icon picker (add/edit modal) ---------- */
.icon-picker {
  max-height: 232px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.icon-group { margin-bottom: 12px; }
.icon-group:last-child { margin-bottom: 0; }
.icon-group-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px; letter-spacing: 0.02em;
}
.icon-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
}
.icon-opt {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  font-size: 20px; line-height: 1;
  padding: 7px 0; cursor: pointer;
  display: grid; place-items: center;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}
.icon-opt:hover { background: var(--surface-2); }
.icon-opt.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.tag.price { border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); color: var(--accent-ink); }
.tag.price .per { color: var(--muted); font-weight: 500; }

/* ---------- 体验记录（编辑弹窗 + 记录页） ---------- */
/* 现代做法：不再在白色弹窗里再套一个灰色「面板」（那正是显旧又挤的根源），
   而是让记录区直接落在弹窗白底上，用留白 + 柔和填充卡片 + 强调色来区分层次。 */
.journal-panel {
  /* 透明背景、无边框；节奏完全由统一 gap 控制，避免层层套框 */
  gap: 18px;
}
.journal-panel-head { display: flex; align-items: center; justify-content: space-between; }
.journal-panel-head .field-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.journal-count { font-family: var(--sans); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.journal-sub { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; text-wrap: pretty; }

/* 列表：每条是一张柔和填充便签卡（无描边，靠浅底 + 圆角 + 左强调条区分），
   卡片间留足间隙，干净、透气、不挤成一团 */
.journal-list { display: flex; flex-direction: column; gap: 12px; }
.jnote {
  position: relative;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 13px 38px 14px 15px;
}
.jnote .jdate {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px; padding: 3px 10px;
}
.jnote .jtext {
  margin: 8px 0 0;
  font-size: 14.5px; line-height: 1.6; color: var(--ink);
  word-break: break-word; white-space: pre-wrap;
  text-wrap: pretty;
}
.jdel {
  position: absolute; top: 10px; right: 10px;
  appearance: none; border: none; background: none;
  color: var(--faint); font-size: 16px; line-height: 1; cursor: pointer;
  border-radius: 6px; width: 22px; height: 22px; padding: 0;
  transition: color 0.14s ease, background 0.14s ease;
}
.jdel:hover { color: var(--danger); background: var(--danger-soft); }

/* 输入区：作为独立的「写新一条」区块，与上方列表用留白自然分隔，带清晰小标题 */
.journal-composer { margin-top: 0; }
.composer-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 9px; }
.journal-composer textarea {
  width: 100%;
  font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 13px; background: var(--surface);
  resize: vertical; min-height: 52px; line-height: 1.5;
}
.journal-composer textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.journal-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.journal-hint { font-size: 12px; color: var(--muted); }
.btn-sm { padding: 7px 15px; font-size: 13.5px; }

/* ---------- 瓶子管理（编辑弹窗） ---------- */
.bottle-panel { gap: 14px; }
.bottle-list { display: flex; flex-direction: column; gap: 10px; }
.bottle-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.bottle-row.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.bottle-idx { font-size: 13px; font-weight: 600; color: var(--muted); flex: 0 0 auto; min-width: 42px; }
.bottle-row.active .bottle-idx { color: var(--accent-ink); }
.bottle-total {
  width: 64px; font-family: var(--sans); font-size: 14px; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 8px; background: var(--surface); text-align: center;
}
.bottle-total:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bottle-unit { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
.bottle-status { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottle-row.active .bottle-status { color: var(--accent-ink); font-weight: 600; }
.bottle-act {
  flex: 0 0 auto; font-size: 12.5px; padding: 5px 11px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bottle-act:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.bottle-del {
  flex: 0 0 auto; appearance: none; border: none; background: none;
  color: var(--faint); font-size: 17px; line-height: 1; cursor: pointer;
  border-radius: 6px; width: 24px; height: 24px; padding: 0;
  transition: color 0.14s ease, background 0.14s ease;
}
.bottle-del:hover { color: var(--danger); background: var(--danger-soft); }

/* 记录页的体验信息流：与弹窗便签卡一致的语言（柔和填充、无描边、左强调条） */
.journal-feed { display: flex; flex-direction: column; gap: 12px; }
.jfeed {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 16px 14px;
}
.jfeed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.jfeed-ico { font-size: 17px; }
.jfeed-name { font-weight: 600; font-size: 14.5px; }
.jfeed-date {
  margin-left: auto; font-size: 11.5px; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 9px;
  font-family: var(--serif); font-variant-numeric: tabular-nums;
}
.jfeed-text { font-size: 14.5px; line-height: 1.6; color: var(--ink); word-break: break-word; white-space: pre-wrap; }

/* ---------- 已归档（吃完了的补给）---------- */
.archive-box {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.archive-box summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 2px;
  user-select: none;
}
.archive-box summary::-webkit-details-marker { display: none; }
.archive-box summary::before {
  content: '▸';
  font-size: 11px;
  color: var(--faint);
}
.archive-box[open] summary::before { content: '▾'; }
.archive-box .card-list { margin-top: 14px; }
.card.archived { opacity: 0.72; }
.pill.done-pill {
  background: var(--surface-2);
  color: var(--muted);
  border: none;
}

/* ---------- 回收站 + 确认弹窗 ---------- */
.trash-box { margin-top: 22px; }
.trash-hint {
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  margin: 10px 2px 4px;
}
.card.trashed { opacity: 0.78; }
.card.trashed .ico { filter: grayscale(0.55); }
.muted-pill {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.danger-btn { color: var(--faint); }
.danger-btn:hover { color: var(--danger); background: var(--danger-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }

/* 页面内确认弹窗（替代原生 confirm） */
.modal-overlay.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(28, 28, 26, 0.42);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 60;
  animation: fade-in 0.14s ease;
}
.confirm-modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 22px 22px 18px;
  width: 100%; max-width: 360px;
  box-shadow: 0 18px 50px rgba(28, 28, 26, 0.22);
}
.confirm-title { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.confirm-msg { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 18px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-actions .btn { flex: 0 0 auto; }
/* 补打卡弹层 */
.bf-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.bf-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.bf-row.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.bf-icon { font-size: 18px; width: 22px; text-align: center; flex: 0 0 auto; }
.bf-name { flex: 1; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-toggle { flex: 0 0 auto; font-size: 13px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); cursor: pointer; }
.bf-row.on .bf-toggle { color: #fff; background: var(--accent); border-color: var(--accent); }
#heat .cell { cursor: pointer; }
#heat .cell:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.heat-hint { margin: 8px 0 0; font-size: 12.5px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 540px) {
  .today-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .stats { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 23px; }
}
