/* ============================================================
   ES人格测试 - 样式表
   ============================================================ */

@import url("https://fontsapi.zeoseven.com/59/main/result.css");

/* ===== 设计系统 ===== */
:root {
  /* 核心色彩 */
  --bg: #faf5f0;
  --surface: #fff7f1;
  --elevated: #fffdfb;
  --card: #fff0e6;
  --card-hover: #ffe8d6;
  --accent: #d0647e;
  --accent-muted: rgba(208, 100, 126, 0.10);
  --accent-hover: #a33d58;
  --accent-btn: #b84a66;
  --accent2: #d08a5a;
  --accent2-hover: #b8744c;
  --accent2-muted: rgba(208, 138, 90, 0.10);
  --text: #3a2828;
  --text-secondary: #605050;
  --text-tertiary: #a08888;
  --border: rgba(60, 40, 40, 0.07);
  --border-strong: rgba(60, 40, 40, 0.13);
  --success: #5a9e78;
  --success-muted: rgba(90, 158, 120, 0.10);
  --danger: #c84848;
  --danger-muted: rgba(200, 72, 72, 0.08);

  /* 兼容旧变量 */
  --bg-fallback: #faf5f0;
  --accent-text: #d0647e;
  --accent-contrast: #ffffff;
  --accent-r: 208;
  --accent-g: 100;
  --accent-b: 126;
  --secondary: #3a2828;
  --border-light: rgba(60, 40, 40, 0.07);

  /* 间距系统 */
  --space-2xs: 4px;
  --space-xs: 6px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-md-lg: 24px;
  --space-xl: 28px;
  --space-2xl: 40px;

  /* 圆角系统 */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --radius-card: 20px;
  --radius-pill: 999px;

  /* 阴影系统 */
  --shadow-sm: 0 1px 4px rgba(180, 120, 100, 0.07);
  --shadow-md: 0 4px 16px rgba(180, 120, 100, 0.09);
  --shadow-lg: 0 8px 30px rgba(180, 120, 100, 0.12);
  --shadow-card: 0 1px 4px rgba(180, 120, 100, 0.06), 0 4px 16px rgba(180, 120, 100, 0.08);
  --shadow-elevated: 0 8px 30px rgba(180, 120, 100, 0.12), inset 0 1px 0 rgba(255,255,255,0.6);

  /* 动画系统 */
  --ios-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.22s var(--ios-ease);

  /* z-index */
  --z-base: 1;
  --z-overlay: 20;
  --z-modal: 40;

  /* 字体 */
  --fs-lg: 23px;
  --fw-extrabold: 800;
  --fw-semibold: 600;
  --ls-tight: -0.02em;
  --ls-wide: 0.02em;
  --lh-tight: 1.2;

  --font-stack: "JiangChengYuanTi", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  position: relative;
  min-height: 100dvh;
  line-height: 1.6;
}

/* 噪点纹理 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(208, 100, 126, 0.16); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: rgba(208, 100, 126, 0.28); }

/* 焦点环 */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ===== Skip Link ===== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  z-index: 10000;
  transition: top 0.2s;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ===== 顶部栏 ===== */
.app-header {
  background: var(--surface);
  border-bottom: 2px solid var(--accent-muted);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
/* 标题 */
.app-header-title {
  position: relative;
  font-size: 20px;
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

/* 左侧闪烁星标 */
.title-sparkle {
  position: relative;
  font-size: 0.66em;
  vertical-align: 0.08em;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  text-shadow: 0 0 6px rgba(208, 100, 126, 0.8), 0 0 12px rgba(208, 100, 126, 0.45);
  animation: header-twinkle 3.2s ease-in-out infinite;
}

.title-sparkle--l {
  margin-right: 9px;
}

@keyframes header-twinkle {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); }
}

.title-sparkle::before,
.title-sparkle::after {
  content: '✦';
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 0.5em;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  text-shadow: 0 0 5px rgba(208, 100, 126, 0.7);
  opacity: 0;
  pointer-events: none;
}

.title-sparkle--l::before { animation: bloom-l1 2.6s ease-out infinite; }
.title-sparkle--l::after  { animation: bloom-l2 2.6s ease-out infinite; animation-delay: 1.3s; }

@keyframes bloom-l1 {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(0deg); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% - 13px), calc(-50% - 12px)) scale(0.95) rotate(40deg); }
}
@keyframes bloom-l2 {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(0deg); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% - 13px), calc(-50% + 12px)) scale(0.95) rotate(-40deg); }
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-watermark {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  letter-spacing: var(--ls-wide);
  opacity: 0.95;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition), color var(--transition);
}
.header-watermark:hover {
  opacity: 1;
  color: var(--accent);
}

/* ===== 应用容器 ===== */
.app-container {
  width: calc(100% - 32px);
  max-width: 380px;
  margin: auto;
  background: var(--elevated);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
  z-index: var(--z-base);
}

.app-container:has(.result-display) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: 0;
  max-width: 400px;
  overflow: visible;
  margin-block: auto;
}
.content-wrapper:has(.result-display) {
  padding: 0;
}

.content-wrapper {
  padding: 28px 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity, filter;
}

/* ===== 网络提示 ===== */
.network-banner {
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-muted);
  background: var(--accent-muted);
  color: var(--accent-text);
}

/* ===== 首页 ===== */
.home-screen { width: 100%; text-align: center; display: flex; flex-direction: column; }
.home-header { padding: 8px 0 28px; display: flex; flex-direction: column; align-items: center; }

.home-deco {
  color: var(--accent);
  margin-bottom: 16px;
  opacity: 0.7;
}
.home-deco svg {
  animation: decoTwinkle 3.4s ease-in-out infinite;
  transform-origin: 50% 42%;
}
@keyframes decoTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.08) rotate(8deg); opacity: 1; }
}

.home-title {
  font-size: clamp(1.8rem, 5vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  text-wrap: balance;
}

.home-subtitle {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 auto;
  text-wrap: pretty;
}

.home-mode-caption {
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  margin: 2px 2px 8px;
}

.home-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 0; }

/* ===== 模式选择卡片 ===== */
.mode-card {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  background: var(--elevated);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.mode-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mode-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-text);
  letter-spacing: -0.01em;
}
.mode-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: 3px;
}

.mode-card-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  line-height: 1;
}

.mode-card-go::after {
  content: "↗";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-text);
  background: var(--accent-muted);
  animation: modeGoArrowPulse 1.7s var(--ease-out) infinite;
  transition: transform var(--transition), background var(--transition), color var(--transition);
}

@keyframes modeGoArrowPulse {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(2px); }
}
.mode-card-primary {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 3px 12px rgba(208, 100, 126, 0.25);
}
.mode-card-primary .mode-card-name { color: #fff; }
.mode-card-primary .mode-card-go {
  color: #fff;
}
.mode-card-primary .mode-card-go::after {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.mode-card-primary .mode-card-meta { color: rgba(255, 255, 255, 0.9); }

.mode-card:focus-visible {
  border-color: var(--accent);
  background: var(--accent-muted);
}

@media (hover: hover) {
  .mode-card:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
    transform: translateY(-1px);
  }
  .mode-card:hover .mode-card-go::after {
    transform: translateX(3px);
    background: var(--accent);
    color: #fff;
  }
  .mode-card-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(208, 100, 126, 0.35);
  }
}

.mode-card.tap-selected,
.mode-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
  background: var(--accent-muted);
}

.mode-card.tap-selected .mode-card-go::after,
.mode-card:active .mode-card-go::after {
  transform: translateX(2px);
  background: var(--accent);
  color: #fff;
}

.mode-card-primary.tap-selected,
.mode-card-primary:active {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(208, 100, 126, 0.35);
}

.mode-card-primary.tap-selected .mode-card-go::after,
.mode-card-primary:active .mode-card-go::after {
  background: rgba(255, 255, 255, 0.28);
}

/* ===== 恢复卡片 ===== */
.resume-card {
  text-align: left;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--card);
}

.resume-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.resume-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.resume-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: center;
}

.resume-actions .btn-secondary,
.resume-actions .btn-ghost {
  flex: 0 0 auto;
  width: 46%;
  max-width: 150px;
  padding: 12px 10px;
  font-size: 14px;
  color: var(--text);
}

.resume-actions .btn-secondary {
  background: var(--accent-btn);
  color: #fff;
  border-color: var(--accent-btn);
  box-shadow: 0 3px 12px rgba(208, 100, 126, 0.25);
}

.resume-actions .btn-secondary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 6px 20px rgba(208, 100, 126, 0.35);
}

.resume-actions .btn-secondary:active {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

/* ===== 按钮 ===== */
.btn-primary, .btn-secondary {
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-btn);
  color: #fff;
  box-shadow: 0 3px 12px rgba(208, 100, 126, 0.25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(208, 100, 126, 0.35);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.97) translateY(0);
  box-shadow: 0 2px 8px rgba(208, 100, 126, 0.2);
}

.btn-secondary {
  background: var(--elevated);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-muted);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: scale(0.97);
}

.btn-back {
  background: var(--elevated);
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-muted);
}

.btn-back:focus-visible,
.btn-back.tap-selected,
.btn-back:active {
  transform: scale(0.96);
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-muted);
}

.question-bottombar {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.btn-back-mini {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 7px;
}

.page-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-muted);
}

.btn-ghost {
  padding: 11px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--elevated);
  color: var(--text-secondary);
  width: 100%;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-muted);
}
.btn-ghost:active { transform: scale(0.97); }

.btn-share {
  background: var(--elevated);
  border: 1.5px solid var(--border-strong);
  color: var(--accent-text);
  font-weight: 700;
  padding: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-share:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.btn-share:active { transform: scale(0.97); }

/* ===== 题目头部 ===== */
.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-md-lg);
  width: 100%;
}

.mode-badge {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 2px;
  display: inline-block;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--card);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  border-radius: 3px;
  transition: width 0.4s var(--ease-out);
}

/* ===== 题目 ===== */
.question-box { width: 100%; margin-bottom: var(--space-md-lg); }
.question-box h2 {
  font-size: clamp(1.125rem, 4.6vw, 1.3rem);
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: var(--space-md-lg);
  text-align: center;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  letter-spacing: -0.01em;
  max-width: 34ch;
  margin-inline: auto;
}

/* ===== 选项按钮 ===== */
.option-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  margin-top: 0;
}

.option-btn {
  padding: 14px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--border-strong);
  background: var(--elevated);
  color: var(--text);
  font-family: inherit;
  transition: all 0.22s var(--ios-ease);
  text-align: center;
  line-height: 1.4;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 仅悬停设备生效 */
@media (hover: hover) {
  .option-btn:hover,
  .option-btn.hover-sim {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(208, 100, 126, 0.25);
  }
  /* hover-sim 立即生效 */
  .option-btn.hover-sim { transition: none; }
}

.option-btn:active {
  transform: scale(0.98);
  box-shadow: none;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transition: none;
}

.option-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(208, 100, 126, 0.25);
  transition: background-color 0.12s var(--ios-ease), border-color 0.12s var(--ios-ease), color 0.12s var(--ios-ease), box-shadow 0.12s var(--ios-ease);
}

@media (hover: hover) {
  .option-btn.selected:hover,
  .option-btn.selected.hover-sim {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(208, 100, 126, 0.35);
  }
  .option-btn.selected.hover-sim { transition: none; }
}

.option-btn.selected:active {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: scale(0.97) translateY(0);
  box-shadow: 0 2px 8px rgba(208, 100, 126, 0.2);
  transition: none;
}

.progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  white-space: nowrap;
  min-width: 36px;
  text-align: center;
}

.nav-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0; width: 100%; }

/* ===== 结果页 ===== */
.result-display {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 26px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(165deg, #fff7f1 0%, #ffe9ee 55%, #fff1e8 100%);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(180, 120, 100, 0.14), inset 0 0 0 1px rgba(208, 100, 126, 0.14), inset 0 0 0 6px rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.result-spark { position: absolute; color: #e3a0b6; line-height: 1; pointer-events: none; z-index: 0; }
.result-spark-1 { top: 10px; left: 12px; font-size: 18px; opacity: 0.55; }
.result-spark-2 { top: 18px; right: 14px; font-size: 12px; opacity: 0.5; color: #d9a98a; }
.result-spark-3 { bottom: 14px; left: 16px; font-size: 12px; opacity: 0.45; }
.result-spark-4 { bottom: 10px; right: 12px; font-size: 16px; opacity: 0.5; }

.result-poster-head {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em;
  color: #d0647e; margin-bottom: 14px;
}
.result-poster-head .star { color: #e3a0b6; font-size: 11px; }

.result-tier-list, .result-extra { position: relative; z-index: 1; }

/* --- Hero: 第 1 名 --- */
.result-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.result-hero-img-wrap {
  position: relative;
  width: 280px;
  /* 不固定高度，随立绘实际高度自适应 */
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 0;
  z-index: 2;
}

/* 去掉之前的 ::after 渐变遮罩 */

.result-hero-img {
  max-width: 100%;
  z-index: 2;
  object-fit: contain;
  /* 无边框、无圆角、无背景色 */
  border-radius: 0;
  filter: none;
  /* 预览页：用 mask 让立绘底部融入背景 */
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* 旧版导出占位（样式保留） */
.hero-fade {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,231,239,0) 0%, #ffe7ef 100%);
}

.result-hero-placeholder {
  z-index: 2;
  min-height: 200px;
  min-width: 220px;
  border: 1.5px dashed var(--border-strong);
  background: var(--card);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.5;
  padding: 14px;
  border-radius: 16px;
}
.result-hero-placeholder span {
  font-size: 12px;
  font-weight: 700;
}

.result-hero-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
  position: relative;
  z-index: 3;
  margin-top: -28px;
}

/* 排名徽章 */
.result-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: 900;
  margin-bottom: 10px;
}
.result-rank-badge.rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  padding: 5px 18px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  box-shadow: 0 4px 16px rgba(255, 165, 0, 0.3);
}

.res-name {
  font-size: 28px; font-weight: 900; color: var(--text);
  margin-bottom: 12px; letter-spacing: -0.02em; line-height: 1.1;
  overflow-wrap: anywhere; text-wrap: balance;
  text-align: center;
}

/* 匹配度条 + 百分比 */
.result-match-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-bottom: var(--space-base);
}

/* 匹配度：星级计量 */
.star-meter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.star-meter .star {
  font-size: 26px;
  line-height: 1;
  color: var(--text-tertiary);
  transition: color var(--transition);
}
.star-meter .star.on {
  color: var(--accent);
  text-shadow: 0 1px 5px rgba(208, 100, 126, 0.35);
}
.star-meter .star.partial {
  color: var(--accent);
  opacity: 0.5;
}
.star-meter-sm {
  gap: 1px;
}
.star-meter-sm .star {
  font-size: 13px;
}

.match-percent-hero {
  font-weight: 900;
  font-size: 22px;
  color: var(--accent);
  min-width: 52px;
  text-align: right;
  letter-spacing: -0.02em;
}

.result-desc {
  font-size: 14px; line-height: 1.65; text-align: center;
  color: var(--text-secondary); margin-bottom: 0;
  padding: 0 8px; overflow-wrap: anywhere;
}

/* --- 第 2-5 名：横向卡片列表 --- */
.result-tier-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-base);
}

.result-tier-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(208, 100, 126, 0.18);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.tier-rank {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  background: var(--border);
  color: var(--text-secondary);
}
.tier-rank.rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.tier-rank.rank-3 {
  background: linear-gradient(135deg, #CD7F32, #B8690E);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.tier-img-wrap {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tier-img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
}

.tier-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-tertiary);
  background: var(--border);
}

.tier-info {
  flex: 1;
  min-width: 0;
}

.tier-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-match {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-match .match-percent {
  font-weight: 800;
  font-size: 13px;
  color: var(--accent-text);
  min-width: 38px;
  text-align: right;
}

/* --- 显示更多按钮 --- */
.result-show-more {
  width: 100%;
  padding: 12px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
  margin-bottom: 0;
}
.result-show-more:active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}
.show-more-arrow {
  font-size: 12px;
  transition: transform 0.3s var(--ease-out);
}
.result-show-more.expanded .show-more-arrow {
  transform: rotate(180deg);
}

.result-utility-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  margin-bottom: 10px;
}

/* --- 隐藏区域 (第 6-10 名) --- */
.result-extra {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-base);
}

/* --- 空结果 --- */
.result-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.result-empty h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.result-empty p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== 分享弹窗 ===== */
.share-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.share-modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--elevated);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90dvh;
  overflow-y: auto;
}

.share-tip {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.5;
}

.share-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-tertiary);
  font-size: 14px;
}

.share-preview-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.share-export-area {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.share-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.share-action-btn {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.share-action-btn:active {
  transform: scale(0.97);
}
.share-action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.share-action-btn.primary:active {
  background: var(--accent-hover);
}

/* 操作按钮 */
.result-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-bottom: 4px; }
.action-row-split { display: flex; gap: 12px; width: 100%; }
.action-row-split button {
  flex: 1; height: 48px; display: flex; align-items: center; justify-content: center;
  padding: 0; border-radius: var(--radius); font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; font-family: inherit;
}

.result-action-row-main {
  margin-top: 2px;
}

.result-retest-inline-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
  margin-bottom: 2px;
}

.result-retest-inline-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.result-retest-inline {
  border: none;
  background: transparent;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  line-height: 1;
  padding: 4px 2px;
}

.result-retest-inline:active {
  color: var(--accent-hover);
}

.result-feedback-card {
  background: var(--elevated);
}

/* 联系卡（参考 ES属性图生成器 交互） */
.feedback-card {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out), opacity var(--transition);
  max-height: 80vh;
  opacity: 1;
}

.feedback-card.collapsed {
  max-height: 0;
  opacity: 0;
  border: none;
  box-shadow: none;
}

.fb-body {
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(80vh - 8px);
}

.fb-body > .fb-item + .fb-item { margin-top: 0; }
.fb-body > .fb-divider { margin-top: 4px; }
.fb-body > .fb-miniapp + .fb-miniapp { margin-top: 4px; }

.fb-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
  cursor: pointer;
}

.fb-item:hover {
  background: var(--card);
}

.fb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

.fb-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  word-break: break-all;
}

.fb-value-link {
  color: var(--accent-text);
}

.fb-copy-hint {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-muted);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.fb-item.fb-copied .fb-copy-hint {
  background: var(--success);
  color: #fff;
}

.fb-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-text);
  letter-spacing: 0.05em;
}

.fb-divider::before {
  content: "";
  width: 14px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
  flex-shrink: 0;
}

.fb-miniapp {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: default;
}

.fb-miniapp:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.fb-miniapp-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0;
}

.fb-miniapp-name::before {
  content: "⬡";
  font-size: 12px;
  color: var(--accent);
}

.fb-miniapp-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ===== Toast ===== */
.toast-host {
  position: fixed;
  inset-inline: 0;
  bottom: 18px;
  z-index: var(--z-modal);
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 12px;
}

.app-toast {
  max-width: min(420px, 100%);
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-lg);
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 弹窗 ===== */
.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(58, 40, 40, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app-dialog {
  width: min(420px, 100%);
  background: var(--elevated);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

.app-dialog h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.app-dialog p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.app-dialog-actions {
  display: flex;
  gap: 10px;
}

.app-dialog-actions button { flex: 1; }

/* ===== 更多工具菜单 ===== */
.more-menu-card {
  width: 100%;
  max-width: 380px;
  margin: 0;
  padding: 0;
  background: var(--elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
  animation: moreMenuIn 0.55s var(--ios-ease) both;
  animation-delay: 0.15s;
}

@keyframes moreMenuIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.more-menu-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}
.more-menu-toggle:hover { background: rgba(60, 40, 40, 0.02); }
.more-menu-toggle:active { background: rgba(60, 40, 40, 0.04); }

.more-menu-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.more-menu-leading-icon {
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.32s var(--ios-ease), color 0.2s ease;
}
.more-menu-toggle:hover .more-menu-leading-icon { transform: rotate(45deg) scale(1.06); }

.more-menu-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.more-menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(208, 100, 126, 0.2);
}
.more-menu-card.more-menu-collapsed .more-menu-badge { display: none; }

.more-menu-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.32s var(--ios-ease), color 0.2s ease;
}
.more-menu-toggle:hover .more-menu-chevron { color: var(--accent-text); }
.more-menu-card:not(.more-menu-collapsed) .more-menu-chevron {
  transform: rotate(180deg);
  color: var(--accent-text);
}

.more-menu-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 18px 18px;
  overflow: hidden;
}
.more-menu-body[hidden] { display: none; }

.more-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -4px 2px;
}

.more-menu-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.more-menu-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}
.more-menu-item:hover { background: rgba(60, 40, 40, 0.02); }

.more-menu-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: all 0.22s var(--ios-ease);
  white-space: nowrap;
  touch-action: manipulation;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.more-menu-btn-icon {
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.32s var(--ios-ease);
}

.more-menu-btn:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent-text);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(208, 100, 126, 0.12);
}
.more-menu-btn:hover .more-menu-btn-icon { transform: rotate(-12deg) scale(1.05); }

.more-menu-btn:active {
  transform: scale(0.97) translateY(0);
  background: var(--accent-muted);
}

.more-menu-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
  text-align: center;
  margin: 0;
  padding: 0 2px 2px;
}

.more-menu-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  text-align: center;
  line-height: 1.55;
  color: var(--text-tertiary);
}
.more-menu-footer span {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 500;
}
.more-menu-footer span:last-child {
  font-size: 10px;
  opacity: 0.6;
}

/* 主页链接 */
.home-links {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding: 0 4px;
}
.home-links a {
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  transition: background 0.2s ease;
}
.home-links a:hover {
  background: var(--accent-muted);
}

/* 扩列引导 */
.persona-guide-box {
  width: 100%;
  background: var(--accent-muted);
  border: 1.5px solid rgba(208, 100, 126, 0.18);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.persona-guide-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}
.persona-guide-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.persona-guide-text strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-text);
}
.persona-guide-text span {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.persona-guide-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(208, 100, 126, 0.25);
  transition: all 0.22s var(--ios-ease);
  white-space: nowrap;
  font-family: inherit;
}
.persona-guide-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(208, 100, 126, 0.35);
  transform: translateY(-1px);
}
.persona-guide-btn:active {
  transform: scale(0.96) translateY(0);
}

/* ===== 统计弹窗 ===== */
.stats-modal {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
  background: rgba(58, 40, 40, 0.3);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  z-index: var(--z-modal);
  display: flex; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; padding: 20px; box-sizing: border-box;
}
.stats-modal.show { pointer-events: auto; }

.stats-card {
  width: clamp(300px, 88vw, 380px);
  max-width: 380px;
  height: clamp(420px, 78vh, 85vh);
  background: var(--elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}
.stats-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.btn-close-stats {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-close-stats:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-muted); }

.stats-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  min-height: 36px;
}
.stats-tabs:active { cursor: grabbing; }

.stats-tab {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--elevated);
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.stats-tab:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-muted); }
.stats-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(208, 100, 126, 0.25);
}

.stats-scroll-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.stats-scroll-body::-webkit-scrollbar { width: 4px; }
.stats-scroll-body::-webkit-scrollbar-track { background: transparent; }
.stats-scroll-body::-webkit-scrollbar-thumb { background: rgba(208, 100, 126, 0.12); border-radius: 2px; }

.stats-leaderboard { display: flex; flex-direction: column; gap: 8px; padding: 0 4px 6px; width: 100%; box-sizing: border-box; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  min-height: 44px;
  touch-action: manipulation;
  user-select: none;
}
.lb-row:hover { background: var(--card-hover); border-color: var(--border-strong); }
.lb-row:active { transform: scale(0.985); }

.lb-row.top1 {
  background: linear-gradient(135deg, rgba(208, 100, 126, 0.12), rgba(208, 138, 90, 0.08));
  border-color: rgba(208, 100, 126, 0.25);
  box-shadow: 0 2px 8px rgba(208, 100, 126, 0.12);
}
.lb-row.top2 {
  background: linear-gradient(135deg, rgba(160, 140, 130, 0.15), rgba(140, 120, 110, 0.1));
  border-color: rgba(160, 140, 130, 0.3);
}
.lb-row.top3 {
  background: linear-gradient(135deg, rgba(208, 138, 90, 0.1), rgba(180, 120, 80, 0.06));
  border-color: rgba(208, 138, 90, 0.2);
}

.lb-rank {
  width: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-align: center;
  flex-shrink: 0;
  line-height: 1.2;
}
.lb-row.top1 .lb-rank { color: var(--accent); font-size: 14px; }
.lb-row.top2 .lb-rank { color: var(--text-secondary); }
.lb-row.top3 .lb-rank { color: var(--accent2); }

.lb-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.lb-unit-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.lb-unit-tag img {
  width: 30px;
  height: 12px;
  object-fit: contain;
  display: block;
}

.lb-bar-track {
  width: 120px;
  height: 8px;
  background: var(--card);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  margin-left: auto;
  border: 1px solid var(--border);
}
.lb-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
}

.stats-footer {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  flex-shrink: 0;
  line-height: 1.6;
}

/* ===== 公告弹窗 ===== */
.modal-notice-content {
  text-align: left;
  margin: 0 0 16px;
}
.modal-notice-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
  text-align: left;
}
.modal-notice-content p:last-child { margin-bottom: 0; }

.modal-notice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(208, 100, 126, 0.25);
  font-family: inherit;
  transition: all var(--transition);
}
.modal-notice-btn:hover { background: var(--accent-hover); box-shadow: 0 6px 24px rgba(208, 100, 126, 0.35); }
.modal-notice-btn:active { transform: scale(0.97); }

/* 弹窗操作按钮 */
.modal-actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 12px;
}
.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  min-width: 0;
}
.modal-btn.cancel {
  background: var(--card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-strong);
}
.modal-btn.cancel:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-muted); }
.modal-btn.confirm {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(208, 100, 126, 0.25);
}
.modal-btn.confirm:hover { background: var(--accent-hover); }

/* ===== 页脚 ===== */
.copyright-wrapper {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 18px 16px 14px;
  font-size: 11px; color: var(--text-tertiary);
  text-align: center; line-height: 1.5;
}
.copyright-wrapper .links-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
.copyright-wrapper .links-row a {
  color: var(--accent-text); text-decoration: none; font-weight: 700;
  font-size: 12px; white-space: nowrap; padding: 2px 4px;
  border-radius: var(--radius-xs); transition: background 0.2s ease;
}
.copyright-wrapper .links-row a:hover { background: var(--accent-muted); }
.copyright-wrapper .info-row {
  font-size: 10px; opacity: 0.7;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
}
.main-site-link { color: var(--accent-text); text-decoration: none; font-weight: 700; }

/* ===== 错误状态 ===== */
.error-inline {
  color: var(--danger);
  background: var(--danger-muted);
  border: 1px solid rgba(200, 72, 72, 0.2);
  border-radius: var(--radius);
  padding: 12px;
  line-height: 1.6;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.error-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== 辅助类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 360px) {
  body { gap: 10px; padding: 0; }
  .more-menu-card { border-radius: 18px; }
  .more-menu-toggle { padding: 12px 14px; }
  .more-menu-title { font-size: 13px; }
  .more-menu-body { padding: 0 14px 14px; gap: 8px; }
  .more-menu-actions { gap: 8px; }
  .more-menu-btn { font-size: 13px; padding: 9px 10px; min-height: 40px; }
  .more-menu-desc { font-size: 11px; }
  .more-menu-footer span { font-size: 10px; }
  .more-menu-footer span:last-child { font-size: 9px; }
  .stats-card { padding: 16px 12px 18px; max-width: 100%; border-radius: 18px; width: clamp(260px, 94vw, 360px); height: clamp(360px, 72vh, 82vh); }
  .stats-header { margin-bottom: 12px; }
  .stats-title { font-size: 16px; }
  .btn-close-stats { width: 26px; height: 26px; font-size: 13px; }
  .stats-tabs { gap: 6px; margin-bottom: 10px; padding: 3px 3px 8px; }
  .stats-tab { padding: 6px 11px; font-size: 12px; }
  .lb-row { padding: 8px 6px; gap: 3px; }
  .lb-rank { width: 16px; font-size: 11px; }
  .lb-name { font-size: 12px; }
  .lb-unit-tag img { width: 24px; height: 9px; }
  .lb-bar-track { width: 72px; height: 7px; }
  .stats-footer { font-size: 12px; }
}

@media (min-width: 480px) {
  body { gap: 14px; }
  .more-menu-card { border-radius: var(--radius-card); }
  .more-menu-toggle { padding: 15px 22px; }
  .more-menu-title { font-size: 15px; }
  .more-menu-body { padding: 0 22px 22px; gap: 12px; }
  .more-menu-actions { gap: 12px; }
  .more-menu-btn { font-size: 14px; padding: 11px 16px; min-height: 46px; }
  .more-menu-desc { font-size: 12px; }
  .more-menu-footer span { font-size: 11px; }
  .more-menu-footer span:last-child { font-size: 10px; }
  .stats-card { padding: 22px 20px 18px; max-width: 430px; border-radius: var(--radius-card); width: clamp(340px, 80vw, 430px); height: clamp(460px, 80vh, 88vh); }
  .stats-header { margin-bottom: 16px; }
  .stats-title { font-size: 19px; }
  .stats-tabs { gap: 10px; margin-bottom: 14px; padding: 4px 4px 12px; }
  .stats-tab { padding: 8px 16px; font-size: 13px; }
  .lb-row { padding: 12px 12px; gap: 6px; }
  .lb-rank { width: 22px; font-size: 13px; }
  .lb-name { font-size: 14px; }
  .lb-unit-tag img { width: 34px; height: 13px; }
  .lb-bar-track { width: 130px; height: 10px; }
}

/* 移动端：顶栏等比缩小 */
@media (max-width: 767px) {
  .app-header { padding: 10px 14px; }
  .app-header-title { font-size: 18px; }
  .header-watermark { font-size: 10px; }
  /* 手机端补固定间距 */
  .content-wrapper:has(.result-display) { padding: 28px 0 32px; }
}

/* ===== 无障碍 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.wm-name {
  color: var(--text);
  font-weight: 700;
}

/* ===== 顶栏悬浮提示（访问统计 / B 站链接） ===== */
@keyframes floatTipIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
#headerFloatTip .ht-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text, #d0647e);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
#headerFloatTip .ht-line { color: var(--text, #3a2828); }
#headerFloatTip .ht-line strong { color: var(--accent, #d0647e); font-weight: 700; }
