* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #ff450a;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 390px;
  margin: 0 auto;
  padding: 14px 16px 24px;
  min-height: 100%;
}

/* 通用卡片 */
.card {
  background: #ffffff;
  border-radius: 14px;
  margin-bottom: 12px;
}

/* 顶部标题卡 */
.header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
}

.title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.earnings-label {
  font-size: 12px;
  color: #888888;
  margin-bottom: 2px;
}

.earnings-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.earnings-value {
  font-size: 22px;
  font-weight: 700;
  color: #e53935;
  letter-spacing: -0.5px;
}

.withdraw-btn {
  position: relative;
  overflow: hidden;
  height: 28px;
  padding: 0 12px;
  background: #ff450a;
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.withdraw-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0);
  transition: background 0.12s ease;
  pointer-events: none;
}

.withdraw-btn:active::after {
  background: rgba(255, 255, 255, 0.35);
}

/* 倒计时卡 */
.timer-card {
  padding: 14px 18px 16px;
}

.timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.timer-label {
  font-size: 14px;
  color: #555555;
}

.timer-value {
  font-size: 14px;
  color: #555555;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #ffe8d6;
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 55%;
  background: #ff450a;
  border-radius: 5px;
  transition: width 0.3s linear;
}

/* 题目卡 */
.question-card {
  padding: 18px 18px 20px;
  text-align: center;
}

.question-hint {
  font-size: 13px;
  color: #aaaaaa;
  margin-bottom: 14px;
}

.question-meaning {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  line-height: 1.4;
}

.question-pinyin {
  font-size: 14px;
  color: #999999;
  letter-spacing: 1px;
}

/* 拼字区 + 字块区 */
.play-card {
  padding: 0;
  overflow: hidden;
}

.puzzle-section {
  padding: 16px 18px 14px;
  text-align: center;
}

.tiles-section {
  padding: 16px 18px 20px;
  text-align: center;
}

.play-divider {
  height: 1px;
  background: #eeeeee;
  margin: 0 18px;
}

.section-label {
  font-size: 13px;
  color: #aaaaaa;
  margin-bottom: 16px;
}

.slots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.slot {
  width: 58px;
  height: 58px;
  border: 2px dashed #ff450a;
  border-radius: 8px;
  background: #fff8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.slot.active {
  border-color: #ff450a;
  border-width: 2.5px;
  box-shadow: 0 0 0 1px rgba(255, 69, 10, 0.15);
}

.slot.filled {
  border-style: solid;
  border-color: #ff450a;
}

.slot-hint {
  font-size: 12px;
  color: #bbbbbb;
}

.tiles {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.tile {
  position: relative;
  overflow: hidden;
  width: 58px;
  height: 58px;
  background: #ff450a;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0);
  transition: background 0.12s ease;
  pointer-events: none;
}

.tile:active::after {
  background: rgba(255, 255, 255, 0.35);
}

.tile.used::after {
  background: rgba(255, 255, 255, 0.28);
}

/* 操作按钮 */
.actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.action-btn {
  flex: 1;
  height: 48px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  font-size: 15px;
  color: #555555;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.action-btn:active {
  background: #f5f5f5;
}

/* 底部统计 */
.footer-stat {
  text-align: center;
  font-size: 14px;
  color: #ffffff;
  opacity: 0.95;
}

/* 答对动画 */
@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.slots.correct .slot {
  animation: correctPulse 0.4s ease;
  border-color: #4caf50;
  background: #e8f5e9;
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.slots.wrong .slot {
  animation: wrongShake 0.4s ease;
  border-color: #ff5252;
}

/* 提示 toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 提现弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 100%;
  max-width: 300px;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 20px 20px;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.modal-mask.show .modal-box {
  transform: scale(1);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.modal-text {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.6;
  margin-bottom: 10px;
}

.modal-highlight {
  font-size: 16px;
  font-weight: 700;
  color: #ff450a;
  margin-bottom: 22px;
}

.modal-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 44px;
  background: #ff450a;
  border: none;
  border-radius: 22px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.modal-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0);
  transition: background 0.12s ease;
  pointer-events: none;
}

.modal-btn:active::after {
  background: rgba(255, 255, 255, 0.35);
}

/* 答对红包弹窗 */
.reward-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.reward-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* 红包第一步 */
.hongbao-card {
  position: relative;
  width: 272px;
  background: #e53935;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.reward-overlay.show .hongbao-card {
  transform: scale(1);
}

.hongbao-flap {
  position: relative;
  height: 84px;
  background: linear-gradient(180deg, #b71c1c 0%, #c62828 100%);
}

.hongbao-flap::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -28px;
  height: 56px;
  background: #e53935;
  border-radius: 50%;
}

.hongbao-body {
  position: relative;
  background: #e53935;
  padding: 22px 20px 32px;
  text-align: center;
}

.hongbao-label {
  font-size: 14px;
  color: #f0d78c;
  margin-bottom: 16px;
}

.hongbao-idiom {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
  margin-bottom: 32px;
}

.hongbao-open-btn {
  position: relative;
  overflow: hidden;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ffe082 0%, #ffc107 50%, #ff9800 100%);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28), inset 0 2px 6px rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.hongbao-open-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  transition: background 0.12s ease;
  pointer-events: none;
}

.hongbao-open-btn:active::after {
  background: rgba(255, 255, 255, 0.35);
}

.hongbao-open-char {
  font-size: 40px;
  font-weight: 700;
  color: #7a6200;
  line-height: 1;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
}

.hongbao-tip {
  font-size: 12px;
  color: #f0d78c;
}

/* 红包第二步 */
.reward-card {
  width: 100%;
  max-width: 292px;
  background: #fffaf6;
  border: 2px solid #ff7043;
  border-radius: 16px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.reward-overlay.show .reward-card {
  transform: scale(1);
}

.reward-title {
  font-size: 17px;
  font-weight: 600;
  color: #e53935;
  margin-bottom: 18px;
}

.reward-idiom {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 4px;
  margin-bottom: 20px;
}

.reward-amount {
  font-size: 42px;
  font-weight: 700;
  color: #e53935;
  letter-spacing: -1px;
  margin-bottom: 8px;
  line-height: 1.1;
}

.reward-status {
  font-size: 13px;
  color: #b8860b;
  margin-bottom: 28px;
}

.reward-continue-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 46px;
  background: #e53935;
  border: none;
  border-radius: 23px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.reward-continue-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 23px;
  background: rgba(255, 255, 255, 0);
  transition: background 0.12s ease;
  pointer-events: none;
}

.reward-continue-btn:active::after {
  background: rgba(255, 255, 255, 0.35);
}
