/* 基础变量 */
:root {
  --primary: #e8a0b0;
  --primary-light: #f2c4d0;
  --primary-dark: #d4849a;
  --secondary: #c9a0d4;
  --secondary-light: #ddc0e6;
  --bg: #fef8f5;
  --bg-card: #ffffff;
  --bg-sidebar: #fdf2f4;
  --text: #5a4a4e;
  --text-light: #9a8a8e;
  --text-lighter: #c4b4b8;
  --border: #f5e0e6;
  --shadow: 0 2px 12px rgba(200, 140, 160, 0.06);
  --shadow-md: 0 4px 20px rgba(200, 140, 160, 0.10);
  --shadow-lg: 0 8px 40px rgba(200, 140, 160, 0.14);
  --radius: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* 页面容器 */
.page {
  min-height: 100vh;
}

#password-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff5f7 0%, #f8e8ff 50%, #e8f4ff 100%);
  padding: 20px;
}

.gate-container {
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

.gate-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

.gate-container h1 {
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 8px;
  font-weight: 700;
}

.gate-subtitle {
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 15px;
}

#password-form {
  background: white;
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

#password-form input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: var(--transition);
  outline: none;
  text-align: center;
  letter-spacing: 4px;
}

#password-form input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 103, 125, 0.1);
}

.gate-error {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}

.gate-footer {
  margin-top: 20px;
}

.gate-footer a {
  color: var(--text-lighter);
  font-size: 13px;
  text-decoration: none;
  transition: var(--transition);
}

.gate-footer a:hover {
  color: var(--primary);
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
  flex: 1;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(232, 103, 125, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-lighter);
}

.input-hint {
  display: block;
  font-size: 12px;
  color: var(--text-lighter);
  margin-top: 6px;
}

/* ==================== 按钮样式 ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 140, 160, 0.30);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg);
}

.btn-danger {
  background: white;
  color: #e74c3c;
  border: 2px solid #fde8e8;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: #e74c3c;
  color: white;
  border-color: #e74c3c;
}

.btn-add {
  background: white;
  color: var(--primary);
  border: 2px dashed var(--primary-light);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add:hover {
  background: var(--primary);
  color: white;
  border-style: solid;
  transform: translateY(-1px);
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-close:hover {
  background: var(--border);
  color: var(--text);
  transform: rotate(90deg);
}

/* ==================== 主页面布局 ==================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #fdf2f4 0%, #fef8f5 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 20;
  overflow-y: auto;
}

.sidebar-hero {
  padding: 48px 28px 36px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.sidebar-heart {
  font-size: 32px;
  color: #f5c6cb;
  -webkit-text-stroke: 1px #e09aab;
  opacity: 0.85;
}

.sidebar-title {
  font-size: 20px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 2px;
}



.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: none;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  font-weight: 500;
}

.nav-item:hover {
  color: var(--primary-dark);
  background: rgba(232, 160, 176, 0.10);
}

.nav-item.active {
  color: var(--primary-dark);
  background: white;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.nav-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* 侧边栏纪念日卡片 */
.sidebar-anniversaries {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-ann-card {
  background: white;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.sidebar-ann-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.sidebar-ann-label {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-ann-days {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sidebar-ann-unit {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.4;
}

/* 带背景图的卡片文字颜色 */
.sidebar-ann-card.has-bg .sidebar-ann-label,
.sidebar-ann-card.has-bg .sidebar-ann-days,
.sidebar-ann-card.has-bg .sidebar-ann-unit {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.sidebar-ann-card.has-bg.dark-text .sidebar-ann-label,
.sidebar-ann-card.has-bg.dark-text .sidebar-ann-days,
.sidebar-ann-card.has-bg.dark-text .sidebar-ann-unit {
  color: #2d2d2d;
  text-shadow: none;
}

/* 纪念日图片上传区域 */
.anniversary-img-upload {
  position: relative;
  width: 100%;
  height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  background: var(--bg);
}

.anniversary-img-upload:hover {
  border-color: var(--primary-light);
}

.ann-img-placeholder {
  font-size: 13px;
  color: var(--text-light);
}

.ann-img-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ann-img-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.sidebar-decor {
  font-size: 28px;
  animation: float 3s ease-in-out infinite;
  opacity: 0.6;
}

/* ==================== 主内容区 ==================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px;
  min-height: 100vh;
  background: var(--bg);
}

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 900px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.section-header h2 {
  font-size: 20px;
  color: var(--text);
  font-weight: 700;
}

/* ==================== 纪念日卡片 ==================== */
.anniversary-list {
  display: grid;
  gap: 16px;
}

.anniversary-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  border: 1px solid transparent;
}

.anniversary-card:nth-child(1) { animation-delay: 0.05s; }
.anniversary-card:nth-child(2) { animation-delay: 0.1s; }
.anniversary-card:nth-child(3) { animation-delay: 0.15s; }
.anniversary-card:nth-child(4) { animation-delay: 0.2s; }
.anniversary-card:nth-child(5) { animation-delay: 0.25s; }

.anniversary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.anniversary-icon {
  font-size: 36px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fdf2f4, #fef0f2);
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: var(--transition);
}

.anniversary-card:hover .anniversary-icon {
  transform: scale(1.1) rotate(-5deg);
}

.anniversary-info {
  flex: 1;
  min-width: 0;
}

.anniversary-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.anniversary-date {
  font-size: 13px;
  color: var(--text-light);
}

.anniversary-days {
  text-align: right;
  flex-shrink: 0;
}

.anniversary-days .days-count {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  display: block;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.anniversary-days .days-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

.anniversary-next {
  font-size: 11px;
  color: var(--secondary);
  margin-top: 6px;
  font-weight: 500;
  white-space: nowrap;
}

/* ==================== 纪念日页面 ==================== */
.anniversary-page {
  position: relative;
  padding: 24px 32px;
  overflow-y: auto;
}

/* 日历卡片 */
.anniversary-calendar {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.calendar-nav-btn {
  background: none;
  border: none;
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.calendar-nav-btn:hover {
  background: var(--bg);
  color: var(--text);
}

/* 日历网格 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px 2px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 6px 0;
  font-weight: 600;
}

.calendar-day {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 4px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
  gap: 2px;
}

.calendar-day.today {
  background: var(--primary-light);
  border-radius: 8px;
  font-weight: 700;
  color: var(--primary-dark);
}

.calendar-day.has-anniversary {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.calendar-day.has-anniversary:hover {
  background: var(--primary-dark);
}

.calendar-day.other-month {
  color: var(--text-light);
  opacity: 0.35;
  cursor: default;
}

.calendar-day:hover:not(.other-month) {
  background: var(--bg);
}

/* 日期下方事项标题 */
.calendar-day-events {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-light);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

.calendar-day.has-anniversary .calendar-day-events {
  color: rgba(255, 255, 255, 0.85);
}

/* 当日事项卡片 */
.today-events {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.today-event-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.today-event-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.today-event-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* 纪念日 FAB */
.anniversary-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 10;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 140, 160, 0.35);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.anniversary-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 24px rgba(200, 140, 160, 0.45);
}

.anniversary-fab:active {
  transform: translateY(0) scale(1);
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  animation: fadeIn 0.5s ease;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.empty-state p {
  font-size: 15px;
}

/* ==================== 照片时间线 ==================== */
.photo-timeline {
  position: relative;
}

.timeline-group {
  margin-bottom: 36px;
}

.timeline-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  padding-left: 28px;
  position: relative;
}

.timeline-date::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(232, 103, 125, 0.15);
}

.timeline-date::after {
  content: '';
  position: absolute;
  left: 5px;
  top: calc(50% + 12px);
  width: 2px;
  height: calc(100% + 24px);
  background: linear-gradient(to bottom, var(--border), transparent);
}

.timeline-group:last-child .timeline-date::after {
  display: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding-left: 28px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  animation: scaleIn 0.4s ease forwards;
  opacity: 0;
}

.photo-item:nth-child(1) { animation-delay: 0.05s; }
.photo-item:nth-child(2) { animation-delay: 0.1s; }
.photo-item:nth-child(3) { animation-delay: 0.15s; }
.photo-item:nth-child(4) { animation-delay: 0.2s; }
.photo-item:nth-child(5) { animation-delay: 0.25s; }
.photo-item:nth-child(6) { animation-delay: 0.3s; }

.photo-item:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: var(--shadow-md);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photo-item:hover img {
  transform: scale(1.1);
}

.photo-item .photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.photo-location-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.95);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.photo-item:hover .photo-location-icon {
  transform: scale(1.1);
}

/* ==================== 模态框 ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 20px;
  color: var(--text);
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ==================== 图标选择器 ==================== */
.icon-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-option {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.icon-option:hover {
  border-color: var(--primary-light);
  transform: scale(1.1);
}

.icon-option.selected {
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(232, 103, 125, 0.15);
}

/* ==================== 照片查看器 ==================== */
.viewer-content {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .viewer-content {
  transform: scale(1);
}

.viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  width: 44px;
  height: 44px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.viewer-image-container {
  width: 100%;
  max-height: 60vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
}

.viewer-image-container img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.viewer-info {
  padding: 28px;
}

.viewer-caption {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.viewer-date {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.viewer-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.viewer-location.hidden {
  display: none;
}

.location-icon {
  font-size: 18px;
}

.viewer-map {
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  background: #f0f0f0;
  border: 1px solid var(--border);
}

.viewer-map.hidden {
  display: none;
}

.viewer-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ==================== 上传区域 ==================== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 24px;
  background: var(--bg);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: white;
  transform: scale(1.01);
}

.upload-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.upload-area p {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.upload-area-sm {
  padding: 28px 20px;
  border-radius: var(--radius);
  margin-bottom: 0;
}

.upload-icon-sm {
  font-size: 36px;
  margin-bottom: 10px;
}

.upload-hint {
  font-size: 13px !important;
  color: var(--text-lighter) !important;
  font-weight: 400 !important;
  margin-top: 8px;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.preview-remove:hover {
  background: #e74c3c;
  transform: scale(1.1);
}

/* ==================== 足迹地图 ==================== */
.footprint-fullscreen {
  position: relative;
  padding: 0 !important;
  height: calc(100vh - 48px);
  overflow: hidden;
}

.footprint-map {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: linear-gradient(135deg, #fdf2f4 0%, #f8e8ff 50%, #e8f4ff 100%);
}

/* 缩放控件 */
.footprint-zoom-control {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.zoom-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-btn:hover {
  background: var(--bg);
  color: var(--primary);
}

.zoom-level {
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 52px;
  text-align: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  user-select: none;
  height: 44px;
  line-height: 44px;
}

/* 悬浮信息卡片 */
.footprint-detail-card {
  display: none;
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  width: 360px;
  max-height: calc(100% - 48px);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.footprint-detail-card.show {
  display: block;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-close:hover {
  background: white;
  color: var(--text);
  transform: rotate(90deg);
}

.detail-content {
  overflow-y: auto;
  max-height: calc(100vh - 96px);
}

.detail-header {
  padding: 24px 48px 16px 24px;
}

.detail-city-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.detail-date {
  font-size: 13px;
  color: var(--text-light);
}

.detail-count {
  font-size: 13px;
  color: var(--text-light);
}

/* Tab 切换栏 */
.detail-tabs {
  display: flex;
  padding: 0 24px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  background: white;
  position: sticky;
  top: 0;
  z-index: 1;
}

.detail-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: white;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.detail-tab:hover {
  color: var(--text);
  background: var(--bg);
}

.detail-tab.active {
  color: var(--primary-dark);
  background: #fdf2f4;
  border-bottom-color: var(--primary);
}

.detail-list {
  padding: 16px 24px;
}

.detail-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.detail-item:hover {
  background: var(--bg);
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-city-group {
  margin-bottom: 16px;
}

.detail-city-group:last-child {
  margin-bottom: 0;
}

.detail-city-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

.detail-item-place {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.detail-item-date {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.detail-item-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.detail-item-photos img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.detail-item-photos img:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}

/* Tab 内容区 */
.detail-tab-panel {
  display: none;
}

.detail-tab-panel.active {
  display: block;
}

/* 相册 Tab */
.detail-album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 16px 24px;
}

.detail-album-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.detail-album-grid img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.detail-album-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}

.detail-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: white;
}

.detail-actions .btn-add {
  flex: 1;
  text-align: center;
}

/* 经历卡片列表 */
.experience-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.experience-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.experience-card:last-child {
  margin-bottom: 0;
}

.experience-card-body {
  flex: 1;
  min-width: 0;
}

.experience-card-city {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.experience-card-date {
  font-size: 13px;
  color: var(--text-light);
}

/* 卡片操作图标 */
.experience-card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.experience-card:hover .experience-card-actions {
  opacity: 1;
}

.exp-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.exp-icon-btn:hover {
  color: var(--primary-dark);
  background: #fdf2f4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.exp-icon-btn svg {
  pointer-events: none;
}

/* 经历详情悬浮面板 */
.experience-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.experience-overlay.hidden {
  display: none;
}

.experience-panel {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  width: 440px;
  max-width: calc(100% - 48px);
  max-height: calc(100% - 80px);
  overflow-y: auto;
  padding: 32px 28px;
  animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.experience-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.experience-close:hover {
  background: var(--bg);
  color: var(--text);
  transform: rotate(90deg);
}

.experience-panel-city {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.experience-panel-date {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.experience-panel-desc {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 24px;
  white-space: pre-wrap;
}

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

.experience-photo-placeholder {
  aspect-ratio: 1;
  background: #e8f0fe;
  border-radius: var(--radius);
}

.experience-photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* 悬浮添加按钮 */
.footprint-fab {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 140, 160, 0.35);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footprint-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 24px rgba(200, 140, 160, 0.45);
}

.footprint-fab:active {
  transform: translateY(0) scale(1);
}

/* ==================== 提示消息 ==================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-md);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    position: fixed;
    left: -300px;
    width: 280px;
    transition: left 0.3s ease;
    box-shadow: none;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 19;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
  }

  .content-card {
    padding: 24px 20px;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fdf2f4, #fef8f5);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 15;
  }

  .mobile-header .mobile-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
  }

  .btn-menu {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    color: var(--text);
  }
}

@media (min-width: 901px) {
  .mobile-header {
    display: none;
  }
}

@media (max-width: 600px) {
  #password-form {
    padding: 24px 20px;
  }

  .gate-container h1 {
    font-size: 22px;
  }

  .gate-icon {
    font-size: 52px;
  }

  .section-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

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

  .modal-content,
  .viewer-content {
    margin: 10px;
    max-height: 95vh;
    border-radius: var(--radius);
  }

  .viewer-map {
    height: 200px;
  }

  .anniversary-card {
    padding: 16px;
  }

  .anniversary-icon {
    width: 52px;
    height: 52px;
    font-size: 28px;
  }

  .anniversary-days .days-count {
    font-size: 24px;
  }

  .footprint-zoom-control {
    bottom: 16px;
    left: 16px;
  }

  .footprint-detail-card {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .footprint-fab {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .anniversary-fab {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .anniversary-page {
    padding: 16px;
  }

  .experience-panel {
    width: calc(100% - 32px);
    padding: 24px 20px;
  }

  .experience-panel-photos {
    grid-template-columns: repeat(2, 1fr);
  }
}
