.account-status-button {
  gap: 8px;
  max-width: 150px;
  border: 1px solid rgba(31, 23, 16, 0.1);
  cursor: pointer;
}

.account-status-button [data-account-launch-label],
.dock [data-open="account"] [data-account-launch-label] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status-button [data-account-launch-label] {
  max-width: 92px;
}

.dock [data-open="account"] [data-account-launch-label] {
  max-width: 58px;
}

.account-status-button:hover,
.account-status-button.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.account-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9a928a;
  box-shadow: 0 0 0 4px rgba(154, 146, 138, 0.12);
}

body.is-authenticated .account-status-dot {
  background: #35bc72;
  box-shadow: 0 0 0 4px rgba(53, 188, 114, 0.14), 0 0 14px rgba(53, 188, 114, 0.34);
}

#window-account {
  width: min(920px, calc(100vw - 40px));
  max-height: min(82vh, 760px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: #0f1216;
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

#window-account .window-titlebar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(28, 34, 42, 0.98), rgba(16, 20, 26, 0.98));
  color: rgba(230, 236, 242, 0.62);
}

#window-account .window-titlebar strong {
  color: #f4f7fa;
  font-weight: 850;
  letter-spacing: 0.02em;
}

#window-account .window-center-button,
#window-account .window-close-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef4;
}

#window-account .window-center-button:hover,
#window-account .window-close-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.account-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(0, 1.24fr);
  min-height: 540px;
  max-height: calc(82vh - 54px);
  padding: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(90, 150, 255, 0.08), transparent 30%),
    #f4f6f8;
}

.account-summary,
.account-workspace {
  min-width: 0;
  padding: clamp(28px, 3.6vw, 42px);
}

.account-summary {
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 20% 12%, rgba(90, 210, 200, 0.18), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(90, 140, 255, 0.16), transparent 36%),
    linear-gradient(165deg, #151a21 0%, #0d1116 55%, #10151c 100%);
  color: #f1f4f7;
}

.account-summary-glow {
  position: absolute;
  inset: auto -20% -30% auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(107, 216, 201, 0.16), transparent 68%);
  pointer-events: none;
}

.account-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
  border: 1px solid rgba(107, 216, 201, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 0 8px rgba(107, 216, 201, 0.06);
}

.account-node::before,
.account-node::after {
  content: "";
  position: absolute;
  inset: 10px -12px;
  border: 1px solid rgba(120, 160, 255, 0.28);
  border-radius: 50%;
  transform: rotate(62deg);
}

.account-node::after {
  transform: rotate(-62deg);
}

.account-node i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f0f4f5;
  box-shadow: 0 0 18px rgba(107, 216, 201, 0.72);
}

.account-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  color: #7be0d2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.account-summary h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: #f7fafc;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.account-summary-lead {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  max-width: 22em;
  color: rgba(230, 236, 242, 0.62);
  font-size: 13px;
  line-height: 1.55;
}

.account-summary-copy {
  position: relative;
  z-index: 1;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 241, 244, 0.78) !important;
  font-size: 13px !important;
  line-height: 1.45;
}

.account-readout,
.account-profile-readout {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.account-readout div,
.account-profile-readout div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.account-profile-readout div {
  border-color: rgba(24, 29, 34, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.account-readout dt,
.account-readout dd,
.account-profile-readout dt,
.account-profile-readout dd {
  margin: 0;
}

.account-readout dt,
.account-readout dd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.account-readout dt {
  color: rgba(238, 241, 244, 0.48);
}

.account-readout dd {
  color: #f0b277;
  font-weight: 800;
}

.account-preview-switch {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 14px 14px 14px 16px;
  border: 1px solid rgba(107, 216, 201, 0.22);
  border-radius: 14px;
  background: rgba(107, 216, 201, 0.08);
  cursor: pointer;
  user-select: none;
}

.account-preview-switch[hidden] {
  display: none !important;
}

.account-preview-switch__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-preview-switch__copy strong {
  color: #eef8f6;
  font-size: 13px;
  font-weight: 900;
}

.account-preview-switch__copy small {
  color: rgba(238, 241, 244, 0.55);
  font-size: 11px;
  line-height: 1.4;
}

.account-preview-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.account-preview-switch__track {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 160ms ease;
}

.account-preview-switch__track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f5f7f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease;
}

.account-preview-switch input:checked + .account-preview-switch__track {
  background: #35bc72;
}

.account-preview-switch input:checked + .account-preview-switch__track i {
  transform: translateX(20px);
}

.account-preview-switch input:focus-visible + .account-preview-switch__track {
  outline: 2px solid #6bd8c9;
  outline-offset: 3px;
}

.account-workspace {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(circle at 88% 12%, rgba(90, 140, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f8fa, #eef1f5);
}

.account-signed-out,
.account-signed-in {
  width: 100%;
  min-width: 0;
}

.account-panel,
.account-profile-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid rgba(24, 29, 34, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  box-shadow:
    0 18px 48px rgba(24, 29, 34, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Author CSS must not override the HTML hidden attribute. */
.account-signed-out[hidden],
.account-signed-in[hidden],
.account-readout[hidden],
.account-rename-cancel[hidden],
.account-rename-edit[hidden] {
  display: none !important;
}

.account-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid rgba(24, 29, 34, 0.08);
  border-radius: 12px;
  background: rgba(24, 29, 34, 0.045);
}

.account-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #716c65;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.account-tabs button:hover {
  color: #181d22;
  background: rgba(255, 255, 255, 0.7);
}

.account-tabs button.is-active {
  background: #181d22;
  color: #f6f3ed;
  box-shadow: 0 10px 20px rgba(24, 29, 34, 0.16);
}

.account-message {
  flex: 0 0 auto;
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(90, 140, 255, 0.16);
  border-left: 3px solid #5b86d9;
  border-radius: 12px;
  background: rgba(90, 140, 255, 0.08);
  color: #3a4350;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  text-align: left;
}

.account-message[hidden] {
  display: none !important;
}

.account-message[data-tone="success"] {
  border-left-color: #35a86a;
  border-color: rgba(53, 168, 106, 0.16);
  background: rgba(53, 168, 106, 0.09);
}

.account-message[data-tone="error"] {
  border-left-color: #c34f42;
  border-color: rgba(195, 79, 66, 0.14);
  background: rgba(195, 79, 66, 0.08);
}

.account-message[data-tone="info"] {
  border-left-color: #8a8078;
  border-color: rgba(24, 29, 34, 0.08);
  background: rgba(24, 29, 34, 0.04);
}

.account-form[hidden] {
  display: none !important;
}

.account-form header {
  margin-bottom: 20px;
}

.account-form header span {
  color: #8a837b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.account-form h3 {
  margin: 6px 0 0;
  color: #151a20;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.account-form header p {
  margin: 8px 0 0;
  color: #7a746d;
  font-size: 13px;
  line-height: 1.5;
}

.account-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.account-form label > span {
  color: #4e4a45;
  font-size: 12px;
  font-weight: 900;
}

.account-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(24, 29, 34, 0.12);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: #181d22;
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.account-form input::placeholder {
  color: rgba(24, 29, 34, 0.34);
}

.account-form input:focus {
  border-color: rgba(61, 111, 217, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(61, 111, 217, 0.12);
}

.account-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a313a, #181d22);
  color: #f7f4ef;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 14px 28px rgba(24, 29, 34, 0.18);
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.account-submit:hover {
  background: linear-gradient(180deg, #343c46, #222831);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 16px 32px rgba(24, 29, 34, 0.22);
}

.account-submit:disabled,
.account-text-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.account-text-button {
  display: block;
  margin: 14px auto 0;
  border: 0;
  background: transparent;
  color: #3d6fd9;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.account-text-button:hover {
  color: #2f58b5;
}

.account-signed-in {
  display: block;
}

.account-profile-card {
  display: grid;
  gap: 16px;
}

.account-profile-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  text-align: left;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(145deg, #2a3340, #151a20);
  color: #f6f3ed;
  font-size: 28px;
  font-weight: 950;
  box-shadow:
    0 0 0 6px rgba(90, 140, 255, 0.1),
    0 14px 28px rgba(24, 29, 34, 0.16);
}

.account-profile-copy {
  min-width: 0;
}

.account-signed-in .account-kicker {
  margin: 0 0 6px;
  color: #4f8f86;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.account-profile-copy h3,
.account-signed-in h3 {
  margin: 0;
  color: #151a20;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.account-profile-copy p,
.account-signed-in > p:not(.account-kicker) {
  margin: 4px 0 0;
  color: #716c65;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-profile-readout {
  margin: 0;
}

.account-profile-readout dt,
.account-profile-readout dd {
  font-size: 12px;
  font-weight: 850;
}

.account-profile-readout dt {
  color: #7a756f;
}

.account-profile-readout dd {
  color: #181d22;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.account-rename {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(24, 29, 34, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-align: left;
}

.account-rename label {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.account-rename label > span {
  color: #4e4a45;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.account-rename input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(24, 29, 34, 0.14);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  color: #181d22;
  font-size: 14px;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.account-rename input[readonly],
.account-rename input:read-only {
  color: #5a554f;
  background: rgba(24, 29, 34, 0.045);
  border-color: rgba(24, 29, 34, 0.08);
  cursor: default;
  box-shadow: none;
}

.account-rename input.is-editing,
.account-rename.is-editing input {
  color: #181d22;
  background: #fff;
  border-color: rgba(61, 111, 217, 0.55);
  box-shadow: 0 0 0 4px rgba(61, 111, 217, 0.12);
  cursor: text;
}

.account-rename input:focus {
  border-color: rgba(61, 111, 217, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(61, 111, 217, 0.12);
}

.account-rename-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.account-rename-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.account-rename-btn__icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  opacity: 0.92;
}

.account-rename-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.account-rename-btn:active:not(:disabled) {
  transform: translateY(0);
}

.account-rename-btn:focus-visible {
  outline: 2px solid rgba(61, 111, 217, 0.45);
  outline-offset: 2px;
}

/* 默认态：编辑主按钮 */
.account-rename-edit {
  flex: 1 1 auto;
  min-width: 112px;
  border-color: rgba(24, 29, 34, 0.1);
  background: linear-gradient(180deg, #ffffff, #f1eee8);
  color: #2a3038;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 18px rgba(24, 29, 34, 0.06);
}

.account-rename-edit .account-rename-btn__icon {
  background: rgba(24, 29, 34, 0.08);
  color: #3a414c;
}

.account-rename-edit:hover {
  border-color: rgba(24, 29, 34, 0.16);
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 10px 22px rgba(24, 29, 34, 0.1);
}

/* 编辑态：保存为强调主按钮 */
.account-rename-save {
  flex: 1 1 auto;
  min-width: 128px;
  border-color: transparent;
  background: linear-gradient(180deg, #5b8ef0, #3d6fd9);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 10px 22px rgba(61, 111, 217, 0.28);
}

.account-rename-save .account-rename-btn__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.account-rename-save:disabled,
.account-rename-save[disabled] {
  border-color: rgba(24, 29, 34, 0.06);
  background: rgba(24, 29, 34, 0.08);
  color: rgba(24, 29, 34, 0.34);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.account-rename-save:disabled .account-rename-btn__icon,
.account-rename-save[disabled] .account-rename-btn__icon {
  background: rgba(24, 29, 34, 0.08);
  color: rgba(24, 29, 34, 0.3);
}

.account-rename-save.is-enabled:not(:disabled):hover {
  background: linear-gradient(180deg, #6a99f4, #3564c9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.24) inset,
    0 12px 26px rgba(61, 111, 217, 0.34);
}

/* 取消：次要幽灵按钮 */
.account-rename-cancel {
  flex: 0 0 auto;
  min-width: 108px;
  border-color: rgba(24, 29, 34, 0.12);
  background: transparent;
  color: #6a655f;
  box-shadow: none;
}

.account-rename-cancel .account-rename-btn__icon {
  background: rgba(24, 29, 34, 0.06);
  color: #7a756f;
}

.account-rename-cancel:hover {
  border-color: rgba(24, 29, 34, 0.2);
  background: rgba(24, 29, 34, 0.04);
  color: #2f2b27;
}

.account-rename.is-editing .account-rename-actions {
  animation: account-rename-actions-in 220ms ease;
}

@keyframes account-rename-actions-in {
  from {
    opacity: 0.55;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 420px) {
  .account-rename-actions {
    flex-direction: column;
  }

  .account-rename-btn {
    width: 100%;
  }
}


.account-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  border: 1px solid rgba(176, 74, 64, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 244, 242, 0.95));
  color: #a04137;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(160, 65, 55, 0.08);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.account-logout__icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(160, 65, 55, 0.1);
  font-size: 12px;
}

.account-logout:hover {
  transform: translateY(-1px);
  border-color: rgba(176, 74, 64, 0.28);
  background: linear-gradient(180deg, #fff, #ffefed);
  color: #8c342c;
}

@media (max-width: 760px) {
  #window-account {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 32px);
  }

  .account-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: calc(100vh - 112px);
  }

  .account-summary {
    min-height: 170px;
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .account-node {
    position: absolute;
    top: 28px;
    right: 30px;
    width: 58px;
    height: 58px;
    margin: 0;
  }

  .account-summary h2 {
    font-size: 28px;
  }

  .account-summary-copy {
    min-height: 0;
    margin-bottom: 0;
  }

  .account-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
  }

  .account-readout div {
    display: grid;
    gap: 4px;
    padding: 12px;
  }

  .account-summary-lead {
    max-width: none;
    padding-right: 72px;
  }

  .account-workspace {
    align-items: start;
    padding: 22px 18px 28px;
  }

  .account-panel,
  .account-profile-card {
    width: 100%;
    padding: 16px;
  }

  .account-profile-head {
    grid-template-columns: auto 1fr;
  }
}

@media (max-width: 620px) {
  #window-account .window-titlebar {
    grid-template-columns: auto 1fr auto;
  }

  #window-account .window-meta,
  #window-account .window-center-button {
    display: none;
  }

  #window-account .window-toolbar {
    width: auto;
  }

  .account-tabs button {
    padding-inline: 5px;
    font-size: 11px;
  }
}
