/* 后台界面增强样式 - 响应式和动画优化 */

/* 移动端适配 */
@media (max-width: 768px) {
  .login-container {
    padding: 20px;
  }
  
  .login-card {
    padding: 30px 20px;
    margin: 0;
  }
  
  .admin-header {
    padding: 20px 0;
  }
  
  .admin-header h1 {
    font-size: 24px;
  }
  
  .admin-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .admin-card {
    padding: 20px;
  }
  
  .captcha-group {
    flex-direction: column;
  }
  
  .captcha-image {
    width: 100%;
    max-width: 200px;
  }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 增强动画效果 */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
  }
}

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

/* 加载动画增强 */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 按钮悬停效果增强 */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::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 0.6s ease;
}

.btn:hover::before {
  left: 100%;
}

/* 表单焦点效果增强 */
.form-control {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

/* 卡片悬停效果 */
.stat-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.admin-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

/* 公告项动画 */
.announcement-item {
  transition: all 0.3s ease;
  animation: slideInLeft 0.5s ease-out;
}

.announcement-item:hover {
  transform: translateX(8px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 文件上传区域 */
.file-upload-label {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-upload-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.file-upload input[type="file"]:focus + .file-upload-label {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 验证码图片效果 */
.captcha-image {
  transition: all 0.3s ease;
  border: 2px solid #e8f6ef;
}

.captcha-image:hover {
  transform: scale(1.05) rotate(2deg);
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* 登录Logo动画 */
.login-logo {
  animation: pulse 2s infinite, float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

/* 响应式字体大小 */
@media (max-width: 480px) {
  .login-title {
    font-size: 20px;
  }
  
  .admin-header h1 {
    font-size: 20px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .form-control {
    font-size: 16px; /* 防止iOS缩放 */
  }
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
  .login-card {
    background: rgba(30, 30, 30, 0.95);
    color: #e0e0e0;
  }
  
  .admin-card {
    background: #2a2a2a;
    color: #e0e0e0;
  }
  
  .form-control {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #4a4a4a;
  }
  
  .form-section {
    background: #252525;
  }
}

/* 可访问性增强 */
.btn:focus,
.form-control:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid #fff;
  }
  
  .form-control {
    border-width: 3px;
  }
}

/* 打印样式 */
@media print {
  .login-container,
  .admin-header {
    background: none !important;
    color: #000 !important;
  }
  
  .btn,
  .file-upload {
    display: none !important;
  }
  
  .admin-card,
  .stat-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}