/* 用户认证样式 - 登录/注册弹窗 */

/* 弹窗遮罩 */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-overlay.active {
  display: flex;
  opacity: 1;
}

/* 弹窗容器 */
.auth-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.auth-overlay.active .auth-modal {
  transform: translateY(0);
}

/* 弹窗头部 */
.auth-header {
  padding: 24px 24px 0;
  text-align: center;
  position: relative;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #666;
  transition: all 0.2s;
}

.auth-close:hover {
  background: #eee;
  color: #333;
}

.auth-logo {
  height: 40px;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* 选项卡 */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  margin: 20px 24px 0;
}

.auth-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.auth-tab:hover {
  color: #333;
}

.auth-tab.active {
  color: #E60012;
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #E60012;
}

/* 表单内容 */
.auth-content {
  padding: 24px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

/* 表单组 */
.auth-field {
  margin-bottom: 20px;
}

.auth-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.auth-label .required {
  color: #E60012;
  margin-left: 2px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: #E60012;
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.1);
}

.auth-input::placeholder {
  color: #aaa;
}

/* 验证码行 */
.auth-captcha-row {
  display: flex;
  gap: 12px;
}

.auth-captcha-row .auth-input {
  flex: 1;
}

.auth-captcha-img {
  height: 46px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #ddd;
}

.auth-captcha-img:hover {
  border-color: #ccc;
}

/* 提交按钮 */
.auth-submit {
  width: 100%;
  padding: 14px;
  background: #E60012;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.auth-submit:hover {
  background: #c5000f;
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 底部链接 */
.auth-footer {
  text-align: center;
  padding: 16px 24px 24px;
  font-size: 14px;
  color: #666;
}

.auth-footer a {
  color: #E60012;
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* 错误提示 */
.auth-error {
  background: #fff0f0;
  color: #c00;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.auth-error.show {
  display: block;
}

/* 成功提示 */
.auth-success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.auth-success.show {
  display: block;
}

/* Header用户区域 */
.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-auth-btns {
  display: flex;
  gap: 12px;
}

.header-login-btn,
.header-register-btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.header-login-btn {
  background: transparent;
  border: 1px solid #ddd;
  color: #333;
}

.header-login-btn:hover {
  border-color: #E60012;
  color: #E60012;
}

.header-register-btn {
  background: #E60012;
  border: 1px solid #E60012;
  color: #fff;
}

.header-register-btn:hover {
  background: #c5000f;
  border-color: #c5000f;
}

/* 已登录用户信息 */
.header-user-info {
  display: none;
  align-items: center;
  gap: 12px;
}

.header-user-info.show {
  display: flex;
}

.header-auth-btns.hide {
  display: none;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E60012;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.header-username {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.header-user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 20px;
  transition: background 0.2s;
}

.header-user-menu:hover {
  background: #f5f5f5;
}

.header-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 8px; /* 用padding代替margin，保持hover状态连续 */
  z-index: 1000;
  display: none;
}

.header-user-dropdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px; /* 透明填充间隙区域，保持hover连续 */
}

.header-user-dropdown::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: -1;
}

.header-user-menu:hover .header-user-dropdown {
  display: block;
}

.header-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
  position: relative;
  z-index: 1;
  background: #fff;
}

.header-user-dropdown a:first-child {
  border-radius: 8px 8px 0 0;
}

.header-user-dropdown a i {
  width: 16px;
  color: #666;
}

.header-user-dropdown a:hover {
  background: #f5f5f5;
}

.header-user-dropdown a:last-child {
  color: #999;
  border-top: 1px solid #eee;
  border-radius: 0 0 8px 8px;
}

/* 响应式 */
@media (max-width: 480px) {
  .auth-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }
  
  .auth-overlay {
    align-items: flex-end;
    padding: 0;
  }
  
  .auth-content {
    padding: 20px;
  }
}
