:root {
  color-scheme: light;
  --ink: #17212f;
  --ink-soft: #5e6a7a;
  --paper: #f6f7f2;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --line: rgba(31, 49, 67, 0.11);
  --blue: #2b64f5;
  --blue-deep: #1746c9;
  --teal: #15a58f;
  --mint: #dff7ee;
  --orange: #ff9b54;
  --danger: #d84f45;
  --shadow: 0 30px 80px rgba(28, 45, 66, 0.13);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family:
    "Avenir Next", "Segoe UI Variable", "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 2% 0%, rgba(157, 225, 208, 0.48), transparent 31%),
    radial-gradient(circle at 96% 10%, rgba(255, 195, 137, 0.44), transparent 26%),
    linear-gradient(145deg, #f8f9f4 0%, #f2f5ff 54%, #f9f7f0 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  top: 24vh;
  left: -180px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(19, 160, 137, 0.19);
  box-shadow:
    inset 0 0 80px rgba(24, 165, 143, 0.07),
    0 0 0 45px rgba(24, 165, 143, 0.025);
}

.ambient-two {
  right: -120px;
  bottom: 5vh;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 150, 76, 0.22);
  box-shadow: inset 0 0 90px rgba(255, 154, 82, 0.09);
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px 14px 14px 6px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 11px 24px rgba(23, 33, 47, 0.2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-style: italic;
  font-weight: 700;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.06em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(22, 154, 132, 0.13);
  border-radius: 999px;
  color: #36746a;
  background: rgba(233, 250, 244, 0.72);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(21, 165, 143, 0.12);
}

main {
  width: min(800px, 100%);
  margin: 72px auto 0;
}

.intro {
  max-width: 650px;
}

.eyebrow,
.kicker {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-family: Georgia, "STSong", "Songti SC", serif;
  font-size: clamp(42px, 7.6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.intro h1 em {
  color: var(--blue);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(43, 100, 245, 0.2);
  text-decoration-thickness: 8px;
  text-underline-offset: 2px;
}

.intro-copy {
  max-width: 540px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 52px 0 22px;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  display: flex;
  gap: 10px;
  min-width: 0;
  color: #9ba4af;
}

.step:not(:last-child)::after {
  position: absolute;
  top: 15px;
  right: 16px;
  left: 46px;
  height: 1px;
  background: var(--line);
  content: "";
}

.step > span {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  font-size: 9px;
  font-weight: 800;
}

.step > div {
  display: flex;
  min-width: 0;
  padding-top: 1px;
  flex-direction: column;
}

.step strong {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step small {
  margin-top: 3px;
  font-size: 10px;
}

.step.is-active {
  color: var(--ink);
}

.step.is-active > span {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(43, 100, 245, 0.09);
}

.step.is-done {
  color: #478479;
}

.step.is-done > span {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  animation: panel-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 #fff;
  content: "";
  pointer-events: none;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-heading {
  display: flex;
  gap: 20px;
  margin-bottom: 34px;
}

.panel-index {
  flex: 0 0 auto;
  color: rgba(43, 100, 245, 0.18);
  font-family: Georgia, serif;
  font-size: 40px;
  font-style: italic;
  line-height: 1;
}

.panel-heading h2,
.success-panel h2 {
  margin: 0;
  font-family: Georgia, "STSong", "Songti SC", serif;
  font-size: clamp(27px, 4.2vw, 38px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.panel-heading p:not(.kicker) {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.token-field {
  position: relative;
}

.token-field input {
  width: 100%;
  min-height: 60px;
  padding: 0 56px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  color: var(--ink);
  background: rgba(247, 249, 252, 0.86);
  font-size: 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.token-field input:focus {
  border-color: rgba(43, 100, 245, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(43, 100, 245, 0.08);
}

.reveal-button {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 9px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  transform: translateY(-50%);
}

.reveal-button:hover {
  background: rgba(23, 33, 47, 0.06);
}

.field-hint {
  margin: 11px 2px 25px;
  color: #8a95a2;
  font-size: 11px;
  line-height: 1.6;
}

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

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, #4378ff 100%);
  box-shadow: 0 14px 28px rgba(43, 100, 245, 0.24);
  font-size: 13px;
  font-weight: 750;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.primary-button svg {
  width: 18px;
  height: 18px;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 17px 32px rgba(43, 100, 245, 0.3);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  opacity: 0.42;
  box-shadow: none;
}

.token-panel .primary-button {
  width: 100%;
}

.button-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.is-busy .button-spinner {
  display: block;
}

.is-busy .primary-button > svg {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.account-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 253, 0.75);
}

.current-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.current-avatar {
  display: block;
  width: 86px;
  height: 86px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #e7ecf3;
  box-shadow: 0 10px 26px rgba(25, 38, 55, 0.17);
  object-fit: cover;
}

.avatar-caption {
  position: absolute;
  right: -4px;
  bottom: -3px;
  padding: 4px 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #4d5b6b;
  background: #edf1f4;
  font-size: 9px;
  font-weight: 700;
}

.identity {
  min-width: 0;
}

.role-pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 7px;
  color: #137560;
  background: var(--mint);
  font-size: 10px;
  font-weight: 750;
}

.identity h3 {
  margin: 9px 0 4px;
  overflow: hidden;
  font-size: 25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity p {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.detail-grid > div {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.detail-grid dt {
  margin-bottom: 7px;
  color: #8994a1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.detail-grid dd {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  text-overflow: ellipsis;
}

.confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px;
  border-radius: 15px;
  color: #536071;
  background: rgba(236, 241, 249, 0.72);
  font-size: 12px;
  line-height: 1.65;
  cursor: pointer;
}

.confirm-row input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--blue);
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
}

.panel-actions.centered {
  justify-content: center;
}

.text-button {
  padding: 12px 4px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--ink);
}

.danger-text {
  color: var(--danger);
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1.05fr);
  gap: clamp(24px, 5vw, 48px);
  align-items: center;
}

.crop-stage {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background:
    linear-gradient(45deg, #edf0f4 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(-45deg, #edf0f4 25%, transparent 25%) 0 12px / 24px 24px,
    linear-gradient(45deg, transparent 75%, #edf0f4 75%) 12px -12px / 24px 24px,
    linear-gradient(-45deg, transparent 75%, #edf0f4 75%) -12px 0 / 24px 24px,
    #f7f8fa;
  box-shadow:
    0 25px 50px rgba(28, 45, 66, 0.16),
    0 0 0 9px rgba(255, 255, 255, 0.78);
  cursor: grab;
  touch-action: none;
}

.crop-stage:active {
  cursor: grabbing;
}

.crop-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.crop-stage.is-empty canvas {
  visibility: hidden;
}

.crop-glow {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    inset 0 -40px 60px rgba(13, 28, 47, 0.08);
  pointer-events: none;
}

.empty-canvas {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #8c96a2;
  text-align: center;
  pointer-events: none;
}

.empty-canvas svg {
  width: 38px;
  height: 38px;
  margin-bottom: 13px;
  color: #aeb6bf;
}

.empty-canvas strong {
  color: #657181;
  font-size: 13px;
}

.empty-canvas span {
  margin-top: 5px;
  font-size: 10px;
}

.editor-controls {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.drop-zone {
  display: flex;
  min-height: 142px;
  padding: 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed rgba(43, 100, 245, 0.32);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: rgba(241, 245, 255, 0.69);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--blue);
  background: rgba(233, 239, 255, 0.92);
  transform: translateY(-1px);
}

.drop-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 13px;
  color: var(--blue);
  background: #fff;
  box-shadow: 0 8px 20px rgba(43, 100, 245, 0.12);
}

.drop-icon svg {
  width: 20px;
  height: 20px;
}

.drop-zone strong {
  font-size: 13px;
}

.drop-zone > span:last-child {
  margin-top: 5px;
  color: #8792a0;
  font-size: 10px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.75);
}

.file-thumb {
  width: 44px;
  height: 44px;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 11px;
  background: #eef1f4;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-file > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.selected-file strong,
.selected-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file strong {
  font-size: 11px;
}

.selected-file span {
  margin-top: 3px;
  color: #8994a1;
  font-size: 10px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 9px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #8c96a1;
  background: #f2f4f6;
}

.icon-button:hover {
  color: var(--danger);
  background: #fff0ef;
}

.zoom-control {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.65);
}

.zoom-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
}

.zoom-heading output {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.zoom-control input {
  width: 100%;
  accent-color: var(--blue);
}

.zoom-control p {
  margin: 7px 0 0;
  color: #929ca8;
  font-size: 9px;
}

.upload-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 2px;
  color: #8a95a1;
  font-size: 10px;
}

.upload-summary strong {
  overflow: hidden;
  color: #657181;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-button {
  width: 100%;
}

.upload-note {
  margin: -5px 0 0;
  color: #939da8;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.upload-progress {
  margin-top: 30px;
  padding: 17px;
  border-radius: 16px;
  background: rgba(240, 244, 253, 0.82);
}

.avatar-mode-switch {
  display: inline-flex;
  gap: 4px;
  margin: -8px 0 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(236, 240, 241, 0.8);
}

.avatar-mode {
  min-height: 38px;
  padding: 8px 15px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.avatar-mode.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 7px rgba(20, 40, 55, 0.1);
}

.system-avatar-mode {
  animation: panel-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.system-toolbar,
.option-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.system-toolbar {
  margin-bottom: 18px;
}

.system-toolbar h3,
.option-heading h4 {
  margin: 0;
  color: var(--ink);
}

.system-toolbar h3 {
  font-size: 17px;
}

.system-toolbar p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.option-heading {
  margin-bottom: 11px;
}

.option-heading h4 {
  font-size: 12px;
}

.option-heading > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.system-avatar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  align-items: start;
  gap: 28px;
}

.system-options {
  min-width: 0;
}

.system-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
  max-height: 400px;
  overflow: auto;
  padding: 2px 3px 4px 2px;
}

.system-avatar-option {
  display: flex;
  min-width: 0;
  aspect-ratio: 0.82;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.76);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.system-avatar-option:hover {
  transform: translateY(-2px);
}

.system-avatar-option[aria-pressed="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43, 100, 245, 0.12);
}

.system-avatar-option img {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1;
  border-radius: 8px;
  background: #edf1f3;
  object-fit: cover;
}

.system-avatar-option span {
  width: 100%;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decoration-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.decoration-field {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.decoration-field .auth-input {
  min-height: 42px;
  margin: 7px 0 0;
  padding: 8px 10px;
  font-size: 11px;
}

.system-preview-column {
  display: grid;
  gap: 13px;
}

.system-preview-stage {
  position: relative;
  display: grid;
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(45deg, #f0f2f3 25%, transparent 25%),
    linear-gradient(-45deg, #f0f2f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f2f3 75%),
    linear-gradient(-45deg, transparent 75%, #f0f2f3 75%), #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.system-preview-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.system-preview-empty {
  position: absolute;
  inset: auto 14px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.system-preview-caption {
  min-height: 17px;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-preview-column .upload-note {
  margin-top: -4px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 11px;
}

.progress-copy span {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe5ed;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 160ms ease;
}

.success-panel {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.success-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #47c7aa);
  box-shadow:
    0 16px 30px rgba(21, 165, 143, 0.26),
    0 0 0 10px rgba(21, 165, 143, 0.08);
}

.success-mark svg {
  width: 30px;
  height: 30px;
  stroke-width: 2.3;
}

.success-panel .kicker {
  margin-bottom: 8px;
  color: var(--teal);
}

.success-copy {
  margin: 13px 0 26px;
  color: var(--ink-soft);
  font-size: 13px;
}

.success-avatar {
  width: 128px;
  height: 128px;
  margin: 0 auto;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #edf1f4;
  box-shadow: 0 20px 40px rgba(27, 43, 61, 0.2);
}

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

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(800px, 100%);
  margin: 22px auto 0;
  padding: 0 8px;
  color: #8f99a4;
  font-size: 9px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(390px, calc(100vw - 40px));
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  color: #fff;
  background: rgba(24, 34, 48, 0.94);
  box-shadow: 0 18px 45px rgba(20, 31, 44, 0.25);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: rgba(133, 42, 37, 0.96);
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.access-status {
  color: var(--ink-soft);
  font-size: 12px;
}

.access-status.is-active {
  color: #137a69;
  font-weight: 700;
}

.access-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.access-dialog {
  width: min(460px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  padding: 26px;
  border: 1px solid rgba(31, 49, 67, 0.12);
  border-radius: 24px;
  color: var(--ink);
  background: #fbfcfa;
  box-shadow: 0 30px 90px rgba(28, 45, 66, 0.24);
}

.access-dialog::backdrop {
  background: rgba(17, 28, 42, 0.4);
  backdrop-filter: blur(5px);
}

.dialog-heading,
.admin-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 23px;
}

.dialog-heading .kicker {
  margin-bottom: 7px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: #fff;
  font-size: 22px;
}

.auth-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 24px 0 20px;
  padding: 4px;
  border-radius: 13px;
  background: #edf1f1;
}

.auth-mode {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 650;
}

.auth-mode.is-active {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 7px rgba(20, 40, 55, 0.1);
}

.auth-input {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 7px 0 17px;
  padding: 11px 13px;
  border: 1px solid rgba(31, 49, 67, 0.16);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: white;
}

.auth-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(21, 165, 143, 0.12);
}

.auth-submit {
  width: 100%;
  margin-top: 3px;
}

.auth-error {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
}

.dialog-footnote,
.one-time-note {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.admin-dialog {
  width: min(900px, calc(100vw - 28px));
}

.admin-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-section h3 {
  margin: 0;
  font-size: 15px;
}

.key-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 13px;
}

.key-form label {
  color: var(--ink-soft);
  font-size: 12px;
}

.key-form .auth-input {
  margin-bottom: 0;
}

.one-time-note {
  padding: 12px;
  border: 1px solid rgba(21, 165, 143, 0.22);
  border-radius: 11px;
  color: #176858;
  background: #edf9f4;
  overflow-wrap: anywhere;
  user-select: all;
}

.admin-section-heading {
  align-items: center;
  margin-bottom: 10px;
}

.admin-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.admin-table-wrap th,
.admin-table-wrap td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

.admin-table-wrap th {
  color: var(--ink-soft);
  background: #f5f7f6;
  font-weight: 650;
}

.admin-table-wrap tr:last-child td {
  border-bottom: 0;
}

.admin-table-wrap .device-cell {
  max-width: 300px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.table-action {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--danger);
  background: #fff;
  font-size: 11px;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 20px;
  }

  main {
    margin-top: 48px;
  }

  .privacy-badge {
    padding: 8px 10px;
    font-size: 10px;
  }

  .account-actions {
    gap: 5px;
  }

  .access-status {
    width: 100%;
    text-align: right;
  }

  .access-button {
    padding-inline: 9px;
    font-size: 11px;
  }

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

  .key-form button {
    grid-column: 1 / -1;
  }

  .access-dialog {
    padding: 20px;
  }

  .stepper {
    margin-top: 38px;
  }

  .step > div {
    display: none;
  }

  .step {
    justify-content: flex-start;
  }

  .step:not(:last-child)::after {
    right: 8px;
    left: 38px;
  }

  .panel {
    border-radius: 25px;
  }

  .panel-heading {
    gap: 13px;
    margin-bottom: 26px;
  }

  .panel-index {
    font-size: 30px;
  }

  .account-card {
    align-items: flex-start;
  }

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

  .editor-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .system-avatar-layout {
    grid-template-columns: 1fr;
  }

  .system-preview-column {
    max-width: 380px;
    margin: 0 auto;
  }

  .system-avatar-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    max-height: 320px;
  }

  .avatar-mode-switch {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .avatar-mode {
    padding-inline: 8px;
    font-size: 11px;
  }

  .crop-stage {
    width: min(100%, 360px);
    margin: 0 auto;
  }

  .panel-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .panel-actions .primary-button {
    width: 100%;
  }

  .panel-actions.centered {
    align-items: stretch;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

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