* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, #ff7e5f, #feb47b);
  color: #333;
  min-height: 100vh;
}
#app { max-width: 480px; margin: 0 auto; padding: 24px 16px 40px; }
.step { display: none; background: #fff; border-radius: 16px; padding: 24px 20px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.step.active { display: block; }
h1 { font-size: 22px; text-align: center; margin: 8px 0 16px; }
h2 { font-size: 18px; text-align: center; margin: 0 0 18px; }
.desc { text-align: center; color: #666; margin: 0 0 8px; }
.lead { font-size: 13px; color: #666; background: #fff7f3; padding: 12px; border-radius: 10px; line-height: 1.6; margin: 0 0 18px; }
.privacy { font-size: 12px; color: #999; margin: 16px 0; line-height: 1.6; }
.btn {
  display: block; width: 100%; padding: 14px; margin-top: 16px;
  background: #ff5a3c; color: #fff; border: none; border-radius: 24px;
  font-size: 16px; font-weight: 600;
}
.btn:active { opacity: .85; }
.btn:disabled { opacity: .6; }

/* 问卷 */
.question { margin-bottom: 18px; }
.q { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.req { color: #ff5a3c; }
.maxhint { font-size: 12px; color: #999; font-weight: 400; }
.opt { display: flex; align-items: flex-start; padding: 7px 0; font-size: 14px; line-height: 1.4; }
.opt input { margin: 3px 8px 0 0; flex: none; }
.err { color: #e74c3c; font-size: 12px; min-height: 14px; margin-top: 2px; }
.text-input {
  width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 10px;
  font-size: 14px; margin-top: 8px;
}
.q-hidden { display: none !important; }
.skip-note {
  font-size: 13px; color: #ff5a3c; background: #fff3ec;
  border: 1px dashed #ffb59e; padding: 10px 12px; border-radius: 10px;
  margin: 14px 0 0; line-height: 1.5;
}

/* 九宫格 */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px;
}
.cell {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 13px; padding: 6px; line-height: 1.3;
  background: #fff3ec; border: 2px solid #ffd5c2; border-radius: 12px; color: #c0392b;
  overflow: hidden;
}
/* 长奖名两行裁剪，避免溢出边框；老微信内核不支持 aspect-ratio 时也能靠 JS 兜底成方形 */
.cell span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.cell.hl { background: #ff5a3c; color: #fff; border-color: #ff5a3c; transform: scale(1.04); transition: transform .08s; }
.cell.center {
  background: #ff5a3c; color: #fff; font-size: 20px; font-weight: 700; cursor: pointer;
  border: none;
}
.cell.center span { -webkit-line-clamp: 1; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-box { background: #fff; width: 80%; max-width: 320px; border-radius: 16px; padding: 24px; text-align: center; }
#modal-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
#modal-body p { font-size: 16px; margin: 6px 0; }
.code-box { margin: 16px 0; padding: 14px; background: #fff3ec; border-radius: 12px; }
.code-label { font-size: 12px; color: #999; }
.code { font-size: 28px; font-weight: 800; letter-spacing: 4px; color: #ff5a3c; margin-top: 4px; }
.tip { font-size: 13px; color: #888; margin-top: 10px; }
