/* ========================================
   统一认证页面样式
   ======================================== */

/* CSS 变量 - 主题色 */
:root {
  --auth-primary: #4CAF50;
  --auth-primary-light: #66BB6A;
  --auth-primary-dark: #388E3C;
  --auth-primary-bg: rgba(76, 175, 80, 0.08);
  --auth-bg: #f5f7fa;
  --auth-card-bg: #ffffff;
  --auth-text: #333333;
  --auth-text-secondary: #666666;
  --auth-text-muted: #999999;
  --auth-border: #e0e0e0;
  --auth-input-bg: #f8f9fa;
  --auth-error: #f44336;
  --auth-error-bg: rgba(244, 67, 54, 0.08);
  --auth-success: #4CAF50;
  --auth-success-bg: rgba(76, 175, 80, 0.08);
  --auth-warning: #ff9800;
  --auth-warning-bg: rgba(255, 152, 0, 0.08);
  --auth-radius: 12px;
  --auth-radius-sm: 8px;
  --auth-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --auth-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --auth-transition: all 0.3s ease;
}

/* 图片分享主题 */
.image-share-theme {
  --auth-primary: #667eea;
  --auth-primary-light: #7c8ef0;
  --auth-primary-dark: #5a6fd6;
  --auth-primary-bg: rgba(102, 126, 234, 0.08);
}

/* 主站点主题 (frontend) */
.frontend-theme {
  --auth-primary: #4CAF50;
  --auth-primary-light: #66BB6A;
  --auth-primary-dark: #388E3C;
  --auth-primary-bg: rgba(76, 175, 80, 0.08);
}

/* 页面基础样式 */
.auth-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--auth-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--auth-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* 认证容器 */
.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--auth-card-bg);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 40px 36px;
  animation: authFadeIn 0.4s ease;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 头部 */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--auth-text);
  margin: 0 0 8px 0;
}

.auth-header p {
  font-size: 14px;
  color: var(--auth-text-secondary);
  margin: 0;
}

/* 提示信息 */
.auth-alert {
  padding: 12px 16px;
  border-radius: var(--auth-radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-alert i {
  font-size: 16px;
  flex-shrink: 0;
}

.auth-alert-error {
  background: var(--auth-error-bg);
  color: var(--auth-error);
  border: 1px solid rgba(244, 67, 54, 0.15);
}

.auth-alert-success {
  background: var(--auth-success-bg);
  color: var(--auth-success);
  border: 1px solid rgba(76, 175, 80, 0.15);
}

.auth-alert-warning {
  background: var(--auth-warning-bg);
  color: #e67e00;
  border: 1px solid rgba(255, 152, 0, 0.15);
}

/* 表单 */
.auth-form {
  width: 100%;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 6px;
}

.auth-form label .required {
  color: var(--auth-error);
  margin-left: 2px;
}

/* 密码输入框容器 */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  flex: 1;
}

/* 显示密码按钮 */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--auth-text-muted);
  font-size: 16px;
  transition: var(--auth-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.toggle-password:hover {
  color: var(--auth-primary);
}

/* 输入框 */
.auth-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  font-size: 15px;
  color: var(--auth-text);
  background: var(--auth-input-bg);
  transition: var(--auth-transition);
  box-sizing: border-box;
  outline: none;
}

.auth-input:focus {
  border-color: var(--auth-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--auth-primary-bg);
}

.auth-input::placeholder {
  color: var(--auth-text-muted);
}

/* 验证码输入 */
.auth-input-code {
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  font-weight: bold;
}

/* 禁用输入框 */
.auth-input[disabled] {
  background: #eee;
  color: #999;
  cursor: not-allowed;
}

/* 表单描述文本 */
.auth-form-desc {
  color: var(--auth-text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* 记住密码 */
.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--auth-text-secondary);
  user-select: none;
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--auth-primary);
  cursor: pointer;
}

/* 按钮 */
.auth-btn {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: var(--auth-radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--auth-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn-primary {
  background: var(--auth-primary);
  color: #fff;
}

.auth-btn-primary:hover {
  background: var(--auth-primary-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-btn-primary:active {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 链接区域 */
.auth-links {
  margin-top: 24px;
  text-align: center;
}

.auth-links p,
.auth-links a {
  font-size: 14px;
  color: var(--auth-text-secondary);
  margin: 8px 0;
}

.auth-links a {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--auth-transition);
}

.auth-links a:hover {
  color: var(--auth-primary-dark);
  text-decoration: underline;
}

.auth-links .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--auth-text-muted);
  font-size: 13px;
}

.auth-links .auth-divider::before,
.auth-links .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

/* 用户协议 */
.agreement-group {
  margin-bottom: 20px !important;
}

.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--auth-text-secondary);
  line-height: 1.5;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--auth-primary);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.auth-checkbox-label a {
  color: var(--auth-primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-checkbox-label a:hover {
  text-decoration: underline;
}

/* 弹窗 */
.auth-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.auth-modal-overlay.active {
  display: flex;
}

.auth-modal-content {
  background: #fff;
  border-radius: var(--auth-radius);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--auth-shadow-lg);
  animation: authModalIn 0.3s ease;
  overflow: hidden;
}

@keyframes authModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.auth-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-modal-close {
  background: #f0f0f0;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--auth-transition);
  line-height: 1;
}

.auth-modal-close:hover {
  background: #e0e0e0;
  color: #666;
}

.auth-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.8;
  font-size: 14px;
  color: var(--auth-text-secondary);
}

.auth-modal-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--auth-text);
  margin-top: 20px;
  margin-bottom: 10px;
}

.auth-modal-body h3:first-child {
  margin-top: 0;
}

.auth-modal-body p {
  margin-bottom: 10px;
  text-align: justify;
}

.auth-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 28px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
/* 图形验证码 */
.captcha-group {
  margin-bottom: 20px !important;
}

.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.captcha-image-wrapper {
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
  background: #fff;
  transition: var(--auth-transition);
}

.captcha-image-wrapper:hover {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px var(--auth-primary-bg);
}

.captcha-image-wrapper svg {
  display: block;
  width: 120px;
  height: 40px;
}

.captcha-refresh {
  background: var(--auth-input-bg);
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  cursor: pointer;
  padding: 8px 12px;
  color: var(--auth-text-secondary);
  font-size: 16px;
  transition: var(--auth-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 40px;
}

.captcha-refresh:hover {
  color: var(--auth-primary);
  border-color: var(--auth-primary);
  background: var(--auth-primary-bg);
}

/* 响应式 */
@media (max-width: 480px) {
  .auth-page {
    padding: 20px 16px;
  }

  .auth-container {
    padding: 28px 24px;
    border-radius: var(--auth-radius-sm);
  }

  .auth-header h1 {
    font-size: 20px;
  }

  .auth-modal-content {
    max-height: 90vh;
    border-radius: var(--auth-radius-sm);
  }

  .auth-modal-header {
    padding: 16px 20px;
  }

  .auth-modal-body {
    padding: 20px;
  }

  .auth-modal-footer {
    padding: 14px 20px;
  }
}