/* Mooree小站的达标专享活动 —— 样式表 */

:root {
  --red-deep: #8b0f21;
  --red-main: #c8102e;
  --red-light: #e63a52;
  --gold: #f5c542;
  --gold-deep: #d9a017;
  --gold-light: #ffe9a8;
  --ink: #2b1a1d;
  --ink-soft: #6b5a5d;
  --line: #ecdfd4;
  --bg-card: #fffdf9;
  --shadow-card: 0 12px 32px rgba(120, 20, 30, 0.18);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 50% 0%, #b3132c 0%, #8b0f21 45%, #5c0916 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; /* 防止 iOS 聚焦输入框时页面自动放大 */
}

/* 背景装饰光斑 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(245, 197, 66, 0.18), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(245, 197, 66, 0.12), transparent 46%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ===== 顶部标题 ===== */
.hd {
  text-align: center;
  color: var(--gold-light);
  margin-bottom: 16px;
}

.hd .bank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 3px;
  padding: 4px 14px;
  border: 1px solid rgba(245, 197, 66, 0.5);
  border-radius: 999px;
  margin-bottom: 12px;
}

.hd h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.hd h1 em {
  font-style: normal;
  color: var(--gold);
}

.hd p {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(255, 233, 168, 0.75);
  letter-spacing: 1px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 18px;
}

/* ===== 转盘 ===== */
.wheel-box {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 6px auto 0;
}

.wheel-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--gold-light), var(--gold), #fff8dc, var(--gold), var(--gold-light));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32), inset 0 0 0 3px rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(139, 15, 33, 0.18);
}

#wheel {
  border-radius: 50%;
  display: block;
  transition: transform 4.2s cubic-bezier(0.15, 0.75, 0.08, 1);
  will-change: transform;
}

/* 指针 */
.pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 46px;
  z-index: 5;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

/* 中心开始按钮 */
.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(160deg, var(--gold-light), var(--gold) 45%, var(--gold-deep));
  color: var(--red-deep);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transition: transform 0.15s ease;
}

.spin-btn:active {
  transform: translate(-50%, -50%) scale(0.94);
}

.spin-btn[disabled] {
  background: linear-gradient(160deg, #d8d8d8, #b4b4b4);
  color: #777;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== 信息条 ===== */
.tip {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff6e0, #fffdf6);
  border: 1px solid #f2dfae;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8a6a2a;
}

.tip b {
  color: var(--red-main);
}

.foot {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  color: rgba(255, 233, 168, 0.55);
  line-height: 1.8;
}
.foot a {
  color: rgba(255, 233, 168, 0.85);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.foot a:hover { color: #ffe9a8; }
.foot .sep { margin: 0 8px; color: rgba(255, 233, 168, 0.4); }
.foot .beian-ico {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  margin-right: 3px;
}

/* ===== 弹窗 ===== */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(40, 6, 12, 0.62);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.mask.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 400px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px 20px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.mask.show .modal {
  transform: translateY(0) scale(1);
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 19px;
  text-align: center;
  color: var(--red-deep);
}

.modal .sub {
  margin: 0 0 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ===== 表单 ===== */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.field label i {
  color: var(--red-main);
  font-style: normal;
  margin-right: 3px;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus {
  border-color: var(--red-main);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.field input::placeholder {
  color: #bdb0ac;
}

.field .err {
  display: none;
  margin-top: 5px;
  font-size: 12px;
  color: var(--red-main);
}

.field.invalid input {
  border-color: var(--red-main);
  background: #fff6f7;
}

.field.invalid .err {
  display: block;
}

/* 由分享链接带入并锁定的字段 */
.field input.locked {
  background: #f4f0ec;
  color: #7a6a66;
  cursor: default;
}

.field input.locked:focus {
  border-color: var(--line);
  box-shadow: none;
}

.ref-hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: #8a7b76;
  line-height: 1.6;
}

.ref-hint a {
  color: var(--red-main);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

/* ===== 按钮 ===== */
.btn {
  display: block;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.985);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-light), var(--red-main) 55%, var(--red-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 16, 46, 0.28);
}

.btn-ghost {
  margin-top: 10px;
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 50%, var(--gold-deep));
  color: var(--red-deep);
  box-shadow: 0 6px 16px rgba(217, 160, 23, 0.32);
}

/* ===== 中奖结果 ===== */
.result-icon {
  width: 76px;
  height: 76px;
  margin: 2px auto 12px;
  display: block;
}

.result-title {
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 2px;
}

.result-amount {
  text-align: center;
  font-size: 44px;
  font-weight: 800;
  color: var(--red-main);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -1px;
}

.result-amount small {
  font-size: 20px;
  font-weight: 700;
  margin-right: 2px;
}

.result-amount.none {
  font-size: 26px;
  color: var(--ink-soft);
  letter-spacing: 2px;
}

.result-name {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-deep);
  margin: 4px 0 14px;
}

/* 领奖核销码 */
.verify-box {
  background: #fff8e8;
  border: 1px solid #e8d3a8;
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin: 0 0 16px;
  text-align: center;
}

.verify-label {
  font-size: 11.5px;
  color: #8a6a2a;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.verify-code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--red-main);
  text-indent: 8px; /* 抵消末位字距，保证视觉居中 */
  line-height: 1.2;
  margin-bottom: 6px;
}

.verify-tip {
  font-size: 11.5px;
  color: #8a6a2a;
  line-height: 1.6;
}

.result-info {
  background: #fdf6ec;
  border: 1px dashed #e8d3a8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.9;
  color: #8a6a2a;
  margin-bottom: 16px;
}

.result-info span {
  color: var(--ink);
  font-weight: 600;
}

.result-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 12px 0 0;
  line-height: 1.7;
}

/* 撒花 */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(105vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%) translateY(12px);
  max-width: 84vw;
  padding: 11px 20px;
  background: rgba(30, 8, 12, 0.92);
  color: #fff;
  font-size: 13.5px;
  border-radius: 999px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  text-align: center;
}

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

/* ===== 加载遮罩 ===== */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(30, 8, 12, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 400;
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

.loading.show {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== 演示模式提示 ===== */
.demo-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 500;
  padding: 6px 12px;
  background: #ff9800;
  color: #fff;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.5px;
}

.demo-bar + .wrap {
  margin-top: 26px;
}

/* ===== 管理后台 ===== */
body.admin {
  background: #f4f1ec;
  color: #2b1a1d;
}

body.admin::before {
  display: none;
}

.admin .wrap {
  max-width: 1080px;
}

.admin .hd {
  color: var(--red-deep);
}

.admin .hd h1 {
  color: var(--red-deep);
  text-shadow: none;
  font-size: 22px;
}

.admin .hd p {
  color: var(--ink-soft);
}

.panel {
  background: #fff;
  border: 1px solid #e8e1d8;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--red-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  background: linear-gradient(160deg, #fff8ec, #fff);
  border: 1px solid #f0e4cd;
  border-radius: 12px;
  padding: 14px;
}

.stat .k {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.stat .v {
  font-size: 24px;
  font-weight: 800;
  color: var(--red-main);
  line-height: 1.2;
}

.stat .v small {
  font-size: 13px;
  font-weight: 600;
  margin-left: 2px;
}

.stat.ok .v {
  color: #1f9254;
}

.stat.warn .v {
  color: #d97706;
}

/* 表格 */
.table-scroll {
  overflow: auto;
  max-height: 62vh;
  border: 1px solid #ece4d9;
  border-radius: 10px;
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

table.grid th,
table.grid td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1ebE2;
}

table.grid th {
  position: sticky;
  top: 0;
  background: #fbf7f1;
  font-weight: 700;
  color: #6b5a5d;
  z-index: 1;
}

table.grid tbody tr:hover {
  background: #fffaf2;
}

table.grid td.idx {
  color: #a89a96;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag.first {
  background: #fde8ec;
  color: #c8102e;
}

.tag.second {
  background: #fff4d6;
  color: #b07d0a;
}

.tag.third {
  background: #fdeee2;
  color: #c2622a;
}

.tag.none {
  background: #f0f0f0;
  color: #888;
}

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

.btn-row .btn {
  width: auto;
  min-width: 120px;
  height: 42px;
  font-size: 14px;
  padding: 0 18px;
  margin-top: 0;
}

.btn-sm {
  height: 34px !important;
  min-width: auto !important;
  padding: 0 12px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

.btn-danger {
  background: #fff;
  color: #c8102e;
  border: 1.5px solid #f3c9d1;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: #a89a96;
  font-size: 13.5px;
}

/* 配额编辑 */
.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quota-item {
  border: 1px solid #ece4d9;
  border-radius: 12px;
  padding: 14px;
}

.quota-item .qn {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.quota-item .qa {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.quota-item input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.quota-item input:focus {
  border-color: var(--red-main);
}

.bar {
  height: 8px;
  background: #f0e8dc;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--red-main));
  border-radius: 999px;
  transition: width 0.4s;
}

.bar-txt {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* 登录 */
.login-box {
  max-width: 380px;
  margin: 8vh auto 0;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.8;
  background: #fbf7f1;
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 16px;
}

.hint code {
  background: #f0e8dc;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}

@media (max-width: 360px) {
  .wheel-box {
    width: 264px;
    height: 264px;
  }
  .hd h1 {
    font-size: 22px;
  }
}
