/* 幻方智汇 · 宣传站（纸面与琥珀）
   令牌与 miniprogram/app.wxss、docs/风格预览.html 同源（px 按 1rpx = 0.5px 换算）。 */

:root {
  --ink: #1f2328;
  --text-2: #5c6672;
  --text-3: #9aa3ae;
  --brand: #f2a93b;
  --brand-deep: #e29a26;
  --brand-text: #a8760f;
  --brand-tint: #fdf2dc;
  --brand-line: #f3cd52;
  --paper: #f6f6f7;
  --card: #ffffff;
  --given: #ebeef1;
  --dot: #e9eaec;
  --hairline: #ececee;
  --divider: #f2f3f5;

  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --shadow-card: 0 2px 10px rgba(31, 35, 40, 0.05);
  --shadow-float: 0 14px 40px rgba(31, 35, 40, 0.09);
  --shadow-cta: 0 6px 18px rgba(242, 169, 59, 0.32);
  --font-num: "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* 点阵纸面：整页即产品内的那张"纸" */
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

::selection { background: var(--brand-line); color: var(--ink); }

:focus-visible { outline: 3px solid var(--brand-line); outline-offset: 2px; border-radius: 4px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 28px; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn-primary {
  background-color: var(--brand);
  background-image: linear-gradient(180deg, #f7b944, #efa22c);
  color: #fff; box-shadow: var(--shadow-cta);
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-primary.is-copied { filter: none; }
.btn-ghost {
  background: var(--card); border: 1px solid var(--brand);
  color: var(--brand-text);
}
.btn-ghost:hover { background: var(--brand-tint); }
.btn-sm { height: 38px; padding: 0 18px; font-size: 14px; }

/* ===== 吸顶头部 ===== */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--hairline);
}
.site-head.is-scrolled { box-shadow: var(--shadow-card); }
.head-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.brand-logo { display: block; border-radius: 7px; }
.site-nav { display: flex; gap: 26px; margin-left: auto; }
.site-nav a {
  color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500;
}
.site-nav a:hover { color: var(--brand-text); }

/* ===== 首屏 ===== */
.hero { overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 64px; align-items: center;
  padding-top: 72px; padding-bottom: 96px;
}
.hero-copy h1 {
  margin: 0 0 14px; font-size: 18px; font-weight: 600; color: var(--text-2);
}
.slogan {
  margin: 0 0 24px;
  font-size: clamp(44px, 6.6vw, 76px);
  font-weight: 900; line-height: 1.18; letter-spacing: 0.01em;
}
.lead {
  margin: 0 0 32px; max-width: 36em;
  font-size: 17px; line-height: 1.9; color: var(--text-2);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.cta-row--center { justify-content: center; }
.cta-note { margin: 14px 0 0; font-size: 13px; color: var(--text-3); }

.hero-board { margin: 0; }
.hero-board figcaption {
  margin-top: 16px; font-size: 13px; line-height: 1.7; color: var(--text-3);
}

/* ===== 盘面（洛书方阵 4 9 2 / 3 5 7 / 8 1 6） ===== */
.board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  aspect-ratio: 1;
}
.cell {
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  font-family: var(--font-num); font-weight: 700;
  font-size: clamp(30px, 4.2vw, 46px);
  font-variant-numeric: tabular-nums;
}
/* 中心格：品牌琥珀 + 白四角星（呼应 logo「中心格值得先算」的口诀） */
.cell--core {
  position: relative; overflow: hidden;
  background-color: var(--brand);
  background-image: linear-gradient(160deg, #f9bd55, #eb9a1c);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 22px rgba(242, 169, 59, 0.32);
}
.cell--core::before {
  content: ""; position: absolute; inset: 0;
  background: center 58% / 56% no-repeat
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="white" d="M32 4c3.4 19.3 9.3 25.2 28 28-18.7 2.8-24.6 8.7-28 28-3.4-19.3-9.3-25.2-28-28 18.7-2.8 24.6-8.7 28-28Z"/></svg>');
  opacity: 0.2;
}
/* 玩法一示例：预填灰底格与待填空格 */
.cell--given { background: var(--given); border-color: transparent; box-shadow: none; }
.cell--blank { background: var(--card); border-style: dashed; box-shadow: none; }

.board--hero { max-width: 460px; }
.board--mini { gap: 8px; }
.board--mini .cell { font-size: 24px; border-radius: var(--r-md); }

/* 首屏入场：整段文案一次淡入，盘面九格错峰浮现（reduced-motion 下全部关闭） */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy { opacity: 0; animation: rise 0.6s ease-out 0.1s forwards; }
  .board--hero .cell {
    opacity: 0; transform: translateY(10px) scale(0.96);
    animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
    animation-delay: calc(160ms + var(--i) * 70ms);
  }
  .board--hero .cell--core {
    animation-name: core-in;
    animation-delay: calc(160ms + 4 * 70ms);
  }
}
@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes core-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  62% { transform: scale(1.04); }
  100% { opacity: 1; transform: none; }
}

/* ===== 通用分节 ===== */
.section { padding: 84px 0 20px; }
.section h2 {
  margin: 0 0 10px; font-size: clamp(26px, 3.4vw, 34px); font-weight: 800;
}
.section-lead { margin: 0 0 28px; color: var(--text-2); }

/* ===== 两款玩法：左右分栏、下一组反转 ===== */
.game {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 56px; align-items: center;
  padding: 44px 0;
}
.game-copy h3 { margin: 0 0 10px; font-size: 24px; font-weight: 800; }
.game-desc { margin: 0 0 14px; font-size: 17px; color: var(--ink); }
.game-rule { margin: 0; font-size: 15px; line-height: 1.9; color: var(--text-2); }
.game--flip .game-copy { order: 2; }
.game--flip .game-visual { order: 1; }

.panel {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); box-shadow: var(--shadow-card);
  padding: 28px;
}
.panel-note { margin: 16px 0 0; font-size: 13px; line-height: 1.7; color: var(--text-3); }

/* 24点示例：数字块与真实算式 */
.tiles { display: flex; gap: 10px; margin-bottom: 18px; }
.tile {
  display: grid; place-items: center; width: 58px; height: 58px;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-md); box-shadow: var(--shadow-card);
  font-family: var(--font-num); font-size: 24px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.expr {
  margin: 0; font-family: var(--font-num);
  font-size: clamp(19px, 2.2vw, 24px); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.expr b { color: var(--brand-text); font-size: 1.25em; }

/* ===== 产品特色：横线分行，不用卡片阵列 ===== */
.features { list-style: none; margin: 0; padding: 0; }
.features li {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
  padding: 22px 4px; border-top: 1px solid var(--divider);
}
.features li:last-child { border-bottom: 1px solid var(--divider); }
.features h3 { margin: 0; font-size: 17px; font-weight: 700; }
.features h3::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  margin-right: 10px; border-radius: 2px;
  background: var(--brand); vertical-align: 1px;
}
.features p { margin: 0; color: var(--text-2); }

/* ===== 解题技巧：分组定义列表 ===== */
.tip-group { margin-top: 40px; }
.tip-group h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.tip-group dl { margin: 0; }
.tip {
  display: grid; grid-template-columns: 200px 1fr; gap: 28px;
  padding: 16px 4px; border-top: 1px solid var(--divider);
}
.tip-group dl .tip:last-child { border-bottom: 1px solid var(--divider); }
.tip dt { font-weight: 700; }
.tip dd { margin: 0; color: var(--text-2); }

/* ===== 开始使用：真实步骤序号 ===== */
.steps {
  list-style: none; counter-reset: step; margin: 36px 0 36px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; margin-bottom: 12px;
  border-radius: 999px; background: var(--brand-tint);
  color: var(--brand-text);
  font-family: var(--font-num); font-size: 17px; font-weight: 700;
}
.steps h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.steps p { margin: 0; font-size: 15px; color: var(--text-2); }

.section--cta { text-align: center; }
.section--cta h2 { margin-bottom: 0; }
.section--cta .steps { text-align: left; }

/* ===== 页脚 ===== */
.site-foot {
  margin-top: 84px; background: var(--card);
  border-top: 1px solid var(--hairline);
}
.foot-row { padding: 36px 24px 44px; text-align: center; }
.foot-brand { margin: 0 0 6px; font-weight: 600; }
.foot-kw { margin: 0 0 10px; font-size: 13px; color: var(--text-3); }
.foot-fine { margin: 0; font-size: 13px; color: var(--text-3); }
.foot-fine-beian { margin: 0; font-size: 13px; color: var(--text-3); }
.foot-fine-beian a { text-decoration: none; color: var(--text-3);}

/* ===== 响应式 ===== */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; padding-top: 48px; padding-bottom: 64px; }
  .board--hero { margin: 0 auto; }
  .hero-board { text-align: center; }
  .hero-board figcaption { max-width: 34em; margin-left: auto; margin-right: auto; }
  .game { grid-template-columns: 1fr; gap: 28px; padding: 36px 0; }
  .game--flip .game-copy { order: 1; }
  .game--flip .game-visual { order: 2; }
  .features li { grid-template-columns: 1fr; gap: 6px; padding: 18px 4px; }
  .tip { grid-template-columns: 1fr; gap: 4px; padding: 14px 4px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .head-row { justify-content: space-between; }
  .slogan { font-size: clamp(38px, 11vw, 52px); }
}
