/* 小c的心愿口袋 —— 全局样式 */
:root {
  --color-bg: #FFF5F5;
  --color-card: #FFFFFF;
  --color-primary: #E8807C;
  --color-primary-light: #FFD3D0;
  --color-accent: #F5B97A;
  --color-text: #4A3F3F;
  --color-text-light: #9C8E8E;
  --color-border: #F0E0E0;
  --shadow-card: 0 4px 12px rgba(232, 128, 124, 0.12);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  padding-bottom: 70px;
}

.container { padding: 16px; }

/* 顶部 */
.header { margin-bottom: 16px; }
.greeting { display: block; font-size: 13px; color: var(--color-text-light); margin-bottom: 4px; }
.title-row { display: flex; align-items: baseline; gap: 6px; }
.page-title { font-size: 22px; font-weight: 700; }
.title-emoji { font-size: 20px; }
.page-subtitle { display: block; font-size: 13px; color: var(--color-text-light); margin-top: 4px; }

/* 卡片 */
.card {
  background: var(--color-card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}

/* 按钮 */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #E8807C 0%, #F5A882 100%);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(232,128,124,0.3);
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; }

.btn-ghost {
  width: 100%;
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary-light);
  border-radius: 24px;
  padding: 11px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 8px;
}

/* tabbar */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: #fff;
  display: flex;
  border-top: 1px solid #f5f0f0;
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; color: #BBB; font-size: 11px; cursor: pointer;
}
.tab.active { color: var(--color-primary); }
.tab-icon { font-size: 20px; }
.tab-badge {
  position: absolute; top: 8px; right: 50%;
  margin-right: -20px;
  background: var(--color-primary); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px;
  line-height: 16px; text-align: center;
  border-radius: 8px; padding: 0 4px;
}

/* 空状态 */
.empty { text-align: center; padding: 40px 16px; color: var(--color-text-light); }
.empty-emoji { font-size: 48px; margin-bottom: 8px; display: block; }
.empty-text { font-size: 14px; line-height: 1.8; white-space: pre-line; }

/* 弹层 */
.mask {
  position: fixed; inset: 0;
  background: rgba(74,63,63,0.4);
  opacity: 0; visibility: hidden;
  transition: all 0.3s; z-index: 100;
}
.mask.show { opacity: 1; visibility: visible; }

.sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px; padding-bottom: calc(32px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
  z-index: 101; max-height: 85%; overflow-y: auto;
  max-width: 480px; margin: 0 auto;
}
.sheet.show { transform: translateY(0); }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-close { font-size: 16px; color: var(--color-text-light); cursor: pointer; padding: 4px; }

/* 表单 */
.label { display: block; font-size: 13px; color: var(--color-text-light); margin-bottom: 6px; margin-top: 8px; }
.input {
  width: 100%; background: var(--color-bg);
  border-radius: 12px; padding: 10px 12px;
  font-size: 14px; margin-bottom: 12px; border: none;
  font-family: inherit;
}
.textarea { min-height: 60px; resize: none; line-height: 1.6; }
.placeholder { color: var(--color-text-light); }

/* 动画 */
.float-in { animation: floatUp 0.4s ease-out; }
@keyframes floatUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 心愿卡通用 */
.wish-card {
  border-radius: 14px; padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-card); position: relative; overflow: hidden;
  cursor: pointer; transition: transform 0.2s;
}
.wish-card:active { transform: scale(0.98); }
.wish-card::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; background: rgba(255,255,255,0.4); border-radius: 50%;
}
.wish-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; position: relative; }
.wish-emoji { font-size: 28px; }
.wish-status { background: rgba(255,255,255,0.7); padding: 3px 10px; border-radius: 12px; font-size: 11px; color: var(--color-text-light); }
.wish-status.received { background: rgba(232,128,124,0.2); color: var(--color-primary); }
.wish-title { display: block; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.wish-desc { display: block; font-size: 14px; opacity: 0.85; margin-bottom: 10px; }
.wish-card-bottom { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-light); }

/* 发送栏 */
.send-bar {
  position: fixed; bottom: 60px; left: 0; right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, var(--color-bg) 70%, rgba(255,245,245,0));
  z-index: 10; max-width: 480px; margin: 0 auto;
}

/* 选择器项 */
.picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; margin-bottom: 8px;
  cursor: pointer; transition: transform 0.15s;
}
.picker-item:active { transform: scale(0.97); }
.picker-item.custom-item { background: linear-gradient(135deg, #F5F5F5 0%, #FFF0F0 100%) !important; border: 1px dashed var(--color-primary-light); }
.picker-emoji { font-size: 24px; }
.picker-info { flex: 1; }
.picker-item-title { display: block; font-size: 15px; font-weight: 600; }
.picker-item-hint { display: block; font-size: 12px; color: var(--color-text-light); }

/* emoji/颜色选择网格 */
.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.emoji-cell { width: 36px; height: 36px; line-height: 36px; text-align: center; font-size: 18px; border-radius: 8px; background: var(--color-bg); cursor: pointer; }
.emoji-cell.active { background: var(--color-primary-light); box-shadow: 0 0 0 2px var(--color-primary); }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.color-cell { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.color-cell.active { box-shadow: 0 0 0 3px rgba(232,128,124,0.3); border: 2px solid #fff; }

/* 清单 */
.list-card { background: var(--color-card); border-radius: 16px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-card); }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.list-title { font-size: 15px; font-weight: 600; }
.list-add-btn { font-size: 13px; color: var(--color-primary); padding: 4px 10px; background: var(--color-bg); border-radius: 12px; cursor: pointer; }
.list-input-row { display: flex; gap: 6px; margin-bottom: 10px; }
.list-input { flex: 1; background: var(--color-bg); border-radius: 10px; padding: 10px; font-size: 14px; border: none; font-family: inherit; }
.list-confirm { background: var(--color-primary); color: #fff; font-size: 13px; padding: 10px 14px; border-radius: 10px; white-space: nowrap; cursor: pointer; }
.list-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.list-item:last-child { border-bottom: none; }
.check-box { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--color-border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
.check-box.checked { background: var(--color-primary); border-color: var(--color-primary); }
.check-mark { color: #fff; font-size: 12px; font-weight: 700; }
.list-item-text { flex: 1; font-size: 14px; }
.done-text { text-decoration: line-through; color: var(--color-text-light); }
.list-delete { font-size: 14px; color: var(--color-text-light); cursor: pointer; opacity: 0.6; padding: 4px; }
.list-empty { padding: 12px 0; font-size: 13px; color: var(--color-text-light); text-align: center; line-height: 1.6; }

/* 瞬间 */
.stats-bar { display: flex; align-items: center; justify-content: center; gap: 24px; background: var(--color-card); border-radius: 16px; padding: 14px; margin-bottom: 16px; box-shadow: var(--shadow-card); }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 24px; font-weight: 800; color: var(--color-primary); }
.stat-label { display: block; font-size: 12px; color: var(--color-text-light); }
.stat-divider { width: 1px; height: 24px; background: var(--color-border); }
.archive-group { margin-bottom: 20px; }
.group-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; padding: 0 4px; }
.group-label { font-size: 15px; font-weight: 700; }
.group-count { font-size: 12px; color: var(--color-text-light); }
.photo-wall { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.archive-photo { width: calc((100% - 8px) / 3); aspect-ratio: 1; border-radius: 6px; object-fit: cover; cursor: pointer; }
.moment-card { background: var(--color-card); border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-card); cursor: pointer; }
.moment-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.moment-date { font-size: 12px; color: var(--color-text-light); }
.moment-mood { font-size: 12px; background: var(--color-bg); padding: 3px 10px; border-radius: 10px; color: var(--color-primary); }
.moment-place { display: flex; align-items: center; gap: 3px; font-size: 13px; color: var(--color-text-light); margin-bottom: 8px; }
.moment-photos { display: flex; gap: 4px; }
.moment-thumb { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; }
.more-badge { width: 80px; height: 80px; border-radius: 8px; background: rgba(74,63,63,0.6); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; font-weight: 600; }
.mood-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mood-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--color-bg); min-width: 60px; cursor: pointer; }
.mood-cell.active { background: var(--color-primary-light); box-shadow: 0 0 0 2px var(--color-primary); }
.mood-emoji { font-size: 18px; }
.mood-text { font-size: 11px; }
.photo-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.photo-preview { position: relative; width: 80px; height: 80px; }
.photo-img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.photo-remove { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; line-height: 18px; text-align: center; background: rgba(74,63,63,0.7); color: #fff; border-radius: 50%; font-size: 11px; cursor: pointer; }
.photo-add { width: 80px; height: 80px; border-radius: 8px; background: var(--color-bg); border: 1px dashed var(--color-border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.add-icon { font-size: 24px; color: var(--color-text-light); line-height: 1; }
.add-text { font-size: 11px; color: var(--color-text-light); }

/* 详情页 */
.detail-card { border-radius: 16px; padding: 24px 16px; text-align: center; box-shadow: var(--shadow-card); margin-bottom: 16px; }
.detail-emoji { font-size: 60px; display: inline-block; }
.detail-title { display: block; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.detail-desc { display: block; font-size: 15px; opacity: 0.85; margin-bottom: 12px; }
.detail-message { background: rgba(255,255,255,0.5); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.msg-text { display: block; font-size: 14px; line-height: 1.7; }
.detail-meta { font-size: 12px; color: var(--color-text-light); }
.received-badge { text-align: center; padding: 12px; }
.badge-check { display: inline-block; width: 32px; height: 32px; line-height: 32px; border-radius: 50%; background: var(--color-primary); color: #fff; margin-bottom: 6px; }
.delete-link { font-size: 13px; color: var(--color-text-light); text-decoration: underline; cursor: pointer; display: block; text-align: center; margin-top: 24px; }
.gallery-photo { width: 100%; border-radius: 12px; margin-bottom: 8px; }
.detail-header { background: var(--color-card); border-radius: 16px; padding: 20px 16px; margin-bottom: 16px; box-shadow: var(--shadow-card); }
.detail-mood-tag { font-size: 12px; background: var(--color-bg); padding: 3px 10px; border-radius: 10px; color: var(--color-primary); }
