/* ============================================
   MDEditor 官网 - 宇宙感首屏
   深空底 + 来源星球 → 转换器 → 交付成品
   ============================================ */

:root {
  /* 文字 */
  --text: #eef2fb;
  --text-2: #a8b3cc;
  --text-3: #6f7b96;

  /* 深空背景 */
  --bg: #05070f;
  --bg-soft: #0a0e1c;
  --bg-line: rgba(126, 148, 200, 0.16);

  /* 品牌／光效 */
  --brand: #4d7dff;
  --brand-lit: #7aa2ff;
  --cyan: #45e0e8;
  --violet: #9b6cff;

  /* 尺寸 */
  --wrap: 1180px;
  --radius: 10px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
          'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================
   顶栏
   ============================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.topbar.is-stuck {
  border-bottom-color: var(--bg-line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ============================================
   按钮
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
              box-shadow 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  line-height: 1.15;
}

.btn-copy small {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.72;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.35),
              0 8px 28px -8px rgba(77, 125, 255, 0.7);
}

.btn-primary:hover {
  box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.55),
              0 10px 34px -8px rgba(77, 125, 255, 0.9);
}

.btn-ghost {
  background: rgba(126, 148, 200, 0.08);
  color: var(--text);
  border: 1px solid var(--bg-line);
}

.btn-ghost:hover {
  border-color: rgba(122, 162, 255, 0.5);
}

.btn-sm {
  padding: 0.4375rem 1rem;
  font-size: 0.8125rem;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
}

.btn.is-off {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================
   首屏容器与深空背景
   ============================================ */

.hero {
  position: relative;
  padding: 4rem 0 5.5rem;
  text-align: center;
  overflow: hidden;
}

/* 星点：多层 radial-gradient，避免引图片 */
.starfield {
  position: absolute;
  inset: -10% 0 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1.2px 1.2px at 27% 62%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.6px 1.6px at 41% 12%, rgba(190,215,255,0.7), transparent),
    radial-gradient(1px 1px at 55% 78%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 68% 30%, rgba(255,255,255,0.65), transparent),
    radial-gradient(1.1px 1.1px at 79% 68%, rgba(200,220,255,0.55), transparent),
    radial-gradient(1.3px 1.3px at 88% 22%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 8% 84%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.2px 1.2px at 34% 91%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.4px 1.4px at 62% 6%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 94% 52%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.2px 1.2px at 18% 44%, rgba(180,205,255,0.5), transparent);
  animation: twinkle 6s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.45; }
}

/* 星云：两团柔光，一冷一紫 */
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.nebula-a {
  top: -14rem;
  left: 50%;
  width: 46rem;
  height: 32rem;
  margin-left: -23rem;
  background: radial-gradient(circle, rgba(77, 125, 255, 0.28), transparent 68%);
}

.nebula-b {
  bottom: -18rem;
  left: 50%;
  width: 38rem;
  height: 28rem;
  margin-left: -19rem;
  background: radial-gradient(circle, rgba(155, 108, 255, 0.2), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  padding: 0.25rem 0.875rem;
  border: 1px solid var(--bg-line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--brand-lit);
  background: rgba(77, 125, 255, 0.08);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.125rem, 4.4vw, 3.25rem);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #ffffff 30%, #a9bfef 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lede {
  max-width: 34rem;
  margin: 0 auto 3.75rem;
  font-size: 1rem;
  color: #67c7ff;
  text-shadow: 0 0 12px rgba(103, 199, 255, 0.35);
}

.hero-cta {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3.75rem;
  scroll-margin-top: 80px;
}

.hero-meta {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}

/* ============================================
   宇宙链路：来源星球 → 转换器 → 交付成品
   ============================================ */

.cosmos {
  position: relative;
  display: grid;
  grid-template-columns: 14rem 1fr minmax(0, 14rem) 1fr 14rem;
  align-items: center;
}

.cosmos-beams {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.orbit {
  position: relative;
}

.orbit-cap {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 2rem;
  transform: translateY(-50%);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--text-3);
  text-transform: uppercase;
}

.orbit-in .orbit-cap { right: -1.25rem; }
.orbit-out .orbit-cap { left: -1.25rem; }

/* 对象层和光束层重叠，星球可以占用整段线路空间 */
.orbit-in { grid-column: 1 / 3; grid-row: 1; z-index: 2; }
.beam-in-space { grid-column: 1 / 3; grid-row: 1; }
.core { grid-column: 3; grid-row: 1; z-index: 3; }
.beam-out-space { grid-column: 4 / 6; grid-row: 1; }
.orbit-out { grid-column: 4 / 6; grid-row: 1; z-index: 2; }

/* 星球散布：绝对定位，坐标和大小由行内 --x/--y/--s 给 */
.planets {
  position: relative;
  height: 21rem;
}

.planet {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4375rem;
  transform: translate(-50%, -50%);
}

/* 星球本体：球面渐变 + 外发光，尺寸跟随 --s */
.planet-body {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--s) * var(--k, 1));
  height: calc(var(--s) * var(--k, 1));
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%,
      rgba(180, 205, 255, 0.28) 0%,
      rgba(40, 58, 110, 0.55) 55%,
      rgba(10, 14, 28, 0.9) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(150, 180, 255, 0.22),
    inset -6px -8px 14px rgba(0, 0, 0, 0.55),
    0 0 18px -4px rgba(77, 125, 255, 0.45);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* 漂浮加在外层，避免和 hover 的 transform 打架；相位由 --d 错开 */
.planet {
  animation: drift 7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* 位移必须带上居中的 -50%，否则会顶掉定位 */
@keyframes drift {
  0%, 100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 7px)); }
}

.planet-body svg {
  width: calc(var(--s) * var(--k, 1) * 0.36);
  height: calc(var(--s) * var(--k, 1) * 0.36);
  fill: none;
  stroke: var(--brand-lit);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.planet-body .icon-solid {
  width: calc(var(--s) * var(--k, 1) * 0.42);
  height: calc(var(--s) * var(--k, 1) * 0.42);
  stroke: #fff;
  stroke-width: 1.35;
}

.icon-solid > :first-child { fill: var(--icon-color); stroke: none; }
.icon-solid > :not(:first-child) { fill: #fff; stroke: none; }
.icon-word { --icon-color: #2b72d6; }
.icon-ppt { --icon-color: #d85b32; }
.icon-pdf { --icon-color: #e5484d; }
.icon-ai { --icon-color: #7567f8; }
.icon-markdown { --icon-color: #3978d4; }
.icon-html { --icon-color: #e55b2d; }

.planet:hover .planet-body {
  transform: translateY(-3px) scale(1.06);
  box-shadow:
    inset 0 0 0 1px rgba(180, 205, 255, 0.4),
    inset -6px -8px 14px rgba(0, 0, 0, 0.5),
    0 0 26px -2px rgba(122, 162, 255, 0.7);
}

.planet-name {
  font-size: 0.75rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
}

/* 可编辑 PPTX 高亮：青色区分 */
.planet-hl .planet-body {
  background:
    radial-gradient(circle at 32% 28%,
      rgba(160, 245, 250, 0.3) 0%,
      rgba(20, 80, 95, 0.6) 55%,
      rgba(8, 18, 26, 0.92) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(69, 224, 232, 0.35),
    inset -6px -8px 14px rgba(0, 0, 0, 0.5),
    0 0 22px -3px rgba(69, 224, 232, 0.5);
}

.planet-hl .planet-body svg {
  stroke: var(--cyan);
}

.planet-hl .planet-name {
  color: var(--cyan);
}

/* ============================================
   光束
   ============================================ */

.beam {
  position: relative;
  height: 21rem;
  min-width: 3rem;
}

.cosmos-beams {
  display: block;
}

.cosmos-beams .beam-in,
.cosmos-beams .beam-out {
  display: block;
}

.beam-line path {
  fill: none;
  stroke: rgba(126, 148, 200, 0.2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* 沿连接线跑动的粒子流：每条路径只保留一段细光束 */
.beam-pulse path {
  fill: none;
  stroke: var(--brand-lit);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-dasharray: 26 500;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px rgba(122, 162, 255, 0.85));
  animation: pulse 8.9s linear infinite;
}

.beam-out .beam-pulse path {
  stroke: var(--cyan);
  filter: drop-shadow(0 0 4px rgba(69, 224, 232, 0.9));
}

.beam-in .beam-pulse path:nth-child(1) { animation-delay: 0s; }
.beam-in .beam-pulse path:nth-child(2) { animation-delay: 0.18s; }
.beam-in .beam-pulse path:nth-child(3) { animation-delay: 0.36s; }
.beam-in .beam-pulse path:nth-child(4) { animation-delay: 0.54s; }
.beam-in .beam-pulse path:nth-child(5) { animation-delay: 0.72s; }

/* 出口晚 1.1s，形成「先进后出」的因果感 */
.beam-out .beam-pulse path:nth-child(1) { animation-delay: 1.1s; }
.beam-out .beam-pulse path:nth-child(2) { animation-delay: 1.24s; }
.beam-out .beam-pulse path:nth-child(3) { animation-delay: 1.38s; }
.beam-out .beam-pulse path:nth-child(4) { animation-delay: 1.52s; }
.beam-out .beam-pulse path:nth-child(5) { animation-delay: 1.66s; }
.beam-out .beam-pulse path:nth-child(6) { animation-delay: 1.8s; }

/* 出口一侧染成青色，呼应「已转换」 */
.beam-out .beam-pulse path {
  stroke: var(--cyan);
  filter: drop-shadow(0 0 4px rgba(69, 224, 232, 0.9));
}

@keyframes pulse {
  from { stroke-dashoffset: 526; }
  to   { stroke-dashoffset: 0; }
}

/* ============================================
   中央转换器
   ============================================ */

.core {
  position: relative;
  display: grid;
  place-items: center;
  height: 19rem;
}

/* 底层光晕 */
.core-halo {
  position: absolute;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(77, 125, 255, 0.35) 0%,
    rgba(155, 108, 255, 0.14) 45%,
    transparent 70%);
  filter: blur(18px);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

/* 两圈旋转光环，做「过滤转换」的机械感 */
.core-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

.core-ring-1 {
  width: 11.5rem;
  height: 11.5rem;
  border-top-color: rgba(122, 162, 255, 0.55);
  border-right-color: rgba(122, 162, 255, 0.18);
  animation: spin 12s linear infinite;
}

.core-ring-2 {
  width: 13.5rem;
  height: 13.5rem;
  border-bottom-color: rgba(69, 224, 232, 0.45);
  border-left-color: rgba(69, 224, 232, 0.14);
  animation: spin 18s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.core-label {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  width: 8.5rem;
  height: 8.5rem;
  border: 1px solid rgba(122, 162, 255, 0.3);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, rgba(77, 125, 255, 0.18), rgba(10, 14, 28, 0.88) 68%);
  box-shadow: inset 0 0 1.75rem rgba(77, 125, 255, 0.1), 0 0 2rem rgba(77, 125, 255, 0.12);
  text-align: center;
}

.core-brand {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
  margin-bottom: 0.1875rem;
  text-shadow: 0 0 18px rgba(122, 162, 255, 0.55);
}

.core-fn {
  font-size: 1rem;
  color: #67c7ff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(103, 199, 255, 0.7);
}

/* ============================================
   页脚
   ============================================ */

.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--bg-line);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.footer-brand {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.footer-copy {
  margin-bottom: 0.375rem;
}

.footer-beian a {
  color: var(--text-3);
  transition: color 0.15s ease;
}

.footer-beian a:hover {
  color: var(--brand-lit);
}

/* ============================================
   响应式
   ============================================ */

@media (max-width: 1080px) {
  .cosmos {
    grid-template-columns: 12rem 1fr minmax(0, 12rem) 1fr 12rem;
  }

  .beam { min-width: 2rem; }

  /* 整体等比缩一档，尺寸差异保持不变 */
  .planet { --k: 0.88; }
}

/* 窄屏：链路转 90 度，来源在上、成品在下 */
@media (max-width: 900px) {
  .cosmos {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
  }

  .orbit,
  .beam,
  .core {
    grid-column: auto;
    grid-row: auto;
  }

  .orbit {
    width: 100%;
    max-width: 24rem;
  }

  .orbit-cap,
  .orbit-in .orbit-cap,
  .orbit-out .orbit-cap {
    position: static;
    width: auto;
    transform: none;
    margin-bottom: 1.25rem;
    text-align: center;
  }

  .orbit-cap br { display: none; }

  /* 窄屏放弃散布坐标，改成平铺，尺寸分级仍然保留 */
  .planets {
    position: static;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1.25rem 1rem;
  }

  .planet {
    position: static;
    transform: none;
    animation-name: drift-flat;
  }

  @keyframes drift-flat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
  }

  .beam {
    width: 100%;
    max-width: 17rem;
    height: 4.5rem;
    min-width: 0;
    transform: rotate(90deg);
    margin: -6rem 0;
  }

  .core {
    height: auto;
    padding: 3rem 0;
  }

  .core-halo {
    width: 12rem;
    height: 12rem;
  }

  .core-ring-1 { width: 9.5rem; height: 9.5rem; }
  .core-ring-2 { width: 11rem; height: 11rem; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 1.25rem; }

  .planet { --k: 0.72; }

  .planet-name { font-size: 0.6875rem; }

  .hero-cta .btn {
    width: 100%;
  }
}

/* 尊重系统减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .starfield,
  .beam-pulse,
  .core-halo,
  .core-ring {
    animation: none;
  }

  .beam-pulse { display: none; }

  .planet {
    animation: none;
  }

  html { scroll-behavior: auto; }
}
