/* ============================================================
   FPS 队伍位置鉴定 — 样式（白色主题版）
   参照参考图风格：白底、卡片式、柔和阴影、橙黄强调色
   移动端竖版优先
   注意：#result-card 会被 html2canvas 截图，
   其内部避免使用 flex gap / backdrop-filter / filter / mask 等特性
   ============================================================ */

:root {
  --bg: #f5f6f9;
  --card: #ffffff;
  --card2: #f4f5f8;
  --line: #e9ecf2;
  --line2: #d8dde8;
  --txt: #1a1f2e;
  --muted: #8a91a3;
  --accent: #ff7a1a;
  --accent2: #f5a623;
  --shadow: 0 10px 32px rgba(23, 32, 62, .08);
  --shadow-sm: 0 4px 14px rgba(23, 32, 62, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  background-image:
    radial-gradient(900px 460px at 50% -12%, rgba(255, 122, 26, .07), transparent 62%),
    radial-gradient(680px 400px at 88% 110%, rgba(245, 166, 35, .06), transparent 60%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

/* 背景网格（极淡） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 32, 62, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 62, .022) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 18%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 18%, #000 25%, transparent 78%);
}

/* ---------- 视图切换 ---------- */
.view {
  display: none;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding: 22px 16px 36px;
  min-height: 100dvh;
}
.view.active {
  display: flex;
  flex-direction: column;
  animation: fadeUp .4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 通用组件 ---------- */
.btn-primary {
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff8c2a, #ff5e00);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 16px 0;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(255, 94, 0, .28);
  transition: transform .12s ease, box-shadow .12s ease, opacity .2s;
}
.btn-primary:active { transform: scale(.965); box-shadow: 0 4px 12px rgba(255, 94, 0, .24); }
.btn-primary:disabled { opacity: .55; cursor: default; }

.btn-ghost {
  display: block;
  width: 100%;
  border: 1px solid var(--line2);
  cursor: pointer;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 2px;
  padding: 12px 0;
  border-radius: 14px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
  transition: color .15s, border-color .15s;
}
.btn-ghost:active { color: var(--txt); border-color: var(--txt); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%) translateY(16px);
  background: #ffffff;
  border: 1px solid var(--line2);
  color: var(--txt);
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 60;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
  max-width: 86vw;
  text-align: center;
  box-shadow: 0 12px 32px rgba(23, 32, 62, .18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 开始页 ---------- */
.start-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 34px;
}

.logo-row {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 20px;
  box-shadow: var(--shadow-sm);
}
.logo-mark { font-size: 17px; margin-right: 8px; }
.logo-text {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
}

.main-title {
  margin-top: 34px;
  font-size: 33px;
  font-weight: 900;
  line-height: 1.42;
  letter-spacing: 1px;
}
.main-title .hl {
  color: var(--accent);
}

.sub-title {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 26px 0 6px;
}
.chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 15px;
  margin: 0 6px 10px;
  font-size: 13px;
  color: var(--txt);
  box-shadow: var(--shadow-sm);
}

.start-card .btn-primary { margin-top: 18px; }

.foot-note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.foot-note .num { color: var(--accent); font-weight: 700; }

/* ---------- 答题页 ---------- */
.quiz-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 20px;
  padding: 20px 18px 24px;
  box-shadow: var(--shadow);
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.quiz-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
}
.quiz-count { font-size: 13px; color: var(--muted); }
.quiz-count b { color: var(--txt); font-size: 17px; }

.progress {
  height: 6px;
  background: #edeff4;
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .35s ease;
}

.q-title {
  margin-top: 26px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.55;
  min-height: 66px;
}

.options { margin-top: 20px; }

.opt {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--card2);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  color: var(--txt);
  font-size: 15px;
  line-height: 1.5;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.opt:active { transform: scale(.985); }
.opt .let {
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.opt.sel {
  border-color: var(--accent);
  background: #fff4e8;
}
.opt.sel .let { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 结果页 ---------- */
.result-head {
  text-align: center;
  margin-bottom: 14px;
}
.result-head-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--muted);
}

/* ↓ 该卡片会被 html2canvas 截图：内部只用 margin 做间距，不用 flex gap */
.result-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 22px;
  position: relative;
  box-shadow: var(--shadow);
}

.badge-hidden {
  display: none;
  position: absolute;
  top: 26px;
  right: -10px;
  background: linear-gradient(135deg, #ffe9a3, #f7b733);
  color: #5c3d00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 5px 12px;
  border-radius: 8px;
  transform: rotate(9deg);
  box-shadow: 0 6px 16px rgba(247, 183, 51, .35);
}
.badge-hidden.show { display: block; }

.meme-wrap { margin-bottom: 18px; }
.meme-wrap img {
  width: 100%;
  height: 248px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.result-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.result-slogan {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.result-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

/* 五维条形图 */
.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 13px;
}
.bar-label {
  flex: none;
  width: 44px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 2px;
}
.bar-track {
  flex: 1;
  height: 10px;
  background: #edeff4;
  border-radius: 99px;
  overflow: hidden;
  margin: 0 10px;
}
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .9s cubic-bezier(.22, 1, .36, 1);
}
.bar-val {
  flex: none;
  width: 36px;
  text-align: right;
  font-size: 13px;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}

.site-foot {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 18px;
}

.result-actions { margin-top: 22px; }

/* ---------- 分享图弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(23, 28, 48, .5);
  padding: 24px;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-box { width: 100%; max-width: 360px; }
.modal-box img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: block;
  box-shadow: 0 16px 48px rgba(23, 32, 62, .3);
}
.modal-hint {
  text-align: center;
  color: #fff;
  font-size: 13px;
  margin-top: 14px;
  letter-spacing: 1px;
}

/* ---------- 调试面板 ---------- */
#debug-panel {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 70;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--txt);
  max-width: 300px;
  max-height: 60vh;
  overflow: auto;
  box-shadow: 0 10px 28px rgba(23, 32, 62, .2);
}
#debug-panel h4 { font-size: 13px; letter-spacing: 2px; color: var(--accent); margin-bottom: 6px; }
#debug-panel table { border-collapse: collapse; }
#debug-panel td { padding: 2px 10px 2px 0; }
#debug-panel .rate { color: var(--accent); font-weight: 700; }
#debug-panel button {
  margin: 8px 6px 0 0;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--txt);
  cursor: pointer;
}
