.profile-page {
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-card,
.profile-section-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 18px);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.profile-card-compact {
  padding: 16px 20px 18px;
}

.profile-card-head h3,
.profile-section-card > h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.profile-card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-card-desc,
.profile-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.profile-head-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.profile-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-dim, #f8fafc);
  min-height: 118px;
}

.profile-meta-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.profile-col-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  word-break: break-all;
  line-height: 1.35;
  min-height: 1.35em;
}

.profile-empty {
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.75;
}

.profile-col-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: auto;
}

.profile-col-edit {
  align-self: flex-start;
  margin-top: 4px;
}

.profile-logout-btn {
  color: var(--red, #dc2626) !important;
  border-color: rgba(220, 38, 38, 0.25) !important;
}

.profile-logout-btn:hover {
  background: rgba(220, 38, 38, 0.08) !important;
}

.profile-membership-host,
.profile-logs-host,
.profile-token-balance {
  min-width: 0;
}

.profile-token-balance-inner .profile-card-head {
  margin-bottom: 14px;
}

.profile-token-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-token-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-dim, #f8fafc);
}

.profile-token-stat strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.profile-edit-modal-content {
  max-width: 360px;
  width: 100%;
}

.profile-edit-modal-content .modal-header {
  padding: 16px 20px;
}

.profile-edit-modal-content .modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
}

.profile-form-modal {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-field {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.profile-form-modal label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  text-align: right;
  white-space: nowrap;
}

.profile-form-modal label::after {
  content: "：";
}

.profile-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.profile-form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-form input[type="text"],
.profile-form input[type="password"],
.profile-form input[type="email"],
.profile-form input[type="tel"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  font-size: 14px;
  background: #fff;
}

.profile-form-submit {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .profile-cols,
  .profile-token-stats {
    grid-template-columns: 1fr;
  }
  .profile-card-head-row {
    flex-direction: column;
  }
  .profile-field {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
  }
  .profile-form-row {
    flex-wrap: wrap;
  }
  .profile-edit-modal-content .modal-body {
    padding: 14px 16px 16px;
  }
}
