:root {
  color-scheme: light;
  --ink: #25272c;
  --red: #f04452;
  --blue: #128be9;
  --yellow: #ffd447;
}
* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
  background:
    radial-gradient(ellipse at 12% 12%, rgba(237, 215, 247, .68), transparent 52%),
    radial-gradient(ellipse at 88% 24%, rgba(200, 231, 251, .72), transparent 55%),
    radial-gradient(ellipse at 70% 94%, rgba(251, 239, 203, .5), transparent 48%),
    #eff3f8;
  background-repeat: no-repeat;
}
/* The reference screenshot contains UI: never use it as a background. */
body::before,
body::after {
  content: none;
}
button { font: inherit; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, input { touch-action: manipulation; }
.page-shell { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.vote-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 790px);
  padding: clamp(26px,5vw,48px) clamp(22px,6vw,65px) 30px;
  border: 2px solid transparent;
  border-radius: 28px;
  background:
    linear-gradient(135deg, #fff7fc 0%, #ffffff 38%, #f5fbff 75%, #fffcf2 100%) padding-box,
    linear-gradient(120deg, #ff91b2 0%, #c2a4ff 28%, #79ceff 56%, #8be3e5 78%, #ffe391 100%) border-box;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow:
    0 28px 65px -20px rgba(34, 49, 82, .28),
    -16px -10px 45px -24px rgba(235, 103, 161, .45),
    18px 14px 48px -24px rgba(64, 171, 243, .42),
    inset 0 1px 0 rgba(255, 255, 255, .96);
}
.vote-card::before {
  position: absolute;
  inset: 7px;
  content: "";
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 21px;
  pointer-events: none;
}
.vote-card::after {
  position: absolute;
  top: -2px;
  left: 24%;
  width: 52%;
  height: 3px;
  content: "";
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #e9dbff 28%, #ffffff 50%, #bce9ff 72%, transparent);
  box-shadow: 0 0 14px rgba(115, 177, 255, .55);
  pointer-events: none;
}
.result-panel { margin: 0; opacity: 1; overflow: visible; }
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #737b84;
  font-size: 14px;
}
.result-bars { display: grid; gap: 18px; margin-top: 22px; }
.result-row {
  display: grid;
  grid-template-columns: 128px minmax(0,1fr) 48px;
  align-items: center;
  gap: 18px;
}
.choice {
  --step: 4px;
  --step-2: calc(var(--step) * 2);
  --edge: 2px;
  --pixel-outline: polygon(var(--step-2) 0,calc(100% - var(--step-2)) 0,calc(100% - var(--step-2)) var(--step),calc(100% - var(--step)) var(--step),calc(100% - var(--step)) var(--step-2),100% var(--step-2),100% calc(100% - var(--step-2)),calc(100% - var(--step)) calc(100% - var(--step-2)),calc(100% - var(--step)) calc(100% - var(--step)),calc(100% - var(--step-2)) calc(100% - var(--step)),calc(100% - var(--step-2)) 100%,var(--step-2) 100%,var(--step-2) calc(100% - var(--step)),var(--step) calc(100% - var(--step)),var(--step) calc(100% - var(--step-2)),0 calc(100% - var(--step-2)),0 var(--step-2),var(--step) var(--step-2),var(--step) var(--step),var(--step-2) var(--step));
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 10px;
  cursor: pointer;
  color: #fff;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}
.choice::before,
.choice::after {
  position: absolute;
  content: "";
  pointer-events: none;
  clip-path: var(--pixel-outline);
}
.choice::before { inset: 0; background: var(--button-edge); }
.choice::after { inset: var(--edge); background: var(--button-fill); }
.choice-label { position: relative; z-index: 1; }
.choice-left { --button-fill: var(--red); --button-edge: #b82d3a; --button-rgb: 240,68,82; }
.choice-right { --button-fill: var(--blue); --button-edge: #0864aa; --button-rgb: 18,139,233; }
.choice-others { --button-fill: var(--yellow); --button-edge: #b48b0e; --button-rgb: 255,212,71; color: #433600; }
.choice:active:not(:disabled) { transform: scale(.97); }
.choice:focus-visible { outline: 3px solid #455f75; outline-offset: 4px; }
.choice.selected { filter: drop-shadow(0 0 3px rgba(var(--button-rgb),.65)); }
.selection-mark {
  position: absolute;
  right: -6px;
  top: -7px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #2d4f70;
  color: #fff;
  font: 700 12px/1 sans-serif;
  opacity: 0;
  pointer-events: none;
}
.choice.selected .selection-mark { opacity: 1; }
.choice.selection-bounce { animation: selection-bounce 480ms ease-out; }
@keyframes selection-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(.92); }
  65% { transform: scale(1.045); }
  100% { transform: scale(1); }
}
.choice:disabled { cursor: default; }
.bar-track { height: 10px; overflow: hidden; border-radius: 99px; background: #eceeed; }
.bar-fill { display: block; width: 0; height: 100%; border-radius: inherit; transition: width 400ms ease; }
.fill-left { background: var(--red); }
.fill-right { background: var(--blue); }
.fill-others { background: var(--yellow); }
.result-row strong { color: #59616b; font-size: 16px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.helper-text { margin: 24px 0 0; color: #737b84; font-size: 14px; line-height: 1.6; text-align: center; }
.reset-button {
  display: flex;
  gap: 5px;
  align-items: center;
  margin: 22px auto 0;
  padding: 5px 8px;
  cursor: pointer;
  color: #737b84;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 12px;
  visibility: hidden;
}
.reset-button.visible { visibility: visible; }
.reset-button:hover { color: #5e646a; }
.reset-button span { font-size: 16px; }
.admin-area { margin-top: 20px; text-align: center; }
.admin-login, .admin-session { display: flex; justify-content: center; gap: 7px; align-items: center; }
[hidden] { display: none !important; }
.admin-login input {
  width: 112px;
  min-width: 0;
  padding: 7px 8px;
  color: var(--ink);
  border: 1px solid #dfe1df;
  border-radius: 4px;
  background: rgba(255,255,255,.8);
  font-size: 12px;
}
.admin-login input:focus-visible, .admin-login button:focus-visible, .admin-session button:focus-visible, .reset-button:focus-visible { outline: 3px solid rgba(18,139,233,.4); outline-offset: 2px; }
.admin-login button, .admin-session button { padding: 7px 10px; cursor: pointer; color: #6f7479; border: 1px solid #dfe1df; border-radius: 4px; background: #f8f8f6; font-size: 12px; }
.admin-login button:hover, .admin-session button:hover { color: var(--ink); background: #eef2f2; }
.admin-session { color: #73787d; font-size: 12px; }
.admin-message { min-height: 17px; margin: 8px 0 0; color: #737b84; font-size: 12px; }
.admin-message.error { color: #d44d58; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* Large presentation screens and touch panels: scale up, keep everything on one screen. */
@media (min-width: 1024px) {
  /* Grow with both viewport dimensions; keep portrait and short screens safe. */
  :root {
    --screen-font: clamp(24px, min(calc(1vw + 2.8vh), 5vh, 4.5vw), 144px);
    --screen-small-font: calc(var(--screen-font) * .65);
  }
  .page-shell { min-height: 100dvh; padding: clamp(18px, 2.6vh, 52px); }
  .vote-card {
    width: min(100%, 2400px);
    padding: clamp(30px, 4.4vh, 96px) clamp(34px, 3.6vw, 120px) clamp(26px, 3.6vh, 76px);
    border-radius: clamp(24px, 2.6vh, 48px);
    box-shadow:
      0 34px 90px -26px rgba(34, 49, 82, .28),
      -18px -12px 60px -28px rgba(235, 103, 161, .45),
      20px 16px 62px -28px rgba(64, 171, 243, .42),
      inset 0 1px 0 rgba(255, 255, 255, .96);
  }
  .vote-card::before { inset: clamp(8px, 1.1vh, 18px); border-radius: clamp(18px, 2vh, 36px); }
  .vote-card::after { height: clamp(3px, .5vh, 8px); }
  .result-heading { font-size: var(--screen-small-font); }
  .result-bars { gap: clamp(16px, 2.5vh, 52px); margin-top: clamp(18px, 2.8vh, 58px); }
  .result-row {
    /* One width for every option so buttons and progress bars line up in strict columns. */
    grid-template-columns: min(clamp(150px, calc(var(--screen-font) * 6.2), 900px), 34%) minmax(0, 1fr) max-content;
    gap: clamp(18px, 1.8vw, 52px);
  }
  .choice-label { white-space: nowrap; }
  .choice {
    --step: clamp(5px, .85vh, 15px);
    --edge: clamp(2px, .34vh, 6px);
    min-height: max(clamp(64px, 9.2vh, 300px), calc(var(--screen-font) * 2));
    padding: clamp(12px, 1.8vh, 34px) clamp(12px, 1.2vw, 34px);
    font-size: var(--screen-font);
  }
  .selection-mark {
    right: clamp(-8px, -.6vw, -14px);
    top: clamp(-9px, -.7vh, -16px);
    width: max(20px, calc(var(--screen-font) * .72));
    height: max(20px, calc(var(--screen-font) * .72));
    border-radius: clamp(5px, .6vh, 12px);
    font-size: calc(var(--screen-font) * .5);
  }
  .bar-track { height: clamp(12px, 1.6vh, 32px); }
  .result-row strong { font-size: var(--screen-font); }
  .helper-text { margin-top: clamp(18px, 2.6vh, 50px); font-size: var(--screen-small-font); }
  .reset-button { font-size: calc(var(--screen-font) * .55); padding: clamp(6px, .9vh, 16px) clamp(8px, .9vw, 20px); }
  .reset-button span { font-size: clamp(17px, 2vh, 34px); }
  .admin-login input { width: clamp(130px, 11vw, 260px); padding: clamp(8px, 1.1vh, 20px); font-size: calc(var(--screen-font) * .5); }
  .admin-login button, .admin-session button { padding: clamp(8px, 1.1vh, 20px) clamp(12px, 1.1vw, 28px); font-size: calc(var(--screen-font) * .5); }
  .admin-session, .admin-message { font-size: calc(var(--screen-font) * .5); }
}
/* Touch panels: suppress sticky hover and confirm taps with a press state instead. */
@media (hover: none), (pointer: coarse) {
  .choice:hover:not(:disabled) { transform: none; filter: none; }
  .choice:active:not(:disabled) { transform: scale(.96); filter: brightness(1.06); }
}
@media (max-width:620px) {
  .page-shell { padding: 14px; }
  .vote-card { padding: 26px 18px 24px; border-radius: 22px; }
  .vote-card::before { border-radius: 15px; }
  .result-row { grid-template-columns: 100px minmax(0,1fr) 42px; gap: 12px; }
  .choice { min-height: 46px; padding: 11px 8px; font-size: 14px; }
  .result-row strong { font-size: 14px; }
  .result-heading { font-size: 12px; }
  .helper-text { font-size: 13px; }
  .admin-login { flex-wrap: wrap; }
}
@media (max-width:360px) {
  .result-row { grid-template-columns: 88px minmax(0,1fr) 38px; gap: 9px; }
  .choice { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
