/* ============================================================
   开学季抽奖活动 - 页面样式
   ============================================================ */

:root {
  --color-bg-start: #2b1055;
  --color-bg-end: #7597de;
  --color-primary: #ff6b35;
  --color-primary-dark: #e5531f;
  --color-gold: #ffd700;
  --color-card: rgba(255, 255, 255, 0.96);
  --radius-card: 20px;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* 确保 hidden 属性始终生效 */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #333;
  background: linear-gradient(160deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
  background-attachment: fixed;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

/* ---------------- 顶部海报宣传栏（竖版 3:4，居中放大） ---------------- */
.poster {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #ddd;
}

.poster__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------------- 转盘区域（去留白：无卡片背景） ---------------- */
.wheel-section {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.wheel-section__title {
  margin: 0;
  font-size: 24px;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.wheel-section__hint {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------------- 中间公告栏（管理员可编辑，无文字时不显示） ---------------- */
.announcement {
  max-width: 560px;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: #ffe29a;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 18px;
}

.wheel {
  display: flex;
  justify-content: center;
}

/* 转盘画布 + 指针 */
.wheel__canvas-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  padding-top: 22px; /* 给顶部指针留出空间 */
}

.wheel__canvas-wrap canvas {
  display: block;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 0 0 6px #f7f1e3;
  transform-origin: center center;
  will-change: transform;
}

.wheel__pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 28px solid #e63946;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
  z-index: 2;
}

.wheel__pointer::after {
  content: "";
  position: absolute;
  top: -28px;
  left: -7px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
}

/* ---------------- 按钮 ---------------- */
.btn {
  min-width: 220px;
  padding: 14px 34px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 22px rgba(255, 107, 53, 0.45);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn--disabled,
.btn:disabled {
  background: linear-gradient(135deg, #b9b9b9 0%, #8f8f8f 100%);
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------------- 兑换码显示区域 ---------------- */
.code-section {
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 22px;
  text-align: center;
}

.code-section__title {
  margin: 0 0 14px;
  font-size: 22px;
  color: #2b1055;
}

.code-section__result {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 18px;
  color: #666;
  border: 2px dashed #dcdcdc;
  border-radius: 14px;
  padding: 16px;
  background: #fafafa;
}

.code-section__prize {
  font-size: 24px;
  font-weight: 700;
  color: #e5531f;
}

.code-section__label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #8a6d1a;
  margin-top: 4px;
}

.code-section__code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #2b1055;
  background: linear-gradient(135deg, #fff6d5, #ffe29a);
  border: 3px solid var(--color-gold);
  border-radius: 12px;
  padding: 10px 26px;
  user-select: all;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.code-section__miss {
  font-size: 24px;
  font-weight: 700;
  color: #999;
}

/* ---------------- 抽奖结果弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal--open {
  visibility: visible;
  opacity: 1;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 380px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 34px 28px 28px;
  text-align: center;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.3s ease;
}

.modal--open .modal__dialog {
  transform: scale(1) translateY(0);
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
}

.modal__close:hover {
  color: #333;
}

.modal__icon {
  font-size: 52px;
}

.modal__title {
  margin: 10px 0 4px;
  font-size: 20px;
  color: #555;
}

.modal__prize {
  font-size: 34px;
  font-weight: 800;
  color: #e5531f;
  margin-bottom: 12px;
}

.modal__code {
  display: inline-block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #2b1055;
  background: linear-gradient(135deg, #fff6d5, #ffe29a);
  border: 2px solid var(--color-gold);
  border-radius: 10px;
  padding: 8px 18px;
  margin-bottom: 14px;
  user-select: all;
}

.modal__code[hidden] {
  display: none;
}

.modal__ok {
  min-width: 140px;
}

body.modal-open {
  overflow: hidden;
}
/* ---------------- 分享解锁 ---------------- */
.btn--unlock {
  min-width: 240px;
  font-size: 17px;
  background: linear-gradient(135deg, #2b1055 0%, #7597de 100%);
}

.btn--unlock:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 22px rgba(43, 16, 85, 0.4);
}

.btn--ghost {
  min-width: 150px;
  font-size: 16px;
  color: #555;
  background: #f2f2f2;
  box-shadow: none;
}

.btn--ghost:hover:not(:disabled) {
  background: #e6e6e6;
}

/* 分享弹窗 */
.modal__dialog--wide {
  width: min(92vw, 430px);
}

.share__tip {
  margin: -4px 0 12px;
  font-size: 14px;
  color: #999;
}

.share__image {
  display: block;
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  margin: 0 auto;
}

.share__error {
  margin: 10px 0 0;
  font-size: 14px;
  color: #e5531f;
}

.share__actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
/* ---------------- 移动端 / 响应式适配 ---------------- */
.wheel__canvas-wrap canvas {
  max-width: calc(100vw - 28px); /* 兜底：极端小屏不溢出 */
}

@media (max-width: 600px) {
  .page {
    padding: 12px 10px 40px;
    gap: 18px;
  }

  .poster {
    border-radius: 14px;
  }

  .wheel-section {
    padding: 18px 12px 22px;
    gap: 12px;
  }

  .wheel-section__title {
    font-size: 20px;
  }

  .wheel__canvas-wrap {
    padding-top: 18px;
  }

  .btn {
    min-width: 0;
    width: 100%;
    max-width: 260px;
    padding: 12px 20px;
    font-size: 17px;
  }

  .btn--unlock {
    font-size: 16px;
  }

  .code-section {
    padding: 16px 12px;
  }

  .code-section__title {
    font-size: 18px;
  }

  .code-section__result {
    font-size: 15px;
    padding: 12px;
  }

  .code-section__prize {
    font-size: 20px;
  }

  .code-section__code {
    font-size: 26px;
    letter-spacing: 3px;
    padding: 8px 16px;
  }

  .code-section__miss {
    font-size: 19px;
  }

  /* 分享弹窗适配 */
  .modal__dialog--wide {
    padding: 24px 16px 20px;
  }

  .share__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .share__actions .btn {
    max-width: none;
  }
}

@media (max-width: 360px) {
  .wheel-section__title {
    font-size: 18px;
  }
  .code-section__code {
    font-size: 22px;
    letter-spacing: 2px;
  }
}






