/* treehole.css - 匿名树洞吐槽屋 专属样式 */
/* 风格：1:1贴合表白墙/糗事墙圆角简约暖色设计 */

/* ---- 标题 ---- */
.th-section-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary);
  margin: 2rem 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.th-title-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.8;
}
.th-desc {
  color: #78909c;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ---- 登录提示 ---- */
.th-login-tip {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}
.th-login-tip a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* ---- 发帖表单 ---- */
.th-post-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.th-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.th-anon-badge {
  background: #fff8e1;
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--accent);
}

.th-daily-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.th-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  resize: vertical;
  min-height: 100px;
  transition: var(--transition);
  color: var(--text);
  background: #FAF5F0;
  font-family: inherit;
}
.th-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(93, 64, 55, 0.15);
}

.th-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 1rem;
}

/* ---- 上传区域 ---- */
.th-upload-area {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.th-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: #f8f4ed;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}
.th-upload-label:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.th-upload-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.6;
}

.th-preview {
  position: relative;
  display: inline-block;
}
.th-preview img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.th-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 发布按钮 ---- */
.th-publish-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.th-publish-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}
.th-publish-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* ---- 瀑布流容器 ---- */
.th-waterfall {
  column-count: 1;
  column-gap: 1rem;
}
@media (min-width: 600px) {
  .th-waterfall { column-count: 2; }
}

/* ---- 帖子卡片 ---- */
.th-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  border: 1px solid var(--border);
  padding: 1.2rem;
  margin-bottom: 1rem;
  break-inside: avoid;
  transition: var(--transition);
  animation: thFadeIn 0.3s ease;
}
.th-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(93, 64, 55, 0.15);
}

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

.th-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.th-card-anon {
  font-weight: 500;
  color: var(--primary);
}

.th-card-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.8rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.th-card-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  border: 1px solid var(--border);
  object-fit: cover;
  max-height: 300px;
}

.th-card-actions {
  display: flex;
  gap: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.th-like-btn,
.th-comment-btn {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0;
  transition: var(--transition);
}
.th-like-btn:hover,
.th-comment-btn:hover {
  color: var(--primary);
}
.th-like-btn.liked {
  color: #e74c3c;
}
.th-like-btn img,
.th-comment-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ---- 加载更多 ---- */
.th-load-more {
  text-align: center;
  margin: 2rem 0;
}
.th-load-more button {
  background: var(--card-bg);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 0.7rem 2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}
.th-load-more button:hover {
  background: #f8f4ed;
}

.th-loading,
.th-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ---- 评论弹窗 ---- */
.th-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.th-modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.th-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--primary);
}

.th-modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.th-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
}

.th-comment-list {
  margin-bottom: 1rem;
}

.th-comment-item {
  padding: 0.8rem 0;
  border-bottom: 1px solid #f0ece6;
}
.th-comment-item:last-child {
  border-bottom: none;
}
.th-comment-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.th-comment-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

.th-comment-input-row {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.th-comment-input-row input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: #FAF5F0;
  color: var(--text);
}
.th-comment-input-row input:focus {
  border-color: var(--primary);
  outline: none;
}
.th-comment-input-row button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.th-comment-input-row button:hover {
  background: var(--primary-dark);
}
.th-send-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ---- 提示消息 ---- */
.th-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: thToastIn 0.3s ease;
}
.th-toast.error {
  background: #e74c3c;
}
@keyframes thToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---- 响应式 ---- */
@media (max-width: 600px) {
  .th-waterfall { column-count: 1; }
  .th-form-footer { flex-direction: column; gap: 0.8rem; }
  .th-publish-btn { width: 100%; text-align: center; }
}