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

:root {
  /* 配色：中秋金绿 + 宣纸米白 */
  --paper: #f6f0e1;
  --paper-deep: #efe4cd;
  --ink-green: #2f4a3c;
  --ink-green-dark: #1f3a2e;
  --sage: #7a8f82;
  --gold: #c9a24b;
  --gold-dark: #a8822f;
  --gold-light: #e8c977;
  --ink: #33302a;
  --ink-soft: #8a8577;
  --ink-faint: #b3ad9e;
  --paper-white: #fffdf5;
  --danger: #c0392b;

  /* 圆角与阴影 */
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 10px rgba(47, 74, 60, 0.08);
  --shadow-md: 0 6px 22px rgba(47, 74, 60, 0.12);
  --shadow-lg: 0 14px 40px rgba(47, 74, 60, 0.18);

  /* 字体 */
  --font-body: "PingFang SC", "HarmonyOS Sans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-brush: "STXingkai", "KaiTi", "STKaiti", "华文行楷", serif;
}

html, body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(201, 162, 75, 0.10), transparent 55%),
    linear-gradient(180deg, #f8f3e6 0%, #efe4cd 100%);
  min-height: 100vh;
  line-height: 1.65;
  position: relative;
}

/* 背景装饰层 */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../img/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.moon {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #f7e7b0 0%, #e5c878 55%, #c9a24b 100%);
  box-shadow: 0 0 60px 18px rgba(201, 162, 75, 0.32);
  opacity: 0.9;
}

.mountains {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40vh;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
}

.mountains svg {
  width: 100%;
  height: 100%;
  display: block;
}

.osmanthus {
  position: absolute;
  opacity: 0.5;
}
.osmanthus.tl { top: 10px; left: 6px; transform: rotate(180deg); }
.osmanthus.br { bottom: 10px; right: 6px; }

.vertical-slogan {
  position: absolute;
  top: 66px;
  right: 22px;
  z-index: 1;
  writing-mode: vertical-rl;
  letter-spacing: 6px;
  color: var(--ink-green-dark);
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-brush);
  padding: 12px 8px;
  background: linear-gradient(180deg, rgba(224, 183, 90, 0.72), rgba(201, 162, 75, 0.42));
  border-radius: 6px;
}

/* 顶栏 */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(47, 74, 60, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--paper-white);
  border-bottom: 1px solid rgba(201, 162, 75, 0.4);
}

.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: var(--font-brush);
  color: #f4e3b2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.nav a {
  color: #f4e3b2;
  text-decoration: none;
  margin-left: 14px;
  font-size: 14px;
  padding: 6px 14px;
  border: 1px solid rgba(224, 183, 90, 0.5);
  border-radius: 20px;
  transition: all 0.2s;
}

.nav a:hover {
  background: rgba(224, 183, 90, 0.2);
  color: #fff;
}

/* 主容器 */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 36px auto 76px;
  padding: 0 18px;
}

/* 卡片（柔和圆角 + 浅投影） */
.card {
  background: rgba(255, 253, 245, 0.82);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

/* 标题 */
.brush-title {
  font-family: var(--font-brush);
  color: var(--ink-green-dark);
  letter-spacing: 3px;
  line-height: 1.2;
}

.page-title {
  text-align: center;
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-subtitle {
  text-align: center;
  font-size: 17px;
  color: var(--sage);
  letter-spacing: 6px;
  margin-bottom: 8px;
}

.slogan {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.9;
  margin: 6px auto 16px;
  max-width: 420px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-brush);
  font-size: 21px;
  color: var(--ink-green-dark);
  margin: 30px 0 16px;
}
.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.section-title::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* 登录/注册卡片（毛玻璃） */
.auth-card {
  max-width: 420px;
  margin: 5vh auto 0;
  position: relative;
  z-index: 1;
  background: rgba(255, 253, 245, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 34px;
}

.auth-card .brush-title {
  text-align: center;
  font-size: 40px;
}

.auth-heading {
  text-align: center;
  font-family: var(--font-brush);
  font-size: 24px;
  color: var(--ink-green-dark);
  margin: 10px 0 20px;
}

.auth-form .field-label {
  display: block;
  text-align: left;
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 14px;
}

.input-wrap {
  position: relative;
  margin-top: 7px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  opacity: 0.8;
}

.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border-radius: 10px;
  border: 1px solid rgba(47, 74, 60, 0.22);
  background: rgba(255, 253, 245, 0.9);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input:focus {
  outline: none;
  border-color: var(--ink-green);
  box-shadow: 0 0 0 4px rgba(201, 162, 75, 0.18);
}

.auth-switch {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}

.auth-switch a {
  color: var(--ink-green);
  font-weight: 700;
  text-decoration: none;
}

.forgot {
  text-align: right;
  margin-top: -8px;
  margin-bottom: 16px;
}

.forgot a {
  font-size: 13px;
  color: var(--ink-faint);
  text-decoration: none;
}

/* 按钮（渐变金 + 阴影 + 点击下沉） */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 12px;
  transition: transform 0.1s, box-shadow 0.1s, background 0.2s, opacity 0.2s;
}

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

.btn-gold {
  background: linear-gradient(135deg, #f0d486 0%, #e0b75a 45%, #c9a24b 100%);
  color: #4a3810;
  box-shadow: 0 6px 16px rgba(201, 162, 75, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-gold:hover {
  box-shadow: 0 9px 22px rgba(201, 162, 75, 0.45);
}

.btn-gold:active {
  box-shadow: 0 2px 8px rgba(201, 162, 75, 0.3);
}

.btn-gold:disabled {
  background: #cfc9bb;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-block {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.btn-draw {
  display: block;
  margin: 20px auto 0;
  font-size: 21px;
  padding: 14px 64px;
}

.btn-sm {
  padding: 11px 20px;
  font-size: 15px;
}

/* 转盘 */
.wheel-wrap {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 14px auto;
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  filter: drop-shadow(0 12px 28px rgba(47, 74, 60, 0.3));
}

.wheel-text {
  fill: #fff8e8;
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(31, 58, 46, 0.6);
  stroke-width: 2px;
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 74px;
  height: 74px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #f4e3b2 40%, #d4a73f 80%, #b8860b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brush);
  font-weight: 700;
  color: var(--ink-green-dark);
  z-index: 2;
  box-shadow: 0 0 0 5px rgba(255, 253, 245, 0.65), 0 0 18px rgba(201, 162, 75, 0.55);
}

/* 金属质感指针 */
.pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 30px;
  height: 40px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #f7e3a0 0%, #d4a73f 55%, #b8860b 100%);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  z-index: 3;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

/* 剩余次数 */
.remain-row {
  text-align: center;
  margin: 6px 0 2px;
}

.remain-count {
  font-size: 30px;
  font-weight: 800;
  color: var(--danger);
}

.remain-hint {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* 结果弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(31, 58, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background: var(--paper-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 46px;
  text-align: center;
  min-width: 290px;
}

.result-title {
  font-family: var(--font-brush);
  font-size: 38px;
  color: var(--ink-green-dark);
  margin-bottom: 12px;
}

.result-text {
  color: var(--ink-soft);
  margin-bottom: 24px;
}

/* 奖项卡片列表 */
.prize-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prize-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(47, 74, 60, 0.06);
  border-radius: 12px;
}

.prize-icon {
  font-size: 24px;
  width: 34px;
  text-align: center;
}

.prize-name {
  font-weight: 700;
  font-size: 15px;
}

.prize-desc {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 13px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 30px 0;
  color: var(--ink-soft);
}

.empty-illust {
  font-size: 46px;
  margin-bottom: 10px;
  line-height: 1;
}

/* 数据看板（三列） */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: rgba(255, 253, 245, 0.9);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  font-size: 26px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-info strong {
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink-green-dark);
}

.stat-info span {
  font-size: 12px;
  color: var(--ink-soft);
}

/* 面板 */
.panel {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 253, 245, 0.7);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-family: var(--font-brush);
  font-size: 19px;
  color: var(--ink-green-dark);
  margin-bottom: 16px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.inline-form input,
.inline-form select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(47, 74, 60, 0.22);
  background: rgba(255, 253, 245, 0.9);
  color: var(--ink);
  font-size: 15px;
  height: 46px;
  max-width: 100%;
  min-width: 0;
}

.inline-form input:focus,
.inline-form select:focus {
  outline: none;
  border-color: var(--ink-green);
  box-shadow: 0 0 0 4px rgba(201, 162, 75, 0.15);
}

.inline-form .btn {
  height: 46px;
}

/* 抽奖次数步进器（− / +） */
.stepper {
  display: inline-flex;
  align-items: center;
  height: 46px;
  border: 1px solid rgba(47, 74, 60, 0.22);
  border-radius: 10px;
  background: rgba(255, 253, 245, 0.9);
  overflow: hidden;
}

.stepper .step-btn {
  width: 44px;
  height: 100%;
  flex: none;
  border: none;
  background: transparent;
  color: var(--ink-green);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s;
}

.stepper .step-btn:hover {
  background: rgba(201, 162, 75, 0.18);
}

.stepper .step-btn:active {
  background: rgba(201, 162, 75, 0.32);
}

.stepper input {
  width: 140px;
  height: 100%;
  padding: 0;
  border: none;
  border-left: 1px solid rgba(47, 74, 60, 0.16);
  border-right: 1px solid rgba(47, 74, 60, 0.16);
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 15px;
}

.stepper input:focus {
  outline: none;
  border-color: rgba(47, 74, 60, 0.16);
  box-shadow: none;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* 锁定状态：次数固定为 1，不可修改 */
.stepper.locked .step-btn {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper.locked .step-btn:hover,
.stepper.locked .step-btn:active {
  background: transparent;
}

.stepper.locked input {
  color: rgba(47, 74, 60, 0.55);
  cursor: not-allowed;
}

/* 次数预览：历史剩余 + 本次变动 */
.count-preview {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(47, 74, 60, 0.06);
  color: var(--ink-green);
  font-size: 13px;
  line-height: 1.5;
}

.count-preview:empty {
  display: none;
}

.count-preview.warn {
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
}

.hint {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 12px;
}

/* 概率设置 两行两列 */
.prob-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.prob-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(47, 74, 60, 0.05);
  border-radius: 10px;
}

.prob-field .label {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}

.prob-field input {
  flex-shrink: 0;
  width: 84px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(47, 74, 60, 0.22);
  background: var(--paper-white);
  color: var(--ink);
  font-size: 14px;
  text-align: right;
}

.prob-field .unit {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* 卡片列表（替代表格） */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 253, 245, 0.9);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.list-main {
  min-width: 0;
}

.list-title {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.list-sub {
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.list-side {
  text-align: right;
  flex-shrink: 0;
}

.list-side .num {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-green-dark);
}

.list-side .lbl {
  font-size: 12px;
  color: var(--ink-faint);
}

/* 用户卡片（两行布局，防止信息挤压重叠） */
.user-card {
  padding: 14px 18px;
  background: rgba(255, 253, 245, 0.9);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.uc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.uc-phone {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uc-remain {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.uc-remain strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-green-dark);
}

.uc-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-faint);
}

.uc-bottom span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prize-0 { color: var(--sage); }
.prize-1 { color: #b8860b; font-weight: 700; }
.prize-2 { color: #a96f2f; font-weight: 700; }
.prize-3 { color: #7a8f82; font-weight: 700; }
.prize-4 { color: #8d6e63; font-weight: 700; }
.prize-5 { color: var(--ink-faint); }

/* 折扣活动 */
.discount-box {
  background: rgba(47, 74, 60, 0.06);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--ink);
}

.discount-box p {
  margin: 7px 0;
}

.discount-box .hl {
  color: var(--ink-green-dark);
  font-weight: 700;
  margin-right: 4px;
}

/* 会员标签 */
.member-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
  color: var(--ink-green);
  background: rgba(47, 74, 60, 0.1);
  vertical-align: middle;
}

/* 奖品库存 */
.stock-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stock-item {
  flex: 1 1 30%;
  min-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(47, 74, 60, 0.05);
  border-radius: 10px;
  text-align: center;
}

.stock-name {
  font-size: 13px;
  color: var(--ink-soft);
}

.stock-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-green-dark);
  line-height: 1.2;
}

.stock-num.empty {
  color: var(--danger);
}

.stock-sub {
  font-size: 11px;
  color: var(--ink-faint);
}

/* 提示消息 */
.flash {
  margin-bottom: 16px;
}

.flash-item {
  background: rgba(201, 162, 75, 0.16);
  border: 1px solid rgba(201, 162, 75, 0.6);
  color: #7a5a1e;
  padding: 11px 16px;
  border-radius: 10px;
  margin-bottom: 6px;
}

/* 底部声明 */
.footer-note {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 12px;
  color: #a49a86;
  padding: 20px 0 26px;
}

/* 移动端汉堡菜单 + 底部操作面板 */
.menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  width: 44px;
  height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.4);
}

.action-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  background: #fdfaf1;
  border-radius: 16px 16px 0 0;
  padding: 12px 16px 20px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
}

.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px;
  font-size: 16px;
  color: #33302a;
  text-decoration: none;
  border-bottom: 1px solid #eeeeee;
}

.sheet-item.current {
  color: #b3ad9e;
}

.current-tag {
  font-size: 12px;
  color: #b3ad9e;
}

.sheet-item.danger {
  color: #E64340;
  margin-top: 10px;
  border-bottom: none;
}

.sheet-cancel {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  background: none;
  border: none;
  font-size: 14px;
  color: #8a8577;
  cursor: pointer;
  text-align: center;
}

.sheet-mask.hidden,
.action-sheet.hidden {
  display: none;
}

@media (max-width: 620px) {
  .nav { display: none; }
  .menu-btn { display: flex; }
  .card { padding: 22px 18px; }
  .wheel-wrap { width: 260px; height: 260px; }
  .page-title { font-size: 32px; }
  .moon { width: 140px; height: 140px; }
  .vertical-slogan { right: 8px; font-size: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prob-grid { grid-template-columns: 1fr; }
}
