/* ============================================================
   胖达校园 · 开学抽奖
   配色取自品牌海报：天蓝 #C9F4FF / 嫩绿 #E4F7CF / 品牌绿 #159847
   页面按手机设计，480 封顶，桌面居中
   ============================================================ */

:root {
  --g900: #073f25;
  --g800: #08713a;
  --g700: #159847;
  --g600: #1fae55;
  --g100: #e7f6df;
  --g50: #f7fbf4;
  --leaf: #a6d98a;
  --sky: #c9f4ff;
  --ink: #174c30;
  --ink-60: #587563;
  --ink-40: #93a29a;
  --line: #e4efe4;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: #e9f1e4;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--g700);
  outline-offset: 3px;
}

.view--wheel :focus-visible,
.footer :focus-visible,
.dev :focus-visible {
  outline-color: var(--leaf);
}

.page {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.noscript {
  margin: 0;
  padding: 18px;
  background: var(--g700);
  color: #fff;
  text-align: center;
}

/* ---------------------------------------------------------- 首屏 */

.view--home {
  background: #f1f9ec;
}

.hero {
  line-height: 0;
  background: #cfeffd;
}

.hero__img {
  display: block;
  width: 100%;
  height: auto;
}

/* 分享有礼 绿色横幅 */

.promo {
  position: relative;
  z-index: 2;
  margin: -10px 12px 0;
  padding: 13px 14px 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, #3fac54 0%, #237f3a 100%);
  box-shadow: 0 12px 26px rgba(20, 90, 44, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.22);
  color: #fff;
}

.promo__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.promo__gift {
  flex: none;
  font-size: 24px;
  line-height: 1;
  transform: rotate(-8deg);
}

.promo__title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: clamp(28px, 8.2vw, 36px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 0 rgba(10, 70, 30, 0.25);
}

.promo__badge {
  flex: none;
  padding: 6px 10px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffe88f 0%, #f0c04a 100%);
  color: #6f4706;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transform: rotate(5deg);
  box-shadow: 0 3px 0 rgba(120, 80, 10, 0.22);
}

.promo__sub {
  margin: 9px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------------------------------------------------------- 手机号卡片 */

.entry {
  position: relative;
  z-index: 3;
  margin-top: 14px;
  padding: 0 14px;
}

.card--entry {
  background: #fff;
  border-radius: 22px;
  padding: 18px 16px 15px;
  box-shadow: 0 10px 26px rgba(31, 110, 60, 0.1);
}

.entry__title {
  margin: 0 0 14px;
  text-align: center;
  font-size: 16.5px;
  font-weight: 800;
  color: #1f6b2e;
}

.entry__title span {
  margin-right: 2px;
}

.entry__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-40);
}

.entry__field {
  position: relative;
}

.entry__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0.55;
  pointer-events: none;
}

.entry__input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 42px;
  border: 1.5px solid #e3ead9;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  letter-spacing: 0.02em;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.entry__input::placeholder {
  color: #a9b5ab;
  font-size: 15px;
  letter-spacing: 0;
}

.entry__input:focus {
  border-color: var(--g700);
  box-shadow: 0 0 0 4px rgba(21, 152, 71, 0.1);
  outline: none;
}

.entry__hint {
  margin: 9px 0 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-40);
}

.form__error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fdf2f0;
  color: #b3261e;
  font-size: 13px;
  line-height: 1.6;
}

.entry__back {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-60);
  text-align: center;
}

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--g700);
}

/* ---------------------------------------------------------- 区块 */

.section {
  padding: 22px 14px 6px;
}

.section--rules {
  padding: 18px 14px 26px;
}

.sec-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1f6b2e;
}

.sec-title span {
  margin-right: 2px;
}

/* 奖品 */

.prize-list {
  list-style: none;
  margin: 0;
  padding: 2px 12px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(31, 110, 60, 0.08);
}

.prize {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #eef4e9;
}

.prize:last-child {
  border-bottom: 0;
}

.prize__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.prize__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: #244936;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prize__meta {
  font-size: 11.5px;
  color: #93a29a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prize__left {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e9f7e0;
  color: #2f8f4a;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.prize__left small {
  font-size: 10px;
  font-weight: 400;
  margin-left: 1px;
}

/* 规则卡片 */

.rules-card {
  background: #eef8e5;
  border-radius: 20px;
  padding: 16px 16px 14px;
}

.rules-card__title {
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 800;
  color: #1f6b2e;
}

.rules-card__title span {
  margin-right: 2px;
}

.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.rules li {
  counter-increment: rule;
  position: relative;
  padding-left: 30px;
  margin-bottom: 9px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #4b6b52;
}

.rules li:last-child {
  margin-bottom: 0;
}

.rules li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2f9d47;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.rules-card__note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #7d9484;
}

/* 页脚 */

.footer {
  background: #1f7f38;
  color: #fff;
  padding: 18px 16px 20px;
  text-align: center;
}

.footer__name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.footer__name::before {
  content: "—— ";
}

.footer__name::after {
  content: " ——";
}

.footer__meta {
  margin: 7px 0 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
}

.devlink {
  margin-top: 10px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.34);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.devlink:hover {
  color: rgba(255, 255, 255, 0.65);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  height: 52px;
  font-family: var(--font);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.18s ease, transform 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, #159847 0%, #08713a 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(8, 113, 58, 0.22);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--block {
  width: 100%;
}

.btn--link {
  background: none;
  border: 0;
  height: auto;
  padding: 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-40);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------------------------------------------------------- 转盘页 */

.view--wheel {
  min-height: 100vh;
  background: var(--g800);
  color: #fff;
}

.wheelpage {
  min-height: 100vh;
  padding: 18px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheelpage__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
}

.wheelpage__back {
  background: none;
  border: 0;
  padding: 2px 4px;
  font-size: 17px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.wheelpage__back:hover {
  color: #fff;
}

.wheelpage__name {
  letter-spacing: 0.04em;
  flex: 1;
}

.wheelpage__chances {
  color: var(--leaf);
  font-variant-numeric: tabular-nums;
}

.wheelstage {
  position: relative;
  width: min(84vw, 340px);
  aspect-ratio: 1;
  margin-top: auto;
  flex-shrink: 0;
}

.wheelstage__canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.wheelstage__pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 26px solid #ffffff;
}

.spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: var(--g700);
  color: #fff;
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.14s ease, background-color 0.18s ease;
}

.spin:hover:not([disabled]) {
  background: var(--g600);
}

.spin:active:not([disabled]) {
  transform: scale(0.97);
}

.spin[disabled] {
  cursor: not-allowed;
  opacity: 0.85;
}

.wheelpage__note {
  margin: 26px 0 auto;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  min-height: 1.6em;
}

.mine {
  width: 100%;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.mine__title {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.mine__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mine__list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  font-size: 14px;
}

.mine__list .code {
  font-variant-numeric: tabular-nums;
  color: var(--leaf);
  letter-spacing: 0.06em;
}

.wheelpage__foot {
  margin: 28px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ---------------------------------------------------------- 弹层 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 32, 15, 0.72);
  animation: fade 0.22s ease both;
}

.modal__card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  color: var(--ink);
  border-radius: 22px;
  padding: 32px 24px 22px;
  text-align: center;
  animation: rise 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal__card--form {
  padding: 26px 22px 16px;
  text-align: left;
}

.modal__kicker {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--g700);
}

.modal__card--form .modal__kicker {
  text-align: left;
}

.modal__title {
  margin: 8px 0 0;
  font-size: clamp(26px, 7.4vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--g800);
}

.modal__title--sm {
  font-size: 20px;
  margin-bottom: 16px;
}

.modal__code {
  margin: 18px 0 0;
  padding: 12px;
  border-radius: 14px;
  background: var(--g100);
  color: var(--g800);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.modal__code:empty {
  display: none;
}

.modal__text {
  margin: 16px 0 22px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-60);
}

.modal__card--form .field__input {
  margin-bottom: 12px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---------------------------------------------------------- 开发者面板 */

.dev {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #f2f6ef;
  display: flex;
  flex-direction: column;
}

.dev__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--g800);
  color: #fff;
}

.dev__title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dev__done {
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.dev__done:hover {
  background: rgba(255, 255, 255, 0.26);
}

.dev__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 48px;
}

.dev__inner {
  max-width: 560px;
  margin: 0 auto;
}

.devstats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.devstat {
  background: #fff;
  border: 1px solid #e4ecdf;
  border-radius: 10px;
  padding: 8px 10px;
}

.devstat b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.devstat span {
  font-size: 11px;
  color: var(--ink-40);
}

.devcard {
  background: #fff;
  border: 1px solid #e4ecdf;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.devsection {
  margin: 8px 2px 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--g900);
}

.devcard__title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--g900);
}

.devcard__hint {
  margin: -4px 0 10px;
  font-size: 11.5px;
  color: var(--ink-40);
}

.dgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.dgrid.dgrid--1-2 {
  grid-template-columns: 2fr 1fr;
}

.dgrid.dgrid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dfield span {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--ink-40);
}

.dinput {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #dfe9d9;
  border-radius: 8px;
  background: #fbfdf9;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
}

.dinput:focus {
  border-color: var(--g700);
  outline: none;
}

textarea.dinput {
  height: auto;
  min-height: 68px;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}

.drow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.dbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
}

.dbtn--primary {
  background: var(--g800);
  color: #fff;
}

.dbtn--primary:hover {
  background: var(--g700);
}

.dbtn--ghost {
  border-color: #dfe9d9;
  color: var(--ink-60);
}

.dbtn--ghost:hover {
  border-color: #b9cfae;
  color: var(--ink);
}

.dbtn--danger {
  border-color: #eccfca;
  color: #b3261e;
  background: transparent;
}

.dbtn--danger:hover {
  background: #fdf3f1;
}

.dbtn--danger.is-armed {
  background: #b3261e;
  border-color: #b3261e;
  color: #fff;
}

.dcheck {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-60);
}

.dcheck input {
  width: 16px;
  height: 16px;
  accent-color: var(--g700);
}

.dodds {
  font-size: 11.5px;
  color: var(--g700);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* 统计卡（可点） */

.devstat--link {
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.devstat--link:hover,
.devstat--link:focus-visible {
  border-color: var(--g700);
  background: #fbfdf9;
}

.devstat__more {
  position: absolute;
  right: 8px;
  top: 6px;
  font-style: normal;
  font-size: 10.5px;
  color: var(--g700);
  opacity: 0.75;
}

/* 参与名单 */

.dev--top {
  z-index: 95;
}

.dev__back {
  background: none;
  border: 0;
  padding: 2px 4px;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.dev__back:hover {
  opacity: 1;
}

.dev__head .dev__title {
  flex: 1;
}

.dev__count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
}

.elist {
  margin-top: 10px;
  background: #fff;
  border: 1px solid #e4ecdf;
  border-radius: 12px;
  overflow: hidden;
}

.elist .empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-40);
  font-size: 13px;
}

.erow {
  padding: 11px 12px;
  border-bottom: 1px solid #eff4ec;
}

.erow:last-child {
  border-bottom: 0;
}

.erow__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.erow__phone {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.erow__time {
  font-size: 11.5px;
  color: var(--ink-40);
  font-variant-numeric: tabular-nums;
}

.erow__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-60);
}

.erow__win {
  color: var(--g700);
  font-weight: 600;
}

.erow__none {
  color: var(--ink-40);
}

/* ---------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 100;
  transform: translateX(-50%);
  max-width: calc(100vw - 40px);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(8, 61, 27, 0.94);
  color: #fff;
  font-size: 13.5px;
  text-align: center;
  animation: rise 0.28s ease both;
}

/* ---------------------------------------------------------- 动效 */

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal__card,
  .toast {
    animation: none;
  }
}

/* ---------------------------------------------------------- 小屏 */

@media (max-width: 360px) {
  .hero {
    padding: 16px 16px 70px;
  }

  .hero__title {
    font-size: 40px;
  }

  .hero__mascot svg {
    width: 112px;
    height: 117px;
  }

  .entry {
    padding: 0 12px;
  }

  .section {
    padding: 26px 14px 22px;
  }

  .spin {
    width: 76px;
    height: 76px;
    font-size: 17px;
  }

  .devstats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
