/* =====================================================
   一路向南 — 用户系统样式
   登录/注册弹窗、个人中心
===================================================== */

/* ============ 弹窗遮罩层 ============ */
.user-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.user-modal-overlay.show {
  opacity: 1;
}

/* ============ 弹窗主体 ============ */
.user-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 28px;
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.user-modal-overlay.show .user-modal {
  transform: translateY(0) scale(1);
}

.user-modal::-webkit-scrollbar {
  width: 4px;
}

.user-modal::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

/* ============ 关闭按钮 ============ */
.user-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.user-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* ============ 弹窗头部 ============ */
.user-modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.user-modal-logo {
  font-size: 48px;
  margin-bottom: 12px;
}

.user-modal-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.user-modal-header p {
  font-size: 14px;
  color: #888;
  margin: 0;
}

.user-profile-meta {
  font-size: 12px !important;
  color: #aaa !important;
  margin-top: 4px !important;
}

/* ============ 用户头像（大） ============ */
.user-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============ 表单 ============ */
.user-form {
  margin-bottom: 16px;
}

.user-form .form-group {
  margin-bottom: 18px;
}

.user-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.user-form .form-group label i {
  width: 16px;
  color: #2d9b5c;
  margin-right: 4px;
}

.user-form .form-group input,
.user-form .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: #fafafa;
  color: #333;
  box-sizing: border-box;
}

.user-form .form-group input:focus,
.user-form .form-group textarea:focus {
  outline: none;
  border-color: #2d9b5c;
  box-shadow: 0 0 0 3px rgba(45, 155, 92, 0.1);
  background: #fff;
}

.user-form .form-group input::placeholder,
.user-form .form-group textarea::placeholder {
  color: #bbb;
}

/* ============ 按钮 ============ */
.user-btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2d9b5c 0%, #1a6b3a 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.user-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 155, 92, 0.35);
}

.user-btn-primary:active {
  transform: translateY(0);
}

.user-btn-secondary {
  width: 100%;
  padding: 12px;
  background: #f5f5f5;
  color: #444;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.user-btn-secondary:hover {
  background: #eee;
  border-color: #ccc;
}

.user-btn-danger {
  width: 100%;
  padding: 12px;
  background: #fff;
  color: #e74c3c;
  border: 1.5px solid #e74c3c;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.user-btn-danger:hover {
  background: #e74c3c;
  color: #fff;
}

/* ============ 提示信息 ============ */
.user-form-error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
}

.user-form-success {
  background: #f0fff4;
  border: 1px solid #b7eb8f;
  color: #237804;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
}

/* ============ 底部链接 ============ */
.user-modal-footer {
  text-align: center;
  font-size: 13px;
  color: #888;
  padding: 4px 0;
}

.user-modal-footer a {
  color: #2d9b5c;
  font-weight: 600;
  text-decoration: none;
}

.user-modal-footer a:hover {
  text-decoration: underline;
}

/* ============ 提示文字 ============ */
.user-form-tip {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  margin-top: 8px;
}

.user-form-tip i {
  margin-right: 4px;
}

/* ============ 个人中心区域 ============ */
.user-profile-section {
  padding: 20px 0;
  border-top: 1px solid #f0f0f0;
}

.user-profile-section:first-of-type {
  border-top: none;
}

.user-profile-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px;
}

.user-profile-section h3 i {
  color: #2d9b5c;
  margin-right: 6px;
}

.user-profile-actions {
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

/* ============ 顶栏用户按钮 ============ */
.user-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #555 !important;
  text-decoration: none !important;
  font-size: 13px;
  transition: color 0.2s;
}

.user-header-btn:hover {
  color: #2d9b5c !important;
}

.user-header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}

.user-header-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ Toast 提示 ============ */
.user-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 10002;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.user-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 响应式 ============ */
@media (max-width: 480px) {
  .user-modal {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }

  .user-modal-logo {
    font-size: 40px;
  }

  .user-modal-header h2 {
    font-size: 20px;
  }

  .user-avatar-large {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}

/* ============ 暗色模式 ============ */
@media (prefers-color-scheme: dark) {
  .user-modal {
    background: #1e2030;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }

  .user-modal-header h2 {
    color: #eee;
  }

  .user-form .form-group label {
    color: #ccc;
  }

  .user-form .form-group input,
  .user-form .form-group textarea {
    background: #2a2d3e;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ddd;
  }

  .user-form .form-group input::placeholder,
  .user-form .form-group textarea::placeholder {
    color: #666;
  }

  .user-btn-secondary {
    background: #2a2d3e;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ccc;
  }

  .user-modal-footer {
    color: #888;
  }

  .user-profile-section h3 {
    color: #ddd;
  }
}
