/* BDSM 角色偏好测验 · 紫青冷调，与 mykink 金玫瑰区分 */
:root {
  --bg0: #07060f;
  --bg1: #120a1f;
  --bg2: #1a1030;
  --panel: rgba(18, 12, 36, 0.88);
  --panel-edge: rgba(167, 139, 250, 0.28);
  --line: rgba(148, 163, 184, 0.22);
  --text: #e8e4f5;
  --muted: #9b93b5;
  --violet: #a78bfa;
  --violet-deep: #7c3aed;
  --magenta: #e879f9;
  --cyan: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body.br-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 0% 0%, rgba(124, 58, 237, 0.28), transparent 55%),
    radial-gradient(800px 420px at 100% 10%, rgba(34, 211, 238, 0.12), transparent 50%),
    radial-gradient(700px 500px at 50% 100%, rgba(232, 121, 249, 0.1), transparent 55%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  overflow-x: hidden;
}

.br-shell-main {
  width: min(780px, 100%);
  margin: 0 auto;
}

.br-wrap {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 12px 32px;
}

.hidden {
  display: none !important;
}

/* —— 面板：切角卡片，非 mykink 圆角金框 —— */
.br-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px 20px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
  clip-path: polygon(
    0 12px,
    12px 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    12px 100%,
    0 calc(100% - 12px)
  );
}

.br-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), transparent 40%, rgba(34, 211, 238, 0.05));
}

.br-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.35);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.br-kicker-wrap {
  text-align: center;
}

.br-title {
  margin: 0 0 10px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  color: #f5f3ff;
  text-shadow: 0 0 24px rgba(167, 139, 250, 0.35);
}

.br-title .accent {
  background: linear-gradient(100deg, var(--violet), var(--magenta) 55%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.br-lead {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.94rem;
  margin: 0 0 14px;
  text-align: center;
}

.br-note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-left: 3px solid var(--violet);
  padding: 10px 12px;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 0 10px 10px 0;
  margin: 12px 0;
}

.br-note .auth-login-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 6px;
  padding: 2px 9px;
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-radius: 999px;
  color: #cffafe;
  background: rgba(34, 211, 238, 0.12);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.br-note .auth-login-link:hover {
  color: #07111f;
  background: var(--cyan);
  border-color: var(--cyan);
}

.br-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.br-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.br-btn:active {
  transform: scale(0.98);
}

.br-btn-primary {
  background: linear-gradient(120deg, var(--violet-deep), #9333ea 50%, #c026d3);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.br-btn-primary:hover {
  filter: brightness(1.06);
}

.br-btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.br-btn-ghost:hover {
  border-color: var(--violet);
  background: rgba(167, 139, 250, 0.08);
}

.br-btn-line {
  background: rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--cyan);
}

.br-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.br-footer-safe {
  margin: 14px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* 昵称 */
.br-field {
  margin: 14px 0 6px;
  text-align: left;
}

.br-field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 6px;
}

.br-field input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 11px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.br-field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.br-field .hint {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 5px;
}

/* —— 答题：横向连续量表，非四宫格卡片 —— */
.br-quiz-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.br-q-index {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(167, 139, 250, 0.55);
  letter-spacing: -0.04em;
}

.br-q-total {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.br-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 6px 0 18px;
}

.br-track > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--violet), var(--magenta), var(--cyan));
  transition: width 0.25s ease;
}

.br-q-text {
  margin: 0 0 20px;
  font-size: 1.18rem;
  font-weight: 650;
  line-height: 1.55;
  color: #f3f0ff;
  border-left: 3px solid var(--magenta);
  padding-left: 14px;
}

/* 连续四段量表 */
.br-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.br-scale-opt {
  appearance: none;
  border: none;
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 14px 6px 12px;
  font-family: inherit;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.br-scale-opt:last-child {
  border-right: none;
}

.br-scale-opt:hover {
  background: rgba(167, 139, 250, 0.1);
}

.br-scale-opt .n {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.br-scale-opt .lab {
  font-weight: 800;
  font-size: 0.95rem;
}

.br-scale-opt .hint {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.2;
}

.br-scale-opt.selected.opt-no {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}
.br-scale-opt.selected.opt-maybe {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}
.br-scale-opt.selected.opt-yes {
  background: rgba(167, 139, 250, 0.28);
  color: #ddd6fe;
}
.br-scale-opt.selected.opt-love {
  background: linear-gradient(180deg, rgba(232, 121, 249, 0.35), rgba(124, 58, 237, 0.35));
  color: #fce7f3;
  box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.5);
}

.br-scale-legend {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.br-quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 420px) {
  .br-scale-opt .hint {
    display: none;
  }
  .br-q-index {
    font-size: 1.8rem;
  }
  .br-q-text {
    font-size: 1.05rem;
  }
}

/* —— 结果：环形主角色 + 分组光谱 —— */
.br-result-head {
  text-align: center;
  margin-bottom: 8px;
}

.br-result-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.br-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: center;
  margin: 16px 0 20px;
}

.br-ring {
  --p: 0;
  --c: var(--violet);
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, 0.06) 0);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 32px rgba(124, 58, 237, 0.25);
}

.br-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--bg1);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.br-ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.br-ring-pct {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.br-ring-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.br-hero-copy {
  flex: 1 1 200px;
  max-width: 320px;
  text-align: left;
}

.br-hero-role {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: #f5f3ff;
}

.br-hero-blurb {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.br-top-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.br-top-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.br-top-item .rank {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--magenta);
  font-weight: 800;
}

.br-top-item .name {
  font-weight: 700;
}

.br-top-item .pct {
  font-family: var(--mono);
  color: var(--cyan);
  font-weight: 700;
}

.br-section-title {
  margin: 22px 0 12px;
  font-size: 0.78rem;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  display: flex;
  align-items: center;
  gap: 10px;
}

.br-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.45), transparent);
}

.br-group {
  margin-bottom: 16px;
}

.br-group-h {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan);
  margin: 0 0 8px;
  padding-left: 2px;
}

.br-bar-row {
  margin-bottom: 10px;
}

.br-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.86rem;
}

.br-bar-name {
  font-weight: 650;
}

.br-bar-pct {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.br-bar-track {
  height: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.br-bar-track > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--violet-deep), var(--cyan));
  transition: width 0.4s ease;
}

.br-share {
  white-space: pre-wrap;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
  border: 1px dashed rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--mono);
}

.br-share-status {
  min-height: 1.2em;
  margin-top: 10px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--cyan);
}

.br-share-preview {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(0, 0, 0, 0.28);
  text-align: center;
}

.br-share-preview img {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: #07060f;
}

.br-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.br-share-actions a.br-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.br-share-canvas {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ad-wrap {
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
}

.br-tagline {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.br-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.br-stats strong {
  color: var(--violet);
  font-weight: 700;
}
