/* 弹窗样式 - 弹窗A/B + Lightbox */

/* 弹窗遮罩层 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.active {
  display: flex;
}

/* 弹窗容器 */
.modal-container {
  background: #fff;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 15px; right: 20px;
  background: none; border: none;
  font-size: 28px; color: #666;
  cursor: pointer; z-index: 10;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.modal-body {
  padding: 30px;
}

/* 弹窗内容 */
.modal-profile .modal-header {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid #f0f0f0;
}

.modal-photo {
  flex-shrink: 0;
  width: 140px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--primary-color, #003D7A);
}
.modal-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.modal-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 48px; font-weight: bold;
  background: linear-gradient(135deg, var(--primary-color, #003D7A), var(--tech-blue, #0066CC));
}

.modal-info h3 {
  font-size: 1.5rem;
  color: var(--primary-color, #003D7A);
  margin-bottom: 8px;
}

.modal-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.modal-name-row h3 {
  margin-bottom: 0;
}

.modal-position {
  color: #666;
  margin-bottom: 8px;
}
.modal-email a {
  color: var(--tech-blue, #0066CC);
  text-decoration: none;
}
.modal-email a:hover { text-decoration: underline; }

.modal-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px;
}
.modal-tags .tag {
  padding: 3px 10px;
  background: #e8f4fd;
  color: var(--primary-color, #003D7A);
  border-radius: 12px;
  font-size: 0.8rem;
}

.modal-section {
  margin-bottom: 20px;
}
.modal-section h4 {
  font-size: 1.1rem;
  color: var(--primary-color, #003D7A);
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-gold, #C4972F);
}
.modal-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #444;
}

.modal-paper-list {
  list-style: none; padding: 0;
}
.modal-paper-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}
.modal-paper-list li:last-child { border-bottom: none; }
.paper-title { display: block; font-weight: 500; color: #333; }
.paper-meta { display: block; font-size: 0.85rem; color: #888; margin-top: 4px; }
.paper-doi {
  display: inline-block; margin-top: 4px;
  color: var(--tech-blue, #0066CC);
  font-size: 0.85rem;
  text-decoration: none;
}
.paper-doi:hover { text-decoration: underline; }

.modal-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.modal-project-card {
  position: relative;
  padding: 8px;
}

.modal-project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-project-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 61, 122, 0.1), rgba(0, 102, 204, 0.16));
  color: var(--primary-color, #003D7A);
  font-weight: 700;
}

.modal-project-title {
  font-size: 1.45rem;
  line-height: 1.45;
  color: var(--primary-color, #003D7A);
  margin-bottom: 18px;
}

.modal-project-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.modal-project-meta-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 250, 252, 0.96), rgba(238, 245, 251, 0.96));
  border: 1px solid rgba(0, 61, 122, 0.08);
}

.modal-project-meta-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: #6b7c93;
  letter-spacing: 0.04em;
}

.modal-project-meta-item strong {
  color: #203247;
  line-height: 1.6;
  font-size: 0.98rem;
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.active { display: flex; }

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}
.lightbox-caption {
  color: #ccc;
  margin-top: 12px;
  font-size: 0.95rem;
}
.lightbox-counter {
  position: absolute;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none; border: none;
  color: #fff; font-size: 36px;
  cursor: pointer;
  padding: 10px;
  transition: opacity 0.2s;
  z-index: 10;
}
.lightbox-close { top: 10px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 0.7; }

/* 响应式 */
@media (max-width: 600px) {
  .modal-profile .modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .modal-photo { width: 120px; height: 150px; }
  .modal-tags { justify-content: center; }
  .modal-body { padding: 20px; }

  .modal-name-row {
    justify-content: center;
    gap: 6px;
  }

  .modal-project-title {
    font-size: 1.08rem;
  }

  .modal-project-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
