/* ==========================================================================
   链飞 · LinkFly — 产品介绍页
   设计令牌与 web/static/css/app.css 保持一致，保证与后台观感统一
   ========================================================================== */

:root {
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-400: #818cf8;
  --violet-500: #8b5cf6;
  --emerald-500: #10b981;

  --bg: #f4f5fa;
  --bg-soft: #eceefa;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --surface-3: #f1f3f9;
  --border: #e4e7f0;
  --border-strong: #d3d8e6;
  --text: #14161f;
  --text-2: #4b5266;
  --muted: #838ba0;

  --primary: var(--brand-500);
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --gradient-soft: linear-gradient(135deg, rgba(99,102,241,.12), rgba(168,85,247,.10));

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-xs: 0 1px 2px rgba(20,22,31,.05);
  --shadow-sm: 0 2px 8px rgba(20,22,31,.06);
  --shadow-md: 0 8px 24px rgba(20,22,31,.08);
  --shadow-lg: 0 20px 48px rgba(20,22,31,.14);
  --shadow-brand: 0 10px 26px rgba(99,102,241,.28);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;

  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d14;
    --bg-soft: #10131d;
    --surface: #151824;
    --surface-2: #1a1e2c;
    --surface-3: #202536;
    --border: #262c3d;
    --border-strong: #333b52;
    --text: #eef1f8;
    --text-2: #b3bacd;
    --muted: #7c869f;
    --primary: var(--brand-400);
    --gradient-soft: linear-gradient(135deg, rgba(99,102,241,.20), rgba(168,85,247,.14));
    --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
    --shadow-sm: 0 2px 10px rgba(0,0,0,.32);
    --shadow-md: 0 10px 28px rgba(0,0,0,.42);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
    --shadow-brand: 0 10px 26px rgba(79,70,229,.38);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
code {
  font-family: var(--mono); font-size: .88em;
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 6px; color: var(--text-2);
  word-break: break-word;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--gradient); display: grid; place-items: center;
  box-shadow: var(--shadow-brand);
}
.brand-mark svg { width: 18px; height: 18px; color: #fff; }
.brand-text { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-text em {
  font-style: normal; font-weight: 600; font-size: 13px;
  color: var(--muted); margin-left: 6px; letter-spacing: .02em;
}

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: color .16s;
}
.nav-links a:hover { color: var(--primary); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 24px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .16s, filter .16s, border-color .16s, background .16s;
}
.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; border-radius: 10px; }
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid var(--border-strong); color: var(--text-2);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 96px; text-align: center;
  background:
    radial-gradient(880px 520px at 12% -12%, rgba(99,102,241,.20), transparent 62%),
    radial-gradient(760px 460px at 102% 2%, rgba(168,85,247,.18), transparent 64%),
    var(--bg);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 70%, var(--bg) 100%);
}

.pill {
  display: inline-block; position: relative; z-index: 1;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--primary); background: var(--gradient-soft);
  border: 1px solid var(--border); padding: 6px 15px; border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 {
  position: relative; z-index: 1;
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.14; letter-spacing: -.035em;
  margin-bottom: 22px;
}
.grad {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.hero-sub {
  position: relative; z-index: 1;
  max-width: 680px; margin: 0 auto 34px;
  font-size: 17px; color: var(--text-2); line-height: 1.78;
}
.hero-sub strong { color: var(--text); font-weight: 650; }

.hero-cta { position: relative; z-index: 1; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta.center { margin-top: 30px; }

.hero-stats {
  position: relative; z-index: 1;
  list-style: none; margin: 54px auto 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  max-width: 720px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.hero-stats li {
  background: var(--surface); padding: 18px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.hero-stats b {
  font-size: 24px; font-weight: 750; letter-spacing: -.03em;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-stats span { font-size: 12.5px; color: var(--muted); }

/* ---------- 首屏主图（浏览器窗口框） ---------- */
.hero-shot {
  position: relative; z-index: 1;
  max-width: 940px; margin: 52px auto 0;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.browser-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.browser-url {
  flex: 1; margin-left: 10px; padding: 4px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; font-family: var(--mono);
  font-size: 11.5px; color: var(--muted); text-align: center;
}
.hero-shot img { display: block; width: 100%; height: auto; }

/* ---------- 终端窗口 ---------- */
.terminal {
  position: relative; z-index: 1;
  max-width: 660px; margin: 56px auto 26px; text-align: left;
  background: #0d1017; border: 1px solid #232838;
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.34);
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: #131824;
  border-bottom: 1px solid #232838;
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.terminal-title {
  margin-left: 8px; font-family: var(--mono);
  font-size: 11.5px; color: #6b768f;
}
.terminal-body {
  margin: 0; padding: 20px 22px 24px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.6px; line-height: 1.85;
  color: #c6cde0; white-space: pre;
}
.c-p { color: #7dd3fc; }
.c-ok { color: #34d399; }
.c-k { color: #fbbf24; font-weight: 600; }
.c-d { color: #39415a; }
.c-dim { color: #5b6478; }

/* ---------- 区块 ---------- */
.section { padding: 92px 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }

.section-head { max-width: 660px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 14px; letter-spacing: -.03em; }
.section-head p { color: var(--muted); font-size: 16px; line-height: 1.75; }

/* ---------- 功能卡片 ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* 网格/弹性子项默认 min-width:auto，内含 <pre> 长行时会撑破容器；
   归零后由 pre 自身的 overflow-x 接管横向滚动 */
.grid > *, .steps > *, .api-split > *, .shots > *, .tech > * { min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px 24px;
  box-shadow: var(--shadow-xs);
  transition: transform .2s cubic-bezier(.2,.9,.3,1), box-shadow .2s, border-color .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.ico {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: var(--radius);
  background: var(--gradient-soft); border: 1px solid var(--border);
  color: var(--primary); margin-bottom: 16px;
}
.ico svg { width: 21px; height: 21px; }
.card h3 { font-size: 16.5px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text-2); line-height: 1.72; }

/* ---------- 截图 ---------- */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.shot {
  margin: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .2s cubic-bezier(.2,.9,.3,1), box-shadow .2s;
}
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.shot img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--border); }
.shot figcaption { padding: 13px 18px; font-size: 13px; color: var(--muted); }

/* ---------- 技术要点 ---------- */
.tech { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
.tech-item {
  padding: 22px 0; border-top: 1px solid var(--border);
}
.tech-item h3 { font-size: 16px; margin-bottom: 7px; display: flex; align-items: center; gap: 9px; }
.tech-item h3::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--gradient);
}
.tech-item p { font-size: 14px; color: var(--text-2); line-height: 1.72; }

/* ---------- 部署步骤 ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 22px;
  display: flex; flex-direction: column;
}
.step-n {
  display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 14px;
  border-radius: 9px; background: var(--gradient); color: #fff;
  font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-brand);
}
.step h3 { font-size: 15.5px; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }

/* 代码块内部的 <code> 不能继承正文行内 code 的底色和边框 */
.code code, .terminal-body code {
  background: none; border: 0; padding: 0; border-radius: 0;
  font-size: inherit; color: inherit; word-break: normal;
}

.code {
  margin: 0; margin-top: auto; padding: 15px 16px; overflow-x: auto;
  background: #0d1017; border: 1px solid #232838; border-radius: var(--radius);
  font-family: var(--mono); font-size: 12.2px; line-height: 1.8;
  color: #c6cde0; white-space: pre;
}
.code-lg { font-size: 12.6px; padding: 20px 22px; }
.c-s { color: #a5d6ff; }

.callout {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg); padding: 22px 24px;
}
.callout-ico {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--gradient-soft); border: 1px solid var(--border); color: var(--primary);
}
.callout-ico svg { width: 19px; height: 19px; }
.callout h4 { font-size: 15px; margin-bottom: 6px; }
.callout p { font-size: 13.8px; color: var(--text-2); line-height: 1.72; }

/* ---------- API ---------- */
.api-split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start; }
.api-code .code { margin-top: 0; }
.api-list {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 22px;
}
.api-list h3 { font-size: 15px; margin-bottom: 14px; }
.api-list ul { list-style: none; margin: 0; padding: 0; }
.api-list li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.api-list li:first-child { border-top: 0; padding-top: 0; }
.api-list code {
  background: none; border: 0; padding: 0;
  font-size: 12.5px; font-weight: 600; color: var(--primary);
}
.api-list span { font-size: 12.5px; color: var(--muted); }

/* ---------- 底部 CTA ---------- */
.cta-band {
  padding: 92px 0; text-align: center;
  background:
    radial-gradient(720px 420px at 50% 0%, rgba(99,102,241,.22), transparent 66%),
    var(--bg);
  border-top: 1px solid var(--border);
}
.cta-band h2 { font-size: clamp(25px, 3.2vw, 34px); margin-bottom: 14px; letter-spacing: -.03em; }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 16px; }

/* ---------- 页脚 ---------- */
.foot { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0; }
.foot-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.foot-note { font-size: 13px; color: var(--muted); }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.foot-links a { font-size: 13px; color: var(--text-2); text-decoration: none; transition: color .16s; }
.foot-links a:hover { color: var(--primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .api-split { grid-template-columns: 1fr; }
  .tech { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .nav-links { display: none; }
  .nav-inner { height: 60px; gap: 14px; }
  .hero { padding: 56px 0 68px; }
  .section { padding: 64px 0; }
  .grid-3, .shots { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); margin-top: 40px; }
  .hero-shot { margin-top: 34px; }
  .browser-url { font-size: 10.5px; padding: 3px 10px; }
  .terminal { margin-top: 40px; }
  .terminal-body { font-size: 11.4px; padding: 16px 16px 20px; }
  .code, .code-lg { font-size: 11.4px; }
  .callout { flex-direction: column; gap: 14px; }
  .cta-band { padding: 64px 0; }
  /* 只让正文里的 CTA 占满整行，导航栏那个小按钮保持原样 */
  .hero-cta { flex-direction: column; }
  .hero-cta .btn, .cta-band .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
