/* ===== 变量与基础 ===== */
:root {
  --bg: #faf6f0;
  --bg-warm: #f5efe6;
  --card: #fffdf9;
  --text: #4a403a;
  --text-light: #8a8078;
  --text-dim: #b0a8a0;
  --s-color: #e8a87c;
  --s-bg: #fce8d8;
  --s-light: #f7e6d8;
  --laohu-color: #7ba978;
  --laohu-bg: #d8edda;
  --laohu-light: #e0f0e2;
  --common-rest: #fff3e0;
  --common-rest-border: #ffd9a0;
  --accent: #e8a87c;
  --border: #ebe0d5;
  --shadow: 0 2px 8px rgba(120, 100, 80, 0.08);
  --shadow-lg: 0 4px 20px rgba(120, 100, 80, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

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

@media (max-width: 768px) {
  * { -webkit-tap-highlight-color: transparent; }
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-warm); box-shadow: var(--shadow); }
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-text { border: none; background: transparent; color: var(--text-light); }
.btn-text:hover { background: var(--bg-warm); color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #d4906a; }
.btn-danger { color: #c44; border-color: #e0c0c0; }
.btn-danger:hover { background: #fce8e8; }
.laohu-btn { background: var(--laohu-bg); border-color: var(--laohu-color); color: #4a6a48; }
.laohu-btn:hover { background: var(--laohu-light); }
.btn-today { color: var(--accent); border-color: var(--accent); }

/* ===== 屏幕切换 ===== */
.screen { min-height: 100vh; }

/* ===== 身份选择页 ===== */
#identity-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-warm) 100%);
}
.identity-container { text-align: center; }
.app-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.app-subtitle {
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 40px;
}
.identity-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.identity-card {
  width: 140px;
  height: 160px;
  background: var(--card);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s;
  border: 2px solid transparent;
}
.identity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(120, 100, 80, 0.18);
}
.identity-card[data-person="s"]:hover { border-color: var(--s-color); }
.identity-card[data-person="laohu"]:hover { border-color: var(--laohu-color); }
.identity-emoji { font-size: 52px; margin-bottom: 8px; }
.identity-name { font-size: 18px; font-weight: 600; color: var(--text); }
.identity-divider { font-size: 24px; color: var(--text-dim); }

/* ===== 顶部栏 ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.header-left, .header-right { display: flex; align-items: center; gap: 6px; }
.header-center { font-size: 14px; color: var(--text-light); text-align: center; }
.current-identity {
  font-weight: 600;
  font-size: 15px;
}
.current-identity .id-emoji { font-size: 20px; margin-right: 4px; }
.current-identity.s-name { color: var(--s-color); }
.current-identity.laohu-name { color: var(--laohu-color); }

#common-rest-info { font-size: 13px; }

/* ===== 今日心情 ===== */
.mood-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-warm);
  flex-wrap: wrap;
}
.mood-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.mood-card.s-person { border-left: 3px solid var(--s-color); }
.mood-card.laohu-person { border-left: 3px solid var(--laohu-color); }
.mood-card .mood-emoji { font-size: 24px; }
.mood-card .mood-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mood-card.s-person .mood-name { color: var(--s-color); }
.mood-card.laohu-person .mood-name { color: var(--laohu-color); }
.mood-card .mood-text { font-size: 13px; color: var(--text-light); max-width: 180px; }
.mood-card .mood-empty { font-size: 12px; color: var(--text-dim); }

/* ===== 页面路由 ===== */
.page { display: none; }
.page.active { display: block; }
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 20px; font-weight: 700; flex: 1; }
.page-back {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.page-back:hover { background: var(--bg-warm); }
.page-body { padding: 20px; max-width: 800px; margin: 0 auto; }

/* ===== 主内容区 ===== */
.app-main {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

/* ===== 日历区 ===== */
.calendar-section {
  flex: 1;
  min-width: 0;
  padding: 16px;
}
.calendar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.calendar-title {
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

/* 排班工具栏 */
.schedule-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.schedule-legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.legend-dot.s-color { background: var(--s-color); }
.legend-dot.laohu-color { background: var(--laohu-color); }
.legend-dot.common-rest { background: var(--common-rest); border: 1px solid var(--common-rest-border); }
.schedule-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 星期表头 */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
  padding: 6px 0;
}
.calendar-weekdays > div { padding: 4px; }
.calendar-weekdays > div:first-child,
.calendar-weekdays > div:last-child { color: #c9a088; }

/* 日历格子 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  cursor: pointer;
  background: var(--card);
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.cal-cell:hover { box-shadow: var(--shadow); border-color: #d8c8b8; }
.cal-cell.other-month { opacity: 0.4; background: var(--bg); }
.cal-cell.today {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 168, 124, 0.15);
}
.cal-cell.selected { border-color: var(--accent); background: #fff8f0; }
.cal-cell.common-rest {
  background: var(--common-rest);
  border-color: var(--common-rest-border);
}
.cal-cell.common-rest.today { border: 2px solid var(--accent); }

.cal-day-num {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}
.cal-cell.today .cal-day-num { color: var(--accent); }
.cal-cell.other-month .cal-day-num { color: var(--text-dim); }

/* 排班状态行 */
.cal-schedule-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  padding-top: 2px;
}
.cal-schedule-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
}
.cal-schedule-item .sched-label {
  font-size: 10px;
  color: var(--text-dim);
}
/* 圆点状态标记 */
.sched-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* 上班 = 实心圆点 */
.sched-dot.work.s-person { background: var(--s-color); }
.sched-dot.work.laohu-person { background: var(--laohu-color); }
/* 休息 = 空心圆环 */
.sched-dot.rest.s-person { border: 2px solid var(--s-color); background: transparent; }
.sched-dot.rest.laohu-person { border: 2px solid var(--laohu-color); background: transparent; }
/* 未设置 = 灰色小点 */
.sched-dot.unset.s-person,
.sched-dot.unset.laohu-person {
  width: 6px; height: 6px;
  background: var(--border);
  margin: 4px;
}

/* 标记图标 */
.cal-markers {
  display: flex;
  gap: 2px;
  font-size: 10px;
  margin-top: 2px;
}
.cal-marker {
  background: var(--bg-warm);
  border-radius: 2px;
  padding: 0 3px;
  font-size: 9px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cal-marker.has-diary { color: var(--accent); }
.cal-marker.has-arrangement { color: var(--laohu-color); }

/* ===== 日期详情侧栏 ===== */
.detail-section {
  width: 400px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--card);
  padding: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}
.detail-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-light);
}
.detail-empty p:first-child { font-size: 16px; margin-bottom: 4px; }
.detail-hint { font-size: 13px; color: var(--text-dim); }

.detail-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-date-title {
  font-size: 18px;
  font-weight: 700;
}
.detail-date-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}
.detail-schedule-mini {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.detail-schedule-card {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
}
.detail-schedule-card.s-person { background: var(--s-light); }
.detail-schedule-card.laohu-person { background: var(--laohu-light); }
.detail-schedule-card .ds-name { font-weight: 600; font-size: 12px; }
.detail-schedule-card .ds-status { font-size: 16px; font-weight: 700; margin-top: 2px; }
.detail-schedule-card .ds-status.work { color: #c47a3a; }
.detail-schedule-card .ds-status.rest { color: var(--laohu-color); }
.detail-schedule-card .ds-status.unset { color: var(--text-dim); font-size: 13px; }

/* 详情区块标题 */
.detail-section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 安排列表 */
.arrangement-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--laohu-color);
}
.arrangement-item.completed { opacity: 0.55; text-decoration: line-through; border-left-color: var(--text-dim); }
.arrangement-item.participant-s { border-left-color: var(--s-color); }
.arrangement-item.participant-laohu { border-left-color: var(--laohu-color); }
.arrangement-item .arr-title { font-weight: 600; font-size: 14px; }
.arrangement-item .arr-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.arrangement-item .arr-actions { display: flex; gap: 4px; margin-top: 6px; }
.arrangement-item .arr-note { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* 日记 */
.diary-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.diary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.diary-author {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
.diary-author.s-person { color: var(--s-color); }
.diary-author.laohu-person { color: var(--laohu-color); }
.diary-time { font-size: 11px; color: var(--text-dim); }
.diary-content {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
  line-height: 1.7;
}
.diary-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.diary-img-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}
.diary-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.12s;
}
.diary-img:hover { transform: scale(1.05); }
.diary-img-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 11px;
  cursor: pointer;
  display: none;
}
.diary-img-wrap.editing .diary-img-delete { display: block; }

.diary-reactions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.reaction-btn {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
}
.reaction-btn:hover { background: var(--card); }
.reaction-count { font-size: 11px; color: var(--text-light); }
.reaction-mine { background: var(--s-bg); border-color: var(--s-color); }

.diary-actions { display: flex; gap: 4px; margin-top: 6px; }

/* 编辑表单 */
.edit-form { margin-bottom: 12px; }
.form-group { margin-bottom: 10px; }
.form-label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 4px; font-weight: 600; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 168, 124, 0.1);
}
.form-textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
.form-row { display: flex; gap: 8px; }
.form-row > * { flex: 1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* 图片上传 */
.img-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.img-upload-area:hover { border-color: var(--accent); color: var(--accent); }
.img-upload-area.has-files { border-style: solid; }
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.upload-preview img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

/* ===== 底部导航栏 ===== */
.nav-bar {
  display: flex;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 4px 0;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(120, 100, 80, 0.06);
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 4px;
  font-size: 11px;
  color: var(--text-light);
  cursor: pointer;
  text-align: center;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
}
.nav-item:hover { background: var(--bg-warm); color: var(--text); }
.nav-item.active { color: var(--accent); font-weight: 600; }
.nav-item.active::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  margin: 2px auto 0;
  border-radius: 1px;
}

.app-main { padding-bottom: 52px; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(74, 64, 58, 0.4);
  z-index: 200;
}
.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 90vw;
  max-height: 88vh;
  overflow-y: auto;
  z-index: 201;
  box-shadow: var(--shadow-lg);
  width: 480px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.modal-close {
  float: right;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-light);
  border: none;
  background: none;
}
.modal-close:hover { color: var(--text); }

/* ===== 图片预览 ===== */
.image-viewer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-viewer-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
}
.image-viewer img {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  z-index: 1;
  border-radius: 8px;
}
.image-viewer-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 400;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; } }

/* ===== 批量编辑模式 ===== */
.cal-cell.batch-mode { cursor: pointer; }
.cal-cell.batch-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 168, 124, 0.3);
}
.batch-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.batch-panel .batch-info { font-size: 13px; color: var(--text-light); margin-right: 8px; }

/* ===== 愿望清单 ===== */
.wishlist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.wishlist-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.wishlist-check.checked { background: var(--laohu-color); color: #fff; border-color: var(--laohu-color); }
.wishlist-text { flex: 1; font-size: 14px; }
.wishlist-item.completed .wishlist-text { text-decoration: line-through; color: var(--text-light); }
.wishlist-date { font-size: 11px; color: var(--text-dim); }
.wishlist-actions { display: flex; gap: 4px; }

/* ===== 本月回忆 ===== */
.memories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.memories-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}
.memories-card img { width: 100%; height: 100%; object-fit: cover; }
.memories-card .memories-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  text-align: center;
}
.memories-activity {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
  cursor: pointer;
}
.memories-activity:hover { background: var(--bg-warm); }

/* ===== Emoji选择器 ===== */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.emoji-option {
  font-size: 24px;
  text-align: center;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.emoji-option:hover { background: var(--bg-warm); }
.emoji-option.selected { background: var(--s-bg); }

/* ===== 移动端详情弹出层 ===== */
.detail-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  padding-bottom: 60px;
}
.detail-overlay.active { transform: translateY(0); }
.detail-overlay-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 8px auto 4px;
  cursor: pointer;
}
.detail-overlay-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 18px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.detail-overlay-close:active { color: var(--text); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .app-main { flex-direction: column; padding-bottom: 56px; }
  .calendar-section { padding: 8px; }

  /* 日历格子更大更易触摸 */
  .calendar-grid { gap: 3px; }
  .cal-cell { min-height: 76px; padding: 3px; }
  .cal-day-num { font-size: 14px; }
  .cal-schedule-item .status-text { font-size: 12px; font-weight: 700; }
  .cal-schedule-item .status-label { font-size: 9px; }
  .cal-marker { font-size: 8px; }

  /* 排班工具栏 */
  .schedule-toolbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .schedule-legend { justify-content: center; gap: 8px; }
  .schedule-actions { justify-content: flex-start; gap: 4px; }
  .schedule-actions .btn { font-size: 12px; padding: 6px 10px; }

  /* 详情面板改为隐藏，用弹出层替代 */
  .detail-section { display: none; }
  .detail-overlay { display: block; }
  .detail-overlay.hidden { display: none; }

  /* 顶部栏紧凑 */
  .app-header { padding: 6px 10px; gap: 4px; }
  .header-left { gap: 4px; }
  .header-right { display: none; }
  .header-center { display: none; }
  .current-identity { font-size: 14px; }
  .current-identity .id-emoji { font-size: 18px; }
  .btn-sm { padding: 5px 8px; font-size: 12px; }
  .btn-text { font-size: 12px; }

  /* 底部导航栏 */
  .nav-bar { display: flex; }
  .nav-item { font-size: 10px; padding: 6px 2px; }

  /* 弹窗近全屏 */
  .modal-container {
    width: 94vw;
    max-height: 90vh;
    padding: 16px;
    border-radius: 16px;
  }
  .form-input, .form-textarea, .form-select { font-size: 16px; padding: 10px; }
  .form-label { font-size: 14px; }

  /* 身份选择页 */
  .identity-card { width: 120px; height: 140px; }
  .identity-emoji { font-size: 44px; }
  .identity-name { font-size: 16px; }
  .app-title { font-size: 22px; }
  .app-subtitle { font-size: 14px; margin-bottom: 28px; }
  .identity-avatars { gap: 16px; }
  .identity-divider { font-size: 20px; }

  /* 日历表头 */
  .calendar-weekdays > div { font-size: 12px; padding: 2px; }
  .calendar-title { font-size: 17px; }

  /* 批量编辑面板 */
  .batch-panel { flex-wrap: wrap; padding: 8px 10px; }
  .batch-panel .batch-info { width: 100%; text-align: center; margin-bottom: 4px; }
  .batch-panel select { font-size: 14px !important; }

  /* 日记图片 */
  .diary-img, .diary-img-wrap { width: 64px; height: 64px; }
  .upload-preview img { width: 56px; height: 56px; }

  /* 回应按钮 */
  .reaction-btn { padding: 4px 10px; font-size: 18px; }

  /* 图片预览器关闭按钮 */
  .image-viewer-close { width: 36px; height: 36px; font-size: 16px; }
}
@media (min-width: 769px) {
  .nav-item { font-size: 13px; padding: 10px 8px; }
  .detail-overlay { display: none; }
}
