/* ===================================
   登录/注册模态框 + 导航栏登录按钮
   =================================== */

/* 导航栏登录按钮 */
.nav-login-btn {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-login-btn:hover {
  border-color: var(--text-muted);
  background: var(--bg-card);
}

/* ====== 遮罩层 ====== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ====== 面板 ====== */
.auth-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s ease, background-color var(--transition-normal);
}

.auth-overlay.open .auth-panel {
  transform: translateY(0) scale(1);
}

/* 关闭按钮 */
.auth-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.auth-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* ====== Tabs ====== */
.auth-header {
  margin-bottom: 1.5rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab:hover {
  color: var(--text-secondary);
}

.auth-tab.active {
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ====== 表单 ====== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.auth-field label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-normal);
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: #3fb8c4;
}

.auth-field input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.auth-field select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* 提交按钮 */
.auth-submit {
  width: 100%;
  padding: 0.65rem;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: #3fb8c4;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 0.25rem;
}

.auth-submit:hover {
  background: #35a3ae;
}

.auth-submit:active {
  transform: scale(0.99);
}

.auth-submit--register {
  background: #e8734a;
}

.auth-submit--register:hover {
  background: #d4653f;
}

/* 底部链接 */
.auth-footer-link {
  text-align: center;
  margin-top: 0.25rem;
}

.auth-footer-link a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-footer-link a:hover {
  color: var(--text-primary);
}
