:root {
  --red: #e53935;
  --red-deep: #b71c1c;
  --red-mid: #d32f2f;
  --gold: #f0c14b;
  --gold-bright: #ffe08a;
  --cream: #fff8f0;
  --text: #3a2412;
  --muted: #8a6a4a;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: #6d0c0c;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.proto-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 20px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #f0d8c4; font-size: 12px; color: var(--muted);
  backdrop-filter: blur(8px);
}
.proto-bar strong { color: var(--red); }
.proto-bar a, .proto-bar button.linkish {
  color: var(--red-mid); padding: 4px 10px; border: 1px solid #ffc9c0;
  border-radius: 6px; margin-left: 4px; font-size: 12px; font-weight: 600;
  background: #fff;
}
.proto-bar .actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* Hero */
.hero {
  position: relative; z-index: 1; overflow: hidden; color: #fff; text-align: center;
}
.hero-media {
  position: relative; overflow: hidden;
  height: 52vh; min-height: 360px; max-height: 520px;
  background: #6a1010;
}
.hero-bg {
  position: absolute; inset: -8%;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,80,40,.35), transparent 55%),
    linear-gradient(165deg, #c62828 0%, #8b1010 40%, #5a0a0a 100%);
}
.hero-bg::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,220,120,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 20%, rgba(255,220,120,.14) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 40% 70%, rgba(255,220,120,.12) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 60%, rgba(255,220,120,.16) 0 1px, transparent 2px);
  animation: spark 8s linear infinite;
}
@keyframes spark {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}
.hero-media::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 100px; z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(140,20,20,.45) 50%, #8b1010 100%);
  pointer-events: none;
}
.hero-inner {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 0 20px 36px;
}
.hero h1 {
  font-family: "STXingkai", "华文行楷", "KaiTi", "STKaiti", "PingFang SC", serif;
  font-size: clamp(32px, 5vw, 56px); font-weight: 700; letter-spacing: .12em;
  line-height: 1.15; margin-bottom: 12px; color: #ffe08a;
  text-shadow:
    0 1px 0 #fff3b0, 0 2px 0 #e0a020, 0 4px 12px rgba(0,0,0,.5),
    0 0 22px rgba(255,180,60,.4);
}
.hero .sub {
  display: inline-block; position: relative;
  font-size: clamp(13px, 1.5vw, 18px); font-weight: 800; letter-spacing: .14em;
  color: #fff; padding: 7px 32px; margin-bottom: 12px;
  background: linear-gradient(180deg, #c62828, #8b1010);
  border: 1px solid rgba(255,210,120,.55);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.hero-meta {
  display: flex; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 960px; margin: 0 auto;
}
.hero-meta__item {
  flex: 1 1 0; min-width: 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(40, 8, 8, .42); border: 1px solid rgba(255,220,140,.22);
  text-align: center; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.hero-meta__item .label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,236,200,.85); margin-bottom: 3px;
}
.hero-meta__item .value {
  display: block; font-size: 12px; font-weight: 800; line-height: 1.35; color: #fff8e8;
}

.content-shell {
  position: relative; z-index: 2;
  background:
    radial-gradient(ellipse 120% 50% at 50% 0%, rgba(220,40,30,.45), transparent 55%),
    linear-gradient(180deg, #8b1010 0%, #7a0e0e 45%, #5c0a0a 100%);
  padding-top: 16px; padding-bottom: 120px; margin-top: -24px;
}
.page { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

.sec-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 0 16px; }
.sec-head .title-row { display: flex; align-items: center; gap: 12px; }
.sec-head .wing {
  width: 48px; height: 2px;
  background: linear-gradient(90deg, transparent, #f0c14b, #e53935, #f0c14b, transparent);
}
.sec-head .title-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 24px; border-radius: 999px;
  background: linear-gradient(180deg, #fff8f0, #ffe8d6);
  border: 1.5px solid #f0c14b;
  box-shadow: 0 4px 16px rgba(229,57,53,.12), inset 0 1px 0 #fff;
}
.sec-head .title-badge .txt {
  font-size: 18px; font-weight: 900; letter-spacing: .14em;
  background: linear-gradient(90deg, #b71c1c, #e53935 50%, #c62828);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sec-head .sub { margin-top: 6px; font-size: 12px; color: var(--muted); }

.panel {
  background: linear-gradient(180deg, #fff8f0 0%, #f3e4c4 100%);
  border-radius: 18px; padding: 24px 28px 28px;
  box-shadow: 0 8px 28px rgba(40,8,8,.2), inset 0 1px 0 rgba(255,255,255,.55);
  border: 1px solid rgba(230,190,110,.55); margin-bottom: 16px;
}
.panel--stage {
  border: 1.5px solid rgba(230,190,110,.65);
  box-shadow: 0 8px 28px rgba(40,8,8,.2), inset 0 1px 0 rgba(255,255,255,.6);
}

/* Day strip */
.day-strip {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 4px 2px 14px; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.day-strip::-webkit-scrollbar { height: 6px; }
.day-strip::-webkit-scrollbar-thumb { background: rgba(180,80,40,.35); border-radius: 999px; }

.day-card {
  flex: 0 0 110px; scroll-snap-align: center;
  border-radius: 14px; padding: 12px 10px 14px;
  text-align: center;
  background: linear-gradient(180deg, #fffdf8, #f7ead0);
  border: 1.5px solid rgba(220,180,100,.55);
  box-shadow: 0 4px 12px rgba(80,20,10,.1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.day-card--today {
  border-color: #e53935;
  box-shadow: 0 0 0 2px rgba(229,57,53,.35), 0 8px 20px rgba(229,57,53,.22);
  transform: translateY(-4px) scale(1.04);
  animation: today-pulse 1.8s ease-in-out infinite alternate;
}
@keyframes today-pulse {
  from { box-shadow: 0 0 0 2px rgba(229,57,53,.3), 0 8px 18px rgba(229,57,53,.18); }
  to { box-shadow: 0 0 0 3px rgba(240,193,75,.55), 0 10px 24px rgba(229,57,53,.28); }
}
.day-card--done {
  opacity: .72;
  background: linear-gradient(180deg, #f0f0f0, #e4e0d8);
  border-color: rgba(160,140,120,.4);
}
.day-card--locked { opacity: .85; }
.day-card--bonus {
  background: linear-gradient(180deg, #fff6d8, #ffd98a);
  border-color: #e0a020;
}
.day-card__badge {
  display: inline-block; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 8px;
  color: #8b1010; background: rgba(255,220,140,.55);
}
.day-card--today .day-card__badge { color: #fff; background: linear-gradient(180deg,#ff5a4a,#c62828); }
.day-card--done .day-card__badge { color: #fff; background: #8a8a8a; }
.day-card__ico {
  width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900; color: #c62828;
  background: radial-gradient(circle at 35% 30%, #fff8e0, #ffd666 55%, #f0a020);
  box-shadow: inset 0 1px 0 #fff, 0 3px 8px rgba(180,80,20,.25);
}
.day-card--bonus .day-card__ico { color: #8b1010; font-size: 18px; }
.day-card__amt {
  font-size: 20px; font-weight: 900; color: var(--red); line-height: 1.1;
}
.day-card__amt small { font-size: 12px; margin-left: 1px; }
.day-card__name { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }

.bonus-row {
  margin: 8px 0 18px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.45); border: 1px dashed rgba(220,160,80,.55);
}
.bonus-row__top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 700; color: #8a6a50; margin-bottom: 8px;
}
.bonus-row__top b { color: var(--red); }
.bonus-bar {
  height: 10px; border-radius: 999px; background: rgba(180,120,60,.18); overflow: hidden;
}
.bonus-bar > i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #ff8a65, #e53935 60%, #f0c14b);
  transition: width .35s ease;
}

.sign-actions { display: flex; justify-content: center; margin-top: 4px; }
.sign-btn {
  min-width: 240px; padding: 14px 36px; border-radius: 999px;
  font-size: 18px; font-weight: 900; letter-spacing: .12em; color: #fff;
  background: linear-gradient(180deg, #ff5a4a, #c62828 70%, #b71c1c);
  box-shadow: 0 4px 0 #8d1a12, 0 10px 24px rgba(180,30,20,.35);
}
.sign-btn:hover:not(:disabled) { filter: brightness(1.05); }
.sign-btn:disabled, .sign-btn.is-done {
  background: linear-gradient(180deg, #c0b8b0, #9a928a);
  box-shadow: 0 3px 0 #6e6860; cursor: not-allowed;
}
.sign-btn.is-block {
  background: linear-gradient(180deg, #ffb74d, #f57c00 70%, #e65100);
  box-shadow: 0 4px 0 #bf360c, 0 10px 24px rgba(180,80,20,.3);
}

/* Status board */
.status-board {
  margin-bottom: 16px; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(230,190,110,.55);
  box-shadow: 0 8px 24px rgba(40,8,8,.2);
  background: linear-gradient(180deg, #fffaf2, #f6ebda);
}
.status-board__head {
  padding: 12px 20px; text-align: center;
  font-size: 17px; font-weight: 900; letter-spacing: .14em; color: #fff;
  background: linear-gradient(180deg, #e53935, #b71c1c);
}
.status-board__body { padding: 16px 20px 14px; }
.status-board__top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.status-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.status-stats .cell {
  text-align: center; padding: 10px 6px; border-radius: 10px;
  background: rgba(255,255,255,.55); border: 1px solid rgba(230,190,110,.4);
}
.status-stats .cell .label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.status-stats .cell b { font-size: 22px; color: var(--red); font-variant-numeric: tabular-nums; }
.status-stats .cell i { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 2px; }
.record-btn {
  flex: 0 0 auto; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #ff5a4a, #c62828);
  box-shadow: 0 3px 0 #8d1a12;
}

/* Condition */
.cond-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.cond-tabs .tab {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 800;
  color: #8a6a50; background: rgba(255,255,255,.5); border: 1px solid rgba(220,180,100,.45);
}
.cond-tabs .tab.is-on {
  color: #fff; background: linear-gradient(180deg,#ff5a4a,#c62828); border-color: transparent;
}
.cond-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(230,190,110,.35);
}
.cond-row:last-child { border-bottom: 0; }
.cond-row .name { font-size: 14px; font-weight: 800; color: var(--text); }
.cond-row .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cond-tag {
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  color: #b71c1c; background: rgba(229,57,53,.12);
}
.cond-tag.is-ok { color: #1b5e20; background: rgba(76,175,80,.18); }
.progress-mini { margin-top: 8px; }
.progress-mini .bar {
  height: 8px; border-radius: 999px; background: rgba(180,120,60,.18); overflow: hidden; margin-bottom: 4px;
}
.progress-mini .bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #ff8a65, #e53935); transition: width .3s ease;
}
.progress-mini .txt { font-size: 12px; color: var(--muted); font-weight: 700; }
.cond-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.cond-actions button {
  padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #ff5a4a, #c62828); box-shadow: 0 3px 0 #8d1a12;
}
.cond-actions button.secondary {
  background: linear-gradient(180deg, #ffb74d, #f57c00); box-shadow: 0 3px 0 #bf360c;
}

.content-list, .rules-list {
  padding-left: 1.2em; font-size: 14px; color: #5a3a22;
}
.content-list li, .rules-list li { margin-bottom: 8px; }

.prize-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px;
}
.prize-card {
  text-align: center; padding: 14px 10px; border-radius: 12px;
  background: rgba(255,255,255,.55); border: 1px solid rgba(230,190,110,.5);
}
.prize-card--bonus {
  background: linear-gradient(180deg, #fff6d8, #ffe08a);
  border-color: #e0a020;
}
.prize-card__day { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.prize-card__amt { font-size: 22px; font-weight: 900; color: var(--red); }
.prize-card__amt small { font-size: 12px; }
.prize-card__name { margin-top: 4px; font-size: 12px; font-weight: 700; color: #5a3a22; }

/* Toast */
.tip {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  z-index: 300; padding: 10px 18px; border-radius: 999px;
  background: rgba(30,10,10,.88); color: #fff; font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s ease;
}
.tip.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Modals */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal__mask { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.modal__panel {
  position: relative; z-index: 1; width: min(360px, 92vw);
  border-radius: 20px; padding: 28px 22px 22px; text-align: center;
  background: linear-gradient(180deg, #fff8f0, #f3e4c4);
  border: 2px solid rgba(240,193,75,.75);
  box-shadow: 0 20px 48px rgba(0,0,0,.4);
}
.win-ico {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; font-size: 32px;
  background: radial-gradient(circle at 35% 30%, #fff8e0, #ffd666 55%, #f0a020);
  box-shadow: 0 6px 16px rgba(180,80,20,.3);
}
.modal__panel h3 {
  font-size: 22px; font-weight: 900; color: var(--red); letter-spacing: .08em; margin-bottom: 6px;
}
.modal__panel p { font-size: 14px; font-weight: 700; color: #5a3a22; margin-bottom: 18px; }
.modal__panel .ok-btn {
  min-width: 160px; padding: 12px 28px; border-radius: 999px;
  font-size: 15px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #ff5a4a, #c62828); box-shadow: 0 3px 0 #8d1a12;
}
.modal-close-x {
  position: absolute; right: 10px; top: 8px; width: 32px; height: 32px;
  font-size: 22px; color: #8a6a4a; line-height: 1;
}

.record-panel {
  position: relative; z-index: 1; width: min(480px, 94vw);
  border-radius: 16px; overflow: hidden;
  background: #fffaf2; border: 1px solid rgba(230,190,110,.55);
  box-shadow: 0 20px 48px rgba(0,0,0,.4);
}
.record-panel__head {
  padding: 14px 18px; text-align: center;
  font-size: 16px; font-weight: 900; color: #fff; letter-spacing: .1em;
  background: linear-gradient(180deg, #e53935, #b71c1c);
}
.record-panel__body { padding: 12px; max-height: 360px; overflow: auto; }
.record-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.record-table th, .record-table td {
  padding: 10px 8px; text-align: center; border-bottom: 1px solid rgba(230,190,110,.35);
}
.record-table th { color: var(--muted); font-weight: 800; }
.record-table td { color: #5a3a22; font-weight: 600; }
.record-table .empty { color: var(--muted); padding: 28px; }

/* H5 overrides applied via body.is-h5 */
body.is-h5 .phone {
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  background: #6d0c0c;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 40px rgba(0,0,0,.35);
  overflow-x: hidden;
}
body.is-h5 .hero-media { height: 42vh; min-height: 280px; max-height: 380px; }
body.is-h5 .hero h1 { font-size: clamp(28px, 8vw, 36px); }
body.is-h5 .hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
body.is-h5 .hero-meta__item { padding: 8px 4px; }
body.is-h5 .hero-meta__item .value { font-size: 10px; }
body.is-h5 .page { margin: 0 12px; padding: 0; }
body.is-h5 .panel { padding: 16px 14px 18px; border-radius: 16px; margin-bottom: 12px; }
body.is-h5 .sec-head .title-badge .txt { font-size: 15px; }
body.is-h5 .sec-head .wing { width: 28px; }
body.is-h5 .day-card { flex: 0 0 96px; padding: 10px 8px 12px; }
body.is-h5 .day-card__amt { font-size: 18px; }
body.is-h5 .sign-btn { width: 100%; min-width: 0; font-size: 16px; }
body.is-h5 .status-stats { grid-template-columns: repeat(3, 1fr); }
body.is-h5 .status-stats .cell b { font-size: 18px; }
body.is-h5 .status-board__top { flex-direction: column; align-items: stretch; }
body.is-h5 .record-btn { width: 100%; }
body.is-h5 .prize-grid { grid-template-columns: repeat(2, 1fr); }
body.is-h5 .content-shell { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

@media (max-width: 720px) {
  .hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .day-card { flex: 0 0 96px; }
  .sign-btn { width: 100%; min-width: 0; }
  .status-board__top { flex-direction: column; align-items: stretch; }
}
