/* 项目交流广场页样式 */
body {
  background: #eef2f7; min-height: 100vh;
  background-image: url('/static/bg_hero.svg');
  background-size: cover; background-position: center top; background-attachment: fixed;
}

.main {
  max-width: 960px; margin: 32px auto; padding: 20px;
  background: rgba(255,255,255,0.85); border-radius: 12px; backdrop-filter: blur(8px);
}
.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: #1f2937; margin-bottom: 6px; }
.page-sub { font-size: 14px; color: #6b7280; }
.page-header-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.category-filter { display: flex; flex: 0 0 auto; align-items: center; gap: 14px; }
.category-filter label { display: inline-flex; align-items: center; gap: 5px; color: #475569; font-size: 13px; cursor: pointer; }
.category-filter input { width: 16px; height: 16px; margin: 0; accent-color: #2d6a9f; cursor: pointer; }

/* 搜索/筛选栏 */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input {
  flex: 1; min-width: 180px; padding: 8px 12px;
  border: 1px solid #d1d5db; border-radius: 7px; font-size: 14px; outline: none;
}
.filter-bar input:focus { border-color: #2d6a9f; }
.filter-bar select {
  padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 14px; outline: none; background: #fff;
}

/* 项目卡片网格 */
.project-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.project-card {
  background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07); display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow 0.15s;
}
.project-thumb-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-thumb-placeholder {
  color: #9ca3af;
  font-size: 13px;
}
.project-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.project-name { font-size: 16px; font-weight: 600; color: #1f2937; }
.project-author { font-size: 13px; color: #6b7280; }
.review-badge {
  display: inline-flex; align-items: center; min-height: 22px; margin-top: 7px;
  padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 500;
}
.review-badge.approved { background: #e0f2fe; color: #0369a1; }
.review-badge.unapproved { background: #fff7ed; color: #c2410c; }
.category-badge {
  display: inline-flex; align-items: center; min-height: 22px; margin-top: 7px; margin-left: 4px;
  padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 500;
}
.category-badge.normal { background: #f1f5f9; color: #475569; }
.category-badge.demo { background: #ecfdf5; color: #047857; }
.project-meta { font-size: 12px; color: #9ca3af; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.btn-sm {
  padding: 5px 11px; border-radius: 6px; font-size: 12px; cursor: pointer;
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  text-decoration: none; transition: background 0.15s;
}
.btn-sm:hover { background: #f9fafb; }
.btn-sm.primary { background: #2d6a9f; color: #fff; border-color: #2d6a9f; }
.btn-sm.primary:hover { background: #1e3a5f; }
.btn-sm.teacher-page { color: #0f766e; border-color: #5eead4; background: #f0fdfa; }
.btn-sm.teacher-page:hover { color: #115e59; border-color: #2dd4bf; background: #ccfbf1; }
.btn-sm:disabled, .btn-sm:disabled:hover {
  cursor: not-allowed; opacity: .46; filter: grayscale(.25); box-shadow: none;
}
.prompt-view-btn { color: #245b47; border-color: #9ac8b6; background: #f3fbf7; }
.prompt-view-btn:hover { color: #174635; border-color: #65a98e; background: #e8f7ef; }

.project-stats { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.stat-pill, .like-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px;
  border: 1px solid #e5e7eb; background: #fff; color: #6b7280;
}
.view-stat { color: #526275; background: #f8fafc; }
.like-btn {
  cursor: pointer; transition: all 0.15s;
}
.like-btn:hover { border-color: #f87171; color: #ef4444; background: #fef2f2; }
.like-btn.liked { border-color: #fca5a5; color: #ef4444; background: #fef2f2; }

.empty-tip { text-align: center; padding: 80px 20px; color: #9ca3af; font-size: 15px; }

/* 分页 */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  margin-top: 28px; flex-wrap: wrap;
}
.page-btn {
  padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer;
  border: 1px solid #d1d5db; background: #fff; color: #374151; transition: background 0.15s;
}
.page-btn:hover { background: #f3f4f6; }
.page-btn.active { background: #2d6a9f; color: #fff; border-color: #2d6a9f; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 13px; color: #6b7280; margin: 0 8px; }

body.prompt-modal-open { overflow: hidden; }
.prompt-modal[hidden] { display: none; }
.prompt-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.prompt-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.62); }
.prompt-modal-panel {
  position: relative; width: min(820px, 100%); max-height: min(86vh, 820px);
  display: flex; flex-direction: column; overflow: hidden; background: #fff;
  border: 1px solid #d8e1ea; border-radius: 8px; box-shadow: 0 24px 70px rgba(15,23,42,0.3);
}
.prompt-modal-header {
  display: flex; justify-content: space-between; gap: 20px; align-items: flex-start;
  padding: 18px 20px; border-bottom: 1px solid #e5e7eb;
}
.prompt-modal-header h2 { margin: 0; color: #1f2937; font-size: 18px; line-height: 1.4; }
.prompt-modal-header p { margin: 4px 0 0; color: #6b7280; font-size: 13px; }
.prompt-modal-close {
  flex: 0 0 34px; width: 34px; height: 34px; border: 0; background: transparent;
  color: #526275; font-size: 25px; line-height: 1; cursor: pointer;
}
.prompt-modal-close:hover { color: #111827; background: #f3f4f6; }
.prompt-modal-body { flex: 1; min-height: 240px; overflow: auto; padding: 18px 20px; background: #f8fafc; }
.prompt-modal-status { min-height: 22px; margin-bottom: 10px; color: #526275; font-size: 13px; }
.prompt-content {
  margin: 0; padding: 18px; overflow: visible; overflow-wrap: anywhere;
  border: 1px solid #dbe4ec; border-radius: 6px; background: #fff; color: #253243;
  font-family: system-ui,-apple-system,'Microsoft YaHei',sans-serif; font-size: 14px; line-height: 1.75;
}
.prompt-content h1, .prompt-content h2, .prompt-content h3, .prompt-content h4 {
  margin: 1.1em 0 .5em; color: #172033; line-height: 1.4;
}
.prompt-content h1:first-child, .prompt-content h2:first-child { margin-top: 0; }
.prompt-content h1 { font-size: 21px; }
.prompt-content h2 { padding-bottom: 7px; border-bottom: 1px solid #e5e7eb; font-size: 18px; }
.prompt-content h3 { font-size: 15px; }
.prompt-content h4 { font-size: 14px; }
.prompt-content p { margin: 0 0 12px; }
.prompt-content ul, .prompt-content ol { margin: 0 0 14px; padding-left: 24px; }
.prompt-content li { margin: 4px 0; }
.prompt-content blockquote {
  margin: 0 0 14px; padding: 9px 12px; border-left: 4px solid #60a5fa;
  background: #eff6ff; color: #42526a;
}
.prompt-content code {
  padding: 2px 5px; border-radius: 4px; background: #eef2f7;
  color: #9f1239; font: 12px/1.6 Consolas, monospace;
}
.prompt-content pre { margin: 0 0 14px; padding: 12px; overflow: auto; border-radius: 6px; background: #172033; }
.prompt-content pre code { padding: 0; background: transparent; color: #e5edf7; }
.prompt-content hr { margin: 16px 0; border: 0; border-top: 1px solid #dbe4ec; }
.prompt-modal-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 20px; border-top: 1px solid #e5e7eb; background: #fff;
}
.prompt-generated-time { color: #7a8796; font-size: 12px; }
.prompt-modal-actions { display: flex; gap: 8px; flex-shrink: 0; }
.prompt-modal-actions .btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 1024px) {
  .project-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .page-header-summary { align-items: flex-start; flex-direction: column; gap: 10px; }
  .main { margin: 16px auto; padding: 14px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 18px; }
}
@media (max-width: 480px) {
  .project-grid { grid-template-columns: 1fr; }
  .prompt-modal { padding: 0; place-items: stretch; }
  .prompt-modal-panel { width: 100%; max-height: 100vh; min-height: 100vh; border: 0; border-radius: 0; }
  .prompt-modal-header, .prompt-modal-body, .prompt-modal-footer { padding-left: 14px; padding-right: 14px; }
  .prompt-modal-footer { align-items: flex-end; }
  .prompt-generated-time { max-width: 45%; }
}
