/* 中大基因 SINO GENOMICS 官网
   品牌色取自公司标志 #054361；只用这一个主色，灰阶统一带一点同色相的蓝。
   中文正文不加 text-wrap: pretty/balance（iPhone 上会把整段排窄）；吸顶栏用不透明白底。 */

:root {
  --ink: #0f2533;
  --ink-2: #3a4e5b;
  --ink-3: #5a6d79;
  --brand: #054361;
  --brand-700: #043650;
  --brand-50: #eef4f7;
  --brand-100: #dce8ee;
  --line: #dbe4e9;
  --field: #c3d0d8;
  --bg: #ffffff;
  --bg-2: #f4f7f9;
  --ok: #17663a;
  --err: #b42318;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
p { margin: 0 0 1em; }
a { color: var(--brand); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(5, 67, 97, .35);
  outline-offset: 2px;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -120px; z-index: 100;
  background: #fff; color: var(--brand); padding: 10px 14px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; box-shadow: 0 4px 16px rgba(15, 37, 51, .15); }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header.scrolled { box-shadow: 0 6px 20px rgba(15, 37, 51, .06); }
.bar { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; min-height: 48px; flex: none; }
.brand img { height: 40px; width: auto; }
.nav-desktop { margin-left: auto; display: flex; gap: 30px; }
.nav-desktop a {
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.nav-desktop a[aria-current="true"] { color: var(--brand); border-bottom-color: var(--brand); }
@media (hover: hover) { .nav-desktop a:hover { color: var(--brand); } }

.nav-mobile { display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border-radius: 10px; border: 0;
  font: inherit; font-size: 16px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, box-shadow .2s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(5, 67, 97, .18); }
@media (hover: hover) { .btn-primary:hover { background: var(--brand-700); } }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; box-shadow: none; flex: none; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-weight: 600; text-decoration: none; color: var(--brand); }
.link-arrow::after { content: "→"; transition: transform .2s; }
@media (hover: hover) { .link-arrow:hover::after { transform: translateX(3px); } }

/* ---------- 通用节 ---------- */
main > section { padding: clamp(64px, 9vw, 112px) 0 clamp(72px, 10vw, 120px); }
.tint { background: var(--bg-2); }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.sec-head { max-width: 44em; margin-bottom: clamp(32px, 4.5vw, 56px); }
h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
.sec-note { margin: 14px 0 0; color: var(--ink-3); font-size: 15px; }

/* ---------- 首屏 ---------- */
.hero {
  padding: clamp(40px, 7vw, 96px) 0 clamp(64px, 9vw, 112px);
  background:
    radial-gradient(60% 70% at 85% 35%, rgba(5, 67, 97, .07), rgba(5, 67, 97, 0) 70%),
    linear-gradient(180deg, var(--brand-50) 0%, #fff 78%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
h1 { font-size: clamp(36px, 5.6vw, 64px); line-height: 1.16; font-weight: 700; letter-spacing: -.01em; margin-bottom: 24px; }
.lead { font-size: clamp(17px, 1.55vw, 19px); line-height: 1.8; color: var(--ink-2); max-width: 33em; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero-for { margin: 36px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 15px; max-width: 33em; }
.hero-art { width: 100%; height: auto; filter: drop-shadow(0 24px 48px rgba(5, 67, 97, .12)); }

/* ---------- 服务 ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 5vw, 80px); }
.svc { display: grid; grid-template-columns: 52px minmax(0, 1fr); padding: 36px 0 40px; border-top: 1px solid var(--line); }
.svc-no { margin: 0; padding-top: 5px; color: var(--brand); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.svc h3 { font-size: 22px; line-height: 1.4; margin-bottom: 10px; }
.svc-desc { color: var(--ink-2); margin-bottom: 18px; }
.ticks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 20px; line-height: 1.6; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--brand); opacity: .75; }
.svc-meta { margin: 0; display: grid; gap: 6px; font-size: 15px; }
.svc-meta div { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 10px; }
.svc-meta dt { color: var(--ink-3); }
.svc-meta dd { margin: 0; color: var(--ink-2); }

/* ---------- 案例 ---------- */
.cases { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.case { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px clamp(28px, 5vw, 72px); padding: 40px 0 44px; border-bottom: 1px solid var(--line); }
.case-tag { margin: 0 0 10px; color: var(--brand); font-size: 14px; font-weight: 600; }
.case h3 { font-size: clamp(20px, 2.1vw, 24px); line-height: 1.45; font-weight: 700; }
.case-body { margin: 0; display: grid; gap: 14px; }
.case-body div { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 14px; }
.case-body dt { color: var(--ink-3); font-size: 14px; font-weight: 600; padding-top: 3px; }
.case-body dd { margin: 0; color: var(--ink-2); }
.case-body .res dt { color: var(--brand); }
.case-body .res dd { color: var(--ink); }

/* ---------- 工作方式 ---------- */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) clamp(32px, 5vw, 80px); }
.principles article { position: relative; padding-top: 22px; }
.principles article::before { content: ""; position: absolute; left: 0; top: 0; width: 36px; height: 3px; border-radius: 2px; background: var(--brand); }
.principles h3 { font-size: 20px; line-height: 1.45; margin-bottom: 10px; }
.principles p { color: var(--ink-2); margin: 0; }

/* ---------- 合作流程 ---------- */
.steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps::before { content: ""; position: absolute; top: 18px; left: 18px; right: 18px; height: 1px; background: var(--brand-100); }
.steps li { position: relative; padding-top: 52px; counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--brand-100);
  color: var(--brand); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: 19px; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--ink-2); }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.about-grid h2 { margin-bottom: 24px; }
.about-grid p { color: var(--ink-2); max-width: 36em; }
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-3); font-size: 15px; }
.facts dd { margin: 0; }

/* ---------- 咨询 ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.contact-intro h2 { margin-bottom: 20px; }
.contact-intro > p { color: var(--ink-2); }
.contact-intro > .contact-tip { margin-top: 24px; font-size: 14px; color: var(--ink-3); }
.contact-list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line); }
.contact-list li { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list .k { flex: none; width: 3em; color: var(--ink-3); }
.contact-list a { text-decoration: none; font-weight: 600; word-break: break-all; }

.inquiry { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 3vw, 36px); box-shadow: 0 16px 40px rgba(15, 37, 51, .05); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; min-width: 0; }
.field label { font-size: 15px; font-weight: 600; }
.req { color: var(--err); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink);
  background: #fff; border: 1px solid var(--field); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.field select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a6d79' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8796a0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(5, 67, 97, .14); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.field-err { margin: 0; font-size: 14px; color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.consent { font-size: 14px; color: var(--ink-3); margin: 4px 0 18px; }
.form-status { margin: 14px 0 0; font-size: 15px; min-height: 1.5em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }
.inquiry-done { text-align: left; }
.inquiry-done h3 { font-size: 22px; margin-bottom: 10px; }
.inquiry-done p { color: var(--ink-2); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 calc(40px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--ink-3); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.foot-brand { display: flex; align-items: center; min-height: 48px; }
.foot-brand img { height: 32px; width: auto; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.foot-nav a { color: var(--ink-2); text-decoration: none; display: inline-block; padding: 10px 0; }
@media (hover: hover) { .foot-nav a:hover { color: var(--brand); } }
.copy { margin: 0 0 0 auto; }

/* ---------- 独立小页（隐私说明、提交结果、404） ---------- */
.page { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) var(--gutter) 80px; }
.page h1 { font-size: clamp(30px, 4.4vw, 42px); margin-bottom: 16px; }
.page h2 { font-size: 20px; margin: 36px 0 10px; }
.page p, .page li { color: var(--ink-2); }
.page ul { padding-left: 1.2em; }
.page .updated { color: var(--ink-3); font-size: 14px; }
.msg-page { max-width: 36em; margin: 0 auto; padding: 14vh var(--gutter) 80px; }
.msg-page h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 16px; }
.msg-page p { color: var(--ink-2); }
.msg-list { color: var(--err); padding-left: 1.2em; margin: 0 0 24px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin-top: 28px; }

/* ---------- 留言箱（内部） ---------- */
.ib { background: var(--bg-2); }
.ib-wrap { max-width: 900px; margin: 0 auto; padding: 32px 16px 64px; }
.ib h1 { font-size: 26px; margin-bottom: 8px; }
.ib-sum { color: var(--ink-3); }
.ib-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 12px 0; }
.ib-item header { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.ib-item time { color: var(--ink-3); font-size: 14px; margin-left: auto; }
.ib-meta { color: var(--ink-3); font-size: 14px; margin: 6px 0 0; }
.ib-msg { white-space: pre-wrap; margin: 10px 0 0; }
.ib-push { margin: 10px 0 0; font-size: 14px; }
.ib-ok { color: var(--ok); }
.ib-bad { color: var(--err); }
.ib-wait { color: #8a5a00; }

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .nav-desktop { gap: 22px; }
}

@media (max-width: 920px) {
  .nav-desktop { display: none; }
  .bar { gap: 12px; }
  .bar .btn-sm { margin-left: auto; }
  .nav-mobile { display: block; }
  .nav-mobile summary {
    list-style: none; cursor: pointer; width: 44px; height: 44px; margin-right: -8px;
    display: grid; place-items: center; border-radius: 10px;
  }
  .nav-mobile summary::-webkit-details-marker { display: none; }
  .burger, .burger::before, .burger::after { display: block; width: 20px; height: 2px; border-radius: 1px; background: var(--ink); position: relative; transition: transform .2s, background-color .2s; }
  .burger::before, .burger::after { content: ""; position: absolute; left: 0; }
  .burger::before { top: -6px; }
  .burger::after { top: 6px; }
  .nav-mobile[open] .burger { background: transparent; }
  .nav-mobile[open] .burger::before { transform: translateY(6px) rotate(45deg); }
  .nav-mobile[open] .burger::after { transform: translateY(-6px) rotate(-45deg); }
  .nav-mobile nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(15, 37, 51, .08);
    padding: 8px max(var(--gutter), env(safe-area-inset-left)) 16px;
    display: grid;
  }
  .nav-mobile nav a { display: flex; align-items: center; min-height: 52px; color: var(--ink); text-decoration: none; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav-mobile nav a:last-child { border-bottom: 0; color: var(--brand); font-weight: 600; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 560px; }
  .svc-grid { grid-template-columns: minmax(0, 1fr); }
  .case { grid-template-columns: minmax(0, 1fr); padding: 32px 0 36px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .steps::before { display: none; }
  .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .brand img { height: 34px; }
  .bar .btn-sm { padding: 0 14px; }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps li { padding: 0 0 28px 56px; min-height: 64px; }
  .steps li:last-child { padding-bottom: 0; }
  .steps li:not(:last-child)::after { content: ""; position: absolute; top: 44px; bottom: 6px; left: 18px; width: 1px; background: var(--brand-100); }
  .svc { grid-template-columns: minmax(0, 1fr); padding: 32px 0 36px; }
  .svc-no { padding: 0 0 6px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .hero-for { margin-top: 28px; }
  .copy { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .nav-mobile, .hero-visual, .inquiry, .skip { display: none !important; }
  .tint, .hero { background: none !important; }
  main > section { padding: 24px 0; }
}
