:root {
  --primary: #2563eb;
  --text: #1f2937;
  --subtext: #6b7280;
  --like: #e11d48;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #e5e5f7;
  background-image: radial-gradient(#cbd5e1 2px, transparent 2px);
  background-size: 30px 30px;
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* 顶部导航栏 */
header {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
  padding: 15px 40px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 1000;
  display: flex; gap: 30px;
}
header a { text-decoration: none; color: var(--subtext); font-weight: bold; transition: 0.3s; }
header a.active, header a:hover { color: var(--primary); }

/* 悬浮发布按钮 */
.fab {
  position: fixed; bottom: 40px; right: 40px;
  width: 60px; height: 60px; background: var(--primary); color: white;
  border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 10px 25px rgba(37,99,235,0.4);
  cursor: pointer; z-index: 1000; transition: 0.3s;
}
.fab:hover { transform: translateY(-5px) scale(1.1); }

/* 情绪板和卡片 */
#moodboard { position: relative; width: 100%; height: 100%; }

.polaroid-post {
  position: absolute; width: 280px; background: #fff;
  padding: 15px 15px 40px 15px; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border-radius: 4px; cursor: default; user-select: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.polaroid-post:hover {
  transform: scale(1.06) translateY(-6px) rotate(2deg) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.post-img {
  width: 100%; height: 200px; object-fit: cover;
  background: #eee; border-radius: 2px; pointer-events: none;
}
.post-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.author-info { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold; text-transform: uppercase;
}
.caption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: #333; }
.actions { margin-top: 15px; display: flex; gap: 15px; color: var(--subtext); }
.actions i { cursor: pointer; transition: 0.2s; font-size: 18px; padding: 5px; }
.actions i:hover { transform: scale(1.2); }
.fa-heart.liked { color: var(--like) !important; }

/* 详情弹窗 */
.detail-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15,23,42,0.6); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); z-index: 12000; 
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.detail-overlay.active { opacity: 1; pointer-events: auto; }
.detail-card {
  background: #fff; width: 900px; max-width: 90vw;
  height: 600px; max-height: 85vh; border-radius: 24px;
  display: flex; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  transform: scale(0.9) translateY(20px); transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.detail-overlay.active .detail-card { transform: scale(1) translateY(0); }

/* 详情图片与操作区 */
.detail-img-wrapper { flex: 1.2; position: relative; overflow: hidden; }
.detail-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.detail-actions {
  position: absolute; top: 20px; left: 20px;
  display: flex; gap: 10px; z-index: 10;
}
.btn-action {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(5px);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; transition: 0.3s;
}
.btn-action:hover { background: rgba(255,255,255,0.4); transform: scale(1.1); }
.btn-edit { background: rgba(37,99,235,0.4); } 

/* 详情信息区 */
.detail-info { flex: 1; padding: 40px; display: flex; flex-direction: column; background: #fbfbfc; overflow-y: auto; }
.detail-author { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.detail-author .avatar { width: 45px; height: 45px; font-size: 16px; }
.author-name { font-size: 18px; font-weight: bold; }
.author-location { font-size: 13px; color: var(--primary); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.detail-caption { font-size: 16px; line-height: 1.8; color: #334155; margin-bottom: 30px; }

/* 评论区 */
.comments-section { flex: 1; overflow-y: auto; border-top: 1px solid #e2e8f0; padding-top: 20px; }
.comments-section::-webkit-scrollbar { width: 6px; }
.comments-section::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.comment-item { margin-bottom: 15px; font-size: 14px; }
.comment-item span.comment-user { font-weight: bold; margin-right: 8px; }
.comment-item span.comment-text { color: #475569; }
.add-comment { margin-top: 20px; display: flex; gap: 10px; }
.add-comment input {
  flex: 1; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: 12px 20px; outline: none; transition: 0.2s;
}
.add-comment input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.btn-send {
  background: var(--primary); color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: 0.2s;
}
.btn-send:hover { background: #1d4ed8; transform: scale(1.05); }

/* 发布/编辑弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  z-index: 15000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.publish-card {
  background: #fff; width: 400px; padding: 30px; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.show .publish-card { transform: translateY(0); }
.publish-card h3 { margin-bottom: 20px; font-size: 20px; }
.publish-card input, .publish-card textarea {
  width: 100%; padding: 12px; margin-bottom: 15px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  font-family: inherit; outline: none;
}
.publish-card input:focus, .publish-card textarea:focus { border-color: var(--primary); }
.publish-card textarea { resize: none; height: 100px; }
.btn-group { display: flex; justify-content: flex-end; gap: 10px; }
.btn-group button { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; }
.btn-cancel { background: #f1f5f9; color: #475569; }
.btn-submit { background: var(--primary); color: #fff; }

/* 悬浮按钮组布局 */
.fab-group {
  position: fixed; bottom: 40px; right: 40px;
  display: flex; flex-direction: column; gap: 15px; z-index: 1000;
}

/* 覆盖原来单独的 fab 定位，让它归由 flex 接管 */
.fab-group .fab { position: static; }

/* 整理卡片时的平滑过渡动画 */
.arranging {
  transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1), 
              top 0.5s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
}