/* ─── Paper detail modal ─── */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
}

#modal-backdrop.open {
  display: flex;
}

#modal {
  background: rgba(19, 41, 75, 0.52);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(76, 118, 188, 0.24);
  border-radius: 18px;
  width: min(560px, 88vw);
  max-width: 88vw;
  max-height: 82vh;
  overflow-y: auto;
  padding: 24px 24px 22px;
  position: relative;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .42);
  animation: modalIn .3s ease;
}

#modal::-webkit-scrollbar {
  width: 7px;
}

#modal::-webkit-scrollbar-track {
  background: transparent;
}

#modal::-webkit-scrollbar-thumb {
  background: rgba(159, 179, 206, 0.28);
  border-radius: 999px;
}

#modal::-webkit-scrollbar-thumb:hover {
  background: rgba(159, 179, 206, 0.42);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(96, 134, 198, 0.28);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  transition: all .18s;
}

#modal-close:hover {
  background: rgba(255, 95, 5, 0.12);
  border-color: rgba(255, 95, 5, 0.36);
  color: #fff;
}

#modal h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.38;
  margin-bottom: 10px;
  padding-right: 34px;
}

#modal .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

#modal .detail-tag {
  font-size: .61rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

#modal .detail-tag.time {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

#modal .detail-tag.domain {
  background: rgba(255, 95, 5, .15);
  color: var(--accent-2);
}

#modal .detail-tag.room {
  background: rgba(252, 179, 22, .15);
  color: var(--gold);
}

#modal .detail-authors {
  font-size: .76rem;
  color: var(--text-dim);
  margin-bottom: 15px;
  line-height: 1.45;
}

#modal .detail-abstract {
  font-size: .78rem;
  line-height: 1.68;
  color: var(--text);
  margin-bottom: 16px;
}

#modal .detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2);
  font-size: .76rem;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s;
}

#modal .detail-link:hover {
  color: var(--teal);
}

@media (max-width: 768px) {
  #modal {
    width: min(92vw, 420px);
    max-width: 92vw;
    max-height: 76vh;
    padding: 18px 18px 16px;
    border-radius: 16px;
  }

  #modal h3 {
    font-size: .92rem;
    line-height: 1.34;
    padding-right: 30px;
  }

  #modal .detail-tag {
    font-size: .58rem;
    padding: 4px 9px;
  }

  #modal .detail-authors {
    font-size: .72rem;
  }

  #modal .detail-abstract,
  #modal .detail-link {
    font-size: .74rem;
  }
}
