@charset "UTF-8";

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --soft: #f7f9fd;
  --ink: #111d30;
  --muted: #5a6b82;
  --quiet: #8796ab;
  --line: #e4ebf5;
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-soft: #eaf1ff;
  --accent-ring: #93b7ff;
  --ok: #0b875b;
  --ok-soft: #e3f7ee;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --gold: #d97706;
  --shadow: 0 2px 10px rgba(17, 29, 48, .04), 0 10px 26px rgba(17, 29, 48, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.lb-open { overflow: hidden; touch-action: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* 空态 / 失效链接 */
.empty-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
}
.empty-card {
  width: 100%;
  max-width: 390px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}
.empty-icon.warn { background: var(--warn-soft); color: var(--warn); }
.empty-card h1 { font-size: 19px; margin-bottom: 10px; }
.empty-card p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* 主容器（手机满宽，电脑居中精致展示） */
.vote-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 14px calc(108px + env(safe-area-inset-bottom));
}

/* 顶部活动信息卡 */
.poll-hero {
  background: linear-gradient(155deg, #ffffff 0%, #f3f7ff 100%);
  border: 1px solid #dbe6fa;
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.hero-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.pill.live { background: var(--ok-soft); color: var(--ok); }
.pill.ended { background: #edf1f7; color: var(--muted); }
.pill.soft { background: #eef2fa; color: #394b66; font-weight: 500; }

.poll-hero h1 {
  font-size: 21px;
  line-height: 1.32;
  letter-spacing: -.2px;
  color: var(--ink);
  word-break: break-word;
}
.poll-desc {
  margin-top: 9px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.hero-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(205, 220, 246, .65);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12.5px;
  color: var(--muted);
}

/* 状态提示横幅 */
.banner-slot { margin-bottom: 12px; }
.state-banner {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}
.state-banner.ok { background: var(--ok-soft); border-color: #b7ebd4; color: #086342; }
.state-banner.ended { background: #eef1f7; border-color: #dce3ee; color: #44556d; }
.state-banner.err { background: #fdecec; border-color: #f8c5c8; color: #b4232f; }
.banner-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.state-banner.ok .banner-dot { background: var(--ok); }
.state-banner.ended .banner-dot { background: #64748b; }
.state-banner.err .banner-dot { background: #dc2626; }

/* 结果排序工具条 */
.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.result-summary { font-size: 13px; color: var(--muted); font-weight: 500; }
.sort-pills {
  display: inline-flex;
  background: #e9eef7;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}
.sort-pill {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
}
.sort-pill.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 29, 48, .1);
}

/* 产品卡片列表 */
.options-list {
  display: grid;
  gap: 14px;
}
.skeleton-card {
  height: 280px;
  border-radius: 20px;
  background: linear-gradient(90deg, #eef2f9 25%, #f7f9fe 50%, #eef2f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.product-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}
.product-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13), var(--shadow);
}
.product-card.is-mine {
  border-color: var(--ok);
  box-shadow: 0 0 0 2px rgba(11, 135, 91, .12), var(--shadow);
}

/* 多图滑动展示区（按主图比例自适应：竖图3:4 / 方图1:1 / 横图4:3） */
.media-box {
  position: relative;
  background: #eef2f8;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.media-box.is-portrait {
  aspect-ratio: 3 / 4;
}
.media-box.is-square {
  aspect-ratio: 1 / 1;
}
.media-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.media-track::-webkit-scrollbar { display: none; }
.media-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  border: 0;
  padding: 0;
  background: #eef2f8;
  cursor: zoom-in;
  display: block;
}
.media-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.media-count {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .62);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.media-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .56);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.media-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.media-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .48);
  transition: width .16s ease, background .16s ease;
}
.media-dot.active {
  width: 15px;
  background: #ffffff;
}

.media-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: rgba(15, 23, 42, .5);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: none;
  place-items: center;
  cursor: pointer;
}
.media-arrow.prev { left: 10px; }
.media-arrow.next { right: 10px; }
@media (hover: hover) and (pointer: fine) {
  .media-box:hover .media-arrow { display: grid; }
}

.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(17, 29, 48, .78);
  color: #fff;
  pointer-events: none;
}
.rank-badge.top1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rank-badge.top2 { background: linear-gradient(135deg, #64748b, #475569); color: #fff; }
.rank-badge.top3 { background: linear-gradient(135deg, #c2783e, #9a5724); color: #fff; }

/* 卡片正文区 */
.card-body {
  padding: 14px 16px 16px;
}
.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-title-wrap { min-width: 0; flex: 1; }
.card-index {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: 6px;
  margin-bottom: 5px;
}
.card-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.38;
  color: var(--ink);
  word-break: break-word;
}
.card-desc {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 选品按钮 */
.pick-btn {
  margin-top: 13px;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid #cbd9f3;
  background: var(--soft);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.pick-btn:active { transform: scale(.985); }
.pick-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.8px solid #9ab2d9;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: transparent;
  transition: all .15s ease;
}
.pick-btn.single .pick-check { border-radius: 999px; }

.product-card.is-selected .pick-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.product-card.is-selected .pick-check {
  background: #fff;
  border-color: #fff;
  color: var(--accent);
}

/* 投后我的选择标记 */
.mine-tag {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 650;
}

/* 票数与进度条（原生 <progress> 保证严格 CSP 零内联样式） */
.res-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.res-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.res-votes { font-size: 14px; font-weight: 700; color: var(--ink); }
.res-pct { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.res-bar {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eff8;
  display: block;
}
.res-bar::-webkit-progress-bar { background: #e9eff8; border-radius: 999px; }
.res-bar::-webkit-progress-value {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 999px;
  transition: width .3s ease;
}
.res-bar::-moz-progress-bar {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 999px;
}
.product-card.is-mine .res-bar::-webkit-progress-value {
  background: linear-gradient(90deg, #10b981, #0b875b);
}
.product-card.is-mine .res-bar::-moz-progress-bar {
  background: linear-gradient(90deg, #10b981, #0b875b);
}

.vote-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--quiet);
}

/* 底部吸顶提交栏 */
.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(17, 29, 48, .08);
}
.sticky-inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sticky-info { min-width: 0; display: grid; gap: 1px; }
.sticky-info strong { font-size: 14.5px; color: var(--ink); }
.sticky-info small { font-size: 12px; color: var(--muted); }
.submit-btn {
  flex-shrink: 0;
  min-width: 132px;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
  transition: opacity .15s ease, transform .1s ease;
}
.submit-btn:active:not(:disabled) { transform: scale(.98); }
.submit-btn:disabled {
  background: #c7d4ea;
  box-shadow: none;
  cursor: not-allowed;
}

/* 全屏多图灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7, 11, 20, .96);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  flex-shrink: 0;
}
.lb-counter { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .9); }
.lb-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}
.lb-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: 8px 12px;
}
.lb-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
.lb-foot {
  padding: 12px 18px 18px;
  text-align: center;
  display: grid;
  gap: 10px;
  flex-shrink: 0;
}
.lb-foot strong { font-size: 14.5px; font-weight: 550; color: rgba(255, 255, 255, .92); }
.lb-dots { display: flex; justify-content: center; gap: 6px; }
.lb-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .35);
}
.lb-dot.active { width: 18px; background: #fff; }

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 120;
  background: rgba(17, 29, 48, .92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
