/**
 * 社区页面样式 - B站风格
 */

/* ========== Tab 切换 ========== */
.tab-btn {
  color: var(--text-secondary, #6b7280);
  border-color: transparent;
  cursor: pointer;
  background: transparent;
}

.tab-btn:hover {
  color: var(--accent-primary, #0ea5e9);
}

.tab-btn.active {
  color: var(--accent-primary, #0ea5e9);
  border-color: var(--accent-primary, #0ea5e9);
}

.tab-content.hidden { display: none; }

/* ========== 卡片网格布局（B站风格） ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
}
@media (min-width: 1280px) {
  .card-grid { grid-template-columns: repeat(6, 1fr); gap: 18px; }
}

/* ========== 信息流布局（微博/B站风格） ========== */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}

/* 信息流卡片 */
.feed-card {
  background: var(--card-bg, #ffffff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease;
}

.feed-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 卡片头部：头像 + 用户信息 */
.feed-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 0;
}

.feed-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--btn-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.feed-user-info {
  flex: 1;
  min-width: 0;
}

.feed-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-username {
  font-size: 15px;
  font-weight: 600;
  color: #fb7299;
}

.feed-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.feed-badge.pinned {
  background: #fce7f3;
  color: #db2777;
}

.feed-badge.announcement {
  background: #fef3c7;
  color: #d97706;
}

.feed-meta {
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
  margin-top: 2px;
}

.feed-meta-dot {
  margin: 0 4px;
}

/* 卡片内容区域 */
.feed-content {
  padding: 12px 16px 16px;
}

.feed-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color, #1f2937);
  margin-bottom: 8px;
  line-height: 1.4;
}

.feed-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-color, #374151);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 图片区域 */
.feed-images {
  display: grid;
  gap: 4px;
  padding: 0 16px 12px;
}

.feed-images.single {
  grid-template-columns: 1fr;
}

.feed-images.double {
  grid-template-columns: repeat(2, 1fr);
}

.feed-images.triple,
.feed-images.multiple {
  grid-template-columns: repeat(3, 1fr);
}

.feed-image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.feed-image:hover {
  opacity: 0.9;
}

.feed-images.single .feed-image {
  aspect-ratio: 16/9;
  max-height: 300px;
}

/* 底部操作栏 */
.feed-actions {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color, #f3f4f6);
  gap: 8px;
}

.feed-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  background: transparent;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  justify-content: center;
}

.feed-action-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
  color: var(--accent-primary, #0ea5e9);
}

.feed-action-btn svg {
  width: 18px;
  height: 18px;
}

/* ========== 旧版动态卡片（保留兼容） ========== */
.post-card {
  background: var(--card-bg, #ffffff);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* 卡片封面区域 - 文字摘要 */
.post-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 动态卡片背景色 */
.post-card-cover.bg-post { background: linear-gradient(145deg, #e0f2fe 0%, #bae6fd 100%); }
.post-card-cover.bg-announcement { background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%); }
.post-card-cover.bg-pinned { background: linear-gradient(145deg, #fce7f3 0%, #fbcfe8 100%); }

/* 卡片标签（左上角） */
.post-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  width: fit-content;
  margin-bottom: 10px;
}

.post-card-badge.pinned { background: linear-gradient(135deg, #ec4899, #f472b6); }
.post-card-badge.announcement { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.post-card-badge.normal { background: var(--btn-primary-bg); }

/* 文字摘要区域 */
.post-card-excerpt {
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* 卡片信息区域 */
.post-card-info {
  padding: 12px 14px;
  background: var(--card-bg, #ffffff);
  border-top: 1px solid rgba(0,0,0,0.04);
}

.post-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color, #1e293b);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.post-card-meta {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========== 求片卡片（文字摘要风格） ========== */
.request-card {
  background: var(--card-bg, #ffffff);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}

.request-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* 求片卡片封面 - 胶囊风格 */
.request-card-cover {
  position: relative;
  width: 100%;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 80px;
}

/* 求片状态背景色 */
.request-card-cover.bg-pending { background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%); }
.request-card-cover.bg-added { background: linear-gradient(145deg, #d1fae5 0%, #a7f3d0 100%); }
.request-card-cover.bg-rejected { background: linear-gradient(145deg, #fee2e2 0%, #fecaca 100%); }

/* 求片状态标签 */
.request-card-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 10px;
}

.request-card-status.pending { background: rgba(146, 64, 14, 0.15); color: #92400e; }
.request-card-status.added { background: rgba(6, 95, 70, 0.15); color: #065f46; }
.request-card-status.rejected { background: rgba(153, 27, 27, 0.15); color: #991b1b; }

/* 求片名称（大字显示） */
.request-card-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #1e293b;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  margin: 4px 0;
}

/* 管理员备注 */
.request-card-note {
  font-size: 12px;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.request-card-info {
  padding: 8px 14px;
  background: var(--card-bg, #ffffff);
  border-top: 1px solid rgba(0,0,0,0.04);
}

.request-card-meta {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========== 状态筛选按钮 ========== */
.status-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-secondary, #6b7280);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.status-filter-btn:hover {
  background: #e0f2fe;
  color: #0284c7;
}

.status-filter-btn.active {
  background: var(--btn-primary-bg);
  color: white;
}

/* ========== 分页 ========== */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 16px 0;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-card, white);
  border: 1px solid var(--border-primary, #e5e7eb);
  color: var(--text-primary, #374151);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: var(--accent-primary, #0ea5e9);
  color: white;
  border-color: var(--accent-primary, #0ea5e9);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--accent-primary, #0ea5e9);
  color: white;
  border-color: var(--accent-primary, #0ea5e9);
}

/* ========== 求片弹窗（独立样式，不与 styles.css 冲突） ========== */
.request-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.request-modal-overlay.hidden { display: none; }

.request-modal-content {
  background: var(--card-bg, white);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: requestModalIn 0.2s ease;
}

@keyframes requestModalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.request-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.request-modal-body {
  padding: 20px;
}

.request-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

/* 验证码区域：防止竖排 */
#captchaQuestion {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 补充说明 textarea 高度固定 */
#requestRemark {
  min-height: 80px;
  max-height: 120px;
}

/* ========== 成功提示弹窗（保留原 modal-* 给其他用途） ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-overlay.hidden { display: none; }

.modal-content {
  background: var(--card-bg, white);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

/* ========== 动画 ========== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ========== 深色模式适配 ========== */

/* 页面背景 */
[data-theme="dark"] body {
  background: linear-gradient(180deg, #18191c 0%, #1f2028 50%, #18191c 100%) !important;
}

/* 导航栏 */
[data-theme="dark"] header {
  background: var(--header-bg, rgba(24, 25, 28, 0.95)) !important;
  border-color: var(--border-color, #2d2e35) !important;
}

/* Tab 切换 - 深色模式 */
[data-theme="dark"] .tab-btn {
  color: var(--text-muted, #6d757a);
  border-color: transparent;
}

[data-theme="dark"] .tab-btn:hover {
  color: var(--accent-primary, #fb7299);
}

[data-theme="dark"] .tab-btn.active {
  color: var(--accent-primary, #fb7299);
  border-color: var(--accent-primary, #fb7299);
}

/* 信息流卡片 - 深色模式 */
[data-theme="dark"] .feed-card {
  background: var(--bg-secondary, #21222c);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .feed-card:hover {
  box-shadow: 0 4px 16px rgba(251, 114, 153, 0.15);
}

[data-theme="dark"] .feed-avatar {
  background: linear-gradient(135deg, #fb7299, #f06292);
}

[data-theme="dark"] .feed-username {
  color: var(--accent-primary, #fb7299);
}

[data-theme="dark"] .feed-time {
  color: var(--text-muted, #6d757a);
}

[data-theme="dark"] .feed-title {
  color: var(--text-primary, #f5f5f5);
}

[data-theme="dark"] .feed-text {
  color: var(--text-secondary, #a2a7ae);
}

[data-theme="dark"] .feed-type {
  background: rgba(251, 114, 153, 0.15);
  color: var(--accent-primary, #fb7299);
}

[data-theme="dark"] .feed-pinned {
  color: var(--accent-primary, #fb7299);
}

[data-theme="dark"] .feed-actions {
  border-color: var(--border-color, #2d2e35);
}

[data-theme="dark"] .feed-action-btn {
  color: var(--text-muted, #6d757a);
}

[data-theme="dark"] .feed-action-btn:hover {
  background: var(--bg-tertiary, #2d2e35);
  color: var(--accent-primary, #fb7299);
}

/* 求片卡片 - 深色模式 */
[data-theme="dark"] .post-card {
  background: var(--bg-secondary, #21222c);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .post-card:hover {
  box-shadow: 0 8px 24px rgba(251, 114, 153, 0.2);
}

[data-theme="dark"] .post-type {
  background: rgba(251, 114, 153, 0.15);
  color: var(--accent-primary, #fb7299);
}

[data-theme="dark"] .post-title {
  color: var(--text-primary, #f5f5f5);
}

[data-theme="dark"] .post-excerpt {
  color: var(--text-muted, #6d757a);
}

[data-theme="dark"] .post-date {
  color: var(--text-muted, #6d757a);
}

/* 分页 - 深色模式 */
[data-theme="dark"] .page-btn {
  background: var(--bg-secondary, #21222c);
  color: var(--text-secondary, #a2a7ae);
  border-color: var(--border-color, #2d2e35);
}

[data-theme="dark"] .page-btn:hover:not(:disabled) {
  background: var(--accent-primary, #fb7299);
  color: white;
  border-color: var(--accent-primary, #fb7299);
}

[data-theme="dark"] .page-btn.active {
  background: var(--accent-primary, #fb7299);
  color: white;
  border-color: var(--accent-primary, #fb7299);
}

/* 求片弹窗 - 深色模式 */
[data-theme="dark"] .request-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .request-modal-content {
  background: var(--bg-secondary, #21222c);
  border-color: var(--border-color, #2d2e35);
}

[data-theme="dark"] .request-modal-content h3 {
  color: var(--text-primary, #f5f5f5);
}

[data-theme="dark"] .request-modal-content label {
  color: var(--text-secondary, #a2a7ae);
}

[data-theme="dark"] .request-modal-content input,
[data-theme="dark"] .request-modal-content textarea {
  background: var(--bg-tertiary, #2d2e35);
  border-color: var(--border-color, #2d2e35);
  color: var(--text-primary, #f5f5f5);
}

[data-theme="dark"] .request-modal-content input:focus,
[data-theme="dark"] .request-modal-content textarea:focus {
  border-color: var(--accent-primary, #fb7299);
  box-shadow: 0 0 0 3px rgba(251, 114, 153, 0.2);
}

/* 成功提示弹窗 - 深色模式 */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-content {
  background: var(--bg-secondary, #21222c);
  border-color: var(--border-color, #2d2e35);
}

[data-theme="dark"] .modal-content h3 {
  color: var(--text-primary, #f5f5f5);
}

[data-theme="dark"] .modal-content label {
  color: var(--text-secondary, #a2a7ae);
}

[data-theme="dark"] .modal-content input,
[data-theme="dark"] .modal-content textarea {
  background: var(--bg-tertiary, #2d2e35);
  border-color: var(--border-color, #2d2e35);
  color: var(--text-primary, #f5f5f5);
}

[data-theme="dark"] .modal-content input:focus,
[data-theme="dark"] .modal-content textarea:focus {
  border-color: var(--accent-primary, #fb7299);
  box-shadow: 0 0 0 3px rgba(251, 114, 153, 0.2);
}

/* 空状态提示 - 深色模式 */
[data-theme="dark"] .empty-state {
  color: var(--text-muted, #6d757a);
}

/* 页面标题 - 深色模式 */
[data-theme="dark"] h2.bg-gradient-to-r {
  background: linear-gradient(to right, #fb7299, #ff9eb3) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
