/* 全局样式重置与基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 根元素变量定义 */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary-color: #0ea5e9;
  --accent-color: #06b6d4;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --background-color: #ffffff;
  --background-overlay: rgba(255, 255, 255, 0.95);
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --error-color: #ef4444;
  --error-bg: #fef2f2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* 页面主体样式 */
body {
  font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background-color: #f5f7fa;
  color: #333;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
  line-height: 1.6;
}

/* 登录页面容器 */
.login-page {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 1s ease-out;
}

/* 页面加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 背景装饰元素 */
.background-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 70%);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0) 70%);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

.shape-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
}

/* 登录容器样式 */
.login-container {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.92));
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  padding: 40px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
  z-index: 2;
}

.login-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 登录头部样式 */
.login-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}

/* Logo样式 */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  transition: transform var(--transition-normal);
  animation: logoPulse 3s ease-in-out infinite;
}

.login-container:hover .logo-icon {
  transform: scale(1.1) rotate(5deg);
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* 标题样式 */
h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 3px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.login-container:hover h2::after {
  opacity: 1;
}

/* 登录表单样式 */
.login-form {
  position: relative;
  animation: fadeInUp 0.8s ease-out;
}

/* 表单加载动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 表单组样式 */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

.label-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* 输入标签样式 */
.input-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

/* 输入框包装器 */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  transform: translateY(-1px);
}

/* 输入图标样式 */
.input-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  margin: 0 16px;
  flex-shrink: 0;
  transition: color var(--transition-normal);
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary-color);
  animation: pulse 1s infinite;
}

/* 输入框样式 */
input {
  flex: 1;
  padding: 14px 16px 14px 0;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text-primary);
  background: transparent;
  transition: color var(--transition-fast);
  position: relative;
  z-index: 1;
}

/* 输入框聚焦动画效果 */
input:focus ~ .focus-ring {
  transform: scaleX(1);
  transition: transform var(--transition-normal);
}

/* 输入框聚焦装饰环 */
.input-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.input-wrapper:focus-within::after {
  transform: scaleX(1);
}

input::placeholder {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.input-wrapper:focus-within input::placeholder {
  color: var(--text-secondary);
}

/* 登录按钮样式 */
.login-button {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.login-button:hover::before {
  left: 100%;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px -8px rgba(59, 130, 246, 0.5);
}

/* 按钮点击波纹效果 */
.login-button::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
  transform: scale(0);
  transition: transform var(--transition-fast);
}

.login-button:active::after {
  transform: scale(2);
}

.login-button span {
  position: relative;
  z-index: 1;
}

/* 按钮图标样式 */
.button-icon {
  width: 18px;
  height: 18px;
  color: white;
  transition: transform var(--transition-normal);
  position: relative;
  z-index: 1;
}

.login-button:hover .button-icon {
  transform: translateX(3px);
}

/* 错误信息样式 */
.error-message {
  color: var(--error-color);
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--error-bg);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: shake 0.5s ease-out, slideIn 0.4s ease-out;
  border-left: 4px solid var(--error-color);
  box-shadow: var(--shadow-sm);
}

/* 错误信息抖动动画 */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.error-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 登录页脚样式 */
.login-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.3s forwards;
}

.login-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  transition: color var(--transition-fast);
  position: relative;
  display: inline-block;
}

.login-footer p::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--primary-light);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.login-container:hover .login-footer p {
  color: var(--text-secondary);
}

.login-container:hover .login-footer p::after {
  transform: scaleX(1);
}

/* 动画定义 */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, 30px) scale(1.1);
  }
  50% {
    transform: translate(0, 60px) scale(1);
  }
  75% {
    transform: translate(-30px, 30px) scale(0.9);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 8px 12px rgba(79, 70, 229, 0.3));
  }
}

/* 微交互动画 */
@keyframes subtlePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* 输入图标聚焦动画 */
@keyframes iconFocus {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary-color);
  animation: iconFocus 0.5s ease-out;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 增强的响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 16px;
    background-attachment: scroll;
  }
  
  .login-container {
    padding: 32px 24px;
    max-width: 100%;
    margin: 0 auto;
  }
  
  .shape {
    filter: blur(60px);
  }
  
  .shape-1 {
    width: 300px;
    height: 300px;
  }
  
  .shape-2 {
    width: 250px;
    height: 250px;
  }
  
  .shape-3 {
    width: 200px;
    height: 200px;
  }
  
  /* 平板设备上的表单动画调整 */
  .login-form {
    animation: fadeInUp 0.6s ease-out;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  
  .login-container {
    padding: 28px 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: 
      0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -2px rgba(0, 0, 0, 0.05),
      0 0 0 1px rgba(255, 255, 255, 0.2);
  }
  
  .logo {
    gap: 10px;
  }
  
  .logo-icon {
    width: 30px;
    height: 30px;
  }
  
  .logo h1 {
    font-size: 24px;
  }
  
  h2 {
    font-size: 18px;
  }
  
  h2::after {
    width: 30px;
    bottom: -6px;
  }
  
  .form-group {
    margin-bottom: 20px;
  }
  
  .input-wrapper {
    padding-right: 12px;
  }
  
  .input-icon {
    width: 16px;
    height: 16px;
    margin: 0 12px;
  }
  
  input {
    font-size: 15px;
    padding: 12px 12px 12px 0;
  }
  
  .login-button {
    padding: 13px 20px;
    font-size: 15px;
    gap: 6px;
  }
  
  .button-icon {
    width: 16px;
    height: 16px;
  }
  
  .error-message {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .login-footer {
    margin-top: 24px;
    padding-top: 16px;
  }
  
  .login-footer p {
    font-size: 12px;
  }
  
  /* 移动设备上的背景形状调整 */
  .shape-1 {
    width: 250px;
    height: 250px;
    top: -50px;
    left: -50px;
  }
  
  .shape-2 {
    width: 200px;
    height: 200px;
    bottom: -30px;
    right: -30px;
  }
  
  .shape-3 {
    width: 150px;
    height: 150px;
  }
}

/* 小屏幕设备优化 */
@media (max-width: 360px) {
  .login-container {
    padding: 24px 16px;
  }
  
  .logo h1 {
    font-size: 22px;
  }
  
  h2 {
    font-size: 16px;
  }
  
  input {
    font-size: 14px;
  }
}