/* ============================================================
   测友社 —— 「星海观测站」视觉系统
   ------------------------------------------------------------
   风格关键词：深空神秘 × 卡通二次元 × 霓虹糖果色
   吉祥物：小星灵「测测」
   设计原则：
     1. 手机优先（≤520px 为设计基准，桌面端居中收窄）
     2. 大点击区（按钮 ≥ 48px）、大字号、强对比
     3. 色彩丰富但有序：每个板块一个主题色，卡通用品牌四色
     4. 动效克制：只用于引导注意力，不影响性能
   ============================================================ */

:root {
  /* —— 底色 —— */
  --bg0: #12082E;
  --bg1: #1B0F45;
  --bg2: #241566;
  /* —— 品牌色 —— */
  --violet: #A78BFA;
  --violet-deep: #7C3AED;
  --cyan: #22D3EE;
  --pink: #FF6BB5;
  --yellow: #FDE047;
  --green: #34D399;
  --orange: #FB923C;
  --blue: #60A5FA;
  --red: #FB7185;
  /* —— 文字 —— */
  --ink: #F3EFFF;
  --ink-dim: #C9BFEA;
  --muted: #9186C4;
  /* —— 面 —— */
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .11);
  /* —— 圆角与阴影 —— */
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --glow-violet: 0 10px 34px -8px rgba(139, 92, 246, .55);
  --glow-cyan: 0 10px 34px -8px rgba(34, 211, 238, .45);
  /* —— 字体 —— */
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB",
          "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: "DIN Alternate", "Bahnschrift", "Avenir Next", var(--font);
  /* —— 布局 —— */
  --maxw: 520px;
  --tabbar-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg0);
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: .2px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; cursor: pointer; background: none; color: inherit; }
img { display: block; }

/* ============================================================
   1. 宇宙背景：星点 × 星云 × 流星
   ============================================================ */
.cosmos {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 85% -10%, #31206E 0%, transparent 60%),
    radial-gradient(1000px 800px at -15% 30%, #14284F 0%, transparent 55%),
    radial-gradient(900px 700px at 70% 110%, #3B1550 0%, transparent 55%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 55%, #0C0625 100%);
}

/* 两层星点：用多组 radial-gradient 手绘星星，慢速漂移 */
.stars { position: absolute; inset: -60% -10%; background-repeat: repeat; will-change: transform; }
.stars-a {
  background-image:
    radial-gradient(1.6px 1.6px at 25px 35px, rgba(255,255,255,.9) 45%, transparent 55%),
    radial-gradient(1.2px 1.2px at 120px 90px, rgba(199,210,254,.8) 45%, transparent 55%),
    radial-gradient(2.2px 2.2px at 210px 40px, rgba(253,224,71,.85) 45%, transparent 55%),
    radial-gradient(1.2px 1.2px at 300px 150px, rgba(255,255,255,.7) 45%, transparent 55%),
    radial-gradient(1.8px 1.8px at 70px 200px, rgba(34,211,238,.75) 45%, transparent 55%),
    radial-gradient(1.4px 1.4px at 260px 240px, rgba(255,255,255,.65) 45%, transparent 55%);
  background-size: 340px 280px;
  animation: drift 90s linear infinite;
}
.stars-b {
  background-image:
    radial-gradient(1px 1px at 45px 65px, rgba(255,255,255,.5) 45%, transparent 55%),
    radial-gradient(1.4px 1.4px at 160px 25px, rgba(255,107,181,.55) 45%, transparent 55%),
    radial-gradient(1px 1px at 240px 180px, rgba(255,255,255,.4) 45%, transparent 55%),
    radial-gradient(1.3px 1.3px at 90px 140px, rgba(167,139,250,.5) 45%, transparent 55%);
  background-size: 280px 220px;
  animation: drift 140s linear infinite reverse;
  opacity: .8;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-340px, 280px, 0); }
}

/* 星云光斑 */
.nebula { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.nebula-a { width: 46vw; height: 46vw; left: -18vw; top: 6vh;
  background: radial-gradient(circle, rgba(124,58,237,.55), transparent 70%); }
.nebula-b { width: 52vw; height: 52vw; right: -22vw; bottom: 8vh;
  background: radial-gradient(circle, rgba(34,211,238,.32), transparent 70%); }

/* 偶尔划过的流星 */
.shooting-star {
  position: absolute; width: 130px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.9));
  transform: rotate(-32deg); opacity: 0;
}
.shooting-star.s1 { top: 16%; left: -20%; animation: shoot 9s ease-in infinite 3s; }
.shooting-star.s2 { top: 38%; left: -30%; animation: shoot 12s ease-in infinite 8.5s; }
@keyframes shoot {
  0%   { transform: translate3d(0,0,0) rotate(-32deg); opacity: 0; }
  4%   { opacity: .9; }
  12%  { transform: translate3d(120vw, 46vh, 0) rotate(-32deg); opacity: 0; }
  100% { opacity: 0; }
}

/* ============================================================
   2. 顶栏 & 底部导航
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px 18px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: linear-gradient(180deg, rgba(18,8,46,.92), rgba(18,8,46,.55) 70%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand-logo { height: 34px; width: auto; filter: drop-shadow(0 2px 10px rgba(124,58,237,.45)); }

.points-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-num); font-weight: 700; font-size: 15px;
  color: #1B0F45;
  background: linear-gradient(135deg, var(--yellow), #FDBA4D);
  padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 4px 18px -4px rgba(253,224,71,.6);
}

.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; z-index: 60;
  width: 100%; max-width: var(--maxw);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(20,10,50,.78), rgba(14,7,38,.96));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 3px; color: var(--muted);
  transition: color .18s, transform .18s;
}
.tab-ic { width: 24px; height: 24px; }
.tab-ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.tab-txt { font-size: 11px; letter-spacing: 1px; }
.tabbar a.active { color: var(--ink); transform: translateY(-2px); }
.tabbar a.active .tab-ic svg { stroke: var(--cyan); filter: drop-shadow(0 0 8px rgba(34,211,238,.8)); }
.tabbar a.active .tab-txt { color: var(--cyan); font-weight: 700; }

/* ============================================================
   3. 主容器
   ============================================================ */
#app {
  max-width: var(--maxw); margin: 0 auto;
  padding: 6px 16px calc(var(--tabbar-h) + 34px);
  min-height: 72vh;
}

/* 首次进入的召唤动画 */
.boot-mask {
  position: fixed; inset: 0; z-index: 99; display: grid; place-items: center;
  background: var(--bg0); transition: opacity .45s, visibility .45s;
}
.boot-mask.gone { opacity: 0; visibility: hidden; }
.boot-mascot {
  width: 92px; height: 92px; border-radius: 50%;
  background: url(/test/static/assets/img/favicon.svg) center/contain no-repeat;
  animation: bootFloat 1.15s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 26px rgba(139,92,246,.7));
}
@keyframes bootFloat {
  from { transform: translateY(-9px) scale(.96); }
  to   { transform: translateY(6px) scale(1.04); }
}

/* ============================================================
   4. 通用组件
   ============================================================ */
.sec { margin-top: 30px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.sec-title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px; }
.sec-title .deco { width: 7px; height: 20px; border-radius: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  box-shadow: 0 0 12px rgba(34,211,238,.7); }
.sec-sub { margin: 3px 0 0 15px; font-size: 12.5px; color: var(--muted); }
.sec-more { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sec-more:active { color: var(--cyan); }

/* —— 按钮 —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 50px; padding: 0 26px; border-radius: 999px;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  transition: transform .16s, box-shadow .16s, opacity .16s;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 55%, #22D3EE 140%);
  background-size: 150% 150%;
  box-shadow: var(--glow-violet);
}
.btn-primary:active { box-shadow: 0 4px 18px -6px rgba(139,92,246,.6); }
.btn-ghost {
  color: var(--ink-dim);
  background: var(--glass); border: 1.5px solid var(--line);
}
.btn-warn { color: #2B0A3D; background: linear-gradient(135deg, var(--pink), #FF9EC7);
  box-shadow: 0 10px 30px -8px rgba(255,107,181,.55); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* —— 徽标 / 标签 —— */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 3px 11px; border-radius: 999px;
  background: rgba(255,255,255,.07); color: var(--ink-dim);
  border: 1px solid var(--line); white-space: nowrap;
}
.chip.c-violet { color: #DDD6FE; background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.4); }
.chip.c-cyan   { color: #A5F3FC; background: rgba(34,211,238,.13); border-color: rgba(34,211,238,.4); }
.chip.c-pink   { color: #FBCFE8; background: rgba(255,107,181,.14); border-color: rgba(255,107,181,.4); }
.chip.c-yellow { color: #FEF3C7; background: rgba(253,224,71,.13); border-color: rgba(253,224,71,.4); }
.chip.c-green  { color: #A7F3D0; background: rgba(52,211,153,.13); border-color: rgba(52,211,153,.4); }
.chip.c-orange { color: #FED7AA; background: rgba(251,146,60,.14); border-color: rgba(251,146,60,.4); }

/* —— 卡片 —— */
.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* —— 空状态 —— */
.empty {
  text-align: center; padding: 44px 18px 40px; color: var(--muted);
}
.empty .mascot {
  width: 88px; height: 88px; margin: 0 auto 10px;
  background: url(/test/static/assets/img/favicon.svg) center/contain no-repeat;
  animation: emptyFloat 2.6s ease-in-out infinite alternate;
  filter: drop-shadow(0 6px 20px rgba(124,58,237,.5));
}
@keyframes emptyFloat { from { transform: translateY(-5px) rotate(-3deg); } to { transform: translateY(6px) rotate(3deg); } }
.empty h3 { margin: 6px 0 4px; font-size: 17px; color: var(--ink-dim); }
.empty p { margin: 4px 0; font-size: 13.5px; }
.empty a { color: var(--cyan); font-weight: 700; }

/* —— 骨架屏 —— */
.skeleton { border-radius: var(--r-md);
  background: linear-gradient(100deg, rgba(255,255,255,.05) 40%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.05) 60%);
  background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -180% 0; } }
.sk-card { height: 128px; margin-bottom: 14px; }

/* ============================================================
   5. 首页 Hero
   ============================================================ */
.hero {
  position: relative; margin-top: 14px;
  border-radius: 30px; padding: 26px 22px 24px;
  background:
    radial-gradient(320px 190px at 88% -12%, rgba(34,211,238,.22), transparent 65%),
    radial-gradient(300px 220px at -10% 110%, rgba(255,107,181,.16), transparent 60%),
    linear-gradient(160deg, rgba(124,58,237,.28), rgba(27,15,69,.65) 55%, rgba(15,8,44,.8));
  border: 1px solid rgba(167,139,250,.28);
  box-shadow: 0 22px 60px -22px rgba(124,58,237,.55);
  overflow: hidden;
}
.hero::before { /* 深空网格 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(300px 200px at 80% 0%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(300px 200px at 80% 0%, #000 20%, transparent 80%);
}
.hero-mascot {
  position: absolute; right: -8px; top: -14px; width: 128px; height: 128px;
  background: url(/test/static/assets/img/favicon.svg) center/contain no-repeat;
  animation: heroFloat 3.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 26px rgba(139,92,246,.65));
}
@keyframes heroFloat { from { transform: translateY(-6px) rotate(-5deg); } to { transform: translateY(8px) rotate(5deg); } }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; letter-spacing: 2px; color: var(--cyan);
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.35);
  padding: 4px 12px; border-radius: 999px; position: relative;
}
.hero h1 {
  position: relative; margin: 14px 0 8px;
  font-size: 27px; line-height: 1.34; font-weight: 900; letter-spacing: .5px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #FDE047 0%, #FF6BB5 45%, #22D3EE 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradFlow 5s ease infinite;
}
@keyframes gradFlow { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.hero p { position: relative; margin: 0 0 18px; font-size: 13.5px; color: var(--ink-dim); max-width: 78%; }
.hero-cta { position: relative; display: flex; gap: 12px; flex-wrap: wrap; }

/* —— 数据带（氛围数字） —— */
.statband {
  display: flex; justify-content: space-around; align-items: center;
  margin: 14px 0 0; padding: 13px 8px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.045); border: 1px solid var(--line);
}
.statband .st { text-align: center; }
.statband .n { font-family: var(--font-num); font-weight: 800; font-size: 19px; color: var(--yellow); }
.statband .l { font-size: 11px; color: var(--muted); letter-spacing: 1px; margin-top: 1px; }

/* ============================================================
   6. 测试卡片
   ============================================================ */
.tcard {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--r-lg); padding: 17px 16px 15px;
  background: var(--glass);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  -webkit-user-select: none; user-select: none;
}
.tcard::before { /* 顶部彩色流光条 */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ac, var(--violet)), transparent 75%);
  opacity: .9;
}
.tcard::after { /* 右上角装饰光环 */
  content: ""; position: absolute; right: -34px; top: -34px; width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ac-soft, rgba(139,92,246,.22)), transparent 68%);
  pointer-events: none;
}
.tcard:active { transform: scale(.98); }
@media (hover: hover) {
  .tcard:hover { transform: translateY(-4px); border-color: var(--ac, var(--violet));
    box-shadow: 0 18px 44px -16px var(--ac-soft, rgba(139,92,246,.4)); }
}
.tcard-top { display: flex; align-items: center; gap: 12px; }
.tcard-ic {
  flex: none; width: 52px; height: 52px; border-radius: 17px;
  display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(150deg, var(--ac-soft, rgba(139,92,246,.28)), rgba(255,255,255,.04));
  border: 1px solid var(--ac-line, rgba(139,92,246,.4));
  box-shadow: inset 0 0 18px rgba(255,255,255,.05);
}
.tcard-name { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.4; }
.tcard-tags { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.tcard-sum { margin: 10px 0 0; font-size: 13px; color: var(--ink-dim); line-height: 1.55; }
.tcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.tcard-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; }
.tcard-go { font-size: 13.5px; font-weight: 800; color: var(--ac, var(--violet));
  display: flex; align-items: center; gap: 4px; }
.tcard-go .arr { transition: transform .18s; }
.tcard:active .tcard-go .arr, .tcard:hover .tcard-go .arr { transform: translateX(4px); }
.tcard.soon { opacity: .55; }
.tcard .fav {
  position: absolute; right: 10px; bottom: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; color: var(--muted);
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  transition: transform .16s, color .16s, background .16s;
}
.tcard .fav.on { color: var(--yellow); background: rgba(253,224,71,.14);
  border-color: rgba(253,224,71,.45); text-shadow: 0 0 10px rgba(253,224,71,.8); }
.tcard .fav:active { transform: scale(1.2); }
.badge-soon {
  position: absolute; right: 12px; top: 12px; font-size: 11px; letter-spacing: 1px;
  color: #1B0F45; background: linear-gradient(135deg, #94A3B8, #CBD5E1);
  padding: 3px 10px; border-radius: 999px; font-weight: 700;
}

/* —— 推荐横滑 —— */
.swipe { display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
  gap: 13px; overflow-x: auto; padding: 4px 2px 12px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; }
.swipe::-webkit-scrollbar { display: none; }
.swipe .tcard { scroll-snap-align: start; }

/* —— 双列网格 ——
   注意：测友社的测试卡片自带「分类 + 2 枚标签 + 时长 + 行动区 + 收藏钮」，
   在半宽（390px 视口下约 173px）列里必然折行（实测标题 2 行、卡高 223px）。
   因此**测试卡片列表一律用下面的 .cardlist 整宽单列**，本类仅保留给
   未来的"纯图标小格子"这类窄元素使用，不要拿它排 .tcard。 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.grid2 .tcard { padding: 15px 13px 13px; }
.grid2 .tcard-ic { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; }
.grid2 .tcard-name { font-size: 14.5px; }
.grid2 .tcard-sum, .grid2 .tcard .fav { display: none; }

/* —— 整宽单列列表（发现页 / 收藏页 / 任何测试卡片列表）——
   测友社的测试卡片自带「分类 + 2 枚标签 + 时长 + 行动区 + 收藏钮」，
   这些元素在 180px 半宽列里必然折行、把卡片撑高，长标题（如"你在朋友眼中是什么类型？"）
   还会把轨道撑破导致横向溢出。整宽单列让它们一行放得下。 */
.cardlist { display: flex; flex-direction: column; gap: 13px; }

/* ============================================================
   7. 分类星图
   ============================================================ */
.catgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 11px; }
.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 13px 4px 11px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--line);
  transition: transform .16s, border-color .16s;
}
.cat-item:active { transform: scale(.94); }
.cat-item.active { border-color: var(--ac); box-shadow: 0 0 0 1px var(--ac), 0 8px 26px -10px var(--ac-soft); }
.cat-ic { font-size: 25px; filter: drop-shadow(0 4px 10px var(--ac-soft, rgba(0,0,0,.4))); }
.cat-name { font-size: 12px; color: var(--ink-dim); letter-spacing: .5px; }

/* —— 发现页分类条：单行横滑 ——
   分类数会随内容扩容增长（5 → 8+），固定列数必然出现"第二行孤零零一个"。
   横滑保证任意分类数都只占一行，且新分类天然"可见可达"。 */
.catbar {
  display: grid; grid-auto-flow: column; grid-auto-columns: 76px; gap: 10px;
  overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.catbar::-webkit-scrollbar { display: none; }
.catbar .cat-item { scroll-snap-align: start; padding: 11px 4px 9px; }
.catbar .cat-ic { font-size: 22px; }
.catbar .cat-name { font-size: 11.5px; }

/* ============================================================
   8. 测试详情 & 作答器
   ============================================================ */
.runner { max-width: var(--maxw); margin: 0 auto; }
.runner-top { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 12px; }
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; color: var(--muted); padding: 8px 12px 8px 4px;
}
.back-link:active { color: var(--cyan); }
.q-count { font-family: var(--font-num); font-size: 15px; font-weight: 700; color: var(--ink-dim); }
.q-count b { color: var(--yellow); font-size: 20px; }

/* 进度条：小火箭飞行轨道 */
.track { position: relative; height: 8px; border-radius: 999px;
  background: rgba(255,255,255,.08); margin: 0 2px 22px; }
.track .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--violet-deep), var(--cyan));
  box-shadow: 0 0 14px rgba(34,211,238,.55);
  transition: width .45s cubic-bezier(.22,1,.36,1); }
.track .rocket { position: absolute; top: 50%; transform: translate(-50%, -58%);
  width: 24px; height: 24px; transition: left .45s cubic-bezier(.22,1,.36,1);
  filter: drop-shadow(0 0 8px rgba(253,224,71,.8)); }

/* 详情页头 */
.intro { text-align: center; padding: 26px 6px 8px; }
.intro-ic {
  width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 30px;
  display: grid; place-items: center; font-size: 46px;
  background: linear-gradient(150deg, var(--ac-soft, rgba(139,92,246,.3)), rgba(255,255,255,.05));
  border: 1px solid var(--ac-line, rgba(139,92,246,.45));
  animation: heroFloat 3s ease-in-out infinite alternate;
  box-shadow: 0 20px 50px -18px var(--ac-soft, rgba(139,92,246,.55));
}
.intro h2 { margin: 0 0 8px; font-size: 23px; font-weight: 900; }
.intro-sum { margin: 0 auto; max-width: 92%; font-size: 14.5px; color: var(--ink-dim); }
.intro-desc { margin: 10px auto 0; max-width: 92%; font-size: 13px; color: var(--muted); }
.intro-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
/* 开测前补充参数（由后端 test.pre_ask 声明，如瑞文的年龄） */
.pre-ask { margin-top: 20px; padding: 15px 16px 13px; border-radius: var(--r-md);
  background: rgba(255,255,255,.05); border: 1px solid var(--line); text-align: left; }
.pa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pa-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.pa-input { width: 108px; padding: 9px 12px; text-align: center; border-radius: 12px;
  background: rgba(0,0,0,.28); border: 1.5px solid var(--line);
  color: var(--ink); font-size: 16px; font-weight: 800; font-family: var(--font-num); outline: none; }
.pa-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.22); }
.pa-hint { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.intro-cta { margin-top: 24px; display: grid; gap: 12px; }
.intro-hint { margin-top: 14px; font-size: 12px; color: var(--muted); display: flex;
  align-items: center; justify-content: center; gap: 6px; }

/* 题目卡 */
.qcard {
  border-radius: var(--r-lg); padding: 26px 20px 20px;
  background: linear-gradient(170deg, rgba(255,255,255,.075), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  animation: qIn .34s cubic-bezier(.22,1,.36,1);
}
@keyframes qIn { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
.qcard.back-anim { animation: qBack .3s cubic-bezier(.22,1,.36,1); }
@keyframes qBack { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: none; } }
.q-label { font-size: 12px; letter-spacing: 3px; color: var(--cyan); margin-bottom: 8px; }
.q-text { font-size: 19.5px; font-weight: 800; line-height: 1.55; margin-bottom: 20px; }

/* 选项：大按钮 + 字母序号 */
.opt {
  display: flex; align-items: center; gap: 13px; width: 100%;
  min-height: 56px; padding: 12px 15px; margin-bottom: 11px;
  border-radius: var(--r-md); text-align: left;
  background: rgba(255,255,255,.05); border: 1.5px solid var(--line);
  font-size: 15.5px; color: var(--ink-dim); font-weight: 600;
  transition: all .16s;
}
.opt .key {
  flex: none; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-num); font-weight: 800; font-size: 14px;
  background: rgba(255,255,255,.08); color: var(--muted);
  transition: all .16s;
}
.opt:active { transform: scale(.98); }
.opt.sel {
  background: linear-gradient(135deg, rgba(139,92,246,.32), rgba(34,211,238,.16));
  border-color: var(--violet); color: #fff;
  box-shadow: 0 10px 30px -10px rgba(139,92,246,.55);
}
.opt.sel .key { background: var(--violet); color: #fff; box-shadow: 0 0 12px rgba(139,92,246,.8); }
.qnav { display: flex; gap: 12px; margin-top: 18px; }

/* ---- 图形题（engine=iq_raven）：题干配图 + 图片选项 ----
   尺寸约束的由来：一张 3×3 矩阵图 + 6 个选项**必须能同屏看到**，否则用户要在
   看不到题干的情况下盲选。故矩阵图限制在 250px 见方、字母角标改为绝对定位
   （不再额外占一行高度），6 个选项排成 3×2 网格。 */
.q-text.q-text-sm { font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 12px; }
.q-img { display: block; width: 100%; max-width: 250px; margin: 0 auto 12px; border-radius: 14px;
  background: #fff; box-shadow: 0 14px 34px -16px rgba(0,0,0,.55); }
.opts-img { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts-img .opt { position: relative; display: block; padding: 6px; margin-bottom: 0; min-height: 0; }
.opts-img .opt .key {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  width: 20px; height: 20px; font-size: 11px; border-radius: 7px; margin: 0;
}
.opt-img { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; background: #fff; }
.opts-img .opt.sel .opt-img { box-shadow: 0 0 0 2px rgba(139,92,246,.85) inset; }
@media (max-width: 380px) {
  .opts-img { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .q-img { max-width: 220px; }
}

/* ---- 图形推理结果区块（detail.raven） ---- */
.rv-block { margin-top: 22px; padding: 20px 16px 16px; border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(34,211,238,.10), rgba(255,255,255,.03));
  border: 1px solid rgba(34,211,238,.28); text-align: center; }
.rv-kicker { font-size: 12.5px; letter-spacing: 2px; color: var(--cyan); margin-bottom: 12px; }
.rv-hero { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.rv-iq { display: flex; flex-direction: column; align-items: center; }
.rv-iq b { font-family: var(--font-num); font-size: 54px; font-weight: 900; line-height: 1;
  color: var(--cyan); text-shadow: 0 0 26px rgba(34,211,238,.5); }
.rv-iq i { font-style: normal; font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: 1px; }
.rv-ci { font-size: 13px; color: var(--ink-dim); line-height: 1.9; text-align: left; }
.rv-ci b { color: var(--ink); font-family: var(--font-num); }
.rv-band { display: block; margin-top: 6px; padding: 4px 14px; border-radius: 99px; font-weight: 800;
  font-size: 13px; color: #fff; background: linear-gradient(135deg, #22d3ee, #8b5cf6); }
.rv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 18px; }
.rv-stat { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 6px; }
.rv-stat .k { font-size: 11px; color: var(--muted); }
.rv-stat .v { font-size: 15px; font-weight: 800; font-family: var(--font-num); margin-top: 3px; }
@media (max-width: 380px) { .rv-stats { grid-template-columns: 1fr 1fr; } }
.rv-block h4 { margin: 20px 0 6px; font-size: 14px; font-weight: 800; color: var(--cyan); text-align: left; }
.rv-sub { margin: 0 0 10px; font-size: 12px; color: var(--muted); text-align: left; line-height: 1.65; }
.rv-rows { text-align: left; }
.rv-row { margin: 10px 0; }
.rv-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px;
  color: var(--ink-dim); margin-bottom: 5px; }
.rv-bar { height: 9px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.09); }
.rv-bar > i { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #22d3ee, #38bdf8); transition: width .4s; }
.rv-bar.alt > i { background: linear-gradient(90deg, #a78bfa, #8b5cf6); }
.rv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.rv-table th, .rv-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: center;
  color: var(--ink-dim); }
.rv-table th { background: rgba(255,255,255,.05); color: var(--muted); font-weight: 700; }
.rv-table tr.cur td { background: rgba(34,211,238,.18); color: var(--ink); font-weight: 800; }
.rv-note { margin-top: 16px; text-align: left; font-size: 12px; color: var(--muted); line-height: 1.7;
  border-top: 1px dashed var(--line); padding-top: 12px; }
.rv-note summary { cursor: pointer; font-weight: 700; color: var(--ink-dim); margin-bottom: 8px; }
.rv-note p { margin: 6px 0; }
.qnav .btn { flex: 1; }
.qauto-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ============================================================
   9. 结果页
   ============================================================ */
.result-wrap { padding-top: 14px; }
.result-card {
  position: relative; border-radius: 32px; padding: 30px 22px 24px;
  text-align: center; overflow: hidden;
  background:
    radial-gradient(340px 220px at 50% -40px, var(--ac-soft, rgba(139,92,246,.35)), transparent 70%),
    linear-gradient(170deg, rgba(255,255,255,.09), rgba(255,255,255,.028));
  border: 1.5px solid var(--ac-line, rgba(139,92,246,.5));
  box-shadow: 0 30px 80px -30px var(--ac-soft, rgba(139,92,246,.6));
}
.result-card::before { /* 星座连线装饰 */
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 30px 40px, var(--ac, #A78BFA) 45%, transparent 55%),
    radial-gradient(1.6px 1.6px at 90px 90px, var(--ac, #A78BFA) 45%, transparent 55%),
    radial-gradient(1.6px 1.6px at 200px 55px, var(--ac, #A78BFA) 45%, transparent 55%),
    radial-gradient(1.6px 1.6px at 260px 120px, var(--ac, #A78BFA) 45%, transparent 55%),
    linear-gradient(20deg, transparent 49.7%, rgba(167,139,250,.14) 50%, transparent 50.3%);
  background-size: 300px 170px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 62%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 62%);
}
.r-kicker { position: relative; font-size: 12.5px; letter-spacing: 2px; color: var(--ink-dim); }
.r-kicker b { color: var(--ac, var(--violet)); }
.r-mascot { position: relative; width: 74px; height: 74px; margin: 14px auto 4px;
  background: url(/test/static/assets/img/favicon.svg) center/contain no-repeat;
  animation: heroFloat 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 8px 22px var(--ac-soft, rgba(139,92,246,.6))); }
.r-label { position: relative; margin: 2px 0 6px; font-size: 30px; font-weight: 900; letter-spacing: 1px;
  background: linear-gradient(180deg, #fff 20%, var(--ac, var(--violet)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 16px var(--ac-soft, rgba(139,92,246,.5))); }
.r-share-line { position: relative; margin: 0 auto; max-width: 92%;
  font-size: 15px; color: var(--ink-dim); }
.r-traits { position: relative; display: flex; justify-content: center; gap: 7px;
  flex-wrap: wrap; margin-top: 14px; }
.r-traits .chip { background: rgba(255,255,255,.08); }

/* 得分环 */
.score-ring { position: relative; width: 118px; height: 118px; margin: 22px auto 4px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .bgc { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 9; }
.score-ring .fgc { fill: none; stroke-width: 9; stroke-linecap: round;
  stroke: var(--ac, var(--violet));
  filter: drop-shadow(0 0 8px var(--ac-soft, rgba(139,92,246,.7))); }
.score-ring .num { position: absolute; inset: 0; display: grid; place-items: center; }
.score-ring .num b { font-family: var(--font-num); font-size: 32px; font-weight: 800; display: block; line-height: 1.1; }
.score-ring .num i { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 2px; display: block; }

.r-sections { position: relative; text-align: left; margin-top: 22px; }
.r-sec {
  background: rgba(0,0,0,.16); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 15px 16px 13px; margin-bottom: 12px;
}
.r-sec h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 800; color: var(--ac, var(--violet));
  display: flex; align-items: center; gap: 6px; }
.r-sec ul { margin: 0; padding-left: 20px; }
.r-sec li { font-size: 13.8px; color: var(--ink-dim); line-height: 1.7; margin-bottom: 4px; }
.r-sec li::marker { color: var(--ac, var(--violet)); }
.r-sec p { margin: 0; font-size: 13.8px; color: var(--ink-dim); line-height: 1.7; }

/* 分享区 */
.share-box { position: relative; margin-top: 20px; padding: 18px 16px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(253,224,71,.09), rgba(255,107,181,.08));
  border: 1px dashed rgba(253,224,71,.4); }
.share-title { font-size: 15px; font-weight: 800; text-align: center; }
.share-sub { font-size: 12.5px; color: var(--muted); text-align: center; margin: 4px 0 14px; }
.share-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.share-item { display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ink-dim); }
.share-item:active .sh-ic { transform: scale(.88); }
.sh-ic { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center;
  font-size: 21px; transition: transform .16s;
  background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.sh-ic.i-copy { background: rgba(139,92,246,.2); border-color: rgba(139,92,246,.5); }
.sh-ic.i-wx { background: rgba(52,211,153,.16); border-color: rgba(52,211,153,.45); }
.sh-ic.i-qq { background: rgba(96,165,250,.16); border-color: rgba(96,165,250,.45); }
.sh-ic.i-card { background: rgba(253,224,71,.15); border-color: rgba(253,224,71,.45); }
.sh-ic.i-more { background: rgba(255,107,181,.16); border-color: rgba(255,107,181,.45); }

.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }

/* ============================================================
   10. 榜单
   ============================================================ */
.rank-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.rank-tab { padding: 9px 0; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line);
  transition: all .16s; }
.rank-tab.active { color: #17123a; background: linear-gradient(135deg, var(--cyan), #7DE9FA);
  border-color: transparent; box-shadow: 0 8px 22px -8px rgba(34,211,238,.6); }
.rank-list { display: grid; gap: 10px; }
.rank-item { display: flex; align-items: center; gap: 13px; padding: 13px 15px;
  border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line); }
.rank-no { flex: none; width: 34px; text-align: center; font-family: var(--font-num);
  font-size: 17px; font-weight: 900; color: var(--muted); }
.rank-item.top1 .rank-no { color: var(--yellow); text-shadow: 0 0 12px rgba(253,224,71,.7); font-size: 21px; }
.rank-item.top2 .rank-no { color: #D8DEE9; text-shadow: 0 0 10px rgba(216,222,233,.6); font-size: 20px; }
.rank-item.top3 .rank-no { color: var(--orange); text-shadow: 0 0 10px rgba(251,146,60,.6); font-size: 20px; }
.rank-name { flex: 1; font-size: 15px; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-family: var(--font-num); font-size: 15px; font-weight: 800; color: var(--cyan); }
.rank-val small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 3px; }

/* ============================================================
   11. 我的（个人中心）
   ============================================================ */
.me-head {
  position: relative; margin-top: 14px; border-radius: 30px; padding: 22px 20px 20px;
  overflow: hidden; text-align: center;
  background: radial-gradient(300px 170px at 50% -30px, rgba(139,92,246,.35), transparent 70%),
              linear-gradient(170deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(167,139,250,.3);
}
.me-avatar { width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px;
  background: linear-gradient(150deg, rgba(139,92,246,.4), rgba(34,211,238,.2));
  border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 14px 34px -12px rgba(139,92,246,.7); }
.me-name { font-size: 19px; font-weight: 900; }
.me-code { font-size: 12px; color: var(--muted); margin-top: 3px; letter-spacing: 1.5px; }
.me-stats { display: flex; justify-content: space-around; margin-top: 18px;
  padding-top: 14px; border-top: 1px dashed var(--line); }
.me-stats .st { flex: 1; }
.me-stats .st + .st { border-left: 1px solid var(--line); }
.me-stats .n { font-family: var(--font-num); font-size: 20px; font-weight: 800; color: var(--yellow); }
.me-stats .l { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.menu-list { display: grid; gap: 10px; margin-top: 16px; }
.menu-item { display: flex; align-items: center; gap: 13px; padding: 16px 16px;
  border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line);
  transition: transform .15s; font-weight: 700; font-size: 15px; }
.menu-item:active { transform: scale(.98); }
.menu-ic { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid;
  place-items: center; font-size: 20px;
  background: linear-gradient(150deg, var(--ac-soft, rgba(139,92,246,.25)), rgba(255,255,255,.04));
  border: 1px solid var(--ac-line, rgba(139,92,246,.35)); }
.menu-item .arr { margin-left: auto; color: var(--muted); font-size: 17px; }
.menu-item .sub { margin-left: auto; margin-right: 10px; color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* 徽章墙 */
.badge-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 14px; }
.badge-item { text-align: center; padding: 15px 8px 12px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--line); }
.badge-item .bi { font-size: 30px; filter: drop-shadow(0 4px 12px rgba(253,224,71,.4)); }
.badge-item .bn { font-size: 13px; font-weight: 800; margin-top: 7px; }
.badge-item .bd { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* 历史结果 */
.hist { display: grid; gap: 10px; }
.hist-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line);
  transition: transform .15s; }
.hist-item:active { transform: scale(.98); }
.hic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid;
  place-items: center; font-size: 21px;
  background: linear-gradient(150deg, var(--ac-soft, rgba(139,92,246,.25)), rgba(255,255,255,.04)); }
.hbody { flex: 1; min-width: 0; }
.ht { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm { font-size: 12.5px; color: var(--cyan); margin-top: 2px; }
.hdate { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ============================================================
   12. 匹配 & 小队
   ============================================================ */
.duo { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 6px; }
.duo .p { text-align: center; }
.duo .pav { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; margin: 0 auto 6px;
  background: linear-gradient(150deg, var(--ac-soft, rgba(139,92,246,.35)), rgba(255,255,255,.06));
  border: 2px solid var(--ac-line, rgba(167,139,250,.5)); }
.duo .pn { font-size: 13.5px; font-weight: 700; }
.duo .pl { font-size: 11px; color: var(--muted); }
.duo .link { text-align: center; }
.duo .heart { font-size: 26px; animation: heartbeat 1.4s ease-in-out infinite; display: block; }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 12% { transform: scale(1.25); } 24% { transform: scale(1); } }
.duo .score-num { font-family: var(--font-num); font-weight: 900; font-size: 19px;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
  -webkit-background-clip: text; background-clip: text; color: transparent; }

.members { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-top: 16px; }
.member { text-align: center; }
.member .mi { width: 100%; aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center;
  font-size: 23px; background: linear-gradient(150deg, var(--ac-soft, rgba(139,92,246,.3)), rgba(255,255,255,.05));
  border: 1.5px solid var(--ac-line, rgba(139,92,246,.4)); }
.member.done .mi { border-color: rgba(52,211,153,.6); box-shadow: 0 0 14px rgba(52,211,153,.3); }
.member .mn { font-size: 11px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .ms { font-size: 10px; color: var(--muted); }
.member.done .ms { color: var(--green); }

.team-invite { margin-top: 16px; padding: 15px; border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(34,211,238,.1), rgba(139,92,246,.1));
  border: 1px dashed rgba(34,211,238,.4); text-align: center; }
.team-code { font-family: var(--font-num); font-size: 24px; font-weight: 900; letter-spacing: 4px;
  color: var(--cyan); text-shadow: 0 0 16px rgba(34,211,238,.6); }

/* ============================================================
   13. 邀请横幅 / Toast / 遮罩
   ============================================================ */
.invite-banner {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 13px 15px; border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.5;
  background: linear-gradient(135deg, rgba(255,107,181,.16), rgba(253,224,71,.12));
  border: 1px solid rgba(255,107,181,.45);
  animation: slideDown .4s cubic-bezier(.22,1,.36,1);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 26px); z-index: 100;
  transform: translateX(-50%) translateY(16px);
  max-width: 82vw; padding: 11px 20px; border-radius: 999px;
  background: rgba(30,18,70,.96); border: 1px solid rgba(167,139,250,.4);
  box-shadow: 0 16px 44px -10px rgba(0,0,0,.6);
  font-size: 14px; color: var(--ink); text-align: center;
  opacity: 0; visibility: hidden; transition: all .28s cubic-bezier(.22,1,.36,1);
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* 模态（小队命名等） */
.mask { position: fixed; inset: 0; z-index: 90; background: rgba(8,4,24,.72);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: all .25s; }
.mask.show { opacity: 1; visibility: visible; }
.modal { width: 100%; max-width: 360px; border-radius: 26px; padding: 24px 20px;
  background: linear-gradient(170deg, #2A1877, #1B0F45);
  border: 1px solid rgba(167,139,250,.35);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
  transform: scale(.92); transition: transform .25s cubic-bezier(.22,1,.36,1); }
.mask.show .modal { transform: scale(1); }
.modal h3 { margin: 0 0 6px; font-size: 18px; font-weight: 900; text-align: center; }
.modal p { margin: 0 0 16px; font-size: 13px; color: var(--muted); text-align: center; }
.modal input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px;
  background: rgba(0,0,0,.3); border: 1.5px solid var(--line); color: var(--ink);
  font-size: 15px; font-family: inherit; outline: none; }
.modal input:focus { border-color: var(--violet); }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ============================================================
   14. 页脚
   ============================================================ */
.site-footer { max-width: var(--maxw); margin: 0 auto; text-align: center;
  padding: 8px 20px calc(var(--tabbar-h) + 26px); }
.foot-mascot { margin: 0 auto 6px; opacity: .85;
  animation: heroFloat 3.6s ease-in-out infinite alternate; }
.foot-slogan { margin: 0; font-size: 12.5px; color: var(--ink-dim); letter-spacing: 1px; }
.foot-note { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.7; }

/* ============================================================
   15. 响应式与降级
   ============================================================ */
@media (min-width: 720px) {
  body { font-size: 15px; }
  .hero h1 { font-size: 30px; }
  .swipe { grid-auto-columns: 46%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
  .shooting-star { display: none; }
}

/* ============================================================
   16. AI 深度评测报告
   ============================================================ */
#ai-block:empty { display: none; }
.ai-report {
  position: relative; margin: 16px 0 4px; text-align: left;
  border-radius: 26px; padding: 22px 18px 18px; overflow: hidden;
  background:
    radial-gradient(280px 180px at 12% -10%, rgba(34,211,238,.20), transparent 70%),
    radial-gradient(240px 200px at 92% 8%, rgba(255,107,181,.18), transparent 72%),
    linear-gradient(165deg, rgba(167,139,250,.16), rgba(255,255,255,.04));
  border: 1.5px solid rgba(167,139,250,.42);
  box-shadow: 0 24px 60px -28px rgba(124,58,237,.65);
}
.ai-report::before { /* 星点装饰 */
  content: ""; position: absolute; inset: 0; opacity: .55; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 24px 30px, #fff 45%, transparent 55%),
    radial-gradient(1.5px 1.5px at 130px 70px, rgba(34,211,238,.9) 45%, transparent 55%),
    radial-gradient(1.5px 1.5px at 300px 46px, rgba(255,107,181,.9) 45%, transparent 55%);
  background-size: 320px 150px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.ai-kicker { position: relative; font-size: 12px; letter-spacing: 2px; color: var(--cyan); font-weight: 700; }
.ai-headline { position: relative; margin: 8px 0 12px; font-size: 21px; font-weight: 900; line-height: 1.35;
  background: linear-gradient(120deg, #fff 10%, var(--violet) 60%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 14px rgba(124,58,237,.45)); }
.ai-overview { position: relative; margin: 0 0 14px; font-size: 14px; line-height: 1.75; color: var(--ink);
  opacity: .94; }
.ai-scores { position: relative; display: grid; gap: 9px; margin: 4px 0 14px; }
.ai-score { background: rgba(0,0,0,.18); border: 1px solid rgba(167,139,250,.28);
  border-radius: 14px; padding: 10px 12px; }
.ai-score-top { display: flex; align-items: center; gap: 8px; }
.ai-dim { font-size: 13.5px; font-weight: 700; color: var(--ink); flex: 1; }
.ai-stars { font-size: 12px; color: var(--yellow, #FDE047); letter-spacing: 1px; }
.ai-score-num { font-size: 14px; font-weight: 800; color: var(--cyan); font-family: var(--font-num); min-width: 26px; text-align: right; }
.ai-bar { height: 7px; border-radius: 6px; background: rgba(255,255,255,.1); margin: 7px 0 5px; overflow: hidden; }
.ai-bar i { display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 70%, var(--pink)); }
.ai-score-cm { font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; }
.ai-sec { position: relative; margin-top: 14px; }
.ai-sec h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 800; color: var(--violet);
  display: flex; align-items: center; gap: 6px; }
.ai-prose { margin: 0; font-size: 13.8px; line-height: 1.8; color: var(--ink-dim); white-space: pre-line; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ai-chips .chip { background: rgba(167,139,250,.16); border-color: rgba(167,139,250,.42); color: #E9DEFF;
  font-size: 12.8px; padding: 6px 12px; }
.ai-chips.soft .chip { background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.4); color: #BDEEF6; }
.ai-advice { margin: 0; padding-left: 20px; }
.ai-advice li { font-size: 13.8px; line-height: 1.75; color: var(--ink-dim); margin-bottom: 5px; }
.ai-advice li::marker { color: var(--pink); }
.ai-match { margin: 0; font-size: 13.8px; line-height: 1.75; color: var(--ink); opacity: .92; }
.ai-foot { position: relative; margin-top: 16px; font-size: 11.5px; color: var(--muted);
  text-align: center; letter-spacing: .5px; }
.ai-compare { margin-top: 16px; padding: 14px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(34,211,238,.10));
  border: 1px solid rgba(168,85,247,.28); }
.ai-compare h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 800; color: var(--violet); }
.ai-cmp-beat { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.ai-cmp-beat b { font-size: 20px; color: var(--cyan); margin: 0 3px;
  text-shadow: 0 0 14px rgba(34,211,238,.45); }
.ai-cmp-chart { width: 100%; }
.ai-cmp-svg { width: 100%; height: 92px; display: block; }
.ai-bar-nor { fill: rgba(168,85,247,.42); }
.ai-bar-you { fill: var(--cyan); filter: drop-shadow(0 0 6px rgba(34,211,238,.7)); }
.ai-cmp-base { stroke: rgba(255,255,255,.18); stroke-width: 1; }
.ai-cmp-oneliner { margin-top: 10px; font-size: 13.5px; font-weight: 700; line-height: 1.5;
  color: var(--ink); background: rgba(255,255,255,.06); border-radius: 12px; padding: 10px 12px;
  border-left: 3px solid var(--cyan); }
.ai-pending { position: relative; margin: 16px 0 4px; text-align: center; font-size: 13.5px;
  color: var(--cyan); background: rgba(34,211,238,.08); border: 1px dashed rgba(34,211,238,.4);
  border-radius: 16px; padding: 14px; }
.ai-pending.muted { color: var(--ink-dim); border-color: rgba(167,139,250,.3); background: rgba(167,139,250,.06); }
.ai-refresh { margin-left: 8px; padding: 6px 14px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #0C0625; background: linear-gradient(135deg, var(--cyan), var(--violet)); }
.ai-refresh:disabled { opacity: .6; }
