:root {
  color-scheme: light;
  --ink: #111111;
  --muted: rgba(29, 29, 31, 0.54);
  --line: rgba(0, 0, 0, 0.08);
  --soft: #f6f7f8;
  --danger: #b42318;
  --card-height: min(720px, calc(100svh - 56px));
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 22% 16%, rgba(199, 226, 246, 0.58), transparent 30%),
    radial-gradient(circle at 76% 6%, rgba(245, 246, 248, 0.92), transparent 28%),
    #ffffff;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.close-link {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 3;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(29, 29, 31, 0.72);
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  backdrop-filter: blur(18px) saturate(160%);
}

.account-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.account-card {
  width: min(100%, 980px);
  height: var(--card-height);
  min-height: 620px;
  display: grid;
  grid-template-columns: 260px 1fr;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.10);
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(165%);
}

.account-sidebar {
  min-height: 0;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  overflow: auto;
}

.account-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  font-size: 18px;
  font-weight: 780;
  padding: 0;
  border: 0;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}
.account-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.account-avatar:hover { transform: translateY(-1px); }
.sidebar-avatar-row { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar-edit {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.76);
  color: rgba(29, 29, 31, 0.7);
  font-size: 12px;
  font-weight: 720;
}
.sidebar-avatar-edit:hover { border-color: rgba(29, 29, 31, 0.18); background: #fff; }

.avatar-profile {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.avatar-profile > div:first-child strong { font-size: 14px; }
.avatar-profile > div:first-child p { margin: 5px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.avatar-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.avatar-choice {
  position: relative;
  aspect-ratio: 1;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}
.avatar-choice img { width: 100%; height: 100%; display: block; border-radius: 11px; }
.avatar-choice:hover { border-color: rgba(22, 135, 111, 0.4); }
.avatar-choice.is-selected { border-color: #16876f; box-shadow: 0 0 0 3px rgba(22, 135, 111, 0.1); }
.avatar-choice.is-selected::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #16876f;
  color: #fff;
  font-size: 10px;
}

@media (max-width: 760px) {
  .avatar-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.profile-heading .overline { margin-top: 0; }
.profile-heading h1 { margin-bottom: 0; }
.profile-avatar-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.profile-avatar-control img {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.avatar-edit-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.8);
  color: rgba(29, 29, 31, 0.74);
  font-size: 12px;
  font-weight: 720;
}
.avatar-edit-button:hover { border-color: rgba(29, 29, 31, 0.18); background: #fff; }

.avatar-settings-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 32px 100px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(28px) saturate(165%);
}
.avatar-settings-dialog::backdrop { background: rgba(29, 29, 31, 0.25); backdrop-filter: blur(8px); }
.avatar-settings-card { padding: 28px; }
.avatar-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.avatar-settings-heading .overline { margin-top: 0; }
.avatar-settings-heading h2 { margin: 0; font-size: 26px; letter-spacing: -0.035em; }
.avatar-settings-heading span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.dialog-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 20px;
}
.avatar-settings-dialog .status { min-height: 18px; margin: 16px 0 0; }

@media (max-width: 560px) {
  .profile-heading { align-items: center; }
  .profile-avatar-control img { width: 54px; height: 54px; border-radius: 17px; }
  .avatar-settings-card { padding: 20px; }
  .avatar-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.account-email {
  margin: 14px 0 24px;
  color: rgba(29, 29, 31, 0.72);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}

.account-tabs {
  display: grid;
  gap: 8px;
}

.tab-button,
.tab-link {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(29, 29, 31, 0.60);
  text-align: left;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
  display: grid;
  align-items: center;
}

.tab-button.is-active,
.tab-button:hover,
.tab-link.is-active,
.tab-link:hover {
  background: #111111;
  color: #ffffff;
}

.account-content {
  min-height: 0;
  padding: 48px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.account-panel {
  display: none;
  min-height: 100%;
}

.account-panel.is-active {
  display: block;
}

.overline {
  margin: 0 0 10px;
  color: rgba(29, 29, 31, 0.42);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.info-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-grid div,
.metric-grid div {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
}

.info-grid span,
.metric-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.info-grid strong,
.metric-grid strong {
  font-size: 18px;
  line-height: 1.2;
  word-break: break-word;
}

.summary-copy {
  max-width: 620px;
  margin: 0 0 18px;
  color: rgba(29, 29, 31, 0.64);
  font-size: 15px;
  line-height: 1.7;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.security-options {
  width: min(100%, 560px);
  display: grid;
  gap: 12px;
}

.security-option {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  text-decoration: none;
}

.security-option:hover {
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}

.security-option span {
  display: grid;
  gap: 6px;
}

.security-option strong {
  font-size: 17px;
}

.security-option small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.security-option b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

.account-form {
  width: min(100%, 430px);
  display: grid;
  gap: 12px;
}

.account-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-form input {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  padding: 0 16px;
  outline: none;
}

.account-form input:focus {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.password-policy {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.primary-action,
.secondary-action,
.danger-action {
  display: inline-grid;
  min-width: 150px;
  height: 46px;
  place-items: center;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
}

.primary-action {
  border: 0;
  background: #111111;
  color: #ffffff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
}

.danger-action {
  border: 0;
  background: var(--danger);
  color: #ffffff;
}

.status {
  min-height: 18px;
  margin: 12px 0 0;
  color: rgba(29, 29, 31, 0.58);
  font-size: 13px;
  line-height: 1.45;
}

.status.is-error {
  color: var(--danger);
}

.account-card--form {
  width: min(100%, 860px);
  grid-template-columns: 250px 1fr;
}

.account-content--form {
  display: grid;
  align-content: center;
}

@media (max-width: 760px) {
  .account-shell {
    padding: 16px;
    place-items: start center;
  }

  .account-card {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    border-radius: 28px;
  }

  .account-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .account-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-button,
  .tab-link {
    text-align: center;
    justify-content: center;
  }

  .account-content {
    padding: 28px 22px;
    overflow: visible;
  }

  .info-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .security-option {
    border-radius: 20px;
  }
}
