/* ==========================================================
   MotionGit 基础设计体系（首页与站内共用）
   令牌 · 两档画幅 · 按钮 · 图标 · 导航 · 页脚
   ========================================================== */

:root {
  --bg: #010409;
  --bg-1: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1c2128;
  --border: #30363d;
  --border-muted: #21262d;
  --border-strong: #484f58;
  --hair: rgba(240, 246, 252, .08);
  --fg: #f0f6fc;
  --fg-2: #c9d1d9;
  --muted: #8b949e;
  --subtle: #6e7681;
  --blue: #58a6ff;
  --purple: #a371f7;
  --pink: #f778ba;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --grad: linear-gradient(92deg, #79c0ff 0%, #a371f7 52%, #f778ba 100%);

  --font: "Mona Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  /* 两档画幅（参考 frame.io）：文字主栏居中适中，媒体区更宽 */
  --gutter: clamp(20px, 4vw, 64px);
  --container: clamp(1080px, 40vw + 500px, 1560px);
  --wide: clamp(1080px, 58vw + 500px, 2000px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; font-feature-settings: "ss01", "cv11"; }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: rgba(88,166,255,.35); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nb { white-space: nowrap; display: inline-block; }

/* ---------- 统一图标 ---------- */
.lg { --c: var(--fg-2); display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px; color: var(--c); background: color-mix(in srgb, var(--c) 10%, rgba(13,17,23,.9)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.lg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lg-sm { width: 20px; height: 20px; border-radius: 6px; } .lg-sm svg { width: 13px; height: 13px; }
.lg-lg { width: 40px; height: 40px; border-radius: 11px; } .lg-lg svg { width: 22px; height: 22px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s, box-shadow .3s; }
.btn:active { transform: translateY(1px); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--fg); color: #0d1117; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 10px 40px -10px rgba(121,192,255,.55); }
.btn-primary:hover { background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 14px 50px -8px rgba(163,113,247,.65); }
.btn-outline { border-color: var(--border); color: var(--fg); background: rgba(13,17,23,.5); }
.btn-outline:hover { border-color: var(--muted); }
.btn-ghost { color: var(--fg-2); }
.btn-ghost:hover { color: #fff; background: rgba(240,246,252,.06); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--blue); }
.text-link:hover span { transform: translateX(2px); }
.text-link span { transition: transform .2s; }

/* ---------- 版块排版 ---------- */
.section { position: relative; padding: clamp(110px, 13vw, 176px) 0; }
.eyebrow { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; color: var(--muted); margin-bottom: 22px; }
.eyebrow .ey-n { color: var(--fg); }
.eyebrow .ey-n::after { content: ""; display: inline-block; width: 24px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--border-strong); }
.h2 { font-size: clamp(34px, 1.4vw + 30px, 68px); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.h2 .soft { color: var(--subtle); }
.lead { font-size: clamp(16px, .5vw + 11px, 22px); color: var(--muted); max-width: 32em; margin: 0; line-height: 1.7; }
.section-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: end; margin-bottom: 64px; }
.section-head > :last-child { justify-self: end; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* ---------- 导航 ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; border-bottom: 1px solid transparent; transition: background .3s, border-color .3s; }
.nav.scrolled { background: rgba(1,4,9,.72); backdrop-filter: blur(16px) saturate(170%); -webkit-backdrop-filter: blur(16px) saturate(170%); border-bottom-color: var(--hair); }
.nav-inner { display: flex; align-items: center; height: 64px; gap: 32px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.logo svg { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 4px; margin-right: auto; }
.nav-links a { padding: 7px 12px; border-radius: 8px; font-size: 14.5px; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-search { display: flex; align-items: center; gap: 8px; height: 32px; width: 220px; padding: 0 6px 0 10px; border: 1px solid var(--border-muted); border-radius: 8px; background: rgba(13,17,23,.5); color: var(--subtle); transition: border-color .2s, width .3s var(--ease); }
.nav-search:focus-within { border-color: var(--blue); width: 280px; }
.nav-search svg { width: 14px; height: 14px; flex: 0 0 auto; }
.nav-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--fg); }
.nav-search input::placeholder { color: var(--subtle); }
.nav-search kbd { font-family: var(--mono); font-size: 11px; color: var(--subtle); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; line-height: 18px; }
.nav-actions .signin { font-size: 14.5px; color: var(--muted); }
.nav-actions .signin:hover { color: var(--fg); }
.menu-btn { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); align-items: center; justify-content: center; }
.menu-btn span { width: 16px; height: 1.5px; background: var(--fg); position: relative; display: block; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; width: 16px; height: 1.5px; background: var(--fg); transition: transform .25s; }
.menu-btn span::before { top: -5px; } .menu-btn span::after { top: 5px; }
.nav.open .menu-btn span { background: transparent; }
.nav.open .menu-btn span::before { transform: translateY(5px) rotate(45deg); }
.nav.open .menu-btn span::after { transform: translateY(-5px) rotate(-45deg); }


/* ---------- 结尾 / 页脚 ---------- */
.cta { position: relative; padding: clamp(130px, 16vw, 220px) 0; text-align: center; overflow: hidden; isolation: isolate; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(45% 55% at 50% 100%, rgba(163,113,247,.22), transparent 70%), radial-gradient(35% 45% at 50% 100%, rgba(31,111,235,.3), transparent 70%), linear-gradient(rgba(139,148,158,.06) 1px, transparent 1px) 0 0 / 64px 64px, linear-gradient(90deg, rgba(139,148,158,.06) 1px, transparent 1px) 0 0 / 64px 64px; mask-image: radial-gradient(70% 90% at 50% 70%, #000, transparent); -webkit-mask-image: radial-gradient(70% 90% at 50% 70%, #000, transparent); }
.cta .h2 { font-size: clamp(38px, 2.4vw + 30px, 96px); line-height: 1.08; }
.cta .hero-cta { margin-top: 48px; }
.footer { border-top: 1px solid var(--hair); padding: 64px 0 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.foot-grid p { color: var(--subtle); font-size: 14px; margin: 14px 0 0; max-width: 280px; }
.foot-grid h5 { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li a { display: block; padding: 4px 0; font-size: 14px; color: var(--subtle); transition: color .2s; }
.foot-grid li a:hover { color: var(--fg); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hair); font-size: 13px; color: var(--subtle); flex-wrap: wrap; }
.foot-bottom .mono { font-size: 12px; }

/* 基础响应式 */
@media (max-width: 1080px) {
  .foot-grid { grid-template-columns: repeat(4, 1fr); }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .nav-links, .nav-search, .nav-actions .signin, .nav-actions .btn { display: none; }
  .menu-btn { display: inline-flex; }
  .nav-inner { justify-content: space-between; }
  .nav.open { background: rgba(1,4,9,.97); }
  .nav.open .nav-links { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; padding: 8px var(--gutter) 22px; background: rgba(1,4,9,.98); border-bottom: 1px solid var(--hair); }
  .nav.open .nav-links a { padding: 14px 4px; font-size: 17px; color: var(--fg); border-bottom: 1px solid var(--hair); border-radius: 0; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* 媒体区突破文字主栏，向两侧对称加宽 */
.bleed { --cw: min(100vw - var(--gutter) * 2, var(--container)); --ww: min(100vw - var(--gutter) * 2, var(--wide)); margin-left: calc((var(--cw) - var(--ww)) / 2); margin-right: calc((var(--cw) - var(--ww)) / 2); }
.gg-wrap.bleed { margin-left: calc((var(--cw) - var(--ww)) / 2 - var(--gutter)); margin-right: calc((var(--cw) - var(--ww)) / 2 - var(--gutter)); }

/* 宽屏：基础组件随窗口放大 */
@media (min-width: 1680px) {
  body { font-size: 17px; }
  .nav-inner { height: 72px; }
  .logo { font-size: 18px; } .logo svg { width: 30px; height: 30px; }
  .nav-links a, .nav-actions .signin { font-size: 15.5px; }
  .nav-search { height: 36px; width: 260px; } .nav-search input { font-size: 15px; }
  .btn { height: 44px; padding: 0 20px; font-size: 16px; }
  .btn-sm { height: 36px; padding: 0 16px; font-size: 15px; }
  .btn-lg { height: 56px; padding: 0 30px; font-size: 17px; }
  .chip { height: 36px; font-size: 14.5px; }
  .eyebrow { font-size: 13.5px; margin-bottom: 26px; }
  .section-head { margin-bottom: 80px; }
  .foot-grid p, .foot-grid li a { font-size: 15px; } .foot-grid h5 { font-size: 14px; }
  .foot-bottom { font-size: 14px; }
}
@media (min-width: 2200px) {
  body { font-size: 18px; }
  .nav-inner { height: 80px; }
  .nav-links a, .nav-actions .signin { font-size: 16.5px; }
}

/* 导航全宽（logo 靠左、操作靠右）；内容区按页面类型使用主栏或宽画幅 */
.nav .container.nav-inner { max-width: calc(var(--wide) + var(--gutter) * 2); }
.container.wide { max-width: calc(var(--wide) + var(--gutter) * 2); }

/* 主导航：下拉菜单 */
.nav-links a.on { color: var(--fg); }
.nav-dd { position: relative; }
.nav-dd > a { display: inline-flex; align-items: center; gap: 4px; }
.nav-dd > a svg { width: 12px; height: 12px; opacity: .6; transition: transform .2s; }
.nav-dd:hover > a svg, .nav-dd:focus-within > a svg { transform: rotate(180deg); }
.nav-dd-menu { position: absolute; left: -8px; top: 100%; z-index: 60; min-width: 260px; padding: 8px; margin-top: 8px; border-radius: 14px; background: rgba(13,17,23,.97); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--border), 0 24px 60px -16px rgba(0,0,0,.85); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s, transform .2s var(--ease), visibility .18s; }
.nav-dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav-dd:hover .nav-dd-menu, .nav-dd:focus-within .nav-dd-menu { opacity: 1; visibility: visible; transform: none; }
.nav-dd-menu a { display: block; padding: 9px 12px; border-radius: 9px; }
.nav-dd-menu a:hover { background: rgba(240,246,252,.06); }
.nav-dd-menu b { display: block; font-size: 14px; font-weight: 600; color: var(--fg); }
.nav-dd-menu small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--subtle); }
@media (max-width: 900px) {
  .nav.open .nav-dd { display: contents; }
  .nav.open .nav-dd > a svg, .nav-dd-menu { display: none; }
}
