/* style.css 完整版 */

:root {
  /* 颜色变量 */
  --primary-color: #ff4d6d;
  --secondary-color: #ff8fa3;
  --light-color: #fff0f3;
  --dark-color: #590d22;
  --text-color: #333;
  --light-text: #777;
  --border-color: #e0e0e0;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  background-color: var(--light-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部样式 */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 20px 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-family: 'Ma Shan Zheng', cursive;
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.heart {
  color: var(--light-color);
  animation: heartbeat 1.5s infinite;
}

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

/* 导航栏 */
nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 10px;
  flex-wrap: wrap;
}

nav li {
  margin: 0;
}

nav a, #logout-button {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  transition: var(--transition);
  display: inline-block;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

#logout-button {
  background-color: white;
  color: var(--primary-color);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

#logout-button:hover {
  background-color: var(--dark-color);
  color: white;
}

/* 用户名显示 */
.username-display {
  position: absolute;
  top: 10px;
  right: 20px;
  color: white;
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* 内容区域 */
section {
  padding: 40px 0;
}

section h2 {
  text-align: center;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 30px;
  position: relative;
  font-family: 'Ma Shan Zheng', cursive;
}

section h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  margin: 10px auto;
  border-radius: 2px;
}

/* 表单容器 */
.form-container {
  background-color: white;
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 0 auto 30px;
}

/* 表单元素 */
textarea, input[type="text"], input[type="number"], input[type="file"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  margin-bottom: 15px;
}

textarea:focus, 
input[type="text"]:focus, 
input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 77, 109, 0.2);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* 按钮样式 */
button, .upload-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
}

button:hover, .upload-button:hover {
  background-color: var(--dark-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.upload-button {
  display: block;
  text-align: center;
}

/* 分页控件 */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.pagination-controls input[type="number"] {
  width: 60px;
  text-align: center;
  margin: 0;
}

/* 内容列表 */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.memory-item, .message-item {
  background-color: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.memory-item:hover, .message-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.memory-item.user1, .message-item.user1 {
  border-left: 4px solid var(--primary-color);
}

.memory-item.user2, .message-item.user2 {
  border-left: 4px solid var(--secondary-color);
}

.content {
  margin-bottom: 10px;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--light-text);
}

.delete-btn {
  background: #ff4d4d;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}

.delete-btn:hover {
  background: #cc0000;
}

/* 照片墙 */
.photo-gallery, .video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.photo-item, .video-item {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.photo-item:hover, .video-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

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

.photo-info, .video-info {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-info small, .video-info small {
  color: var(--light-text);
  font-size: 0.8rem;
}

/* 视频样式 */
.video-item video {
  width: 100%;
  height: 200px;
  background-color: #000;
  display: block;
}

/* 情侣待办事项样式 */
.todo-item {
  background-color: white;
  padding: 15px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 15px;
  transition: var(--transition);
}

.todo-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.todo-item.user1 {
  border-left: 4px solid var(--primary-color);
}

.todo-item.user2 {
  border-left: 4px solid var(--secondary-color);
}

.todo-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.todo-content.completed span {
  text-decoration: line-through;
  color: var(--light-text);
  opacity: 0.8;
}

.todo-content input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.todo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}

.todo-meta small {
  color: var(--light-text);
  font-size: 0.8rem;
}

.todo-meta button {
  padding: 4px 10px;
  font-size: 0.8rem;
  background-color: #ff4d4d;
  border-radius: 4px;
  transition: var(--transition);
}

.todo-meta button:hover {
  background-color: #cc0000;
  transform: translateY(-1px);
}

/* 进度条 */
.progress-container {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 15px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  width: 0%;
  transition: width 0.3s ease;
  color: white;
  font-size: 10px;
  text-align: center;
  line-height: 8px;
}

/* 纪念日 */
.anniversary-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 30px;
}

.anniversary-item {
  text-align: center;
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  min-width: 200px;
}

.days-count {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 10px 0;
}

/* 食物推荐 */
.food-container {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 500px;
  margin: 0 auto;
}

.food-result {
  margin-top: 20px;
  padding: 15px;
  background: var(--light-color);
  border-radius: var(--border-radius);
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: bold;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 加载指示器 */
#loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 页脚 */
footer {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}

footer p {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  .username-display {
    position: static;
    text-align: center;
    margin-bottom: 10px;
  }
  
  nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    justify-content: flex-start;
    margin: 0 -20px;
    padding: 0 20px;
  }
  
  nav ul::-webkit-scrollbar {
    display: none;
  }
  
  nav li {
    flex: 0 0 auto;
  }
  
  nav a, #logout-button {
    padding: 6px 12px;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.15);
    white-space: nowrap;
  }
  
  .photo-gallery, .video-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  
  .anniversary-container {
    flex-direction: column;
    gap: 20px;
  }
  
  section {
    padding: 30px 0;
  }
  
  .form-container {
    padding: 20px;
  }
  
  button, .upload-button {
    padding: 10px 20px;
  }

  /* 情侣待办响应式 */
  .todo-item {
    padding: 12px;
  }
  
  .todo-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .todo-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

@media (max-width: 480px) {
  .photo-gallery, .video-gallery {
    grid-template-columns: 1fr;
  }
  
  .pagination-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .pagination-controls > * {
    width: 100%;
  }
  
  input[type="number"] {
    text-align: center;
  }
}
/* 照片预览模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  animation: zoom 0.3s;
}

@keyframes zoom {
  from {transform: scale(0.1)}
  to {transform: scale(1)}
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover,
.close:focus {
  color: var(--secondary-color);
  text-decoration: none;
  cursor: pointer;
}

#caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

/* 响应式调整 */
@media only screen and (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    max-height: 70vh;
  }
  
  .close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
  
  #caption {
    height: auto;
  }
}