/* ======= Header 前台登录态 ======= */
.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.auth-user {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.auth-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
}
.auth-user.open .auth-dropdown {
  display: flex;
}
.auth-dropdown a,
.auth-dropdown button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.auth-dropdown a:hover,
.auth-dropdown button:hover {
  background: var(--bg-hover);
  color: var(--brand);
}

/* ======= 登录/注册页 ======= */
.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
}
.auth-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.auth-card .auth-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.auth-field input::placeholder {
  color: var(--text-muted);
}
.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
}
.auth-submit:hover { opacity: 0.92; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-error {
  padding: 10px 12px;
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  display: none;
}
.auth-success {
  padding: 10px 12px;
  font-size: 13px;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  display: none;
}
.auth-footer {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}
.auth-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* ======= 个人中心 ======= */
.profile-page {
  padding: 40px 20px;
  max-width: 960px;
  margin: 0 auto;
}
.profile-header {
  margin-bottom: 28px;
}
.profile-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}
.profile-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.profile-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.profile-tab:hover { color: var(--text-primary); }
.profile-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.profile-panel { display: none; }
.profile-panel.active { display: block; }
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.profile-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.profile-field:last-child { margin-bottom: 0; }
.profile-field label {
  width: 90px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.profile-field input,
.profile-field textarea {
  flex: 1;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
}
.profile-field input:read-only {
  background: var(--bg-muted);
  color: var(--text-muted);
}
.profile-save-btn {
  margin-top: 20px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.profile-save-btn:hover { opacity: 0.92; }

/* 暗黑模式适配 */
[data-theme="dark"] .auth-error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
[data-theme="dark"] .auth-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}
