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

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f23;
  color: #fff;
  overflow: hidden;
}

.portal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
}

.portal__background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, .15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, .1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(34, 211, 238, .1) 0%, transparent 50%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: .6; }
  100% { opacity: 1; }
}

.portal__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal__entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 3rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(20px);
  transition: all .4s cubic-bezier(.4, 0, .2, 1);
  cursor: pointer;
}

.portal__entry:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, .06);
  border-color: rgba(99, 102, 241, .4);
  box-shadow:
    0 20px 60px rgba(99, 102, 241, .15),
    0 0 40px rgba(99, 102, 241, .1);
}

.portal__entry:active {
  transform: translateY(-4px) scale(.99);
}

.portal__icon {
  width: 180px;
  height: 180px;
  margin-bottom: 2rem;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.portal__svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 20px rgba(99, 102, 241, .3));
}

.cell {
  transition: all .3s ease;
}

.cell--1 {
  fill: #6366f1;
}

.cell--2 {
  fill: #ec4899;
}

.cell--3 {
  fill: #22d3ee;
}

.cell--4 {
  fill: #f59e0b;
}

.portal__entry:hover .cell--1 {
  fill: #818cf8;
}

.portal__entry:hover .cell--2 {
  fill: #f472b6;
}

.portal__entry:hover .cell--3 {
  fill: #67e8f9;
}

.portal__entry:hover .cell--4 {
  fill: #fbbf24;
}

.portal__title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: .5rem;
  background: linear-gradient(135deg, #6366f1, #ec4899, #22d3ee);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal__subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, .5);
  font-weight: 300;
  letter-spacing: .1em;
  margin-bottom: 1.5rem;
}

.portal__hint {
  font-size: .9rem;
  color: rgba(255, 255, 255, .4);
  padding: .5rem 1.2rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .3s ease;
}

.portal__entry:hover .portal__hint {
  color: rgba(255, 255, 255, .8);
  border-color: rgba(99, 102, 241, .5);
  background: rgba(99, 102, 241, .1);
}

.portal__footer {
  position: absolute;
  bottom: 2rem;
  color: rgba(255, 255, 255, .3);
  font-size: .8rem;
}

/* ============ 登录弹窗 ============ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-overlay.show {
  display: flex;
}

.login-modal {
  background: #1a1a3e;
  border: 1px solid rgba(99, 102, 241, .3);
  border-radius: 1.5rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  animation: modalIn .3s ease;
}

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

.login-modal__header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-modal__header h2 {
  font-size: 1.5rem;
  margin-bottom: .5rem;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-modal__header p {
  color: rgba(255, 255, 255, .5);
  font-size: .9rem;
}

.login-form__field {
  margin-bottom: 1.2rem;
}

.login-form__field label {
  display: block;
  font-size: .85rem;
  color: rgba(255, 255, 255, .6);
  margin-bottom: .4rem;
  font-weight: 500;
}

.login-form__field input {
  width: 100%;
  padding: .8rem 1rem;
  border-radius: .75rem;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: all .3s ease;
}

.login-form__field input:focus {
  border-color: rgba(99, 102, 241, .6);
  background: rgba(99, 102, 241, .05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.login-form__field input::placeholder {
  color: rgba(255, 255, 255, .3);
}

.login-form__error {
  font-size: .85rem;
  color: #f87171;
  text-align: center;
  min-height: 1.2rem;
  margin-bottom: .8rem;
  opacity: 0;
  transition: opacity .3s ease;
}

.login-form__error.show {
  opacity: 1;
}

.login-form__btn {
  width: 100%;
  padding: .9rem;
  border-radius: .75rem;
  border: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s ease;
}

.login-form__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, .4);
}

.login-form__btn:active {
  transform: translateY(0);
}

.login-form__btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .portal__entry {
    padding: 2rem;
  }

  .portal__icon {
    width: 140px;
    height: 140px;
  }

  .portal__title {
    font-size: 2rem;
  }

  .login-modal {
    padding: 1.5rem;
  }
}
