.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: hidden;
  padding: 1rem;
}

.backgroundGrid {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: linear-gradient(rgba(6, 182, 212, 0.3) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(6, 182, 212, 0.3) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.digitalRain {
  position: absolute;
  inset: 0;
  color: #06b6d4;
  font-family: monospace;
  font-size: 14px;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(6, 182, 212, 0.2));
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;

  &::before {
    content: "01010101 10101010 00110011 10011001 11001100 10101010 01010101 11001100 00110011";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 30px,
      rgba(6, 182, 212, 0.05) 30px,
      rgba(6, 182, 212, 0.05) 60px
    );
    background-size: 100% 100%;
    opacity: 0.3;
    animation: rain 20s linear infinite;
  }
}

@keyframes rain {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 0% 100%;
  }
}

.loginContainer {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
  animation: pulseSlow 4s infinite;
  backdrop-filter: blur(10px);
  z-index: 10;
  
  @media (max-width: 480px) {
    padding: 1.5rem;
    max-width: 100%;
  }
}

@keyframes pulseSlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
  }
}

.topLine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(6, 182, 212, 0.8), transparent);
}

.cornerDecoration {
  position: absolute;
  width: 32px;
  height: 32px;

  &.topLeft {
    top: 0;
    left: 0;
    border-top: 2px solid rgba(6, 182, 212, 0.6);
    border-left: 2px solid rgba(6, 182, 212, 0.6);
  }

  &.topRight {
    top: 0;
    right: 0;
    border-top: 2px solid rgba(6, 182, 212, 0.6);
    border-right: 2px solid rgba(6, 182, 212, 0.6);
  }

  &.bottomLeft {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid rgba(6, 182, 212, 0.6);
    border-left: 2px solid rgba(6, 182, 212, 0.6);
  }

  &.bottomRight {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid rgba(6, 182, 212, 0.6);
    border-right: 2px solid rgba(6, 182, 212, 0.6);
  }
  
  @media (max-width: 480px) {
    width: 24px;
    height: 24px;
  }
}

.header {
  text-align: center;
  margin-bottom: 2rem;
  
  @media (max-width: 480px) {
    margin-bottom: 1.5rem;
  }
}

.logoContainer {
  position: relative;
  width: 280px;
  height: 80px;
  margin: 0 auto 1rem;
  
  @media (max-width: 480px) {
    width: 100%;
    max-width: 240px;
    height: 60px;
    margin-bottom: 0.75rem;
  }
}

.logoBackground {
  background: linear-gradient(to right, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.1));
  color: #06b6d4;
  font-weight: bold;
  font-size: 1.8rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(6, 182, 212, 0.3);
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(6, 182, 212, 0.8), transparent);
  }

  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(6, 182, 212, 0.8), transparent);
  }
}

.logoText {
  position: relative;
  z-index: 10;
  font-family: monospace;
  letter-spacing: 4px;
  color: transparent;
  background-clip: text;
  background-image: linear-gradient(to right, #06b6d4, #0891b2);
  -webkit-background-clip: text;
  font-size: 2rem;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
  
  @media (max-width: 480px) {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }
}

.scanLine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(6, 182, 212, 0.4);
  animation: scan 3s infinite;
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(500%);
    opacity: 0;
  }
}

.systemVersion {
  color: rgba(6, 182, 212, 0.7);
  font-size: 0.9rem;
  font-family: monospace;
  margin-bottom: 0.25rem;
  
  @media (max-width: 480px) {
    font-size: 0.8rem;
  }
}

.secureTerminal {
  color: rgba(6, 182, 212, 0.5);
  font-size: 0.8rem;
  font-family: monospace;
  
  @media (max-width: 480px) {
    font-size: 0.7rem;
  }
}

.loginForm {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  
  @media (max-width: 480px) {
    gap: 1rem;
  }
}

.inputGroup {
  position: relative;

  &:hover .inputGlow {
    opacity: 1;
  }
}

.inputGlow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(to right, rgba(6, 182, 212, 0.3), rgba(6, 182, 212, 0.3));
  border-radius: 6px;
  filter: blur(2px);
  opacity: 0.3;
  transition: opacity 1s;
}

.inputWrapper {
  position: relative;
}

.inputLabel {
  position: absolute;
  left: 12px;
  top: 16px;
  color: rgba(6, 182, 212, 0.5);
  font-size: 0.8rem;
  font-family: monospace;
  z-index: 1;
  
  @media (max-width: 480px) {
    font-size: 0.7rem;
    top: 14px;
    left: 10px;
  }
}

.input {
  width: 100%;
  padding: 1rem 4.5rem 1rem 5.5rem;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 4px;
  color: #06b6d4;
  font-size: 1rem;
  font-family: monospace;
  transition: all 0.3s ease;

  &:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
  }

  &::placeholder {
    color: rgba(6, 182, 212, 0.3);
  }
  
  @media (max-width: 480px) {
    font-size: 0.9rem;
    padding: 0.85rem 3rem 0.85rem 4.5rem;
  }
}

.statusIndicator {
  position: absolute;
  right: 12px;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  
  @media (max-width: 480px) {
    right: 10px;
    top: 14px;
    gap: 3px;
  }
}

.indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #06b6d4;
  border-radius: 50%;

  &.pulse {
    animation: pulse 2s infinite;
    background-color: rgba(6, 182, 212, 0.5);
  }
  
  @media (max-width: 480px) {
    width: 6px;
    height: 6px;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
}

.error {
  color: #ff4e4e;
  font-size: 0.9rem;
  text-align: center;
  font-family: monospace;
  background-color: rgba(255, 78, 78, 0.1);
  border: 1px solid rgba(255, 78, 78, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  
  @media (max-width: 480px) {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    gap: 6px;
  }
}

.errorIndicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ff4e4e;
  border-radius: 50%;
  animation: pulse 2s infinite;
  
  @media (max-width: 480px) {
    width: 6px;
    height: 6px;
  }
}

.buttonContainer {
  position: relative;
  margin-top: 0.5rem;

  &:hover .buttonGlow {
    opacity: 1;
  }
}

.buttonGlow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(to right, rgba(6, 182, 212, 0.5), rgba(6, 182, 212, 0.3));
  border-radius: 6px;
  filter: blur(2px);
  opacity: 0.3;
  transition: opacity 1s;
}

.loginButton {
  position: relative;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(to right, rgba(9, 145, 178, 0.5), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: 4px;
  color: #06b6d4;
  font-size: 1.1rem;
  font-family: monospace;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  &:hover:not(:disabled) {
    background: linear-gradient(to right, rgba(9, 145, 178, 0.2), rgba(6, 182, 212, 0.1));
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
  }

  &:active:not(:disabled) {
    transform: translateY(1px);
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  @media (max-width: 480px) {
    font-size: 0.95rem;
    padding: 0.85rem;
    gap: 6px;
  }
}

.buttonIndicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #06b6d4;
  border-radius: 50%;
  animation: pulse 2s infinite;
  
  @media (max-width: 480px) {
    width: 6px;
    height: 6px;
  }
}

.loadingSpinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 182, 212, 0.2);
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  
  @media (max-width: 480px) {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.footer {
  color: rgba(6, 182, 212, 0.3);
  font-size: 0.75rem;
  font-family: monospace;
  text-align: center;
  margin-top: 1rem;
  
  @media (max-width: 480px) {
    font-size: 0.7rem;
    margin-top: 0.75rem;
  }
}

/* 处理极小屏幕设备 */
@media (max-width: 360px) {
  .loginContainer {
    padding: 1.25rem;
  }
  
  .logoContainer {
    max-width: 220px;
    height: 55px;
  }
  
  .logoText {
    font-size: 1.3rem;
    letter-spacing: 2px;
  }
  
  .inputLabel {
    font-size: 0.65rem;
  }
  
  .input {
    font-size: 0.85rem;
    padding: 0.75rem 2.5rem 0.75rem 4rem;
  }
  
  .loginButton {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
}

/* 添加屏幕方向适配 */
@media (max-height: 570px) and (orientation: landscape) {
  .loginContainer {
    padding: 1.25rem;
    max-height: 95vh;
    overflow-y: auto;
  }
  
  .logoContainer {
    height: 50px;
    margin-bottom: 0.5rem;
  }
  
  .header {
    margin-bottom: 1rem;
  }
  
  .loginForm {
    gap: 0.8rem;
  }
  
  .systemVersion,
  .secureTerminal {
    display: inline-block;
    margin: 0 0.5rem;
  }
} 