/* ============================================================
   基础按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-success { background: #4CAF50; color: #fff; }
.btn-danger { background: #F44336; color: #fff; }

/* ============================================================
   表单
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-input,
.form-select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid #E8E8E8;
  border-radius: 12px;
  font-size: 15px;
  background: #FAFAFA;
  transition: border-color 0.2s;
  font-family: inherit;
  color: var(--text);
  line-height: 1.2;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.form-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
}
.form-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  border: 1.5px solid #E8E8E8;
  border-radius: 12px;
  font-size: 15px;
  background: #FAFAFA;
  transition: border-color 0.2s;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
}
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* ============================================================
   猫猫币徽章
   ============================================================ */
.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 18px;
}
.coin-badge.negative { background: #FFEBEE; color: var(--danger); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 9999;
  animation: toastIn 0.18s ease-out;
  max-width: 80%;
  text-align: center;
  word-break: break-word;
  pointer-events: none;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
  z-index: 10;
  touch-action: manipulation;
}
.login-logo { font-size: 64px; margin-bottom: 8px; }
.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.login-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 40px; }
.login-form { width: 100%; max-width: 320px; }

/* ============================================================
   个人主页头部
   ============================================================ */
.profile-header { text-align: center; padding: 24px 0 16px; }
.profile-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  font-size: 72px;
  line-height: 1;
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-coin { margin-top: 12px; }

/* ============================================================
   悬浮发布按钮
   ============================================================ */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(80px + var(--safe-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  border: none;
  box-shadow: 0 4px 16px rgba(255, 107, 138, 0.4);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.25s ease;
  touch-action: none;      /* 新增：防止拖拽时页面跟着滑动 */
  user-select: none;       /* 新增：防止长按选中 */
  -webkit-user-select: none;
}
.fab:active { transform: scale(0.92); }

/* ============================================================
   任务卡片
   ============================================================ */
.task-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.task-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.task-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.task-reward {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}
.task-deadline.urgent { color: var(--danger); }

/* 状态标签 */
.status-published { background: #E3F2FD; color: #1976D2; }
.status-assigned { background: #FFF3E0; color: #F57C00; }
.status-completed { background: #E8F5E9; color: #388E3C; }
.status-cancelled { background: #FFEBEE; color: #D32F2F; }
.status-expired { background: #F3E5F5; color: #7B1FA2; }
html[data-theme="dark"] .status-expired { background: #2A1A3A; color: #CE93D8; }

/* ============================================================
   弹窗
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s;
}
.modal-sheet {
  width: 100%;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  animation: slideUp 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

/* ============================================================
   时间线
   ============================================================ */
.timeline-list { padding-left: 4px; }
.timeline-item {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
}
.timeline-dot-wrap { flex-shrink: 0; padding-top: 4px; }
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}
.timeline-dot.publish { background: #1976D2; }
.timeline-dot.assign { background: #F57C00; }
.timeline-dot.complete { background: #388E3C; }
.timeline-dot.cancel { background: #D32F2F; }
.timeline-dot.postpone { background: #7B1FA2; }
.timeline-dot.update { background: #9C27B0; box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.15); }
.timeline-dot.user-uu { background: #FF6B8A; box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.15); }
.timeline-dot.user-dd { background: #6B8AFF; box-shadow: 0 0 0 3px rgba(107, 138, 255, 0.15); }
.timeline-dot.user-other { background: #9E9E9E; box-shadow: 0 0 0 3px rgba(158, 158, 158, 0.15); }
.timeline-line {
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -20px;
  width: 2px;
  background: #E0E0E0;
}
.timeline-content {
  flex: 1;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.timeline-text {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 4px;
  color: var(--text);
}
.timeline-text strong { color: var(--primary); }
.timeline-time {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============================================================
   商品卡片
   ============================================================ */
.shop-card {
  display: flex;
  gap: 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.shop-image {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--primary-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  overflow: hidden;
}
.shop-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.shop-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}
.shop-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-seller {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.shop-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.shop-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

/* ============================================================
   统计卡片
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.stat-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 简易柱状图 */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  padding-top: 10px;
}
.chart-bar {
  flex: 1;
  background: var(--primary-light);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.6s ease;
  position: relative;
}
.chart-bar.today { background: var(--primary); }

/* ============================================================
   任务操作小按钮
   ============================================================ */
.task-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 10px;
}
.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  line-height: 1;
}
.btn-mini:active { transform: scale(0.94); }
.btn-mini:disabled { opacity: 0.5; pointer-events: none; }
.btn-mini-complete { background: #E8F5E9; color: #388E3C; }
.btn-mini-postpone { background: #FFF3E0; color: #E65100; }
.btn-mini-cancel { background: #FFEBEE; color: #D32F2F; }

/* ============================================================
   iOS 风格滚轮日期选择器
   ============================================================ */
.picker-sheet { max-height: 78vh; }
.picker-preview {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 0 14px;
  letter-spacing: 0.5px;
}
.picker-wheels {
  display: flex;
  gap: 4px;
  position: relative;
  padding: 0 4px;
}
.picker-column {
  flex: 1;
  height: 200px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  text-align: center;
  position: relative;
}
.picker-column::-webkit-scrollbar { display: none; }
.picker-padding { height: 80px; }
.picker-item {
  height: 40px;
  line-height: 40px;
  scroll-snap-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: color 0.15s, font-size 0.15s, font-weight 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.picker-item.active {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}
.picker-highlight {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 40px;
  margin-top: -20px;
  pointer-events: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.picker-mask-top,
.picker-mask-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 80px;
  pointer-events: none;
  z-index: 6;
  background: var(--card-bg);
}
.picker-mask-top {
  top: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}
.picker-mask-bottom {
  bottom: 0;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, transparent 100%);
}
.picker-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ============================================================
   页面头部（带返回按钮）
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
}
.page-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.page-back:active { transform: scale(0.9); }
.page-header-title {
  font-size: 20px;
  font-weight: 700;
  flex: 1;
}

/* ============================================================
   筛选 Tab
   ============================================================ */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.filter-tab {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.filter-tab.active {
  background: var(--primary);
  color: #fff;
}

/* ============================================================
   个人主页任务行
   ============================================================ */
.section-title {
  display: flex;
  align-items: center;
  font-weight: 700;
  margin-bottom: 10px;
  gap: 8px;
}
.section-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}
.task-row {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.task-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.task-row-main { min-width: 0; }
.task-row-line1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.task-row-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.task-row-reward {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  flex-shrink: 0;
}
.task-row-time {
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.task-row-line2 {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   加载动画：三只跳动的猫爪
   ============================================================ */
.loading-cat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 80px 0;
  font-size: 26px;
  user-select: none;
}
.loading-cat span {
  display: inline-block;
  animation: hop 1.2s infinite ease-in-out;
  opacity: 0.35;
}
.loading-cat span:nth-child(1) { animation-delay: 0s; }
.loading-cat span:nth-child(2) { animation-delay: 0.15s; }
.loading-cat span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hop {
  0%, 60%, 100% { transform: translateY(0) scale(0.9); opacity: 0.35; }
  30% { transform: translateY(-8px) scale(1.05); opacity: 1; }
}

/* ============================================================
   主题切换按钮
   ============================================================ */
.theme-toggle {
  position: absolute;
  top: 16px;
  right: 22px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card-bg);
  border: none;
  box-shadow: var(--shadow);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.15s, background-color 0.3s;
  line-height: 1;
}
.theme-toggle:active { transform: scale(0.9); }

/* ============================================================
   状态/标签/优先级小标签
   ============================================================ */
.status-tag,
.task-tag,
.priority-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  flex-shrink: 0;
  white-space: nowrap;
}
.public-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  flex-shrink: 0;
  white-space: nowrap;
  background: #F3E5F5;
  color: #7B1FA2;
}
html[data-theme="dark"] .public-tag { background: #2A1A3A; color: #CE93D8; }

/* ============================================================
   标签选择器
   ============================================================ */
.tag-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all 0.15s;
  user-select: none;
}
.tag-option:active { transform: scale(0.95); }
.tag-option.selected {
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
html[data-theme="dark"] .tag-option {
  background: var(--input-bg);
  border-color: var(--border);
}

/* ============================================================
   优先级选择器
   ============================================================ */
.priority-picker {
  display: flex;
  gap: 8px;
}
.priority-option {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all 0.15s;
  user-select: none;
}
.priority-option:active { transform: scale(0.96); }
.priority-option.selected {
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
html[data-theme="dark"] .priority-option {
  background: var(--input-bg);
  border-color: var(--border);
}

/* 任务闪烁动画 */
@keyframes task-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.task-blink {
  animation: task-blink 1.1s ease-in-out infinite;
}

/* ============================================================
   附件选择器
   ============================================================ */
.attach-picker { margin-top: 6px; }
.attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.attach-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}
.attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attach-thumb-loading {
  background: var(--primary-light);
  animation: task-blink 1s infinite;
  color: var(--primary);
  font-size: 16px;
  cursor: default;
}
.attach-info {
  flex: 1;
  min-width: 0;
}
.attach-name {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-size {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.attach-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.attach-remove:active { background: var(--divider); }
.attach-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px dashed var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.attach-add-btn:active { background: var(--input-bg); }
.attach-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 附件展示 */
.attach-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.attach-display-item {
  border-radius: 8px;
  overflow: hidden;
  background: var(--input-bg);
  border: 1px solid var(--border);
}
.attach-display-image {
  width: 72px;
  height: 72px;
  cursor: pointer;
}
.attach-display-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attach-display-doc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
}
.attach-doc-icon { font-size: 18px; }
.attach-doc-name {
  font-size: 12px;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   图片预览
   ============================================================ */
.image-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}
.image-preview-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
}
.image-preview-close {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

/* ============================================================
   猫猫币 + 公共猫猫币 并排卡片
   ============================================================ */
.coin-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}
.coin-pair-item {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
  min-width: 0;
  text-align: center;
}
.coin-pair-item:active { transform: scale(0.97); }
.coin-pair-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.coin-pair-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coin-pair-value.negative { color: var(--danger); }

/* ============================================================
   iOS Toggle
   ============================================================ */
.ios-toggle {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}
.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ios-toggle .ios-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #E9E9EB;
  border-radius: 31px;
  transition: background 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.ios-toggle .ios-toggle-slider::before {
  content: '';
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.ios-toggle input:checked + .ios-toggle-slider { background: var(--primary); }
.ios-toggle input:checked + .ios-toggle-slider::before { transform: translateX(20px); }
.ios-toggle input:disabled + .ios-toggle-slider { opacity: 0.4; cursor: not-allowed; }
html[data-theme="dark"] .ios-toggle .ios-toggle-slider { background: #39393D; }

/* ============================================================
   iOS Segmented Control
   ============================================================ */
.ios-segmented {
  display: flex;
  padding: 2px;
  background: var(--input-bg);
  border-radius: 9px;
  gap: 2px;
  border: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}
.ios-segmented-item {
  flex: 1;
  text-align: center;
  padding: 7px 8px;
  font-size: 13px;
  border-radius: 7px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  font-family: inherit;
  border: none;
  background: transparent;
}
.ios-segmented-item.active {
  background: var(--card-bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ============================================================
   设置页
   ============================================================ */
.settings-group {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.settings-group-title {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 16px 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.settings-row-icon { font-size: 18px; flex-shrink: 0; }
.settings-row-label { font-size: 15px; color: var(--text); }
.settings-row-value { font-size: 13px; color: var(--text-secondary); }
.settings-row-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 0;
  line-height: 0;
}
.settings-row-arrow::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg);
}
.settings-row-clickable { cursor: pointer; }
.settings-row-clickable:active { background: var(--input-bg); }
.settings-row-danger .settings-row-label { color: var(--danger); }

/* ============================================================
   个人主页统计卡片（一行）
   ============================================================ */
.stat-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stat-card-main { display: flex; gap: 24px; flex: 1; }
.stat-card-item { display: flex; flex-direction: column; gap: 2px; }
.stat-card-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.stat-card-label {
  font-size: 11px;
  color: var(--text-secondary);
}
.stat-pk-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.stat-pk-btn:active { transform: scale(0.95); }

/* ============================================================
   最近动态
   ============================================================ */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-item:first-child { padding-top: 4px; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.activity-dot.user-uu { background: #FF6B8A; }
.activity-dot.user-dd { background: #6B8AFF; }
.activity-dot.user-other { background: #9E9E9E; }
.activity-content { flex: 1; min-width: 0; }
.activity-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.activity-text strong { color: var(--primary); font-weight: 700; }
.activity-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   头像
   ============================================================ */
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.avatar-clickable {
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}
.avatar-clickable:active { transform: scale(0.95); }
.avatar-loading {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
}
.avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  font-size: 18px;
  flex-shrink: 0;
}
.avatar-mini .avatar-image { width: 100%; height: 100%; }
.avatar-medium {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  font-size: 16px;
  flex-shrink: 0;
  vertical-align: middle;
}
.avatar-medium .avatar-image { width: 100%; height: 100%; }

/* ============================================================
   底部备案信息
   ============================================================ */
.footer-beian {
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.footer-beian a { color: var(--text-secondary); text-decoration: none; }
.footer-beian a:active { color: var(--primary); }

/* ============================================================
   密码显示/隐藏按钮
   ============================================================ */
.pwd-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  user-select: none;
  line-height: 1;
}
.pwd-eye:active { color: var(--primary); }

/* ============================================================
   日历
   ============================================================ */
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.cal-month-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--card-bg);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cal-nav-btn:active { background: var(--primary-light); }
.cal-week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 6px 0;
  font-weight: 600;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 4px;
}
.cal-week-header-cell { padding: 4px 0; }
.cal-week {
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--divider);
}
.cal-week:last-child { border-bottom: none; }
.cal-dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}
.cal-date {
  padding: 6px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: relative;
}
.cal-date.cal-today { color: var(--primary); }
.cal-date.cal-other-month { color: var(--text-secondary); opacity: 0.4; }
.cal-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  position: relative;
  margin-top: 2px;
}
.cal-cell-bg {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.cal-cell-bg:hover { background: var(--input-bg); }
.cal-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  font-size: 10px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
  height: 22px;
  margin: 1px 0;
  transition: transform 0.1s;
  z-index: 2;
}
.cal-bar:active { transform: scale(0.98); }
.cal-bar.continues-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.continues-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar-active { background: #FFE4E9; color: #C2185B; }
.cal-bar-done { background: #E8F5E9; color: #388E3C; }
.cal-bar-expired { background: #FFEBEE; color: #D32F2F; }
.cal-bar-public { }
html[data-theme="dark"] .cal-bar-active { background: #3D2630; color: #FF8FA5; }
html[data-theme="dark"] .cal-bar-done { background: #1A3A1A; color: #81C784; }
html[data-theme="dark"] .cal-bar-expired { background: #3A1A1A; color: #E57373; }
.cal-bar-avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.cal-bar-avatar-emoji {
  width: 14px;
  height: 14px;
  font-size: 12px;
  line-height: 14px;
  text-align: center;
  flex-shrink: 0;
}
.cal-bar-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.cal-bar-arrow {
  flex-shrink: 0;
  font-size: 8px;
  opacity: 0.7;
}
.cal-week-mini .cal-dates { margin-bottom: 4px; }
.cal-week-mini .cal-date { font-size: 12px; padding: 4px 0 2px; }
.cal-week-mini .cal-bar { height: 22px; font-size: 10px; }

/* ============================================================
   纪念日 Emoji 选择器
   ============================================================ */
.ann-emoji-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.ann-emoji-opt {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--input-bg);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ann-emoji-opt:active { transform: scale(0.92); }
.ann-emoji-opt.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.05);
}
html[data-theme="dark"] .ann-emoji-opt { background: var(--input-bg); }
html[data-theme="dark"] .ann-emoji-opt.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* ============================================================
   拍一拍
   ============================================================ */
.poke-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.poke-quick-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.15s;
}
.poke-quick-item:active { transform: scale(0.94); }
.poke-hint {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================================
   日常任务
   ============================================================ */
.weekday-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.weekday-opt {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--input-bg);
  border: 1.5px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.15s;
}
.weekday-opt:active { transform: scale(0.92); }
.weekday-opt.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.weekday-quick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.weekday-quick-item {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.weekday-quick-item:active { transform: scale(0.94); }

.recurring-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}
.recurring-card:active { transform: scale(0.98); }
.recurring-card.disabled { opacity: 0.55; }
.recurring-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.recurring-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.recurring-status-on { color: #4CAF50; font-weight: 600; }
.recurring-status-off { color: #999; font-weight: 600; }

.task-from-recurring {
  margin-bottom: 10px;
  font-size: 12px;
  color: #7B1FA2;
  background: #F3E5F5;
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
html[data-theme="dark"] .task-from-recurring {
  background: #2A1A3A;
  color: #CE93D8;
}

.pool-negative { color: var(--danger) !important; }

.recurring-toggle-wrap {
  flex-shrink: 0;
  padding-top: 2px;
}

/* ============================================================
   打卡表（带 !important 强制生效，防止缓存/冲突）
   ============================================================ */
.checkin-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.checkin-table {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.checkin-header {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  gap: 2px;
  justify-items: center;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}

.checkin-name-col {
  justify-self: start;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 4px;
  min-width: 0;
  line-height: 1.2;
}

.checkin-day-col {
  text-align: center;
  line-height: 1;
}
.checkin-day-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}
.checkin-day-num {
  font-size: 9px;
  color: var(--text-secondary);
  opacity: 0.55;
  margin-top: 1px;
}

.checkin-row {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  grid-auto-rows: 26px;
  gap: 2px;
  justify-items: center;
  align-items: center;
  margin-bottom: 2px;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
}
.checkin-row:last-child { margin-bottom: 0; }

.checkin-cell {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  aspect-ratio: auto !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s;
  line-height: 1;
  background: transparent;
  flex-shrink: 0;
  box-sizing: border-box;
}
.checkin-cell:active { transform: scale(0.88); }

.checkin-cell.done img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.checkin-cell.done span {
  font-size: 18px;
  line-height: 1;
}

.checkin-cell.fail {
  background: #FFEBEE;
  color: #D32F2F;
  font-weight: 700;
  font-size: 13px;
}
html[data-theme="dark"] .checkin-cell.fail {
  background: #3A1A1A;
  color: #E57373;
}

.checkin-cell.pending::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D0D0D0;
}
html[data-theme="dark"] .checkin-cell.pending::after {
  background: #4A4A4A;
}

.checkin-cell.cancelled::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #E5E5E5;
}
html[data-theme="dark"] .checkin-cell.cancelled::after {
  background: #333;
}

.checkin-cell.empty {
  background: transparent;
  cursor: default;
}
.checkin-cell.empty:active { transform: none; }

.checkin-stats { margin-top: 0; }
/* ===== 下拉刷新：页面下滑让位 ===== */
.pull-spacer {
  height: 0;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.25s ease;
}
.pull-spacer .pull-loading-cat {
  padding: 0;
  font-size: 22px;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.pull-spacer.visible .pull-loading-cat {
  opacity: 1;
}

/* ===== 统计页：全局卡片 ===== */
.global-stats {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.global-stat-cell {
  flex: 1;
  text-align: center;
  padding: 4px 0;
}
.global-stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.global-stat-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  margin-top: 4px;
}
.global-stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.global-stat-divider {
  width: 1px;
  background: var(--divider);
  flex-shrink: 0;
}

/* ===== 统计页：折线图 ===== */
.line-chart-wrap {
  width: 100%;
  padding: 4px 0;
}
.line-chart {
  width: 100%;
  height: 90px;
  display: block;
  overflow: visible;
}
.line-chart-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 0 2px;
}
.line-chart-current {
  color: var(--primary);
  font-weight: 700;
}

/* ===== 我们页面：双头像 ===== */
.couple-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.couple-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  line-height: 1;
  flex-shrink: 0;
  background: var(--input-bg);
}
.couple-heart {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  animation: heartbeat 1.6s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* ===== 猫猫币 3 卡片 ===== */
.coin-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 12px;
}
.coin-trio-item {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 6px;
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s;
  min-width: 0;
}
.coin-trio-item:active {
  transform: scale(0.97);
}
.coin-trio-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coin-trio-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coin-trio-value.negative {
  color: var(--danger);
}

/* ===== 统计简版行 ===== */
.stats-simple-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}
.stats-simple-row:last-child {
  border-bottom: none;
}
.stats-simple-name {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-simple-item {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex: 1;
  text-align: center;
}
.stats-simple-row > :nth-child(3) {
  text-align: right;
}
.stats-simple-item b {
  color: var(--primary);
  font-weight: 700;
}

/* ===== 对方任务：拍一拍按钮 ===== */
.btn-mini-poke {
  background: #FFF3E0;
  color: #E65100;
}

/* ===== 迷你头像（统计卡片、最近完成用） ===== */
.mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--input-bg);
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 2px;
}
.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}


/* ===== 搜索页 ===== */
.search-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: transform 0.15s;
  line-height: 1;
}
.search-filter-btn:active { transform: scale(0.95); }
.search-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.search-input-wrap {
  position: relative;
}
.search-input {
  padding-right: 40px;
}
.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.search-clear:active { background: var(--primary-light); color: var(--primary); }

.search-filter-group {
  margin-bottom: 12px;
}
.search-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.search-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.search-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.search-filter-chip:active { transform: scale(0.95); }
.search-filter-chip.active {
  background: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .search-filter-chip {
  background: var(--input-bg);
}

.search-history-card {
  padding: 14px 16px;
}
.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.search-history-clear {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}
.search-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.search-history-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.search-history-chip:active { transform: scale(0.95); }
.search-history-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 12px 0;
}

.search-result-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 8px;
  padding-left: 4px;
}

/* ===== 搜索页：筛选行（按钮 + 摘要） ===== */
.search-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 4px;
  min-height: 28px;
}
.search-filter-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.search-filter-summary-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.search-filter-summary-more {
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===== 首页卡片折叠 ===== */
.section-collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-left: 2px;
}
.section-collapse-icon::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.8px solid var(--text-secondary);
  border-bottom: 1.8px solid var(--text-secondary);
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.2s ease;
}
.section-collapse-icon.collapsed::before {
  transform: rotate(-45deg);
}
.section-body.hidden {
  display: none;
}
/* ===== 首页通知引导提示条 ===== */
.push-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--primary-light);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s;
}
.push-prompt:active { transform: scale(0.98); }
.push-prompt-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.push-prompt-text {
  flex: 1;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  line-height: 1.4;
}
.push-prompt-close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  color: var(--primary);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.push-prompt-close:active { background: rgba(255, 255, 255, 0.9); }
html[data-theme="dark"] .push-prompt-close {
  background: rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .push-prompt-close:active {
  background: rgba(0, 0, 0, 0.4);
}

/* ===== 每日一问（如果后续要加自定义样式） ===== */


/* ===== 纪念日：当天氛围 ===== */
.anniversary-card-today {
  position: relative;
  padding-left: 14px !important;
}
.anniversary-line {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
  pointer-events: none;
  z-index: 3;
}
.anniversary-today-banner {
  text-align: center;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
  padding: 4px 0;
}

.anniversary-confetti {
  position: absolute;
  top: -20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  animation: confetti-fall 3.5s linear 3;
  z-index: 1;
}
.anniversary-confetti:nth-child(1) { left: 8%;  animation-delay: 0s; }
.anniversary-confetti:nth-child(2) { left: 28%; animation-delay: 0.6s; }
.anniversary-confetti:nth-child(3) { left: 48%; animation-delay: 1.2s; }
.anniversary-confetti:nth-child(4) { left: 68%; animation-delay: 1.8s; }
.anniversary-confetti:nth-child(5) { left: 88%; animation-delay: 2.4s; }

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg);      opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(180px) rotate(360deg); opacity: 0; }
}

.anniversary-emoji-pulse {
  display: inline-block;
  animation: emoji-pulse 1.6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes emoji-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

.anniversary-milestone {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
  padding: 2px 8px;
  background: var(--primary-light);
  border-radius: 6px;
  display: inline-block;
}

/* ===== 弹窗（已回退：不做防穿透） ===== */
.modal-overlay {
  overscroll-behavior: contain;
}
.modal-sheet {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.image-preview-overlay {
  overscroll-behavior: contain;
}