/* ============================================
   User Profile Page - 用户个人信息页面 - 滚动修复版
   简约现代单卡片设计
   ============================================ */

/* ========== 最优先：确保滚动正常 ========== */
.main-content:has(.profile-container) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: calc(100vh - 49px) !important;
  display: block !important;
  flex-direction: initial !important;
}

.main-content:has(.profile-container) > * {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* ========== 页面容器 ========== */
.profile-container {
  padding: 32px 24px 80px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  flex: none !important;
  padding-bottom: 80px;
}

/* ========== 页面标题 ========== */
.profile-header {
  text-align: left;
}

.profile-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.profile-subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

/* ========== 主卡片 ========== */
.profile-main-card {
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-main-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ========== 内容分区 ========== */
.profile-section {
  padding: 16px 24px;
}

.profile-section-divider {
  border-top: 1px solid var(--color-border-light);
}


.profile-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.profile-section-header-inline .profile-section-title {
  margin: 0;
}

/* ========== 分区底部按钮区域 ========== */
.profile-section-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 0;
}

/* ========== 密码表单区域 ========== */
.profile-password-form {
  margin-top: 0;
}

/* ========== 表单网格布局 ========== */
.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.profile-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

.profile-form-grid .form-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.profile-form-grid .form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0;
}

.profile-form-grid input[type="text"],
.profile-form-grid input[type="email"],
.profile-form-grid input[type="tel"],
.profile-form-grid input[type="password"],
.profile-form-grid textarea {
  margin: 0;
  padding: 7px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-input);
  resize: vertical;
}

.profile-form-grid textarea {
  min-height: 60px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-form-grid input[type="text"]:focus,
.profile-form-grid input[type="email"]:focus,
.profile-form-grid input[type="tel"]:focus,
.profile-form-grid input[type="password"]:focus,
.profile-form-grid textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-alpha-10);
  outline: none;
  background: var(--color-bg-card);
}

.profile-form-grid input.disabled {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.8;
  border-color: transparent;
}

.profile-form-grid .form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

.profile-form-grid .core-hours-info {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--color-bg-secondary);
  border-radius: 6px;
  line-height: 1.6;
}

.profile-form-grid .core-hours-card {
  grid-column: 1 / -1;
  background: var(--color-bg-secondary);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0;
}

.profile-form-grid .core-hours-card .form-label {
  margin-bottom: 8px;
}

.profile-form-grid .core-hours-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-form-grid .core-hours-row {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ========== 提示消息 ========== */
.profile-alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.4;
  font-weight: 400;
}

.profile-alert.danger {
  background: var(--color-danger-alpha-8);
  border: 1px solid var(--color-danger-alpha-15);
  color: var(--color-danger-dark);
}

.profile-alert.success {
  background: var(--color-success-alpha-8);
  border: 1px solid var(--color-success-alpha-15);
  color: var(--color-success-dark);
}

/* ========== 退出登录区域 ========== */
.profile-logout-section {
  background: var(--color-bg-secondary);
}

.logout-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logout-text h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.logout-text p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ========== 按钮样式优化 ========== */
.profile-section .btn {
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-section .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.profile-section .btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.profile-section .btn-ghost:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.profile-password-toggle-btn {
  border-color: var(--color-primary-alpha-40);
  color: var(--color-primary);
  background: var(--color-primary-alpha-8);
  transition: all 0.2s ease;
}

.profile-password-toggle-btn:hover {
  background: var(--color-primary-alpha-15);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.profile-logout-section .btn-danger {
  background: transparent;
  border: 1.5px solid var(--color-danger-alpha-30);
  color: var(--color-danger);
  font-weight: 500;
  box-shadow: none;
}

.profile-logout-section .btn-danger:not(:disabled):hover {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
  box-shadow: none;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  .profile-container {
    padding: 32px 20px;
    gap: 24px;
  }

  .profile-title {
    font-size: 26px;
  }

  .profile-subtitle {
    font-size: 14px;
  }

  .profile-section {
    padding: 24px 20px;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-section-header-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .logout-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 16px;
  }

  .logout-content .btn {
    width: 100%;
  }

  .profile-main-card {
    border-radius: 12px;
  }
}
