/* ===== 瀑布流容器 ===== */
.waterfall-container {
  column-count: 5;
  column-gap: 12px;
  padding: 16px 24px 24px;
}

@media (max-width: 1400px) {
  .waterfall-container { column-count: 4; }
}
@media (max-width: 1100px) {
  .waterfall-container { column-count: 3; }
}
@media (max-width: 768px) {
  .waterfall-container { column-count: 2; column-gap: 8px; padding: 12px; }
}

/* ===== 笔记卡片 ===== */
.note-card {
  break-inside: avoid;
  margin-bottom: 12px;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: relative;
}
.note-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.note-card:hover .card-cover-overlay {
  opacity: 1;
}

/* 封面图 */
.card-cover {
  width: 100%;
  position: relative;
  background: var(--gray-1);
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.note-card:hover .card-cover img {
  transform: scale(1.04);
}

.card-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}

/* 多图标识 */
.card-multi-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.5);
  color: var(--white);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

/* 卡片内容 */
.card-body {
  padding: 10px 12px 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.card-author img {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.card-author-name {
  font-size: 12px;
  color: var(--gray-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-like {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-4);
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 14px;
  transition: all var(--transition);
}
.card-like:hover { background: var(--red-bg); color: var(--red); }
.card-like.liked { color: var(--red); }
.card-like.liked .like-heart { animation: heartPop 0.3s ease; }
.like-heart { font-size: 14px; }

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ===== 内容详情弹窗 ===== */
.detail-panel {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  overflow: hidden;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

@keyframes slideUp {
  from { opacity: 0; transform: scale(0.96) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.detail-left {
  width: 50%;
  flex-shrink: 0;
  background: var(--black);
  position: relative;
}

.detail-image-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#detailImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 90vh;
}

.detail-image-nav {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.img-nav-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  color: var(--black);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: all var(--transition);
}
.img-nav-btn:hover { background: var(--white); }
.img-nav-btn.hidden { visibility: hidden; }

.img-dots {
  display: flex;
  gap: 5px;
}
.img-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: all var(--transition);
}
.img-dot.active {
  background: var(--white);
  width: 18px;
  border-radius: 3px;
}

.detail-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  gap: 16px;
}

/* 作者信息 */
.detail-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.author-avatar-lg {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--gray-2);
  flex-shrink: 0;
}
.author-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.author-name-lg {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.author-name-lg:hover { color: var(--red); }
.detail-date { font-size: 12px; color: var(--gray-4); }

/* 正文 */
.detail-content { flex-shrink: 0; }
.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.5;
  margin-bottom: 8px;
}
.detail-desc {
  font-size: 14px;
  color: var(--gray-5);
  line-height: 1.7;
  white-space: pre-line;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.detail-tag {
  font-size: 13px;
  color: var(--red);
  background: var(--red-bg);
  padding: 4px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.detail-tag:hover { background: #ffd6db; }

/* 评论区 */
.detail-comments {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-comments h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  flex-shrink: 0;
}
.comment-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.comment-item {
  display: flex;
  gap: 10px;
}
.comment-item img {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.comment-body { flex: 1; }
.comment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-6);
  margin-bottom: 3px;
}
.comment-text {
  font-size: 13px;
  color: var(--black);
  line-height: 1.5;
}
.comment-time {
  font-size: 11px;
  color: var(--gray-4);
  margin-top: 4px;
}

.comment-input-area {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--gray-1);
  flex-shrink: 0;
}
.comment-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.comment-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--gray-1);
  border-radius: 20px;
  padding: 0 12px;
  gap: 8px;
  height: 38px;
  border: 1.5px solid transparent;
  transition: all var(--transition);
}
.comment-input-wrap:focus-within {
  background: var(--white);
  border-color: var(--red);
}
.comment-input-wrap input {
  flex: 1;
  background: transparent;
  font-size: 13px;
  color: var(--black);
}
.comment-input-wrap input::placeholder { color: var(--gray-4); }
.send-btn {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.send-btn:hover { opacity: 0.7; }

/* 底部操作 */
.detail-actions {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--gray-1);
  padding-top: 16px;
  flex-shrink: 0;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--gray-1);
  color: var(--gray-5);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.action-btn:hover { background: var(--red-bg); color: var(--red); }
.action-btn.active { background: var(--red-bg); color: var(--red); }
.action-icon { font-size: 18px; }

/* ===== 用户主页弹窗 ===== */
.profile-panel {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.profile-header {
  position: relative;
  text-align: center;
  padding: 0 24px 24px;
}

.profile-bg {
  height: 140px;
  background: linear-gradient(135deg, #ff6b81 0%, #ff2442 50%, #ff8e53 100%);
  margin: 0 -0px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid var(--white);
  object-fit: cover;
  margin-top: -40px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.profile-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  margin: 12px 0 6px;
}

.profile-header p {
  font-size: 14px;
  color: var(--gray-4);
  margin-bottom: 16px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 12px 0 16px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
}
.stat-label {
  font-size: 12px;
  color: var(--gray-4);
}

.follow-btn-lg {
  background: var(--red);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 36px;
  border-radius: 24px;
  transition: all var(--transition);
}
.follow-btn-lg:hover { background: #e01e3a; }
.follow-btn-lg.following {
  background: var(--white);
  color: var(--gray-5);
  border: 1.5px solid var(--gray-2);
}

/* 主页标签 */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-2);
  padding: 0 24px;
}
.profile-tab {
  flex: 1;
  text-align: center;
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-4);
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.profile-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 700;
}
.profile-tab:hover { color: var(--red); }

.profile-content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
}
.profile-grid-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.profile-grid-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.profile-grid-item:hover img { transform: scale(1.06); }

/* ===== 发布弹窗 ===== */
.publish-panel {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.publish-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  text-align: center;
}

.publish-upload-area {
  border: 2px dashed var(--gray-2);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-1);
}
.publish-upload-area:hover {
  border-color: var(--red);
  background: var(--red-bg);
}
.upload-icon { font-size: 40px; margin-bottom: 8px; display: block; }
.publish-upload-area p { font-size: 14px; color: var(--gray-4); line-height: 1.6; }
.publish-upload-area .upload-tip { font-size: 12px; color: var(--gray-3); }

.publish-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.preview-item {
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.preview-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.publish-input, .publish-textarea {
  width: 100%;
  border: 1.5px solid var(--gray-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--black);
  transition: border-color var(--transition);
  resize: none;
  background: var(--white);
}
.publish-input:focus, .publish-textarea:focus {
  border-color: var(--red);
  outline: none;
}
.publish-input::placeholder, .publish-textarea::placeholder { color: var(--gray-3); }

.publish-tags-select { display: flex; align-items: flex-start; gap: 12px; }
.tags-label { font-size: 14px; color: var(--gray-5); font-weight: 500; white-space: nowrap; padding-top: 7px; }
.tags-options { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-option {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--gray-5);
  background: var(--gray-1);
  border: 1.5px solid transparent;
  transition: all var(--transition);
}
.tag-option:hover { border-color: var(--red); color: var(--red); }
.tag-option.selected { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.publish-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-1);
}

/* ===== 搜索结果页 ===== */
.search-results-page { padding: 20px 24px 0; }
.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.search-header h2 { font-size: 18px; font-weight: 700; color: var(--black); }
.search-filter { display: flex; gap: 8px; }
.filter-btn {
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--gray-5);
  background: var(--gray-1);
  border: 1.5px solid transparent;
  transition: all var(--transition);
}
.filter-btn.active { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.filter-btn:hover { color: var(--red); }
