#pg-profile {
  background: #f5f5f7;
}

#pg-profile .ph,
#pg-profile .profile-layout {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

#pg-profile.profile-guest .profile-menu .mi {
  color: var(--gray-5);
}

.ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 16px;
  color: #1d2129;
  text-align: left;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.account-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.station-badge {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  color: #fff;
  background: #1677ff;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.ph .pn {
  color: #1d2129;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
  word-break: break-word;
}

.ph .pr {
  color: #86909c;
  font-size: 12px;
  line-height: 1.45;
}

.role-switch {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  align-self: center;
  flex-wrap: wrap;
}

.role-pill {
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  color: #4e5969;
  background: #f2f3f5;
  font-size: 12px;
  font-weight: 650;
}

.role-pill.act {
  color: #fff;
  background: #1677ff;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(150px, 164px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 4px 14px;
}

.profile-detail {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}

.profile-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 18px 18px 68px;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(4px);
}

body.profile-auth-modal-lock {
  overflow: hidden;
}

.profile-auth-card {
  width: min(360px, calc(100vw - 36px));
  max-height: min(560px, calc(100vh - 92px));
  overflow: auto;
  border: 1px solid rgba(229, 231, 235, 0.94);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.profile-auth-card-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-2);
  background: rgba(255, 255, 255, 0.96);
}

.profile-auth-card-head h2 {
  margin: 0;
  color: #1d2129;
  font-size: 18px;
  line-height: 1.25;
}

.profile-auth-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #4e5969;
  background: #f2f3f5;
  font-size: 22px;
  line-height: 1;
}

.profile-menu {
  display: grid;
  gap: 7px;
  align-self: start;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.profile-section-title {
  padding: 0 10px 1px;
  color: #4e5969;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.profile-section-title.vip-title {
  color: #1677ff;
}

.profile-menu-group {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.035);
}

.profile-menu-group.vip-section {
  background: #f9faff;
}

.profile-detail {
  min-height: 240px;
}

.profile-detail .hbar {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--gray-2);
  background: #fff;
}

.profile-detail .ptitle {
  color: var(--gray-6);
  font-size: 14px;
  font-weight: 800;
}

.profile-detail .empty {
  padding: 24px 12px;
  color: var(--gray-5);
  font-size: 13px;
  line-height: 1.6;
}

.profile-data-card,
.profile-data-list,
.profile-data-table {
  margin: 12px;
}

.profile-data-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--gray-2);
  border-radius: 12px;
  background: #fff;
}

.profile-data-title,
.profile-record-title {
  color: var(--gray-6);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.profile-data-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--gray-5);
  font-size: 12px;
  line-height: 1.45;
}

.profile-data-value {
  color: var(--gray-6);
  font-weight: 700;
  word-break: break-word;
}

.profile-data-list {
  display: grid;
  gap: 8px;
}

.profile-record {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--gray-2);
  border-radius: 10px;
  background: #fff;
}

.profile-record-meta,
.profile-record-sub {
  color: var(--gray-5);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.profile-data-table {
  overflow-x: auto;
}

.profile-recharge-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 12px;
  padding: 10px;
  border: 1px solid var(--gray-2);
  border-radius: 12px;
  background: #fff;
}

.profile-recharge-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--gray-6);
  font-size: 12px;
  font-weight: 720;
}

.profile-recharge-field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--gray-2);
  border-radius: 9px;
  color: var(--gray-6);
  background: #fff;
  font-size: 13px;
}

.profile-recharge-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-recharge-form button {
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.profile-recharge-form .profile-recharge-option {
  color: var(--gray-6);
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: 10px;
}

.profile-recharge-form .profile-recharge-option.is-selected {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.profile-recharge-form button:disabled {
  opacity: 0.55;
}

.profile-recharge-note {
  grid-column: 1 / -1;
  color: var(--gray-5);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.profile-recharge-result {
  margin-bottom: 8px;
}

.profile-pay-amount {
  margin-bottom: 8px;
  color: var(--gray-6);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.profile-pay-code-link {
  display: inline-block;
}

.profile-pay-code {
  display: block;
  width: min(100%, 280px);
  max-height: 380px;
  object-fit: contain;
  border: 1px solid var(--gray-2);
  border-radius: 10px;
  background: #fff;
}

.profile-pay-code-hint {
  margin-top: 8px;
  color: var(--gray-5);
  font-size: 12px;
  line-height: 1.5;
}

.profile-pay-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-recharge-form .profile-pay-code-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--gray-2);
  border-radius: 10px;
  color: var(--gray-6);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.profile-data-tr {
  min-width: 560px;
  display: grid;
  grid-template-columns: 90px 70px 80px minmax(150px, 1fr) 92px;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--gray-2);
  color: var(--gray-6);
  font-size: 12px;
  line-height: 1.35;
}

.profile-data-head {
  border-radius: 10px 10px 0 0;
  background: #f7f8fa;
  color: var(--gray-5);
  font-weight: 800;
}

.profile-auth-form {
  display: grid;
  gap: 7px;
  padding: 12px 14px 14px;
}

.profile-auth-form label {
  min-height: 34px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--gray-6);
  font-size: 12px;
  font-weight: 700;
}

.profile-auth-form label span {
  padding-left: 7px;
  color: #4e5969;
  white-space: nowrap;
}

.profile-auth-form input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--gray-2);
  border-radius: 12px;
  background: #fff;
  color: var(--gray-6);
  font-size: 13px;
}

.profile-auth-form input::placeholder {
  color: #a8b0bd;
}

.profile-auth-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.profile-auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 6px;
}

.profile-auth-form button {
  height: 36px;
  border-radius: 19px;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.profile-auth-form .profile-auth-secondary {
  color: #1d2129;
  background: #f2f3f5;
}

.profile-auth-form button:disabled {
  color: rgba(255, 255, 255, 0.72);
  background: #8ab4f8;
}

.profile-auth-error,
.profile-auth-success {
  min-height: 20px;
  font-size: 12px;
  line-height: 1.45;
}

.profile-auth-error {
  color: var(--danger);
}

.profile-auth-success {
  color: var(--success);
}

@media (max-width: 360px) {
  .profile-auth-form label {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .profile-auth-code-row {
    grid-template-columns: minmax(0, 1fr) 82px;
  }
}

.station-brand-form {
  display: grid;
  gap: 12px;
  padding: 14px 12px 18px;
}

.brand-form-note {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  color: #4e5969;
  font-size: 12px;
  line-height: 1.55;
  padding: 10px;
}

.brand-field {
  display: grid;
  gap: 6px;
  color: #1d2129;
  font-size: 13px;
  font-weight: 720;
}

.brand-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--gray-2);
  border-radius: 10px;
  background: #fff;
  color: var(--gray-6);
  font-size: 13px;
  padding: 0 11px;
}

.brand-field input[type="file"] {
  height: auto;
  padding: 9px;
  color: #4e5969;
  background: #f7f8fa;
}

.brand-upload-preview {
  display: grid;
  gap: 8px;
}

.brand-preview {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.brand-preview img {
  display: block;
  width: 100%;
  max-height: 118px;
  object-fit: contain;
  background: #f7f8fa;
}

.station-brand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.station-brand-actions button {
  height: 36px;
  border-radius: 18px;
  padding: 0 14px;
  color: #fff;
  background: #1677ff;
  font-size: 13px;
  font-weight: 800;
}

.station-brand-actions button[type="button"] {
  color: #1d2129;
  background: #f2f3f5;
}

.station-brand-actions button:disabled {
  opacity: 0.55;
}

.mi {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 11px 10px;
  border: 0;
  border-bottom: 1px solid #eef0f3;
  border-radius: 0;
  color: #1d2129;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-size: 14px;
}

.mi:last-child {
  border-bottom: none;
}

.mi:active {
  opacity: 0.7;
}

.mi.act {
  color: #1677ff;
  background: #f0f7ff;
}

.mi .ml2 {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.mi .ml2 .mi2 {
  width: 24px;
  flex: 0 0 24px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.mi-text {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.mi-title {
  color: #1d2129;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.25;
}

.mi-desc {
  overflow: hidden;
  color: #86909c;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mi.act .mi-title {
  color: #1677ff;
}

.mi .ma {
  display: block;
  margin-left: auto;
  color: #c9cdd4;
  font-size: 18px;
}

@media (min-width: 700px) {
  .profile-layout {
    grid-template-columns: 164px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 4px;
  }

  .profile-detail {
    min-height: 280px;
  }

  .mi {
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .ph {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .role-switch {
    justify-content: flex-start;
  }

  .profile-layout {
    grid-template-columns: minmax(138px, 40%) minmax(0, 1fr);
    gap: 8px;
  }

  .mi {
    min-height: 58px;
    padding: 10px 8px;
  }

  .mi .ml2 {
    gap: 8px;
  }

  .mi .ml2 .mi2 {
    width: 24px;
    flex-basis: 24px;
    font-size: 18px;
  }

  .profile-recharge-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
