/*
 * 首页精修层：叠加在 home.css 之后，只做视觉细化，不改结构与交互。
 * 1. 数字改用 Geist 等宽数字，避免中文混排时等宽字体显得生硬
 * 2. 所有示意发票统一使用数电票票样（static/picture/invoice-sample.svg）
 * 3. 内容默认可见，滚动动效只做轻微位移，杜绝整段空白
 */

html:root {
  --site-font-num: "Geist", "Geist Fallback", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: var(--site-font-num);
  --inv-frame: #c9d6cf;
}

body,
.num,
[data-count] {
  font-variant-numeric: tabular-nums;
}

/* ---------- 内容默认可见 ---------- */
html.io .reveal {
  opacity: 1;
  transform: translateY(10px);
}

html.io .reveal.vis {
  transform: none;
}

html.io #a4 .cell,
html.io .msheet {
  opacity: 1;
}

/* ---------- 首屏：去掉飘散纸条，纸张更干净 ---------- */
.hero-visual .scatter {
  display: none;
}

/* ---------- 示意发票：统一使用数电票票样 SVG ---------- */
#a4 .cell,
.msheet .g,
.a4mini .g,
.mini .half {
  position: relative;
  padding: 0;
  border: 1px solid var(--inv-frame);
  border-radius: 2px;
  background: #fff url("../picture/invoice-sample.svg") center / contain no-repeat;
  overflow: hidden;
}

#a4 .cell::before,
#a4 .cell::after,
.msheet .g::before,
.msheet .g::after,
.a4mini .g::before,
.a4mini .g::after,
.mini .half::before,
.mini .half::after {
  content: none;
}

#a4 .cell .l {
  display: none;
}

/* 10 联最常用于批量打印铁路电子客票，换用客票票样 */
#a4[data-layout="10"] .cell,
.msheet[data-n="10"] .g {
  background-image: url("../picture/train-ticket-sample.svg");
}

/* ---------- 首屏下方与第一屏的衔接 ---------- */
.hero + .block,
header + .block {
  padding-top: 72px;
}

/* ---------- 功能区示意窗：放大合并预览，填满空窗 ---------- */
.feature-lead .lead-shot .win .body {
  grid-template-columns: minmax(0, 0.8fr) auto minmax(0, 1.7fr);
  padding: 22px 18px;
}

.feature-lead .win .a4mini .grid {
  gap: 6px;
}

.feature-lead .win .a4mini .grid {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.feature-lead .win .stack {
  gap: 10px;
}

.feature-lead .lead-shot {
  justify-content: center;
}

.feature-lead .lead-shot .win,
.feature-lead .lead-shot .win .body {
  flex: none;
}

/* ---------- 适用人群：四类用户平级，等宽四列 ---------- */
.persona-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.persona,
.persona:nth-child(4) {
  grid-column: auto;
  background: var(--surface);
  border-color: rgba(20, 33, 29, 0.06);
}

/* ---------- 典型场景：保留卡片，改为等宽 2×2，四个场景平级 ---------- */
.scene-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.scene {
  padding: 22px 24px;
  align-items: center;
}

.scene .sic {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r2);
  background: var(--accent-tint);
  color: var(--accent);
}

.scene h3 {
  font-size: 1.02rem;
}

.scene p {
  font-size: 0.92rem;
}

@media (max-width: 1100px) {
  .persona-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 移动端：首屏样张后的衬纸比预览区高，上下留出空间避免压住规格文字 */
@media (max-width: 900px) {
  .preview {
    padding-block: 36px 28px;
  }
}

@media (max-width: 640px) {
  .persona-grid,
  .scene-list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 手机端功能卡片单列，避免窄列挤字和空格 */
  .bento .tile,
  .bento .tile:nth-child(n) {
    grid-column: 1 / -1;
  }
}

/* ---------- 主按钮流光：悬停扫一次，首屏主按钮加载后自动扫一次，不循环 ---------- */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary:hover {
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2) inset, 0 14px 30px -12px rgba(13, 92, 74, 0.8);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: -2px auto -2px 0;
  width: 46%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.42) 50%, rgba(255, 255, 255, 0.08) 70%, transparent 100%);
  transform: translateX(-130%) skewX(-18deg);
  pointer-events: none;
  z-index: 1;
}

.btn-primary:hover::after,
.btn-primary:focus-visible::after {
  animation: btn-sheen 0.9s var(--site-ease);
}

.hero .btn-primary.btn-lg::after {
  animation: btn-sheen 1.1s var(--site-ease) 0.9s 1 both;
}

.hero .btn-primary.btn-lg:hover::after {
  animation: btn-sheen 0.9s var(--site-ease);
}

@keyframes btn-sheen {
  from { transform: translateX(-130%) skewX(-18deg); }
  to { transform: translateX(330%) skewX(-18deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary::after {
    display: none;
  }
}

/* ---------- 底部浮动条：返回顶部未出现时不占位，滚到位置后整体展开 ---------- */
.float-stack .to-top {
  max-width: 96px;
  white-space: nowrap;
  transition: max-width 0.36s var(--site-ease), padding 0.36s var(--site-ease),
    margin 0.36s var(--site-ease), opacity 0.24s var(--site-ease) 0.08s,
    color 0.2s var(--site-ease), background 0.2s var(--site-ease), transform 0.22s var(--site-ease);
}

.float-stack .to-top:not(.show) {
  max-width: 0;
  padding-inline: 0;
  margin-left: -2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-width 0.3s var(--site-ease), padding 0.3s var(--site-ease),
    margin 0.3s var(--site-ease), opacity 0.12s var(--site-ease);
}

@media (prefers-reduced-motion: reduce) {
  .float-stack .to-top,
  .float-stack .to-top:not(.show) {
    transition: none;
  }
}

/* ---------- 小程序区：二维码放光 ---------- */
/* 1. 卡片右侧一层静态的暖金色光晕，把视线引到二维码 */
.xcx-card {
  background:
    radial-gradient(ellipse 46% 80% at 86% 50%, rgba(245, 176, 52, 0.11), transparent 70%),
    var(--surface);
}

/* 2. 二维码背后缓慢呼吸的光 */
.xcx-qr::before {
  content: "";
  position: absolute;
  top: 46%;
  left: 50%;
  width: 118%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 176, 52, 0.34) 0%, rgba(255, 128, 72, 0.12) 42%, transparent 68%);
  filter: blur(6px);
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0.6;
  z-index: -1;
  pointer-events: none;
  animation: xcx-breathe 4.8s ease-in-out infinite;
}

/* 3. 二维码边框上一道绕行的流光 */
.xcx-qr button {
  position: relative;
  isolation: isolate;
  box-shadow: 0 0 0 1px rgba(245, 176, 52, 0.14), 0 20px 44px -24px rgba(214, 140, 30, 0.5);
  overflow: hidden;
  border-color: transparent;
}

.xcx-qr button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 200deg, rgba(245, 176, 52, 0.25) 270deg, #f5a623 330deg, #fff4d6 352deg, transparent 360deg);
  transform: translate(-50%, -50%) rotate(0deg);
  z-index: -2;
  animation: xcx-orbit 5.5s linear infinite;
}

.xcx-qr button::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: calc(var(--r3) - 3px);
  background: #fff;
  z-index: -1;
}

.xcx-qr button:hover::before {
  animation-duration: 2.4s;
}

@keyframes xcx-breathe {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes xcx-orbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .xcx-qr::before,
  .xcx-qr button::before {
    animation: none;
  }
}
