/* ============================================================
   财跃星辰 官网 · 基础样式
   目录：
   0. 动效偏好
   1. 设计 Token
   2. 基础与工具类
   3. 顶部导航
   4. Hero
   5. 通用 Section
   6. 产品卡片
   7. 页脚
   8. 响应式
   ============================================================ */

/* ============================================
   0. 动效偏好（尊重系统「减少动效」设置）
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   1. 设计 Token
   ============================================ */
:root {
  /* 字号（1.25 倍节奏） */
  --fs-display: clamp(32px, 4.6vw, 54px);
  --fs-h1:      clamp(28px, 3.6vw, 42px);
  --fs-h2:      clamp(24px, 3vw, 34px);
  --fs-h3:      22px;
  --fs-h4:      18px;
  --fs-body:    16px;
  --fs-sm:      14px;
  --fs-xs:      13px;

  /* 字重 */
  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* 字间距 */
  --ls-tight:  -0.02em;
  --ls-normal: 0;
  --ls-wide:   0.06em;
  --ls-wider:  0.14em;

  /* 行高 */
  --lh-tight:  1.16;
  --lh-snug:   1.35;
  --lh-normal: 1.6;
  --lh-loose:  1.75;

  /* 圆角 */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(10,22,48,.04);
  --shadow-sm: 0 2px 8px rgba(10,22,48,.05), 0 1px 2px rgba(10,22,48,.04);
  --shadow-md: 0 8px 24px rgba(10,22,48,.07), 0 2px 6px rgba(10,22,48,.04);
  --shadow-lg: 0 24px 48px rgba(10,22,48,.10), 0 8px 16px rgba(10,22,48,.05);

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --max:  1200px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   2. 基础与工具类
   ============================================ */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* overflow-x: clip 不会产生滚动容器，可避免 sticky 顶栏失效 */
@supports (overflow: clip) {
  body { overflow-x: clip; }
}

h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--brand-accent); color: #fff; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 滚动渐显（仅在 JS 可用时隐藏初始状态，避免关闭 JS 后内容不可见） */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal[data-delay="1"] { transition-delay: .08s; }
html.js .reveal[data-delay="2"] { transition-delay: .16s; }
html.js .reveal[data-delay="3"] { transition-delay: .24s; }
html.js .reveal[data-delay="4"] { transition-delay: .32s; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; height: 50px; padding: 0 28px;
  border-radius: var(--r-pill);
  font-size: var(--fs-body); font-weight: var(--fw-semibold);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              border-color .25s, color .25s, background-color .25s;
}
.btn-primary {
  background-image: var(--brand-grad);
  color: #fff;
  box-shadow: 0 12px 30px rgba(var(--brand-violet-rgb),.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(var(--brand-violet-rgb),.38); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--brand-deep); color: var(--brand-deep); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn svg { transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

/* ============================================
   3. 顶部导航
   ============================================ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(10,22,48,.05); }

.nav { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 16px; }

.brand { display: inline-flex; align-items: center; }
.brand img { height: 34px; width: auto; }

/* 导航文字：对齐官方稿——加粗、深墨色、大间距、无下划线 */
.menu { display: flex; align-items: center; gap: 40px; }
.menu > a {
  padding: 6px 0;
  font-size: var(--fs-body); font-weight: var(--fw-semibold);
  color: var(--ink);
  transition: color .25s;
}
/* .menu > a:hover { color: var(--brand-violet); }
.menu > a.active { color: var(--brand-violet); } */
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px;
  color: var(--ink); border: 1px solid var(--line);
  background: var(--surface);
}

/* ============================================
   4. Hero
   ============================================ */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  position: absolute; inset: -10%;
  background-image:
    linear-gradient(rgba(16,24,40,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,24,40,.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 62% 58% at 50% 34%, #000 8%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 34%, #000 8%, transparent 74%);
}


.hero-constellation { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }

.hero-stars { position: absolute; inset: 0; }
.hero-stars span {
  position: absolute; border-radius: 50%; background: var(--brand-violet);
  animation: twinkle 3.4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.7); }
  50%      { opacity: .9; transform: scale(1.15); }
}

.hero-inner { position: relative; padding: 92px 0 88px; text-align: center; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide); color: var(--ink-soft);
  backdrop-filter: blur(8px);
}
.hero-eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-mint);
  box-shadow: 0 0 0 0 rgba(var(--brand-mint-rgb),.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--brand-mint-rgb),.55); }
  70%  { box-shadow: 0 0 0 12px rgba(var(--brand-mint-rgb),0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--brand-mint-rgb),0); }
}

.hero-title {
  margin: 26px auto 0;          /* 居中 */
  width: fit-content;           /* 渐变贴合文字宽度，避免只显示渐变前半段 */
  max-width: 15em;
  min-height: 1.2em;            /* 随轮播换文案时避免高度跳动 */
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  background: var(--brand-violet);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* 换屏时整行淡入上浮（渐变文字不适合逐字拆分，逐字效果由下方描述承担） */
.hero-title.is-anim { animation: titleIn .75s var(--ease); }
@keyframes titleIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.hero-rot { margin: 22px auto 0; max-width: 34em; }
.hero-rot-stack { display: grid; }
.hero-rot-item {
  grid-area: 1 / 1;
  font-size: var(--fs-h4);
  line-height: var(--lh-loose);
  color: var(--ink-soft);
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease), visibility .5s;
}
.hero-rot-item.is-active { opacity: 1; visibility: visible; }
.hero-rot-item .c {
  display: inline-block;
  opacity: 0;
  transform: translateY(.5em);
  filter: blur(4px);
}
.hero-rot-item.is-active .c {
  animation: charIn .62s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes charIn {
  from { opacity: 0; transform: translateY(.5em); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; justify-content: center; }

.hero-meta {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 34px;
  font-size: var(--fs-xs); color: var(--ink-mute);
  letter-spacing: var(--ls-wide);
}
/* 进度点：可点击手动切屏 */
.hero-rot-dots { display: inline-flex; gap: 6px; align-items: center; }
.hero-dot {
  position: relative;
  width: 26px; height: 16px; padding: 0;
  border-radius: 4px; background: none; cursor: pointer;
}
.hero-dot::before {                 /* 轨道 */
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; margin-top: -2px; border-radius: 3px;
  background: rgba(98,71,220,.22);
  transition: background-color .25s;
}
.hero-dot::after {                  /* 进度填充 */
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; margin-top: -2px; border-radius: 3px;
  background: var(--brand-grad);
  transform: scaleX(0); transform-origin: left center;
}
.hero-dot.is-active::after { animation: dotFill 2.9s linear forwards; }
.hero-dot:hover::before { background: rgba(98,71,220,.30); }
.hero-dot:focus-visible { outline: 2px solid var(--brand-violet); outline-offset: 2px; }
@keyframes dotFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-rot-seq b { color: var(--brand-violet); font-weight: var(--fw-bold); }

/* ============================================
   5. 通用 Section
   ============================================ */
.section-head { margin-bottom: 48px; }
.section-head.center { text-align: center; }
.section-eyebrow {
  display: inline-block;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider); text-transform: uppercase;
  color: var(--brand-violet);
  padding: 5px 14px; border-radius: var(--r-pill);
  background: var(--primary-soft);
  margin-bottom: 18px;
}
.section-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
}
.section-desc {
  margin-top: 14px;
  color: var(--ink-mute);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
  max-width: 62ch;
}
.section-head.center .section-desc { margin-left: auto; margin-right: auto; }

/* ============================================
   6. 产品卡片
   ============================================ */
.products {
  position: relative;
  padding: 96px 0 104px;
  /* background: var(--bg-soft); */
  overflow: hidden;
}
.products::before {
  content: ''; position: absolute; inset: 0;
  /* background:
    radial-gradient(circle at 8% 12%, rgba(204,30,126,.05), transparent 45%),
    radial-gradient(circle at 92% 88%, rgba(98,71,220,.07), transparent 48%); */
  pointer-events: none;
}
.products .container { position: relative; }

.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }

.product {
  --accent: var(--brand-accent);
  --accent-2: var(--brand-violet);
  --accent-rgb: var(--brand-accent-rgb);
  --accent-grad: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  scroll-margin-top: calc(var(--nav-h) + 20px);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 40px 36px 34px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
/* 两条产品线统一为官方宝蓝 #3965FE（如需恢复 X-Eva 玫红：把它的 --accent 改回 var(--brand-accent)*） */
.product--eva,
.product--camp { --accent: #3965FE; --accent-2: #6E93FF; --accent-rgb: 57,101,254; }

.product::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: var(--accent-grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.product::after {
  content: ''; position: absolute; top: -130px; right: -130px;
  width: 300px; height: 300px; border-radius: 50%;
  background: var(--accent-grad);
  filter: blur(72px); opacity: .10;
  transition: opacity .4s; pointer-events: none;
}
/* 点击导航定位到本卡片时的高亮提示（两张卡锚点位置相同，需要可见反馈） */
.product.is-flash { animation: cardFlash 1.8s var(--ease); }
.product.is-flash::before { opacity: 1; }
@keyframes cardFlash {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-rgb),.45), var(--shadow-md); }
  35%  { box-shadow: 0 0 0 14px rgba(var(--accent-rgb),.12), var(--shadow-lg); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb),0), var(--shadow-sm); }
}

.product:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.product:hover::before { opacity: 1; }
.product:hover::after { opacity: .20; }
.product > * { position: relative; z-index: 1; }

.product-top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.product-icon {
  flex: 0 0 52px; width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background-image: var(--accent-grad);
  color: #fff;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb),.32);
  transition: transform .35s var(--ease);
}
.product:hover .product-icon { transform: rotate(-6deg) scale(1.06); }
.product-badge {
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  color: var(--accent);
  background: rgba(var(--accent-rgb),.10);
  border: 1px solid rgba(var(--accent-rgb),.16);
}

.product-name {
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}
.product-sub { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-faint); letter-spacing: var(--ls-wide); }
.product-desc { margin-top: 16px; font-size: var(--fs-sm); color: var(--ink-mute); line-height: var(--lh-loose); }

.product-features {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin: 26px 0 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.product-features li {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--fs-sm); color: var(--ink-soft);
}
.product-features li i {
  flex: 0 0 16px; width: 16px; height: 16px;
  border-radius: 50%;
  background-image: var(--accent-grad);
  position: relative;
}
.product-features li i::after {
  content: ''; position: absolute; left: 5px; top: 4px;
  width: 4px; height: 7px;
  border: solid #fff; border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

.product-foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.product-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 24px;
  border-radius: var(--r-pill);
  background-image: var(--brand-grad);
  color: #fff; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  box-shadow: 0 10px 26px rgba(var(--accent-rgb),.30);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.product-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(var(--accent-rgb),.42); }
.product-cta svg { transition: transform .25s var(--ease); }
.product-cta:hover svg { transform: translateX(3px); }
.product-domain {
  font-size: var(--fs-xs); color: var(--ink-faint);
  letter-spacing: var(--ls-wide);
  font-family: "SF Mono", Consolas, "Courier New", monospace;
}

/* ============================================
   7. 联系我们 / 页脚
   ============================================ */
.footer {
  position: relative;
  overflow: hidden;
  padding: 78px 0 30px;
  color: rgba(255,255,255,.72);
  background:
    radial-gradient(ellipse 72% 62% at 50% 0%, rgba(98,71,220,.10), transparent 64%),
    radial-gradient(ellipse 60% 50% at 86% 104%, rgba(204,30,126,.06), transparent 60%),
    linear-gradient(180deg, #080A1A 0%, #04060D 100%);
}

/* 星空：星尘 + 亮星双层，均由 JS 生成（见 assets/main.js） */
.footer-stars { position: absolute; inset: 0; color: #CFE0FF; pointer-events: none; }
.footer-stars span {
  position: absolute; border-radius: 50%;
  background: currentColor;
  animation: twinkle 3.4s ease-in-out infinite;
}
.footer-inner { position: relative; z-index: 1; }

.footer-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  /* margin-top: 46px; */
  /* padding-top: 10px; */
}
.footer-brand img { height: 44px; width: auto; }
.footer-brand strong { display: block; color: #fff; font-size: 15px; font-weight: var(--fw-semibold); letter-spacing: .04em; }
.footer-brand span { display: block; margin-top: 5px; font-size: var(--fs-xs); color: rgba(255,255,255,.55); letter-spacing: var(--ls-wide); }

/* 底栏：三栏 + 竖向分隔线 */
.footer-bottom {
  /* display: grid; grid-template-columns: repeat(3, 1fr); */
  align-items: center;
  text-align: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,.55);
}
.footer-bottom > * { position: relative; text-align: center; }
.footer-bottom > * + *::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 1px; height: 14px; margin-top: -7px;
  background: rgba(255,255,255,.16);
}
.footer-legal { color: rgba(255,255,255,.55); }
.footer-icp { color: rgba(255,255,255,.55); letter-spacing: var(--ls-wide); }
.footer-bottom a { color: rgba(255,255,255,.55); transition: color .25s; }
.footer-bottom a:hover { color: #fff; }

/* ============================================
   8. 响应式
   ============================================ */
@media (max-width: 1000px) {
  .products-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .menu-toggle { display: inline-flex; }
  .menu {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px 20px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(10,22,48,.10);
    transform-origin: top center;
    display: none;
  }
  .menu.open { display: flex; animation: menuIn .28s var(--ease); }
  @keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  .menu > a { padding: 12px 10px; font-size: var(--fs-body); }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .hero-inner { padding: 66px 0 70px; }
  .products { padding: 72px 0 80px; }
  .section-head { margin-bottom: 34px; }
  .product { padding: 32px 24px 28px; }
  .product-features { grid-template-columns: 1fr 1fr; gap: 10px; }
  .btn { width: 100%; max-width: 320px; }
  .hero-actions { flex-direction: column; align-items: center; gap: 12px; }
  .hero-actions .btn { width: 100%; max-width: 320px; }

  /* 页脚：单列堆叠，去掉竖向分隔线 */
  .footer { padding: 58px 0 26px; }
  .footer-contacts { flex-direction: column; gap: 12px; margin-top: 24px; }
  .footer-brand { margin-top: 34px; padding-top: 30px; }
  .footer-bottom { grid-template-columns: 1fr; gap: 10px; margin-top: 28px; }
  .footer-bottom > * { text-align: left; }
  .footer-bottom > * + *::before { display: none; }
}

@media (max-width: 460px) {
  .product-features { grid-template-columns: 1fr; }
  .product-foot { flex-direction: column; align-items: flex-start; }
  .product-cta { width: 100%; justify-content: center; }
  .footer-brand img { height: 38px; }
}
