/* ============================================================
   NameWheel.top — 幸运转盘 / 名字转盘样式
   设计主题：紫罗兰庆典风 + 干净卡片布局，明亮、欢快、无干扰
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --ink: #241b3a;            /* 主文字：深紫黑 */
  --ink-soft: #5d5478;       /* 次要文字 */
  --brand: #6d28d9;          /* 品牌主色：紫罗兰 */
  --brand-strong: #5b21b6;
  --brand-soft: #f0eafc;     /* 品牌浅色底 */
  --paper: #f7f5fb;          /* 页面底色 */
  --card: #ffffff;
  --line: #e6e1f2;           /* 卡片边线 */
  --ok: #047857;
  --gold: #f59e0b;           /* 指针/高亮金 */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(36, 27, 58, .05), 0 8px 24px rgba(36, 27, 58, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.02em;
}

.brand em {
  font-style: normal;
  color: var(--brand);
  font-weight: 600;
}

.brand-icon { border-radius: 8px; flex: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}

.site-nav a:hover { color: var(--brand); }

.lang-select {
  font: inherit;
  font-size: 13.5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  max-width: 128px;
}

/* ---------- 首屏 ---------- */
.hero {
  text-align: center;
  padding: 40px 0 24px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.6vw, 42px);
  line-height: 1.18;
  letter-spacing: -.03em;
  font-weight: 800;
}

.hero-sub {
  margin: 0 auto;
  max-width: 740px;
  color: var(--ink-soft);
  font-size: clamp(15px, 2vw, 17px);
}

/* ---------- 工具区布局 ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
  margin-bottom: 22px;
}

.tool-right { display: grid; gap: 16px; }

.panel-card, .wheel-card, .history-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-card { padding: 18px 20px; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 15.5px;
  font-weight: 700;
}

.panel-title .panel-extra {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 800;
  flex: none;
}

/* ---------- 转盘画布区 ---------- */
.wheel-card {
  position: relative;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  border-radius: 14px;
}

/* 正方形内容盒：转盘/指针/中心按钮都相对它定位 */
.wheel-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

#wheelCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* 中心 SPIN 按钮 */
.spin-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 5px solid #fff;
  background: radial-gradient(circle at 32% 28%, #8b5cf6, var(--brand) 68%);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: clamp(14px, 2.4vw, 20px);
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(109, 40, 217, .45), inset 0 2px 6px rgba(255,255,255,.35);
  transition: transform .12s ease, box-shadow .12s ease;
  z-index: 3;
}

.spin-hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.05); }
.spin-hub:active:not(:disabled) { transform: translate(-50%, -50%) scale(.97); }
.spin-hub:disabled { cursor: default; opacity: .85; }

/* 顶部指针 */
.wheel-pointer {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 26px solid var(--gold);
  filter: drop-shadow(0 3px 3px rgba(36, 27, 58, .35));
  z-index: 4;
  pointer-events: none;
}

.wheel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 全屏画布模式：舞台铺满视口，内容盒保持正方形且不超高 */
.wheel-stage:fullscreen {
  background: radial-gradient(circle at 50% 40%, #312e51, #17132b 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  padding: 3vmin;
  box-sizing: border-box;
}

.wheel-stage:fullscreen .wheel-box {
  width: min(94vmin, 100%);
  width: min(94dvmin, 100%); /* 动态视口单位：移动端地址栏伸缩时也不超高 */
  flex: none;
}

/* 设置了摇奖标题：顶部预留标题空间，转盘让位不重叠 */
.wheel-stage:fullscreen.has-fs-title {
  padding-top: max(96px, 15.5vmin);
  padding-top: max(96px, 15.5dvmin);
}

.wheel-stage:fullscreen.has-fs-title .wheel-box {
  width: min(94vmin, 100%, calc(100vh - max(96px, 15.5vmin) - 4.5vmin));
  width: min(94dvmin, 100%, calc(100dvh - max(96px, 15.5dvmin) - 4.5dvmin));
}

/* 全屏内的退出按钮（仅全屏时可见；在 body 下时隐藏） */
.fs-exit-btn { display: none; }

:fullscreen .fs-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 96;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(23, 16, 43, .55);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s ease;
}

:fullscreen .fs-exit-btn:hover { background: rgba(23, 16, 43, .85); }

/* 全屏抽奖标题（仅全屏可见；无标题时 JS 内联隐藏） */
.fs-title { display: none; }

:fullscreen .fs-title {
  display: block;
  position: fixed;
  top: max(18px, 4.5vmin);
  left: 50%;
  transform: translateX(-50%);
  z-index: 94;
  max-width: 80vmin;
  padding: 12px 30px;
  border-radius: 999px;
  background: rgba(23, 16, 43, .38);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: clamp(18px, 4vmin, 40px);
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  pointer-events: none;
}

/* ---------- 背景色板 ---------- */
.bg-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.bg-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.bg-swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  padding: 0;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.bg-swatch:hover { transform: scale(1.1); }

.bg-swatch.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, .18);
}

/* ---------- 表单控件 ---------- */
.field { margin-bottom: 12px; }

.field label, .range-row label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.text-input, .select-input, textarea.text-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s;
}

textarea.text-input {
  min-height: 120px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.55;
}

.text-input:focus, .select-input:focus, textarea.text-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, .12);
}

.field-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.range-row label { margin: 0; white-space: nowrap; }

.range-input {
  flex: 1;
  accent-color: var(--brand);
  height: 4px;
  cursor: pointer;
}

.range-val {
  min-width: 44px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* 开关行 */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
}

.switch-row:first-of-type { border-top: 0; }

.switch-row .switch-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.switch-row .switch-desc {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-soft);
}

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  cursor: pointer;
}

.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }

.toggle .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d5cfe6;
  transition: background .18s;
  pointer-events: none;
}

.toggle .track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(36, 27, 58, .3);
  transition: transform .18s;
}

.toggle input:checked + .track { background: var(--brand); }
.toggle input:checked + .track::after { transform: translateX(18px); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  border-radius: 11px;
  padding: 12px 20px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .16s ease;
}

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(109, 40, 217, .26);
}

.btn-primary:not(:disabled):hover { background: var(--brand-strong); transform: translateY(-1px); }

.btn-outline {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline:not(:disabled):hover { border-color: var(--brand); color: var(--brand); }

.btn-ghost {
  background: transparent;
  color: var(--brand);
  padding: 12px 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-sm { padding: 7px 12px; font-size: 13.5px; border-radius: 9px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* ---------- 模板 chips ---------- */
.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #ddd0f7;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all .15s;
}

.chip:hover { background: #e4d9fa; border-color: var(--brand); }

/* ---------- 条目列表 ---------- */
.quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-add .text-input { flex: 1; }

.entry-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaff;
}

.entry-row.hidden-entry { opacity: .5; }

.entry-color {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--line);
  flex: none;
  cursor: pointer;
  overflow: hidden;
}

.entry-color input[type="color"] {
  position: absolute;
  inset: -8px;
  width: 42px;
  height: 42px;
  opacity: 0;
  cursor: pointer;
}

.entry-text {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 4px 6px;
}

.entry-text:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}

.entry-weight {
  width: 52px;
  font: inherit;
  font-size: 13px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 2px;
  background: #fff;
  color: var(--ink);
}

.entry-weight:focus { outline: none; border-color: var(--brand); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  flex: none;
  padding: 0;
}

.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn.danger:hover { background: #fde8ec; color: #dc2626; }
.icon-btn.off { opacity: .45; }

.entry-count {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ---------- 历史记录 ---------- */
.history-card {
  padding: 18px 20px;
  margin-bottom: 44px;
}

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

.history-head h2 { margin: 0; font-size: 15.5px; }

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-soft);
  border: 1px solid #ddd0f7;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 5px 13px;
}

.history-list li .h-time {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 12px;
}

.history-empty { color: var(--ink-soft); font-size: 13.5px; margin: 0; }

/* ---------- 中奖弹窗 ---------- */
.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(23, 16, 43, .55);
  backdrop-filter: blur(3px);
  padding: 20px;
}

.winner-overlay.show { display: flex; }

.winner-dialog {
  position: relative;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(23, 16, 43, .4);
  padding: 34px 34px 28px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  animation: pop .35s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes pop {
  from { transform: scale(.75); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.winner-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.winner-name {
  margin: 0 0 20px;
  font-size: clamp(26px, 6vw, 38px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.2;
}

.winner-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.winner-btns .btn { flex: 1; min-width: 120px; }

#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 95;
}

/* ---------- 内容区 ---------- */
.content-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 34px;
  margin-bottom: 22px;
}

.content-section h2 {
  margin: 0 0 14px;
  font-size: 23px;
  letter-spacing: -.02em;
}

.content-section p { color: var(--ink-soft); margin: 0 0 12px; }
.content-section p:last-child { margin-bottom: 0; }

.howto-list {
  margin: 0;
  padding-left: 22px;
  color: var(--ink-soft);
}

.howto-list li { margin-bottom: 10px; }
.howto-list li::marker { color: var(--brand); font-weight: 800; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature-item h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  color: var(--ink);
}

.feature-item h3::before {
  content: "✦";
  color: var(--brand);
  margin-right: 7px;
}

.feature-item p { margin: 0; font-size: 14px; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; }

.faq-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 20px;
  font-weight: 400;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item p {
  padding: 0 18px 16px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 44px;
  padding: 30px 0 36px;
}

.footer-inner { text-align: center; }

.footer-inner p { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.footer-nav a {
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.footer-nav a:hover { text-decoration: underline; }

.disclaimer { font-size: 12.5px !important; color: #a49cc0 !important; max-width: 640px; margin: 0 auto !important; }

/* ---------- Toast ---------- */
.copied-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(36, 27, 58, .3);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 100;
}

.copied-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 静态页（隐私/关于/联系） ---------- */
.page-body { background: var(--paper); }

.page-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
  margin: 36px 0 44px;
}

.page-card h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -.02em;
}

.page-card .page-updated {
  color: #a49cc0;
  font-size: 13px;
  margin-bottom: 22px;
}

.page-card h2 {
  font-size: 19px;
  margin: 26px 0 8px;
}

.page-card p, .page-card li {
  color: var(--ink-soft);
  font-size: 15px;
}

.page-card ul { padding-left: 22px; }

.page-card a { color: var(--brand); }

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--brand-soft);
  border: 1px solid #ddd0f7;
  color: var(--brand);
  font-weight: 700;
  border-radius: 11px;
  padding: 12px 20px;
  text-decoration: none;
  margin: 6px 0;
}

.contact-mail:hover { background: #e4d9fa; }

/* ---------- 多转盘：标签栏 / 模式切换 / 网格 ---------- */
.wheel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.wheel-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fbfaff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.wheel-tab:hover { border-color: var(--brand); color: var(--brand); }

.wheel-tab.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.wheel-tab .wt-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-tab .wt-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
}

.wheel-tab .wt-x:hover { background: #fde8ec; color: #dc2626; }

.wheel-tab-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: transparent;
  border: 1.5px dashed #c9b8ef;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: all .15s;
}

.wheel-tab-add:hover { border-color: var(--brand); background: var(--brand-soft); }

/* 模式切换：单个 / 全部 */
.seg-control {
  display: inline-flex;
  background: #efeaf8;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.seg-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 6px 18px;
  cursor: pointer;
  transition: all .15s;
}

.seg-btn.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(36, 27, 58, .15);
}

/* 多转盘网格 */
.wheels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  width: 100%;
}

.grid-wheel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fbfaff;
  transition: border-color .15s, box-shadow .15s;
}

.grid-wheel.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, .12);
}

.gw-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.grid-wheel.active .gw-name { color: var(--brand); }

.gw-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.gw-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.gw-pointer {
  position: absolute;
  left: 50%;
  top: -3px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid var(--gold);
  filter: drop-shadow(0 2px 2px rgba(36, 27, 58, .3));
  pointer-events: none;
}

.spin-all-btn {
  width: 100%;
  max-width: 560px;
  font-size: 17px;
  letter-spacing: .06em;
}

/* 网格小转盘中心的转动按钮（迷你轮毂） */
.gw-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 3px solid #fff;
  background: radial-gradient(circle at 32% 28%, #8b5cf6, var(--brand) 68%);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .02em;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(109, 40, 217, .4), inset 0 2px 4px rgba(255, 255, 255, .3);
  transition: transform .12s ease, box-shadow .12s ease;
  z-index: 3;
}

.gw-spin:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.08); }
.gw-spin:active:not(:disabled) { transform: translate(-50%, -50%) scale(.96); }
.gw-spin:disabled { cursor: default; opacity: .85; }

/* 抽取人数步进器 */
.count-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.count-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--brand);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}

.count-btn:hover { border-color: var(--brand); background: var(--brand-soft); }

.count-input {
  width: 46px;
  height: 30px;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}

.count-input::-webkit-outer-spin-button,
.count-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.count-input:focus { outline: 2px solid rgba(109, 40, 217, .35); border-color: var(--brand); }

/* 全部模式网格全屏 */
.wheels-grid:fullscreen {
  background: radial-gradient(circle at 50% 40%, #312e51, #17132b 75%);
  padding: 24px;
  overflow-y: auto;
  align-content: center;
}

/* 网格全屏 + 摇奖标题：顶部预留空间避免遮挡首排小转盘 */
.wheels-grid:fullscreen.has-fs-title {
  padding-top: max(96px, 15.5vmin);
  padding-top: max(96px, 15.5dvmin);
}

.wheels-grid:fullscreen .grid-wheel { background: rgba(255, 255, 255, .96); }

/* 多中奖名单 */
.winner-multi {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  text-align: left;
}

.winner-multi li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}

.winner-multi li:last-child { border-bottom: 0; }

.winner-multi .wm-wheel {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-multi strong {
  color: var(--brand);
  font-size: 17px;
  word-break: break-word;
  text-align: right;
}

/* 条目面板中的当前转盘提示 */
.panel-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

/* 历史记录中的来源转盘标签 */
.history-list li .h-wheel {
  font-weight: 600;
  color: var(--brand);
  font-size: 11.5px;
  background: #fff;
  border: 1px solid #ddd0f7;
  border-radius: 999px;
  padding: 1px 8px;
}

/* ---------- 无障碍 ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 920px) {
  .tool-grid { grid-template-columns: 1fr; }
  .wheel-card { order: 1; }
  .tool-right { order: 2; }
  .content-section { padding: 24px 22px; }
  .page-card { padding: 26px 22px; }
}

@media (max-width: 560px) {
  .hero { padding: 30px 0 18px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 13.5px; }
  .wheel-card { padding: 14px; }
  .content-section h2 { font-size: 20px; }
  .winner-dialog { padding: 26px 20px 22px; }
  .entry-weight { width: 44px; }
  .wheels-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .wheel-tab .wt-name { max-width: 90px; }
  .seg-btn { padding: 6px 14px; }
}
