:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: rgba(10, 16, 25, 0.78);
  --panel-strong: rgba(12, 19, 29, 0.94);
  --line: rgba(171, 241, 255, 0.22);
  --line-strong: rgba(83, 245, 255, 0.52);
  --text: #eef9ff;
  --muted: #94a7b7;
  --cyan: #53f5ff;
  --green: #2ff68d;
  --magenta: #ff4fd8;
  --amber: #ffba4a;
  --coral: #ff695d;
  --blue: #4c8dff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
a,
input {
  font: inherit;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
}

.hero-surface {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 22px clamp(16px, 3.4vw, 52px) 42px;
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.94) 0%, rgba(7, 9, 13, 0.74) 46%, rgba(7, 9, 13, 0.55) 100%),
    url("/assets/cyber-hero.png") center / cover no-repeat;
}

.hero-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(83, 245, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 79, 216, 0.04) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(90deg, black, transparent 80%);
}

.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 9px, rgba(255, 255, 255, 0.025) 10px);
  mix-blend-mode: screen;
  opacity: 0.56;
}

.top-strip,
.layout-grid {
  position: relative;
  z-index: 1;
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto 34px;
}

.brand-link,
.top-actions,
.action-row,
.status-row,
.panel-heading,
.login-row,
.admin-actions {
  display: flex;
  align-items: center;
}

.brand-link {
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(83, 245, 255, 0.08);
  color: var(--cyan);
  box-shadow: 0 0 24px rgba(83, 245, 255, 0.22);
}

.top-actions,
.admin-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-link,
.secondary-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: rgba(5, 10, 16, 0.58);
  color: var(--muted);
}

.secondary-link {
  color: var(--cyan);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.68);
  color: var(--cyan);
  font-size: 13px;
}

.layout-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.96fr) minmax(360px, 1.04fr);
  gap: 18px;
  align-items: start;
}

.profile-console,
.mbti-console,
.wechat-menu,
.signal-panel,
.admin-panel,
.admin-login {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.profile-console {
  padding: clamp(18px, 3vw, 28px);
}

.profile-main {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.avatar {
  width: 112px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 1px rgba(83, 245, 255, 0.45), 0 0 36px rgba(83, 245, 255, 0.24);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 98px);
  line-height: 0.88;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(83, 245, 255, 0.28), 4px 0 0 rgba(255, 79, 216, 0.22);
}

h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.18;
  letter-spacing: 0;
}

.location {
  margin: 12px 0 0;
  color: rgba(238, 249, 255, 0.64);
  font-size: 22px;
}

.wechat-id {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.wechat-id span {
  color: var(--text);
}

.status-row {
  gap: 10px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.status-chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  color: rgba(238, 249, 255, 0.78);
  background: rgba(255, 255, 255, 0.04);
}

.status-pulse {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--green) 0 5px, transparent 6px),
    rgba(47, 246, 141, 0.08);
  box-shadow: 0 0 24px rgba(47, 246, 141, 0.2);
}

.status-text,
.privacy-line {
  color: var(--muted);
}

.action-row {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  color: #031116;
  font-weight: 800;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 12px 32px rgba(83, 245, 255, 0.2);
}

.secondary-button {
  color: var(--text);
  border-color: var(--line);
  background: rgba(5, 10, 16, 0.62);
  box-shadow: none;
}

.secondary-button.compact {
  min-height: 40px;
}

.button-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  flex: 0 0 auto;
}

.privacy-line {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.mbti-console {
  min-height: 388px;
  padding: clamp(18px, 3vw, 28px);
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.mini-meter {
  min-width: 74px;
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  text-align: center;
  color: var(--cyan);
  background: rgba(83, 245, 255, 0.08);
}

.test-stage p {
  color: var(--muted);
  line-height: 1.7;
}

.test-kicker {
  margin: 0 0 10px;
  color: var(--magenta);
  font-size: 12px;
  font-weight: 900;
}

.question-block {
  animation: enter 0.22s ease-out both;
}

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

.answer-button {
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
}

.answer-button:hover,
.menu-row:hover,
.ghost-link:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 28px rgba(83, 245, 255, 0.16);
}

.answer-button span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cyan);
  background: rgba(83, 245, 255, 0.08);
}

.axis-stack {
  display: grid;
  gap: 12px;
  margin: 18px 0 20px;
}

.axis-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.axis-track {
  height: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.axis-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
}

.wechat-menu {
  grid-column: 1;
  overflow: hidden;
}

.menu-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 44px minmax(74px, 0.52fr) minmax(0, 1fr) 20px;
  gap: 14px;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 12, 18, 0.62);
  color: var(--text);
  text-align: left;
}

.menu-row:last-child {
  border-bottom: 0;
}

.menu-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  font-weight: 900;
}

.menu-row span:nth-child(2) {
  font-size: 22px;
  font-weight: 800;
}

.menu-row small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: right;
}

.chevron {
  color: rgba(238, 249, 255, 0.45);
  font-size: 26px;
}

.green { color: var(--green); }
.blue { color: var(--blue); }
.cyan { color: var(--cyan); }
.amber { color: var(--amber); }
.coral { color: var(--coral); }
.yellow { color: #ffd84d; }
.gear { color: #9dd3ff; }

.signal-panel {
  min-height: 300px;
  padding: clamp(18px, 3vw, 28px);
}

.signal-panel p {
  color: var(--muted);
  line-height: 1.8;
}

.signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.signal-list span {
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--cyan);
  background: rgba(83, 245, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.qr-dialog {
  width: min(88vw, 430px);
  border: 1px solid var(--line-strong);
  padding: 22px;
  background: rgba(7, 9, 13, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

.qr-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.qr-dialog img {
  display: block;
  width: 100%;
  background: white;
}

.qr-dialog p {
  margin: 14px 0 0;
  color: var(--muted);
  text-align: center;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.82);
  color: var(--text);
}

.admin-body {
  background:
    linear-gradient(120deg, rgba(83, 245, 255, 0.1), transparent 30%),
    linear-gradient(300deg, rgba(255, 186, 74, 0.08), transparent 34%),
    #07090d;
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-header h1 {
  font-size: clamp(34px, 5vw, 64px);
}

.admin-login {
  padding: 24px;
}

.admin-login label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.login-row {
  gap: 10px;
  align-items: stretch;
}

.login-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.dashboard {
  display: grid;
  gap: 18px;
}

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

.stat-card {
  border: 1px solid var(--line);
  padding: 18px;
  background: var(--panel);
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 36px;
  color: var(--cyan);
}

.admin-panel {
  padding: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--cyan);
  font-size: 12px;
}

td {
  color: rgba(238, 249, 255, 0.82);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.user-cell span,
.muted {
  color: var(--muted);
}

.result-list {
  display: grid;
  gap: 10px;
}

.admin-result {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-result span {
  color: var(--muted);
  font-size: 12px;
}

.admin-result h3 {
  font-size: 20px;
}

.admin-result p {
  margin: 0;
  color: var(--muted);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .wechat-menu,
  .signal-panel {
    grid-column: auto;
  }

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

@media (max-width: 620px) {
  .hero-surface {
    padding: 16px 12px 26px;
  }

  .top-strip,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-main {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
  }

  .avatar {
    width: 82px;
  }

  .location {
    font-size: 18px;
  }

  .wechat-id {
    font-size: 15px;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .menu-row {
    min-height: 70px;
    grid-template-columns: 38px minmax(68px, 0.5fr) minmax(0, 1fr) 16px;
    gap: 10px;
    padding: 0 12px;
  }

  .menu-row span:nth-child(2) {
    font-size: 18px;
  }

  .menu-row small {
    font-size: 12px;
  }

  .login-row,
  .admin-result {
    flex-direction: column;
  }

  .login-row input {
    min-height: 46px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}
