/* 新春/充值活动风：深红底 + 金边 + 橙黄内容卡（对齐 BuffBuff / 活动说明参考） */
:root {
  --page-red: #a81010;
  --page-red-deep: #7a0b0b;
  --card-top: #feda8e;
  --card-mid: #ff9a4a;
  --card-bot: #e84818;
  --gold: #ffd700;
  --gold-line: #e8c048;
  --gold-dark: #b8860b;
  --title-red: #8b2505;
  --body-on-card: #4a1510;
  --body-muted: rgba(74, 21, 16, 0.72);
  --white-soft: #fff8f0;
  --accent-pointer: #c41e1e;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--page-red);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 200, 120, 0.18), transparent 55%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 24px,
      rgba(0, 0, 0, 0.04) 24px,
      rgba(0, 0, 0, 0.04) 25px
    );
  color: var(--white-soft);
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: calc(20px + var(--safe-bottom));
}

a {
  color: var(--gold);
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 14px 0;
}

/* 顶栏 — 深红上的白字 + 金色数据胶囊 */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.topbar h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.02em;
}
.topbar .sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 4px;
}
.stats-pill {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.pill {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 14px;
  padding: 8px 12px;
  text-align: center;
  min-width: 72px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.pill b {
  display: block;
  font-size: 1.05rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.pill span {
  font-size: 10px;
  color: rgba(255, 248, 240, 0.75);
}

/* 活动说明式标题胶囊 */
.page-title-capsule {
  max-width: 280px;
  margin: 0 auto 18px;
  text-align: center;
  position: relative;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.35), rgba(255, 200, 100, 0.9), rgba(255, 215, 0, 0.35));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.page-title-capsule::before,
.page-title-capsule::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 240, 180, 0.9), rgba(200, 150, 40, 0.5));
  border: 2px solid var(--gold-line);
  opacity: 0.85;
  pointer-events: none;
}
.page-title-capsule::before {
  left: 6px;
}
.page-title-capsule::after {
  right: 6px;
}
.page-title-capsule-inner {
  border-radius: 999px;
  padding: 12px 36px;
  background: radial-gradient(ellipse 100% 120% at 50% 0%, #ff8a50, #b31818 62%, #7a0e0e);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #fff3c4;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 橙黄渐变内容卡 */
.block {
  margin-top: 16px;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-mid) 48%, var(--card-bot) 100%);
  border: 2px solid var(--gold-line);
  border-radius: 22px;
  padding: 14px 14px 16px;
  color: var(--body-on-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.block-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -6px -6px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #b01010, #7a0a0a);
  border: 2px solid var(--gold-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.block-h h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.block-h h3::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8c4, var(--gold-dark));
  border: 2px solid #5c3d00;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.block-h small {
  color: rgba(255, 236, 200, 0.88);
  font-size: 11px;
  font-weight: 600;
}

/* Hero 区块 — 仍在橙卡内 */
.hero {
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-mid) 50%, #e85a20 100%);
  border: 2px solid var(--gold-line);
  padding: 18px 16px 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  color: var(--body-on-card);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
}
.hero h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--title-red);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.hero .en {
  font-size: 12px;
  color: var(--body-muted);
  margin-bottom: 14px;
}
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 0, 0, 0.12);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--body-muted);
  margin-bottom: 14px;
}
.countdown strong {
  color: #b01010;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn-gold {
  background: linear-gradient(180deg, #fff6a8 0%, #ffd54a 35%, #e8b020 100%);
  color: #8b0000;
  border: 2px solid #c9a227;
  box-shadow: 0 4px 0 #8a6a18, 0 8px 20px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-ghost {
  background: rgba(139, 0, 0, 0.08);
  color: var(--title-red);
  border: 2px solid rgba(139, 0, 0, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 转盘 */
.roulette-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}
.wheel-outer {
  position: relative;
  width: min(260px, 72vw);
  height: min(260px, 72vw);
}
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    #f5d78e 0deg 45deg,
    #e8a848 45deg 90deg,
    #c41e1e 90deg 135deg,
    #f0c860 135deg 180deg,
    #d43820 180deg 225deg,
    #ffe08a 225deg 270deg,
    #8b0000 270deg 315deg,
    #ffb347 315deg 360deg
  );
  border: 8px solid var(--gold-line);
  box-shadow:
    0 0 0 3px rgba(139, 0, 0, 0.35),
    inset 0 0 36px rgba(0, 0, 0, 0.15);
  transition: transform 3.5s cubic-bezier(0.15, 0.85, 0.2, 1);
}
.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8e8, #ffd54a);
  border: 3px solid #8b4513;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 2;
}
.pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid var(--accent-pointer);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  z-index: 3;
}
.chances {
  font-size: 13px;
  color: var(--body-muted);
  text-align: center;
}
.chances strong {
  color: #b01010;
  font-weight: 800;
}

/* 任务列表 */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  border: 1px solid rgba(139, 0, 0, 0.15);
}
.task p {
  margin: 0;
  font-size: 13px;
  color: var(--body-on-card);
}
.task .tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #8b0000;
  background: rgba(255, 215, 0, 0.45);
  border: 1px solid rgba(200, 150, 40, 0.5);
  padding: 4px 8px;
  border-radius: 999px;
}

.ref-box {
  background: rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  padding: 12px;
  border: 2px dashed rgba(200, 150, 40, 0.65);
  margin-bottom: 10px;
}
.ref-url {
  font-size: 12px;
  word-break: break-all;
  color: var(--body-muted);
  margin-bottom: 10px;
}
.row-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.row-btns .btn {
  padding: 11px 10px;
  font-size: 13px;
}

details.rule-group {
  border-bottom: 1px solid rgba(74, 21, 16, 0.15);
  padding: 10px 0;
}
details.rule-group:last-child {
  border-bottom: none;
}
details.rule-group summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  color: var(--title-red);
}
details.rule-group summary::-webkit-details-marker {
  display: none;
}
details.rule-group ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--body-muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, var(--safe-bottom));
  transform: translateX(-50%) translateY(120px);
  background: linear-gradient(180deg, #3d0808, #2a0505);
  color: #ffe8a8;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--gold-line);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(40, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal.open {
  display: flex;
}
.modal-card {
  background: linear-gradient(180deg, #feda8e 0%, #ff8a45 55%, #e03018 100%);
  border: 3px solid var(--gold-line);
  border-radius: 22px;
  padding: 22px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.modal-card h4 {
  margin: 0 0 10px;
  color: #8b0000;
  font-size: 1.15rem;
  font-weight: 900;
}
.modal-card p {
  margin: 0 0 18px;
  color: var(--body-on-card);
  font-size: 14px;
  font-weight: 600;
}

.toolbar-close {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.toolbar-close button {
  background: rgba(139, 0, 0, 0.1);
  border: 2px solid rgba(139, 0, 0, 0.25);
  color: var(--title-red);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hint-api {
  margin: 0;
  font-size: 12px;
  color: var(--body-muted);
}

.hint-api code {
  font-size: 11px;
  background: rgba(139, 0, 0, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
}

/* 活动说明深红底区块（须写在通用 rule-group 之后，避免覆盖金色标题） */
.rules-sheet {
  margin-top: 16px;
  padding: 18px 16px 20px;
  border-radius: 22px;
  border: 2px solid var(--gold-line);
  background: linear-gradient(165deg, #9e1414 0%, #7a0e0e 50%, #5c0a0a 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  color: #fff;
}
.rules-sheet .block-h {
  background: linear-gradient(180deg, #c01818, #8a1010);
}
.rules-sheet details.rule-group {
  border-bottom-color: rgba(255, 215, 0, 0.22);
}
.rules-sheet details.rule-group summary {
  color: var(--gold);
  font-size: 14px;
}
.rules-sheet details.rule-group ul {
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
}
