/* 骰子夜 · 活泼方向 · 第 2 期 B 稿
   语法：Family.co / Cash App 一路——奶油底 + 大块饱和色段、圆润重字、贴纸与弹簧、页面底色随滚动切换。 */

:root {
  --cream: #FAF4DC;   /* 与浏览器里视频实际渲染色一致 (250,244,220)，bt709 标注后实测 */
  --cream-2: #FFE9C2;
  --tomato: #FF4F3A;
  --marigold: #FFC531;
  --cobalt: #2955BE;   /* 与浏览器里视频实际渲染色一致 (41,85,190) */
  --mint: #3FCF9A;
  --ink: #1B1B1F;
  --ink-2: #4A4A52;
  --white: #FFFFFF;
  --bg: var(--cream);
  --fg: var(--ink);
  --r: 28px;
  --font-d: "Fredoka", "Noto Sans SC", sans-serif;
  --font: "Noto Sans SC", "Fredoka", -apple-system, "PingFang SC", sans-serif;
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1140px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font); color: var(--fg); background: var(--bg);
  font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .7s var(--ease), color .7s var(--ease);
}
body[data-bg="marigold"] { --bg: var(--marigold); }
body[data-bg="cobalt"] { --bg: var(--cobalt); --fg: var(--white); }
body[data-bg="mint"] { --bg: var(--mint); }
body[data-bg="ink"] { --bg: var(--ink); --fg: var(--cream); }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.wrap { width: min(var(--wrap), calc(100% - 48px)); margin: 0 auto; }

/* ── 字阶 ── */
.display { font-family: var(--font-d); font-weight: 900; font-size: clamp(56px, 9vw, 132px); line-height: .98; letter-spacing: -0.02em; }
.h2 { font-weight: 900; font-size: clamp(36px, 5.2vw, 72px); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.kicker { font-weight: 700; font-size: 15px; letter-spacing: .04em; margin-bottom: 18px; opacity: .8; }
.lede { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.55; max-width: 26em; margin-top: 26px; color: var(--ink-2); }
.sub { font-size: clamp(17px, 1.4vw, 21px); margin-top: 14px; max-width: 30em; opacity: .85; }
.fine { font-size: 13.5px; margin-top: 18px; opacity: .65; font-weight: 500; }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 16px 28px; border-radius: 999px;
  font-weight: 800; font-size: 17px; border: 2.5px solid var(--ink); color: var(--ink); background: transparent;
  transition: transform .5s var(--spring), box-shadow .3s, background .3s;
  box-shadow: 0 4px 0 var(--ink);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-line { background: var(--white); }
.btn-cream { background: var(--cream); color: var(--ink); border-color: var(--cream); box-shadow: 0 4px 0 rgba(255,243,220,.35); }
.btn-cream:hover { box-shadow: 0 7px 0 rgba(255,243,220,.35); }
.btn-sm { padding: 10px 18px; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
.actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

/* ── 导航 ── */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 24px; padding: 8px 10px 8px 18px;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 5px 0 var(--ink);
  color: var(--ink);
}
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 900; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; }
.logo-die {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--tomato); color: var(--white);
  font-family: var(--font-d); font-weight: 700; font-size: 13px; transform: rotate(-8deg); border: 2px solid var(--ink);
}
.nav-links { display: flex; gap: 20px; font-weight: 700; font-size: 15px; }
.nav-links a { padding: 6px 2px; position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; background: var(--marigold); border-radius: 3px; transform: scaleX(0); transition: transform .4s var(--spring); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ── 首屏 ── */
.hero {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center;
  width: min(var(--wrap), calc(100% - 48px)); margin: 0 auto; padding: 120px 0 40px; gap: 24px;
}
.hero-copy { position: relative; z-index: 3; }
.hero-copy > * { opacity: 0; transform: translateY(24px) scale(.98); animation: pop .9s var(--spring) forwards; }
.hero-copy > :nth-child(2) { animation-delay: .1s; } .hero-copy > :nth-child(3) { animation-delay: .22s; }
.hero-copy > :nth-child(4) { animation-delay: .34s; } .hero-copy > :nth-child(5) { animation-delay: .46s; }
@keyframes pop { to { opacity: 1; transform: none; } }
.hero-stage { position: relative; height: min(70vh, 640px); z-index: 2; }
.cat-wrap { position: absolute; right: -4%; bottom: -2%; width: min(100%, 600px); aspect-ratio: 4 / 3; }
.cat-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-wrap .cat-poster, .cat-wrap .cat { transform: scale(1.75); transform-origin: 50% 62%; }   /* Wan 输出里猫偏小，底色纯平可以直接放大 */
.cat { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s; }
.cat.is-ready { opacity: 1; }
.cat-wrap.no-video { background: url(assets/cat_poster.png) center/contain no-repeat; }
.sticker {
  position: absolute; left: 0; top: 0; width: var(--w, 120px); cursor: grab; user-select: none; touch-action: none;
  filter: drop-shadow(0 10px 14px rgba(27,27,31,.18)); will-change: transform;
  transform: translate(var(--x), var(--y)) rotate(var(--rot));   /* 基础位置：入场动画结束或被打断后仍然成立 */
  animation: drop .8s var(--spring) both; animation-delay: var(--d, 0s);
}
.sticker.is-drag { cursor: grabbing; filter: drop-shadow(0 22px 26px rgba(27,27,31,.26)); z-index: 5; }
.sticker img { width: 100%; pointer-events: none; }
@keyframes drop { from { opacity: 0; transform: translate(var(--x), calc(var(--y) - 60px)) rotate(var(--rot)) scale(.6); } to { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--rot)); } }
.hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 13px; font-weight: 700; opacity: .5; }

/* ── 跑马灯 ── */
.ribbon-clip { overflow: hidden; margin: 12px 0 -10px; }
.ribbon { background: var(--ink); color: var(--cream); overflow: hidden; padding: 14px 0; transform: rotate(-1.4deg) scale(1.04); }
.ribbon-track { display: flex; gap: 28px; white-space: nowrap; font-weight: 800; font-size: 20px; animation: marquee 28s linear infinite; width: max-content; }
.ribbon-track i { color: var(--marigold); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── 段落通用 ── */
section { padding: clamp(96px, 12vw, 170px) 0; }

/* ── 三件事 ── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 56px; }
.card {
  position: relative; padding: 120px 28px 30px; border-radius: var(--r); border: 3px solid var(--ink); background: var(--white);
  box-shadow: 0 8px 0 var(--ink); color: var(--ink); min-height: 380px;
  transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(var(--ty, 0)); transition: transform .6s var(--spring), box-shadow .4s;
}
.card:hover { --ty: -6px; box-shadow: 0 14px 0 var(--ink); }
.card-tomato { background: var(--tomato); color: var(--white); }
.card-cobalt { background: var(--cobalt); color: var(--white); }
.card-mint { background: var(--mint); }
.card h3 { font-size: 30px; font-weight: 900; letter-spacing: -0.01em; margin-bottom: 12px; }
.card p { font-size: 16.5px; line-height: 1.6; opacity: .92; }
.card .chip { display: inline-block; margin-top: 20px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 13px; font-weight: 800; }
.card-sticker { position: absolute; top: -34px; right: 22px; width: 130px; height: 130px; background: center/contain no-repeat; transform: rotate(8deg); transition: transform .6s var(--spring); }
.card:hover .card-sticker { transform: rotate(-6deg) scale(1.12) translateY(-6px); }

/* ── 涂鸦描线 ── */
.doodle-in { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
.doodle-art { color: var(--ink); }
.doodle-svg { width: 100%; height: auto; }
.doodle-svg .s { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.doodle.is-in .doodle-svg .s { animation: draw var(--dur) linear forwards; animation-delay: var(--delay); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.is-static .doodle-svg .s { stroke-dashoffset: 0 !important; animation: none !important; }

/* ── 掷骰 ── */
.roll-in { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; }
.roll-log { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.roll-log span { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.14); font-family: var(--font-d); font-weight: 700; font-size: 18px; animation: pop .6s var(--spring) both; }
.roll-log span.big { background: var(--marigold); color: var(--ink); }
.roll-log span.one { background: var(--tomato); color: var(--white); }
.die {
  position: relative; justify-self: center; width: min(420px, 80%); aspect-ratio: 1; border: 0; background: none; cursor: pointer;
  transform: rotate(var(--r, 0deg)) scale(var(--s, 1)); transition: transform .9s var(--spring);
}
.die:hover { --s: 1.05; }
.die.is-rolling { animation: roll 1s var(--ease); }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(280deg) scale(.85) translateY(-40px); } 60% { transform: rotate(560deg) scale(1.1) translateY(10px); } 100% { transform: rotate(720deg) scale(1); } }
.die-img { width: 100%; filter: drop-shadow(0 24px 30px rgba(0,0,0,.3)); }
.die-num {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-d); font-weight: 700;
  font-size: clamp(64px, 9vw, 120px); color: var(--white); text-shadow: 0 4px 0 rgba(0,0,0,.25); transform: translateY(-6%);
}

/* ── 规则库 ── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 32px; }
.f { font: inherit; font-weight: 800; font-size: 15px; padding: 10px 18px; border-radius: 999px; border: 2.5px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; transition: transform .4s var(--spring), background .3s, color .3s; }
.f:hover { transform: translateY(-2px); }
.f.is-on { background: var(--ink); color: var(--cream); }
.glist { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; }
.g {
  padding: 22px 20px 20px; border-radius: 22px; border: 2.5px solid var(--ink); background: var(--white); box-shadow: 0 5px 0 var(--ink);
  transition: transform .5s var(--spring), opacity .3s; view-transition-name: var(--vt);
}
.g:hover { transform: translateY(-4px) rotate(-1deg); }
.g.is-hidden { display: none; }
.g b { display: block; font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.g small { display: block; font-size: 13px; font-weight: 700; opacity: .65; }
.g .tags { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.g .tags span { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--cream-2); }
.g .tags span.t-party { background: var(--tomato); color: var(--white); } .g .tags span.t-strategy { background: var(--cobalt); color: var(--white); }
.g .tags span.t-quick { background: var(--marigold); } .g .tags span.t-two { background: var(--mint); }

/* ── 大家说 ── */
.quotes { display: flex; gap: 20px; overflow-x: auto; padding: 48px 24px 32px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.quotes::-webkit-scrollbar { display: none; }
.quotes blockquote {
  flex: 0 0 min(340px, 78vw); scroll-snap-align: center; padding: 28px 26px; border-radius: 26px; background: var(--white); border: 3px solid var(--ink); box-shadow: 0 7px 0 var(--ink);
  transform: rotate(var(--q, 0)); transition: transform .5s var(--spring);
}
.quotes blockquote:nth-child(odd) { --q: -1.5deg; } .quotes blockquote:nth-child(even) { --q: 1.5deg; }
.quotes blockquote:hover { transform: rotate(0) translateY(-6px); }
.quotes p { font-size: 21px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.quotes footer { margin-top: 18px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }

/* ── 下载 ── */
.dl-in { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; }
.dl-cat { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--cobalt); border: 3px solid var(--cream); }
.dl-cat .cat { opacity: 1; }

/* ── 页脚 ── */
.foot { background: var(--ink); color: var(--cream); padding: 24px 0 36px; font-size: 13.5px; font-weight: 600; }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot .logo-die { background: var(--marigold); color: var(--ink); }

/* ── 显现 ── */
.reveal { opacity: 0; transform: translateY(30px) scale(.97); transition: opacity .7s var(--ease), transform .9s var(--spring); }
.reveal.is-in { opacity: 1; transform: none; }
.is-static .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.is-static .hero-copy > * { animation: none; opacity: 1; transform: none; }
.is-static .sticker { animation: none; opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--rot)); }

/* ── 响应式 ── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 110px; }
  .hero-stage { height: 56vw; min-height: 320px; }
  .cards { grid-template-columns: 1fr; }
  .roll-in, .dl-in, .doodle-in { grid-template-columns: 1fr; }
  .glist { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav { gap: 12px; padding: 6px 8px 6px 14px; white-space: nowrap; }
  .nav .btn-sm { padding: 8px 14px; font-size: 14px; }
  .nav-links { display: none; }
  .glist { grid-template-columns: 1fr; }
  .card { padding-top: 100px; min-height: 0; }
  .ribbon-track { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *, .sticker { animation: none; opacity: 1; }
  .ribbon-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .die.is-rolling { animation: none; }
}
