/* 管理员登录页面专用样式 */
:root {
  --admin-primary: #4361ee;
  --admin-secondary: #3f37c9;
  --admin-accent: #4895ef;
  --admin-gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  --admin-light: #4cc9f0;
  --admin-dark: #3a0ca3;
  --white: #ffffff;
  --black: #000000;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--gray-800);
  background-color: var(--gray-100);
  height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* 登录背景 */
.login-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.login-background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--admin-gradient);
  opacity: 0.95;
}

.login-background-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(2px);
}

.shape-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -100px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
  animation: float 20s ease-in-out infinite;
}

.shape-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -50px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
  animation: float 15s ease-in-out infinite reverse;
}

.shape-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  left: 30%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
  animation: float 18s ease-in-out infinite 2s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, -30px) rotate(5deg);
  }
  50% {
    transform: translate(40px, 20px) rotate(10deg);
  }
  75% {
    transform: translate(-20px, 40px) rotate(5deg);
  }
}

/* 登录容器 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 30px 60px -10px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.admin-card {
  border-top: 5px solid var(--admin-primary);
}

/* 登录头部 */
.login-header {
  padding: 2.5rem 2.5rem 1.5rem;
  text-align: center;
  position: relative;
}

.login-logo {
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: center;
}

.logo-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.admin-icon {
  background: var(--admin-gradient);
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.login-subtitle {
  color: var(--gray-600);
  font-size: 1rem;
  font-weight: 500;
}

/* 警告提示 */
.alert {
  margin: 1.5rem 2.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  animation: slideIn 0.3s ease forwards;
}

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

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--danger);
  color: #b91c1c;
}

.alert-icon {
  flex-shrink: 0;
  color: currentColor;
}

/* 表单样式 */
.login-form {
  padding: 0 2.5rem 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.input-wrapper {
  position: relative;
  transition: all 0.2s ease;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--gray-500);
  transition: all 0.3s ease;
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-800);
  background: var(--white);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.form-control::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.input-wrapper.focused .input-icon {
  color: var(--admin-primary);
  transform: translateY(-50%) scale(1.1);
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--admin-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.btn-full {
  width: 100%;
}

.btn-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--admin-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.btn.loading .btn-text {
  opacity: 0;
}

.btn.loading .btn-loading {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 按钮波纹效果 */
.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    transform: scale(40, 40);
    opacity: 0;
  }
}

/* 登录页脚 */
.login-footer {
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.link-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
}

.link-secondary:hover {
  color: var(--admin-primary);
  background: var(--gray-100);
  transform: translateY(-2px);
}

.login-help {
  text-align: center;
}

.text-muted {
  color: var(--gray-500);
  font-size: 0.75rem;
}

/* 错误状态 */
.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.field-error::before {
  content: '⚠';
  font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 576px) {
  .login-container {
    padding: 1rem;
  }
  
  .login-header {
    padding: 2rem 1.5rem 1rem;
  }
  
  .login-form,
  .login-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .alert {
    margin: 1.5rem 1.5rem;
  }
  
  .login-title {
    font-size: 1.75rem;
  }
  
  .logo-icon {
    width: 70px;
    height: 70px;
  }
}

/* 动画增强 */
.login-card {
  animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
}

@keyframes cardAppear {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 焦点效果 */
.input-wrapper.focused {
  transform: scale(1.01);
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
  .login-card {
    background: rgba(31, 41, 55, 0.95);
  }
  
  .login-title {
    color: var(--gray-100);
  }
  
  .login-subtitle {
    color: var(--gray-400);
  }
  
  .form-label {
    color: var(--gray-300);
  }
  
  .form-control {
    background: rgba(17, 24, 39, 0.8);
    border-color: var(--gray-700);
    color: var(--gray-200);
  }
  
  .form-control::placeholder {
    color: var(--gray-500);
  }
  
  .form-control:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 4px rgba(72, 149, 239, 0.2);
  }
  
  .login-footer {
    background: rgba(17, 24, 39, 0.8);
    border-color: var(--gray-700);
  }
  
  .link-secondary {
    color: var(--gray-400);
  }
  
  .link-secondary:hover {
    color: var(--admin-light);
    background: rgba(255, 255, 255, 0.05);
  }
  
  .text-muted {
    color: var(--gray-400);
  }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
