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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部 */
.site-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  padding: 40px 0;
  text-align: center;
}

.site-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.site-header p {
  font-size: 15px;
  opacity: 0.9;
}

/* 筛选栏 */
.filter-bar {
  padding: 24px 0 16px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-btn {
  padding: 8px 18px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
}

.tag-btn:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

.tag-btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

/* 项目列表 */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}

.project-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #f1f5f9;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-color: #c7d2fe;
}

.project-card.pinned {
  border-top: 3px solid #f59e0b;
}

.project-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pinned-badge {
  font-size: 11px;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.project-card .desc {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.project-card .tag {
  font-size: 12px;
  background: #eef2ff;
  color: #4338ca;
  padding: 3px 10px;
  border-radius: 4px;
}

.project-card .view-btn {
  font-size: 13px;
  color: #4f46e5;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #e2e8f0;
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-right: 40px;
}

.modal-content #detailDesc {
  font-size: 15px;
  color: #475569;
  line-height: 1.8;
  margin-bottom: 20px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-tags .tag {
  font-size: 13px;
  background: #eef2ff;
  color: #4338ca;
  padding: 4px 12px;
  border-radius: 6px;
}

.qr-section {
  text-align: center;
  padding: 24px;
  background: #f8fafc;
  border-radius: 12px;
}

.qr-label {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 14px;
}

.qr-section img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

/* 加载和空状态 */
.loading, .empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 15px;
}

/* 响应式 */
@media (max-width: 640px) {
  .site-header {
    padding: 28px 0;
  }
  
  .site-header h1 {
    font-size: 22px;
  }
  
  .project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .project-card {
    padding: 18px;
  }
  
  .modal-content {
    padding: 24px 20px;
  }
  
  .qr-section img {
    width: 150px;
    height: 150px;
  }
}
