/* ============================================================
   绒屿之都云抽奖 · 设计系统
   黑白纸墨 —— 铅字排印 × 抽奖票据：纯灰阶、硬边、宋体标题
   签名元素：「抽奖凭证」票根（齿孔 + 虚线裁切 + 等宽序列号 + 硬投影）
   ============================================================ */

/* hidden 属性优先于任何 display 设置（修复 .escrowbar/.shareline 等空壳凭空显示） */
[hidden] { display: none !important; }

:root {
  color-scheme: light;

  --paper: #f6f6f4;
  --card: #ffffff;
  --ink: #141414;
  --muted: #565656;
  --faint: #8c8c8c;
  --line: #e5e5e3;
  --line-strong: #cfcfcd;

  --brand: #141414;
  --brand-600: #000000;
  --brand-100: #e7e7e5;
  --brand-50: #f0f0ee;
  --brand-hi: #2e2e2e;

  --gold: #1c1c1c;
  --gold-deep: #000000;
  --gold-50: #f2f2f0;
  --gold-100: #e2e2e0;

  --danger: #141414;
  --danger-50: #ffffff;
  --danger-soft: #ececea;
  --danger-line: #141414;

  /* 环境层（亮色基准，暗色主题在文件中部整组覆盖） */
  --nav-bg: rgba(255, 255, 255, 0.92);
  --body-top: #f6f6f4;
  --row-hover: #fafaf8;
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --light-veil: rgba(246, 246, 244, 0.8);
  --stage-veil: rgba(246, 246, 244, 0.78);

  /* 转盘配色（games.js 内联样式按变量引用） */
  --wl-a: #ffffff;
  --wl-b: #efefed;
  --wl-pot: #d6d6d4;
  --wl-line: #141414;

  --r-lg: 8px;
  --r-md: 6px;
  --r-sm: 4px;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.04);
  --shadow-2: 0 10px 28px rgba(0, 0, 0, 0.09);
  --shadow-3: 0 18px 44px rgba(0, 0, 0, 0.16);
  --shadow-hard: 4px 4px 0 rgba(20, 20, 20, 0.9);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-display: "Kaiti SC", "STKaiti", KaiTi, "KaiTi_GB2312", "BiauKai", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

::selection { background: var(--brand-100); }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- 顶栏 ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
  flex: none;
}
.brand:hover { color: var(--ink); }

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--card);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.nav__links {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex: none;
}

.nav__links a {
  color: var(--muted);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav__links a:hover { color: var(--ink); background: var(--paper); }
.nav__links a.is-active { color: var(--brand); background: var(--brand-50); font-weight: 600; }

.nav__spacer { flex: 1; }

.nav__user { display: flex; align-items: center; gap: 10px; flex: none; }

.userchip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.userchip__avatar {
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.userchip b { color: var(--ink); font-weight: 600; }

/* ---------------- 布局 ---------------- */

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.wrap--narrow { max-width: 860px; }

.pagehead { margin-bottom: 28px; }
.pagehead h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.01em; }
.pagehead p { color: var(--muted); margin-top: 4px; }

.foot {
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
  padding: 24px;
  background: var(--paper);
}

.foot small {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  opacity: 0.85;
}

.foot small a { color: var(--brand); }
.foot small a:hover { text-decoration: underline; }

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.card__body { padding: 24px; }
.card__head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card__head h2 { font-size: 16px; font-weight: 700; }
.card__head .spacer { flex: 1; }

/* ---------------- 按钮 ---------------- */

.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 0 18px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--brand);
  color: var(--card);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.btn--primary:hover:not(:disabled) { background: var(--brand-600); color: var(--card); }

.btn--ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }

.btn--soft { background: var(--brand-50); color: var(--brand); }
.btn--soft:hover:not(:disabled) { background: var(--brand-100); color: var(--brand-600); }

.btn--danger { background: var(--danger-50); color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn--gold { background: var(--gold); color: var(--card); }
.btn--gold:hover:not(:disabled) { background: var(--gold-deep); color: var(--card); }

.btn--lg { height: 46px; font-size: 15px; padding: 0 24px; border-radius: 12px; }
.btn--sm { height: 32px; font-size: 13px; padding: 0 12px; border-radius: 8px; }

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 18px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.label .opt { color: var(--faint); font-weight: 400; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 122, 95, 0.12);
}
.input.is-mono { font-family: var(--mono); letter-spacing: 0.02em; }

.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

/* 选择卡片（玩法/模式） */
.pickrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pickrow--2 { grid-template-columns: repeat(2, 1fr); }

.pick {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.pick:hover { border-color: var(--brand); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick.is-on {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 1px var(--brand);
}
.pick__title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pick__desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.pick__ico { font-size: 17px; }

/* 步骤标题（创建流程是真实顺序） */
.step { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 14px; }
.step:first-child { margin-top: 0; }
.step__no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brand);
  border: 1px solid var(--brand-100);
  background: var(--brand-50);
  border-radius: 6px;
  padding: 2px 7px;
}
.step h2 { font-size: 16.5px; font-weight: 700; }
.step .sub { color: var(--faint); font-size: 13px; }

/* ---------------- 创建页组件（移动优先单列流） ---------------- */

.input--lg { height: 46px; font-size: 15.5px; }
.btn--xl { height: 50px; font-size: 16px; padding: 0 28px; border-radius: 14px; }

/* 分节卡片 */
.csec {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 20px 18px;
  margin-bottom: 14px;
}
.csec .step { margin: 26px 0 14px; }
.csec .step:first-child { margin-top: 0; }

/* 封面图卡片 */
.coverup {
  position: relative;
  min-height: 116px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s;
  display: grid;
  place-items: center;
}
.coverup:hover { border-color: var(--brand); }
.coverup__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.coverup__img.is-show { display: block; }
.coverup.has-img { border-style: solid; border-color: var(--line); }
.coverup__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 22px 16px;
  text-align: center;
}
.coverup__empty .ico-svg { font-size: 22px; color: var(--faint); }
.coverup__empty b { font-size: 13.5px; color: var(--ink); }
.coverup__empty span { font-size: 12px; color: var(--faint); }
.coverup.has-img .coverup__empty { display: none; }
.coverup__clear {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.coverup__clear:hover { background: rgba(0, 0, 0, 0.85); }

/* 奖品行卡片（简化：名称 + 类型 + 数量/份数，权重折叠） */
.prizecard {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 12px 12px 10px;
  margin-bottom: 10px;
}
.prizecard__top { display: flex; gap: 8px; align-items: center; }
.prizecard__top .p-name { height: 40px; font-weight: 600; }
.prizecard__del {
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.prizecard__del:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-50); }
.prizecard__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; margin-top: 8px; }
.prizecard__grid .p-amount { display: none; }
.prizecard.is-asset .prizecard__grid { grid-template-columns: 1fr 1fr 1fr; }
.prizecard.is-asset .p-amount { display: block; }
.prizecard .input, .prizecard .select { height: 38px; }
.prizecard__adv { margin-top: 6px; font-size: 12.5px; color: var(--faint); }
.prizecard__adv summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.prizecard__adv summary::-webkit-details-marker { display: none; }
.prizecard__adv summary:hover { color: var(--muted); }
.prizecard__adv summary .ico-svg { font-size: 11px; transition: transform 0.15s; }
.prizecard__adv[open] summary .ico-svg { transform: rotate(180deg); }
.prizecard__advbody { display: flex; align-items: center; gap: 10px; padding-top: 8px; flex-wrap: wrap; }
.prizecard__advbody .input { width: 110px; height: 34px; }

/* 虚线添加按钮 */
.addprize {
  width: 100%;
  border: 1.5px dashed var(--line-strong);
  background: none;
  border-radius: var(--r-md);
  padding: 12px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.addprize:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

/* 托管预览条 */
.escrowbar {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--gold-50);
  border: 1px solid var(--gold-100);
  color: var(--gold-deep);
  font-size: 13px;
  line-height: 1.65;
}
.escrowbar .ico-svg { flex: none; margin-top: 3px; }
.escrowbar b { font-weight: 700; }
.escrowbar.is-warn { background: var(--danger-50); border-color: var(--danger-line); color: var(--danger); }

/* 高级设置折叠面板 */
.advset {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  margin-bottom: 4px;
}
.advset summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.advset summary::-webkit-details-marker { display: none; }
.advset summary .ico-svg { font-size: 12px; transition: transform 0.15s; }
.advset[open] summary .ico-svg { transform: rotate(180deg); }
.advset summary:hover { color: var(--ink); }
.advset__sub { font-weight: 400; font-size: 12.5px; color: var(--faint); }
.advset[open] summary { border-bottom: 1px dashed var(--line); }
.advset__body { padding: 18px; }

/* 底部常驻提交条 */
.submitbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(246, 246, 244, 0) 0%, var(--paper) 34%);
}
.submitbar .btn { flex: 1; }

/* 扁平勾选卡（公示中奖名单） */
.pick--flat { display: flex; align-items: flex-start; gap: 10px; }
.pick--flat input[type="checkbox"] {
  position: static;
  opacity: 1;
  pointer-events: auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--brand);
  flex: none;
}
.pick--flat .pick__desc { margin-top: 0; }

@media (max-width: 720px) {
  .csec { padding: 18px 14px; border-radius: var(--r-md); }
  .prizecard__grid { grid-template-columns: 1fr 1fr; }
  .prizecard.is-asset .prizecard__grid { grid-template-columns: 1fr; }
  .submitbar__note { display: none; }
  .submitbar .btn { width: 100%; flex: none; }
  .submitbar { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .shareline { flex-wrap: wrap; padding: 10px 12px; }
  .shareline .url { flex: 1 1 100%; order: 3; }
  .shareline .btn { margin-left: auto; }
}

/* ---------------- 徽章 ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--form { background: var(--paper); border-color: var(--line); color: var(--muted); }
.badge--green { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }
.badge--gold { background: var(--gold-50); border-color: var(--gold-100); color: var(--gold-deep); }
.badge--gray { background: var(--paper); border-color: var(--line); color: var(--muted); }
.badge--red { background: var(--danger-50); border-color: var(--danger-line); color: var(--danger); }

/* ---------------- 表格 ---------------- */

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--row-hover); }
.table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------------- 统计卡 ---------------- */

.statgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-1);
}
.stat__label { font-size: 12.5px; color: var(--muted); }
.stat__value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.stat__value small { font-size: 13px; color: var(--faint); font-weight: 400; }
.stat--gold .stat__value { color: var(--gold-deep); }

/* ---------------- Tabs ---------------- */

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  appearance: none;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--brand); border-bottom-color: var(--brand); }

/* ============================================================
   签名元素：「抽奖凭证」票根
   ============================================================ */

.ticket {
  position: relative;
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.ticket__stub {
  flex: 0 0 128px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 6px, rgba(20, 20, 20, 0.045) 6px 12px),
    var(--brand-50);
  border-right: 1.5px dashed var(--brand-100);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.ticket__stub .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--card);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.ticket__serial {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--brand);
  letter-spacing: 0.08em;
}
.ticket__brand { font-size: 11px; color: var(--faint); letter-spacing: 0.3em; margin-top: auto; }

.ticket__main { flex: 1; padding: 22px 26px; min-width: 0; }

/* 齿孔：票根分割线上下两个半圆 */
.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  z-index: 2;
}
.ticket::before { top: -10px; left: 119px; }
.ticket::after { bottom: -10px; left: 119px; }

/* 中奖凭证（结果弹窗中的票根） */
.result-ticket { max-width: 460px; margin: 0 auto; animation: ticket-print 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.2); }

@keyframes ticket-print {
  from { transform: translateY(-46px) rotate(-1.5deg); opacity: 0; }
  to { transform: translateY(0) rotate(0); opacity: 1; }
}

.result-name { font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.result-name.is-miss { color: var(--muted); font-weight: 700; }
.result-name.is-win { color: var(--gold-deep); }

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  background: var(--gold-50);
  border: 1px solid var(--gold-100);
  color: var(--gold-deep);
  padding: 6px 14px;
  border-radius: 999px;
}
.result-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.result-note b { color: var(--ink); }

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--faint);
}
.result-meta .num { font-family: var(--mono); }

/* ---------------- 弹窗 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay-bg);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  max-width: 520px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  animation: pop-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop-in {
  from { transform: scale(0.94) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal__body { padding: 26px; }
.modal__foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
}

/* ---------------- 提示 ---------------- */

.toastbox {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--card);
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  animation: toast-in 0.25s ease;
}
.toast--err { background: var(--danger); }
.toast--ok { background: var(--brand-600); }
@keyframes toast-in {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   玩法组件
   ============================================================ */

.stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 50% -100px, rgba(20, 20, 20, 0.035), transparent),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* --- 九宫格 --- */

.grid9 {
  display: grid;
  grid-template-columns: repeat(3, 104px);
  grid-auto-rows: 104px;
  gap: 10px;
}
.gcell {
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  transition: transform 0.12s, border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.gcell__name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gcell__tag { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.gcell.is-on {
  border-color: var(--brand);
  background: var(--brand-50);
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(14, 122, 95, 0.18);
}
.gcell.is-win {
  border-color: var(--gold);
  background: var(--gold-50);
  transform: scale(1.05);
  box-shadow: 3px 3px 0 var(--ink);
}

.gbtn {
  background: var(--brand);
  color: var(--card);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.12s;
}
.gbtn:hover:not(:disabled) { transform: scale(1.03); }
.gbtn:disabled { filter: grayscale(0.35); opacity: 0.75; cursor: not-allowed; }
.gbtn__main { font-size: 19px; font-weight: 800; letter-spacing: 0.12em; }
.gbtn__sub { font-size: 11px; opacity: 0.85; }

/* --- 大转盘 --- */

.wheelbox { position: relative; width: 320px; height: 320px; }
.wheelbox svg { width: 100%; height: 100%; display: block; }
.wheel-rot { transition: transform 4.2s cubic-bezier(0.12, 0.8, 0.16, 1); }
.wheelbox .wheel-label {
  font-size: 11px;
  font-weight: 700;
  fill: var(--ink);
}
.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--gold);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  z-index: 3;
}
.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 5px solid var(--card);
  background: var(--brand);
  color: var(--card);
  font-family: var(--font);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  z-index: 2;
}
.wheel-hub:disabled { filter: grayscale(0.35); opacity: 0.75; cursor: not-allowed; }
.wheel-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid var(--brand-50);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  pointer-events: none;
}

/* --- 盲盒 --- */

.boxgrid { display: grid; grid-template-columns: repeat(3, 128px); gap: 14px; }
.bcard { perspective: 800px; height: 128px; cursor: pointer; }
.bcard.is-disabled { cursor: not-allowed; }
.bcard__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.bcard.is-flip .bcard__inner { transform: rotateY(180deg); }
.bcard__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 10px;
}
.bcard__front {
  background:
    repeating-linear-gradient(-45deg, transparent 0 8px, rgba(20, 20, 20, 0.04) 8px 16px),
    var(--card);
}
.bcard__front .qm {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand);
  font-weight: 800;
  font-size: 18px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
}
.bcard__front .no { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.bcard__back {
  transform: rotateY(180deg);
  background: var(--gold-50);
  border-color: var(--gold-100);
}
.bcard__back.is-miss { background: var(--paper); border-color: var(--line); }
.bcard__back .bname {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gold-deep);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bcard__back.is-miss .bname { color: var(--muted); }
.bcard__back .bsub { font-size: 11px; color: var(--faint); font-family: var(--mono); }

/* ---------------- 奖品一览（图例） ---------------- */

.legend { width: 100%; max-width: 520px; }
.legend h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.legrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.legrow:last-child { border-bottom: none; }
.legrow .dot { width: 8px; height: 8px; border-radius: 3px; background: var(--brand-100); flex: none; }
.legrow .lname { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legrow .lmeta { margin-left: auto; color: var(--faint); font-size: 12px; font-family: var(--mono); white-space: nowrap; }
.legrow .lbar { height: 4px; border-radius: 2px; background: var(--line); width: 72px; flex: none; overflow: hidden; }
.legrow .lbar i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.legrow .limg { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; flex: none; background: var(--brand-50); border: 1px solid var(--line); }

/* ---------------- 中奖名单 ---------------- */

.winlist { display: flex; flex-direction: column; max-height: 320px; overflow: auto; }
.winrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.winrow:last-child { border-bottom: none; }
.winrow .wname { font-weight: 600; }
.winrow .wprize { color: var(--gold-deep); }
.winrow .wtime { margin-left: auto; color: var(--faint); font-size: 12px; font-family: var(--mono); white-space: nowrap; }

/* 头像：QQ 头像 + 用户名首字兜底（app.js avatarHTML 渲染 .avatar > img + .avatar__fb） */
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar__fb { line-height: 1; }
.winrow__avatar { width: 30px; height: 30px; }
.celluser { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.celluser > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celluser__avatar { width: 26px; height: 26px; font-size: 12px; }

/* ---------------- 倒计时 ---------------- */

.countdown {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.countdown small { font-size: 15px; color: var(--faint); font-weight: 400; margin: 0 3px; }
.countdown.is-done { color: var(--brand); }

/* ---------------- 空状态 ---------------- */

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty .ico { font-size: 34px; margin-bottom: 8px; }
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 13px; }
.empty .btn { margin-top: 16px; }

/* ---------------- 首页 ---------------- */

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0 44px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
  background: linear-gradient(transparent 68%, var(--brand-100) 68%);
}
.hero .sub { color: var(--muted); font-size: 15.5px; margin-top: 16px; max-width: 34em; }
.hero__cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

.hero__card { padding: 22px; }
.hero__card h3 { font-size: 15px; margin-bottom: 14px; }
.mystats { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.mystats > div { flex: 1; padding: 12px 8px; text-align: center; }
.mystats > div + div { border-left: 1px solid var(--line); }
.mystats .v { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.mystats .k { font-size: 12px; color: var(--muted); }

.featrow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.feat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
}
.feat .fico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-bottom: 10px;
}
.feat h3 { font-size: 14px; margin-bottom: 4px; }
.feat p { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------------- 分享卡 ---------------- */

.shareline {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px 8px 12px;
}
.shareline .url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 杂项 ---------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
.chip b { color: var(--ink); font-family: var(--mono); }

.divider { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }

.loading {
  padding: 60px 0;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.2em;
}

.overlay--light {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--light-veil);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.15em;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 20px; }
  .hero h1 { font-size: 30px; }
  .featrow { grid-template-columns: repeat(2, 1fr); }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav__inner { padding: 0 12px; gap: 10px; height: 54px; }
  .nav__links { gap: 0; margin-left: 0; }
  .nav__links a { padding: 6px 8px; font-size: 13.5px; }
  .nav__user { gap: 6px; }
  .userchip { font-size: 12.5px; }
  .userchip b { display: none; } /* 小屏只留头像，防止顶栏挤爆 */
  .userchip__avatar { width: 26px; height: 26px; }
  .wrap { padding: 20px 14px 64px; }
  .pagehead { margin-bottom: 20px; }
  .pagehead h1 { font-size: 22px; }
  .hero h1 { font-size: 26px; }
  .hero .sub { font-size: 14.5px; }
  .mystats { margin-bottom: 12px; }
  .mystats .v { font-size: 17px; }
  .featrow { grid-template-columns: 1fr; }
  .statgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px 14px 11px; }
  .stat__value { font-size: 22px; }
  .formgrid { grid-template-columns: 1fr; }
  .pickrow, .pickrow--2 { grid-template-columns: 1fr; }
  .grid9 { grid-template-columns: repeat(3, minmax(76px, 88px)); grid-auto-rows: minmax(76px, 88px); gap: 7px; }
  .boxgrid { grid-template-columns: repeat(2, minmax(110px, 128px)); gap: 10px; }
  .stage { padding: 20px 12px; }
  .wheelbox { width: min(320px, calc(100vw - 76px)); height: auto; aspect-ratio: 1; }
  .wheel-hub { width: 74px; height: 74px; font-size: 14px; letter-spacing: 0.06em; }
  .countdown { font-size: 32px; }
  .legend { max-width: 100%; }
  .table { font-size: 13px; }
  .table th { padding: 9px 8px; }
  .table td { padding: 10px 8px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 表格窄屏卡片化（配合 app.js 自动标注的 data-th 表头标签），不再横向溢出 */
  .table--fix { display: block; border: none; }
  .table--fix thead { display: none; }
  .table--fix tbody, .table--fix tr { display: block; }
  .table--fix tr { padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
  .table--fix tr:last-child { border-bottom: none; }
  .table--fix td { display: flex; align-items: baseline; gap: 10px; padding: 7px 8px; border-bottom: 1px dashed var(--line); }
  .table--fix td:last-child { border-bottom: none; }
  .table--fix td:not([data-th=''])::before {
    content: attr(data-th);
    flex: none;
    min-width: 4.5em;
    font-size: 12px;
    color: var(--faint);
  }
  .table--fix td.actions { justify-content: flex-end; }
  .table--fix td.actions::before { margin-right: auto; }
  .tabs { overflow-x: auto; }
  /* 票根小屏竖排 */
  .ticket { flex-direction: column; }
  .ticket__stub {
    flex-direction: row;
    flex-basis: auto;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1.5px dashed var(--brand-100);
  }
  .ticket__stub .ticket__brand { margin-top: 0; margin-left: auto; font-size: 10.5px; letter-spacing: 0.12em; white-space: nowrap; }
  .winrow { flex-wrap: wrap; row-gap: 2px; }
  .winrow__avatar { width: 26px; height: 26px; }
  .celluser__avatar { width: 24px; height: 24px; font-size: 11px; }
  .ticket::before, .ticket::after { display: none; }
  .ticket__main { padding: 16px; }
  .result-name { font-size: 18px; }
  .modal__body { padding: 20px 16px; }
  .modal__foot { padding: 12px 16px; flex-wrap: wrap; }
  .modal__foot .btn { flex: 1; }
  .overlay { padding: 14px; place-items: start center; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .toastbox { top: 64px; max-width: calc(100vw - 28px); }
  .toast { max-width: 100%; white-space: normal; text-align: center; line-height: 1.5; padding: 9px 16px; }
  /* 输入 16px：避免 iOS 聚焦自动放大页面 */
  .input, .select, .textarea { font-size: 16px; }
  .btn { -webkit-tap-highlight-color: transparent; }
  .foot { padding: 18px 14px; }
}

/* 极窄屏：导航两行化——第一行品牌+用户区，第二行链接，杜绝链接被压成竖排 */
@media (max-width: 430px) {
  .nav__inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; }
  .nav__links { order: 3; flex: 1 1 100%; margin-left: -8px; }
  .nav__links a { padding: 5px 8px; }
}

@media (max-width: 400px) {
  .nav__inner { gap: 8px; }
  .brand { gap: 8px; font-size: 15px; }
  .brand__mark { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
  .nav__links a { padding: 6px 6px; font-size: 13px; }
  .hero h1 { font-size: 23px; }
  .hero__cta .btn { flex: 1; }
  .grid9 { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; gap: 6px; }
  .gcell { aspect-ratio: 1; }
  .gcell__name { font-size: 12px; }
  .boxgrid { grid-template-columns: repeat(2, 1fr); }
  .bcard { height: auto; }
  .bcard__face { aspect-ratio: 1; }
  .bcard__back .bname { font-size: 12px; }
  .mystats .v { font-size: 15px; }
  .countdown { font-size: 27px; }
}

/* ---------------- 创建模式分段按钮（简易 / 高级） ---------------- */

.levelseg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.levelseg__btn {
  appearance: none;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.levelseg__btn:hover { color: var(--ink); }
.levelseg__btn.is-on {
  background: var(--card);
  color: var(--brand);
  box-shadow: var(--shadow-1);
}
.levelseg__btn small { margin-left: 4px; font-size: 11.5px; font-weight: 400; color: var(--faint); }
.levelseg__btn.is-on small { color: var(--brand); }

/* 简易模式：隐藏玩法形式 / 高级设置 / 中奖权重等进阶项 */
#createForm[data-level='simple'] .adv-only { display: none !important; }

/* ---------------- 动效克制 ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- SVG 图标 ---------------- */

.ico-svg {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ============================================================
   暗色主题 —— [data-theme="dark"]
   仅覆盖环境层与色板 token，所有结构样式复用亮色定义
   ============================================================ */

[data-theme="dark"] {
  color-scheme: dark;

  --paper: #101010;
  --card: #181818;
  --ink: #f0f0ee;
  --muted: #a3a3a0;
  --faint: #6f6f6c;
  --line: #2a2a28;
  --line-strong: #3a3a38;

  --brand: #f0f0ee;
  --brand-600: #ffffff;
  --brand-100: #2c2c2a;
  --brand-50: #202020;
  --brand-hi: #d5d5d2;

  --gold: #f0f0ee;
  --gold-deep: #ffffff;
  --gold-50: #202020;
  --gold-100: #2e2e2c;

  --danger: #f0f0ee;
  --danger-50: #181818;
  --danger-soft: #242422;
  --danger-line: #f0f0ee;

  --nav-bg: rgba(16, 16, 16, 0.9);
  --body-top: #101010;
  --row-hover: #1e1e1c;
  --overlay-bg: rgba(0, 0, 0, 0.68);
  --light-veil: rgba(16, 16, 16, 0.72);
  --stage-veil: rgba(16, 16, 16, 0.72);

  --wl-a: #222220;
  --wl-b: #181816;
  --wl-pot: #2e2e2c;
  --wl-line: #3a3a38;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.5);
  --shadow-2: 0 10px 28px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 18px 44px rgba(0, 0, 0, 0.6);
  --shadow-hard: 4px 4px 0 rgba(240, 240, 238, 0.18);
}

/* 票根存根的斜纹底（灰阶斜纹） */
[data-theme="dark"] .ticket__stub {
  background:
    repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255, 255, 255, 0.045) 6px 12px),
    var(--brand-50);
}

/* 暗色下游戏按钮硬面阴影 */
[data-theme="dark"] .gbtn,
[data-theme="dark"] .wheel-hub {
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   奖池背景图
   ============================================================ */

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.stage-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--stage-veil);
}
.stage > *:not(.stage-bg) {
  position: relative;
  z-index: 1;
}

/* 背景图上传控件（创建页） */
.bgup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bgup__thumb {
  width: 84px;
  height: 56px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  object-fit: cover;
  display: none;
  background: var(--paper);
}
.bgup__thumb.is-show { display: block; }

/* ---------------- 图片参考：奖品配图 / 说明配图 ---------------- */

/* 创建页：奖品行配图按钮（46×46 虚线框，选图后显示缩略图 + 右上角移除） */
.p-imgbtn {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1.5px dashed var(--line);
  background: var(--paper);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  color: var(--faint);
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}
.p-imgbtn:hover { border-color: var(--brand); color: var(--brand); }
.p-imgbtn.is-busy { opacity: 0.55; pointer-events: none; }
.p-imgbtn__plus { display: grid; place-items: center; }
.p-imgbtn__plus .ico-svg { width: 18px; height: 18px; }
.p-imgbtn .p-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-imgbtn__del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

/* 创建页：说明配图（最多 3 张，缩略图点击看原图，× 移除） */
.descup { margin-top: 8px; }
.descup__list { display: flex; gap: 8px; flex-wrap: wrap; }
.descup__item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 18px;
  cursor: pointer;
  background: var(--paper);
}
.descup__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.descup__item.is-busy { opacity: 0.55; }
.descup__del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.descup__add {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--brand);
  background: none;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.descup__add:hover { border-color: var(--brand); }

/* 参与页：详情区说明配图（点击新窗口查看原图） */
.descimgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.descimgs__item {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  background: var(--paper);
}

/* 九宫格：奖品配图为主视觉 */
.gcell__img {
  width: 100%;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 4px;
}

/* 盲盒：翻牌背面奖品图 */
.bcard__img {
  width: 100%;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 6px;
}

/* 结果弹窗：中奖凭证带奖品图 */
.result-img {
  width: 100%;
  max-width: 260px;
  max-height: 170px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 auto 10px;
  display: block;
  border: 1px solid var(--line);
}

@media (max-width: 400px) {
  .descimgs__item { width: 78px; height: 78px; }
  .result-img { max-height: 140px; }
}

/* 报名者头像堆叠(活动页 joinersWrap:头像行 + 参与人数 + 发起者开关) */
.jrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.jstack { display: inline-flex; align-items: center; }
.jstack .jstack__av { width: 26px; height: 26px; font-size: 12px; }
.jstack .jstack__av + .jstack__av { margin-left: -8px; }
.jstack__more { margin-left: 8px; font-size: 12px; color: var(--faint); font-family: var(--mono); }
.jstack__txt { font-size: 13px; color: var(--faint); }
.jstack__txt b { color: var(--text); }

/* 报名者头像弹层(头像网格 + 滚动分页加载,头像图床异步按需加载) */
.jrow__open { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; text-align: left; }
.jmodal__list { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; max-height: 56vh; overflow-y: auto; padding: 4px 2px; overscroll-behavior: contain; }
.jmodal__cell { flex: none; }
.jmodal__av { width: 36px; height: 36px; font-size: 14px; }
.jmodal__hint { margin: 12px 0 0; text-align: center; }

/* 奖品图展示形式:小图标(默认 .limg)/信息条/封面卡片 + 分段选择控件 */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg__btn { appearance: none; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: var(--r-sm); padding: 7px 14px; font-size: 12.5px; font: inherit; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.seg__btn:hover { border-color: var(--brand); color: var(--brand); }
.seg__btn.is-on { background: var(--brand); border-color: var(--brand); color: var(--card); }
.legrow--banner { padding: 10px 4px; }
.legrow--banner .bimg { width: 148px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--brand-50); border: 1px solid var(--line); }
.legrow--banner .lmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.legrow--banner .lname { white-space: normal; }
.legrow--banner .lmeta { margin-left: 0; white-space: normal; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pcard__img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--brand-50); }
.pcard__img--ph { display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--brand); }
.pcard__body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 3px; }
.pcard__name { font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.pcard__meta { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.legrow--banner .lbar { flex: none; width: 100%; }
.pcard__body .lbar { flex: none; width: 100%; }

/* 中奖名单奖品图(跟随展示形式) + 创建页草稿恢复提示条 */
.wimg { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; flex: none; background: var(--brand-50); border: 1px solid var(--line); }
.wimg--banner { width: 72px; height: 30px; border-radius: 8px; }
.wimg--card { width: 48px; height: 48px; border-radius: 10px; }
.draftbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand); font-size: 13px; }
.draftbar svg { width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; }

/* 图片保护:禁止拖拽/选中/长按呼出菜单(防当图床,配合 app.js 的 dragstart/contextmenu 拦截) */
img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

/* 点击放大灯箱(仅带 jz 类的内容图;放大层图片同样受全局禁拖拽/右键/长按约束) */
img.jz { cursor: zoom-in; }
.lbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(8, 10, 16, .84); opacity: 0; pointer-events: none; transition: opacity .18s ease; cursor: zoom-out; }
.lbox.is-on { opacity: 1; pointer-events: auto; }
.lbox__img { max-width: min(92vw, 1080px); max-height: 84vh; width: auto; height: auto; border-radius: 14px; box-shadow: 0 28px 80px rgba(0, 0, 0, .55); cursor: zoom-out; }
.lbox__x { position: absolute; top: 10px; right: 20px; font-size: 34px; line-height: 1; color: #fff; opacity: .8; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); cursor: pointer; }
.lbox__x:hover { opacity: 1; }
body.is-locked { overflow: hidden; }

/* ============================================================
   黑白纸墨 · 版面重塑层（打印排印细节，全部走 token，暗色自适应）
   ============================================================ */

/* 宋体标题：铅字感 */
h1, h2, h3, .brand {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* 选中与焦点：纯墨 */
::selection { background: var(--ink); color: var(--card); }
:focus-visible { outline: 2px solid var(--ink); }

/* 顶栏：墨线封边，当前页以下划线标记 */
.nav { border-bottom: 1px solid var(--ink); }
.nav__links a { border-radius: 4px; }
.nav__links a.is-active {
  background: transparent;
  border-radius: 0;
  box-shadow: inset 0 -2px 0 var(--ink);
}

/* 按钮：平墨直角；危险动作用「裁切虚线」表达 */
.btn { border-radius: var(--r-md); box-shadow: none; }
.btn--primary { background: var(--brand); box-shadow: none; }
.btn--primary:hover:not(:disabled) { background: var(--brand-600); }
.btn--gold { background: var(--gold); }
.btn--danger {
  background: var(--card);
  color: var(--ink);
  border: 1px dashed var(--ink);
}
.btn--danger:hover:not(:disabled) { background: var(--ink); color: var(--card); }

/* 凭证票根：墨框 + 硬投影（印刷贴纸感） */
.ticket { border-color: var(--ink); box-shadow: var(--shadow-hard); }

/* 暗色下九宫格中奖格：软白盖戳 */
[data-theme="dark"] .gcell.is-win { box-shadow: 3px 3px 0 rgba(240, 240, 238, 0.35); }

/* 灯箱遮罩：更纯的黑 */
.lbox { background: rgba(0, 0, 0, 0.88); }
