@charset "UTF-8";

/* 个人中心视觉统一层。 */
:root {
  --bg: #f6f8f7;
  --bg-secondary: #eef4f2;
  --card: #ffffff;
  --text: #171717;
  --text-secondary: #2f3d3a;
  --muted: #52615d;
  --primary: #0f766e;
  --primary-hover: #0d665f;
  --primary-light: #dff7f2;
  --primary-dark: #0a5953;
  --accent: #d4af37;
  --accent-light: #fff5cf;
  --border: #dce5e2;
  --danger: #dc2626;
  --success: #059669;
  --shadow-sm: 0 1px 2px rgba(23, 23, 23, 0.04);
  --shadow: 0 12px 32px rgba(23, 23, 23, 0.07);
  --shadow-lg: 0 24px 60px rgba(23, 23, 23, 0.11);
  --radius-sm: 8px;
  --radius: 8px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --profile-content-min-height: clamp(560px, calc(100vh - 160px), 720px);
}

html.dark {
  --bg: #111714;
  --bg-secondary: #18231f;
  --card: #151f1c;
  --text: #f4faf8;
  --text-secondary: #cfddd9;
  --muted: #97aaa4;
  --primary: #5eead4;
  --primary-hover: #2dd4bf;
  --primary-light: rgba(94, 234, 212, 0.14);
  --primary-dark: #14b8a6;
  --accent: #f2cf5b;
  --accent-light: rgba(242, 207, 91, 0.14);
  --border: rgba(224, 242, 238, 0.14);
}

body {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08) 0, rgba(15, 118, 110, 0) 360px),
    var(--bg);
}

.profile-container {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

.profile-container::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: -1;
  height: 300px;
  background:
    linear-gradient(90deg, rgba(17, 24, 22, 0.78), rgba(17, 24, 22, 0.3)),
    url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1400&q=80") center 42% / cover;
}

.profile-header {
  width: min(1180px, calc(100vw - 32px));
  margin: 18px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

html.dark .profile-header {
  background: rgba(21, 31, 28, 0.9);
  border-color: var(--border);
}

.profile-title {
  color: var(--text);
  letter-spacing: 0;
}

.profile-back-btn,
.theme-toggle-btn,
.profile-nav,
.profile-nav-item,
.profile-card,
.profile-input,
.profile-select,
.profile-field-readonly,
.profile-btn,
.profile-edit-btn,
.profile-toast,
.profile-modal-content,
.profile-modal-input,
.profile-avatar-upload-btn {
  border-radius: 8px;
}

.profile-back-btn {
  background: var(--card);
  border-color: var(--border);
  color: var(--text-secondary);
  cursor: pointer;
}

.profile-back-btn:hover,
.theme-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.theme-toggle-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.profile-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: stretch;
  max-width: 1180px;
  padding: 28px 0 42px;
}

.profile-sidebar {
  width: auto;
  min-width: 0;
}

.profile-nav {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: var(--profile-content-min-height);
  padding: 20px;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

html.dark .profile-nav {
  background: rgba(21, 31, 28, 0.92);
  border-color: var(--border);
}

.profile-nav-item {
  min-height: 44px;
  padding: 12px 16px;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  color: var(--text-secondary);
  font-weight: 650;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.profile-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.profile-nav-item:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.profile-nav-item.active {
  background: var(--text);
  color: #ffffff;
  box-shadow: none;
}

html.dark .profile-nav-item.active {
  background: var(--primary);
  color: #0b1614;
}

.profile-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: var(--profile-content-min-height);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

html.dark .profile-card {
  background: rgba(21, 31, 28, 0.92);
  border-color: var(--border);
}

.profile-card-body {
  flex: 1;
  padding: 30px;
}

.profile-card-footer {
  flex-shrink: 0;
  padding: 18px 30px;
  background: var(--bg-secondary);
}

.profile-form {
  gap: 0;
  margin-top: 18px;
}

.profile-avatar-section {
  align-items: stretch;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(212, 175, 55, 0.1)),
    var(--card);
}

.profile-avatar-large {
  border-radius: 8px;
  background: var(--text);
  box-shadow: none;
}

html.dark .profile-avatar-large {
  background: var(--primary);
  color: #0b1614;
}

.profile-avatar-edit-btn {
  border-radius: 8px;
  border-color: var(--border);
  background: var(--card);
}

.profile-avatar-edit-btn:hover,
.profile-edit-btn:hover,
.profile-modal-close:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.profile-avatar-name {
  color: var(--text);
  letter-spacing: 0;
}

.profile-avatar-role {
  border-radius: 8px;
  background: var(--accent-light);
  color: #7a5a00;
}

html.dark .profile-avatar-role {
  color: var(--accent);
}

.profile-settings-title {
  padding-left: 0;
  border-left: 0;
  color: var(--text);
  font-size: 16px;
}

.profile-field {
  gap: 12px;
  padding: 10px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-light, var(--border));
}

.profile-field:last-child {
  border-bottom: 0;
}

.profile-field-label {
  padding-top: 8px;
  color: var(--text-secondary);
  font-weight: 700;
}

.profile-input,
.profile-select,
.profile-modal-input {
  border-color: var(--border);
  background: var(--card);
  color: var(--text);
}

.profile-input:focus,
.profile-select:focus,
.profile-modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.profile-field-readonly {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.profile-field-hint,
.profile-avatar-upload-hint {
  color: var(--muted);
}

.profile-btn {
  min-height: 42px;
  box-shadow: none;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.profile-btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.profile-btn-primary:hover {
  background: var(--primary-hover);
  transform: none;
  box-shadow: none;
}

.profile-btn-secondary {
  border-color: var(--border);
  background: var(--card);
  color: var(--text-secondary);
}

.profile-btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.profile-edit-btn {
  border: 1px solid var(--border);
  background: var(--card);
}

.profile-label-tooltip::after {
  border-color: var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.profile-modal-overlay {
  background: rgba(17, 24, 22, 0.56);
}

.profile-modal-content {
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

.profile-modal-header,
.profile-modal-footer {
  background: var(--bg-secondary);
}

.profile-avatar-upload-btn {
  background: var(--primary);
}

.profile-avatar-upload-btn:hover {
  background: var(--primary-hover);
}

.profile-avatar-modal-content {
  max-width: 760px;
}

.profile-avatar-upload-modal-content {
  max-width: 420px;
}

.profile-avatar-modal-content .profile-modal-body {
  padding: 20px 24px;
}

.profile-avatar-modal-content .profile-modal-footer {
  padding: 16px 24px;
}

.profile-avatar-editor {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 220px;
  gap: 20px;
  align-items: start;
  justify-content: center;
}

.profile-avatar-editor.hidden {
  display: none;
}

.profile-avatar-editor-left {
  min-width: 0;
}

.profile-avatar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-avatar-tool-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.profile-avatar-tool-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.profile-avatar-tool-btn svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.profile-avatar-crop-frame {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-crop-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.profile-avatar-crop-canvas:active {
  cursor: grabbing;
}

.profile-avatar-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 33.333%, rgba(255, 255, 255, 0.38) 33.333%, rgba(255, 255, 255, 0.38) 33.666%, transparent 33.666%, transparent 66.333%, rgba(255, 255, 255, 0.38) 66.333%, rgba(255, 255, 255, 0.38) 66.666%, transparent 66.666%),
    linear-gradient(to bottom, transparent 33.333%, rgba(255, 255, 255, 0.38) 33.333%, rgba(255, 255, 255, 0.38) 33.666%, transparent 33.666%, transparent 66.333%, rgba(255, 255, 255, 0.38) 66.333%, rgba(255, 255, 255, 0.38) 66.666%, transparent 66.666%);
  box-shadow: inset 0 0 0 1px rgba(23, 23, 23, 0.18);
}

.profile-avatar-editor-right {
  min-width: 0;
}

.profile-avatar-preview-title {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
}

.profile-avatar-preview-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-avatar-preview-label {
  color: var(--muted);
  font-size: 13px;
}

.profile-avatar-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-preview-sm {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.profile-avatar-preview-lg {
  width: 150px;
  height: 150px;
  border-radius: 8px;
}

.profile-toast {
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

/* 导出历史列表样式。 */
.profile-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-history-header .profile-settings-title {
  margin-bottom: 8px;
}

.profile-history-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.profile-history-refresh-btn {
  flex-shrink: 0;
}

.profile-history-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.profile-history-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}

.profile-history-table th,
.profile-history-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}

.profile-history-table th {
  background: var(--bg-secondary);
  color: var(--text);
  font-weight: 750;
}

.profile-history-table tr:last-child td {
  border-bottom: 0;
}

.profile-report-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 750;
}

html.dark .profile-report-badge {
  color: var(--primary);
}

.profile-history-table .profile-history-empty {
  color: var(--muted);
  text-align: center;
}

@media screen and (orientation: portrait) and (max-width: 1180px) {
  .profile-main {
    grid-template-columns: 180px 1fr;
    gap: 16px;
    width: min(1120px, calc(100vw - 24px));
    padding: 24px 0 32px;
  }

  .profile-nav {
    position: static;
    min-height: auto;
    padding: 16px;
    gap: 4px;
  }

  .profile-nav-item {
    padding: 10px 12px;
    white-space: nowrap;
    font-size: 13px;
  }
}

@media screen and (max-width: 768px) {
  .profile-header {
    width: calc(100vw - 24px);
    margin-top: 12px;
  }

  .profile-main {
    grid-template-columns: 1fr;
    padding: 18px 12px 30px;
  }

  .profile-sidebar {
    width: 100%;
  }

  .profile-nav {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    min-height: auto;
    padding: 10px;
    top: auto;
    box-shadow: var(--shadow-sm);
  }

  .profile-nav-item {
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .profile-card-body,
  .profile-card-footer {
    padding: 20px;
  }

  .profile-avatar-section {
    padding: 18px;
  }

  .profile-avatar-editor {
    grid-template-columns: 1fr;
  }

  .profile-avatar-tools {
    flex-wrap: wrap;
  }

  .profile-history-header {
    flex-direction: column;
  }

  .profile-history-refresh-btn {
    width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .profile-header {
    align-items: stretch;
    gap: 12px;
  }

  .profile-header-left {
    justify-content: space-between;
    width: 100%;
  }

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

  .profile-email-row {
    flex-direction: column;
  }

  .profile-modal-footer {
    flex-direction: column-reverse;
  }

  .profile-modal-footer .profile-btn {
    width: 100%;
  }

  .profile-nav-item {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
