/* ===== 认证系统样式 ===== */

/* 遮罩层 */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: authFadeIn 0.2s ease;
}

@keyframes authFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes authSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-in { animation: authSlideIn 0.25s ease; }
.auth-modal-out { animation: authSlideIn 0.25s ease reverse; }

/* 弹窗主体 */
.auth-modal {
  background: #fff;
  border-radius: 16px;
  width: 420px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  position: relative;
}

.auth-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: #F1F5F9;
  color: #64748B;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.auth-close:hover {
  background: #E2E8F0;
  color: #1E293B;
}

/* 弹窗内容 */
.auth-modal-body {
  padding: 40px 36px 32px;
}

.auth-logo {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #0F52BA;
  margin-bottom: 24px;
}

/* Tab切换 */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  position: relative;
}
.auth-tab:hover { color: #0F52BA; }
.auth-tab.active {
  color: #0F52BA;
  font-weight: 600;
}
.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: #0F52BA;
  border-radius: 2px;
}

.auth-tab-content { display: none; }

/* 输入框 */
.auth-field {
  position: relative;
  margin-bottom: 16px;
}
.auth-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  z-index: 1;
  pointer-events: none;
}
.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 14px;
  color: #1E293B;
  background: #F8FAFC;
  transition: all 0.2s;
  font-family: inherit;
  outline: none;
}
.auth-input:focus {
  border-color: #0F52BA;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,82,186,0.1);
}
.auth-input::placeholder { color: #94A3B8; }

/* 验证码输入行 */
.auth-code-field { display: flex; gap: 10px; }
.auth-code-field .auth-input { flex: 1; }
.auth-code-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid #0F52BA;
  border-radius: 10px;
  background: #fff;
  color: #0F52BA;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.auth-code-btn:hover { background: #E3F2FD; }
.auth-code-btn:disabled {
  border-color: #CBD5E1;
  color: #94A3B8;
  background: #F1F5F9;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 密码可见切换 */
.auth-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  z-index: 1;
}

/* 选项行 */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748B;
  cursor: pointer;
}
.auth-checkbox input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #0F52BA;
}
.auth-link-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: #0F52BA;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.auth-link-btn:hover { text-decoration: underline; }

/* 主按钮 */
.auth-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0F52BA, #1565C0);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.auth-btn:hover {
  background: linear-gradient(135deg, #0B3D91, #0F52BA);
  box-shadow: 0 4px 16px rgba(15,82,186,0.3);
  transform: translateY(-1px);
}
.auth-btn:disabled {
  background: #94A3B8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 错误提示 */
.auth-error {
  font-size: 12px;
  color: #EF4444;
  margin-top: 4px;
  min-height: 18px;
}
.auth-global {
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

/* ===== 导航栏用户状态 ===== */
.auth-user-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.auth-user-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.auth-user-trigger:hover { background: #E3F2FD; }
.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.auth-avatar-text {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0F52BA, #1565C0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.auth-nickname {
  font-size: 13px;
  font-weight: 500;
  color: #1E293B;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-arrow {
  font-size: 10px;
  color: #94A3B8;
  transition: transform 0.2s;
}
.auth-user-dropdown.open .auth-arrow { transform: rotate(180deg); }

.auth-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  min-width: 180px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s;
  z-index: 100;
}
.auth-user-dropdown.open .auth-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.auth-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #1E293B;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  box-sizing: border-box;
}
.auth-dropdown-item:hover { background: #F1F5F9; }
.auth-dropdown-divider {
  height: 1px;
  background: #E2E8F0;
  margin: 4px 8px;
}
.auth-dropdown-logout { color: #EF4444 !important; }
.auth-dropdown-logout:hover { background: #FEF2F2 !important; }

/* ===== 用户中心页面 ===== */
.user-center {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  margin-top: 24px;
}

.user-sidebar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 24px;
  text-align: center;
  height: fit-content;
}
.user-sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-sidebar-avatar .auth-avatar-text {
  width: 80px;
  height: 80px;
  font-size: 32px;
}
.user-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-sidebar-name {
  font-size: 18px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 4px;
}
.user-sidebar-phone {
  font-size: 13px;
  color: #94A3B8;
  margin-bottom: 16px;
}
.user-sidebar-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
.user-sidebar-stat {
  text-align: center;
}
.user-sidebar-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #0F52BA;
}
.user-sidebar-stat-label {
  font-size: 12px;
  color: #94A3B8;
}
.user-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-sidebar-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #64748B;
  text-decoration: none;
  transition: all 0.15s;
  text-align: left;
}
.user-sidebar-nav a:hover,
.user-sidebar-nav a.active {
  background: #E3F2FD;
  color: #0F52BA;
  font-weight: 500;
}

/* 右侧内容 */
.user-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 28px;
  min-height: 400px;
}
.user-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #E3F2FD;
}

/* 用户中心表单 */
.uc-form { max-width: 480px; }
.uc-form .auth-field { margin-bottom: 20px; }
.uc-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  margin-bottom: 6px;
}
.uc-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 14px;
  color: #1E293B;
  background: #F8FAFC;
  transition: all 0.2s;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.uc-input:focus {
  border-color: #0F52BA;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,82,186,0.1);
}
.uc-input:disabled {
  background: #F1F5F9;
  color: #94A3B8;
  cursor: not-allowed;
}
.uc-btn {
  height: 42px;
  padding: 0 28px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0F52BA, #1565C0);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.uc-btn:hover {
  background: linear-gradient(135deg, #0B3D91, #0F52BA);
  box-shadow: 0 4px 16px rgba(15,82,186,0.3);
}
.uc-btn-secondary {
  background: #F1F5F9;
  color: #64748B;
}
.uc-btn-secondary:hover { background: #E2E8F0; box-shadow: none; }
.uc-success {
  color: #10B981;
  font-size: 13px;
  margin-top: 8px;
}
.uc-error {
  color: #EF4444;
  font-size: 13px;
  margin-top: 8px;
}

/* 收藏/发布列表 */
.uc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #F1F5F9;
}
.uc-list-item:last-child { border-bottom: none; }
.uc-list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #1E293B;
}
.uc-list-item-meta {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 2px;
}
.uc-list-item-action {
  font-size: 12px;
  color: #EF4444;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

/* 响应式 */
@media (max-width: 768px) {
  .user-center { grid-template-columns: 1fr; }
  .user-sidebar { text-align: center; }
  .user-sidebar-nav { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .auth-modal-body { padding: 28px 20px 24px; }
  .auth-tabs { flex-wrap: wrap; }
  .auth-tab { padding: 8px 6px; font-size: 13px; }
}
