:root {
  color-scheme: dark;
  --profile-bg: #0d0b07;
  --profile-panel: #17130c;
  --profile-panel-soft: #1d170d;
  --profile-gold: #f2ca50;
  --profile-gold-deep: #d4af37;
  --profile-text: #eee5d7;
  --profile-muted: rgba(238, 229, 215, 0.64);
  --profile-line: rgba(212, 175, 55, 0.26);
  --profile-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --profile-sans: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--profile-bg);
}

body.profile-shell {
  min-height: 100vh;
  color: var(--profile-text);
  font-family: var(--profile-sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.11), transparent 17rem),
    linear-gradient(180deg, #110e07 0%, var(--profile-bg) 52%, #090704 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.profile-main {
  width: min(100%, 448px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 38px 20px calc(112px + env(safe-area-inset-bottom));
}

.profile-topbar {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 28px;
}

.profile-topbar h1 {
  grid-column: 2;
  margin: 0;
  text-align: center;
  color: #f7f1e6;
  font-family: var(--profile-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.profile-back {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--profile-gold);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.profile-back:active {
  background: rgba(242, 202, 80, 0.1);
}

.profile-topbar-spacer {
  display: block;
  width: 40px;
  height: 40px;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -8px 2px 26px;
}

.profile-avatar {
  display: grid;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid rgba(242, 202, 80, 0.44);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.18), transparent 26%),
    linear-gradient(145deg, #2c2210, #151007);
  color: var(--profile-gold);
  box-shadow:
    inset 0 0 0 5px rgba(242, 202, 80, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.24);
  font-family: var(--profile-serif);
  font-size: 27px;
  font-weight: 700;
}

.profile-avatar-letter {
  line-height: 1;
}

.profile-summary-main {
  display: grid;
  min-width: 0;
  gap: 8px;
  justify-items: start;
}

.profile-summary-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 8px 8px 8px 3px;
  background: linear-gradient(135deg, #d8aa35, #8e6511);
  color: #fff9e8;
  box-shadow: 0 6px 16px rgba(142, 101, 17, 0.24);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.profile-summary-phone {
  overflow: hidden;
  max-width: 100%;
  color: #f7f1e6;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary-badge.is-admin {
  background: linear-gradient(135deg, #d05a4a, #8d2f2a);
  box-shadow: 0 6px 16px rgba(141, 47, 42, 0.28);
}

.profile-summary-badge.is-vip {
  background: linear-gradient(135deg, #e2b93d, #9b7015);
  box-shadow: 0 6px 18px rgba(155, 112, 21, 0.34);
}

.profile-summary-badge.is-svip {
  background: linear-gradient(135deg, #b98cf0, #6b3fa0);
  box-shadow: 0 6px 18px rgba(107, 63, 160, 0.36);
}

.profile-vip-card {
  margin: 0 2px 26px;
  padding: 18px;
  border: 1px solid rgba(242, 202, 80, 0.34);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(242, 202, 80, 0.12), rgba(255, 255, 255, 0.025));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.profile-vip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-vip-card .profile-kicker {
  margin-bottom: 6px;
}

.profile-vip-card h2 {
  margin: 0;
  color: #f7f1e6;
  font-family: var(--profile-serif);
  font-size: 19px;
  font-weight: 700;
}

.profile-vip-copy {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--profile-muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
}

.profile-vip-copy:hover,
.profile-vip-copy:focus-visible {
  color: #f2ca50;
}

.profile-vip-copy:focus-visible {
  outline: 1px solid rgba(242, 202, 80, 0.72);
  outline-offset: 3px;
  border-radius: 4px;
}

.profile-vip-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-vip-entitlement {
  padding: 14px;
  border: 1px solid rgba(242, 202, 80, 0.22);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.profile-vip-entitlement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-vip-source {
  color: var(--profile-text);
  font-size: 16px;
  font-weight: 700;
}

.profile-vip-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(242, 202, 80, 0.14);
  color: var(--profile-gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-vip-detail {
  margin: 8px 0 0;
  color: var(--profile-muted);
  font-size: 13px;
  line-height: 1.5;
}

.profile-vip-meta {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(238, 229, 215, 0.1);
}

.profile-vip-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.profile-vip-meta dt {
  color: var(--profile-muted);
  font-size: 12px;
}

.profile-vip-meta dd {
  margin: 0;
  color: var(--profile-text);
  font-size: 13px;
  text-align: right;
}

.profile-menu {
  display: grid;
  gap: 12px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 18px;
  border: 1px solid var(--profile-line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  border-color: rgba(242, 202, 80, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018));
  transform: translateY(-1px);
}

.profile-menu-item:active {
  transform: translateY(0);
}

.profile-menu-title {
  color: #f4eee2;
  font-family: var(--profile-serif);
  font-size: 17px;
  font-weight: 700;
}

.profile-menu-arrow {
  color: var(--profile-gold);
  font-size: 28px;
  line-height: 1;
}

.profile-card {
  border: 1px solid var(--profile-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  padding: 22px;
}

.profile-kicker {
  margin: 0 0 8px;
  color: var(--profile-gold);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.profile-card h2 {
  margin: 0;
  color: #f7f1e6;
  font-family: var(--profile-serif);
  font-size: 21px;
  font-weight: 700;
}

.profile-copy {
  margin: 10px 0 0;
  color: var(--profile-muted);
  font-size: 14px;
  line-height: 1.7;
}

.profile-data-list {
  display: grid;
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid rgba(238, 229, 215, 0.1);
}

.profile-data-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(238, 229, 215, 0.1);
}

.profile-data-label {
  flex: 0 0 auto;
  color: var(--profile-muted);
  font-size: 14px;
}

.profile-data-value {
  color: var(--profile-text);
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
}

.profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(242, 202, 80, 0.42);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(242, 202, 80, 0.17), rgba(242, 202, 80, 0.08));
  color: var(--profile-gold);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.profile-button:hover,
.profile-button:focus-visible {
  border-color: rgba(242, 202, 80, 0.75);
}

.profile-button.secondary {
  border-color: rgba(238, 229, 215, 0.26);
  background: transparent;
  color: var(--profile-text);
}

.profile-button.danger {
  border-color: rgba(255, 183, 174, 0.32);
  background: transparent;
  color: #ffb7ae;
}

.profile-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 2px solid var(--profile-gold);
  background: rgba(242, 202, 80, 0.08);
  color: var(--profile-muted);
  font-size: 13px;
  line-height: 1.7;
}

.profile-empty {
  margin-top: 20px;
  padding: 28px 20px;
  border: 1px dashed rgba(242, 202, 80, 0.3);
  border-radius: 14px;
  color: var(--profile-muted);
  text-align: center;
}

.profile-empty strong {
  display: block;
  color: var(--profile-text);
  font-family: var(--profile-serif);
  font-size: 17px;
}

.profile-empty p {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.7;
}

.profile-exam-records {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.profile-exam-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-exam-overview-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(242, 202, 80, 0.2);
  border-radius: 12px;
  background: rgba(242, 202, 80, 0.055);
}

.profile-exam-overview-item strong {
  color: var(--profile-gold);
  font-size: 22px;
  line-height: 1;
}

.profile-exam-overview-item span {
  color: var(--profile-muted);
  font-size: 12px;
  white-space: nowrap;
}

.profile-exam-section {
  display: grid;
  gap: 10px;
}

.profile-exam-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-exam-section-head h3 {
  margin: 0;
  color: #f4eee2;
  font-family: var(--profile-serif);
  font-size: 16px;
  font-weight: 700;
}

.profile-exam-section-head span {
  color: var(--profile-muted);
  font-size: 12px;
}

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

.profile-exam-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(238, 229, 215, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  color: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.profile-exam-record:hover,
.profile-exam-record:focus-visible {
  border-color: rgba(242, 202, 80, 0.44);
  background: rgba(242, 202, 80, 0.07);
}

.profile-exam-record:focus-visible {
  outline: 2px solid rgba(242, 202, 80, 0.72);
  outline-offset: 2px;
}

.profile-exam-record-main {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}

.profile-exam-record-main strong {
  overflow: hidden;
  color: var(--profile-text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-exam-record-main span {
  color: var(--profile-muted);
  font-size: 12px;
}

.profile-exam-record-score {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 2px;
  color: var(--profile-gold);
}

.profile-exam-record-score strong {
  font-family: var(--profile-serif);
  font-size: 22px;
  line-height: 1;
}

.profile-exam-record-score span {
  font-size: 12px;
}

.profile-exam-record-arrow {
  flex: 0 0 auto;
  color: rgba(242, 202, 80, 0.72);
  font-size: 22px;
  line-height: 1;
}

.profile-empty-compact {
  margin-top: 0;
  padding: 20px 14px;
}

.profile-qr {
  display: grid;
  width: min(100%, 250px);
  margin: 22px auto 0;
  padding: 12px;
  place-items: center;
  border-radius: 16px;
  background: #fff;
}

.profile-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.profile-contact-line {
  margin: 18px 0 0;
  color: var(--profile-gold);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.profile-error {
  margin: 18px 0 0;
  color: #ffb7ae;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .profile-main {
    padding-right: 18px;
    padding-left: 18px;
  }

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