/* ============================================================
   Base · Reset + Typography + Layout primitives
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 13px;
  scroll-behavior: smooth;
  background: var(--space-grad);   /* 最底层：纯色宇宙底（透不出上面任何层） */
  color: var(--c-paper);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.62;
  color: var(--c-paper);
  background: transparent;        /* 让 html 的背景透出，contour/stars 即可显示在它之上 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: 0.01em;
}
/* 罗盘金线 · 全站极淡黄道坐标网格 (fixed, 顶部渐隐) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-compass-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-compass-line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 130% 90% at 50% -5%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse 130% 90% at 50% -5%, #000 0%, transparent 72%);
}

img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--c-blue); color: var(--c-ink); }

/* ── Container ── */
.wrap       { width: var(--container); margin: 0 auto; }
.wrap-sm    { width: var(--container-sm); margin: 0 auto; }
.wrap-full  { width: 100%; margin: 0 auto; }

/* ── Typography ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-blue-l);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--c-blue), transparent);
  box-shadow: 0 0 8px var(--c-blue);
}
.eyebrow.paper { color: var(--c-blue-l); }
.eyebrow.paper::before { background: linear-gradient(90deg, var(--c-blue), transparent); }

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-paper-dim);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--c-paper-soft);
}

.h-display {
  font-size: 32px;
  line-height: 0.96;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.h-section {
  font-size: 32px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.025em;
}

/* 标题流光下划线：进入视口后由 motion.js 添加 .lit 触发 */
.h-section { position: relative; display: block; }
.h-section::after {
  content: "";
  position: absolute;
  left: 0; bottom: -0.18em;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: transform 900ms var(--ease-out), opacity 600ms var(--ease-out);
  box-shadow: 0 0 12px var(--c-gold);
}
.h-section.lit::after { transform: scaleX(1); opacity: 1; }
.section-head .eyebrow.lit { color: var(--c-gold); }
.section-head .eyebrow { transition: color 600ms var(--ease-out); }

.h-subsection {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em 0;
  max-width: 65ch;
  color: var(--c-paper-dim);
}
.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--c-paper);
  max-width: 60ch;
}
.quote {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.45;
  color: var(--c-paper);
  border-left: 2px solid var(--c-blue);
  padding-left: var(--s-5);
  margin: var(--s-6) 0;
}

/* ── Section frame · 透明融入星图 · 不用色块分界 ── */
section {
  position: relative;
  padding: clamp(72px, 10vw, 148px) 0;
  scroll-margin-top: 72px;
  background: transparent;
}
/* 极淡黄道坐标装饰 · 区分 section 而不用色块 */
section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    var(--nebula-1),
    var(--nebula-2),
    var(--nebula-3);
  opacity: 0.32;
  pointer-events: none;
}
/* 顶端的水平星座线 · section 之间的"星界线" */
section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-blue-l), transparent);
  opacity: 0.4;
  box-shadow: 0 0 12px var(--c-blue);
  pointer-events: none;
}
section > .wrap { position: relative; z-index: 1; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-8);
  max-width: 820px;
}
.section-head .num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-blue);
  letter-spacing: 0.3em;
  white-space: nowrap;
}
.section-head .num .coords {
  color: var(--c-paper-dim);
  font-weight: 400;
  letter-spacing: 0.12em;
  font-size: 11px;
  margin-left: 4px;
}

/* ── 痛点密度 · P1–P4 卡片紧缩 ── */
#problem .card { padding: var(--s-6); }
#problem .card p { font-size: 13px; line-height: 1.55; margin-bottom: var(--s-3); }
#problem .h-subsection { font-size: 18px; line-height: 1.25; }
#problem .stamp { font-size: 13px; padding: 4px 10px; }
#problem .section-head { margin-bottom: var(--s-6); }
#problem .grid { gap: var(--s-4); }

/* ── 星座装饰 · section 右上角 ── */
.celestial-deco {
  position: absolute;
  top: var(--s-7);
  right: var(--s-6);
  width: 96px;
  height: 52px;
  pointer-events: none;
  opacity: 0.65;
  z-index: 2;
}
.celestial-deco svg { width: 100%; height: 100%; }
@media (max-width: 820px) {
  .celestial-deco { width: 72px; height: 40px; top: var(--s-5); right: var(--s-4); opacity: 0.45; }
}
@media (max-width: 560px) {
  .celestial-deco { display: none; }
}

/* ── 星盘罗盘 · 全站唯一 · 固定屏幕右上角 (celestial.js 注入) ── */
.site-rose {
  position: fixed;
  top: 64px;
  right: 18px;
  width: 200px;
  height: 200px;
  pointer-events: none;
  opacity: 0.5;
  z-index: 2;
}
.site-rose svg { width: 100%; height: 100%; }
@media (max-width: 820px) {
  .site-rose { width: 140px; height: 140px; top: 56px; right: 8px; opacity: 0.4; }
}
@media (max-width: 560px) {
  .site-rose { width: 108px; height: 108px; opacity: 0.3; }
}

/* ── 极光带 · 缓慢漂移的宇宙尘埃 ── */
#aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 20% 20%, rgba(127,178,255,0.07), transparent 60%),
    radial-gradient(ellipse 100% 70% at 80% 60%, rgba(181,140,255,0.055), transparent 65%),
    radial-gradient(ellipse 90% 60% at 50% 90%, rgba(95,230,218,0.045), transparent 60%);
  animation: aurora-drift 60s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes aurora-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-2%, 1%) scale(1.03); }
  100% { transform: translate(1%, -1%) scale(1.02); }
}

/* ── 星图图例 · 设计解构六要素 (Sky Key) ── */
.sky-key {
  position: fixed;
  left: var(--s-5);
  bottom: var(--s-5);
  z-index: 50;
  padding: 12px 14px;
  border: 1px solid var(--c-line-2);
  border-radius: 12px;
  background: rgba(4,6,15,.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--c-paper-dim);
  max-width: 296px;
  pointer-events: none;
}
.sky-key .sk-title { color: var(--c-compass); letter-spacing: 0.2em; margin-bottom: 8px; }
.sky-key .sk-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sky-key .sk-sp { margin-bottom: 8px; }
.sky-key .sk-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 6px currentColor; }
.sky-key .sk-sp em { font-style: normal; color: var(--c-paper-dim); }
.sky-key .sk-el { display: inline-flex; align-items: center; gap: 3px; }
.sky-key .sk-el b { font-weight: 400; }
.sky-key { display: none; }   /* Round 33g: 用户反馈"图例隐藏吧"——全站隐藏 SKY KEY（之前仅 820px 以下隐藏） */

/* ── Grids ── */
.grid { display: grid; gap: var(--s-6); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
/* ── 强制上下布局工具类 ── */
.stack { grid-template-columns: 1fr !important; }            /* 始终单列（桌面+移动） */
@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .g-3 { grid-template-columns: repeat(2, 1fr); }
  .stack-mobile { grid-template-columns: 1fr !important; }   /* ≤820px 单列；桌面保持 .g-N 原列数 */
}
/* ── TAM/SAM 漏斗：默认填满右列（桌面靠 .tam-som-grid 的 aspect-ratio 撑高）；
   移动端由下方 ≤560px 的 #chart-funnel{height:260px} 覆盖为固定高度。
   注意：不能给 canvas 写内联 height:100%——移动端父级无确定高度会塌缩，且内联样式优先级会压过媒体查询。 ── */
#chart-funnel { width: 100%; height: 100%; display: block; }

@media (max-width: 560px) {
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .grid { gap: var(--s-4); }

  /* ── 瀑布流 · 移动端单列纵向堆叠（优先排版舒适，内容上下排列） ──
     纯卡片网格（痛点 / 解法 / 合规 / 定价 / 里程碑）移除 2 列 masonry，
     直接退回 grid 1fr 单列，卡片自上而下排列，保证窄屏阅读舒适。 */

  /* ── 全局排版 / 间距阶梯 ── */
  section { padding: 56px 0; }
  .section-head { margin-bottom: var(--s-6); }
  .section-head .num { white-space: normal; font-size: 11px; }   /* Round 33g: 移动端允许坐标行换行，消除 91px 横向溢出 */
  .hero-content { padding-top: 15vh; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.2em; }
  .hero-meta { gap: var(--s-5); }
  .hero-meta .item .v { font-size: 18px; }
  .btn { padding: 13px 20px; font-size: 13px; letter-spacing: 0.14em; }
  .btn .arrow { width: 14px; }

  /* ── TAM / SAM · 单列纵向堆叠（移除固定 aspect-ratio 防止塌缩） ── */
  .tam-som-grid {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
  }
  .tam-som-rows {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    padding: 0;
  }
  .tam-som-rows .slider-wrap { height: auto; width: 100%; }
  #chart-funnel { height: 260px; }

  /* ── 页脚 · 单列 ── */
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-5); }

  /* ── 图表容器收紧 ── */
  .chart-box { padding: var(--s-4); }
  .chart-box .desc { font-size: 11px; }

  /* ── 移动端隐藏工具类（由 JS 之外的静态规则兜底） ── */
  .hide-mobile { display: none !important; }
  /* Round 33n：移动端删除灰色 kicker 小标签（彩色 t-orange/t-red/t-gold 保留） */
  .kicker:not(.t-orange):not(.t-red):not(.t-gold) { display: none !important; }
}

/* ── Utility ── */
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }
.t-paper { color: var(--c-paper); }
.t-dim   { color: var(--c-paper-dim); }
.t-orange { color: var(--c-orange); }
.t-red   { color: var(--c-red); }
.t-jade  { color: var(--c-jade); }
.t-gold  { color: var(--c-gold); }
.t-blue  { color: var(--c-blue); }
.t-cyan  { color: var(--c-cyan); }
.t-violet{ color: var(--c-violet); }

.upper { text-transform: uppercase; letter-spacing: 0.18em; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-line-2), transparent);
  border: 0;
  margin: var(--s-7) 0;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--c-line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-paper-dim);
  white-space: nowrap;        /* Round 33l: 防止 "园区 / 算力中心 / 代工厂" 在窄卡内换行成两行 */
}
.tag.orange { color: var(--c-orange); border-color: var(--c-orange); }
.tag.red    { color: var(--c-alert);  border-color: var(--c-alert); }
.tag.blue   { color: var(--c-blue);   border-color: var(--c-blue); }
.tag.jade   { color: var(--c-jade);   border-color: var(--c-jade); }
.tag.gold   { color: var(--c-gold);   border-color: var(--c-gold); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 14px 24px;
  border: 1px solid var(--c-paper);
  color: var(--c-paper);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all 320ms var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c-paper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 480ms var(--ease-out);
  z-index: 0;
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn:hover { color: var(--c-ink); }
.btn > * { position: relative; z-index: 1; }
.btn .arrow {
  width: 16px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width 320ms var(--ease-out);
}
.btn .arrow::after {
  content: "";
  position: absolute;
  right: 0; top: -3px;
  width: 7px; height: 7px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arrow { width: 22px; }

.btn-primary {
  background: var(--c-orange);
  border-color: var(--c-orange);
  color: var(--c-ink);
}
.btn-primary::before { background: var(--c-paper); }
.btn-primary:hover { color: var(--c-ink); border-color: var(--c-paper); }

/* ── Card · 极细边框 + 角点装饰代替整圈 ── */
.card {
  background:
    radial-gradient(ellipse 120% 90% at 90% 0%, rgba(127,178,255,.05), transparent 55%),
    rgba(8, 12, 26, 0.4);
  border: 1px solid rgba(215, 224, 244, 0.06);
  border-radius: var(--radius-l);
  padding: var(--s-5);
  position: relative;
  overflow: hidden;
  transition: transform 480ms var(--ease-out), border-color 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
/* 顶部金色发丝线：悬停时展开，增加动态感 */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 12%;
  width: 76%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 520ms var(--ease-out), opacity 320ms var(--ease-out);
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 212, 121, 0.28);
  box-shadow: var(--sh-glow-gold), 0 18px 44px -20px rgba(0, 0, 0, 0.7);
}
.card:hover::before { transform: scaleX(1); opacity: 0.85; }
.card .corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--c-paper-dim);
  opacity: 0.55;
}
.card .corner::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-blue-l);
  box-shadow: 0 0 6px var(--c-blue);
}
.card .corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.card .corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.card .corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.card .corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }