/* ============================================================
   手机 App 样式（离线自包含版）· 移动优先
   - 纯色平涂 + 2px 白/深粗边框，禁渐变/阴影/发光（与电脑端风格一致）
   - 底部固定 Tab 栏；触控目标 ≥44px；安全区适配
   ============================================================ */

:root {
  --ink: #2F2B26;
  --orange: #B07463;
  --blue: #7D93A9;
  --yellow: #C8B28B;
  --cream: #EDE5D7;
  --paper: #F3EDE1;
  --gray: #8A8178;
  --white: #FFFFFF;
  --danger: #B07463;
}

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

html, body { height: 100%; margin: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  /* 复古纸张网点（纯色，非阴影） */
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: 6px 6px;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.view {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px calc(70px + env(safe-area-inset-bottom));
}

/* 次级页返回条 */
.back-bar { margin-bottom: 8px; }
.back-bar .btn { min-height: 36px; }

/* ---------- 底部 Tab 栏 ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  min-height: 52px;
  background: var(--paper);
  border: none;
  border-right: 2px solid var(--ink);
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.tab-item:last-child { border-right: none; }
.tab-item.active { background: var(--orange); color: var(--cream); }
.tab-icon { font-size: 20px; line-height: 1; }

/* ---------- 通用卡片 ---------- */
.section {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 14px 12px;
  margin-bottom: 12px;
}
.section h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--ink);
}
.section-empty { color: var(--gray); font-weight: 600; }
.section.orange { background: var(--orange); color: var(--cream); }
.section.blue { background: var(--blue); color: var(--cream); }
.section.yellow { background: var(--yellow); color: var(--ink); }

/* ---------- 按钮 ---------- */
.btn {
  padding: 10px 14px;
  min-height: 42px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary { background: var(--orange); color: var(--cream); }
.btn-danger { background: var(--danger); color: var(--cream); }
.btn-sm { padding: 7px 10px; min-height: 34px; font-size: 13px; }

/* ---------- 输入控件 ---------- */
input[type="text"], input[type="search"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
}
label { font-weight: 700; }

/* ---------- 底部抽屉弹窗 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(47, 43, 38, 0.5);
  display: flex;
  align-items: flex-end;
  z-index: 100;
}
.sheet {
  width: 100%;
  max-height: 88vh;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 900; }
.sheet-close { background: none; border: 2px solid var(--ink); border-radius: 2px; font-size: 14px; width: 34px; height: 34px; cursor: pointer; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  right: 12px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast-item {
  background: var(--ink);
  color: var(--cream);
  border: 2px solid var(--ink);
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast-item.show { opacity: 1; transform: none; }

/* ---------- 首页：顶部 ---------- */
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.home-date { font-size: 18px; font-weight: 900; }
.home-lunar { font-size: 12px; font-weight: 700; color: var(--gray); }
.home-weekline { font-size: 12px; font-weight: 800; color: var(--orange); width: 100%; }

/* ---------- 首页：四宫格（一览无余） ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.grid-cell {
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 92px;
  cursor: pointer;
}
.grid-icon { font-size: 20px; line-height: 1; }
.grid-num { font-size: 22px; font-weight: 900; line-height: 1.15; }
.grid-label { font-size: 13px; font-weight: 800; }
.grid-sub { font-size: 11px; opacity: 0.85; }
.grid-todo { background: var(--blue); color: var(--cream); }
.grid-habit { background: var(--yellow); color: var(--ink); }
.grid-exam { background: var(--orange); color: var(--cream); }
.grid-grade { background: var(--paper); color: var(--ink); }

/* ---------- 首页：今日计划 ---------- */
.plan-section h2 small { font-size: 12px; color: var(--gray); }
.plan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  border-bottom: 2px solid var(--ink);
  min-height: 42px;
}
.plan-row:last-of-type { border-bottom: none; }
.plan-row.done .plan-title { text-decoration: line-through; opacity: 0.55; }
.plan-check {
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.plan-jump { width: 30px; text-align: center; font-size: 16px; flex-shrink: 0; }
.plan-time { font-size: 12px; color: var(--gray); flex-shrink: 0; min-width: 44px; }
.plan-title { flex: 1; font-size: 15px; }

/* ---------- 首页：快速备忘 ---------- */
.memo-add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.memo-add-row input { flex: 1; }
.memo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 2px solid var(--ink);
}
.memo-row:last-of-type { border-bottom: none; }
.memo-text { flex: 1; font-size: 14px; }

/* ---------- 首页：底部快捷条 ---------- */
.quickbar {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.quickbar .quick-add { flex: 1; }

/* ---------- 首页：工具组 / 统计 ---------- */
.home-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.home-tools .btn { flex: 1; min-width: 30%; }
.text-result {
  max-height: 55vh;
  overflow-y: auto;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 2px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-all;
}
.text-result .md-h2 { font-size: 16px; font-weight: 900; margin: 8px 0 4px; }
.text-result .md-h3 { font-size: 14px; font-weight: 900; margin: 6px 0 3px; }
.text-result .md-p { margin: 3px 0; }
.text-result .md-li { margin: 2px 0; }
.text-result .md-table { font-size: 12px; color: var(--gray); }
.text-result .md-hr { border: 0; border-top: 2px solid var(--ink); margin: 6px 0; }
.stat-title { font-size: 14px; font-weight: 900; margin: 10px 0 6px; }
.stat-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.stat-label { width: 64px; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.stat-bar { flex: 1; height: 12px; border: 2px solid var(--ink); background: var(--cream); }
.stat-fill { display: block; height: 100%; background: var(--blue); }
.stat-val { width: 78px; font-size: 11px; color: var(--gray); text-align: right; flex-shrink: 0; }

/* ---------- 更多页 ---------- */
.more-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 10px;
  margin-bottom: 8px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.more-icon { font-size: 20px; }
.more-main { flex: 1; display: flex; flex-direction: column; }
.more-desc { font-size: 11px; font-weight: 600; color: var(--gray); }
.more-arrow { font-size: 20px; color: var(--gray); }

/* ---------- 待办页 ---------- */
.todo-title-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.todo-title-line h1 { margin: 0; font-size: 20px; font-weight: 900; }
.mode-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.mode-tab {
  flex: 1;
  padding: 9px 0;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.mode-tab.active { background: var(--orange); color: var(--cream); }
.todo-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.todo-toolbar input { flex: 1; }
.todo-toolbar .todo-cat { width: 104px; flex-shrink: 0; padding: 8px; }
.todo-filters { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.mini-check { font-size: 13px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* 日历翻页导航（‹ › 与标题紧凑居中，今天按钮稍远） */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 8px; }
.cal-title { font-size: 15px; font-weight: 900; padding: 0 8px; min-width: 100px; text-align: center; }
#cal-today-btn { margin-left: 12px; }

/* 年视图 */
.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.year-cell {
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.year-cell.cur { background: var(--orange); color: var(--cream); }
.year-month { font-size: 16px; font-weight: 900; }
.year-sub { font-size: 11px; opacity: 0.8; }

/* 课表视图（星期×课程） */
.sched-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sched-cell {
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  min-height: 120px;
  padding: 4px;
  cursor: pointer;
}
.sched-cell.today { background: var(--orange); color: var(--cream); }
.sched-label { font-size: 11px; font-weight: 900; margin-bottom: 3px; }
.sched-row {
  border-bottom: 2px solid var(--ink);
  padding: 2px 0;
  font-size: 10px;
  line-height: 1.35;
}
.sched-row:last-of-type { border-bottom: none; }
.sched-time { display: block; font-weight: 900; }
.sched-title { display: block; }
.sched-loc, .sched-sec { display: block; opacity: 0.75; }
.sched-empty { font-size: 10px; opacity: 0.5; }

/* ⋯ 更多 / 标签 / 任务组 */
.more-actions { display: flex; flex-direction: column; gap: 8px; }
.more-act {
  width: 100%;
  padding: 13px 12px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.tag-add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.tag-add-row input { flex: 1; }
.tag-list { display: flex; flex-direction: column; gap: 6px; }
.tag-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px; }
.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.weekday-btn.selected { background: var(--orange); color: var(--cream); }
.group-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  border-bottom: 2px solid var(--ink);
}
.group-row:last-of-type { border-bottom: none; }
.group-main { flex: 1; min-width: 0; }
.group-title { font-size: 15px; font-weight: 800; }
.group-meta { font-size: 12px; color: var(--gray); }

.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 6px;
  border-bottom: 2px solid var(--ink);
  min-height: 56px;
  touch-action: pan-y;
}
.todo-row:last-of-type { border-bottom: none; }
.todo-row.done .todo-title { text-decoration: line-through; opacity: 0.5; }
.todo-row.overdue .todo-title { color: var(--danger); }
.todo-check {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 15px; font-weight: 800; word-break: break-all; }
.todo-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--gray); margin-top: 2px; }
.todo-edit {
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--paper);
}
.overdue-tag { color: var(--danger); font-weight: 900; }
.tag {
  display: inline-block;
  padding: 1px 6px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 800;
  background: var(--yellow);
}
.tag-warn { background: var(--orange); color: var(--cream); }
.tag-course { background: var(--blue); color: var(--cream); }
.tag.prio-P1 { background: var(--orange); color: var(--cream); }
.tag.prio-P2 { background: var(--yellow); color: var(--ink); }
.tag.prio-P3 { background: var(--blue); color: var(--cream); }

/* ---------- 周/月日历网格 ---------- */
.cal-grid { display: grid; gap: 4px; }
.cal-grid.week { grid-template-columns: repeat(7, 1fr); }
.cal-grid.month { grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  min-height: 52px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;            /* 格子可点（进日视图） */
  touch-action: manipulation;
}
.cal-cell:active { transform: scale(0.94); }   /* 按压反馈 */
.cal-cell.today { background: var(--orange); color: var(--cream); }
.cal-cell.out { opacity: 0.35; }
.cal-cell.has-overdue .cal-day { color: var(--danger); font-weight: 900; }
.cal-day { font-size: 15px; font-weight: 900; }
.cal-label { font-size: 10px; opacity: 0.8; }
.cal-dots { display: flex; gap: 2px; flex-wrap: wrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); display: inline-block; }
.dot.more { width: auto; height: auto; font-size: 9px; font-style: normal; background: none; }
.cal-cell.today .dot { background: var(--cream); }

/* ---------- 全屏表单 ---------- */
.form-grid { display: flex; flex-direction: column; gap: 10px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 800; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }
.form-actions .btn { flex: 1; }

/* ---------- 资料页 ---------- */
.mat-folder { margin-bottom: 8px; }
.mat-tools { display: flex; gap: 8px; }
.mat-tools .mat-folder { flex: 1; margin-bottom: 8px; }
.mat-list { padding: 6px 10px; }
.mat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 2px solid var(--ink);
  min-height: 56px;
}
.mat-row:last-of-type { border-bottom: none; }
.mat-thumb { width: 48px; height: 48px; object-fit: cover; border: 2px solid var(--ink); border-radius: 2px; flex-shrink: 0; }
.mat-full { width: 100%; border: 2px solid var(--ink); border-radius: 2px; margin: 4px 0; }
.mat-main { flex: 1; min-width: 0; }
.mat-title { font-size: 15px; font-weight: 800; word-break: break-all; }
.mat-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--gray); margin-top: 2px; }
.mat-budget { margin-top: 8px; font-size: 12px; }

/* ---------- 习惯页 ---------- */
.habit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.habit-name { font-size: 16px; font-weight: 900; flex: 1; }
.habit-meta { font-size: 12px; color: var(--gray); }
.habit-cal { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.habit-cell {
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--cream);
  cursor: pointer;
  padding: 0;
}
.habit-cell.hit { background: var(--blue); }
.habit-cell.backfill { background: var(--orange); }
.habit-actions .btn { width: 100%; }

/* ---------- 考试页 ---------- */
.exam-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 2px;
  border-bottom: 2px solid var(--ink);
}
.exam-row:last-of-type { border-bottom: none; }
.exam-row.urgent { background: var(--cream); }
.exam-row.urgent .exam-subject { color: var(--danger); }
.exam-main { flex: 1; min-width: 0; }
.exam-subject { font-size: 15px; font-weight: 800; }
.exam-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }
.exam-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ---------- 成绩页 ---------- */
.gpa-box { text-align: center; }
.gpa-num { font-size: 40px; font-weight: 900; line-height: 1.1; }
.gpa-label { font-size: 13px; color: var(--gray); margin-top: 4px; }
.grade-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 2px solid var(--ink);
}
.grade-row:last-of-type { border-bottom: none; }
.grade-main { flex: 1; min-width: 0; }
.grade-subject { font-size: 15px; font-weight: 800; }
.grade-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }
.grade-score { font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.grade-group-title { border-bottom: 3px solid var(--ink); padding-bottom: 6px; margin: 0 0 10px; font-size: 18px; font-weight: 900; }
.grade-group-title small { font-size: 12px; color: var(--gray); }

/* ---------- 回收站页 ---------- */
.trash-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 2px;
  border-bottom: 2px solid var(--ink);
}
.trash-row:last-of-type { border-bottom: none; }
.trash-main { flex: 1; min-width: 0; }
.trash-title { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; word-break: break-all; }
.trash-meta { font-size: 11px; color: var(--gray); margin-top: 2px; }

/* ---------- 设置页 ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.set-label { display: block; font-size: 12px; font-weight: 800; color: var(--gray); margin: 6px 0 4px; }
.set-status { font-size: 12px; color: var(--gray); }

/* ---------- 深色模式（沿用电脑端规格） ---------- */
body.dark {
  --cream: #1E1E24;
  --paper: #2C2831;
  --ink: #F8F8F8;
  --gray: #B9B9C2;
  --orange: #704838;
  --blue: #294266;
  --yellow: #2F4861;
  --danger: #5E3338;
  background-image: radial-gradient(rgba(248, 248, 248, 0.16) 1px, transparent 1px);
}
body.dark * { border-color: #FFFFFF !important; }
body.dark .tabbar, body.dark .tab-item { background: #2D2830; color: #F8F8F8; }
body.dark .tab-item.active { background: #3A353F; }
body.dark input, body.dark textarea, body.dark select { background: #1F1B22; color: #FFFFFF; }
body.dark .section, body.dark .sheet { background: #2C2831; color: #F8F8F8; }
body.dark .btn { background: #2D2932; color: #F8F8F8; }
body.dark .btn-primary { background: #2F4861; color: #FFFFFF; }
body.dark .sheet-mask { background: rgba(0, 0, 0, 0.65); }
body.dark .grid-todo { background: #294266; }
body.dark .grid-habit { background: #2F4861; color: #FFFFFF; }
body.dark .grid-exam { background: #704838; }
body.dark .grid-grade { background: #38343C; color: #F8F8F8; }
body.dark .more-row { background: #2D2932; color: #F8F8F8; }
body.dark .home-lunar, body.dark .plan-time, body.dark .more-desc, body.dark .more-arrow { color: #B9B9C2; }
body.dark .plan-row { border-color: #FFFFFF; }
body.dark .memo-row { border-color: #FFFFFF; }
body.dark .tag { background: #2D2932; color: #F8F8F8; }
body.dark .tag-warn { background: #5E3338; color: #FFFFFF; }
body.dark .tag.prio-P1 { background: #5E3338; color: #FFFFFF; }
body.dark .tag.prio-P2 { background: #2F4861; color: #FFFFFF; }
body.dark .tag.prio-P3 { background: #38343C; color: #FFFFFF; }
body.dark .todo-check { border-color: #FFFFFF; }
body.dark .todo-edit { background: #2D2932; color: #F8F8F8; }
body.dark .mode-tab { background: #2D2932; color: #F8F8F8; }
body.dark .mode-tab.active { background: #3A353F; }
body.dark .cal-cell { background: #2D2932; color: #F8F8F8; }
body.dark .cal-cell.today { background: #704838; color: #FFFFFF; }
body.dark .dot { background: #F8F8F8; }
body.dark .cal-cell.today .dot { background: #FFFFFF; }
body.dark .exam-row.urgent { background: #2C2831; }
body.dark .habit-cell { background: #1E1E24; }
body.dark .grade-row, body.dark .trash-row, body.dark .mat-row, body.dark .exam-row { border-color: #FFFFFF; }
body.dark .year-cell { background: #2D2932; color: #F8F8F8; }
body.dark .year-cell.cur { background: #704838; color: #FFFFFF; }

/* ---------- 药品页 ---------- */
.med-row { margin-bottom: 10px; padding: 10px 12px; }
.med-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.med-name { font-weight: 800; font-size: 15px; }
.med-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }
.tag-danger { background: #A34A3F; color: #FFFFFF; border-radius: 2px; padding: 1px 6px; font-size: 11px; font-weight: 800; }
body.dark .tag-danger { background: #5E3338; }

/* ---------- 仪表盘 ---------- */
.dash-card { margin-bottom: 10px; padding: 12px; }
.dash-card[data-goto] { cursor: pointer; }
.dash-card-title { font-weight: 900; font-size: 15px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.dash-card-body { font-size: 13px; }
.dash-line { margin: 4px 0; overflow-wrap: anywhere; }
.dash-empty { color: var(--gray); font-size: 12px; padding: 4px 0; }

/* ---------- jiajun_ovo 水印（右下角，点击弹联系方式） ---------- */
.mobile-watermark {
  position: fixed;
  right: 10px;
  bottom: calc(58px + env(safe-area-inset-bottom));
  z-index: 999;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--gray);
  opacity: 0.45;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 6px;
}
body.dark .mobile-watermark { color: #A9A29A; }

/* ---------- 标签勾选框（关联药品选择）紧贴选项 ---------- */
.tag-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  vertical-align: middle;
  font-weight: 700;
  cursor: pointer;
}
.tag-checkbox input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--orange);
}
