:root {
  color-scheme: light;
  --bg-a: #f7f7f9;
  --bg-b: #e9edf5;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #16181d;
  --muted: #646b76;
  --line: rgba(20, 26, 38, 0.12);
  --accent: #0a84ff;
  --accent-strong: #0066d8;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --shadow: 0 30px 80px rgba(57, 66, 86, 0.2);
  --button-text: #ffffff;
}

body[data-theme="titan-dark"] {
  color-scheme: dark;
  --bg-a: #151515;
  --bg-b: #2a2b2f;
  --surface: rgba(35, 36, 39, 0.72);
  --surface-strong: rgba(49, 50, 54, 0.9);
  --text: #f5f5f7;
  --muted: #b4b7bf;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #a7c7ff;
  --accent-strong: #7fb0ff;
  --accent-soft: rgba(167, 199, 255, 0.16);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.44);
  --button-text: #101114;
}

body[data-theme="medical-blue"] {
  color-scheme: light;
  --bg-a: #eef8fb;
  --bg-b: #d9ecff;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #102033;
  --muted: #587083;
  --line: rgba(20, 83, 124, 0.16);
  --accent: #008eaa;
  --accent-strong: #006d91;
  --accent-soft: rgba(0, 142, 170, 0.15);
  --shadow: 0 34px 90px rgba(47, 118, 154, 0.22);
  --button-text: #ffffff;
}

body[data-theme="warm-graphite"] {
  color-scheme: light;
  --bg-a: #f5f0ea;
  --bg-b: #e8e3dc;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --text: #202026;
  --muted: #69625c;
  --line: rgba(64, 54, 45, 0.15);
  --accent: #8a6f4d;
  --accent-strong: #6f5639;
  --accent-soft: rgba(138, 111, 77, 0.16);
  --shadow: 0 34px 90px rgba(92, 78, 64, 0.2);
  --button-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-a);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% 18%, var(--accent-soft), transparent 28rem),
    linear-gradient(135deg, var(--bg-a), var(--bg-b));
  transition: background 240ms ease, color 240ms ease;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
}

.profile-card {
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  padding: clamp(24px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.28), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.22);
  overflow: hidden;
}

.identity {
  min-width: 0;
}

.eyebrow,
.panel-label {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.25rem, 9vw, 7.4rem);
  line-height: 0.95;
  font-weight: 760;
}

.role {
  margin: clamp(14px, 2vw, 20px) 0 0;
  color: var(--text);
  font-size: clamp(1.15rem, 2.3vw, 1.75rem);
  font-weight: 650;
}

.bio {
  max-width: 29rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.75;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 5vw, 46px);
}

.action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.action:hover,
.theme-choice:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.action-primary {
  color: var(--button-text);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.portrait-panel {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.avatar-frame {
  width: min(100%, 420px);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.theme-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
}

.panel-label {
  margin-bottom: 4px;
  font-size: 0.76rem;
}

.panel-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.theme-choice {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-choice.is-active {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--line));
  background: var(--accent-soft);
}

.swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
}

.swatch-light {
  background: linear-gradient(135deg, #ffffff, #dce7f6);
}

.swatch-dark {
  background: linear-gradient(135deg, #111113, #747985);
}

.swatch-blue {
  background: linear-gradient(135deg, #e5fbff, #008eaa);
}

.swatch-warm {
  background: linear-gradient(135deg, #f7efe4, #8a6f4d);
}

@media (max-width: 820px) {
  .shell {
    align-items: start;
    padding: 14px;
  }

  .profile-card {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 24px;
    border-radius: 24px;
  }

  .portrait-panel {
    order: -1;
  }

  .avatar-frame {
    width: min(100%, 340px);
    border-radius: 26px;
  }

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

  .action {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .profile-card {
    padding: 18px;
    border-radius: 20px;
  }

  h1 {
    font-size: 3.1rem;
  }

  .role {
    font-size: 1.05rem;
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }

  .theme-choice {
    min-height: 44px;
  }
}
