/* ===== 极巨化三角初华娃娃意向投票 · 亮色系 · 移动端优先 ===== */
:root {
  --page: #f5f6fa;
  --card: #ffffff;
  --ink: #23283a;
  --ink-2: #5b6478;
  --ink-3: #8b93a6;
  --line: #e8eaf1;
  --pink: #ff7fae;
  --pink-soft: #fff1f6;
  --violet: #7c5cff;
  --gold: #f5a623;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #e11d48;
  --shadow: 0 2px 10px rgba(35, 40, 58, .05), 0 10px 30px rgba(35, 40, 58, .06);
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; } /* 防止被下面的 display 规则覆盖 */

/* 顶部装饰条 */
.bg { position: fixed; inset: 0 0 auto 0; height: 220px; z-index: -1; overflow: hidden;
  background: linear-gradient(135deg, #ffeaf2 0%, #f2ecff 55%, #eaf7ff 100%); }
.bg i { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; }
.bg i:nth-child(1) { width: 260px; height: 260px; left: -60px; top: -90px; background: #ffcfe2; }
.bg i:nth-child(2) { width: 240px; height: 240px; right: -50px; top: -60px; background: #d5c8ff; }
.bg i:nth-child(3) { width: 200px; height: 200px; left: 40%; top: -110px; background: #cfeaff; }

.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); }

/* ===== 群聊宣传冻结栏（吸顶） ===== */
.groupbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 10px rgba(35, 40, 58, .04);
}
.groupbar-inner {
  max-width: 560px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 10px;
}
.gb-avatar {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%;
  object-fit: cover; background: #f1f2f6; border: 1px solid var(--line); display: block;
}
.gb-info { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; }
.gb-name {
  font-size: 14px; font-weight: 700; letter-spacing: -.1px; color: var(--ink);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gb-tag {
  flex: 0 0 auto; font-style: normal; font-size: 10px; line-height: 1; padding: 3px 6px;
  border-radius: 999px; color: #b3386a; background: var(--pink-soft); border: 1px solid #ffe0ec;
}
.gb-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px;
  min-height: 34px; padding: 0 13px; font-family: inherit;
  font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap;
  border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 4px 12px rgba(124, 92, 255, .28);
  transition: transform .12s, box-shadow .18s;
}
.gb-btn:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(124, 92, 255, .22); }
.gb-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.gb-plus { font-size: 15px; line-height: 1; }

/* 群内宣传语横幅：贴在群身份行下方（不占刘海安全区，且吸顶时常驻可见） */
.gb-promo {
  margin: 0; padding: 5px 16px;
  text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .2px;
  color: #fff; text-shadow: 0 1px 2px rgba(120, 30, 80, .18);
  background: linear-gradient(90deg, var(--pink) 0%, #b07bff 55%, var(--violet) 100%);
}

/* ===== 群二维码弹层 ===== */
.qr-sheet { position: relative; padding: 24px 20px 20px; max-height: 88vh; overflow-y: auto; }
.qr-sheet h3 { margin: 0 0 4px; padding: 0 26px; font-size: 17px; }
.qm-tip { margin: 0 0 14px !important; font-size: 12px !important; color: var(--ink-3) !important; }
.qm-close {
  position: absolute; right: 8px; top: 8px; width: 32px; height: 32px;
  display: grid; place-items: center; font-family: inherit;
  font-size: 19px; line-height: 1; color: var(--ink-3);
  background: #f1f2f6; border: 0; border-radius: 50%; cursor: pointer;
}
.qm-close:active { background: #e6e8f0; }
.qm-qr {
  display: block; width: 100%; max-width: 250px; margin: 0 auto; padding: 6px;
  aspect-ratio: 1 / 1; background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.qm-no {
  margin-top: 16px; padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 10px;
  text-align: left; background: #fbfaff; border: 1.5px dashed #e2d8ff; border-radius: 12px;
}
.qm-no-label { flex: 0 0 auto; font-size: 12px; color: var(--ink-3); }
.qm-no b {
  flex: 1 1 auto; font-size: 18px; letter-spacing: 1.5px; color: var(--violet);
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.qm-copy {
  flex: 0 0 auto; min-height: 34px; padding: 0 16px; font-family: inherit;
  font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap;
  border: 0; border-radius: 999px; cursor: pointer; transition: background .18s;
  background: linear-gradient(135deg, var(--pink), var(--violet));
}
.qm-copy:active { transform: translateY(1px); }
.qm-copy.done { background: linear-gradient(135deg, #34d399, var(--ok)); }

@media (max-width: 359px) {
  .gb-tag { display: none; }                 /* 极窄屏（≤359px）先让出标签，保证按钮不被挤出去 */
  .gb-name { font-size: 13px; }
  .gb-btn { padding: 0 10px; font-size: 12px; }
  .qm-no b { font-size: 16px; letter-spacing: 1px; }
}

/* ===== 头部 ===== */
.hero { text-align: center; padding-top: 4px; }
.tag {
  display: inline-block; font-size: 12px; letter-spacing: .3px; padding: 5px 12px;
  border-radius: 999px; color: #b3386a; font-weight: 600;
  background: #fff; border: 1px solid #ffd9e7; box-shadow: var(--shadow);
}
.hero h1 { font-size: 21px; line-height: 1.35; margin: 14px 0 6px; font-weight: 700; letter-spacing: -.2px; }
.sub { margin: 0; font-size: 13px; color: var(--ink-2); }
.livebar {
  margin: 14px auto 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--ink-2); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.livebar b { color: var(--violet); }
.livebar em { font-style: normal; margin-left: 4px; color: var(--ink-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.notice {
  margin: 16px 0 0; padding: 10px 12px; font-size: 12px; color: #8a5a12;
  background: #fff8e8; border: 1px solid #ffe4b3; border-radius: 12px;
}

/* ===== 倒计时 ===== */
.countdown {
  margin: 14px auto 0; max-width: 440px; padding: 12px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cd-label { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.cd-ico { margin-right: 4px; }
.cd-units { display: flex; align-items: baseline; justify-content: center; gap: 5px; }
.cd-units .u { display: flex; align-items: baseline; gap: 2px; }
.cd-units b {
  min-width: 42px; padding: 6px 4px; text-align: center; font-size: 21px; font-weight: 700;
  color: #b3386a; border-radius: 10px; font-variant-numeric: tabular-nums; background: var(--pink-soft);
}
.cd-units i { font-style: normal; font-size: 11px; color: var(--ink-3); }
.cd-units .sep { color: #cfd3de; font-size: 16px; }
.cd-deadline { margin-top: 8px; font-size: 11px; color: var(--ink-3); text-align: center; }
.countdown.urgent { border-color: #ffd0d8; }
.countdown.urgent .cd-units b { color: var(--err); background: #fff0f2; }
.countdown.done .cd-units b { color: var(--ink-2); background: #f1f2f6; }

/* ===== 分步标题 ===== */
.step { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 24px 0 12px; font-weight: 700; }
.step i {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; font-style: normal;
  display: grid; place-items: center; font-size: 12px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--violet));
}
.step small { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: auto; }

/* ===== 选项卡片 ===== */
.choices { display: grid; gap: 12px; }
.opt {
  position: relative; display: block; cursor: pointer; background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s, transform .1s;
}
.opt:hover { border-color: #ffc2d8; }
.opt:active { transform: scale(.995); }
.opt.sel { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 127, 174, .18), var(--shadow); }
.opt .thumb { position: relative; width: 100%; aspect-ratio: 4 / 3; display: block;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #f6f7fb 68%, #eef0f6 100%); }
.opt .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 8px 12px; }
.ph { /* 图片未放置时的占位 */
  position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; justify-items: center;
  text-align: center; padding: 12px; margin: 8px; border: 1.5px dashed #d7dbe6; border-radius: 12px; color: var(--ink-3);
}
.ph span { font-size: 13px; color: var(--ink-2); }
.ph code { font-size: 11px; color: var(--violet); word-break: break-all; }
.opt .meta { display: flex; align-items: center; gap: 8px; padding: 11px 12px; }
.opt .no {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: #f1f2f6; color: var(--ink-2);
}
.opt.sel .no { background: var(--pink); color: #fff; }
.opt .name { font-size: 16px; font-weight: 600; }
.opt .hint { font-size: 11px; color: var(--ink-3); margin-left: auto; text-align: right; }
.check {
  position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  opacity: 0; transform: scale(.6); transition: .18s ease; box-shadow: 0 2px 8px rgba(255, 127, 174, .5);
}
.opt.sel .check { opacity: 1; transform: scale(1); }
.opt.wide { background: linear-gradient(135deg, #fff5f9, #f4f1ff); }
.opt.wide .meta { padding: 20px 14px; }
.hidden-radio { position: absolute; opacity: 0; width: 0; height: 0; }

/* ===== QQ 输入：头像内嵌在输入框左侧，失焦后自动替换为真实头像 ===== */
.field { position: relative; }
.field input {
  width: 100%; padding: 15px 42px 15px 14px; font-size: 17px; letter-spacing: .5px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; outline: none; transition: .18s;
}
.field input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .12); }
.field input::placeholder { color: #b9bfcc; letter-spacing: 0; }
.qqfield input { padding-left: 64px; }
.qqav {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  background: #f1f2f6; border: 1px solid var(--line); transition: box-shadow .2s, opacity .2s;
}
.qqav.checking { opacity: .55; box-shadow: 0 0 0 3px rgba(124, 92, 255, .14); }
.qqav.real { border-color: #c9efd7; box-shadow: 0 0 0 3px rgba(22, 163, 74, .1); }
.qqav.missing { border-color: #fbcfd8; box-shadow: 0 0 0 3px rgba(225, 29, 72, .1); }
.clean {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px;
  border-radius: 50%; display: none; place-items: center; background: #eef0f5; color: var(--ink-2);
  font-size: 15px; cursor: pointer; line-height: 1;
}
.clean.show { display: grid; }
.tip { font-size: 12px; color: var(--ink-3); margin: 8px 2px 0; line-height: 1.7; }
.qqnote { margin: 8px 2px 0; font-size: 13px; color: var(--err); }
.qqnote.dim { color: var(--ink-3); }
.spinner { width: 14px; height: 14px; border: 2px solid #e6e8f0; border-top-color: var(--violet);
  border-radius: 50%; display: inline-block; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 按钮 ===== */
.btn {
  width: 100%; margin-top: 18px; padding: 16px; font-size: 17px; font-weight: 700; color: #fff;
  border: 0; border-radius: 14px; cursor: pointer; background: linear-gradient(90deg, var(--pink), var(--violet));
  box-shadow: 0 8px 20px rgba(124, 92, 255, .25); transition: .18s;
}
.btn:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.loading { pointer-events: none; opacity: .8; }

.msg { font-size: 13px; margin: 12px 2px 0; min-height: 18px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }
.myvote {
  font-size: 12px; color: var(--ink-2); margin: 8px 2px 0; padding: 8px 10px; border-radius: 10px;
  background: var(--pink-soft); border: 1px solid #ffe0ec;
}
.myvote b { color: #b3386a; }

/* ===== 结果 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.results { margin-top: 8px; }
.results .step { margin-top: 0; }
.sumline { font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.sumline b { font-size: 16px; color: var(--violet); }
.bars { display: grid; gap: 10px; }
.bar-row { font-size: 13px; }
.bar-top { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--ink-2); }
.bar-top b { color: var(--ink); }
.track { height: 8px; border-radius: 999px; background: #eef0f5; overflow: hidden; }
.fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .5s ease;
  background: linear-gradient(90deg, var(--pink), var(--violet)); }
.bar-row.lead .fill { background: linear-gradient(90deg, var(--gold), var(--pink)); }
.linkbtn { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--ink-3);
  font-size: 12px; text-decoration: underline; cursor: pointer; }

.foot { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 26px; }

/* ===== 遮罩 / Toast ===== */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(28, 24, 46, .45); backdrop-filter: blur(4px); }
.sheet { max-width: 380px; width: 100%; text-align: center; padding: 26px 20px; background: #fff;
  border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.sheet h3 { margin: 0 0 10px; font-size: 18px; }
.sheet p { margin: 0 0 14px; font-size: 13px; color: var(--ink-2); line-height: 1.75; }
.sheet b { color: var(--pink); }
.count { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.ended-sum { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; line-height: 1.9; }
.ended-sum b { color: var(--violet); }
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; max-width: 86vw; padding: 10px 16px; border-radius: 999px; font-size: 13px;
  background: rgba(35, 40, 58, .92); color: #fff;
}
body.no-scroll { overflow: hidden; }        /* 群二维码弹层打开时锁住背景滚动 */
.qr-sheet { overscroll-behavior: contain; }
.qm-no b { user-select: all; -webkit-user-select: all; }  /* 兜底：长按可整段选中群号 */

/* ===== 手机横屏 / 平板 / 桌面 ===== */
@media (min-width: 520px) {
  .hero h1 { font-size: 25px; }
  .choices { grid-template-columns: 1fr 1fr; }
  .opt.wide { grid-column: 1 / -1; }
  /* 三张图 + 一条「都行」共 4 个选项：第 3 张图单独占一行，
     居中放才不会在右上角留一个空洞（max-width 扣掉列间距的一半） */
  .opt:nth-child(3):not(.wide) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 6px);
  }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
