/* ==========================================
   💕 恋爱APP设计系统 — 全新UI
   ========================================== */

/* ===== 设计标记 ===== */
:root {
  --rose: #e84d8a;
  --rose-dark: #d43d7a;
  --rose-light: #ff8caa;
  --rose-glow: #ffb3c6;
  --lavender: #c084fc;
  --lavender-light: #e0c8fc;
  --bg: #fff5f7;
  --bg-card: #ffffff;
  --bg-soft: #fce8ef;
  --bg-warm: #fef0f5;
  --text: #2d1b2e;
  --text-secondary: #6b4e6f;
  --text-muted: #a080a5;
  --text-light: #c9a8ce;
  --border: #f0dbe4;
  --border-light: #f8ecf0;
  --success: #7ec8a0;
  --success-bg: #e8f8ee;
  --danger: #ef4444;
  --danger-bg: #fde8e8;
  --warning: #f59e0b;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --radius-xl: 32px;
  --shadow: 0 4px 24px rgba(232, 77, 138, 0.10);
  --shadow-lg: 0 8px 40px rgba(232, 77, 138, 0.14);
  --shadow-float: 0 8px 32px rgba(232, 77, 138, 0.18);
  --gradient-rose: linear-gradient(135deg, #e84d8a, #ff6b9d);
  --gradient-rose-soft: linear-gradient(135deg, #ff8caa, #ffb3c6);
  --gradient-lavender: linear-gradient(135deg, #c084fc, #a78bfa);
  --gradient-warm: linear-gradient(135deg, #fce8ef, #fff5f7);
  --gradient-bg: linear-gradient(160deg, #fff5f7 0%, #fce8ef 40%, #f8ecf8 100%);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nav-height: 72px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--gradient-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

input, textarea, button, select {
  font-family: inherit;
  font-size: inherit;
}

/* ===== 排版 ===== */
.section-title {
  font-size: 22px;
  font-weight: 700;
  background: var(--gradient-rose);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 16px;
}

/* ===== 页面容器 ===== */
#page-content {
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 24px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

#page-content::-webkit-scrollbar {
  width: 4px;
}

#page-content::-webkit-scrollbar-track {
  background: transparent;
}

#page-content::-webkit-scrollbar-thumb {
  background: var(--rose-glow);
  border-radius: 4px;
}

/* ===== 按钮系统 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--gradient-rose);
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(232, 77, 138, 0.30);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(232, 77, 138, 0.30);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-card);
  color: var(--rose);
  border: 1.5px solid var(--border);
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  border-color: var(--rose-light);
  background: var(--bg-soft);
  box-shadow: 0 2px 12px rgba(232, 77, 138, 0.10);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1.5px solid #fca5a5;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-small {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 20px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
}

/* ===== 输入框 ===== */
.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: all 0.3s;
  box-sizing: border-box;
}

.input-field:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232, 77, 138, 0.12);
}

.input-field::placeholder {
  color: var(--text-light);
}

textarea.input-field {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-gradient {
  background: var(--gradient-rose);
  color: #fff;
  border: none;
  box-shadow: 0 4px 24px rgba(232, 77, 138, 0.25);
}

.card-soft {
  background: var(--bg-soft);
  border: none;
  box-shadow: none;
}

/* ===== 导航栏 ===== */
#nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  z-index: 100;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  border-radius: 0;
  min-width: 0;
}

.nav-btn .nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.3s;
  position: relative;
}

.nav-btn .nav-label {
  font-size: 10px;
  letter-spacing: 0.2px;
}

.nav-btn.active {
  color: var(--rose);
}

.nav-btn.active .nav-icon {
  transform: scale(1.1);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--gradient-rose);
  border-radius: 0 0 3px 3px;
}

.nav-btn:active {
  transform: scale(0.92);
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(232, 77, 138, 0.35);
  line-height: 1;
}

.nav-user-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  border-radius: 0;
}

.nav-user-btn .nav-icon {
  font-size: 22px;
}

.nav-user-btn .nav-label {
  font-size: 10px;
}

.nav-user-btn:hover {
  color: var(--rose);
}

.has-msg .msg-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 14px);
  width: 8px;
  height: 8px;
  background: var(--rose);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.88);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 20px;
  background: var(--gradient-bg);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(ellipse at 30% 20%, rgba(232,77,138,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(192,132,252,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 40px 28px 32px;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(232,77,138,0.12);
  border: 1px solid rgba(255,255,255,0.6);
  position: relative;
  z-index: 1;
}

.login-emoji {
  font-size: 56px;
  margin-bottom: 12px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  background: var(--gradient-rose);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.login-users {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

.login-user-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.3s;
  width: 130px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.login-user-btn:hover {
  border-color: var(--rose-glow);
  background: var(--bg-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232,77,138,0.10);
}

.login-user-btn.selected {
  border-color: var(--rose);
  background: var(--bg-soft);
  box-shadow: 0 4px 20px rgba(232,77,138,0.15);
  transform: translateY(-2px);
}

.login-user-avatar {
  font-size: 40px;
  line-height: 1;
}

.login-user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.login-pwd-area {
  margin-top: 4px;
}

.login-pwd-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
  box-sizing: border-box;
  text-align: center;
  letter-spacing: 2px;
}

.login-pwd-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232,77,138,0.12);
}

.login-enter-btn {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  background: var(--gradient-rose);
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(232,77,138,0.30);
  letter-spacing: 1px;
}

.login-enter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(232,77,138,0.35);
}

.login-enter-btn:active {
  transform: scale(0.97);
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* ===== 首页 ===== */

/* 照片轮播 */
.photo-carousel {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 0 16px;
  box-shadow: var(--shadow-lg);
  background: var(--bg-soft);
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  color: var(--rose);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

.carousel-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.92);
}

.carousel-btn.prev {
  left: 12px;
}

.carousel-btn.next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.carousel-dots .dot.active {
  width: 24px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* 恋爱计时器 */
.counter-card {
  text-align: center;
  margin-bottom: 14px;
}

.counter-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}

.counter-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.counter-num {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding: 8px 12px;
  background: var(--gradient-rose);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(232,77,138,0.25);
  position: relative;
}

.counter-num .counter-unit {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
}

.counter-sep {
  font-size: 28px;
  font-weight: 300;
  color: var(--rose-light);
  margin: 0 2px;
}

/* 运势卡片 */
.fortune-card {
  margin-bottom: 14px;
}

.fortune-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fortune-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fortune-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.fortune-btn:hover {
  border-color: var(--rose-light);
  color: var(--rose);
  background: var(--bg-soft);
}

.fortune-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  position: relative;
}

.fortune-text::before {
  content: '💌';
  position: absolute;
  top: -8px;
  left: 16px;
  font-size: 16px;
}

/* 统计行 */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.stat-card:active {
  transform: scale(0.95);
}

.stat-card .stat-icon {
  font-size: 20px;
  margin-bottom: 4px;
  display: block;
}

.stat-card .stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--rose);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 签到按钮区 */
.checkin-area {
  text-align: center;
  margin-bottom: 14px;
}

.btn-quick-checkin {
  width: 100%;
  padding: 16px;
  background: var(--gradient-rose);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(232,77,138,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-quick-checkin:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(232,77,138,0.25);
}

.btn-quick-checkin.done {
  background: linear-gradient(135deg, #7ec8a0, #6ab890);
  box-shadow: 0 4px 20px rgba(126,200,160,0.25);
}

.checkin-hint {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.checkin-hint span {
  cursor: pointer;
  transition: color 0.3s;
}

.checkin-hint span:hover {
  color: var(--rose);
}

/* 彩蛋按钮 */
.btn-easter-egg {
  text-align: center;
  padding: 10px;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.3s;
  background: transparent;
  border: 1.5px dashed var(--border);
  margin-bottom: 8px;
}

.btn-easter-egg:hover {
  color: var(--rose);
  border-color: var(--rose-glow);
  background: var(--bg-soft);
}

/* ===== 商店页 ===== */
.shop-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.balance-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  padding: 10px 18px;
  border-radius: 25px;
}

.balance-icon {
  font-size: 20px;
}

.balance-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--rose);
}

.balance-label {
  font-size: 12px;
  color: var(--text-muted);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  background: var(--gradient-rose);
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(232,77,138,0.25);
}

.primary-btn:active {
  transform: scale(0.96);
}

/* 礼物网格 */
.gift-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.gift-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.3s;
}

.gift-card:active {
  transform: scale(0.96);
}

.gift-card.disabled {
  opacity: 0.5;
  filter: grayscale(0.6);
}

.gift-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
}

.gift-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.gift-price {
  font-size: 13px;
  color: var(--rose);
  font-weight: 700;
  margin-bottom: 10px;
}

.btn-buy {
  padding: 7px 16px;
  background: var(--gradient-rose);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(232,77,138,0.20);
}

.btn-buy:active {
  transform: scale(0.94);
}

.btn-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 订单列表 */
.order-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.3s;
}

.order-card:active {
  transform: scale(0.98);
}

.order-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.order-info {
  flex: 1;
  min-width: 0;
}

.order-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.order-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.order-status {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.order-status:hover {
  background: var(--rose);
  color: #fff;
}

.order-status.shipped {
  background: var(--success-bg);
  color: #2d8a5e;
  cursor: default;
}

/* ===== 签到/任务弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 27, 46, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-box {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(45,27,46,0.25);
  animation: modalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.modal-close:hover {
  background: var(--rose);
  color: #fff;
}

/* 签到日历 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav-btn:hover {
  border-color: var(--rose-light);
  color: var(--rose);
}

.calendar-month {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.calendar-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.calendar-day {
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.checked {
  background: var(--gradient-rose);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(232,77,138,0.25);
}

.calendar-day.today {
  border: 2px solid var(--rose);
  font-weight: 700;
}

.calendar-day.other-month {
  color: var(--text-light);
}

.calendar-streak {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-secondary);
}

.calendar-streak strong {
  color: var(--rose);
  font-size: 18px;
}

/* 任务系统 */
.task-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-soft);
  border-radius: 25px;
  padding: 3px;
  margin-bottom: 16px;
}

.task-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 22px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.task-tab.active {
  background: var(--bg-card);
  color: var(--rose);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.task-panel {
  display: none;
}

.task-panel.active {
  display: block;
}

.task-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.3s;
}

.task-card:active {
  transform: scale(0.98);
}

.task-card.done {
  opacity: 0.6;
  background: var(--bg-soft);
}

.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
  color: transparent;
}

.task-card.done .task-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 14px;
  color: var(--text);
}

.task-card.done .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-points {
  font-size: 12px;
  font-weight: 700;
  color: var(--rose);
  flex-shrink: 0;
}

.task-timer {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}

/* ===== 日记页 ===== */
.diary-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.mood-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.mood-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 36px;
  line-height: 1;
}

.mood-btn:hover {
  border-color: var(--rose-light);
  background: var(--bg-soft);
}

.mood-btn.selected {
  border-color: var(--rose);
  background: var(--bg-soft);
  box-shadow: 0 2px 8px rgba(232,77,138,0.12);
}

.diary-photo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-add-photo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px dashed var(--border);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  min-height: 36px;
}

.btn-add-photo:hover {
  border-color: var(--rose-light);
  color: var(--rose);
  background: var(--bg-soft);
}

.diary-photo-preview {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1.5px solid var(--border);
}

.btn-remove-photo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -28px;
  margin-top: -28px;
  z-index: 1;
  position: relative;
}

.diary-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: all 0.3s;
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}

.diary-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232,77,138,0.12);
}

.diary-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.diary-sort-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 12px;
}

.diary-sort-btn:hover {
  border-color: var(--rose-light);
  color: var(--rose);
}

/* 日记列表 */
.diary-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.3s;
}

.diary-item:active {
  transform: scale(0.98);
}

.diary-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.diary-mood {
  font-size: 22px;
}

.diary-date {
  font-size: 12px;
  color: var(--text-muted);
}

.diary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.diary-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diary-photo-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* 日记详情弹窗 */
.diary-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(45, 27, 46, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.diary-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(45,27,46,0.25);
  animation: modalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.diary-modal-content .section-title {
  margin-bottom: 8px;
}

.diary-modal-mood {
  font-size: 28px;
  margin-bottom: 10px;
}

.diary-modal-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.diary-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.5;
}

.diary-modal-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}

.diary-modal-img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 14px;
}

.diary-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
}

.diary-empty .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

/* ===== 留言墙 ===== */
.msg-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.msg-sender-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.msg-sender {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: all 0.3s;
}

.msg-sender:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232,77,138,0.12);
}

.msg-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: all 0.3s;
  resize: vertical;
  min-height: 70px;
  line-height: 1.6;
}

.msg-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232,77,138,0.12);
}

.msg-send-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.msg-date-divider {
  text-align: center;
  padding: 16px 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
}

.msg-date-divider::before,
.msg-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 60px);
  height: 1px;
  background: var(--border);
}

.msg-date-divider::before {
  left: 0;
}

.msg-date-divider::after {
  right: 0;
}

.msg-item {
  display: inline-block;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  margin-bottom: 8px;
  position: relative;
}

.msg-item.sender-self {
  background: var(--gradient-rose);
  color: #fff;
  border-bottom-right-radius: 4px;
  float: right;
  clear: both;
}

.msg-item.sender-other {
  background: var(--bg-soft);
  color: var(--text);
  border-bottom-left-radius: 4px;
  float: left;
  clear: both;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  clear: both;
}

.msg-item.sender-self + .msg-time {
  text-align: right;
}

.msg-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
}

.msg-empty .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

/* ===== 聊天页 ===== */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#page-content:has(.chat-page) {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height));
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 8px;
  flex-shrink: 0;
}

.chat-header .section-title {
  margin: 0;
}

.chat-toggle-btn {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.chat-toggle-btn:hover {
  border-color: var(--rose-light);
  color: var(--rose);
}

.chat-toggle-btn.active {
  background: var(--gradient-rose);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(232,77,138,0.25);
}

.chat-identity {
  padding: 4px 16px 10px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-identity .chat-arrow {
  color: var(--rose);
  font-weight: 700;
}

.chat-msgs-area {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 12px;
  min-height: 0;
  scroll-behavior: smooth;
}

.chat-msgs-area::-webkit-scrollbar {
  width: 3px;
}

.chat-msgs-area::-webkit-scrollbar-thumb {
  background: var(--rose-glow);
  border-radius: 3px;
}

.chat-msg-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  animation: msgIn 0.3s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg-row.self {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.chat-msg-main {
  max-width: 75%;
}

.chat-msg-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
  padding-left: 4px;
}

.chat-msg-row.self .chat-msg-name {
  text-align: right;
  padding-left: 0;
  padding-right: 4px;
}

.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  display: inline-block;
  max-width: 100%;
}

.chat-msg-row:not(.self) .chat-msg-bubble {
  background: var(--bg-card);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.chat-msg-row.self .chat-msg-bubble {
  background: var(--gradient-rose);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 12px rgba(232,77,138,0.20);
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 3px;
  padding-left: 4px;
}

.chat-msg-row.self .chat-msg-time {
  text-align: right;
  padding-left: 0;
  padding-right: 4px;
}

.chat-msg-img {
  max-width: 200px;
  max-height: 240px;
  border-radius: 12px;
  display: block;
  cursor: zoom-in;
}

.chat-msg-recalled {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

.chat-msg-ref {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-left: 3px solid var(--rose-glow);
  border-radius: 0 8px 8px 0;
  padding: 4px 10px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
  background: var(--bg-card);
}

.chat-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232,77,138,0.12);
}

.chat-send-btn {
  padding: 11px 20px;
  border-radius: 24px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 14px;
  min-width: 64px;
}

/* 聊天记录查看 */
.memory-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#page-content:has(.memory-page) {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height));
}

.memory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 0;
  flex-shrink: 0;
}

.memory-header .section-title {
  font-size: 18px;
}

.memory-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 16px;
  flex-shrink: 0;
}

.memory-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.memory-stat-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--rose);
  line-height: 1.2;
}

.memory-stat-num strong {
  font-size: 20px;
  font-weight: 900;
}

.memory-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.memory-search-box {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
}

.memory-search-box .btn-primary {
  flex-shrink: 0;
}

.memory-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px 12px;
  flex-shrink: 0;
}

.memory-date-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.memory-date-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.memory-nav-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--rose);
  white-space: nowrap;
}

.memory-nav-weekday {
  font-size: 15px;
  color: var(--rose);
}

.memory-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0 16px 8px;
}

.memory-content::-webkit-scrollbar {
  width: 3px;
}

.memory-content::-webkit-scrollbar-thumb {
  background: var(--rose-glow);
  border-radius: 3px;
}

.memory-list {
  padding: 0;
}

.memory-list::-webkit-scrollbar {
  width: 3px;
}

.memory-list::-webkit-scrollbar-thumb {
  background: var(--rose-glow);
  border-radius: 3px;
}

.memory-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 12px;
  flex-shrink: 0;
}

.btn-chat-toggle {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.btn-chat-toggle:hover {
  border-color: var(--rose-light);
  color: var(--rose);
}

.btn-chat-toggle.active {
  border-color: var(--rose);
  background: var(--gradient-rose);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,77,138,0.2);
}

.memory-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
}

.memory-more {
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: var(--text-light);
}

.memory-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* 聊天记录搜索结果 */
.chat-search-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.3s;
}

.chat-search-item:active {
  transform: scale(0.98);
}

.chat-search-body {
  flex: 1;
  min-width: 0;
}

.chat-search-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-hl {
  background: #fde68a;
  border-radius: 3px;
  padding: 0 2px;
}

.chat-img {
  max-width: 240px;
  max-height: 320px;
  border-radius: 12px;
  cursor: pointer;
  display: block;
}

/* 图片灯箱 */
.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
}

.chat-lightbox-img {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.chat-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.chat-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ===== 管理页 ===== */
.admin-page {
  padding-bottom: 20px;
}

.admin-login-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  text-align: center;
}

.admin-login-card .section-title {
  margin-bottom: 20px;
}

.admin-pwd-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
  box-sizing: border-box;
  text-align: center;
}

.admin-pwd-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(232,77,138,0.12);
}

.admin-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.admin-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-row .input-field {
  flex: 1;
  min-width: 120px;
}

.admin-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 80px;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.admin-gift-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.admin-gift-icon {
  font-size: 24px;
}

.admin-gift-info {
  flex: 1;
  min-width: 0;
}

.admin-gift-name {
  font-size: 14px;
  font-weight: 600;
}

.admin-gift-price {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Toast 提示 ===== */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90vw;
}

.toast {
  padding: 12px 20px;
  background: rgba(45, 27, 46, 0.88);
  backdrop-filter: blur(12px);
  color: #fff;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1), toastOut 0.4s 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  text-align: center;
  pointer-events: auto;
  max-width: 100%;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.92); }
}

/* ===== 特效容器 ===== */
#effect-container {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  overflow: hidden;
}

.heart-particle {
  position: absolute;
  font-size: 24px;
  animation: heartFloat 1.5s ease-out forwards;
  pointer-events: none;
}

@keyframes heartFloat {
  0% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.3) rotate(40deg); }
}

/* 全屏爱心 */
.fullscreen-hearts {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

.fullscreen-heart {
  position: absolute;
  font-size: 28px;
  animation: heartRise 3s ease-out forwards;
  pointer-events: none;
}

@keyframes heartRise {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(0.5) rotate(20deg);
  }
}

/* ===== 欢迎弹窗 ===== */
.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 9996;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 27, 46, 0.5);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.welcome-content {
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(45,27,46,0.3);
  animation: modalIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-content .login-emoji {
  font-size: 64px;
}

.welcome-content .login-title {
  font-size: 24px;
  margin-bottom: 8px;
}

.welcome-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ===== 行内布局辅助 ===== */
.flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ===== 响应式 - 手机 ===== */
@media (max-width: 480px) {
  #page-content {
    padding: 16px 12px 20px;
  }
  #page-content:has(.chat-page) {
    padding: 0;
  }

  .section-title {
    font-size: 19px;
  }

  .photo-carousel {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
  }

  .carousel-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .carousel-dots .dot {
    width: 7px;
    height: 7px;
  }
  .carousel-dots .dot.active {
    width: 20px;
  }

  .counter-num {
    min-width: 44px;
    padding: 6px 10px;
    font-size: 26px;
  }
  .counter-sep {
    font-size: 22px;
  }

  .stats-row {
    gap: 6px;
  }
  .stat-card {
    padding: 12px 6px;
  }
  .stat-card .stat-num {
    font-size: 18px;
  }
  .stat-card .stat-label {
    font-size: 10px;
  }

  .btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 18px;
    font-size: 13px;
  }

  .nav-btn {
    gap: 1px;
  }
  .nav-btn .nav-icon {
    font-size: 20px;
  }
  .nav-btn .nav-label {
    font-size: 9px;
  }

  .gift-grid {
    gap: 10px;
  }
  .gift-card {
    padding: 14px 10px;
  }

  .login-card {
    padding: 30px 20px 24px;
  }
  .login-title {
    font-size: 22px;
  }
  .login-user-btn {
    padding: 14px 16px;
    width: 110px;
  }
  .login-user-avatar {
    font-size: 32px;
  }

  .diary-item {
    padding: 14px 16px;
  }
  .diary-form {
    padding: 16px;
  }

  .chat-header {
    padding: 10px 12px 6px;
  }
  .chat-msgs-area {
    padding: 6px 12px 10px;
  }
  .chat-input-bar {
    padding: 8px 10px;
    gap: 6px;
  }
  .chat-input {
    padding: 10px 14px;
    font-size: 14px;
  }
  .chat-send-btn {
    padding: 10px 16px;
    font-size: 13px;
    min-width: 56px;
  }

  .memory-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
  }
  .memory-stat-num strong {
    font-size: 16px;
  }
  .memory-stat-card {
    padding: 8px 4px;
  }

  .modal-box {
    padding: 22px 18px;
    border-radius: var(--radius);
  }

  .diary-modal-content {
    padding: 22px 18px;
  }

  .msg-item {
    max-width: 75%;
    padding: 9px 14px;
    font-size: 13px;
  }

  .admin-section {
    padding: 16px;
  }
}

@media (max-width: 380px) {
  #page-content {
    padding: 12px 8px 16px;
  }
  #page-content:has(.chat-page) {
    padding: 0;
  }

  .section-title {
    font-size: 17px;
  }

  .photo-carousel {
    aspect-ratio: 1/1;
    border-radius: 14px;
  }

  .counter-num {
    min-width: 38px;
    padding: 5px 8px;
    font-size: 22px;
  }
  .counter-sep {
    font-size: 18px;
  }

  .nav-btn .nav-icon {
    font-size: 18px;
  }

  .login-card {
    padding: 24px 16px 20px;
    border-radius: var(--radius);
  }
  .login-user-btn {
    padding: 12px 14px;
    width: 100px;
  }
  .login-user-avatar {
    font-size: 28px;
  }
  .login-user-name {
    font-size: 13px;
  }

  .chat-input {
    padding: 9px 12px;
    font-size: 13px;
  }
  .chat-send-btn {
    padding: 9px 14px;
    font-size: 12px;
    min-width: 48px;
  }
  .chat-msgs-area {
    padding: 4px 10px 8px;
  }
  .chat-input-bar {
    padding: 6px 8px;
    gap: 4px;
  }

  .memory-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px;
  }
  .memory-stat-num strong {
    font-size: 14px;
  }
  .memory-stat-card {
    padding: 6px 4px;
  }

  .msg-item {
    max-width: 80%;
    padding: 7px 10px;
    font-size: 12px;
  }
}

/* ===== 管理员区域特殊样式 ===== */
.admin-section .admin-row:last-child {
  margin-bottom: 0;
}

.admin-section .flex-between {
  margin-bottom: 8px;
}

.admin-section .btn-primary,
.admin-section .btn-secondary,
.admin-section .btn-danger {
  flex-shrink: 0;
}

/* 存储管理特殊样式 */
.restore-input {
  display: none;
}

.restore-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-soft);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  border: 1.5px dashed var(--border);
}

.restore-label:hover {
  border-color: var(--rose-light);
  color: var(--rose);
  background: var(--bg-soft);
}

/* 设置区域 */
.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-row label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 70px;
}

.settings-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--rose);
  cursor: pointer;
}

/* 首页引用 */
.home-quote {
  text-align: center;
  padding: 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  line-height: 1.6;
}

/* 切换用户按钮 */
.switch-user-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.3s;
}

.switch-user-btn:hover {
  color: var(--rose);
}

/* ===== 加载/空状态 ===== */
.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-state .loading-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
  animation: pulse-loading 1.5s ease infinite;
}

@keyframes pulse-loading {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ===== 聊天记录弹窗 ===== */
.chat-record-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.chat-record-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 27, 46, 0.45);
  backdrop-filter: blur(6px);
}

.chat-record-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  max-width: 440px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(45,27,46,0.25);
  animation: modalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 高亮文本 ===== */
.highlight-rose {
  color: var(--rose);
  font-weight: 700;
}

.highlight-success {
  color: var(--success);
  font-weight: 700;
}

/* ===== 爱心悬浮装饰 ===== */
.floating-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  color: var(--rose-glow);
  opacity: 0.15;
  animation: floatAround 8s ease-in-out infinite;
  font-size: 20px;
}

@keyframes floatAround {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.15;
  }
  25% {
    transform: translateY(-20px) rotate(5deg);
    opacity: 0.2;
  }
  50% {
    transform: translateY(-10px) rotate(-3deg);
    opacity: 0.12;
  }
  75% {
    transform: translateY(-30px) rotate(4deg);
    opacity: 0.18;
  }
}

/* ===== 兼容类（模板引用） ===== */
/* 任务 body 别名 */
.task-body {
  flex: 1;
  min-width: 0;
}

.empty-tip {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.task-panel-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.wife-task-reminder {
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-large {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 25px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 18px;
}

/* admin 表单/alert/动作 */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-alerts {
  margin-bottom: 16px;
}

.alert-box {
  padding: 12px 16px;
  background: var(--warning);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.admin-photo-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-photo-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-soft);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-photo-admin {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.btn-remove-photo-admin:hover {
  background: var(--danger);
}

/* 签到弹窗中的提示 */
.today-checked-hint {
  text-align: center;
  padding: 10px;
  margin-bottom: 16px;
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  color: #2d8a5e;
  font-weight: 600;
  font-size: 14px;
}

/* 任务描述细节 */
.task-undotimer {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}

/* 礼物编辑行 */
.gift-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.gift-edit-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.gift-edit-row input:focus {
  border-color: var(--rose);
}

/* 照片上传预览 */
.photo-upload-area {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* 消息时间戳 */
.msg-timestamp {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* 订单/礼物管理行 */
.admin-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.admin-item-info {
  flex: 1;
  min-width: 0;
}

.admin-item-name {
  font-size: 13px;
  font-weight: 600;
}

.admin-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* 开关按钮 */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
  padding: 0;
}

.toggle-switch.on {
  background: var(--rose);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle-switch.on::after {
  transform: translateX(20px);
}

/* ===== 赚积分任务系统 ===== */
.earn-section {
  margin-bottom: 20px;
}

.earn-form-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.earn-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.earn-form-row .input-field {
  flex: 1;
}

.earn-task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.3s;
}

.earn-task-card.status-applied {
  border-color: var(--warning);
  background: #fffcf0;
}

.earn-task-card.status-completed {
  border-color: var(--success);
  background: var(--success-bg);
  opacity: 0.8;
}

.earn-task-info {
  flex: 1;
  min-width: 0;
}

.earn-task-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}

.earn-task-points {
  font-size: 13px;
  font-weight: 700;
  color: var(--rose);
}

.earn-task-status {
  font-size: 12px;
  color: var(--text-muted);
}

.earn-task-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.earn-pending {
  font-size: 12px;
  color: var(--warning);
  font-weight: 500;
}

.earn-check {
  font-size: 20px;
  flex-shrink: 0;
}

.btn-apply {
  font-size: 12px !important;
  padding: 6px 12px !important;
  white-space: nowrap;
}

.btn-approve {
  background: var(--success) !important;
  color: #fff !important;
  border: none !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  cursor: pointer !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  transition: all 0.3s;
}

.btn-approve:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

.earn-task-card.status-completed .earn-task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ===== Close Button Style ===== */
.modal-close-bottom {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-top: 16px;
  background: var(--gradient-rose-soft);
  color: var(--rose-dark);
  border: 1.5px solid var(--rose-light);
  border-radius: 25px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(232, 77, 138, 0.08);
}

.modal-close-bottom:hover {
  background: var(--gradient-rose);
  color: #fff;
  border-color: var(--rose);
  box-shadow: 0 4px 20px rgba(232, 77, 138, 0.30);
  transform: translateY(-2px);
}

.modal-close-bottom:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(232, 77, 138, 0.15);
}
