.profile-page {
  background:
    radial-gradient(circle at 8% 8%, rgba(20, 184, 166, 0.1), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(124, 58, 237, 0.1), transparent 26%),
    linear-gradient(135deg, #f3fcfb 0%, #f8f7fc 48%, #fff5f8 100%);
}

.profile-page .account-link.active {
  color: var(--primary);
  background: #eff6ff;
}

.profile-page-title {
  display: grid;
  justify-items: center;
  text-align: center;
}

.page-eyebrow,
.section-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-eyebrow {
  color: #64748b;
}

.profile-page-title h1 {
  margin-top: 7px;
  text-wrap: balance;
}

.profile-page-title p {
  max-width: 620px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0 80px;
}

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

.profile-card,
.settings-card,
.stat-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 227, 238, 0.92);
  box-shadow: 0 14px 42px rgba(36, 52, 76, 0.07);
  backdrop-filter: blur(12px);
}

.profile-card {
  position: sticky;
  top: 20px;
  overflow: hidden;
  border-radius: 24px;
}

.profile-cover {
  height: 92px;
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 255, 255, 0.42) 0 4px, transparent 5px),
    radial-gradient(circle at 78% 62%, rgba(255, 255, 255, 0.26) 0 7px, transparent 8px),
    linear-gradient(125deg, #2563eb, #7067db 52%, #14b8a6);
}

.profile-identity {
  padding: 0 24px;
  text-align: center;
}

.avatar-picker {
  position: relative;
  display: block;
  width: 108px;
  height: 108px;
  margin: -54px auto 14px;
  background: #e8eef8;
  border: 5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(24, 43, 74, 0.2);
}

.avatar-preview-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: zoom-in;
}

.avatar-preview-trigger:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 3px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-edit-icon {
  position: absolute;
  right: -2px;
  bottom: 3px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.avatar-edit-icon:hover,
.avatar-edit-icon:focus-visible {
  background: var(--primary-dark);
  outline: none;
  transform: scale(1.08);
}

.avatar-preview-trigger:hover .profile-avatar {
  filter: brightness(0.92);
  transform: scale(1.035);
}

.profile-avatar {
  transition: filter 0.2s, transform 0.25s;
}

.profile-identity h2 {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.3;
}

.profile-role {
  display: inline-flex;
  padding: 3px 10px;
  color: #5b4cce;
  background: #f1efff;
  border: 1px solid #e0dcff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.profile-bio {
  display: -webkit-box;
  min-height: 44px;
  margin: 14px 0 20px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-meta {
  display: grid;
  gap: 0;
  margin: 0 20px;
  padding: 14px 0;
  border-block: 1px solid #e9eef5;
}

.profile-meta div {
  display: grid;
  min-width: 0;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 4px;
  align-items: baseline;
}

.profile-meta dt {
  color: #94a3b8;
  font-size: 12px;
}

.profile-meta dd {
  margin: 0;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-actions {
  display: grid;
  gap: 6px;
  padding: 14px 18px;
}

.profile-action-link {
  display: grid;
  min-height: 44px;
  padding: 5px 8px;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.profile-action-link[hidden] {
  display: none;
}

.profile-action-link:hover,
.profile-action-link:focus-visible {
  color: var(--primary);
  background: #f4f7fc;
  outline: none;
  transform: translateX(2px);
}

.profile-action-link b {
  color: #a8b4c4;
  font-size: 16px;
}

.action-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  font-size: 14px;
}

.action-icon-blue { color: #2563eb; background: #eaf2ff; }
.action-icon-violet { color: #7c3aed; background: #f2ebff; }
.action-icon-amber { color: #b45309; background: #fff3dd; }

.logout-button {
  display: flex;
  width: calc(100% - 36px);
  min-height: 42px;
  margin: 0 18px 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c24141;
  background: #fff7f7;
  border: 1px solid #f5d1d1;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.logout-button:hover,
.logout-button:focus-visible {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
  outline: none;
}

.profile-content {
  display: grid;
  min-width: 0;
  gap: 22px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 108px;
  padding: 20px;
  overflow: hidden;
  align-items: center;
  gap: 15px;
  border-radius: 18px;
}

.stat-card::after {
  position: absolute;
  right: -18px;
  bottom: -28px;
  width: 82px;
  height: 82px;
  content: "";
  border: 16px solid currentColor;
  border-radius: 50%;
  opacity: 0.035;
}

.stat-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 13px;
  font-size: 19px;
  font-weight: 800;
}

.stat-card-blue .stat-icon { color: #2563eb; background: #eaf2ff; }
.stat-card-violet .stat-icon { color: #7c3aed; background: #f2ebff; }
.stat-card-teal .stat-icon { color: #0f9f88; background: #e4f8f4; }

.stat-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.settings-card {
  overflow: hidden;
  border-radius: 22px;
}

.card-heading {
  display: grid;
  padding: 24px 26px 20px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #e9eef5;
}

.heading-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
}

.heading-icon-blue { color: #2563eb; background: #eaf2ff; }
.heading-icon-violet { color: #7c3aed; background: #f2ebff; }
.heading-icon-teal { color: #0f8f87; background: #e2f8f5; }
.heading-icon-amber { color: #b45309; background: #fff3dd; }

/* 网站主题选择器 -------------------------------------------------------- */
.appearance-card {
  overflow: hidden;
}

.appearance-card .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.theme-selector {
  display: grid;
  margin: 24px 26px 0;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  border: 0;
}

.theme-option {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 12px;
  gap: 12px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid #dfe7f1;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.theme-option:hover {
  border-color: #a9c8f8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.09);
  transform: translateY(-2px);
}

.theme-option:has(input:focus-visible) {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.theme-option:has(input:checked) {
  background: #f3f8ff;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 10px 25px rgba(37, 99, 235, 0.1);
}

.theme-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-preview {
  position: relative;
  display: block;
  height: 82px;
  overflow: hidden;
  background: #edf2f8;
  border: 1px solid rgba(131, 149, 174, 0.24);
  border-radius: 11px;
}

.theme-preview::before {
  position: absolute;
  inset: 0 0 auto;
  height: 17px;
  content: "";
  background: #fff;
  border-bottom: 1px solid rgba(131, 149, 174, 0.2);
}

.theme-preview i,
.theme-preview b,
.theme-preview em {
  position: absolute;
  display: block;
  content: "";
  border-radius: 5px;
}

.theme-preview i {
  top: 25px;
  left: 9px;
  width: 28%;
  height: 46px;
  background: #fff;
}

.theme-preview b {
  top: 25px;
  right: 9px;
  width: 57%;
  height: 20px;
  background: #fff;
}

.theme-preview em {
  right: 9px;
  bottom: 11px;
  width: 57%;
  height: 17px;
  background: #dbeafe;
}

.theme-preview-dark {
  background: #0f1727;
}

.theme-preview-dark::before,
.theme-preview-dark i,
.theme-preview-dark b {
  background: #26344a;
  border-color: #3c4a5f;
}

.theme-preview-dark em {
  background: #315b92;
}

.theme-preview-auto {
  background: linear-gradient(90deg, #edf2f8 0 50%, #0f1727 50%);
}

.theme-preview-auto::before {
  background: linear-gradient(90deg, #fff 0 50%, #26344a 50%);
}

.theme-preview-auto i {
  background: linear-gradient(90deg, #fff 0 50%, #26344a 50%);
}

.theme-preview-auto b {
  background: linear-gradient(90deg, #fff 0 35%, #26344a 35%);
}

.theme-preview-auto em {
  background: linear-gradient(90deg, #dbeafe 0 35%, #315b92 35%);
}

.theme-option-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.theme-option-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.theme-option-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-check {
  position: absolute;
  right: 10px;
  bottom: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: transparent;
  background: transparent;
  border: 1px solid #c7d2df;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.theme-option input:checked ~ .theme-check {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.theme-preference-note {
  margin: 15px 26px 24px;
  color: var(--muted);
  font-size: 12px;
}

.card-heading h2 {
  margin: 1px 0 1px;
  font-size: 20px;
  line-height: 1.3;
}

.card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-form {
  display: grid;
  gap: 18px;
  padding: 25px 26px 26px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-form .field label {
  color: #334155;
  font-size: 13px;
}

.settings-form .input,
.settings-form .textarea {
  background: #fbfcfe;
  border-color: #d9e1ec;
}

.settings-form .input:hover,
.settings-form .textarea:hover {
  border-color: #b7c4d6;
}

.settings-form .textarea {
  min-height: 104px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-label-row > span {
  color: #94a3b8;
  font-size: 11px;
}

.field-label-row b {
  color: #64748b;
}

.avatar-upload-field {
  display: grid;
  min-height: 84px;
  padding: 14px 16px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  background: linear-gradient(135deg, #f7faff, #faf9ff);
  border: 1px dashed #c9d5e6;
  border-radius: 14px;
}

.upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #2563eb;
  background: #e9f2ff;
  border-radius: 12px;
}

.upload-copy {
  display: grid;
  min-width: 0;
}

.upload-copy strong {
  font-size: 13px;
}

.upload-copy span {
  overflow: hidden;
  color: #8290a4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-copy span:last-child:not(:only-child) {
  color: #5a6b82;
}

.upload-button {
  display: inline-flex;
  min-height: 36px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: #fff;
  border: 1px solid #bcd2f3;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: color 0.2s, background 0.2s;
}

.upload-button:hover {
  color: #fff;
  background: var(--primary);
}

.settings-form .form-error {
  min-height: 0;
}

.settings-form .form-error:not(:empty) {
  padding: 9px 11px;
  background: #fff7f7;
  border: 1px solid #fecaca;
  border-radius: 10px;
}

.form-footer {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.form-footer > span {
  color: #94a3b8;
  font-size: 11px;
}

.form-footer > span b {
  color: #64748b;
  font-weight: 600;
}

.form-footer .button {
  min-width: 138px;
}

/* 个人悬浮快捷按钮设置 -------------------------------------------------- */
.shortcut-limit {
  min-width: 54px;
  padding: 6px 10px;
  color: #7c5b16;
  background: #fff8e7;
  border: 1px solid #f3dfaf;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.shortcut-limit b {
  color: #b45309;
  font-size: 14px;
}

.shortcut-editor {
  display: grid;
  gap: 10px;
}

.shortcut-editor-row {
  display: grid;
  min-width: 0;
  padding: 12px;
  grid-template-columns: 72px 112px minmax(110px, 0.72fr) minmax(180px, 1.45fr) 34px;
  gap: 10px;
  align-items: end;
  background: #fbfcfe;
  border: 1px solid #e0e7f0;
  border-radius: 14px;
}

.shortcut-order-controls {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 4px;
  align-self: stretch;
}

.shortcut-number {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #7655dc);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

.shortcut-order-controls button,
.shortcut-remove {
  display: grid;
  padding: 0;
  place-items: center;
  color: #64748b;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 7px;
  line-height: 1;
}

.shortcut-order-controls button:hover:not(:disabled),
.shortcut-order-controls button:focus-visible,
.shortcut-remove:hover,
.shortcut-remove:focus-visible {
  color: var(--primary);
  border-color: #9cbdf2;
  outline: none;
}

.shortcut-order-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.shortcut-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.shortcut-field > span,
.shortcut-position-field > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.shortcut-field .input {
  width: 100%;
  min-width: 0;
}

.shortcut-remove {
  width: 34px;
  height: 40px;
  color: #b34a55;
  font-size: 20px;
}

.shortcut-remove:hover,
.shortcut-remove:focus-visible {
  color: #fff;
  background: #dc4254;
  border-color: #dc4254;
}

.shortcut-empty {
  display: grid;
  min-height: 104px;
  padding: 20px;
  place-items: center;
  align-content: center;
  color: #758397;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  text-align: center;
}

.shortcut-empty[hidden] {
  display: none;
}

.shortcut-empty strong {
  color: #475569;
  font-size: 14px;
}

.shortcut-empty span,
.shortcut-help {
  color: #8290a4;
  font-size: 11px;
}

.shortcut-editor-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.shortcut-add:disabled {
  cursor: not-allowed;
}

.shortcut-position-field {
  display: grid;
  min-width: 220px;
  gap: 5px;
}

.shortcut-visibility-toggle {
  display: grid;
  min-height: 66px;
  padding: 12px 14px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e0e7f0;
  border-radius: 13px;
  cursor: pointer;
}

.shortcut-visibility-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.shortcut-switch {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s;
}

.shortcut-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s;
}

.shortcut-visibility-toggle input:checked + .shortcut-switch {
  background: var(--primary);
}

.shortcut-visibility-toggle input:checked + .shortcut-switch i {
  transform: translateX(18px);
}

.shortcut-visibility-toggle input:focus-visible + .shortcut-switch {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 3px;
}

.shortcut-visibility-copy {
  display: grid;
}

.shortcut-visibility-copy strong {
  color: #334155;
  font-size: 13px;
}

.shortcut-visibility-copy small {
  color: #8290a4;
  font-size: 11px;
}

.shortcut-help {
  margin: -6px 0 0;
}

.button:disabled,
.upload-button[aria-disabled="true"] {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.security-card {
  border-color: #e2dcf5;
}

.security-badge {
  display: inline-flex;
  padding: 6px 10px;
  align-items: center;
  gap: 6px;
  color: #15803d;
  background: #effbf3;
  border: 1px solid #ceefd8;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.security-badge i {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.13);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap .input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #8795a8;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transform: translateY(-50%);
}

.password-toggle::before {
  display: block;
  width: 16px;
  height: 10px;
  margin: auto;
  content: "";
  border: 1.7px solid currentColor;
  border-radius: 50% / 60%;
}

.password-toggle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.password-toggle[aria-pressed="true"]::after {
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(-42deg);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--primary);
  background: #eff6ff;
  outline: none;
}

.password-strength {
  display: grid;
  gap: 7px;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.strength-bars i {
  height: 4px;
  background: #e4e9f1;
  border-radius: 999px;
  transition: background 0.2s;
}

.password-strength span {
  color: #7b8a9e;
  font-size: 11px;
}

.password-strength[data-level="1"] .strength-bars i:nth-child(-n+1) { background: #ef4444; }
.password-strength[data-level="2"] .strength-bars i:nth-child(-n+2) { background: #f59e0b; }
.password-strength[data-level="3"] .strength-bars i:nth-child(-n+3) { background: #3b82f6; }
.password-strength[data-level="4"] .strength-bars i { background: #10b981; }
.password-strength[data-level="1"] span { color: #dc2626; }
.password-strength[data-level="2"] span { color: #b45309; }
.password-strength[data-level="3"] span { color: #2563eb; }
.password-strength[data-level="4"] span { color: #059669; }

.security-footer {
  padding-top: 3px;
}

.security-submit {
  background: #6d4ed9;
  border-color: #6d4ed9;
}

.security-submit:hover,
.security-submit:focus-visible {
  background: #5b3fc4;
  border-color: #5b3fc4;
  box-shadow: 0 8px 22px rgba(109, 78, 217, 0.24);
}

.avatar-preview-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.34);
  transform: translate(-50%, -50%);
}

.avatar-preview-dialog[hidden],
.avatar-preview-dialog:not([open]) {
  display: none;
}

.avatar-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(10px);
}

.avatar-preview-dialog[open] {
  animation: avatar-preview-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.avatar-preview-heading {
  display: flex;
  padding: 20px 22px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e8edf5;
}

.avatar-preview-heading h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.avatar-preview-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: #64748b;
  background: #f7f9fc;
  border: 1px solid #e1e7ef;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.avatar-preview-close:hover,
.avatar-preview-close:focus-visible {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  outline: none;
  transform: rotate(5deg);
}

.avatar-preview-stage {
  display: grid;
  min-height: 380px;
  padding: 28px;
  place-items: center;
  background:
    linear-gradient(45deg, #edf1f6 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(-45deg, #edf1f6 25%, transparent 25%) 0 12px / 24px 24px,
    linear-gradient(45deg, transparent 75%, #edf1f6 75%) 12px -12px / 24px 24px,
    linear-gradient(-45deg, transparent 75%, #edf1f6 75%) -12px 0 / 24px 24px,
    #f8fafc;
}

.avatar-preview-stage img {
  display: block;
  width: min(340px, 100%);
  max-height: 420px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.2);
}

.avatar-preview-dialog > p {
  margin: 0;
  padding: 13px 20px 15px;
  color: #8290a4;
  font-size: 11px;
  text-align: center;
}

@keyframes avatar-preview-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px)) scale(0.97);
  }
}

@media (max-width: 980px) {
  .profile-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .stat-card {
    min-height: 96px;
    padding: 15px;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .shortcut-editor-row {
    grid-template-columns: 68px 105px minmax(120px, 1fr) 34px;
  }

  .shortcut-url-field {
    grid-column: 2 / 4;
  }

  .shortcut-remove {
    grid-column: 4;
    grid-row: 1 / 3;
    align-self: center;
  }
}

@media (max-width: 780px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-card {
    position: static;
  }

  .profile-cover {
    height: 112px;
  }

  .profile-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-meta div {
    grid-template-columns: 1fr;
    gap: 1px;
    text-align: center;
  }

  .profile-meta dd {
    text-align: center;
  }

  .profile-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .profile-page .page-header {
    padding-bottom: 18px;
  }

  .profile-page-title {
    margin-top: 34px;
  }

  .profile-layout {
    padding-top: 12px;
  }

  .profile-stats {
    gap: 8px;
  }

  .stat-card {
    min-height: 92px;
    padding: 13px 8px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    text-align: center;
  }

  .stat-icon {
    display: none;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .card-heading {
    padding: 20px;
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .heading-icon {
    width: 40px;
    height: 40px;
  }

  .security-badge {
    display: none;
  }

  .shortcut-limit {
    display: none;
  }

  .settings-form {
    padding: 21px 20px;
  }

  .shortcut-editor-row {
    grid-template-columns: 62px minmax(0, 1fr) 34px;
  }

  .shortcut-order-controls {
    grid-row: 1 / 3;
  }

  .shortcut-icon-field {
    grid-column: 2;
  }

  .shortcut-field:not(.shortcut-icon-field),
  .shortcut-url-field {
    grid-column: 1 / -1;
  }

  .shortcut-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .shortcut-editor-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .shortcut-position-field {
    min-width: 0;
  }

  .theme-selector {
    margin: 20px;
    grid-template-columns: 1fr;
  }

  .theme-option {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
  }

  .theme-preview {
    height: 72px;
  }

  .theme-option-copy small {
    white-space: normal;
  }

  .theme-preference-note {
    margin: -3px 20px 20px;
  }

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

  .avatar-upload-field {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .upload-icon {
    width: 38px;
    height: 38px;
  }

  .upload-button {
    grid-column: 1 / -1;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .form-footer .button {
    width: 100%;
  }

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

  .avatar-preview-stage {
    min-height: 300px;
    padding: 20px;
  }
}
