/* ============ 流星雨降临主题样式 ============ */

:root {
  --primary: #ff6b9d;
  --primary-dark: #e8508a;
  --secondary: #a78bfa;
  --accent: #fbbf24;
  --bg: #fdf2f8;
  --bg-gradient: linear-gradient(135deg, #fff1f5 0%, #f3e8ff 50%, #fef3c7 100%);
  --card-bg: rgba(255, 255, 255, 0.92);
  --text: #4a3f55;
  --text-light: #8b7d94;
  --border: #f5d5e3;
  --shadow: 0 4px 20px rgba(255, 107, 157, 0.15);
  --shadow-lg: 0 8px 32px rgba(255, 107, 157, 0.2);
  --radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 星空背景动画 */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 3s infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 通用容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* 卡片样式 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), #8b5cf6);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* 输入框 */
.input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: white;
  color: var(--text);
  transition: all 0.3s ease;
  outline: none;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

textarea.input {
  resize: vertical;
  min-height: 100px;
}

/* ============ 登录页面 ============ */

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-subtitle {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 30px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-hint {
  margin-top: 20px;
  padding: 12px;
  background: #fff5f9;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-light);
  border: 1px dashed var(--primary);
}

/* ============ 主页面 ============ */

.main-page {
  display: none;
}

/* 导航栏 */
.navbar {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 16px;
  z-index: 100;
}

.navbar-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
}

.navbar-user span {
  font-weight: 600;
  color: var(--primary);
}

/* Tab 导航 */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 6px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

/* 内容区 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 首页欢迎区 */
.welcome-card {
  text-align: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto;
}

/* 爱心装饰 */
.heart {
  display: inline-block;
  animation: beat 1.5s ease infinite;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15); }
  40% { transform: scale(1); }
  60% { transform: scale(1.15); }
}

/* 纪念日倒计时 */
.countdown-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.countdown-card {
  text-align: center;
  padding: 20px;
}

.countdown-label {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.countdown-days {
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.countdown-date {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 时间线 */
.timeline-section {
  position: relative;
  padding-left: 30px;
}

.timeline-section::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary), var(--accent));
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.timeline-date {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.timeline-content {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

.timeline-author {
  font-size: 12px;
  color: var(--secondary);
  margin-top: 8px;
}

/* 照片墙 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.photo-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  position: relative;
}

.photo-card:hover {
  transform: translateY(-4px) scale(1.02);
}

.photo-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.photo-caption {
  padding: 12px;
  font-size: 13px;
  color: var(--text);
}

.photo-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
}

.photo-card:hover .photo-delete {
  opacity: 1;
}

/* 留言板 */
.messages-section {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.message-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.message-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 70%;
  box-shadow: var(--shadow);
}

.message-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.message-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.message-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 表单区域 */
.form-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px dashed var(--border);
}

.form-section h3 {
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: transform 0.3s ease;
  opacity: 0;
}

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

.toast.success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.toast.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* 响应式 */
@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  .navbar {
    padding: 12px 16px;
  }

  .tabs {
    flex-wrap: nowrap;
  }

  .tab {
    font-size: 13px;
    padding: 10px 8px;
  }

  .login-card {
    padding: 30px 24px;
  }

  .countdown-days {
    font-size: 32px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
