:root {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.9);
  --text: #182334;
  --muted: #607089;
  --line: #dbe3ef;
  --brand: #164b68;
  --brand-strong: #0d3449;
  --accent: #c3884a;
  --shadow: 0 20px 45px rgba(14, 35, 74, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(22, 75, 104, 0.14), transparent 26%),
    radial-gradient(circle at 82% 6%, rgba(195, 136, 74, 0.14), transparent 18%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
}

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

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 22px 18px;
}

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

.page-header--compact {
  margin-bottom: 16px;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.header-brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 14px 24px rgba(14, 35, 74, 0.12);
}

.header-brand strong,
.header-brand span {
  display: block;
}

.header-brand strong {
  font-size: 16px;
}

.header-brand span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.header-auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.header-account-slot {
  position: relative;
}

.header-account-loading,
.header-login-btn,
.header-register-btn {
  min-width: 104px;
}

.header-account {
  position: relative;
}

.header-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(219, 227, 239, 0.95);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(14, 35, 74, 0.08);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.header-account-trigger:hover,
.header-account.is-open .header-account-trigger {
  border-color: rgba(22, 75, 104, 0.22);
  box-shadow: 0 16px 34px rgba(14, 35, 74, 0.12);
  transform: translateY(-1px);
}

.header-account-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(137, 163, 196, 0.24);
  flex: 0 0 auto;
}

.header-account-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
}

.header-account-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.header-account-copy strong,
.header-account-copy span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-account-copy strong {
  font-size: 14px;
  color: var(--text);
}

.header-account-copy span {
  font-size: 12px;
  color: var(--muted);
}

.header-account-caret {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.header-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 188px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(219, 227, 239, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(14, 35, 74, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 20;
}

.header-account.is-open .header-account-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (hover: hover) {
  .header-account:hover .header-account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.header-account-menu-item {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  transition: background 120ms ease, color 120ms ease;
}

.header-account-menu-item:hover {
  background: rgba(22, 75, 104, 0.08);
  color: var(--brand-strong);
}

.hero-card--compact {
  margin-bottom: 18px;
}

.theme-toggle-btn {
  min-width: 104px;
}

.hero-card,
.catalog-section,
.missing-card,
.test-shell,
.intro-strip {
  border: 1px solid rgba(219, 227, 239, 0.95);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  padding: 32px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 252, 0.92)),
    linear-gradient(135deg, rgba(22, 75, 104, 0.08), rgba(195, 136, 74, 0.06));
}

.hero-card h1 { margin: 0 0 12px; font-size: 34px; }
.hero-card p { margin: 0; max-width: 780px; color: var(--muted); line-height: 1.8; font-size: 15px; }

.hero-meta {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(219, 227, 239, 0.95);
  color: var(--brand);
  font-size: 13px;
}

.intro-strip {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 20px;
}

.intro-strip p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }

#dashboardRoot { margin-top: 18px; }

.account-center {
  border-radius: 26px;
  padding: 24px;
  border: 1px solid rgba(219, 227, 239, 0.95);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.account-center-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.account-center-head h2,
.account-panel h3 {
  margin: 0;
}

.account-center-intro {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
  max-width: 760px;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-profile-copy {
  display: grid;
  gap: 4px;
}

.account-profile-copy strong {
  font-size: 16px;
}

.account-profile-copy span {
  color: var(--muted);
  font-size: 13px;
}

.account-chip-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-copy-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-copy-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(247, 250, 253, 0.92);
}

.account-copy-card strong {
  display: block;
  font-size: 15px;
}

.account-copy-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 13px;
}

.account-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-panel,
.account-login-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.account-grid .account-panel {
  margin-top: 0;
}

.account-panel-head p,
.account-login-card p,
.account-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.account-invite-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 55, 80, 0.96), rgba(22, 75, 104, 0.92));
  color: #fff;
}

.account-invite-box strong {
  display: block;
  font-size: 34px;
  letter-spacing: 1px;
}

.account-invite-box span {
  display: block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.8);
  word-break: break-all;
  font-size: 13px;
}

.account-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-code-list,
.account-result-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.account-results-toolbar {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.account-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 14px;
}

.account-results-summary {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.account-code-item,
.account-result-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.account-code-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.account-code-main strong {
  font-size: 18px;
  color: var(--brand-strong);
}

.account-code-main span {
  color: var(--muted);
  font-size: 12px;
}

.account-code-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-code-actions .bridge-input {
  min-width: 220px;
}

.account-results-panel {
  margin-top: 16px;
}

.account-result-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.account-result-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(14, 35, 74, 0.06);
}

.account-result-item strong {
  display: block;
  font-size: 16px;
}

.account-result-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-result-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.account-result-path {
  font-size: 12px !important;
}

.account-result-meta {
  text-align: right;
}

.account-result-meta b {
  display: block;
  color: var(--brand);
  font-size: 12px;
}

.account-result-meta span {
  margin-top: 6px;
}

.account-empty {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: rgba(245, 248, 251, 0.8);
}

.account-pager {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.account-pager-info {
  color: var(--muted);
  font-size: 13px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(22, 75, 104, 0.08);
  color: var(--brand);
}

.type-badge--personality {
  background: rgba(22, 75, 104, 0.1);
  color: #10435d;
}

.type-badge--fun {
  background: rgba(195, 136, 74, 0.16);
  color: #8c5c24;
}

.type-badge--fortune {
  background: rgba(88, 114, 201, 0.14);
  color: #3f57a8;
}

.type-badge--trending {
  background: rgba(54, 156, 123, 0.14);
  color: #1f7b5d;
}

.gift-record-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.gift-record-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.gift-record-item strong,
.gift-record-item span {
  display: block;
}

.gift-record-item span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.gift-record-meta {
  text-align: right;
}

.gift-record-meta b {
  color: var(--brand);
  font-size: 12px;
}

.catalog-grid { margin-top: 18px; display: grid; gap: 18px; }

.catalog-section { border-radius: 26px; padding: 24px; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 12px;
  text-transform: uppercase;
}

.section-head h2,
.missing-card h1,
.test-side h1,
.result-head h2,
.question-card h2 {
  margin: 0;
  line-height: 1.3;
}

.section-stat { color: var(--muted); font-size: 13px; }

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

.group-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.group-head h3 { margin: 0; font-size: 18px; }
.group-head span { color: var(--muted); font-size: 12px; }
.item-list { display: grid; gap: 10px; }

.test-item {
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
}

.test-item span { line-height: 1.5; }
.test-item b { font-size: 12px; white-space: nowrap; }

.test-item.live {
  background: linear-gradient(135deg, rgba(237, 244, 248, 0.92), rgba(255, 255, 255, 0.95));
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.test-item.live:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(14, 35, 74, 0.08);
}

.test-item.live b { color: var(--brand); }
.test-item.coming { background: rgba(246, 248, 252, 0.82); color: #8795ab; }

.missing-card { border-radius: 26px; padding: 36px; margin-top: 20px; }
.missing-card p { color: var(--muted); line-height: 1.8; }

.primary-link,
.primary-btn,
.ghost-link,
.ghost-btn,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-link,
.primary-btn { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; }
.ghost-link,
.ghost-btn,
.back-link { background: #fff; color: var(--text); border-color: var(--line); }

.test-shell {
  margin-top: 20px;
  border-radius: 28px;
  padding: 18px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
}

.test-side {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.back-link { margin-bottom: 18px; }
.intro-copy { color: var(--muted); line-height: 1.8; font-size: 14px; }

.info-stack {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.info-card,
.disclaimer-card {
  border-radius: 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.info-card span,
.disclaimer-card strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.info-card strong { font-size: 18px; }
.disclaimer-card p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 13px; }

.test-main { display: grid; gap: 16px; }

.progress-head,
.question-card,
.result-card {
  border-radius: 22px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.step-label,
.question-index { margin: 0 0 8px; color: var(--muted); font-size: 12px; }

.progress-bar {
  margin-top: 14px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e7edf6;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.option-list { margin-top: 20px; display: grid; gap: 12px; }

.option-item {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.option-item:hover,
.option-item.active {
  transform: translateY(-1px);
  border-color: #bfd3e6;
  box-shadow: 0 10px 18px rgba(14, 35, 74, 0.06);
}

.option-item input { margin-top: 2px; }
.option-item span { line-height: 1.7; }

.action-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.metric-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  font-size: 20px;
  margin-bottom: 8px;
}

.metric-card p,
.result-head p,
.result-foot p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.result-foot {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.result-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.restart-floating {
  margin-top: 34px;
  padding: 12px 18px;
  border-style: dashed;
  opacity: 0.72;
  box-shadow: none;
}

.premium-report {
  display: grid;
  gap: 18px;
}

.premium-hero {
  display: grid;
  grid-template-columns: 1.4fr 260px;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(18, 56, 79, 0.98), rgba(21, 76, 104, 0.92)),
    linear-gradient(135deg, rgba(195, 136, 74, 0.12), rgba(255, 255, 255, 0.05));
  color: #fff;
}

.premium-copy h2 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.2;
}

.premium-summary {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
  font-size: 15px;
}

.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
}

.score-orb {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.score-orb span,
.score-orb small {
  color: rgba(255, 255, 255, 0.72);
}

.score-orb strong {
  margin: 12px 0 10px;
  font-size: 52px;
  letter-spacing: 1px;
}

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

.premium-panel,
.locked-report,
.share-report {
  border-radius: 22px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.panel-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.premium-panel h3,
.locked-copy h3,
.share-copy h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.35;
}

.premium-panel p,
.locked-copy p,
.share-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.dimension-list {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.dimension-item {
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.dimension-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.dimension-top span {
  color: var(--text);
  font-weight: 600;
}

.dimension-top strong {
  color: var(--brand);
  font-size: 14px;
}

.dimension-bar {
  height: 8px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
  margin-bottom: 10px;
}

.dimension-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

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

.report-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.85;
}

.locked-report {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,252,0.96));
}

.locked-report::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.12) 44%, rgba(255,255,255,0.28) 100%);
  pointer-events: none;
}

.locked-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.locked-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  filter: blur(0.2px);
}

.locked-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.locked-card strong {
  display: block;
  font-size: 20px;
  color: var(--brand);
  margin-bottom: 8px;
}

.locked-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.locked-card.unlocked p {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.paywall-actions,
.share-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bridge-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(137, 163, 196, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.bridge-copy h4 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text);
}

.bridge-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.bridge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.bridge-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(232, 239, 247, 0.92);
  border: 1px solid rgba(137, 163, 196, 0.2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.redeem-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bridge-input {
  min-width: 240px;
  flex: 1 1 240px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 14px;
}

.bridge-secondary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bridge-subcard {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(137, 163, 196, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

.bridge-code-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.bridge-code-item {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-profile-card {
  margin: 16px 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(137, 163, 196, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

.share-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(137, 163, 196, 0.26);
}

.share-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
}

.share-profile-copy {
  display: grid;
  gap: 4px;
}

.share-profile-copy strong {
  color: var(--text);
  font-size: 15px;
}

.share-profile-copy span {
  color: var(--muted);
  font-size: 13px;
}

.share-report {
  display: block;
}

.share-report--compact {
  padding: 26px 30px;
}

.share-report--compact .share-copy {
  max-width: 640px;
}

.share-report--compact h3 {
  margin: 0;
  font-size: 40px;
  line-height: 1.18;
  color: var(--text);
}

.share-download-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.share-report--compact .share-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(237, 242, 248, 0.86);
  border: 1px solid rgba(137, 163, 196, 0.18);
  word-break: normal;
}

.share-report--compact .share-link strong {
  color: var(--text);
}

.share-report--compact .share-actions {
  margin-top: 20px;
}

.share-report--compact .primary-btn {
  min-width: 244px;
  min-height: 54px;
  font-size: 17px;
}

.share-link {
  margin-top: 14px !important;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f5f8fb;
  border: 1px solid var(--line);
  word-break: break-all;
  font-size: 13px;
}

.share-qr-wrap {
  display: flex;
  justify-content: flex-end;
}

.share-qr-card {
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.share-qr {
  width: 132px;
  height: 132px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: cover;
}

.poster-preview {
  display: grid;
  gap: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #f8fafd;
  padding: 14px;
}

.poster-preview canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(14, 35, 74, 0.08);
}

.poster-preview-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.hidden { display: none !important; }

.test-main.result-mode .progress-head {
  display: none !important;
}

.ui-toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.ui-toast {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 75, 104, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: 0 18px 38px rgba(14, 35, 74, 0.12);
  line-height: 1.65;
  font-size: 14px;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ui-toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.ui-toast--success {
  border-color: rgba(41, 140, 110, 0.22);
}

.ui-toast--error {
  border-color: rgba(192, 92, 74, 0.24);
}

.ui-toast--info {
  border-color: rgba(21, 75, 104, 0.16);
}

.yujian-aigc-footer {
  max-width: 1280px;
  margin: 18px auto 0;
  padding: 18px 24px 28px;
  border-top: 1px solid #dbe4ef;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  text-align: center;
}

.yujian-aigc-footer p { margin: 0; }

body[data-theme="dark"] {
  --bg: #08131f;
  --panel: rgba(12, 24, 38, 0.92);
  --text: #eef4fb;
  --muted: #9fb0c5;
  --line: rgba(128, 159, 194, 0.22);
  --brand: #71b5d8;
  --brand-strong: #2a7aa0;
  --accent: #f0ae70;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
  background:
    radial-gradient(circle at top left, rgba(113, 181, 216, 0.2), transparent 30%),
    radial-gradient(circle at 82% 6%, rgba(240, 174, 112, 0.14), transparent 22%),
    linear-gradient(180deg, #06111c 0%, #091725 42%, #0b1b2b 100%);
}

body[data-theme="dark"] .page-header {
  padding: 14px 18px;
  border-radius: 24px;
  border: 1px solid rgba(128, 159, 194, 0.14);
  background: rgba(7, 17, 27, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px);
}

body[data-theme="dark"] .header-account-trigger {
  background: rgba(10, 21, 34, 0.96);
  border-color: rgba(128, 159, 194, 0.18);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

body[data-theme="dark"] .header-account-trigger:hover,
body[data-theme="dark"] .header-account.is-open .header-account-trigger {
  border-color: rgba(143, 208, 242, 0.42);
}

body[data-theme="dark"] .header-account-avatar {
  border-color: rgba(128, 159, 194, 0.22);
}

body[data-theme="dark"] .header-account-copy strong {
  color: #eef4fb;
}

body[data-theme="dark"] .header-account-copy span,
body[data-theme="dark"] .header-account-caret {
  color: #9fb0c5;
}

body[data-theme="dark"] .header-account-menu {
  background: rgba(10, 22, 35, 0.98);
  border-color: rgba(128, 159, 194, 0.18);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .header-account-menu-item {
  color: #eef4fb;
}

body[data-theme="dark"] .header-account-menu-item:hover {
  background: rgba(113, 181, 216, 0.12);
  color: #8fd0f2;
}

body[data-theme="dark"] .hero-card,
body[data-theme="dark"] .catalog-section,
body[data-theme="dark"] .missing-card,
body[data-theme="dark"] .test-shell,
body[data-theme="dark"] .intro-strip,
body[data-theme="dark"] .account-center,
body[data-theme="dark"] .test-side,
body[data-theme="dark"] .progress-head,
body[data-theme="dark"] .question-card,
body[data-theme="dark"] .result-card,
body[data-theme="dark"] .premium-panel,
body[data-theme="dark"] .locked-report,
body[data-theme="dark"] .share-report,
body[data-theme="dark"] .account-panel,
body[data-theme="dark"] .account-login-card,
body[data-theme="dark"] .account-code-item,
body[data-theme="dark"] .account-result-item,
body[data-theme="dark"] .gift-record-item,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .option-item,
body[data-theme="dark"] .info-card,
body[data-theme="dark"] .disclaimer-card,
body[data-theme="dark"] .group-card,
body[data-theme="dark"] .bridge-panel,
body[data-theme="dark"] .bridge-subcard,
body[data-theme="dark"] .share-profile-card,
body[data-theme="dark"] .share-qr-card,
body[data-theme="dark"] .account-copy-card,
body[data-theme="dark"] .account-empty,
body[data-theme="dark"] .locked-card,
body[data-theme="dark"] .dimension-item {
  background: linear-gradient(180deg, rgba(11, 23, 37, 0.96), rgba(9, 19, 31, 0.92));
  border-color: var(--line);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] .hero-card {
  background:
    linear-gradient(135deg, rgba(10, 23, 37, 0.98), rgba(15, 31, 49, 0.94)),
    linear-gradient(135deg, rgba(113, 181, 216, 0.08), rgba(240, 174, 112, 0.06));
}

body[data-theme="dark"] .catalog-section,
body[data-theme="dark"] .account-center,
body[data-theme="dark"] .test-shell,
body[data-theme="dark"] .missing-card {
  background:
    linear-gradient(180deg, rgba(8, 19, 31, 0.98), rgba(10, 22, 35, 0.94));
}

body[data-theme="dark"] .meta-pill,
body[data-theme="dark"] .share-link,
body[data-theme="dark"] .poster-preview,
body[data-theme="dark"] .account-invite-box {
  border-color: var(--line);
}

body[data-theme="dark"] .header-brand strong,
body[data-theme="dark"] .hero-card h1,
body[data-theme="dark"] .section-head h2,
body[data-theme="dark"] .group-head h3,
body[data-theme="dark"] .account-center-head h2,
body[data-theme="dark"] .account-panel h3,
body[data-theme="dark"] .question-card h2,
body[data-theme="dark"] .premium-panel h3,
body[data-theme="dark"] .locked-copy h3,
body[data-theme="dark"] .share-copy h3,
body[data-theme="dark"] .bridge-copy h4 {
  color: #f4f8fd;
}

body[data-theme="dark"] .account-invite-box {
  background:
    linear-gradient(135deg, rgba(18, 55, 79, 0.98), rgba(34, 93, 126, 0.92));
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .primary-link,
body[data-theme="dark"] .primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #2b84ad, #1d5d7f);
  box-shadow: 0 14px 26px rgba(12, 48, 70, 0.28);
}

body[data-theme="dark"] .ghost-link,
body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .back-link,
body[data-theme="dark"] .account-select,
body[data-theme="dark"] .bridge-input {
  background: rgba(10, 21, 34, 0.96);
  color: #ebf2f9;
  border-color: rgba(128, 159, 194, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] .ghost-link:hover,
body[data-theme="dark"] .ghost-btn:hover,
body[data-theme="dark"] .back-link:hover {
  border-color: rgba(143, 208, 242, 0.42);
  background: rgba(13, 28, 44, 0.98);
}

body[data-theme="dark"] .progress-bar,
body[data-theme="dark"] .dimension-bar {
  background: rgba(112, 145, 176, 0.18);
}

body[data-theme="dark"] .progress-head {
  background: linear-gradient(180deg, rgba(10, 24, 38, 0.94), rgba(8, 19, 31, 0.9));
}

body[data-theme="dark"] .test-item.live {
  background: linear-gradient(135deg, rgba(18, 35, 53, 0.98), rgba(24, 49, 73, 0.94));
  border-color: rgba(128, 159, 194, 0.28);
}

body[data-theme="dark"] .test-item.live span {
  color: #eef4fb;
}

body[data-theme="dark"] .test-item.live b {
  color: #8fd0f2;
}

body[data-theme="dark"] .test-item.coming {
  background: rgba(13, 27, 42, 0.82);
  color: #7f93aa;
  border-color: rgba(128, 159, 194, 0.16);
}

body[data-theme="dark"] .meta-pill {
  background: rgba(10, 22, 35, 0.88);
  color: #dce7f3;
}

body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] .panel-label {
  color: #f0b273;
}

body[data-theme="dark"] .section-stat,
body[data-theme="dark"] .group-head span,
body[data-theme="dark"] .intro-strip p,
body[data-theme="dark"] .hero-card p,
body[data-theme="dark"] .header-brand span,
body[data-theme="dark"] .account-profile-copy span,
body[data-theme="dark"] .account-panel-head p,
body[data-theme="dark"] .account-login-card p,
body[data-theme="dark"] .account-empty p,
body[data-theme="dark"] .metric-card p,
body[data-theme="dark"] .metric-card span,
body[data-theme="dark"] .dimension-item p,
body[data-theme="dark"] .share-profile-copy span,
body[data-theme="dark"] .premium-panel p,
body[data-theme="dark"] .locked-copy p,
body[data-theme="dark"] .share-copy p,
body[data-theme="dark"] .bridge-note,
body[data-theme="dark"] .report-list,
body[data-theme="dark"] .account-result-item span,
body[data-theme="dark"] .gift-record-item span {
  color: #adc0d4;
}

body[data-theme="dark"] .question-index,
body[data-theme="dark"] .step-label {
  color: #8ea3b9;
}

body[data-theme="dark"] .option-item:hover,
body[data-theme="dark"] .option-item.active,
body[data-theme="dark"] .account-result-item:hover,
body[data-theme="dark"] .test-item.live:hover {
  border-color: rgba(143, 208, 242, 0.4);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"] .premium-hero {
  background:
    linear-gradient(135deg, rgba(11, 41, 59, 0.98), rgba(18, 62, 86, 0.94)),
    linear-gradient(135deg, rgba(240, 174, 112, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"] .score-orb,
body[data-theme="dark"] .tag-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .locked-report {
  background:
    linear-gradient(180deg, rgba(10, 22, 35, 0.98), rgba(8, 18, 29, 0.96));
}

body[data-theme="dark"] .locked-report::after {
  background: linear-gradient(180deg, rgba(7, 16, 26, 0) 0%, rgba(7, 16, 26, 0.14) 46%, rgba(7, 16, 26, 0.26) 100%);
}

body[data-theme="dark"] .bridge-chip,
body[data-theme="dark"] .type-badge {
  background: rgba(17, 35, 53, 0.92);
  border: 1px solid rgba(128, 159, 194, 0.16);
  color: #dbe8f4;
}

body[data-theme="dark"] .type-badge--personality {
  color: #8fd0f2;
}

body[data-theme="dark"] .type-badge--fun {
  color: #f0bd86;
}

body[data-theme="dark"] .type-badge--fortune {
  color: #aebdff;
}

body[data-theme="dark"] .type-badge--trending {
  color: #86d7b8;
}

body[data-theme="dark"] .share-profile-card,
body[data-theme="dark"] .bridge-subcard,
body[data-theme="dark"] .account-copy-card,
body[data-theme="dark"] .share-qr-card,
body[data-theme="dark"] .poster-preview {
  background: rgba(13, 27, 42, 0.92);
}

body[data-theme="dark"] .share-report--compact .share-link {
  background: rgba(17, 35, 53, 0.92);
  border-color: rgba(128, 159, 194, 0.16);
}

body[data-theme="dark"] .share-avatar {
  border-color: rgba(128, 159, 194, 0.22);
}

body[data-theme="dark"] .account-result-meta b,
body[data-theme="dark"] .gift-record-meta b,
body[data-theme="dark"] .dimension-top strong,
body[data-theme="dark"] .test-item.live b,
body[data-theme="dark"] .bridge-copy h4,
body[data-theme="dark"] .metric-card strong {
  color: #8fd0f2;
}

body[data-theme="dark"] .account-result-path {
  color: #8ea3b9 !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] button {
  caret-color: #8fd0f2;
}

body[data-theme="dark"] .yujian-aigc-footer {
  border-top-color: var(--line);
}

body[data-theme="dark"] .ui-toast {
  background: rgba(10, 22, 35, 0.96);
  border-color: rgba(128, 159, 194, 0.2);
  color: #edf4fb;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1040px) {
  .account-copy-grid,
  .account-results-toolbar,
  .account-grid,
  .group-grid,
  .metric-grid,
  .test-shell,
  .premium-grid,
  .premium-columns,
  .share-report,
  .premium-hero,
  .locked-grid,
  .bridge-secondary { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .ui-toast-stack {
    top: 14px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .page-shell { padding: 18px 14px 12px; }
  .header-account-trigger {
    min-width: 0;
    width: 100%;
    border-radius: 22px;
  }
  .header-account-menu {
    left: 0;
    right: 0;
    min-width: 0;
  }
  .hero-card,
  .account-center,
  .catalog-section,
  .missing-card,
  .test-side,
  .progress-head,
  .question-card,
  .result-card { padding: 18px; }
  .hero-card h1 { font-size: 28px; }
  .page-header,
  .account-center-head,
  .gift-record-item,
  .account-result-item,
  .section-head,
  .action-row { flex-direction: column; align-items: stretch; }
  .account-results-toolbar { grid-template-columns: 1fr; }
  .account-result-meta,
  .gift-record-meta { text-align: left; }
  .share-report--compact { padding: 22px 18px; }
  .share-report--compact h3 { font-size: 30px; }
  .share-report--compact .share-link {
    display: flex;
    align-items: flex-start;
    border-radius: 18px;
    word-break: break-word;
  }
  .share-report--compact .primary-btn { width: 100%; }
  .restart-floating {
    width: 100%;
    margin-top: 28px;
    opacity: 0.66;
  }
}
