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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
  min-height: 100vh;
  color: #444;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(255,182,193,0.2);
}

.logo { font-size: 1.3rem; font-weight: bold; color: #ff6b9d; }

.nav-links a {
  margin-left: 25px;
  text-decoration: none;
  color: #666;
  font-weight: 500;
  transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: #ff6b9d; }

.container { max-width: 900px; margin: 0 auto; padding: 30px 15px; }

.page-header { text-align: center; margin-bottom: 30px; }
.page-header h1 { color: #ff6b9d; font-size: 1.8rem; margin-bottom: 8px; }
.page-header p { color: #888; font-size: 0.95rem; }

/* ===== 浮动添加按钮 ===== */
.fab-add {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,107,157,0.4);
  z-index: 99;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab-add:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 30px rgba(255,107,157,0.5);
}

/* ===== INS 风格瀑布流 ===== */
.ins-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.ins-card {
  margin-bottom: 0;
  width: 100%;
}

.ins-card {
  width: 100%;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: all 0.3s;
  animation: fadeIn 0.5s ease;
}
.ins-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 图片区域 */
.ins-image-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 正方形 */
  overflow: hidden;
  background: #f5f5f5;
}
.ins-image-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.ins-card:hover .ins-image-wrap img {
  transform: scale(1.05);
}

/* 多张图片指示器 */
.ins-image-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.ins-image-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.ins-image-dots span.active {
  background: white;
}

/* 内容区域 */
.ins-body {
  padding: 14px 16px;
}
.ins-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ins-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #ff8fa3;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}
.ins-author {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}
.ins-author a {
  color: #333;
  text-decoration: none;
}
.ins-time {
  color: #bbb;
  font-size: 0.75rem;
}

.ins-title {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}
.ins-location {
  color: #ff8fa3;
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.ins-desc {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 操作栏 */
.ins-actions {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}
.ins-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  padding: 4px;
}
.ins-action-btn:hover { color: #ff6b9d; }
.ins-action-btn.liked { color: #ff6b9d; }
.ins-action-btn .icon { font-size: 1.2rem; }

/* 评论区 */
.ins-comments {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ffe4e1;
}
.ins-comment-list {
  background: #fafafa;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.ins-comment-line {
  padding: 3px 0;
}
.ins-comment-line a {
  color: #555;
  text-decoration: none;
  font-weight: 600;
}
.ins-comment-reply {
  color: #ff8fa3;
  text-decoration: none;
}
.ins-comment-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ins-comment-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 16px;
  outline: none;
  font-size: 0.85rem;
}
.ins-comment-form button {
  padding: 8px 14px;
  background: #ff8fa3;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ===== 添加回忆模态框 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #ffe4e1;
}
.modal-header h2 { color: #ff6b9d; font-size: 1.2rem; }
.modal-header .modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #ccc;
  cursor: pointer;
  line-height: 1;
}
.modal-header .modal-close:hover { color: #ff6b9d; }
.modal-content form { padding: 20px 25px 25px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr;
  align-items: start; gap: 15px; }
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ffd6e0;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #fff8fa;
  transition: all 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #ff6b9d;
  background: white;
}
.hint { font-weight: normal; color: #aaa; font-size: 0.8rem; margin-left: 5px; }

.image-upload-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}
.upload-btn {
  width: 90px; height: 90px;
  border: 2px dashed #ffb6c1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fff8fa;
  color: #ff6b9d;
}
.upload-btn:hover { border-color: #ff6b9d; background: #fff0f5; }
.upload-btn .plus { font-size: 1.5rem; line-height: 1; }
.upload-btn .text { font-size: 0.75rem; margin-top: 4px; }

.preview-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.preview-item {
  width: 90px; height: 90px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.preview-item .del-btn {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  background: rgba(0,0,0,0.5);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255,107,157,0.3);
}

/* 图片放大模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal.active { display: flex; }
.modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  object-fit: contain;
}
.modal .modal-close {
  position: absolute;
  top: 20px; right: 30px;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  grid-column: 1 / -1;
}
.empty-state .emoji { font-size: 3rem; margin-bottom: 15px; }

@media (max-width: 640px) {
  .ins-grid { grid-template-columns: 1fr; }
  .fab-add { bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 1.8rem; }
  .form-row { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .ins-grid { grid-template-columns: repeat(2, 1fr); }
}


/* 无图片卡片更紧凑 */
.ins-card.no-image .ins-body {
  padding-top: 20px;
}
.ins-card.no-image {
  min-height: auto;
}

/* 图片轮播模态框 */
.carousel-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.carousel-modal.active { display: flex; }

.carousel-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.3s;
}

.carousel-counter {
  color: white;
  font-size: 0.9rem;
  margin-bottom: 15px;
  opacity: 0.8;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1001;
}
.carousel-btn:hover { background: rgba(255,255,255,0.4); }
.carousel-btn.prev { left: 15px; }
.carousel-btn.next { right: 15px; }

.carousel-close {
  position: absolute;
  top: 20px;
  right: 25px;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
}

/* 图片指示点（卡片上） */
.ins-image-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background: #f5f5f5;
}
.ins-image-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.ins-card:hover .ins-image-wrap img {
  transform: scale(1.05);
}

/* 多张图片滑动提示 */
.ins-image-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.ins-image-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.3s;
}
.ins-image-dots span.active {
  background: white;
}

/* 触摸滑动提示 */
.swipe-hint {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  background: rgba(0,0,0,0.3);
  padding: 4px 12px;
  border-radius: 12px;
  pointer-events: none;
  animation: fadeOut 2s forwards;
  animation-delay: 1s;
}
@keyframes fadeOut {
  to { opacity: 0; }
}

@media (max-width: 640px) {
  .carousel-btn { width: 36px; height: 36px; font-size: 1.2rem; }
  .carousel-btn.prev { left: 8px; }
  .carousel-btn.next { right: 8px; }
  .carousel-close { top: 10px; right: 15px; font-size: 2rem; }
}
