/* ==========================================================================
   随机点名 · 样式表
   风格：浅蓝 + 白色，简洁教育风；移动优先，桌面端自动居中放大
   ========================================================================== */

:root {
  /* 主题色 */
  --blue-50: #f4faff;
  --blue-100: #eaf4ff;
  --blue-200: #d6e8ff;
  --blue-300: #a9cdfa;
  --blue-500: #2f7cf6;
  --blue-600: #1f66d6;
  --ink: #17416f;
  --ink-2: #4a6b8f;
  --ink-3: #86a3c2;

  /* 结果高亮色（绿色，突出中奖） */
  --green: #0f8b52;
  --green-line: rgba(62, 207, 142, 0.5);
  --green-bg-1: #e9fbf2;
  --green-bg-2: #d8f6e8;

  /* 危险色（停止、清空） */
  --red: #f2643c;
  --red-500: #e64545;
  --red-bg: #fff1f1;

  --card: #ffffff;
  --shadow: 0 16px 40px rgba(53, 122, 214, 0.14);
  --shadow-soft: 0 8px 22px rgba(53, 122, 214, 0.1);

  /* 展示窗口高度：跟随视口高度自动放大，全屏时再放大一档 */
  --screen-h: clamp(260px, 42vh, 420px);
  /* 展示区主字号（滚动名字 / 中奖名字），用 vmin 让大屏自动变大 */
  --display-font: clamp(48px, 11vmin, 120px);
  /* 点名墙每格最小宽度 */
  --cell-min: 108px;
  /* 滚动模式：每一行名字的高度 */
  --roll-row-h: 96px;
  --radius-lg: 26px;
  --radius-md: 16px;
}

/* 进入浏览器全屏后，展示区与字号再放大一档 */
body.is-fullscreen {
  --screen-h: 50vh;
  --screen-h: 50dvh;
  --display-font: clamp(90px, 20vmin, 320px);
  --cell-min: 150px;
}

/* 全屏时隐藏非必要的辅助元素，保证一屏放得下、不用滚动 */
body.is-fullscreen .switch-row,
body.is-fullscreen .foot,
body.is-fullscreen .brand-sub {
  display: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #eaf4ff 0%, #f7fbff 45%, #eef6ff 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ==================== 布局 ==================== */
.app {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

body.is-fullscreen .app {
  max-width: min(1800px, 96vw);
  padding-top: 2vh;
}

/* ==================== 顶部标题栏 ==================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 0;
  gap: 12px;
}

.brand-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.brand-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-btn {
  border: 1px solid #cfe3ff;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-500);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.icon-btn:hover {
  background: #eef5ff;
}

.pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(47, 124, 246, 0.12);
  color: var(--blue-500);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--blue-500);
}

/* ==================== 抽取主卡片 ==================== */
.stage {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  padding: 18px 18px 22px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* 右上角柔光装饰，让卡片不那么平 */
.stage::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(87, 166, 255, 0.22), rgba(87, 166, 255, 0) 70%);
  pointer-events: none;
}

.stage::after {
  content: "";
  position: absolute;
  left: -80px;
  bottom: -120px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 207, 142, 0.18), rgba(62, 207, 142, 0) 70%);
  pointer-events: none;
}

.stage > * {
  position: relative;
  z-index: 1;
}

.tip {
  margin: 0 0 14px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
}

/* 展示窗口 */
.screen {
  position: relative;
  height: var(--screen-h);
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, var(--blue-50) 0%, #e4f0ff 100%);
  /* 用内阴影画描边，保证内容高度刚好等于 --screen-h，滚动不露半行 */
  box-shadow: inset 0 0 0 2px #d9e9ff, 0 10px 30px rgba(53, 122, 214, 0.1);
  overflow: hidden;
}

/* 揭晓瞬间的整块高光 */
.screen.hit-flash {
  animation: hit-flash 0.85s ease-out both;
}

@keyframes hit-flash {
  0% {
    box-shadow: inset 0 0 0 2px #d9e9ff, 0 0 0 0 rgba(62, 207, 142, 0.55), 0 10px 30px rgba(53, 122, 214, 0.1);
  }
  45% {
    box-shadow: inset 0 0 0 2px #9fe6c4, 0 0 0 22px rgba(62, 207, 142, 0), 0 10px 30px rgba(53, 122, 214, 0.1);
  }
  100% {
    box-shadow: inset 0 0 0 2px #d9e9ff, 0 0 0 30px rgba(62, 207, 142, 0), 0 10px 30px rgba(53, 122, 214, 0.1);
  }
}

/* 这些元素用 hidden 属性切换显示，必须显式覆盖掉各自的 display，
   否则 .winner 的 display:flex 会盖住浏览器的 [hidden] 规则 */
.screen[hidden],
.slot[hidden],
.winner[hidden] {
  display: none;
}

/* ==================== 滚动抽奖动画 ==================== */

/* 滚动模式：多层名字 + 极光光圈 */
.roll-screen {
  background:
    radial-gradient(120% 90% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #eef6ff 0%, #dcebff 55%, #e8f2ff 100%);
}

/* 装饰层：两个发光椭圆环 + 若干粒子 */
.aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 86%;
  height: 106%;
  transform: translate(-50%, -50%) rotate(-4deg);
  border-radius: 50%;
  border: 1.5px solid rgba(160, 216, 255, 0.85);
  box-shadow:
    0 0 46px rgba(120, 200, 255, 0.5),
    inset 0 0 46px rgba(180, 225, 255, 0.45);
  opacity: 0.75;
}

.aurora-ring-2 {
  width: 66%;
  height: 82%;
  transform: translate(-50%, -50%) rotate(5deg);
  border-color: rgba(214, 238, 255, 0.75);
  box-shadow: 0 0 30px rgba(140, 205, 255, 0.4);
  opacity: 0.6;
}

/* 粒子（呼吸闪烁） */
.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(190, 226, 255, 0.9) 45%, rgba(190, 226, 255, 0) 70%);
  animation: spark-pulse 2.6s ease-in-out infinite;
}

.spark-1 { left: 10%; top: 24%; animation-delay: 0s; }
.spark-2 { left: 84%; top: 18%; animation-delay: 0.4s; }
.spark-3 { left: 76%; top: 62%; animation-delay: 0.9s; }
.spark-4 { left: 16%; top: 70%; animation-delay: 1.3s; }
.spark-5 { left: 48%; top: 8%; animation-delay: 1.8s; }

@keyframes spark-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.35; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* 滚动名单容器 */
.roll-list {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* 底部渐隐，让下面的名字自然淡出（参考图的效果） */
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, #000 18%, #000 68%, rgba(0, 0, 0, 0.5) 90%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, #000 18%, #000 68%, rgba(0, 0, 0, 0.5) 90%, rgba(0, 0, 0, 0) 100%);
}

.roll-track {
  will-change: transform;
}

.roll-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--roll-row-h, 88px);
  transform-origin: 50% 40%;
}

/* 名字本体 */
.roll-row-name {
  position: relative;
  z-index: 2;
  font-size: calc(var(--roll-row-h, 88px) * 0.68);
  font-weight: 800;
  letter-spacing: 2px;
  color: #1c56a8;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.75), 0 10px 24px rgba(40, 100, 190, 0.18);
  white-space: nowrap;
}

/* 速度线：给下方虚化的名字加横向拖尾，越远越明显（透明度由 JS 控制） */
.roll-row-streak {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 96%;
  height: calc(var(--roll-row-h, 88px) * 0.44);
  transform: translate(-50%, -50%);
  border-radius: 999px;
  opacity: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0px,
      rgba(130, 185, 255, 0.36) 10px,
      rgba(255, 255, 255, 0.5) 18px,
      rgba(130, 185, 255, 0) 34px
    );
  filter: blur(3px);
  transition: opacity 0.12s linear;
}

/* 滚动中的名字：默认浅蓝白，焦点行是清晰的深蓝 */
.roll-list.is-rolling .roll-row-name {
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(60, 130, 220, 0.45), 0 0 18px rgba(180, 220, 255, 0.7);
}

.roll-list.is-rolling .roll-row.is-focus .roll-row-name {
  color: #1b52a4;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.75), 0 14px 30px rgba(30, 90, 180, 0.28);
}

/* 旧的单行滚动样式保留给其它地方复用（当前不再使用） */
.slot {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.slot-track {
  /* 轨道由两份相同名单拼成，滚动 -50% 时刚好接回开头，实现无缝循环 */
  animation: slot-roll 0.5s linear infinite;
  will-change: transform;
}

.slot-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--screen-h);              /* 每项高度 = 窗口高度，一次只露一个名字 */
  padding: 0 16px;
  font-size: var(--display-font);
  font-weight: 800;
  letter-spacing: 3px;
  color: #2a6fc9;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65), 0 12px 30px rgba(47, 124, 246, 0.22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 名字背后的一团柔光，滚动时更有"抽奖机"的感觉 */
.slot-item::before {
  content: "";
  position: absolute;
  width: 62%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 124, 246, 0.18) 0%, rgba(47, 124, 246, 0) 70%);
  pointer-events: none;
}

@keyframes slot-roll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

/* 系统设置"减少动态效果"时，取消滚动动画，避免不适 */
@media (prefers-reduced-motion: reduce) {
  .slot-track {
    animation-duration: 1.4s;
  }
}

/* ==================== 结果展示（放大高亮） ==================== */
.winner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
}

.winner-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 4px 22px;
  border-radius: 18px;
}

/* 未抽取时的"呼吸"待机态：不再是一块死板的灰字 */
.winner-card.is-idle {
  animation: idle-breathe 3s ease-in-out infinite;
}

.winner-card.is-idle::after {
  content: "";
  position: absolute;
  inset: -34%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 124, 246, 0.2) 0%, rgba(47, 124, 246, 0) 68%);
  animation: idle-halo 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes idle-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes idle-halo {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.1); }
}

.winner-name {
  font-size: calc(var(--display-font) * 0.85);
  font-weight: 800;
  letter-spacing: 3px;
  color: #9db8d4;
  transition: color 0.25s ease, font-size 0.25s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 抽中后的高亮卡片：淡绿底 + 绿色描边 + 柔光阴影 */
.winner-card.is-on {
  background: linear-gradient(180deg, var(--green-bg-1) 0%, var(--green-bg-2) 100%);
  box-shadow: inset 0 0 0 3px var(--green-line), 0 12px 26px rgba(15, 139, 82, 0.16);
}

.winner-card.is-on .winner-name {
  color: var(--green);
  font-size: calc(var(--display-font) * 1.25);
  text-shadow: 0 6px 16px rgba(15, 139, 82, 0.18);
}

/* 中奖卡片持续呼吸发光；这里把入场动画和发光动画写在同一条 animation 里，
   否则后定义的 animation 会整体覆盖前一条 */
.winner-card.is-on.pop-a {
  animation: pop-a 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both,
             winner-glow 1.8s ease-in-out 0.5s infinite;
}

.winner-card.is-on.pop-b {
  animation: pop-b 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both,
             winner-glow 1.8s ease-in-out 0.5s infinite;
}

@keyframes winner-glow {
  0%, 100% {
    box-shadow: inset 0 0 0 3px var(--green-line), 0 12px 26px rgba(15, 139, 82, 0.16);
  }
  50% {
    box-shadow: inset 0 0 0 3px rgba(62, 207, 142, 0.85), 0 18px 42px rgba(15, 139, 82, 0.3);
  }
}

.winner-hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

.tip.is-hit {
  color: var(--green);
  font-size: clamp(18px, 2.4vmin, 48px);
  font-weight: 800;
}

/* ==================== 点名墙模式 ==================== */
.wall {
  position: absolute;
  inset: 0;
  display: grid;
  /* 学生卡片：auto-fill 让每行尽量多放，人多时自动换行并滚动 */
  grid-template-columns: repeat(auto-fill, minmax(var(--cell-min), 1fr));
  grid-auto-rows: minmax(104px, auto);
  align-content: start;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: none;
}

.wall::-webkit-scrollbar {
  display: none;
}

.wall-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px 7px;
  border: 1.5px solid #e8f1fd;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(58, 120, 200, 0.07);
  transition: transform 0.13s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
}

/* 头像：没有照片时用姓名首字 + 彩色底 */
.wall-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(160deg, #dbe9ff, #eef5ff);
  color: #2a6fc9;
  font-size: 19px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px rgba(120, 170, 230, 0.35);
}

.wall-name {
  font-size: 14px;
  font-weight: 800;
  color: #17416f;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 状态小标签：未点名 / 已点名 / 本轮点名 */
.wall-state {
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5fa;
  color: #8aa2bd;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* 按人数调整卡片尺寸：人少时更大 */
.wall.size-l .wall-avatar { width: 54px; height: 54px; font-size: 24px; }
.wall.size-l .wall-name { font-size: 17px; }
.wall.size-m .wall-avatar { width: 46px; height: 46px; font-size: 21px; }
.wall.size-s .wall-avatar { width: 38px; height: 38px; font-size: 17px; }
.wall.size-s .wall-name { font-size: 12px; }

/* 跳动中的高亮卡：蓝底 + "本轮"角标 */
.wall-cell.is-hot {
  background: linear-gradient(160deg, #57a6ff 0%, var(--blue-500) 100%);
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(47, 124, 246, 0.38);
}

.wall-cell.is-hot .wall-avatar {
  background: linear-gradient(160deg, #ffffff, #eaf3ff);
  color: #1f66d6;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}

.wall-cell.is-hot .wall-name { color: #ffffff; }
.wall-cell.is-hot .wall-state { background: rgba(255, 255, 255, 0.9); color: #1f66d6; }

/* 之前已点过的卡：淡蓝底 + "已点名" */
.wall-cell.is-called {
  background: linear-gradient(160deg, #e8f2ff 0%, #dbe9ff 100%);
  border-color: #cfe3ff;
}

.wall-cell.is-called .wall-avatar {
  background: linear-gradient(160deg, #ffffff, #e6f0ff);
  color: #2f7cf6;
}

.wall-cell.is-called .wall-state {
  background: rgba(47, 124, 246, 0.14);
  color: #2f7cf6;
}

/* 最终中奖卡：蓝底 + 金色描边 + 放大 */
.wall-cell.is-win {
  background: linear-gradient(160deg, #57a6ff 0%, #2a6ff0 100%);
  border-color: #ffd166;
  transform: scale(1.12);
  z-index: 3;
  box-shadow: 0 0 0 3px #ffd166, 0 0 26px rgba(255, 209, 102, 0.75), 0 12px 26px rgba(30, 90, 180, 0.28);
  animation: pop-a 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

.wall-cell.is-win .wall-avatar {
  background: linear-gradient(160deg, #ffffff, #eaf3ff);
  color: #1f66d6;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.95);
}

.wall-cell.is-win .wall-name { color: #ffffff; font-size: 15px; }
.wall-cell.is-win .wall-state { background: #ffd166; color: #7a5000; }

/* 中奖卡向外扩散一圈金色光环 */
.wall-cell.is-win::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 3px solid rgba(255, 209, 102, 0.9);
  animation: ring-out 0.9s ease-out both;
  pointer-events: none;
}

@keyframes ring-out {
  from { transform: scale(0.92); opacity: 1; }
  to { transform: scale(1.22); opacity: 0; }
}

/* 未中奖的格子淡化，突出结果 */
/* 展示中不再整体淡化，状态由卡片颜色区分 */
.wall-cell.is-dim { opacity: 0.85; }

/* 点名墙右下角的"全部重置"（清空已点名记录） */
.wall-reset {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  padding: 6px 14px;
  border: 1.5px solid #cfe3ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2f7cf6;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(58, 120, 200, 0.12);
}

/* ==================== 转盘模式 ==================== */
/* 转盘：轮盘 + 金色指针 + 中心按钮 + 下方结果条 */
.wheel-screen {
  display: flex;
  flex-direction: column;
  padding: 6px 6px 8px;
  background:
    radial-gradient(120% 80% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, #eef5ff 0%, #dfeaff 100%);
}

.wheel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: 6px;
}

.wheel-canvas {
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  transform-origin: 50% 50%;
  will-change: transform;
  filter: drop-shadow(0 12px 26px rgba(60, 120, 200, 0.28));
}

/* 顶部的"转动中"三条小横线 */
.wheel-motion {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0.55;
  pointer-events: none;
}

.wheel-motion i {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(120, 170, 230, 0), #9cc6f5, rgba(120, 170, 230, 0));
}

/* 金色指针：从中心指向顶部 */
.wheel-needle {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 16px;
  height: 46%;
  margin-left: -8px;
  background: linear-gradient(180deg, #ffd166 0%, #f7b733 55%, #e8a020 100%);
  clip-path: polygon(50% 0%, 78% 100%, 22% 100%);
  filter: drop-shadow(0 3px 6px rgba(120, 80, 0, 0.3));
  pointer-events: none;
  z-index: 3;
}

/* 指针顶端的圆球 */
.wheel-needle i {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd9a0 0%, #ff9d3c 55%, #f57c1f 100%);
  box-shadow: 0 0 12px rgba(255, 150, 60, 0.75);
}

/* 中心按钮（白色圆盘，点它开始 / 停止） */
.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 22%;
  height: 22%;
  min-width: 62px;
  min-height: 62px;
  max-width: 96px;
  max-height: 96px;
  margin: 0;
  transform: translate(-50%, -50%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  color: #1f66d6;
  font-size: clamp(15px, 2.2vmin, 20px);
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(50, 110, 190, 0.28), inset 0 0 0 3px rgba(200, 220, 250, 0.6);
}

.wheel-hub:active {
  transform: translate(-50%, -50%) scale(0.96);
}

/* 右上角状态徽标 */
.wheel-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 4;
  padding: 4px 12px;
  border: 1.5px solid #cfe3ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2f7cf6;
  font-size: 12px;
  font-weight: 700;
}

/* 结果条 */
.wheel-result {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1.5px solid #e2edfb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(58, 120, 200, 0.1);
}

/* display:flex 会覆盖 hidden 属性，这里显式处理 */
.wheel-result[hidden] {
  display: none;
}

.wheel-result-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(160deg, #dbe9ff, #eef5ff);
  color: #2a6fc9;
  font-size: 16px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px rgba(120, 170, 230, 0.35);
}

.wheel-result-text {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  color: #17416f;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wheel-result.is-win .wheel-result-text { color: #1f66d6; }

.wheel-result-state {
  flex-shrink: 0;
  padding: 3px 12px;
  border: 1.5px solid #dbe8fa;
  border-radius: 999px;
  background: #f7fbff;
  color: #8aa2bd;
  font-size: 12px;
  font-weight: 700;
}

.wheel-result.is-win .wheel-result-state {
  border-color: #ffd166;
  background: #fff6e0;
  color: #a06a00;
}

/* ==================== 抽取样式切换 ==================== */
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 4px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch-row-tight {
  margin-top: 6px;
}

/* 撒花画布：覆盖整屏但不挡操作 */
.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

/* ==================== 登录拦截（未注册不能用点名） ==================== */
.link-plain {
  text-decoration: none;
  cursor: pointer;
}

/* 用户中心里的"去领取验证码"提示条 */
/* ==================== 人机验证（图形/算术） ==================== */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.captcha-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  height: 48px;
  padding: 0 8px;
  border: 1.5px solid #e0ecfb;
  border-radius: 12px;
  background: #f8fbff;
  color: #86a3c2;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.captcha-visual.captcha-question {
  font-size: 20px;
  font-weight: 800;
  color: #1f66d6;
  letter-spacing: 1px;
}

.captcha-img {
  height: 40px;
  display: block;
}

.captcha-input {
  flex: 1;
  min-width: 80px;
}

.captcha-refresh {
  flex-shrink: 0;
  border: 0;
  padding: 0 12px;
  height: 48px;
  border-radius: 12px;
  background: #eef5ff;
  color: #3b6ea8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.captcha-refresh:hover {
  background: #e2eeff;
}

.claim-hint {
  display: block;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef5ff;
  color: #2f7cf6;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.claim-hint:hover {
  background: #e2eeff;
}

.link-btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* 领取验证码页：验证码大字展示 */
.claim-code {
  margin: 6px 0 2px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px dashed #cfe3ff;
  background: #f6faff;
  color: #1f66d6;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(15px, 4.4vw, 22px);
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  word-break: break-all;
}

.claim-btns {
  margin-top: 14px;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(234, 244, 255, 0.96), rgba(226, 238, 255, 0.97));
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 24px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(53, 122, 214, 0.2);
}

.gate-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #17416f;
}

.gate-sub {
  margin: 8px 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #86a3c2;
}

.gate-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.gate-link {
  color: #2f7cf6;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.gate-note {
  font-size: 12px;
  color: #9bb3cc;
}

.switch-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue-500);
  cursor: pointer;
}

.style-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: #f3f8ff;
}

.style-switch-label {
  flex-shrink: 0;
  margin-right: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.seg-btn {
  border: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: #3b6ea8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.seg-btn:hover {
  background: #e4efff;
}

.seg-btn.is-active {
  background: #ffffff;
  color: var(--blue-500);
  box-shadow: 0 4px 12px rgba(53, 122, 214, 0.18);
}

.winner-card.is-on + .winner-hint {
  color: var(--green);
  font-weight: 600;
}

/* 两个内容相同、名字不同的动画，交替使用即可让每次抽奖都重新播放 */
.pop-a { animation: pop-a 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both; }
.pop-b { animation: pop-b 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both; }

@keyframes pop-a {
  0%   { transform: scale(0.6); opacity: 0.2; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pop-b {
  0%   { transform: scale(0.6); opacity: 0.2; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==================== 按钮 ==================== */
.main-btn {
  /* 用 flex 居中：这样 <button> 和 <a>（例如用户中心的"去点名"）文字都能垂直+水平居中。
     之前是 display:block + 固定高度，<a> 没有按钮的默认居中，文字会挤在左上角。 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  margin-top: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 6px;
  /* letter-spacing 会在最后一个字后面也加 6px，导致整体看起来往左偏约 3px；
     这里用 text-indent 补回来，让文字视觉上真正居中 */
  text-indent: 6px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.main-btn.is-start {
  background: linear-gradient(135deg, #57a6ff 0%, var(--blue-500) 100%);
  box-shadow: 0 14px 26px rgba(47, 124, 246, 0.34);
}

.main-btn.is-stop {
  background: linear-gradient(135deg, #ff9a62 0%, var(--red) 100%);
  box-shadow: 0 14px 26px rgba(242, 100, 60, 0.34);
}

.main-btn:hover {
  opacity: 0.94;
}

.main-btn:active {
  transform: scale(0.97);
}

.main-btn:disabled {
  opacity: 0.75;
  cursor: default;
  transform: none;
}

.tool-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.tool-btn {
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: #eef5ff;
  color: #3b6ea8;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.tool-btn-primary {
  background: rgba(47, 124, 246, 0.12);
  color: var(--blue-500);
}

.tool-btn:hover {
  background: #e2eeff;
}

.tool-btn:active {
  transform: scale(0.97);
}

.foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #9bb3cc;
}

/* ==================== 弹层 ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] {
  display: none;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 46, 84, 0.45);
  animation: fade-in 0.2s ease both;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 18px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(16, 46, 84, 0.28);
  animation: panel-in 0.22s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 手机上弹层从底部升起，更好点按 */
@media (max-width: 640px) {
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    animation: sheet-in 0.26s ease both;
  }

  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(60px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.panel-done {
  border: 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(47, 124, 246, 0.12);
  color: var(--blue-500);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.panel-done:hover {
  background: rgba(47, 124, 246, 0.2);
}

.panel-note {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

.panel-note code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--blue-50);
  color: #3b6ea8;
  font-size: 12px;
}

/* ==================== 表单 ==================== */

/* 文件导入区 */
.import-row {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px dashed #bcd9ff;
  border-radius: 14px;
  background: #f8fbff;
}

.import-row.is-dragover {
  border-color: var(--blue-500);
  background: #e9f3ff;
}

.import-btn {
  display: block;
  width: 100%;
  height: 46px;
  border: 1px solid #cfe3ff;
  border-radius: 12px;
  background: #ffffff;
  color: var(--blue-500);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.import-btn::before {
  content: "📄 ";
  font-size: 15px;
}

.import-btn:hover {
  background: #eef5ff;
}

.import-btn:active {
  transform: scale(0.99);
}

.import-btn:disabled {
  color: #a9c0d8;
  cursor: default;
}

.import-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

.import-note b {
  color: #3b6ea8;
  font-weight: 700;
}

/* 真正用于选文件的 input，隐藏界面但保留功能 */
.file-input {
  display: none;
}

/* 扫码收名单 */
.collect-row {
  margin-top: 14px;
}

.collect-btn {
  border-style: solid;
  border-color: rgba(47, 124, 246, 0.45);
  background: rgba(47, 124, 246, 0.06);
}

.collect-btn::before {
  content: "📱 ";
  font-size: 15px;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 2px dashed #d9e9ff;
}

/* 二维码用 canvas 画出来，用 pixelated 保证放大后边缘不发虚 */
.qr-canvas {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  background: #ffffff;
  image-rendering: pixelated;
}

.qr-canvas-big {
  width: min(78vw, 58vh);
  height: min(78vw, 58vh);
}

.qr-room {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

.qr-room b {
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--blue-500);
}

.collect-status {
  margin: 16px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.collect-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 130px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.collect-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-bg-1);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  animation: pop-a 0.35s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

.collect-empty {
  font-size: 13px;
  color: var(--ink-3);
}

/* 用局域网地址打开时的提醒条（学生用自己流量扫不到） */
.collect-host-warn {
  margin: -4px 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #ffd8b0;
  background: #fff6ec;
  color: #a35a12;
  font-size: 13px;
  line-height: 1.7;
}

.collect-host-warn b {
  color: #8a4405;
}

.qr-full-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  text-align: center;
}

.qr-full-room {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.qr-full-room b {
  letter-spacing: 4px;
  color: var(--blue-500);
}

.qr-full-tip {
  margin: 0;
  font-size: 14px;
  color: var(--ink-3);
}

/* 导入时的列选择列表 */
.column-list {
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.column-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid #e7f1fd;
  border-radius: 12px;
  background: #f7fbff;
  cursor: pointer;
}

.column-row:hover {
  background: #eef5ff;
}

.column-row.is-active {
  border-color: var(--blue-300);
  background: #e9f3ff;
}

.column-row input[type="radio"] {
  margin: 3px 0 0;
  accent-color: var(--blue-500);
  flex-shrink: 0;
}

.column-info {
  flex: 1;
  min-width: 0;
}

.column-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.column-sample {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  word-break: break-all;
}

.editor {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  border: 1px solid #e0ecfb;
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px; /* 16px 可避免 iOS 自动放大页面 */
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.editor:focus {
  border-color: var(--blue-300);
  background: #ffffff;
}

.panel-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.mini-btn {
  height: 48px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.12s ease;
}

.mini-btn:active {
  transform: scale(0.98);
}

.mini-btn:hover {
  opacity: 0.88;
}

.mini-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #57a6ff 0%, var(--blue-500) 100%);
  box-shadow: 0 10px 20px rgba(47, 124, 246, 0.28);
}

.mini-danger {
  color: var(--red-500);
  background: var(--red-bg);
}

.mini-plain {
  color: #3b6ea8;
  background: #eef5ff;
}

.list-title {
  margin: 18px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.name-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin-bottom: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid #e7f1fd;
  border-radius: 12px;
  background: #f7fbff;
}

.name-index {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e4efff;
  color: #5b86b6;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
}

.name-text {
  flex: 1;
  font-size: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.name-del {
  flex-shrink: 0;
  border: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--red-bg);
  color: var(--red-500);
  font-size: 13px;
  cursor: pointer;
}

.name-del:hover {
  background: #ffe0e0;
}

.name-empty {
  padding: 34px 0;
  text-align: center;
  font-size: 14px;
  color: #a9c0d8;
}

/* 登录表单 */
.join-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.join-app {
  max-width: 560px;
  padding-top: calc(40px + env(safe-area-inset-top));
}

.join-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: auto;
  min-height: 0;
  padding: 30px 20px;
  overflow: visible;   /* 内容比容器高时也不要被裁掉 */
}

.join-input {
  width: 100%;
  max-width: 380px;
  height: 64px;
  padding: 0 18px;
  border: 2px solid #d9e9ff;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.join-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.14);
}

.join-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--green-bg-1), var(--green-bg-2));
  color: var(--green);
  font-size: 34px;
  font-weight: 800;
  line-height: 64px;
  text-align: center;
  box-shadow: inset 0 0 0 3px var(--green-line);
  animation: pop-a 0.4s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

.join-check-error {
  background: var(--red-bg);
  color: var(--red-500);
  box-shadow: inset 0 0 0 3px rgba(230, 69, 69, 0.35);
}

.join-done-name {
  font-size: 34px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: 2px;
}

.join-error .join-done-name {
  color: var(--red-500);
  font-size: 26px;
}

.join-done-tip {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-3);
  text-align: center;
}

.join-back {
  width: 100%;
  margin-top: 14px;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #e0ecfb;
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

.input:focus {
  border-color: var(--blue-300);
  background: #ffffff;
}

.code-row {
  display: flex;
  gap: 10px;
}

.code-btn {
  flex-shrink: 0;
  min-width: 122px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: #eef5ff;
  color: var(--blue-500);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.code-btn:disabled {
  color: #a9c0d8;
  cursor: default;
}

.login-submit {
  margin-top: 6px;
}

.dev-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e8;
  color: #a9761b;
}

.confirm-text {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ==================== 轻提示 ==================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(64px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100% - 48px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(23, 65, 111, 0.9);
  color: #ffffff;
  font-size: 14px;
  text-align: center;
  animation: toast-in 0.2s ease both;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ==================== 桌面 / 大屏微调 ==================== */
@media (min-width: 900px) {
  :root {
    --screen-h: clamp(340px, 48vh, 620px);
    --display-font: clamp(64px, 12vmin, 180px);
    --roll-row-h: 124px;
  }

  .brand-title {
    font-size: 30px;
  }

  .stage {
    padding: 24px 28px 30px;
  }

  .main-btn {
    height: 68px;
    font-size: 22px;
  }
}

/* 全屏时指针、按钮也跟着放大，避免大屏上显得过小 */
body.is-fullscreen .wheel-pointer {
  margin-left: -18px;
  border-left-width: 18px;
  border-right-width: 18px;
  border-top-width: 30px;
}

body.is-fullscreen .main-btn {
  height: 76px;
  font-size: 24px;
}

body.is-fullscreen .tip {
  font-size: 17px;
}

/* 矮屏（横屏手机、小窗口）压缩高度，保证按钮不用滚动就能点到 */
@media (max-height: 700px) {
  :root {
    --screen-h: clamp(180px, 34vh, 300px);
    --display-font: clamp(36px, 9vmin, 96px);
  }

  /* 压缩间距，保证一屏放得下、不需要滚动 */
  .tip {
    margin-bottom: 8px;
  }

  .style-switch,
  .switch-row {
    margin-top: 8px;
  }

  .foot {
    margin-top: 10px;
  }

  .main-btn {
    height: 54px;
    margin-top: 14px;
  }
}
