:root {
  --bg: #FFFAF3;
  --bg2: #FFF3E4;
  --ink: #2D1B0E;
  --muted: #8B7355;
  --rule: #E8D5BF;
  --accent: #D4763C;
  --accent2: #C4564A;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 4px 24px rgba(45, 27, 14, 0.06);
  --shadow-card: 0 8px 40px rgba(45, 27, 14, 0.08);
  --shadow-float: 0 16px 56px rgba(45, 27, 14, 0.12);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

#app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
}

.page {
  display: none;
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding-bottom: 100px;
}

.page.active { display: block; }

.page-index { padding-bottom: 180px; }

.header {
  padding: 40px 20px 20px;
  background: linear-gradient(170deg, var(--bg) 0%, var(--bg2) 100%);
  text-align: center;
}

.header-greeting { font-size: 28px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.header-sub { font-size: 13px; color: var(--muted); }

.header-stats {
  display: flex;
  background: white;
  border-radius: var(--radius-lg);
  margin-top: 20px;
  padding: 16px 0;
  box-shadow: var(--shadow-soft);
}

.stat-item { flex: 1; text-align: center; }
.stat-num { display: block; font-size: 24px; font-weight: 700; color: var(--ink); }
.stat-num[data-status="sealed"] { color: #D97706; }
.stat-num[data-status="delivered"] { color: #059669; }
.stat-num[data-status="opened"] { color: #7C6853; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-divider { width: 1px; background: var(--rule); margin: 8px 0; }

.filter-bar {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  overflow-x: auto;
}

.filter-tag {
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--rule);
  cursor: pointer;
  white-space: nowrap;
}

.filter-tag.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.letter-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.letter-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.letter-card.template-classic { background: linear-gradient(180deg, #FFFAF3 0%, #FFF3E4 100%); }
.letter-card.template-warm { background: linear-gradient(180deg, #FFF7ED 0%, #FFEDD5 100%); }
.letter-card.template-pink { background: linear-gradient(180deg, #FDF2F8 0%, #FCE7F3 100%); }
.letter-card.template-ocean { background: linear-gradient(135deg, #E8F4F8 0%, #D0E8F2 100%); }
.letter-card.template-green { background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%); }
.letter-card.template-vintage { background: linear-gradient(135deg, #F5E6D3 0%, #E8D5BF 100%); }
.letter-card.template-starry { background: linear-gradient(135deg, #5a5a8a 0%, #6a6aaa 100%); }
.letter-card.template-night { background: linear-gradient(135deg, #505080 0%, #606090 100%); }
.letter-card.template-starry .letter-title, .letter-card.template-starry .letter-card-time, .letter-card.template-starry .letter-card-preview { color: #FFFFFF; }
.letter-card.template-night .letter-title, .letter-card.template-night .letter-card-time, .letter-card.template-night .letter-card-preview { color: #FFE44D; }

.letter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.letter-card.template-classic::before { background: linear-gradient(90deg, #D97706, #B45309); }
.letter-card.template-warm::before { background: linear-gradient(90deg, #F59E0B, #EF4444); }
.letter-card.template-pink::before { background: linear-gradient(90deg, #EC4899, #8B5CF6); }
.letter-card.template-ocean::before { background: linear-gradient(90deg, #06B6D4, #3B82F6); }
.letter-card.template-green::before { background: linear-gradient(90deg, #10B981, #059669); }
.letter-card.template-vintage::before { background: linear-gradient(90deg, #D97706, #92400E); }
.letter-card.template-starry::before { background: linear-gradient(90deg, #6366F1, #4338CA); }
.letter-card.template-night::before { background: linear-gradient(90deg, #8B5CF6, #7C3AED); }

.letter-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.letter-title { font-size: 17px; font-weight: 600; color: var(--ink); }

.status-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
}

.status-tag.sealed { background: #FEF3C7; color: #D97706; }
.status-tag.delivered { background: #D1FAE5; color: #059669; }
.status-tag.opened { background: #FFFFFF; color: #4B5563; }

.letter-card-time {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.letter-card-preview {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.letter-envelope { text-align: center; padding: 16px 0; }
.envelope-icon { font-size: 36px; opacity: 0.3; }
.envelope-hint { font-size: 12px; color: var(--accent); margin-top: 8px; }

.fab-container {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
  z-index: 50;
  pointer-events: none;
  box-sizing: border-box;
}

.fab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: white;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(212, 118, 60, 0.35);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.fab-btn:active { transform: scale(0.98); }
.fab-icon { font-size: 18px; }

.navbar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  cursor: pointer;
  font-size: 15px;
}

.back-icon { font-size: 20px; }

.navbar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}

.navbar-right { width: 60px; }

.create-form { padding: 20px 16px; }
.form-section { margin-bottom: 20px; }
.form-label { font-size: 14px; font-weight: 600; margin-bottom: 10px; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.template-item {
  height: 80px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.template-item.active { border-color: var(--accent); }
.template-classic { background: linear-gradient(180deg, #FFFAF3 0%, #FFF3E4 100%); }
.template-warm { background: linear-gradient(180deg, #FFF7ED 0%, #FFEDD5 100%); }
.template-pink { background: linear-gradient(180deg, #FDF2F8 0%, #FCE7F3 100%); }
.template-name { font-size: 12px; color: var(--ink); }

.title-input, .date-input, .profile-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 14px;
  background: white;
  outline: none;
  font-family: inherit;
}

.letter-paper {
  background: linear-gradient(180deg, #FFFAF3 0%, #FFF3E4 100%);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}

.paper-classic { background: linear-gradient(180deg, #FFFAF3 0%, #FFF3E4 100%); }
.paper-warm { background: linear-gradient(180deg, #FFF7ED 0%, #FFEDD5 100%); }
.paper-pink { background: linear-gradient(180deg, #FDF2F8 0%, #FCE7F3 100%); }

.letter-textarea {
  width: 100%;
  min-height: 200px;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  font-size: 15px;
  line-height: 1.8;
  font-family: inherit;
  color: var(--ink);
}

.word-count {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  text-align: center;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(212, 118, 60, 0.3);
}

.btn-primary:active { opacity: 0.9; }

.detail-content { padding: 20px 16px; }

.detail-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.detail-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.detail-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.detail-content-text { font-size: 16px; line-height: 2; white-space: pre-wrap; }
.detail-meta { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

.sealed-overlay { text-align: center; padding: 40px 0; }
.sealed-icon { font-size: 64px; margin-bottom: 16px; }
.sealed-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.sealed-desc { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.sealed-countdown { font-size: 18px; color: var(--accent); font-weight: 600; }

.delivered-action { text-align: center; padding: 40px 0; }
.open-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 100px;
  padding: 14px 48px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212, 118, 60, 0.3);
  margin-top: 16px;
}

.user-card {
  display: flex;
  align-items: center;
  padding: 30px 20px 20px;
  background: linear-gradient(170deg, var(--bg) 0%, var(--bg2) 100%);
  gap: 14px;
  cursor: pointer;
}

.user-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(212, 118, 60, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; }
.user-name { font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.user-desc { font-size: 13px; color: var(--muted); }
.user-arrow { color: var(--muted); font-size: 20px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 20px;
}

.stats-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 4px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.stats-num { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.stats-num.accent { color: var(--accent); }
.stats-num.green { color: #059669; }
.stats-num.muted { color: #7C6853; }
.stats-label { font-size: 11px; color: var(--muted); }

.menu-list {
  margin: 0 16px 20px;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item:active { background: var(--bg2); }
.menu-icon { font-size: 20px; margin-right: 12px; }
.menu-text { flex: 1; font-size: 15px; }
.menu-arrow { color: var(--muted); font-size: 18px; }
.menu-item.danger .menu-text { color: var(--danger); }
.menu-divider { height: 1px; background: var(--rule); margin: 0 16px; }

.about-section { text-align: center; padding: 20px 16px 40px; }
.about-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.about-desc { font-size: 12px; color: var(--muted); line-height: 1.8; }

.profile-modal-mask, .poster-modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profile-modal, .poster-modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-modal-header, .poster-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
}

.profile-modal-title, .poster-modal-title { font-size: 16px; font-weight: 600; }
.profile-modal-close, .poster-modal-close { font-size: 18px; color: var(--muted); cursor: pointer; }

.profile-form { padding: 20px; }

.profile-avatar-section { text-align: center; margin-bottom: 20px; }
.avatar-choose-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(212, 118, 60, 0.12);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  cursor: pointer;
  overflow: hidden;
  border: none;
}

.avatar-choose-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-hint { font-size: 12px; color: var(--muted); }

.profile-field { margin-top: 16px; }
.profile-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }

.profile-actions, .poster-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--rule);
}

.profile-btn, .poster-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.profile-btn.cancel, .poster-btn.cancel { background: var(--bg2); color: var(--ink); }
.profile-btn.confirm, .poster-btn.save, .poster-btn.share { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; }

.poster-preview {
  padding: 16px;
  text-align: center;
  background: var(--bg2);
  flex: 1;
  overflow-y: auto;
}

.poster-preview canvas {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.toast.show { opacity: 1; }

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: white;
  border-top: 1px solid var(--rule);
  display: flex;
  z-index: 40;
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
}

.tab-item.active { color: var(--accent); }
.tab-icon { font-size: 22px; margin-bottom: 2px; }
.tab-text { font-size: 11px; }

.card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-text { font-size: 14px; }
.empty-sub { font-size: 12px; margin-top: 6px; opacity: 0.7; }

.reply-badge { display: inline-block; margin-left: 6px; padding: 0 6px; background: var(--accent); color: white; font-size: 10px; border-radius: 8px; vertical-align: middle; }

/* 新模板 */
.template-ocean { background: linear-gradient(135deg, #E8F4F8 0%, #D0E8F2 100%); border-left: 3px solid #5BA4B4; }
.template-green { background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%); border-left: 3px solid #7CB342; }
.template-vintage { background: linear-gradient(135deg, #F5E6D3 0%, #E8D5BF 100%); border-left: 3px solid #8B6914; }
.template-starry { background: linear-gradient(135deg, #5a5a8a 0%, #6a6aaa 100%); border-left: 3px solid #FFFFFF; }
.template-starry .template-name { color: #FFFFFF !important; }
.template-night { background: linear-gradient(135deg, #505080 0%, #606090 100%); border-left: 3px solid #FFE44D; }
.template-night .template-name { color: #FFE44D !important; }
.paper-ocean { background: linear-gradient(135deg, #E8F4F8 0%, #D0E8F2 100%); }
.paper-green { background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%); }
.paper-vintage { background: linear-gradient(135deg, #F5E6D3 0%, #E8D5BF 100%); }
.paper-starry { background: linear-gradient(135deg, #5a5a8a 0%, #6a6aaa 100%); color: #FFFFFF; }
.paper-night { background: linear-gradient(135deg, #505080 0%, #606090 100%); color: #FFE44D; }
.dark-paper { color: #E0E0E0; }
.dark-text { color: #E0E0E0; }

/* 信封 */
.letter-envelope { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background: rgba(255,255,255,0.5); border-radius: var(--radius); margin-top: 8px; }
.envelope-icon { font-size: 36px; opacity: 0.4; margin-bottom: 4px; }
.envelope-hint { font-size: 12px; color: var(--accent); }

/* 详情页信封 */
.detail-envelope { position: relative; width: 200px; height: 130px; margin: 20px auto; perspective: 600px; }
.detail-envelope-body { position: absolute; bottom: 0; left: 0; width: 100%; height: 100px; background: linear-gradient(135deg, #F5E6D3 0%, #E8D5BF 100%); border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.detail-envelope-flap { position: absolute; top: 0; left: 0; width: 100%; height: 65px; background: linear-gradient(135deg, #F0DCC8 0%, #E0C9A8 100%); clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 8px 8px 0 0; transform-origin: top; transition: transform 0.6s ease; }
.detail-wax { position: absolute; top: 45px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; flex-direction: column; align-items: center; }
.wax-circle-small { width: 36px; height: 36px; background: var(--accent); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.wax-text-small { font-size: 9px; color: white; margin-top: -26px; font-weight: bold; }

.unseal-envelope { cursor: pointer; position: relative; width: 200px; height: 130px; margin: 20px auto; perspective: 600px; transition: transform 0.2s; }
.unseal-envelope:hover { transform: scale(1.02); }
.unseal-hint { position: absolute; top: -28px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 4px; }
.unseal-hint-icon { font-size: 14px; }

/* 拆封/封印动画 */
.seal-animation { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100; flex-direction: column; align-items: center; justify-content: center; color: white; }
.seal-animation.active { display: flex; }
.seal-phase-1, .seal-phase-2, .seal-phase-3, .seal-phase-4, .seal-phase-5 { display: none; text-align: center; animation: fadeIn 0.5s ease; }
.seal-phase-1.active, .seal-phase-2.active, .seal-phase-3.active, .seal-phase-4.active, .seal-phase-5.active { display: flex; flex-direction: column; align-items: center; }
.seal-icon { font-size: 64px; margin-bottom: 16px; animation: pulse 1.5s infinite; }
.seal-text { font-size: 18px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* AI润色 */
.ai-polish-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.ai-polish-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: rgba(212,118,60,0.1); color: var(--accent); border-radius: 20px; font-size: 12px; cursor: pointer; border: 1px solid rgba(212,118,60,0.2); transition: all 0.2s; }
.ai-polish-btn:hover { background: rgba(212,118,60,0.2); }
.ai-polish-icon { font-size: 14px; }

.polish-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 80; display: flex; align-items: center; justify-content: center; }
.polish-modal { background: white; border-radius: var(--radius-lg); width: 90%; max-width: 420px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.polish-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.polish-modal-title { font-size: 16px; font-weight: 600; }
.polish-modal-close { font-size: 18px; color: var(--muted); cursor: pointer; }
.polish-body { padding: 20px; display: flex; flex-direction: column; align-items: center; min-height: 160px; }
.polish-spinner { width: 40px; height: 40px; border: 3px solid #eee; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.polish-loading-text { color: var(--muted); font-size: 14px; }
.polish-textarea { width: 100%; min-height: 160px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; font-family: inherit; font-size: 14px; resize: vertical; outline: none; }
.polish-actions { display: flex; gap: 12px; padding: 12px 20px 20px; justify-content: flex-end; }
.polish-btn { padding: 8px 16px; border-radius: 20px; font-size: 14px; cursor: pointer; }
.polish-btn.cancel { background: #f5f5f5; color: var(--text); }
.polish-btn.confirm { background: var(--accent); color: white; }

.confirm-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  text-align: center;
}
.confirm-modal-icon {
  font-size: 48px;
  margin: 24px 0 12px;
}
.confirm-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.confirm-modal-desc {
  font-size: 14px;
  color: var(--muted);
  padding: 0 24px 20px;
  line-height: 1.5;
}
.confirm-modal-actions {
  display: flex;
  border-top: 1px solid var(--rule);
}
.confirm-modal-btn {
  flex: 1;
  padding: 14px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}
.confirm-modal-btn.cancel {
  color: var(--text);
  border-right: 1px solid var(--rule);
}
.confirm-modal-btn.cancel:hover {
  background: #f5f5f5;
}
.confirm-modal-btn.confirm {
  color: var(--accent);
  font-weight: 500;
}
.confirm-modal-btn.confirm:hover {
  background: rgba(212,118,60,0.1);
}

/* 详情页 */
.detail-sealed, .detail-delivered, .detail-opened { padding: 16px; }
.sealed-header, .delivered-header, .opened-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sealed-icon { font-size: 32px; margin-right: 8px; }
.sealed-title, .delivered-title, .opened-title { font-size: 18px; font-weight: 600; flex: 1; }
.sealed-status { font-size: 12px; color: var(--accent); }

.countdown-card { text-align: center; padding: 20px; margin-bottom: 16px; }
.countdown-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.countdown-value { font-size: 28px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.countdown-target { font-size: 12px; color: var(--muted); }

.opened-paper { border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; min-height: 200px; box-shadow: var(--shadow-soft); }
.paper-content { font-size: 15px; line-height: 1.8; white-space: pre-wrap; }

.replies-section { margin-top: 16px; }
.replies-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.reply-item { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.reply-bubble { background: var(--accent); color: white; border-radius: 16px 16px 4px 16px; padding: 12px 16px; max-width: 80%; }
.reply-content { font-size: 14px; line-height: 1.6; }
.reply-time { font-size: 10px; opacity: 0.8; margin-top: 4px; text-align: right; }

.action-bar { display: flex; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.action-btn { flex: 1; padding: 10px; border-radius: 20px; font-size: 14px; text-align: center; cursor: pointer; transition: all 0.2s; }
.action-btn.edit { background: rgba(212,118,60,0.1); color: var(--accent); }
.action-btn.reply { background: var(--accent); color: white; }
.action-btn.share { background: rgba(212,118,60,0.1); color: var(--accent); }
.action-btn.delete { background: #ffebee; color: #c62828; }

/* 日期选择器 */
.date-selector { display: flex; align-items: center; gap: 8px; }
.date-select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: white;
  font-size: 16px;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.date-select:focus { outline: none; border-color: var(--accent); }
.date-unit { font-size: 16px; color: var(--text); }
.date-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.date-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.date-quick-btn { padding: 6px 14px; border-radius: 20px; background: var(--bg-card); border: 1px solid var(--rule); font-size: 12px; color: var(--text); cursor: pointer; transition: all 0.2s; }
.date-quick-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.seal-section { padding-bottom: 100px; }

/* 用户区域 */
#userArea { cursor: pointer; }
