/* 认证系统样式 */
:root {
  --login-horizontal-position: 75%;  /* 水平位置: 50%=正中, 60%=偏右, 40%=偏左 */
}

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
}

.auth-backdrop {
  position: fixed; /* 保持fixed,相对于视口定位 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 使用背景图片并添加虚化效果 */
  background-image: url('login-background.png');
  background-size: cover; /* 使用cover填满整个屏幕 */
  background-position: center center; /* 居中显示 */
  background-repeat: no-repeat;
  z-index: 9998; /* 背景层层级 */
  /* 移除 pointer-events: none */
}

/* 添加虚化遮罩层 */
.auth-backdrop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1); /* 减轻遮罩 */
  backdrop-filter: blur(1px); /* 减少虚化 */
  z-index: 9999;
  /* 移除 pointer-events: none */
}

/* LOGO - 放置在左上角 */
.auth-backdrop::after {
  content: '';
  position: fixed; /* LOGO用fixed定位 */
  top: 40px;
  left: 40px;
  transform: none;
  width: 150px;
  height: 150px;
  background-image: url('LOGO.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.9;
  pointer-events: none;
  z-index: 10000; /* LOGO层级 */
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* 移除LOGO浮动动画 */


.auth-container {
  /* 半透明白色背景，类似参考图 */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px) saturate(150%);
  border-radius: 20px;
  padding: 40px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
  width: 100%;
  max-width: 400px;
  position: fixed; /* 保持fixed定位 */
  z-index: 10001; /* 登录框在最上层 */

  /* 使用固定定位,直接控制位置 */
  left: var(--login-horizontal-position);
  top: 50%;
  transform: translate(-50%, -50%);

  /* 淡入动画,不移动位置 */
  animation: authFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 移除登录框额外的背景层，保持简洁 */


@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  color: #333333; /* 深色文字 */
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px 0;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.auth-header p {
  color: rgba(0, 0, 0, 0.6); /* 深色文字 */
  font-size: 16px;
  margin: 0;
}

.auth-form {
  margin-bottom: 20px;
}

.auth-form.hidden {
  display: none;
}

.auth-form h3 {
  color: #333333; /* 深色文字 */
  font-size: 24px;
  margin: 0 0 20px 0;
  text-align: center;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-group input {
  width: 100%;
  padding: 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.4); /* 半透明白色 */
  color: #333333; /* 深色文字 */
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.form-group input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.auth-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-btn.primary {
  background: rgba(70, 130, 255, 0.7); /* 半透明蓝色按钮 */
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 20px rgba(70, 130, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auth-btn.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.auth-btn.primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s ease;
  z-index: 1;
}

.auth-btn.primary:hover::after {
  left: 100%;
}

.auth-btn.primary:hover {
  background: rgba(90, 150, 255, 0.8);
  transform: translateY(-2px);
  box-shadow:
    0 12px 30px rgba(70, 130, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.7);
}

.auth-btn.primary:active {
  transform: translateY(0);
}

.auth-switch {
  text-align: center;
  margin: 20px 0 0 0;
  color: rgba(0, 0, 0, 0.6); /* 深色文字 */
}

.auth-switch a {
  color: #4682b4; /* 钢蓝色链接 */
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-demo {
  border-top: 1px solid #e1e5e9;
  padding-top: 20px;
  text-align: center;
}

.auth-demo p {
  color: #666;
  margin: 0 0 15px 0;
  font-size: 14px;
}

.demo-btn {
  background: #f8f9fa;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: all 0.3s ease;
}

.demo-btn:hover {
  background: #1e90ff;
  color: white;
  border-color: #1e90ff;
}

.auth-message {
  padding: 15px;
  border-radius: 8px;
  margin: 0 0 20px 0;
  font-weight: 500;
  text-align: center;
}

.auth-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.auth-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 用户管理模态框 - 独立样式,不使用登录背景 */
.user-management-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 23, 0.9); /* 纯色半透明背景,不使用图片 */
  backdrop-filter: blur(10px);
}

/* 用户管理界面样式 */
.user-management-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  animation: authSlideIn 0.5s ease-out;
}

.user-management-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e1e5e9;
}

.user-management-header h2 {
  color: #333;
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #1e90ff 0%, #00d084 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.close-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #ff5252;
  transform: scale(1.1);
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #1e90ff 0%, #00d084 100%);
  border-radius: 15px;
  color: white;
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.2);
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
}

.user-list {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 20px;
}

.user-list-header h3 {
  color: #333;
  font-size: 20px;
  margin: 0 0 20px 0;
  font-weight: 600;
}

.user-table {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-header {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1.5fr 1fr;
  gap: 15px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #1e90ff 0%, #00d084 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.table-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1.5fr 1fr;
  gap: 15px;
  padding: 15px 20px;
  border-bottom: 1px solid #e1e5e9;
  transition: background-color 0.3s ease;
  align-items: center;
}

.table-row:hover {
  background: #f8f9fa;
}

.table-row:last-child {
  border-bottom: none;
}

.user-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.user-avatar {
  font-size: 18px;
}

.current-user-badge {
  background: #00d084;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.user-role {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.user-role.admin {
  background: #ff6b6b;
  color: white;
}

.user-role.user {
  background: #e1e5e9;
  color: #666;
}

.user-email {
  color: #666;
  font-size: 14px;
}

.user-register-time {
  color: #666;
  font-size: 14px;
}

.user-actions {
  display: flex;
  justify-content: center;
}

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.delete-btn {
  background: #ff6b6b;
  color: white;
}

.delete-btn:hover {
  background: #ff5252;
  transform: translateY(-1px);
}

.action-disabled {
  color: #999;
  font-size: 12px;
  font-style: italic;
}

.no-users {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .user-management-container {
    width: 95%;
    margin: 10px;
    padding: 20px;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 10px;
  }
  
  .table-header,
  .table-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .table-header span,
  .table-row span {
    padding: 5px 0;
  }
}

/* ICP备案信息样式 */
.icp-info {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.icp-info a {
  color: rgba(0, 0, 0, 0.6);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  transition: all 0.3s ease;
  display: inline-block;
}

.icp-info a:hover {
  color: rgba(0, 0, 0, 0.8);
  background: rgba(255, 255, 255, 0.5);
  text-decoration: underline;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
  :root {
    --login-horizontal-position: 50%; /* 小屏幕居中 */
  }

  .auth-container {
    margin: 20px;
    padding: 30px 20px;
    max-width: 90%;
  }

  .auth-backdrop::after {
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    margin: 20px;
    padding: 30px 20px;
  }

  .auth-header h2 {
    font-size: 24px;
  }

  .icp-info a {
    font-size: 11px;
    padding: 4px 8px;
  }

  .auth-backdrop::after {
    width: 60px;
    height: 60px;
  }
}

/* 中等屏幕适配 */
@media (min-width: 769px) and (max-width: 1366px) {
  :root {
    --login-horizontal-position: 60%; /* 中等屏幕稍微偏右 */
  }
}

/* 大屏幕适配 */
@media (min-width: 1367px) {
  :root {
    --login-horizontal-position: 75%; /* 大屏幕更偏右 */
  }
}