:root {
  --red: #c41e1e;
  --red-deep: #8b0000;
  --cream: #fff6e8;
  --cream-2: #ffe8c8;
  --ink: #1a1210;
  --muted: #6b5344;
  --gold: #f5c542;
  --green: #07c160;
  --panel: rgba(255, 250, 242, 0.92);
  --shadow: 0 18px 50px rgba(120, 20, 10, 0.18);
  --radius: 22px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffd0a8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ffb3a8 0%, transparent 50%),
    linear-gradient(180deg, #fff8ef 0%, #ffe4cc 40%, #ffd4b8 100%);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}

body.chaos {
  animation: vibe 1.2s ease-in-out infinite alternate;
}
@keyframes vibe {
  from { filter: saturate(1.05); }
  to { filter: saturate(1.25) hue-rotate(-4deg); }
}

#confetti-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
}

.siren-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: repeating-linear-gradient(90deg, #c41e1e, #c41e1e 40px, #1a1210 40px, #1a1210 80px);
  color: #fff;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.55rem 1rem;
  animation: siren-flash 0.8s steps(2) infinite;
}
@keyframes siren-flash {
  50% { filter: brightness(1.25); }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  max-width: 920px;
  margin: 0 auto;
}
.brand { display: flex; gap: 0.75rem; align-items: center; }
.logo {
  font-size: 2rem;
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  background: var(--red);
  border-radius: 16px;
  box-shadow: 0 8px 0 var(--red-deep);
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.brand-title { font-weight: 900; font-size: 1.15rem; }
.brand-sub { font-size: 0.75rem; color: var(--muted); }
.top-actions { display: flex; gap: 0.4rem; }

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  display: grid;
  gap: 1.25rem;
}

.panel {
  background: var(--panel);
  border: 2px solid rgba(196, 30, 30, 0.12);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero {
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--red);
}
.hero::before {
  content: "🍗 🍟 🥤 🍗 🍟 🥤";
  position: absolute;
  inset: auto -20% -0.4rem;
  font-size: 1.4rem;
  opacity: 0.18;
  letter-spacing: 0.6em;
  white-space: nowrap;
  animation: marquee 18s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-40%); }
}

.eyebrow {
  display: inline-block;
  background: var(--ink);
  color: var(--gold);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.hero h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  margin: 0.7rem 0 0.4rem;
  line-height: 1.2;
  font-weight: 900;
}
.hero.is-thursday h1 {
  color: var(--red);
  text-shadow: 3px 3px 0 #ffd7a8;
}
.hero.is-not h1 { color: var(--muted); }
.radar-sub { color: var(--muted); margin: 0 auto 1.2rem; max-width: 36em; }

.radar-clock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.clock-block {
  background: linear-gradient(180deg, #fff, var(--cream-2));
  border-radius: 16px;
  padding: 0.75rem 0.4rem;
  border: 1px dashed rgba(196,30,30,0.35);
}
.clock-label { display: block; font-size: 0.72rem; color: var(--muted); }
.clock-value { display: block; font-weight: 900; font-size: clamp(1rem, 3.5vw, 1.35rem); font-variant-numeric: tabular-nums; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; align-items: center; }

.section-head h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.section-head p { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }

.gen-controls {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}
.field { display: grid; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.field input, .field select {
  font: inherit;
  color: var(--ink);
  border: 2px solid rgba(26,18,16,0.12);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(196,30,30,0.15);
}

.gen-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }

.primary-btn, .secondary-btn, .ghost-btn {
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  padding: 0.7rem 1.15rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.primary-btn {
  background: linear-gradient(180deg, #e23a3a, var(--red-deep));
  color: #fff;
  box-shadow: 0 6px 0 #5c0000;
}
.primary-btn:hover { transform: translateY(-2px); }
.primary-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #5c0000; }
.primary-btn.big { font-size: 1.1rem; padding: 0.95rem 1.6rem; width: 100%; max-width: 280px; }
.primary-btn.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 0 #5c0000, 0 0 0 0 rgba(196,30,30,0.45); }
  50% { box-shadow: 0 6px 0 #5c0000, 0 0 0 12px rgba(196,30,30,0); }
}
.secondary-btn {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
}
.ghost-btn {
  background: rgba(255,255,255,0.65);
  color: var(--ink);
  border: 1px solid rgba(26,18,16,0.12);
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}
.text-link { color: var(--red); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.story-card {
  background: #1a1210;
  color: #fff6e8;
  border-radius: 18px;
  padding: 1.2rem 1.15rem;
  min-height: 180px;
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(245,197,66,0.25);
}
.typewriter {
  white-space: pre-wrap;
  font-size: 1.02rem;
  line-height: 1.75;
  min-height: 8em;
}
.story-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #c9a88a;
}
.toast {
  background: var(--green);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
}

.ritual-stage { display: grid; place-items: center; }
.fake-pay, .pay-result {
  width: min(100%, 340px);
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border: 2px solid rgba(7,193,96,0.35);
  box-shadow: 0 12px 30px rgba(7,193,96,0.12);
}
.pay-avatar {
  width: 64px; height: 64px; margin: 0 auto 0.6rem;
  border-radius: 16px; background: #f3f3f3;
  display: grid; place-items: center; font-size: 2rem;
}
.pay-to { color: var(--muted); font-size: 0.9rem; }
.pay-amount {
  font-size: 2.6rem; font-weight: 900; margin: 0.4rem 0;
  font-variant-numeric: tabular-nums;
}
.pay-note { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.tiny { font-size: 0.75rem; color: var(--muted); margin-top: 0.75rem; }
.pay-success-icon { font-size: 3rem; }
.pay-result h3 { margin: 0.4rem 0; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.arch-card {
  background: linear-gradient(160deg, #fff, #fff0e0);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(196,30,30,0.15);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.arch-card:hover { transform: translateY(-3px); border-color: var(--red); }
.arch-card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.arch-card p { margin: 0; font-size: 0.86rem; color: var(--muted); }
.arch-tag {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--red);
  background: rgba(196,30,30,0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.lore { margin-top: 1rem; border-radius: 14px; background: rgba(26,18,16,0.04); padding: 0.4rem 0.9rem; }
.lore summary { cursor: pointer; font-weight: 800; padding: 0.5rem 0; }
.lore-body { color: var(--muted); font-size: 0.92rem; padding-bottom: 0.7rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.stat-card {
  text-align: center;
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 0.4rem;
  border: 1px dashed rgba(196,30,30,0.3);
}
.stat-num { display: block; font-size: 1.6rem; font-weight: 900; color: var(--red); }
.stat-label { font-size: 0.72rem; color: var(--muted); }

.badges {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #eee;
  color: #888;
  border: 1px solid transparent;
}
.badge.unlocked {
  background: linear-gradient(180deg, #fff3c4, #ffe08a);
  color: #7a4d00;
  border-color: #f0c040;
  box-shadow: 0 3px 0 #d4a017;
}

.vibe-list { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.vibe-list li { margin-bottom: 0.45rem; }
.vibe-list strong { color: var(--ink); }

.footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
.footer code {
  background: rgba(26,18,16,0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

/* WeChat modal */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: end center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}
.wechat-sheet {
  position: relative;
  width: min(100%, 400px);
  height: min(88vh, 640px);
  background: #ededed;
  border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: slideup 0.28s ease;
}
@keyframes slideup {
  from { transform: translateY(40%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.wechat-bar {
  background: #ededed;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid #ddd;
  font-size: 0.95rem;
}
.wechat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.bubble {
  max-width: 82%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  position: relative;
}
.bubble.them {
  align-self: flex-start;
  background: #fff;
}
.bubble.me {
  align-self: flex-end;
  background: #95ec69;
}
.bubble .time {
  display: block;
  text-align: center;
  color: #999;
  font-size: 0.72rem;
  margin: 0.2rem 0 0.5rem;
  align-self: center;
  background: transparent;
  padding: 0;
}
.wechat-disclaimer {
  margin: 0;
  padding: 0.55rem 0.85rem 0.9rem;
  font-size: 0.72rem;
  color: #888;
  background: #f7f7f7;
  text-align: center;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px; height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.3; }
}

@media (max-width: 700px) {
  .gen-controls { grid-template-columns: 1fr; }
  .radar-clock { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; }
}

/* --- v2 additions --- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.visit-banner {
  max-width: 920px;
  margin: 0 auto 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(90deg, #1a1210, #5c1a12);
  color: #ffe8c8;
  border-radius: 14px;
  font-size: 0.95rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  box-shadow: var(--shadow);
}
.visit-n {
  color: var(--gold);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.visit-note { opacity: 0.75; font-size: 0.78rem; margin-left: 0.25rem; }

.chaos-explainer {
  text-align: left;
  background: rgba(255,255,255,0.7);
  border: 2px dashed rgba(196,30,30,0.35);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin: 0 auto 1rem;
  max-width: 40rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.chaos-explainer .chaos-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.chaos-explainer ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.chaos-explainer li { margin-bottom: 0.25rem; }

.secondary-look {
  background: #fff !important;
  color: var(--red) !important;
  box-shadow: 0 6px 0 #c9a08a !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.center { text-align: center; }

.spice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.spice-label { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.spice-chip {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  border: 2px solid rgba(196,30,30,0.25);
  background: #fff;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.spice-chip.on {
  background: var(--red);
  color: #fff;
  border-color: var(--red-deep);
}

.slider-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.slider-row input[type=range] { width: min(240px, 60vw); accent-color: var(--red); }

.hold-wrap { position: relative; width: 100%; max-width: 280px; margin: 0 auto; }
.hold-bar {
  height: 6px;
  background: #eee;
  border-radius: 99px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.hold-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), #0a8);
  border-radius: 99px;
}

.oracle-card {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  background: #1a1210;
  color: var(--gold);
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.lore-seo h2 { margin-top: 0; }
.lore-seo p { color: var(--muted); }

.toast-global {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: #1a1210;
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  max-width: 90vw;
  text-align: center;
}

body.egg-mode .logo {
  animation: spin 0.6s linear infinite;
  box-shadow: 0 0 0 6px var(--gold);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.logo {
  border: none;
  cursor: pointer;
  font-family: inherit;
}


/* Meituan联盟外卖红包 CTA */
.meituan-deal {
  margin: 1.15rem auto 0.35rem;
  max-width: 420px;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 18px;
  border: 2px dashed rgba(255, 107, 53, 0.55);
  background: linear-gradient(180deg, rgba(255, 244, 230, 0.95), rgba(255, 228, 196, 0.9));
  box-shadow: 0 10px 28px rgba(196, 70, 20, 0.12);
  text-align: center;
}
.meituan-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #c45a12;
  text-transform: none;
}
.meituan-title {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  color: #b33a00;
}
.meituan-copy {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}
.meituan-copy strong { color: #8b2e00; }
a.primary-btn.meituan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: linear-gradient(180deg, #ff8a3d, #e85d04);
  box-shadow: 0 6px 0 #9a3b00;
  max-width: 100%;
}
a.primary-btn.meituan-btn:hover { transform: translateY(-2px); }
a.primary-btn.meituan-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #9a3b00; }
.meituan-note { margin: 0.65rem 0 0; opacity: 0.9; }
.hero.is-thursday .meituan-deal {
  border-style: solid;
  border-color: #ff6b35;
  animation: meituan-glow 1.8s ease-in-out infinite alternate;
}
@keyframes meituan-glow {
  from { box-shadow: 0 10px 28px rgba(196, 70, 20, 0.12); }
  to { box-shadow: 0 12px 34px rgba(232, 93, 4, 0.28); }
}
