/* ========================================
   我们的时光 — 情侣日常记录网站
   全局样式 v2
   ======================================== */

/* --- 基础变量 --- */
:root {
  --bg: #faf8f6;
  --card: #ffffff;
  --text: #3d3432;
  --text-mid: #6b5e58;
  --text-light: #9b8c85;
  --accent: #d4856b;
  --accent-deep: #c07157;
  --accent-soft: #fdf2ed;
  --accent-gradient: linear-gradient(135deg, #e8987a 0%, #d4856b 40%, #c97d6a 100%);
  --border: #f0e8e2;
  --timeline: #ecdcd2;
  --shadow-sm: 0 1px 2px rgba(60,35,25,0.04), 0 1px 3px rgba(60,35,25,0.03);
  --shadow: 0 2px 8px rgba(60,35,25,0.05), 0 1px 3px rgba(60,35,25,0.04);
  --shadow-lg: 0 8px 30px rgba(60,35,25,0.08), 0 2px 8px rgba(60,35,25,0.04);
  --radius: 14px;
  --radius-sm: 10px;
  --max-w: 700px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}

/* --- 导航栏 --- */
.navbar {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
}

.navbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.03em;
  text-decoration: none;
}

.navbar-brand .heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: var(--accent-gradient);
  border-radius: 50%;
  color: #fff;
  font-size: 0.8rem;
  animation: heartbeat 1.6s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
  60% { transform: scale(1); }
}

.navbar-link {
  font-size: 0.875rem;
  color: var(--text-light);
  text-decoration: none;
  padding: 7px 15px;
  border-radius: 20px;
  transition: all 0.25s;
  font-weight: 500;
}

.navbar-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* --- 主容器 --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 100px;
}

/* ==================== 密码门 ==================== */
.password-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 75vh;
  text-align: center;
}

.gate-illustration {
  margin-bottom: 28px;
  position: relative;
}

.gate-illustration .main-emoji {
  font-size: 4.5rem;
  display: block;
  animation: float 3s ease-in-out infinite;
}

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

.gate-illustration .sparkles {
  position: absolute;
  font-size: 1.2rem;
  animation: sparkle 2s ease-in-out infinite;
}

.gate-illustration .sparkles:nth-child(2) { top: -8px; right: -20px; animation-delay: 0.3s; }
.gate-illustration .sparkles:nth-child(3) { bottom: 10px; left: -22px; animation-delay: 0.7s; }

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

.password-gate h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.password-gate .gate-subtitle {
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 0.95rem;
  max-width: 300px;
  line-height: 1.6;
}

.password-input-wrap {
  display: flex;
  gap: 10px;
  background: var(--card);
  padding: 6px;
  border-radius: 50px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s;
}

.password-input-wrap:focus-within {
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(212,133,107,0.1);
}

.password-input-wrap input {
  width: 190px;
  padding: 13px 20px;
  border: none;
  border-radius: 40px;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: var(--text);
  letter-spacing: 0.08em;
}

.password-input-wrap input::placeholder {
  color: #cec3bc;
  letter-spacing: 0;
}

.password-error {
  color: #d44;
  font-size: 0.85rem;
  margin-top: 14px;
  display: none;
  align-items: center;
  gap: 5px;
}

.password-error.show { display: flex; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 26px;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(212,133,107,0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212,133,107,0.35);
}

.btn-primary:active { transform: scale(0.97); }

.btn-outline {
  background: var(--card);
  color: var(--accent);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-danger {
  background: transparent;
  color: #d44;
  border: 1.5px solid #fcc;
}

.btn-danger:hover {
  background: #fff5f5;
  border-color: #d44;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 0.8rem;
  border-radius: 30px;
}

.btn-lg {
  padding: 15px 36px;
  font-size: 1rem;
  border-radius: 50px;
}

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

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--timeline) 5%,
    var(--timeline) 95%,
    transparent 100%
  );
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 36px;
  animation: fadeInUp 0.45s ease-out both;
}

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

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

.timeline-dot {
  position: absolute;
  left: -26px;
  top: 18px;
  width: 12px; height: 12px;
  background: var(--accent-gradient);
  border: 3px solid var(--bg);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(212,133,107,0.12);
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 550;
  letter-spacing: 0.04em;
  padding-left: 2px;
}

/* ==================== 内容卡片 ==================== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-media {
  width: 100%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #f7f3f0;
}

.card-media img {
  width: 100%;
  display: block;
  max-height: 500px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-media:hover img {
  transform: scale(1.03);
}

.card-media video {
  width: 100%;
  display: block;
  max-height: 440px;
  background: #000;
}

.card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.02));
  pointer-events: none;
}

.card-body {
  padding: 22px 26px 26px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 650;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1.45;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.7;
}

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

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  font-size: 0.92rem;
  color: var(--text-light);
}

/* ==================== 灯箱 ==================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.25s ease;
}

.lightbox.open { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox img, .lightbox video {
  max-width: 93vw;
  max-height: 93vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: zoomIn 0.3s ease;
}

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

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  width: 44px; height: 44px;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.22);
  transform: scale(1.08);
}

/* ==================== 后台管理 ==================== */
.admin-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 100px;
}

.login-box {
  max-width: 380px;
  margin: 80px auto;
  text-align: center;
}

.login-box h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 28px;
}

/* --- 表单 --- */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-mid);
  letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
  min-height: 85px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,133,107,0.08);
}

.form-group input[type="file"] {
  padding: 10px 14px;
  font-size: 0.9rem;
}

.form-group input[type="file"]::file-selector-button {
  background: var(--accent-soft);
  border: none;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--accent);
  margin-right: 12px;
  font-family: inherit;
  font-weight: 550;
  transition: all 0.2s;
}

.form-group input[type="file"]::file-selector-button:hover {
  background: #fce4da;
}

.form-hint {
  font-size: 0.76rem;
  color: var(--text-light);
  margin-top: 5px;
}

/* --- 管理头部 --- */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.admin-top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-top-actions .admin-email {
  font-size: 0.84rem;
  color: var(--text-light);
}

/* --- 添加区块 --- */
.add-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  margin-bottom: 36px;
  border: 1px solid var(--border);
}

.add-section h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-row .form-group {
  flex: 1;
  min-width: 160px;
}

/* --- 管理列表 --- */
.admin-section-title {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 16px;
  color: var(--text-mid);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px 20px;
  transition: all 0.25s;
  border: 1px solid transparent;
}

.admin-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.admin-item-thumb {
  width: 74px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f5f2f0;
}

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

.admin-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-item-meta {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 3px;
}

/* --- 上传进度 --- */
.upload-progress {
  display: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 12px 0 4px;
  overflow: hidden;
}

.upload-progress.active { display: block; }

.upload-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

/* ==================== 密码弹窗 ==================== */
.pw-tab {
  flex: 1;
  padding: 11px 16px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.25s;
  font-family: inherit;
}

.pw-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pw-tab:hover { color: var(--accent); }

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #3d3432;
  color: #fff;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

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

.toast.success { background: #3a7d5f; }
.toast.error { background: #c44; }

/* ==================== 加载 ==================== */
.spinner {
  display: inline-block;
  width: 22px; height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-wrap {
  text-align: center;
  padding: 50px 0;
}

.load-more {
  text-align: center;
  margin-top: 28px;
}

/* ==================== 隐藏 ==================== */
.hidden { display: none !important; }

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
  .container { padding: 28px 16px 80px; }
  .admin-layout { padding: 28px 16px 80px; }

  .timeline { padding-left: 24px; }
  .timeline::before { left: 5px; }
  .timeline-dot {
    left: -21px; width: 10px; height: 10px; top: 16px;
  }

  .card-body { padding: 18px 20px 22px; }
  .card-title { font-size: 1rem; }

  .password-input-wrap input { width: 150px; }
  .password-gate h2 { font-size: 1.3rem; }

  .admin-item { flex-wrap: wrap; }
  .admin-item-thumb { width: 56px; height: 44px; }
  .add-section { padding: 20px; }
  .form-row { flex-direction: column; gap: 0; }

  .admin-top-actions { width: 100%; justify-content: flex-end; }

  .lightbox-close { top: 16px; right: 18px; }
}
