:root {
  color-scheme: light;
  --ink: #202027;
  --muted: #6f6d78;
  --line: #dedce5;
  --soft: #f6f4f8;
  --accent: #614181;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: #fcfbfd;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page-head,
.shared-rules,
main,
footer {
  width: min(1380px, calc(100% - 48px));
  margin-inline: auto;
}

.page-head { padding: 48px 0 28px; }
.brand { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 12px 0 8px; font-size: clamp(32px, 5vw, 58px); line-height: 1.08; letter-spacing: -.04em; }
.page-head p { margin: 0; color: var(--muted); font-size: 17px; }

.shared-rules {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 18px 34px;
  align-items: center;
  padding: 18px 20px;
  background: var(--soft);
  border-top: 2px solid var(--accent);
}

.shared-rules div { display: grid; gap: 4px; }
.shared-rules b { font-size: 13px; }
.shared-rules span,
.shared-rules p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.shared-rules p { margin: 0; justify-self: end; text-align: right; }

main { padding: 38px 0 56px; }
.list-head,
.profile-row {
  display: grid;
  grid-template-columns: 150px minmax(220px, .85fr) minmax(260px, 1fr) minmax(280px, 1.1fr);
  gap: 24px;
}

.list-head {
  padding: 0 14px 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h2 {
  margin: 38px 0 0;
  padding: 10px 14px;
  color: var(--accent);
  background: var(--soft);
  font-size: 14px;
  letter-spacing: .08em;
}

h2:first-child { margin-top: 0; }

.profile-row {
  align-items: center;
  min-height: 112px;
  padding: 18px 14px;
  border-bottom: 1px solid var(--line);
}

.account { display: flex; align-items: center; gap: 14px; }
.avatar-button {
  display: block;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: zoom-in;
}
.avatar-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.account img { display: block; width: 66px; height: 66px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.account div,
.identity { display: grid; gap: 4px; }
.account b { font-size: 13px; }
.account span { color: var(--accent); font-size: 12px; font-weight: 700; }

.identity strong { font-size: 17px; line-height: 1.25; }
.identity code { color: var(--accent); font-family: inherit; font-size: 13px; overflow-wrap: anywhere; }
.identity small { color: var(--muted); font-size: 11px; }

.bio { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.bio i {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.bio:last-child i { color: var(--accent); background: #eee8f4; }
.bio p { margin: 2px 0 0; font-size: 13px; line-height: 1.55; }

footer {
  padding: 20px 0 30px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.avatar-dialog {
  width: min(760px, calc(100% - 32px));
  padding: 18px;
  background: #fcfbfd;
  border: 0;
  border-radius: 10px;
}
.avatar-dialog::backdrop { background: rgba(20, 17, 25, .78); }
.avatar-dialog img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}
.avatar-dialog p { margin: 12px 42px 0 0; font-size: 14px; font-weight: 700; }
.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: rgba(32, 32, 39, .82);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}
.dialog-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@media (max-width: 900px) {
  .page-head,
  .shared-rules,
  main,
  footer { width: min(100% - 28px, 700px); }

  .shared-rules { grid-template-columns: 1fr; gap: 12px; }
  .shared-rules p { justify-self: start; text-align: left; }
  .list-head { display: none; }
  main { padding-top: 24px; }

  .profile-row {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px 18px;
    align-items: start;
  }

  .account { grid-row: 1 / span 3; align-items: flex-start; flex-direction: column; gap: 8px; }
  .identity { grid-column: 2; }
  .bio { grid-column: 2; }
}

@media (max-width: 520px) {
  .page-head { padding-top: 30px; }
  .page-head p { font-size: 15px; }
  .profile-row { grid-template-columns: 80px minmax(0, 1fr); padding-inline: 6px; }
  .account img { width: 60px; height: 60px; }
}
