:root {
  --ink: #12151a;
  --ink-soft: #3a4250;
  --paper: #f3f6fa;
  --accent: #0f6b5c;
  --accent-deep: #0a4f44;
  --radius-pc: 18px;
  --gap-side: clamp(18px, 4vw, 56px);
  --header-h: 64px;
  --stage-glow: #ffffff;
  --stage-tint: rgba(15, 107, 92, 0.06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f5f7;
    --ink-soft: #a8b0bc;
    --paper: #12151a;
    --accent: #3dbaa3;
    --accent-deep: #2f9a87;
    --stage-glow: rgba(255, 255, 255, 0.06);
    --stage-tint: rgba(61, 186, 163, 0.12);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Noto Sans SC", "Syne", sans-serif;
  background: var(--paper);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.scroll-track {
  height: 320vh;
  pointer-events: none;
  background: transparent;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--gap-side);
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
  fill: currentColor;
}

.brand-name {
  font-family: "Syne", "Noto Sans SC", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% -12%, var(--stage-glow) 0%, transparent 58%),
    radial-gradient(900px 520px at 82% 18%, var(--stage-tint), transparent 55%),
    var(--paper);
}

.hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 1;
  will-change: opacity;
  pointer-events: none;
}

.hero-copy {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 8px) var(--gap-side) 16px;
  text-align: center;
  min-height: 0;
}

.tagline {
  margin: 0;
  max-width: 16ch;
  font-family: "Syne", "Noto Sans SC", sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 4.2vw, 2.75rem);
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: var(--ink);
  animation: rise-in 0.9s ease both;
}

.pc-stage {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  padding: 0 var(--gap-side);
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.pc-frame {
  width: 100%;
  height: min(62vh, calc(100vh - var(--header-h) - 140px));
  min-height: 280px;
  line-height: 0;
  border-radius: var(--radius-pc) var(--radius-pc) 0 0;
  overflow: hidden;
  background: #1e1e1e;
  box-shadow:
    0 -20px 60px rgba(18, 21, 26, 0.12),
    0 0 0 1px rgba(18, 21, 26, 0.08);
  opacity: 0;
  transform: translateY(28px);
}

.pc-frame.is-ready {
  animation: pc-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pc-screen {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #1e1e1e;
  pointer-events: none;
}

/* —— 第 2 屏：AI Agent —— */
.agent-section {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 12px) var(--gap-side) 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity;
}

.agent-layout {
  width: 100%;
  max-width: 1200px;
  height: min(78vh, calc(100vh - var(--header-h) - 48px));
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}

.agent-copy {
  min-width: 0;
}

.agent-title {
  margin: 0 0 12px;
  font-family: "Syne", "Noto Sans SC", sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.agent-title-mobile {
  display: none;
}

.agent-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
  line-height: 1.6;
}

.agent-frame-wrap {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
}

.agent-frame {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border-radius: 16px;
  overflow: hidden;
  background: #252526;
  box-shadow:
    0 18px 50px rgba(18, 21, 26, 0.18),
    0 0 0 1px rgba(18, 21, 26, 0.1);
  opacity: 0;
  transform: translateY(20px);
}

.agent-frame.is-ready {
  animation: pc-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agent-screen {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #252526;
  pointer-events: none;
}

.download {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px var(--gap-side);
  text-align: center;
  will-change: transform, opacity;
  pointer-events: none;
  opacity: 0;
}

.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  pointer-events: auto;
}

.download-title {
  margin: 0;
  font-family: "Syne", "Noto Sans SC", sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.06em;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 0.9rem 1.6rem;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-huawei {
  border-radius: 12px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 10px 28px rgba(18, 21, 26, 0.18);
}

.btn-huawei:hover {
  filter: brightness(1.08);
}

.btn-openharmony {
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(15, 107, 92, 0.28);
}

.btn-openharmony:hover {
  background: var(--accent-deep);
}

.download-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pc-rise {
  from {
    opacity: 0;
    transform: translateY(48px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .agent-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    height: auto;
    max-height: calc(100vh - var(--header-h) - 36px);
  }

  .agent-copy {
    text-align: center;
  }

  .agent-frame-wrap {
    height: min(62vh, 520px);
  }

  .agent-frame {
    min-height: 280px;
  }
}

@media (max-width: 720px) {
  :root {
    --radius-pc: 14px;
    --header-h: 56px;
  }

  .scroll-track {
    height: 220vh;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 1rem;
  }

  /* 手机：跳过 IDE；Agent 用电脑同款圆角方块缩小贴底，不拉竖也不压扁 */
  .hero {
    display: none !important;
  }

  .agent-section {
    opacity: 1;
    visibility: visible;
    align-items: stretch;
    justify-content: flex-start;
    padding: calc(var(--header-h) + 4px) 16px 16px;
  }

  .agent-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: calc(100vh - var(--header-h) - 20px);
    max-height: none;
    gap: 0;
  }

  .agent-copy {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 12px 12px;
    min-height: 0;
  }

  .agent-title-desktop,
  .agent-desc {
    display: none;
  }

  .agent-title-mobile {
    display: block;
    margin: 0;
    max-width: 14ch;
    font-size: clamp(1.6rem, 4.2vw, 2.75rem);
    line-height: 1.25;
    letter-spacing: 0.04em;
    font-weight: 800;
  }

  .agent-frame-wrap {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: flex-end;
  }

  .agent-frame {
    width: min(100%, 420px);
    aspect-ratio: 1 / 1;
    height: auto;
    max-height: min(58vh, 100vw - 32px);
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
  }

  .btn {
    min-width: min(100%, 260px);
    width: min(100%, 280px);
  }
}
