:root {
  --paper: var(--gx-ui-surface, #fbf8f2);
  --paper-warm: var(--gx-ui-soft, #f6eee2);
  --ink: var(--gx-ui-text, #29221c);
  --muted: var(--gx-ui-muted, #817568);
  --line: var(--gx-ui-border, #eadbc7);
  --gold: var(--gx-ui-primary, #b87621);
  --gold-deep: var(--gx-ui-primary-hover, #965b17);
  --green: var(--gx-ui-primary, #73886b);
  --danger: var(--gx-ui-error, #a84f43);
  --shadow: 0 20px 55px rgba(var(--gx-ui-shadow-rgb, 82, 57, 29), 0.09);
  --serif: "Noto Serif TC", "Songti TC", "STSong", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 16% 12%, var(--gx-ui-soft, rgba(214, 175, 119, 0.14)), transparent 25rem),
    var(--gx-ui-soft, #f2eee7);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.site-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, #fff, var(--paper));
  border-inline: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.13));
}

.site-header {
  min-height: 74px;
  padding: 10px 28px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.brand {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--gold-deep);
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.42));
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px rgba(var(--gx-ui-shadow-rgb, 184, 118, 33), 0.17);
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--gx-ui-muted, #745f49);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.customize-link {
  padding: 12px 19px;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gx-ui-primary, #cd9137), var(--gx-ui-primary, #a96617));
  box-shadow: 0 8px 20px rgba(var(--gx-ui-shadow-rgb, 184, 118, 33), 0.2);
}

.menu-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.36));
  border-radius: 50%;
  background: #fff;
}

.menu-button span {
  width: 17px;
  height: 1px;
  background: var(--ink);
}

.primary-nav {
  height: 50px;
  padding: 0 28px;
  display: flex;
  align-items: stretch;
  gap: 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.primary-nav a {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav a.is-active {
  color: var(--gold-deep);
}

.primary-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--gold);
}

.account-main {
  min-height: calc(100vh - 124px);
  padding: 64px clamp(24px, 7vw, 76px) 90px;
  background:
    radial-gradient(circle at 80% 10%, var(--gx-ui-soft, rgba(219, 178, 116, 0.12)), transparent 20rem),
    linear-gradient(180deg, var(--gx-ui-soft, rgba(247, 238, 225, 0.4)), transparent 25rem);
}

.loading-panel {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.loading-orbit {
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.24));
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: account-spin 0.9s linear infinite;
}

.loading-panel p {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.08em;
}

.loading-panel small {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

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

.guest-view {
  max-width: 620px;
  margin: 0 auto;
}

.view-heading {
  margin-bottom: 30px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-deep);
  font-size: 11px;
  letter-spacing: 0.28em;
}

.view-heading h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 500;
  letter-spacing: 0.1em;
}

.view-heading > p:last-child {
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.login-card {
  position: relative;
  padding: 38px clamp(24px, 6vw, 54px) 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(145deg, #fff, var(--gx-ui-surface, #fbf7f0));
  box-shadow: var(--shadow);
}

.login-card::before {
  position: absolute;
  top: -100px;
  right: -80px;
  width: 220px;
  height: 220px;
  content: "";
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.12));
  border-radius: 50%;
}

.step-indicator {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.step-indicator span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.step-indicator span.is-active {
  color: #fff;
  border-color: var(--gold);
  background: var(--gold);
}

.step-indicator i {
  width: 72px;
  height: 1px;
  background: var(--line);
}

.login-form {
  position: relative;
  z-index: 1;
}

.form-heading {
  margin-bottom: 24px;
}

.form-heading h1,
.form-heading h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 500;
}

.form-heading p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.form-heading strong {
  color: var(--gold-deep);
  font-weight: 500;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: var(--gx-ui-muted, #695a4b);
  font-size: 13px;
}

.phone-field,
.code-field {
  width: 100%;
  height: 54px;
  border: 1px solid var(--gx-ui-border, #dfcdb4);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  outline: none;
}

.phone-field {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
}

.phone-field span {
  display: grid;
  place-items: center;
  height: 28px;
  color: var(--gx-ui-muted, #675747);
  font-size: 14px;
  border-right: 1px solid var(--line);
}

.phone-field input {
  min-width: 0;
  height: 100%;
  padding: 0 18px;
  color: var(--ink);
  border: 0;
  background: transparent;
  outline: none;
}

.code-field {
  padding: 0 18px;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0.3em;
}

.phone-field:focus-within,
.code-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--gx-ui-primary-rgb, 184, 118, 33), 0.1);
}

.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
  color: #fff;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gx-ui-primary, #c88a31), var(--gx-ui-primary, #a96719));
  box-shadow: 0 10px 24px rgba(var(--gx-ui-shadow-rgb, 174, 106, 24), 0.2);
  cursor: pointer;
}

.primary-button:disabled {
  color: var(--gx-ui-disabled-text, #aa9e8e);
  background: var(--gx-ui-disabled-bg, #eee7dd);
  box-shadow: none;
  cursor: wait;
}

.text-back {
  margin: 0 0 16px;
  padding: 0;
  color: var(--gold-deep);
  font-size: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.code-actions {
  min-height: 24px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.code-actions button {
  padding: 4px 0;
  color: var(--gold-deep);
  border: 0;
  background: transparent;
}

.code-actions button:disabled {
  color: var(--gx-ui-disabled-text, #aaa095);
}

.form-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.form-message.is-success {
  color: var(--green);
}

.privacy-note {
  margin: 12px 0 0;
  color: var(--gx-ui-muted, #a09588);
  font-size: 11px;
  text-align: center;
}

.auth-switch {
  position: relative;
  z-index: 1;
  margin-bottom: 30px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--gx-ui-border, #e4d5c1);
  border-radius: 999px;
  background: var(--gx-ui-soft, #f7f1e8);
}

.auth-switch button {
  min-height: 42px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.auth-switch button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--gx-ui-primary-hover, #c88a31), var(--gx-ui-primary-hover, #a96719));
  box-shadow: 0 7px 18px rgba(var(--gx-ui-shadow-rgb, 174, 106, 24), 0.18);
}

.auth-field,
.password-control {
  width: 100%;
  height: 54px;
  border: 1px solid var(--gx-ui-border, #dfcdb4);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.auth-field {
  margin-bottom: 18px;
  padding: 0 18px;
  color: var(--ink);
  outline: none;
}

.gx-app select.auth-field {
  appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gx-ui-primary, #7f7163) 50%),
    linear-gradient(135deg, var(--gx-ui-primary, #7f7163) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) 24px,
    calc(100% - 15px) 24px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
}

.gx-app select.auth-field:disabled {
  color: var(--gx-ui-disabled-text, #a39a90);
  background-color: var(--gx-ui-disabled-bg, #f2eee8);
  cursor: wait;
}

.auth-field-help {
  display: block;
  min-height: 18px;
  margin: -10px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-nickname-help {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px 10px;
  text-align: right;
}

.auth-nickname-help em {
  flex-basis: 100%;
  color: var(--danger);
  font-style: normal;
}

.auth-field-help.is-invalid {
  color: var(--danger);
}

.auth-field[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(var(--gx-ui-shadow-rgb, 165, 62, 46), 0.08);
}

.auth-textarea {
  width: 100%;
  min-height: 116px;
  margin-bottom: 18px;
  padding: 14px 16px;
  resize: vertical;
  color: var(--ink);
  line-height: 1.6;
  border: 1px solid var(--gx-ui-border, #dfcdb4);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  outline: none;
}

.password-control {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  overflow: hidden;
}

.password-control input {
  min-width: 0;
  height: 100%;
  padding: 0 16px 0 18px;
  color: var(--ink);
  border: 0;
  background: transparent;
  outline: none;
}

.password-control button {
  height: 32px;
  margin-right: 10px;
  padding: 0 11px;
  color: var(--gold-deep);
  font-size: 12px;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.22));
  border-radius: 999px;
  background: var(--gx-ui-surface, #fffaf3);
  cursor: pointer;
}

.auth-field:focus,
.auth-textarea:focus,
.password-control:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--gx-ui-primary-rgb, 184, 118, 33), 0.1);
}

.auth-rule-list {
  margin: -7px 0 19px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 16px;
  color: var(--gx-ui-muted, #988b7c);
  font-size: 11px;
  list-style: none;
  border-radius: 13px;
  background: var(--gx-ui-soft, rgba(246, 238, 226, 0.66));
}

.auth-rule-list li::before {
  margin-right: 6px;
  content: "○";
}

.auth-rule-list li.is-valid {
  color: var(--green);
}

.auth-rule-list li.is-valid::before {
  content: "✓";
}

.auth-rule-list li.is-invalid {
  color: var(--danger);
}

.auth-rule-list li.is-invalid::before {
  content: "×";
}

.member-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(360px, 1.22fr);
  align-items: start;
  gap: 24px;
}

.profile-card {
  position: relative;
  min-height: 390px;
  padding: 42px 28px 30px;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--gx-ui-border, #e3d1b8);
  border-radius: 30px;
  background: linear-gradient(155deg, #fff 10%, var(--gx-ui-soft, #f8efe2) 100%);
  box-shadow: var(--shadow);
}

.profile-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  width: 260px;
  height: 260px;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.14));
  border-radius: 50%;
  transform: translateX(-50%);
}

.avatar-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--gold-deep);
  font-size: 30px;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.38));
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.55);
}

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

.profile-copy {
  position: relative;
}

.profile-caption {
  color: var(--gold-deep);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.profile-copy h2 {
  margin: 8px 0 7px;
  font-size: 25px;
  font-weight: 500;
}

.profile-copy > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-copy dl {
  margin: 27px 0 0;
  padding-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  border-top: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.16));
}

.profile-copy dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.profile-copy dd {
  margin: 7px 0 0;
  color: var(--gx-ui-primary, #5d4b38);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-menu {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.account-entry {
  width: 100%;
  min-height: 78px;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 15px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  border: 0;
  border-bottom: 1px solid var(--gx-ui-border, #eee2d2);
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, padding-left 160ms ease;
}

.account-entry:last-child {
  border-bottom: 0;
}

.account-entry:hover,
.account-entry:focus-visible {
  padding-left: 24px;
  background: var(--gx-ui-soft, #fbf4e9);
  outline: none;
}

.entry-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: var(--gold-deep);
  font-size: 13px;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.22));
  border-radius: 50%;
  background: var(--gx-ui-surface, #fffaf3);
}

.account-entry > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.account-entry strong {
  font-size: 15px;
  font-weight: 500;
}

.account-entry small {
  color: var(--muted);
  font-size: 11px;
}

.account-entry i {
  color: var(--gx-ui-primary, #bca789);
  font-size: 25px;
  font-style: normal;
}

.logout-entry strong {
  color: var(--gx-ui-error, #8e4f43);
}

.member-message {
  min-height: 24px;
  margin: 22px 0 0;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 18px;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 14px;
  background: rgba(var(--gx-ui-text-rgb, 45, 37, 29), 0.94);
  box-shadow: 0 12px 32px rgba(var(--gx-ui-shadow-rgb, 45, 37, 29), 0.2);
}

.design-sync-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.design-sync-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(var(--gx-ui-text-rgb, 43, 34, 25), 0.42);
  backdrop-filter: blur(5px);
}

.design-sync-modal section {
  position: relative;
  width: min(100%, 470px);
  padding: 35px 31px 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--gx-ui-surface, #fffdf9);
  box-shadow: 0 28px 70px rgba(var(--gx-ui-shadow-rgb, 52, 38, 24), 0.22);
}

.design-sync-modal section > p {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.design-sync-modal h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 500;
}

.design-sync-modal section > span {
  display: block;
  margin: 13px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.design-sync-modal section > div {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
}

.design-sync-modal section button {
  min-height: 44px;
  color: var(--gold-deep);
  border: 1px solid var(--gx-ui-border, #dfcdb4);
  border-radius: 999px;
  background: #fff;
}

.design-sync-modal section button.is-primary {
  color: #fff;
  border-color: var(--gold);
  background: var(--gold);
}

.design-sync-modal section button:disabled {
  color: var(--gx-ui-disabled-text, #aaa095);
  border-color: var(--gx-ui-disabled-border, #e5ddd3);
  background: var(--gx-ui-disabled-bg, #eee9e2);
}

.design-sync-modal small {
  display: block;
  margin-top: 14px;
  color: var(--gx-ui-muted, #9d9285);
  font-size: 10px;
}

.design-sync-modal em {
  display: block;
  min-height: 19px;
  margin-top: 9px;
  color: var(--danger);
  font-size: 11px;
  font-style: normal;
}

.design-sync-modal em.is-success {
  color: var(--green);
}

@media (min-width: 721px) {
  .site-header {
    min-height: 64px;
    padding: 8px 16px;
  }

  .brand-mark {
    width: 42px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .customize-link {
    padding: 10px 14px;
    font-size: 12px;
  }

  .menu-button {
    width: 38px;
    height: 38px;
  }

  .primary-nav {
    height: 43px;
    padding: 0 17px;
    justify-content: space-between;
    gap: 8px;
  }

  .primary-nav a {
    font-size: 12px;
  }

  .account-main {
    min-height: calc(100vh - 107px);
    padding: 42px 20px 72px;
  }

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

  .profile-card {
    min-height: 0;
    padding: 34px 24px 27px;
  }

  .login-card {
    padding: 30px 20px 25px;
    border-radius: 26px;
  }

  .guest-identity-card {
    padding: 20px 18px;
  }

  .guest-identity {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
  }

  .guest-avatar {
    width: 62px;
    height: 62px;
  }

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

  .auth-assistance,
  .reset-inline-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 64px;
    padding: 8px 16px;
  }

  .brand-mark {
    width: 42px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .customize-link {
    padding: 10px 14px;
    font-size: 12px;
  }

  .menu-button {
    width: 38px;
    height: 38px;
  }

  .primary-nav {
    height: 43px;
    padding: 0 17px;
    justify-content: space-between;
    gap: 8px;
  }

  .primary-nav a {
    font-size: 12px;
  }

  .account-main {
    min-height: calc(100vh - 107px);
    padding: 42px 20px 72px;
  }

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

  .profile-card {
    min-height: 0;
    padding: 34px 24px 27px;
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 7px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 38px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small {
    font-size: 6px;
  }

  .customize-link {
    padding: 9px 11px;
  }

  .menu-button {
    width: 36px;
    height: 36px;
  }

  .account-main {
    padding-inline: 16px;
  }

  .login-card {
    padding: 30px 20px 25px;
    border-radius: 26px;
  }

  .auth-rule-list {
    grid-template-columns: 1fr;
  }

  .phone-field {
    grid-template-columns: 64px 1fr;
  }

  .account-entry {
    min-height: 74px;
    padding-inline: 15px;
    grid-template-columns: 38px 1fr auto;
    gap: 12px;
  }

  .entry-icon {
    width: 36px;
    height: 36px;
  }
}

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

/* Mobile-first personal crystal space */
.member-view {
  width: 100%;
}

.member-space {
  width: min(100%, 680px);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.space-heading {
  padding: 2px 4px 0;
  text-align: left;
}

.space-kicker,
.space-card-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--gx-ui-primary, #a36a2c);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .2em;
}

.space-heading h1 {
  margin: 0;
  color: var(--gx-ui-text, #2c241d);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(34px, 8vw, 46px);
  font-weight: 500;
  letter-spacing: .08em;
}

.space-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--gx-ui-muted, #7d7166);
  font-size: 14px;
  line-height: 1.8;
}

.space-card {
  border: 1px solid var(--gx-ui-border, rgba(193, 137, 73, .28));
  border-radius: 20px;
  background: var(--gx-ui-surface, rgba(255, 253, 249, .93));
  box-shadow: 0 16px 42px rgba(var(--gx-ui-shadow-rgb, 84, 55, 27), 0.06);
}

.space-profile-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 24px 20px 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -20%, var(--gx-ui-soft, rgba(214, 167, 104, .22)), transparent 50%),
    linear-gradient(145deg, var(--gx-ui-surface, rgba(255, 253, 249, .98)), var(--gx-ui-soft, rgba(249, 241, 230, .94)));
}

.space-profile-card::before,
.space-profile-card::after {
  position: absolute;
  left: 50%;
  border: 1px solid var(--gx-ui-border, rgba(189, 127, 55, .16));
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.space-profile-card::before { top: -116px; width: 300px; height: 300px; }
.space-profile-card::after { top: -80px; width: 225px; height: 225px; }

.space-avatar-link {
  position: relative;
  z-index: 1;
  display: grid;
  width: 82px;
  height: 82px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid var(--gx-ui-border, rgba(186, 122, 50, .42));
  border-radius: 50%;
  background: var(--gx-ui-surface, #fffdf9);
  color: var(--gx-ui-primary, #9c5b18);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(var(--gx-ui-shadow-rgb, 122, 77, 31), 0.12);
}

.space-avatar-halo { position: absolute; inset: -7px; border: 1px solid var(--gx-ui-border, rgba(186, 122, 50, .18)); border-radius: inherit; }
.space-avatar-image:not([hidden]) { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.space-avatar-fallback:not([hidden]) { display: grid; width: 100%; height: 100%; place-items: center; font-family: "Noto Serif TC", "Songti TC", serif; font-size: 26px; }

.space-avatar-edit {
  position: absolute;
  right: -5px;
  bottom: -3px;
  min-width: 35px;
  padding: 4px 7px;
  border: 2px solid var(--gx-ui-border, #fffdf9);
  border-radius: 999px;
  background: var(--gx-ui-primary, #b87928);
  color: #fff;
  font-size: 9px;
  letter-spacing: .08em;
}

.space-member-label { position: relative; z-index: 1; display: inline-block; color: var(--gx-ui-primary, #a36a2c); font-size: 10px; letter-spacing: .18em; }
.space-profile-card h2 { position: relative; z-index: 1; margin: 7px 0 4px; color: var(--gx-ui-text, #2e261f); font-family: "Noto Serif TC", "Songti TC", serif; font-size: 24px; font-weight: 500; }
.space-profile-card > p { position: relative; z-index: 1; margin: 0; color: var(--gx-ui-muted, #8b7c6d); font-size: 12px; letter-spacing: .06em; }

.space-profile-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
}

.space-profile-meta div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--gx-ui-border, rgba(186, 122, 50, .16));
  border-radius: 8px;
  background: var(--gx-ui-surface, rgba(255, 253, 249, .72));
}

.space-profile-meta dt {
  color: var(--gx-ui-primary, #9b6a33);
  font-size: 11px;
  letter-spacing: .08em;
  text-align: right;
}

.space-profile-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--gx-ui-text, #3a3027);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: left;
}

[data-profile-email-status] {
  font-family: inherit;
  font-weight: 600;
}

[data-profile-email-status].is-verified { color: var(--gx-ui-primary, #50723c); }
[data-profile-email-status].is-pending { color: var(--gx-ui-primary, #a36a2c); }
[data-profile-email-status].is-missing { color: var(--gx-ui-muted, #9a8d80); }

.account-section,
.account-secondary-section {
  display: grid;
  gap: 12px;
  padding: 0 2px;
}

.account-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.account-section-heading h2 {
  margin: 0;
  color: var(--gx-ui-text, #2f271f);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 22px;
  font-weight: 500;
}

.account-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.account-detail-grid div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--gx-ui-border, rgba(190, 136, 73, .2));
  border-radius: 8px;
  background: var(--gx-ui-surface, rgba(255, 253, 249, .72));
}

.account-detail-grid dt {
  color: var(--gx-ui-primary, #9b6a33);
  font-size: 12px;
  letter-spacing: .08em;
}

.account-detail-grid dd {
  min-width: 0;
  margin: 0;
  color: var(--gx-ui-text, #352c24);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-align: right;
}

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

.account-related-item {
  display: grid;
  min-height: 104px;
  align-content: space-between;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--gx-ui-border, rgba(190, 136, 73, .2));
  border-radius: 8px;
  background: var(--gx-ui-surface, rgba(255, 253, 249, .76));
  color: inherit;
  text-decoration: none;
}

.account-related-item > span {
  color: var(--gx-ui-muted, #745f4a);
  font-size: 12px;
  line-height: 1.4;
}

.account-related-item strong {
  color: var(--gx-ui-text, #2f271f);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.account-related-item small {
  color: var(--gx-ui-muted, #9a8d80);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.account-related-item--static {
  cursor: default;
}

.energy-card {
  overflow: hidden;
  padding: 20px;
  background: radial-gradient(circle at 100% 0, var(--gx-ui-soft, rgba(199, 151, 86, .16)), transparent 38%), linear-gradient(145deg, var(--gx-ui-surface, #fffdf9), var(--gx-ui-soft, #f7efe3));
}

.space-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.space-card-heading h2,
.service-heading h2 { margin: 0; color: var(--gx-ui-text, #2f271f); font-family: "Noto Serif TC", "Songti TC", serif; font-size: 22px; font-weight: 500; }

.space-status-pill { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--gx-ui-border, rgba(178, 117, 47, .24)); border-radius: 999px; color: var(--gx-ui-primary, #9d672c); background: var(--gx-ui-surface, rgba(255, 250, 242, .8)); font-size: 10px; }
.energy-empty-state { display: grid; grid-template-columns: 64px 1fr; gap: 15px; align-items: center; margin: 20px 0; }
.energy-orbit { position: relative; display: grid; width: 60px; height: 60px; place-items: center; border: 1px solid var(--gx-ui-border, rgba(176, 114, 44, .35)); border-radius: 50%; }
.energy-orbit::before,
.energy-orbit::after { position: absolute; border: 1px solid var(--gx-ui-border, rgba(176, 114, 44, .2)); border-radius: 50%; content: ""; }
.energy-orbit::before { inset: 7px; }
.energy-orbit::after { width: 5px; height: 5px; top: 6px; right: 10px; border: 0; background: var(--gx-ui-primary, #bd7b2f); }
.energy-orbit i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gx-ui-primary, #e9c486), var(--gx-ui-primary, #9b5a16) 72%); box-shadow: 0 0 18px rgba(var(--gx-ui-shadow-rgb, 174, 111, 39), 0.3); }
.energy-empty-state strong { display: block; color: var(--gx-ui-primary, #4b3c2d); font-size: 14px; font-weight: 600; }
.energy-empty-state p { margin: 6px 0 0; color: var(--gx-ui-muted, #8a7a6b); font-size: 12px; line-height: 1.7; }

.space-primary-link { display: flex; min-height: 46px; align-items: center; justify-content: space-between; padding: 0 17px; border-radius: 999px; background: linear-gradient(135deg, var(--gx-ui-primary, #d79532), var(--gx-ui-primary, #b46e19)); color: #fff; font-size: 13px; letter-spacing: .05em; text-decoration: none; box-shadow: 0 10px 22px rgba(var(--gx-ui-shadow-rgb, 174, 105, 24), 0.18); }
.space-action-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center; min-height: 92px; padding: 18px 20px; color: inherit; text-align: left; text-decoration: none; }
.space-action-button { width: 100%; font: inherit; cursor: pointer; }
.space-action-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--gx-ui-border, rgba(188, 126, 55, .28)); border-radius: 50%; background: var(--gx-ui-surface, #fffaf2); color: var(--gx-ui-primary, #a4611d); font-family: "Noto Serif TC", "Songti TC", serif; font-size: 15px; }
.space-action-copy { min-width: 0; }
.space-action-copy strong,
.service-row strong { display: block; color: var(--gx-ui-text, #332a22); font-size: 16px; font-weight: 500; }
.space-action-copy small,
.service-row small { display: block; margin-top: 5px; color: var(--gx-ui-muted, #928476); font-size: 11px; line-height: 1.5; }
.space-action-meta { color: var(--gx-ui-primary, #aa753d); font-size: 10px; white-space: nowrap; }
.space-action-arrow,
.service-row > span:last-child { color: var(--gx-ui-primary, #c39a68); font-family: Georgia, serif; font-size: 22px; }

.service-card { overflow: hidden; }
.service-heading { padding: 20px 20px 16px; }
.service-row { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px; border-top: 1px solid var(--gx-ui-border, rgba(190, 136, 73, .18)); color: inherit; text-decoration: none; }
.space-logout { justify-self: center; margin: 2px 0 4px; padding: 8px 18px; border: 0; background: transparent; color: var(--gx-ui-muted, #9a8d80); font: inherit; font-size: 13px; cursor: pointer; }
.space-message { min-height: 22px; margin: -10px 0 0; text-align: center; }

@media (max-width: 640px) {
  .member-space { gap: 20px; }
  .space-heading { padding-top: 0; }
  .space-action-card { grid-template-columns: 42px minmax(0, 1fr) 12px; }
  .space-action-meta { display: none; }
}

@media (min-width: 720px) {
  .member-space { gap: 24px; }
  .space-heading { text-align: center; }
  .space-profile-card { padding-block: 28px 26px; }
  .space-profile-meta,
  .account-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-related-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .energy-card { padding: 24px; }
  .space-action-card,
  .service-row { padding-inline: 24px; }
}


/* Final customer acceptance: account actions remain comfortably tappable at every mobile width. */
.menu-button {
  width: 44px;
  height: 44px;
}

.space-logout {
  min-height: 44px;
}

/* Guest account center: show member value before requesting authentication. */
.guest-view {
  max-width: 680px;
}

.guest-dashboard {
  display: grid;
  gap: 22px;
}

.guest-heading {
  padding: 2px 4px 0;
}

.guest-heading h1 {
  margin: 0;
  color: var(--gx-ui-text, #2c241d);
  font-size: clamp(34px, 8vw, 46px);
  font-weight: 500;
  letter-spacing: .08em;
}

.guest-heading > p:last-child {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--gx-ui-muted, #7d7166);
  font-size: 14px;
  line-height: 1.8;
}

.guest-identity-card,
.guest-help-card {
  overflow: hidden;
  border: 1px solid var(--gx-ui-border, rgba(193, 137, 73, .28));
  border-radius: 22px;
  background: var(--gx-ui-surface, rgba(255, 253, 249, .95));
  box-shadow: 0 16px 42px rgba(var(--gx-ui-shadow-rgb, 84, 55, 27), 0.07);
}

.guest-identity-card {
  position: relative;
  padding: 24px;
  background:
    radial-gradient(circle at 95% -10%, var(--gx-ui-soft, rgba(214, 167, 104, .2)), transparent 45%),
    linear-gradient(145deg, var(--gx-ui-surface, #fffdf9), var(--gx-ui-soft, #f8f0e5));
}

.guest-identity-card::after {
  position: absolute;
  top: -115px;
  right: -100px;
  width: 250px;
  height: 250px;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, .13));
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.guest-identity {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.guest-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--gx-ui-primary, #9c5b18);
  font-size: 24px;
  border: 1px solid var(--gx-ui-border, rgba(186, 122, 50, .38));
  border-radius: 50%;
  background: var(--gx-ui-surface, #fffdf9);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .58);
}

.guest-avatar img,
.space-default-avatar {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.guest-identity-copy {
  min-width: 0;
}

.guest-identity-copy small {
  color: var(--gx-ui-primary, #a36a2c);
  font-size: 10px;
  letter-spacing: .16em;
}

.guest-identity-copy h2 {
  margin: 7px 0 5px;
  color: var(--gx-ui-text, #30271f);
  font-size: 21px;
  font-weight: 500;
}

.guest-identity-copy p {
  margin: 0;
  color: var(--gx-ui-muted, #8b7c6d);
  font-size: 12px;
  line-height: 1.65;
}

.guest-auth-actions {
  position: relative;
  z-index: 1;
  margin: 22px 0 20px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 10px;
}

.guest-auth-actions button {
  min-height: 48px;
  color: var(--gx-ui-primary, #9a5d1c);
  border: 1px solid var(--gx-ui-border, #dfc9ac);
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  cursor: pointer;
}

.guest-auth-actions button.is-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gx-ui-primary, #c88a31), var(--gx-ui-primary, #a96719));
  box-shadow: 0 9px 22px rgba(var(--gx-ui-shadow-rgb, 174, 106, 24), 0.2);
}

.guest-benefit-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--gx-ui-border, rgba(190, 136, 73, .18));
}

.guest-benefit-grid a {
  min-width: 0;
  min-height: 106px;
  padding: 18px 8px 8px;
  display: grid;
  justify-items: center;
  align-content: start;
  color: inherit;
  text-align: center;
  text-decoration: none;
  border-right: 1px solid var(--gx-ui-border, rgba(190, 136, 73, .14));
}

.guest-benefit-grid a:last-child {
  border-right: 0;
}

.guest-benefit-grid a > span {
  width: 38px;
  height: 38px;
  margin-bottom: 9px;
  display: grid;
  place-items: center;
  color: var(--gx-ui-primary, #a4611d);
  font-size: 13px;
  border: 1px solid var(--gx-ui-border, rgba(188, 126, 55, .27));
  border-radius: 50%;
  background: var(--gx-ui-surface, #fffaf2);
}

.guest-benefit-grid strong {
  font-size: 13px;
  font-weight: 500;
}

.guest-benefit-grid small {
  margin-top: 4px;
  color: var(--gx-ui-muted, #9a8d80);
  font-size: 9px;
  line-height: 1.4;
}

.guest-help-card > div {
  padding: 20px 20px 15px;
}

.guest-help-card h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
}

.guest-help-card > a,
.guest-help-card > button {
  width: 100%;
  min-height: 70px;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: inherit;
  text-align: left;
  text-decoration: none;
  border: 0;
  border-top: 1px solid var(--gx-ui-border, rgba(190, 136, 73, .18));
  background: transparent;
  cursor: pointer;
}

.guest-help-card strong,
.guest-help-card small {
  display: block;
}

.guest-help-card strong {
  color: var(--gx-ui-text, #3b3026);
  font-size: 14px;
  font-weight: 500;
}

.guest-help-card small {
  margin-top: 5px;
  color: var(--gx-ui-muted, #96887a);
  font-size: 11px;
  line-height: 1.5;
}

.guest-help-card i {
  color: var(--gx-ui-primary, #c39a68);
  font-size: 22px;
  font-style: normal;
}

.auth-card-back {
  position: relative;
  z-index: 2;
  min-height: 44px;
  margin-bottom: 18px;
}

.auth-assistance {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.auth-assistance a,
.auth-assistance button,
.reset-inline-actions a,
.reset-inline-actions button {
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  color: var(--gx-ui-primary, #96601f);
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.password-reset-panel {
  position: relative;
  z-index: 1;
}

.password-reset-panel h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.password-reset-panel > p:not(.eyebrow):not(.form-message) {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.customer-id-field,
.request-id-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
}

.request-id-field {
  font-size: 12px;
}

.reset-complete-form {
  margin-top: 24px;
}

.reset-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 18px;
  color: var(--gx-ui-muted, #9a8d80);
  font-size: 11px;
  letter-spacing: .14em;
}

.reset-divider::before,
.reset-divider::after {
  flex: 1;
  height: 1px;
  content: "";
  background: var(--gx-ui-soft, rgba(190, 136, 73, .2));
}

.reset-divider span {
  white-space: nowrap;
}

.reset-inline-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .guest-dashboard {
    gap: 20px;
  }

  .guest-identity-card {
    padding: 20px 18px;
  }

  .guest-identity {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
  }

  .guest-avatar {
    width: 62px;
    height: 62px;
  }

  .guest-identity-copy h2 {
    font-size: 18px;
  }

  .guest-benefit-grid {
    grid-template-columns: 1fr 1fr;
  }

  .guest-benefit-grid a {
    min-height: 104px;
    border-bottom: 1px solid var(--gx-ui-border, rgba(190, 136, 73, .14));
  }

  .guest-benefit-grid a:nth-child(2n) {
    border-right: 0;
  }

  .guest-benefit-grid a:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .auth-assistance,
  .reset-inline-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }
}

/* Account home v2: fixed-order mobile structure governed by the shared content shell. */
.gx-app .account-main {
  --gx-account-card-gap: 16px;
  padding-top: var(--gx-account-card-gap);
}

.gx-app .member-space {
  width: 100%;
  max-width: 100%;
  gap: var(--gx-account-card-gap);
}

.gx-app .account-identity-card,
.gx-app .account-energy-card,
.gx-app .account-service-card {
  overflow: hidden;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.22));
  border-radius: 20px;
  background: var(--gx-ui-surface, rgba(255, 253, 249, 0.96));
  box-shadow: 0 12px 32px rgba(var(--gx-ui-shadow-rgb, 77, 50, 25), 0.055);
}

.gx-app .account-identity-card {
  background:
    radial-gradient(circle at 4% -14%, var(--gx-ui-soft, rgba(211, 164, 100, 0.2)), transparent 42%),
    linear-gradient(145deg, var(--gx-ui-surface, #fffdf9), var(--gx-ui-soft, #faf3e9));
}

.gx-app .account-identity-main {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 11px;
  min-height: 112px;
  padding: 18px 16px 16px;
}

.gx-app .account-avatar {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  min-width: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.32));
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.56);
}

.gx-app .account-avatar :where(img, span) {
  width: 100%;
  height: 100%;
}

.gx-app .account-avatar img {
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.gx-app .account-identity-copy {
  display: grid;
  min-height: 58px;
  min-width: 0;
  align-content: center;
}

.gx-app .account-identity-copy h1 {
  margin: 0;
  color: var(--gx-ui-text, #2f271f);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(20px, 5.6cqi, 24px);
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gx-app .account-identity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-top: 8px;
  color: var(--gx-ui-muted, #817365);
  font-size: 12px;
  line-height: 1.25;
}

.gx-app .account-identity-meta span {
  min-width: 0;
}

.gx-app .account-identity-meta b {
  color: inherit;
  font-weight: 600;
}

.gx-app .account-member-badge,
.gx-app .account-id-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.gx-app .account-member-badge {
  background: var(--gx-ui-primary, #211e1a);
  color: #f1d5a3;
  letter-spacing: 0.04em;
}

.gx-app .account-id-badge {
  gap: 4px;
  background: var(--gx-ui-soft, #e4e1db);
  color: var(--gx-ui-muted, #5e5851);
  letter-spacing: 0.01em;
}

.gx-app .account-email {
  max-width: 100%;
  color: var(--gx-ui-muted, #817365);
  overflow-wrap: anywhere;
}

.gx-app .account-settings-entry {
  display: grid;
  min-width: 44px;
  min-height: 54px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  color: var(--gx-ui-primary, #815b32);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.gx-app .account-primary-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gx-app .account-primary-actions a {
  display: grid;
  min-width: 0;
  min-height: 92px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 10px 3px;
  color: var(--gx-ui-text, #3a3027);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.gx-app .account-secondary-actions {
  display: grid;
}

.gx-app .account-secondary-actions a {
  min-height: 62px;
  padding: 10px 17px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.gx-app .account-secondary-actions strong,
.gx-app .account-secondary-actions small {
  display: block;
}

.gx-app .account-secondary-actions strong {
  color: var(--gx-ui-text, #352c24);
  font-size: 14px;
  font-weight: 600;
}

.gx-app .account-secondary-actions small {
  margin-top: 3px;
  color: var(--gx-ui-muted, #887a6d);
  font-size: 12px;
  line-height: 1.45;
}

.gx-app .account-secondary-actions gx-icon {
  transform: rotate(-90deg);
}

.gx-app .account-primary-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.22));
  border-radius: 50%;
  background: var(--gx-ui-surface, rgba(255, 253, 249, 0.88));
}

.gx-app .account-primary-icon img {
  width: 22px;
  height: 22px;
}

.gx-app .account-energy-card {
  padding: 19px 17px 17px;
  background:
    radial-gradient(circle at 100% 0, var(--gx-ui-soft, rgba(199, 151, 86, 0.14)), transparent 42%),
    linear-gradient(145deg, var(--gx-ui-surface, #fffdf9), var(--gx-ui-soft, #f8f0e5));
}

.gx-app .account-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gx-app .account-card-heading p {
  margin: 0 0 4px;
  color: var(--gx-ui-primary, #a36a2c);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.gx-app .account-card-heading h2 {
  margin: 0;
  color: var(--gx-ui-text, #2f271f);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 20px;
  font-weight: 600;
}

.gx-app .account-card-heading > span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--gx-ui-border, rgba(178, 117, 47, 0.24));
  border-radius: 999px;
  background: var(--gx-ui-surface, rgba(255, 250, 242, 0.84));
  color: var(--gx-ui-primary, #98632a);
  font-size: 12px;
}

.gx-app .account-energy-body {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  margin: 16px 0;
}

.gx-app .account-energy-body .energy-orbit {
  width: 52px;
  height: 52px;
}

.gx-app .account-energy-body p {
  margin: 0;
  color: var(--gx-ui-muted, #76695d);
  font-size: 13px;
  line-height: 1.7;
}

.gx-app .account-energy-action {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--gx-ui-primary, #175941);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.gx-app .account-service-card .account-card-heading {
  padding: 18px 17px 14px;
}

.gx-app .account-service-row {
  display: grid;
  width: 100%;
  min-height: 70px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 12px 17px;
  border: 0;
  border-top: 1px solid var(--gx-ui-border, rgba(184, 118, 33, 0.16));
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.gx-app .account-service-row > img {
  width: 22px;
  height: 22px;
}

.gx-app .account-service-row strong,
.gx-app .account-service-row small {
  display: block;
}

.gx-app .account-service-row strong {
  color: var(--gx-ui-text, #352c24);
  font-size: 15px;
  font-weight: 600;
}

.gx-app .account-service-row small {
  margin-top: 3px;
  color: var(--gx-ui-muted, #887a6d);
  font-size: 12px;
  line-height: 1.45;
}

.gx-app :where(
  .account-avatar,
  .account-settings-entry,
  .account-primary-actions a,
  .account-secondary-actions a,
  .account-energy-action,
  .account-service-row,
  .space-logout
):focus-visible {
  outline: 2px solid var(--gx-ui-primary, #175941);
  outline-offset: 3px;
}

.gx-app .space-logout {
  justify-self: stretch;
  width: 100%;
  min-height: 48px;
  margin: 2px 0 0;
  border: 1px solid var(--gx-ui-border, rgba(147, 95, 40, 0.24));
  border-radius: 14px;
  background: var(--gx-ui-surface, rgba(255, 253, 249, 0.7));
  color: var(--gx-ui-primary, #7b5a3a);
  font-size: 14px;
}

/* Account resources: read-only bottom sheets that keep the account page in place. */
html.is-terms-open,
body.is-terms-open {
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-help-open,
body.is-help-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body:is(.is-terms-open, .is-help-open) {
  width: 100%;
  touch-action: none;
}

body:is(.is-terms-open, .is-help-open) .account-terms-scroll {
  touch-action: pan-y;
}

.gx-app .account-terms-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-items: end;
  justify-items: center;
  isolation: isolate;
}

.gx-app .account-terms-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(var(--gx-ui-text-rgb, 31, 27, 23), 0.48);
  backdrop-filter: blur(2px);
  cursor: default;
  animation: account-terms-backdrop-in 180ms ease-out both;
}

.gx-app .account-terms-dialog {
  position: relative;
  display: grid;
  width: 100%;
  max-width: none;
  height: 75vh;
  height: 75dvh;
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--gx-ui-text, #302a25);
  border: 1px solid var(--gx-ui-border, rgba(176, 151, 122, 0.2));
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: var(--gx-ui-surface, #fcfbf8);
  box-shadow: 0 -18px 54px rgba(var(--gx-ui-shadow-rgb, 37, 31, 25), 0.2);
  outline: none;
  animation: account-terms-sheet-in 220ms cubic-bezier(0.22, 0.74, 0.22, 1) both;
}

.gx-app .account-terms-sheet.is-closing .account-terms-backdrop {
  animation: account-terms-backdrop-out 180ms ease-in both;
}

.gx-app .account-terms-sheet.is-closing .account-terms-dialog {
  animation: account-terms-sheet-out 180ms ease-in both;
}

.gx-app .account-terms-header {
  position: relative;
  display: grid;
  min-height: 78px;
  place-items: center;
  padding: 17px 64px 15px;
  border-bottom: 1px solid var(--gx-ui-border, rgba(176, 151, 122, 0.18));
  background: var(--gx-ui-surface, rgba(252, 251, 248, 0.98));
}

.gx-app .account-terms-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.gx-app .account-terms-close {
  position: absolute;
  top: 19px;
  right: 16px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: var(--gx-ui-muted, #6f6a63);
  border: 0;
  border-radius: 50%;
  background: var(--gx-ui-soft, #f5f3ee);
  cursor: pointer;
}

.gx-app .account-terms-close img {
  width: 22px;
  height: 22px;
  opacity: 0.72;
}

.gx-app .account-terms-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  background: var(--gx-ui-surface, #fbfaf7);
  outline: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.gx-app .account-terms-content,
.gx-app .account-terms-state {
  width: min(100%, 732px);
  margin-inline: auto;
  padding: 20px 18px;
  border: 1px solid var(--gx-ui-border, rgba(176, 151, 122, 0.14));
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(var(--gx-ui-shadow-rgb, 64, 50, 35), 0.05);
}

.gx-app .account-terms-content {
  color: var(--gx-ui-muted, #45403a);
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.gx-app .account-terms-content > :first-child {
  margin-top: 0;
}

.gx-app .account-terms-content > p:first-child {
  margin-bottom: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--gx-ui-border, rgba(176, 151, 122, 0.18));
  color: var(--gx-ui-text, #302a25);
  font-size: 16px;
  line-height: 1.7;
}

.gx-app .account-terms-content > :last-child {
  margin-bottom: 0;
}

.gx-app .account-terms-content :where(h1, h2, h3, h4, h5, h6) {
  margin: 1.4em 0 0.55em;
  color: var(--gx-ui-text, #2f2924);
  font-weight: 600;
  line-height: 1.45;
}

.gx-app .account-terms-content h1 {
  font-size: 21px;
}

.gx-app .account-terms-content h2 {
  color: var(--gx-ui-muted, #3f5d50);
  font-size: 16px;
  letter-spacing: 0.025em;
}

.gx-app .account-terms-content :where(h3, h4, h5, h6) {
  font-size: 16px;
}

.gx-app .account-terms-content :where(p, ul, ol, blockquote, pre, table, details) {
  margin: 0 0 1em;
}

.gx-app .account-help-content > .account-help-intro {
  margin-bottom: 10px;
  color: var(--gx-ui-muted, #6f675f);
}

.gx-app .account-terms-content .account-help-steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gx-app .account-terms-content .account-help-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  margin-top: 0;
  padding: 17px 0;
  border-top: 1px solid var(--gx-ui-border, rgba(176, 151, 122, 0.18));
}

.gx-app .account-terms-content .account-help-step:first-child {
  border-top: 0;
}

.gx-app .account-help-step-number {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--gx-ui-primary, #9b5f20);
  border: 1px solid var(--gx-ui-border, rgba(190, 123, 41, 0.3));
  border-radius: 50%;
  background: var(--gx-ui-surface, #fffaf2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.gx-app .account-help-step h2 {
  margin: 0 0 5px;
  color: var(--gx-ui-muted, #3f5d50);
  font-size: 16px;
  letter-spacing: 0.025em;
}

.gx-app .account-help-step p {
  margin: 0;
  color: var(--gx-ui-muted, #5e5750);
}

.gx-app .account-terms-content :where(ul, ol) {
  padding-left: 1.5em;
}

.gx-app .account-terms-content li + li {
  margin-top: 0.45em;
}

.gx-app .account-terms-content a,
.gx-app .account-terms-full-link,
.gx-app .account-terms-state a {
  color: var(--gx-ui-primary, #176448);
  text-underline-offset: 3px;
}

.gx-app .account-terms-content blockquote {
  padding-left: 14px;
  border-left: 3px solid var(--gx-ui-border, rgba(23, 100, 72, 0.28));
  color: var(--gx-ui-muted, #686057);
}

.gx-app .account-terms-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gx-app .account-terms-content :where(th, td) {
  padding: 8px;
  border: 1px solid var(--gx-ui-border, #e8e1d7);
  text-align: left;
  vertical-align: top;
}

.gx-app .account-terms-content pre {
  max-width: 100%;
  padding: 12px;
  overflow: auto;
  border-radius: 10px;
  background: var(--gx-ui-soft, #f4f1eb);
  white-space: pre-wrap;
}

.gx-app .account-terms-state {
  display: grid;
  min-height: 180px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.gx-app .account-terms-state strong {
  color: var(--gx-ui-text, #332d28);
  font-size: 17px;
  font-weight: 600;
}

.gx-app .account-terms-state p {
  max-width: 290px;
  margin: 10px 0 0;
  color: var(--gx-ui-muted, #7b7269);
  font-size: 13px;
  line-height: 1.7;
}

.gx-app .account-terms-state :where(button, a) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 9px 20px;
  border: 1px solid var(--gx-ui-border, rgba(23, 100, 72, 0.3));
  border-radius: 999px;
  background: #fff;
  color: var(--gx-ui-primary, #176448);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.gx-app .account-terms-full-link {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 15px auto 0;
  font-size: 13px;
  text-align: center;
}

.gx-app :where(.account-terms-close, .account-terms-scroll, .account-terms-state button, .account-terms-state a, .account-terms-full-link):focus-visible {
  outline: 2px solid var(--gx-ui-primary, #176448);
  outline-offset: 3px;
}

@keyframes account-terms-sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes account-terms-sheet-out {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@keyframes account-terms-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes account-terms-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 360px) {
  .gx-app .account-terms-scroll {
    padding-inline: 14px;
  }

  .gx-app .account-terms-content,
  .gx-app .account-terms-state {
    padding-inline: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gx-app .account-terms-backdrop,
  .gx-app .account-terms-dialog,
  .gx-app .account-terms-sheet.is-closing .account-terms-backdrop,
  .gx-app .account-terms-sheet.is-closing .account-terms-dialog {
    animation-duration: 1ms;
  }
}

/* Guest/auth refresh: intentionally scoped; member and settings styles stay intact. */
.gx-app .guest-view { width: 100%; max-width: 100%; }
.gx-app .guest-view .guest-dashboard { gap: 16px; }
.gx-app .guest-view .guest-identity-card {
  padding: 18px 16px 0;
  border-radius: 20px;
  border-color: var(--gx-ui-border, rgba(184, 118, 33, .22));
  background: var(--gx-ui-surface, #fcf8f1);
  box-shadow: 0 12px 32px rgba(var(--gx-ui-shadow-rgb, 77, 50, 25), 0.055);
}
.gx-app .guest-view .guest-identity-card::after,
.gx-app .guest-view .login-card::before { content: none; }
.gx-app .guest-view .guest-identity {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
.gx-app .guest-view .guest-avatar { width: 58px; height: 58px; margin-top: 3px; }
.gx-app .guest-view .guest-identity-copy h1 {
  margin: 0 0 5px;
  font-size: clamp(20px, 5.6cqi, 24px);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-weight: 600;
  line-height: 1.3;
}
.gx-app .guest-view .guest-identity-copy p { font-size: 13px; color: var(--gx-ui-muted, #756657); }
.gx-app .guest-view .guest-auth-actions {
  margin: 10px 0 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 240px;
}
.gx-app .guest-view .guest-auth-actions button {
  min-height: 44px;
  color: var(--gx-ui-text, #195741);
  border-color: var(--gx-ui-primary, #195741);
  font-size: 15px;
  font-weight: 600;
  background: var(--gx-ui-surface, #fffdf9);
  box-shadow: none;
}
.gx-app .guest-view .guest-auth-actions .is-primary { background: var(--gx-ui-primary, #195741); color: white; }
.gx-app .guest-view .guest-benefit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); border: 0; margin-top: 16px; }
.gx-app .guest-view .guest-benefit-grid a { padding: 8px 2px 16px; min-height: 84px; border: 0; }
.gx-app .guest-view .guest-benefit-grid img { width: 21px; height: 21px; }
.gx-app .guest-view .guest-benefit-grid a > span { background: var(--gx-ui-surface, #fffdf9); }
.gx-app .guest-view .account-secondary-actions { padding-inline: 0; }
.gx-app .guest-view .guest-energy-image { width: 50px; height: 50px; border-radius: 50%; }
.gx-app .guest-view .guest-recovery-entry {
  justify-self: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--gx-ui-primary, #805426);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.gx-app .guest-view .login-card {
  padding: 20px;
  border-radius: 20px;
  background: var(--gx-ui-surface, #fffdf9);
  box-shadow: 0 12px 32px rgba(var(--gx-ui-shadow-rgb, 77, 50, 25), 0.055);
}
.gx-app .guest-view .auth-switch { margin-bottom: 22px; }
.gx-app .guest-view .auth-switch button.is-active,
.gx-app .guest-view .primary-button { background: var(--gx-ui-primary-hover, #195741); color: #fff; box-shadow: none; }
.gx-app .guest-view .primary-button { min-height: 48px; border-radius: 999px; }
.gx-app .guest-view .form-heading { margin-bottom: 20px; }
.gx-app .guest-view .form-heading h1 { font-size: 24px; margin: 0 0 8px; }
.gx-app .guest-view .form-heading p { font-size: 14px; line-height: 1.6; }
.gx-app .guest-view .field-label { font-size: 14px; }
.gx-app .guest-view .auth-field,
.gx-app .guest-view .password-control { height: 48px; border-radius: 12px; margin-bottom: 16px; }
.gx-app .guest-view .auth-field,
.gx-app .guest-view .password-control input { font-size: 16px; min-width: 0; }
.gx-app .guest-view .password-control button { min-width: 48px; min-height: 44px; color: var(--gx-ui-text, #195741); }
.gx-app .guest-view .login-card .password-control input { border: 0; background: transparent; box-shadow: none; }
.gx-app .guest-view .password-control button { border: 0; background: transparent; box-shadow: none; }
.gx-app .guest-view :where(button, a, input, select):focus-visible {
  outline: 2px solid var(--gx-ui-primary, #195741);
  outline-offset: 3px;
}
.gx-app .guest-view .password-control:focus-within {
  border-color: var(--gx-ui-primary, #195741);
  outline: 2px solid var(--gx-ui-primary, #195741);
  outline-offset: 3px;
}
.gx-app .guest-view .password-control input:focus-visible { outline: none; }
.gx-app .guest-view .auth-ui-preview-note { font-size: 12px; line-height: 1.5; color: var(--gx-ui-muted, #756657); }
.gx-app .guest-view .auth-ui-steps { margin: 0 0 20px; color: var(--gx-ui-text, #195741); font-size: 13px; }
.gx-app .guest-view .auth-ui-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.gx-app .guest-view .auth-ui-code button { height: 48px; border: 1px solid var(--gx-ui-primary, #195741); border-radius: 12px; color: var(--gx-ui-text, #195741); background: transparent; padding: 0 12px; }
.gx-app .guest-view .auth-ui-message { color: var(--gx-ui-error, #975047); font-size: 14px; line-height: 1.6; min-height: 24px; }

/* Desktop help and terms share a bounded dialog with internal scrolling. */
@media (min-width: 768px) {
  .gx-app .account-terms-sheet {
    box-sizing: border-box;
    padding: 24px;
    align-items: center;
    min-width: 0;
    min-height: 0;
  }
  .gx-app .account-terms-sheet .account-terms-dialog {
    box-sizing: border-box;
    width: 100%;
    max-width: 860px;
    min-width: 0;
    min-height: 0;
    height: min(780px, calc(100vh - 48px));
    height: min(780px, calc(100dvh - 48px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    border-bottom: 1px solid var(--gx-ui-border, rgba(176, 151, 122, 0.2));
    border-radius: 24px;
  }
  .gx-app .account-terms-sheet :is(.account-terms-scroll, .account-terms-content, .account-terms-state) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
