/* ========== 变量 ========== */
:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --primary: #E8839C;
  --primary-light: #FFD6E0;
  --primary-lighter: #FFF0F3;
  --primary-deep: #D4748C;
  --accent: #F4A261;
  --accent-light: #FFE4C9;
  --text: #4A3728;
  --text-light: #8B7355;
  --text-muted: #BFA98E;
  --border: #F0E0D0;
  --shadow: rgba(180, 130, 100, 0.08);
  --shadow-md: rgba(180, 130, 100, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 68px;
  --top-height: 52px;
  --sidebar-width: 220px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========== 飘落爱心 ========== */
.hearts-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.floating-heart {
  position: absolute; top: -30px;
  opacity: 0.12;
  animation: floatDown linear infinite;
}
@keyframes floatDown {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.12; }
  50%  { opacity: 0.2; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(74, 55, 40, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%; max-width: 440px; max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(180,130,100,0.2);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-family: 'Noto Serif SC', serif; font-size: 18px; }

.btn-close {
  width: 32px; height: 32px; border: none; background: var(--primary-lighter);
  border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--primary);
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.btn-close:hover { background: var(--primary-light); }

.setup-card { text-align: center; max-width: 380px; }
.setup-header { margin-bottom: 24px; }
.setup-icon { font-size: 56px; margin-bottom: 12px; }
.setup-header h2 { font-family: 'Noto Serif SC', serif; font-size: 22px; margin-bottom: 8px; }
.setup-desc { color: var(--text-light); font-size: 14px; }
/* ========== 表单 ========== */
.form-group { margin-bottom: 18px; text-align: left; }
.form-group label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; font-weight: 500; }
.form-group input[type="text"], .form-group input[type="date"], .form-group input[type="password"], .form-group input[type="number"], .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text); background: var(--bg); transition: border-color 0.2s;
  font-family: inherit; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-top: 6px; }
.settings-card { max-width: 520px; }
.settings-section {
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.58); margin-bottom: 14px;
}
.settings-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary-deep); margin-bottom: 12px;
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 0; color: var(--text); cursor: pointer;
}
.toggle-row strong { display: block; font-size: 14px; margin-bottom: 4px; }
.toggle-row small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--primary); flex: 0 0 auto; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: white; box-shadow: 0 4px 12px rgba(232,131,156,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(232,131,156,0.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-block { width: 100%; padding: 12px; }
.btn-small { padding: 7px 16px; font-size: 13px; border-radius: 20px; }
.btn-icon { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; transition: transform 0.2s; }
.btn-icon:hover { transform: scale(1.15); }

.music-toggle {
  position: fixed; right: 18px; top: 62px; z-index: 1200;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: var(--primary);
  box-shadow: 0 3px 12px var(--shadow-md);
  cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.music-toggle:hover { transform: translateY(-1px) scale(1.04); }
.music-toggle.hidden { display: none; }
.music-toggle.playing {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: white;
}
.music-toggle.playing::after {
  content: ''; position: absolute; inset: -4px; border-radius: inherit;
  border: 1px solid rgba(232,131,156,0.35);
  animation: musicPulse 1.6s ease-in-out infinite;
}
@keyframes musicPulse {
  0%, 100% { transform: scale(0.96); opacity: 0.45; }
  50% { transform: scale(1.12); opacity: 0.08; }
}

/* ========== 选择器通用 ========== */
.author-switch { display: flex; gap: 10px; }
.author-btn {
  flex: 1; padding: 8px 12px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: white; cursor: pointer; font-size: 14px; color: var(--text-light); transition: all 0.2s; font-family: inherit;
}
.author-btn.active { border-color: var(--primary); background: var(--primary-lighter); color: var(--primary); font-weight: 600; }

.mood-picker, .weather-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-btn {
  padding: 8px 6px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: white; cursor: pointer; font-size: 20px; text-align: center; transition: all 0.2s; min-width: 56px;
}
.mood-btn small { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }
.mood-btn.active { border-color: var(--primary); background: var(--primary-lighter); }

.icon-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  width: 44px; height: 44px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: white; cursor: pointer; font-size: 22px; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.icon-btn.active { border-color: var(--primary); background: var(--primary-lighter); }

/* ========== 图片上传 ========== */
.image-preview-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.image-preview-item { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; position: relative; }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-item .remove-img {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  background: rgba(0,0,0,0.5); color: white; border: none; border-radius: 50%;
  cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.btn-upload {
  padding: 8px 16px; border: 2px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--bg); cursor: pointer; color: var(--text-light); font-size: 13px; transition: all 0.2s; font-family: inherit;
}
.btn-upload:hover { border-color: var(--primary); color: var(--primary); }

/* ========== 应用布局 ========== */
.app {
  height: 100%; display: flex; position: relative; z-index: 1;
}

.sidebar { display: none; }

.main-wrap {
  flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0;
}

.top-bar {
  height: var(--top-height); display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: rgba(255,248,240,0.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.top-title { font-family: 'Noto Serif SC', serif; font-size: 17px; font-weight: 600; color: var(--primary); }

.pages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 10px);
  scroll-behavior: smooth;
}
.pages::-webkit-scrollbar { width: 4px; }
.pages::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

.page { display: none; padding: 0; animation: pageFadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 16px 16px 0; }
.page-header h2 { font-family: 'Noto Serif SC', serif; font-size: 20px; }

/* ========== 底部导航(手机) ========== */
.bottom-nav {
  height: var(--nav-height); display: flex;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; transition: all 0.2s; position: relative;
}
.nav-icon { font-size: 22px; transition: transform 0.2s; }
.nav-text { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.nav-item.active .nav-text { color: var(--primary); font-weight: 600; }
.nav-item.active .nav-icon { transform: scale(1.15); }
.nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; background: var(--primary); border-radius: 0 0 3px 3px;
}

/* ============================================
   首页 — 甜蜜英雄区
   ============================================ */
.hero {
  position: relative;
  background: linear-gradient(160deg, #FFE4EC 0%, #FFF0E8 30%, #FFD6E0 60%, #FFECD2 100%);
  padding: 36px 20px 28px;
  text-align: center;
  overflow: hidden;
}

.hero-bg-decor { position: absolute; inset: 0; pointer-events: none; }
.decor-heart, .decor-star {
  position: absolute; opacity: 0.15; font-size: 24px;
}
.d1 { top: 10%; left: 8%; font-size: 20px; animation: gentleFloat 6s ease-in-out infinite; }
.d2 { top: 20%; right: 10%; font-size: 28px; animation: gentleFloat 8s ease-in-out infinite 1s; }
.d3 { bottom: 25%; left: 15%; font-size: 16px; animation: gentleFloat 7s ease-in-out infinite 2s; }
.d4 { bottom: 15%; right: 12%; font-size: 22px; animation: gentleFloat 9s ease-in-out infinite 0.5s; }
.d5 { top: 50%; left: 50%; font-size: 14px; animation: gentleFloat 10s ease-in-out infinite 3s; }
.s1 { top: 12%; right: 25%; font-size: 16px; color: var(--accent); opacity: 0.2; animation: gentleSpin 12s linear infinite; }
.s2 { bottom: 20%; left: 30%; font-size: 18px; color: var(--accent); opacity: 0.18; animation: gentleSpin 15s linear infinite reverse; }

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes gentleSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-couple {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-bottom: 16px; position: relative; z-index: 1;
}

.hero-avatar-wrap { text-align: center; }
.hero-avatar {
  width: 70px; height: 70px; background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; box-shadow: 0 6px 20px rgba(232,131,156,0.2);
  margin: 0 auto 6px; border: 3px solid white;
}
.hero-name {
  font-family: 'Noto Serif SC', serif; font-size: 16px; font-weight: 600; color: var(--text);
}

.hero-love { text-align: center; }
.hero-heart {
  font-size: 32px; animation: heartBeat 1.2s ease-in-out infinite;
}
.hero-love-text {
  font-size: 11px; color: var(--primary); letter-spacing: 2px; margin-top: 2px; font-style: italic;
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
}

.hero-quote {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px; color: var(--text); line-height: 1.6;
  margin: 16px auto 20px; max-width: 400px;
  position: relative; z-index: 1;
  animation: quoteIn 1s ease 0.3s both;
}
@keyframes quoteIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-timer { position: relative; z-index: 1; }
.hero-timer-label { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.hero-timer-nums { display: flex; justify-content: center; align-items: center; gap: 4px; }

.ht-item {
  background: rgba(255,255,255,0.85); border-radius: 12px;
  padding: 8px 10px; min-width: 52px; text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(232,131,156,0.1);
}
.ht-num {
  display: block; font-family: 'Noto Serif SC', serif;
  font-size: 24px; font-weight: 700; color: var(--primary); line-height: 1.2;
}
.ht-unit { font-size: 11px; color: var(--text-muted); }
.ht-sep { font-size: 20px; color: var(--primary-light); font-weight: 700; padding: 0 2px; margin-top: -8px; }

/* 统计卡片 */
.home-stats { display: flex; gap: 10px; padding: 16px 16px 0; }
.stat-card {
  flex: 1; background: var(--card); border-radius: var(--radius); padding: 16px 10px;
  text-align: center; box-shadow: 0 2px 8px var(--shadow); cursor: pointer; transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px var(--shadow-md); }
.stat-icon { font-size: 24px; margin-bottom: 4px; }
.stat-num { font-family: 'Noto Serif SC', serif; font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.home-grid { padding: 16px; }
.home-section { margin-bottom: 16px; }
.section-title { font-family: 'Noto Serif SC', serif; font-size: 16px; margin-bottom: 10px; }

.empty-hint {
  padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px;
  background: var(--card); border-radius: var(--radius-sm);
}

.period-card {
  --period-accent: var(--primary);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff9fb 0%, #fff 100%);
  border: 1px solid rgba(232,131,156,0.16);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 8px var(--shadow);
}
.period-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--period-accent) 16%, transparent), transparent 42%);
  pointer-events: none;
}
.period-period { --period-accent: #e85f7a; }
.period-fertile { --period-accent: #f0a24f; }
.period-pms { --period-accent: #7c8de6; }
.period-follicular { --period-accent: #5fbfa3; }
.period-luteal { --period-accent: #d67fb8; }
.period-card-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.period-heading { min-width: 0; }
.period-ring {
  width: 74px; height: 74px; border-radius: 50%;
  background:
    conic-gradient(var(--period-accent) calc(var(--cycle-progress, 0) * 1%), rgba(232,131,156,0.12) 0);
  padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(232,131,156,0.08);
}
.period-ring-inner {
  width: 100%; height: 100%; border-radius: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff;
}
.period-ring-inner span {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--period-accent);
}
.period-ring-inner small {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.period-icon {
  width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--period-accent) 16%, white);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto;
}
.period-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.period-kicker span {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--period-accent) 12%, white); color: var(--period-accent); font-weight: 700;
}
.period-kicker em { font-style: normal; }
.period-title { font-family: 'Noto Serif SC', serif; font-size: 16px; font-weight: 700; color: var(--primary-deep); margin-bottom: 4px; }
.period-desc { font-size: 13px; line-height: 1.65; color: var(--text); }
.period-detail-grid {
  position: relative;
  z-index: 1;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px;
}
.period-detail-grid div {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(232,131,156,0.1);
  border-radius: 14px; padding: 10px 8px; text-align: center;
}
.period-detail-grid span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.period-detail-grid b {
  display: block; font-family: 'Noto Serif SC', serif; font-size: 15px; color: var(--primary-deep); white-space: nowrap;
}
.period-meta {
  position: relative;
  z-index: 1;
  display: flex; gap: 7px; margin-top: 10px; padding: 8px 10px;
  background: rgba(255,255,255,0.76);
  border-radius: 14px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}
.period-meta span {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-deep);
}

.recent-messages .msg-mini {
  background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px;
  margin-bottom: 8px; box-shadow: 0 1px 4px var(--shadow);
}
.msg-mini .msg-mini-author { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.msg-mini .msg-mini-text { font-size: 14px; line-height: 1.5; }

.upcoming-list .upcoming-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px;
  margin-bottom: 8px; box-shadow: 0 1px 4px var(--shadow);
}
.upcoming-item .upcoming-icon { font-size: 28px; }
.upcoming-item .upcoming-info { flex: 1; }
.upcoming-item .upcoming-name { font-size: 14px; font-weight: 600; }
.upcoming-item .upcoming-date { font-size: 12px; color: var(--text-muted); }
.upcoming-item .upcoming-countdown { font-family: 'Noto Serif SC', serif; font-size: 18px; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.8; }

/* ========== 操作按钮 ========== */
.card-actions {
  position: absolute; top: 10px; right: 10px; display: flex; gap: 4px;
  opacity: 0; transition: opacity 0.2s; z-index: 2;
}
.card-action-btn {
  width: 28px; height: 28px; border: none; background: var(--bg); border-radius: 50%;
  cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; color: var(--text-muted);
}
.card-action-btn:hover { background: var(--primary-lighter); color: var(--primary); }

/* ========== 时光轴 ========== */
.timeline { padding: 0 16px; }
.timeline .post-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  margin-bottom: 14px; box-shadow: 0 2px 8px var(--shadow); position: relative;
  animation: cardIn 0.3s ease;
}
.timeline .post-card:hover .card-actions { opacity: 1; }

@keyframes cardIn { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }

.post-card .post-meta {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.post-meta-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.post-card .post-author { font-size: 14px; font-weight: 600; color: var(--primary); }
.post-card .post-date { font-size: 12px; color: var(--text-muted); }
.timeline .card-actions {
  position: static;
  opacity: 1;
  flex-shrink: 0;
  margin-left: auto;
  align-items: center;
}
.timeline .card-action-btn {
  width: 30px; height: 30px; border-radius: 10px; background: var(--bg);
  font-size: 14px;
}
.timeline .card-action-btn:hover { background: var(--primary-lighter); color: var(--primary); transform: translateY(-1px); }
.post-card .post-title { font-family: 'Noto Serif SC', serif; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.post-card .post-content { font-size: 14px; line-height: 1.7; margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }
.post-card .post-images { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.post-card .post-images img { width: 100px; height: 100px; border-radius: 8px; object-fit: cover; cursor: pointer; transition: transform 0.2s; }
.post-card .post-images img:hover { transform: scale(1.05); }
.post-comments {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.post-comments-header {
  font-size: 13px; font-weight: 700; color: var(--primary-deep); margin-bottom: 8px;
}
.comment-list { display: flex; flex-direction: column; gap: 8px; }
.comment-item {
  background: rgba(255,255,255,0.66); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 10px;
}
.comment-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.comment-author { font-size: 12px; font-weight: 700; }
.comment-actions { display: inline-flex; align-items: center; gap: 6px; }
.comment-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.comment-delete {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: var(--primary-lighter); color: var(--text-muted);
  cursor: pointer; font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.comment-delete:hover { color: var(--primary); background: var(--primary-light); }
.comment-content { font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.comment-compose { margin-top: 10px; display: grid; gap: 8px; }
.comment-author-switch .author-btn { padding: 6px 10px; font-size: 12px; }
.comment-compose textarea {
  width: 100%; padding: 9px 10px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-family: inherit; resize: vertical; min-height: 52px; outline: none;
}
.comment-compose textarea:focus { border-color: var(--primary); }

/* ========== 日记 ========== */
.checkin-streak {
  background: linear-gradient(135deg, var(--primary-lighter), #FFF0E8);
  border-radius: var(--radius); padding: 20px; text-align: center; margin: 0 16px 16px;
}
.streak-num { font-family: 'Noto Serif SC', serif; font-size: 42px; font-weight: 700; color: var(--primary); line-height: 1; }
.streak-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.checkin-journal { padding: 0 16px; }
.checkin-journal-head {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}
.checkin-journal-head .btn-icon { font-size: 28px; line-height: 1; color: var(--primary); }
.checkin-month-label { font-family: 'Noto Serif SC', serif; font-size: 18px; font-weight: 700; min-width: 120px; text-align: center; }
.checkin-board { display: grid; gap: 14px; }

.checkin-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 16px; background: var(--card); border-radius: var(--radius);
  padding: 14px; box-shadow: 0 2px 8px var(--shadow);
}
.cal-header { text-align: center; font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 4px 0; }
.cal-day { position: relative; text-align: center; padding: 9px 0; font-size: 13px; border-radius: 10px; color: var(--text-light); cursor: pointer; min-height: 34px; }
.cal-day:hover { background: var(--primary-lighter); color: var(--primary); }
.cal-day.today { border: 2px solid var(--primary); color: var(--primary); font-weight: 600; }
.cal-day.checked { background: var(--primary); color: white; font-weight: 600; }
.cal-day.checked.today { box-shadow: 0 2px 8px rgba(232,131,156,0.4); }
.cal-day.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-dot {
  position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px;
  transform: translateX(-50%); border-radius: 50%; background: currentColor;
}
.cal-day.empty { visibility: hidden; }

.checkin-detail {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 2px 8px var(--shadow); min-height: 220px;
}
.diary-empty { text-align: center; color: var(--text-muted); padding: 30px 12px 28px; }
.diary-empty-title { font-family: 'Noto Serif SC', serif; font-size: 17px; color: var(--text); margin-bottom: 6px; }
.diary-empty p { margin: 0; line-height: 1.7; }
.diary-empty-btn { margin-top: 16px; min-width: 118px; }
.diary-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.diary-day-date { font-family: 'Noto Serif SC', serif; font-size: 18px; font-weight: 700; }
.diary-day-week { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.diary-list { display: grid; gap: 10px; }
.diary-entry {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; background: rgba(255,255,255,0.66);
}
.diary-entry:hover .card-actions { opacity: 1; }
.diary-entry-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.diary-entry-left { display: flex; align-items: center; gap: 8px; }
.diary-entry-meta { color: var(--text-muted); font-size: 12px; }
.diary-entry-actions { position: static; opacity: 0.45; }
.diary-entry-text { font-size: 14px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.diary-entry-note { margin-top: 8px; font-size: 13px; color: var(--text-light); }

.checkin-list .checkin-item {
  background: var(--card); border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 10px; box-shadow: 0 2px 6px var(--shadow);
  display: flex; align-items: flex-start; gap: 12px; position: relative;
}
.checkin-item:hover .card-actions { opacity: 1; }
.checkin-item .checkin-mood { font-size: 28px; flex-shrink: 0; }
.checkin-item .checkin-info { flex: 1; }
.checkin-item .checkin-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.checkin-item .checkin-author { font-size: 14px; font-weight: 600; color: var(--primary); }
.checkin-item .checkin-weather { font-size: 14px; }
.checkin-item .checkin-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.checkin-item .checkin-note { font-size: 14px; line-height: 1.5; }
.checkin-item .checkin-diary {
  font-size: 14px; line-height: 1.7; margin: 6px 0; white-space: pre-wrap;
}

/* ========== 纪念日 ========== */
.ann-list { padding: 0 16px; }
.ann-list .ann-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  margin-bottom: 12px; box-shadow: 0 2px 8px var(--shadow);
  display: flex; align-items: center; gap: 14px;
  position: relative; overflow: hidden; transition: transform 0.2s;
}
.ann-card:hover { transform: translateY(-2px); }
.ann-card:hover .card-actions { opacity: 1; }
.ann-card::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; background: var(--primary-lighter); border-radius: 50%; opacity: 0.5;
}
.ann-card .ann-icon { font-size: 36px; flex-shrink: 0; z-index: 1; }
.ann-card .ann-info { flex: 1; z-index: 1; }
.ann-card .ann-name { font-family: 'Noto Serif SC', serif; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.ann-card .ann-date-text { font-size: 13px; color: var(--text-muted); }
.ann-card .ann-countdown { text-align: right; z-index: 1; flex-shrink: 0; }
.ann-card .ann-countdown-num { font-family: 'Noto Serif SC', serif; font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1; }
.ann-card .ann-countdown-label { font-size: 11px; color: var(--text-muted); }

/* ========== 心愿清单 ========== */
.wish-progress {
  display: flex; align-items: center; gap: 12px; margin: 0 16px 16px;
  background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 2px 8px var(--shadow);
}
.wish-progress-bar { flex: 1; height: 10px; background: var(--primary-lighter); border-radius: 5px; overflow: hidden; }
.wish-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--primary)); border-radius: 5px; transition: width 0.5s ease; width: 0%; }
.wish-progress-text { font-size: 13px; color: var(--text-light); white-space: nowrap; }

.wish-list { padding: 0 16px; }
.wish-list .wish-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 8px; box-shadow: 0 1px 4px var(--shadow);
  cursor: pointer; transition: all 0.2s;
}
.wish-item:hover { transform: translateX(4px); }
.wish-item .wish-check {
  width: 24px; height: 24px; border: 2px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; font-size: 12px;
}
.wish-item.done .wish-check { background: var(--primary); border-color: var(--primary); color: white; }
.wish-item .wish-text { flex: 1; font-size: 14px; transition: all 0.2s; }
.wish-item.done .wish-text { text-decoration: line-through; color: var(--text-muted); }
.wish-item .wish-delete {
  background: none; border: none; font-size: 14px; cursor: pointer;
  opacity: 0; transition: opacity 0.2s; color: var(--text-muted);
}
.wish-item:hover .wish-delete { opacity: 0.6; }

/* ========== 喜好清单 ========== */
.msg-list { padding: 0 16px; }
.msg-list .msg-card {
  background: var(--card); border-radius: var(--radius-sm); padding: 11px 12px;
  margin-bottom: 8px; box-shadow: 0 1px 5px var(--shadow); position: relative;
}
.preference-card { border: 1px solid rgba(232,131,156,0.08); }
.preference-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.preference-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--primary-deep);
  padding: 2px 8px; border-radius: 999px;
  background: var(--primary-lighter);
}
.preference-actions {
  position: static;
  opacity: 1;
  flex-shrink: 0;
}
.preference-actions .card-action-btn {
  width: 24px; height: 24px; font-size: 12px;
}
.preference-title {
  margin-top: 8px;
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.preference-detail {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.preference-footer { margin-top: 8px; }
.msg-card:hover .card-actions { opacity: 1; }
.msg-card .msg-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.msg-card .msg-author-tag { font-size: 12px; color: var(--primary); font-weight: 600; }
.msg-card .msg-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.author-1 { color: var(--primary) !important; }
.author-2 { color: var(--accent) !important; }

/* ========== 图片查看器 ========== */
.image-viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  cursor: pointer; animation: fadeIn 0.2s ease;
}
.image-viewer img { max-width: 95%; max-height: 95%; border-radius: 8px; object-fit: contain; }

/* ========== Toast ========== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px);
  padding: 10px 24px; background: var(--text); color: white; border-radius: 24px;
  font-size: 14px; z-index: 3000; opacity: 0; transition: all 0.3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =============================================
   PC端 >= 900px — 侧边栏 + 宽敞内容
   ============================================= */
@media (min-width: 900px) {
  body {
    background: linear-gradient(135deg, #FFF5EE 0%, #FFE8F0 50%, #FFF5EE 100%);
  }

  .app { max-width: 1400px; margin: 0 auto; }

  /* 侧边栏 */
  .sidebar {
    display: flex; flex-direction: column;
    width: var(--sidebar-width); flex-shrink: 0;
    background: white;
    border-right: 1px solid var(--border);
    padding: 0;
    height: 100%;
  }

  .sidebar-header {
    padding: 28px 20px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-logo { font-size: 36px; margin-bottom: 6px; }
  .sidebar-title {
    font-family: 'Noto Serif SC', serif; font-size: 15px;
    color: var(--primary); font-weight: 600;
  }

  .sidebar-nav {
    flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px;
  }

  .sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; border-radius: 12px;
    border: none; background: none; cursor: pointer;
    font-size: 14px; color: var(--text-light); font-family: inherit;
    transition: all 0.2s; text-align: left;
  }
  .sidebar-item:hover { background: var(--primary-lighter); color: var(--text); }
  .sidebar-item.active { background: var(--primary); color: white; font-weight: 600; box-shadow: 0 2px 10px rgba(232,131,156,0.3); }
  .si-icon { font-size: 18px; width: 24px; text-align: center; }
  .si-text { font-size: 14px; }

  .sidebar-footer { padding: 10px; border-top: 1px solid var(--border); }

  /* 隐藏手机端导航 */
  .top-bar { display: none; }
  .bottom-nav { display: none; }
  .music-toggle { top: 18px; right: 24px; }

  .main-wrap { background: var(--bg); }

  .pages {
    padding-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
  }

  /* 首页hero放大 */
  .hero {
    padding: 52px 40px 40px;
    border-radius: 0 0 32px 32px;
  }

  .hero-avatar { width: 90px; height: 90px; font-size: 46px; }
  .hero-name { font-size: 18px; }
  .hero-couple { gap: 32px; margin-bottom: 20px; }
  .hero-heart { font-size: 40px; }
  .hero-love-text { font-size: 12px; }

  .hero-quote { font-size: 22px; margin: 20px auto 24px; max-width: 500px; }

  .ht-item { padding: 10px 16px; min-width: 68px; border-radius: 14px; }
  .ht-num { font-size: 30px; }

  .home-stats { padding: 24px 32px 0; gap: 16px; }
  .stat-card { padding: 22px 16px; border-radius: 18px; }
  .stat-num { font-size: 28px; }
  .stat-label { font-size: 13px; }

  .home-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; padding: 24px 32px;
  }
  .home-section { margin-bottom: 0; }

  /* 页面内容加宽 */
  .page-header { padding: 28px 32px 0; }

  .timeline { padding: 0 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .timeline .post-card { margin-bottom: 0; }
  .timeline .empty-state { grid-column: 1 / -1; }
  .post-card .post-images img { width: 120px; height: 120px; }

  .checkin-streak { margin: 0 32px 20px; }
  .checkin-journal { padding: 0 32px; }
  .checkin-board { grid-template-columns: 320px 1fr; gap: 20px; }
  .checkin-calendar { margin-bottom: 0; }

  .ann-list { padding: 0 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .ann-list .ann-card { margin-bottom: 0; }
  .ann-list .empty-state { grid-column: 1 / -1; }

  .wish-progress { margin: 0 32px 16px; }
  .wish-list { padding: 0 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .wish-list .wish-item { margin-bottom: 0; }
  .wish-list .empty-state { grid-column: 1 / -1; }

  .msg-list { padding: 0 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .msg-list .msg-card { margin-bottom: 0; }
  .msg-list .empty-state { grid-column: 1 / -1; }

  .card-actions { opacity: 0.4; }
  .post-card:hover .card-actions,
  .checkin-item:hover .card-actions,
  .ann-card:hover .card-actions,
  .msg-card:hover .card-actions { opacity: 1; }
}

@media (min-width: 1200px) {
  .timeline { grid-template-columns: repeat(3, 1fr); }
  .msg-list { grid-template-columns: repeat(3, 1fr); }
  .ann-list { grid-template-columns: repeat(3, 1fr); }
}

/* ========== 图片上传进度 ========== */
.image-preview-item.uploading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
}

.upload-progress {
  width: 80%;
  height: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e91e63, #ff5722);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.upload-status {
  font-size: 12px;
  color: #c2185b;
  font-weight: 500;
}

/* 上传错误状态 */
.image-preview-item.upload-error {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.upload-error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  text-align: center;
}

.upload-error-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.upload-error-text {
  font-size: 11px;
  color: #c62828;
  margin-bottom: 8px;
  max-width: 90%;
  word-break: break-word;
}

.upload-retry-btn {
  padding: 6px 14px;
  font-size: 12px;
  background: linear-gradient(135deg, #e91e63, #ff5722);
  color: white;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.upload-retry-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}
