/* ============================================================
   界合智能官网 jiehe-ai.cn
   风格：黑底细网格 + ASCII 鲨鱼（首屏 canvas），等宽字做标签，中文用系统黑体
   ============================================================ */

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #000;
  --panel: rgba(8, 10, 14, 0.78);
  --fg: #eceff4;
  --muted: #9aa3b2;
  --dim: #5f6776;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.06);
  --cyan: #6ee6ff;      /* 与动画里的水波同色 */
  --amber: #e0892c;     /* 与鲨鱼身上的点缀色同源 */
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  /* 网格尺寸与首屏动画在 1920 宽时的字符格一致（13 × 19） */
  --cell-w: 13px;
  --cell-h: 19px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--cyan); color: #000; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.label, .eyebrow {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}
.eyebrow { color: var(--cyan); text-shadow: 0 0 10px #000, 0 0 4px #000, 0 0 2px #000; }
.label { color: var(--dim); }

/* ---------- 导航 ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: 64px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom-color: var(--line-soft);
}
.nav__brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.nav__name { font-weight: 700; font-size: 18px; letter-spacing: 0.04em; }
.nav__mono { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--dim); letter-spacing: 0.16em; }
.nav__links { display: flex; gap: 32px; font-size: 15px; }
.nav__links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav__links a:hover { color: var(--fg); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 96px 24px 96px;
  overflow: hidden;
  isolation: isolate;
}
.ocean {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; display: block;
  font-family: var(--mono);   /* 动画里的字形取自画布的字体 */
}
.hero__content {
  width: min(680px, 100%);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.hero__title {
  margin: 24px 0 0;
  font-size: clamp(40px, 5.2vw, 76px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.01em;
  /* 鱼游过标题时保持可读 */
  text-shadow: 0 0 24px #000, 0 0 8px #000;
}
.hero__lede {
  margin: 24px 0 0;
  font-size: 18px; line-height: 1.8;
  color: var(--muted);
  text-shadow: 0 0 12px #000;
}

/* ---------- 终端 ---------- */
.term {
  margin-top: 40px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.term__bar {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px; color: var(--dim); letter-spacing: 0.04em;
}
.term__note { color: var(--dim); }
.term__log {
  height: 168px;
  overflow-y: auto;
  padding: 12px 16px 4px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin; scrollbar-color: #2a2f38 transparent;
  font-family: var(--mono), var(--sans);
}
.term__log .ln { margin: 0; }
.term__log .ln--cmd { color: var(--fg); }
.term__log .ln--cmd::before { content: "$ "; color: var(--cyan); }
.term__log .ln--out { color: var(--muted); }
.term__log .ln--err { color: var(--amber); }
.term__log .ln--gap { height: 8px; }
.term__log a { color: var(--cyan); text-underline-offset: 3px; }
.caret {
  display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em;
  background: var(--cyan); margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term__form {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px;
  border-top: 1px solid var(--line-soft);
}
.term__prompt { color: var(--cyan); white-space: nowrap; font-weight: 600; }
.term__input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  color: var(--fg);
  font: inherit; font-family: var(--mono), var(--sans);
  font-size: 16px;   /* iOS 小于 16px 会自动放大页面 */
  padding: 8px 0;
  caret-color: var(--cyan);
}
.term__input::placeholder { color: var(--dim); }
.term__send {
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 4px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 16px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.term__send:hover { color: var(--cyan); border-color: var(--cyan); }

.term__chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 16px 16px;
}
.term__chips button {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 12px; min-height: 36px;
  border: 1px solid var(--line); border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font: inherit; font-size: 13px; font-family: var(--mono), var(--sans);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.term__chips button span { color: var(--fg); font-weight: 600; }
.term__chips button:hover { border-color: var(--cyan); color: var(--fg); background: rgba(110, 230, 255, 0.06); }

.hero__hint {
  position: absolute; left: 32px; bottom: 24px; margin: 0;
  font-family: var(--mono), var(--sans); font-size: 12px; color: var(--dim);
}
.hero__scroll {
  position: absolute; right: 32px; bottom: 24px;
  font-family: var(--mono), var(--sans); font-size: 12px; color: var(--dim);
  text-decoration: none; letter-spacing: 0.08em;
}
.hero__scroll:hover { color: var(--fg); }

/* ---------- 通用 section ---------- */
.section {
  position: relative;
  padding: 128px 32px;
  border-top: 1px solid var(--line-soft);
  /* 静态网格，延续首屏的字符格 */
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: calc(var(--cell-w) * 8) calc(var(--cell-h) * 5);
  background-position: -1px -1px;
}
.section > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.section__head h2 {
  margin: 16px 0 0;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.3; font-weight: 700;
}
.section__intro { margin: 24px 0 0; max-width: 640px; color: var(--muted); }

/* ---------- 服务：左侧大号编号，桌面端随滚动吸附 ---------- */
.services { list-style: none; padding: 0; margin-top: 64px; }
.service {
  display: grid; grid-template-columns: 240px 1fr; gap: 32px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service__num {
  font-family: var(--mono); font-weight: 600;
  font-size: 120px; line-height: 1; letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(110, 230, 255, 0.45);
  position: sticky; top: 112px; align-self: start;
}
.service__body h3 { margin: 12px 0 0; font-size: 28px; line-height: 1.3; font-weight: 700; }
.service__body > p:not(.label) { margin: 16px 0 0; color: var(--muted); max-width: 680px; }
.tags { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--mono), var(--sans); font-size: 13px;
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}

/* ---------- 能力：主卡 + 两张副卡 ---------- */
.caps {
  margin-top: 64px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.cap {
  position: relative;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
}
/* 四角十字，像字符画的框 */
.cap::before, .cap::after {
  content: "+"; position: absolute;
  font-family: var(--mono); font-size: 14px; line-height: 1; color: var(--dim);
}
.cap::before { top: -8px; left: -5px; }
.cap::after { bottom: -8px; right: -5px; }
/* 主卡占一整行：左文字、右示意对话 */
.cap--main {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center;
}
.cap__text > p:not(.label) { margin: 16px 0 0; color: var(--muted); }
.cap--main .chat { margin: 0; }
.nowrap { white-space: nowrap; }
.cap h3 { margin: 12px 0 0; font-size: 24px; line-height: 1.35; font-weight: 700; }
.cap > p:not(.label) { margin: 16px 0 0; color: var(--muted); }
.cap .cap__quote { color: var(--fg); font-size: 18px; }
.list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
.list li::before { content: "› "; color: var(--cyan); font-family: var(--mono); }

.chat {
  margin: 24px 0 0;
  padding: 16px;
  border: 1px dashed var(--line);
  font-family: var(--mono), var(--sans);
  font-size: 14px; line-height: 1.7;
  color: var(--muted);
}
.chat figcaption { font-size: 12px; color: var(--dim); margin-bottom: 8px; letter-spacing: 0.08em; }
.chat p { margin: 0 0 8px; }
.chat p:last-child { margin-bottom: 0; }
.chat b { color: var(--fg); font-weight: 600; }
.chat .chat__ai b { color: var(--cyan); }

/* ---------- 联系 ---------- */
.contact {
  margin-top: 48px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.contact div { border-top: 1px solid var(--line); padding-top: 16px; }
.contact dt { font-family: var(--mono), var(--sans); font-size: 13px; color: var(--dim); letter-spacing: 0.08em; }
.contact dd { margin: 8px 0 0; font-size: 18px; }
.contact a { text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .2s, color .2s; }
.contact a:hover { color: var(--cyan); border-color: var(--cyan); }

/* ---------- 页脚 ---------- */
.footer {
  padding: 64px 24px 48px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  color: var(--dim);
  font-size: 14px;
}
.footer__shark {
  display: inline-block; text-align: left;
  margin: 0 0 32px;
  font-family: var(--mono); font-weight: 600;
  font-size: 11px; line-height: 1.25;
  color: #4b5566;
  overflow: hidden; max-width: 100%;
}
.footer p { margin: 8px 0 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.footer__credit { font-size: 12px; }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .caps { grid-template-columns: 1fr; }
  .cap--main { grid-template-columns: 1fr; gap: 24px; }
  .contact { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr; gap: 8px; }
  .service__num { position: static; font-size: 64px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { padding: 0 16px; height: 56px; }
  .nav__links { gap: 16px; font-size: 14px; }
  .nav__mono { display: none; }
  .hero { padding: 72px 16px 64px; }
  .hero__title { margin-top: 16px; }
  .hero__lede { margin-top: 16px; }
  .hero__lede { font-size: 16px; }
  .br-wide { display: none; }
  .term { margin-top: 32px; }
  .term__note { display: none; }
  .term { background: rgba(8, 10, 14, 0.7); }
  .term__log { height: 120px; font-size: 13px; }
  .term__chips { display: grid; grid-template-columns: 1fr 1fr; }
  .term__chips button { font-size: 12px; padding: 6px 10px; justify-content: center; }
  .hero__hint { display: none; }
  .hero__scroll { right: 16px; bottom: 16px; }
  .section { padding: 96px 16px; }
  .cap { padding: 24px; }
  .footer__shark { font-size: 7px; }
}
/* 矮屏（如 1366×768 笔记本）：首屏收紧，终端整块留在一屏内 */
@media (min-width: 641px) and (max-height: 860px) {
  .hero { padding-top: 80px; padding-bottom: 64px; }
  .hero__title { margin-top: 16px; font-size: clamp(40px, 4.6vw, 64px); }
  .hero__lede { margin-top: 16px; }
  .term { margin-top: 32px; }
  .term__log { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
}
