/* 中大基因 · 软件工具与系统 — alltools.sinogenomics.com
   视觉沿用官网（home.sinogenomics.com）：品牌色取自公司标志 #054361，只用这一个主色，
   灰阶统一带一点同色相的蓝；绿色只给「在线」，琥珀色只给「暂时无法访问」。
   中文正文不加 text-wrap: pretty/balance（iPhone 上会把整段排窄）；吸顶栏用不透明白底；
   不依赖任何外部字体和 CDN。可见性不押在动画上：没有会把内容藏起来的入场动画。 */

: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;
  --ok-bg: #eaf5ee;
  --ok-line: #cfe7d8;
  --ok-dot: #22a45a;
  --warn: #7a4f00;
  --warn-bg: #fbf3e2;
  --warn-line: #efdcb0;
  --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 { margin: 0; color: var(--ink); }
p { margin: 0 0 1em; }
a { color: var(--brand); }
a:focus-visible, button:focus-visible, summary: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: 44px; padding: 0 20px; font-size: 15px; box-shadow: none; flex: none; }

.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, 104px) 0 clamp(72px, 10vw, 112px); }
.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, 52px); }
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, 88px) 0 clamp(56px, 8vw, 96px);
  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(30px, 4.4vw, 52px); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin-bottom: 24px; }
.nb { white-space: nowrap; }
.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-count { margin: 36px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 15px; max-width: 33em; }

/* 首屏右侧：工具一览（像一个桌面，每个工具是一个图标） */
.launcher {
  background: #fff; border: 1px solid #d9e3e9; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 48px rgba(5, 67, 97, .12);
}
.launcher-bar { display: flex; align-items: center; gap: 7px; padding: 15px 20px; border-bottom: 1px solid #edf1f4; }
.launcher-bar i { width: 9px; height: 9px; border-radius: 50%; background: #e3eaef; }
.launcher-bar span { width: 150px; max-width: 40%; height: 12px; border-radius: 6px; background: #eef3f6; margin-left: 12px; }
.launcher-grid { list-style: none; margin: 0; padding: 22px 20px 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 4px 12px; border-radius: 14px; text-decoration: none; color: var(--ink); text-align: center; }
@media (hover: hover) { .tile:hover { background: var(--bg-2); } }
.tile-mark {
  position: relative; width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--brand-50); border: 1px solid var(--brand-100);
}
.tile-name { font-size: 14px; font-weight: 600; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.dot { position: absolute; right: -4px; top: -4px; width: 13px; height: 13px; border-radius: 50%; background: var(--ok-dot); border: 2px solid #fff; }
.dot[hidden] { display: none; }
.tile-more .tile-mark { background: #fff; border: 1.5px dashed var(--field); }
.tile-more .tile-mark i { position: relative; width: 18px; height: 18px; display: block; }
.tile-more .tile-mark i::before, .tile-more .tile-mark i::after { content: ""; position: absolute; background: var(--ink-3); border-radius: 1px; }
.tile-more .tile-mark i::before { left: 8px; top: 1px; width: 2px; height: 16px; }
.tile-more .tile-mark i::after { left: 1px; top: 8px; width: 16px; height: 2px; }
.tile-more .tile-name { color: var(--ink-3); font-weight: 500; }

/* ---------- 工具卡片 ---------- */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 32px); }
.tool {
  display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
@media (hover: hover) { .tool:hover { border-color: var(--brand-100); box-shadow: 0 18px 40px rgba(15, 37, 51, .08); } }
.tool-art { padding: 22px 22px 0; background: linear-gradient(180deg, var(--brand-50) 0%, #fff 100%); border-bottom: 1px solid var(--line); }
.tool-art img { width: 100%; height: auto; aspect-ratio: 16 / 9; margin-bottom: -1px; filter: drop-shadow(0 14px 28px rgba(5, 67, 97, .10)); }
.tool-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 26px clamp(20px, 2.4vw, 30px) 28px; }
.tool-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; min-height: 28px; }
.tool-cat { color: var(--brand); font-size: 14px; font-weight: 600; }
.tool h3 { font-size: clamp(22px, 2.2vw, 26px); line-height: 1.35; font-weight: 700; }
.tool-tag { margin: 8px 0 18px; color: var(--ink-2); }
.ticks { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 9px; }
.ticks li { position: relative; padding-left: 20px; line-height: 1.65; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 7px; height: 7px; border-radius: 2px; background: var(--brand); opacity: .75; }
.tool-note { margin: 0 0 20px; font-size: 14px; line-height: 1.7; color: var(--ink-3); }
.tool-foot {
  margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
}
.tool-where { display: grid; gap: 2px; min-width: 0; }
.tool-host { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; word-break: break-all; }
a.tool-host { padding: 8px 0; margin: -8px 0; }
@media (hover: hover) { a.tool-host:hover { color: var(--brand); text-decoration: underline; } }
.tool-access { font-size: 14px; color: var(--ink-3); }

/* 第一张卡片横着排：左图右文 */
.tool-featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.tool-featured .tool-art { display: grid; align-content: center; padding: 28px; border-bottom: 0; border-right: 1px solid var(--line); }
.tool-featured .tool-art img { margin-bottom: 0; }
.tool-featured .tool-body { padding: clamp(26px, 3vw, 40px); }
.tool-featured h3 { font-size: clamp(26px, 2.8vw, 32px); }

/* 状态标签：在线 / 需授权 / 暂时无法访问。没测出来就不显示 */
.chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 3px 12px 3px 10px; border-radius: 99px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.chip[hidden] { display: none; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip[data-state="up"] { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.chip[data-state="invite"] { color: var(--brand); background: var(--brand-50); border-color: var(--brand-100); }
.chip[data-state="invite"]::before { border-radius: 2px; }
.chip[data-state="down"] { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }

/* ---------- 定制开发 ---------- */
.custom-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.custom-grid h2 { margin-bottom: 20px; }
.custom-grid p { color: var(--ink-2); max-width: 36em; }
.custom-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 28px; }
.custom-side { margin: 0; border-top: 1px solid var(--line); }
.custom-side div { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.custom-side dt { color: var(--ink-3); font-size: 15px; }
.custom-side dd { margin: 0; }

/* ---------- 页脚 ---------- */
.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); } }
.foot-note { flex-basis: 100%; margin: 0; }
.copy { margin: 0 0 0 auto; }

/* ---------- 独立小页（404） ---------- */
.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-actions { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin-top: 28px; }

/* ---------- 响应式 ---------- */
@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; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .launcher { max-width: 520px; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tool-featured { display: flex; }
  .tool-featured .tool-art { display: block; padding: 22px 22px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .tool-featured .tool-art img { margin-bottom: -1px; }
  .tool-featured .tool-body { padding: 26px clamp(20px, 2.4vw, 30px) 28px; }
  .tool-featured h3 { font-size: clamp(22px, 2.2vw, 26px); }
  .custom-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  h1 { font-size: 28px; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .brand img { height: 34px; }
  .bar .btn-sm { padding: 0 14px; }
  .hero-count { margin-top: 28px; }
  .launcher-grid { padding: 16px 12px 18px; gap: 8px 4px; }
  .tile-mark { width: 56px; height: 56px; border-radius: 14px; }
  .tool-foot { align-items: flex-start; }
  .tool-foot .btn { width: 100%; }
  .copy { margin-left: 0; }
}

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

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