/* ======================================
   BETI 颜值人格测试 — 玫瑰晨曦设计系统
   Rose Dawn · Warm Pink Theme
   ====================================== */

:root {
  /* 背景色阶 */
  --bg-page: #fdf5f4;
  --bg-card: #ffffff;
  --bg-card-alt: #faeeed;
  --bg-input: #ffffff;
  --bg-hover: #f8e6e5;
  --bg-selected: #f0ced2;

  /* 边框 */
  --border-light: #ebd5d8;
  --border-medium: #d4b5bb;
  --border-hover: #d4567a;
  --border-selected: #d4567a;

  /* 主色 */
  --accent-1: #d4567a;
  --accent-2: #e26d8f;
  --accent-dark: #a33d5a;
  --accent-gradient: linear-gradient(135deg, #d4567a 0%, #e26d8f 100%);
  --accent-glow: 0 4px 20px rgba(212, 86, 122, 0.2);

  /* 文字色 */
  --text-primary: #2e1a22;
  --text-secondary: #6b4a56;
  --text-muted: #9f7f8e;
  --text-on-accent: #ffffff;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(163, 61, 90, 0.06);
  --shadow-md: 0 4px 16px rgba(163, 61, 90, 0.08);
  --shadow-lg: 0 8px 32px rgba(163, 61, 90, 0.1);
  --shadow-card: 0 2px 12px rgba(163, 61, 90, 0.06);

  /* 圆角 */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* 过渡 */
  --transition-fast: all 0.18s ease;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== Reset ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ====== 背景装饰 ====== */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.decor-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
}

.decor-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(212, 86, 122, 0.15), transparent 70%);
  top: -100px; right: -80px;
  animation: decorFloat1 20s ease-in-out infinite;
}
.decor-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(226, 109, 143, 0.12), transparent 70%);
  bottom: -60px; left: -60px;
  animation: decorFloat2 24s ease-in-out infinite;
}
.decor-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(212, 86, 122, 0.1), transparent 70%);
  top: 40%; left: 60%;
  animation: decorFloat3 28s ease-in-out infinite;
}

@keyframes decorFloat1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.1); }
}
@keyframes decorFloat2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}
@keyframes decorFloat3 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-20px, -25px) scale(1.05); }
}

/* ====== 主容器 ====== */
.shell {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ====== 卡片 ====== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
}

.card-inner {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
  overflow: hidden;
  min-width: 0;
}

.card-inner:hover {
  border-color: var(--border-medium);
}

/* ====== 屏幕切换 ====== */
.screen { display: none; }
.screen.active {
  display: block;
  animation: screenIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== 按钮 ====== */
button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: var(--transition);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none !important;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--accent-glow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(212, 86, 122, 0.3);
}
.btn-primary:not(:disabled):active {
  transform: translateY(0);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--accent-dark);
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-medium);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-outline:hover {
  transform: translateY(-2px);
  border-color: var(--accent-1);
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}
.btn-outline:active {
  transform: translateY(0);
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ====== 首页 ====== */
.hero-card {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 48px 28px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-dark);
  border: 1px solid var(--border-medium);
  background: var(--bg-card-alt);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-title {
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.9;
  max-width: 460px;
  margin-bottom: 32px;
}

/* 欢迎回来提示条 */
.welcome-back {
  background: linear-gradient(135deg, #fdf5f4 0%, #f0ced2 100%);
  border: 1.5px solid var(--accent-1);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
  animation: wbSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes wbSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.wb-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.wb-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.wb-sub {
  font-size: 13px;
  color: var(--accent-dark);
  font-weight: 700;
}
.wb-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.wb-actions .btn-sm {
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 10px;
}
.wb-actions .btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-medium);
  color: var(--text-secondary);
}
.wb-actions .btn-outline:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.hero-actions {
  margin-bottom: 40px;
}
.hero-actions .btn-primary {
  font-size: 16px;
  padding: 15px 36px;
}

.hero-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.hero-footer a {
  color: var(--accent-1);
  text-decoration: none;
  font-weight: 600;
}
.hero-footer a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* ====== 测试页 ====== */
.test-card {
  margin-top: 12px;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 245, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin: -24px -24px 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.progress-wrap { flex: 1; min-width: 160px; }

.progress {
  height: 6px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.question-list { display: grid; gap: 16px; }

.question {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--bg-card);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  animation: qIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes qIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.question:hover { border-color: var(--border-medium); }

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--bg-selected);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.question-title {
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--text-primary);
}

.options { display: grid; gap: 10px; margin-top: 14px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background: var(--bg-input);
  cursor: pointer;
  transition: var(--transition-fast);
}
.option:hover {
  border-color: var(--accent-1);
  background: var(--bg-hover);
}
.option.selected {
  border-color: var(--accent-1);
  background: var(--bg-selected);
  box-shadow: 0 0 0 1px var(--accent-1);
}

.option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent-1);
  transform: scale(1.15);
  flex-shrink: 0;
  cursor: pointer;
}

.option-code {
  font-weight: 800;
  color: var(--accent-1);
  min-width: 20px;
  font-size: 14px;
}

.option-text {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.65;
}

.actions-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

.hint {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ====== 结果页 ====== */
.result-card {
  margin-top: 12px;
  padding: 24px;
}

.result-layout { display: grid; gap: 18px; min-width: 0; width: 100%; overflow: hidden; }

/* 第一行：海报（独占整行） */
.poster-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.poster-image {
  width: 100%;
  max-width: 400px;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.poster-image:hover { transform: scale(1.02); }
.poster-box.no-image .poster-image { display: none; }

.poster-caption {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
  font-style: italic;
  padding-left: 12px;
  border-left: 3px solid var(--accent-1);
  align-self: flex-start;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 第二行：主类型 + 小二维码（与副文字顶对齐） */
.type-qr-row {
  display: flex;
  flex-direction: column;
}
.type-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.type-sub-qr {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  gap: 14px;
  margin-top: 12px;
}
.type-subname {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.85;
  word-break: break-word;
  overflow-wrap: break-word;
}
.type-qr {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  gap: 3px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  width: 56px;
  min-width: 56px;
  max-width: 56px;
}
.type-qr-img {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  min-width: 56px;
  min-height: 56px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  object-fit: contain;
}
.type-qr-label {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}
.type-kicker {
  font-size: 11px;
  color: var(--accent-1);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.type-name {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-word;
  overflow-wrap: break-word;
}

.match {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--bg-selected);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
  width: fit-content;
}

/* 内容区标题 */
.section-title {
  font-size: 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--text-primary);
}
.section-title .icon {
  font-size: 16px;
}

.analysis-box p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 维度列表 */
.dim-list { display: grid; gap: 12px; }

.dim-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--bg-card);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.dim-item:hover {
  border-color: var(--border-medium);
  background: var(--bg-hover);
}

.dim-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dim-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.dim-item-score {
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  color: var(--accent-1);
}

.dim-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.8;
}

.dim-bar-wrap {
  margin: 8px 0;
  height: 4px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.dim-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.note-box p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.85;
}

/* 作者的话 */
.author-box {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.author-box summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: var(--transition-fast);
}
.author-box summary:hover { background: var(--bg-hover); }
.author-box summary::-webkit-details-marker { display: none; }

.toggle-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-1);
  border: 1px solid var(--border-medium);
  background: var(--bg-card-alt);
  padding: 4px 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.author-content {
  border-top: 1px solid var(--border-light);
  padding: 4px 20px 20px;
  animation: expandIn 0.3s ease;
}
@keyframes expandIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.author-content p {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.95;
}

.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

/* ====== 截图导出区域 — 风格 A 杂志封面风（竖屏） ====== */
#exportArea {
  width: 420px;
  margin: 0 auto;
  background: var(--bg-page);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* — 顶部英雄区 — */
#exportArea .ea-hero {
  background: linear-gradient(180deg, #f0ced2 0%, var(--bg-page) 100%);
  padding: 36px 28px 24px;
  text-align: center;
}
#exportArea .ea-brand {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--accent-1);
  text-transform: uppercase;
  margin-bottom: 18px;
}
#exportArea .ea-poster {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: var(--radius-md);
  margin: 0 auto 18px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(212, 86, 122, 0.18));
}
#exportArea .ea-type-code {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
#exportArea .ea-type-cn {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 3px;
}
#exportArea .ea-intro {
  font-size: 13px;
  color: var(--accent-dark);
  font-style: italic;
  margin-top: 10px;
  padding: 0 16px;
  line-height: 1.7;
}
#exportArea .ea-match {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(212, 86, 122, 0.12);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  margin-top: 14px;
}

/* — 正文区 — */
#exportArea .ea-body {
  padding: 22px 28px;
}
#exportArea .ea-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#exportArea .ea-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 22px;
  white-space: pre-wrap;
}

/* — 维度列表 — */
#exportArea .ea-dims {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 22px;
}
#exportArea .ea-dim {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
}
#exportArea .ea-dim-name {
  flex: 1;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}
#exportArea .ea-dim-bar {
  width: 80px;
  height: 4px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
#exportArea .ea-dim-bar span {
  display: block;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: inherit;
}
#exportArea .ea-dim-level {
  font-weight: 800;
  color: var(--accent-1);
  min-width: 14px;
  text-align: center;
}

/* — 同类型人数 — */
#exportArea .ea-same {
  text-align: center;
  font-size: 12px;
  color: var(--accent-dark);
  padding: 10px 16px;
  background: var(--bg-selected);
  border: 1px solid var(--accent-1);
  border-radius: var(--radius-xs);
  margin-bottom: 4px;
}
#exportArea .ea-same strong {
  font-size: 16px;
  font-weight: 900;
  color: var(--accent-1);
}

/* — 底部页脚 — */
#exportArea .ea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 28px 22px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card-alt);
}
#exportArea .ea-footer .ea-qr-img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 4px;
}
#exportArea .ea-footer-text {
  flex: 1;
  text-align: right;
}
#exportArea .ea-footer-text .brand {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-primary);
}
#exportArea .ea-footer-text .tagline {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ====== 统计模块 ====== */
.stats-box {
  animation: qIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stats-hero {
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  padding: 22px 20px;
  text-align: center;
  color: var(--text-on-accent);
  margin-bottom: 14px;
}
.stats-hero .sh-big {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}
.stats-hero .sh-label {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 5px;
}

.stats-my-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-selected);
  border: 1px solid var(--accent-1);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.stats-my-icon {
  font-size: 28px;
  line-height: 1;
}
.stats-my-text {
  flex: 1;
}
.stats-my-text .t1 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}
.stats-my-text .t2 {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stats-rank-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.stats-rank-list {
  display: grid;
  gap: 6px;
}
.stats-rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  font-size: 12px;
  transition: var(--transition-fast);
}
.stats-rank-item.is-me {
  border-color: var(--accent-1);
  background: var(--bg-selected);
}
.stats-rank-num {
  font-weight: 900;
  color: var(--accent-1);
  min-width: 18px;
  text-align: center;
}
.stats-rank-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-rank-bar {
  width: 60px;
  height: 4px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.stats-rank-bar span {
  display: block;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: inherit;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stats-rank-pct {
  font-weight: 800;
  color: var(--accent-1);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 隐私提示 */
.privacy-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ====== 响应式 ====== */
@media (max-width: 720px) {
  .poster-image { max-width: 320px; max-height: 320px; }
}

@media (max-width: 480px) {
  .shell { padding: 12px 12px 40px; }
  .hero-card { padding: 36px 18px; min-height: 65vh; }
  .hero-title { font-size: 26px; }
  .hero-title br { display: none; }
  .hero-desc { font-size: 14px; }
  .hero-desc br { display: none; }
  .hero-actions .btn-primary { font-size: 15px; padding: 13px 30px; }
  .test-card { padding: 18px; }
  .topbar {
    margin: -18px -18px 16px;
    padding: 14px 18px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .result-card { padding: 18px; }
  .question { padding: 16px; }
  .question-title { font-size: 14px; }
  .option { padding: 11px 13px; }
  .btn-primary, .btn-outline { padding: 12px 20px; font-size: 14px; }
  .type-name { font-size: 22px; }
  .poster-image { max-width: 280px; max-height: 280px; }
  .type-qr-img { width: 48px !important; height: 48px !important; max-width: 48px !important; max-height: 48px !important; min-width: 48px; min-height: 48px; }
  .type-qr { width: 48px; min-width: 48px; max-width: 48px; }
  .type-sub-qr { gap: 10px; }
  .actions-bottom { flex-direction: column; align-items: stretch; }
  .result-actions { flex-direction: column; align-items: stretch; }
  .btn-group { justify-content: stretch; }
  .btn-group button { flex: 1; justify-content: center; }
  .card-inner { padding: 16px; max-width: 100%; }
  .stats-hero .sh-big { font-size: 36px; }
  .stats-hero { padding: 18px 16px; }
}

@media (max-width: 360px) {
  .hero-title { font-size: 22px; }
  .hero-badge { font-size: 10px; padding: 5px 12px; }
}

/* ====== 滚动条 ====== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-1); }

/* ====== 选中 ====== */
::selection { background: rgba(212, 86, 122, 0.2); color: var(--text-primary); }

/* ====== 防下载/防盗版保护 ====== */
img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

.img-protect-wrap {
  position: relative;
  display: inline-block;
  overflow: hidden;
}
.img-protect-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  pointer-events: auto;
  cursor: default;
}

.poster-box,
.poster-image,
.export-poster {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ====== 长按保存遮罩层 ====== */
.save-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.save-overlay.hidden {
  display: none !important;
}
.save-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  flex-shrink: 0;
}
.save-overlay-tip {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
}
.save-overlay-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.save-overlay-close:hover {
  background: rgba(255,255,255,0.25);
}
.save-overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  padding: 0 16px 24px;
}
.save-overlay-img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  pointer-events: auto !important;
  -webkit-touch-callout: default !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
  -webkit-user-drag: auto !important;
  user-drag: auto !important;
}

/* ====== 隐藏工具 ====== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.hidden { display: none !important; }
