/* ============================================================
   BioEDAM — 钢琴白 × Cancer Cell 蓝 学术风格
   白底 #FAF9F6（暖白/象牙白），主色 #2E3A8C（深宝蓝）

   ⚠️ 版式已锁定（用户 2026-08-16 确认定稿）：内容区宽度 1080px 为定稿值。
   不得随意调整宽度/间距/布局参数；如需改版式必须先征求用户同意。
   ============================================================ */
:root {
  --bg: #FFFFFF;            /* 苹果风纯白 */
  --bg-soft: #F5F5F7;       /* 苹果浅灰白（区块底） */
  --surface: #FFFFFF;
  --ink: #1D1D1F;           /* 苹果近黑主文字 */
  --ink-2: #6E6E73;         /* 次要文字 */
  --cc-blue: #2E3A8C;       /* Cancer Cell 蓝（主色） */
  --cc-blue-2: #4051B0;     /* 亮一档 */
  --cc-blue-soft: #EDF0FB;  /* 淡蓝底 */
  --line: #E5E5EA;          /* 苹果浅灰分割线 */
  --green: #2E8B6E;
  --amber: #B98A2F;
  --red: #B0433E;
  --serif: Georgia, "Songti SC", "Noto Serif SC", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --content-width: 1080px;  /* 内容区宽度（锁定，勿改） */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cc-blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航（苹果风毛玻璃） ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 8px rgba(0,0,0,.04);
}
.nav-inner {
  max-width: var(--content-width); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--cc-blue); letter-spacing: .5px; }
.logo small { font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 6px; font-family: var(--sans); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--cc-blue); text-decoration: none; }
.nav-links a.active { color: var(--cc-blue); font-weight: 600; }
.nav-cta {
  background: var(--cc-blue); color: #fff !important;
  padding: 7px 16px; border-radius: 20px; font-size: 13px !important; font-weight: 600;
}
.nav-cta:hover { background: var(--cc-blue-2); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--content-width); margin: 0 auto; padding: 72px 24px 40px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif); font-size: 40px; font-weight: 700;
  color: var(--cc-blue); line-height: 1.3;
}
.hero .sub { color: var(--ink-2); font-size: 17px; margin-top: 14px; max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-tools {
  margin-top: 34px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px; max-width: 860px; margin-left: auto; margin-right: auto;
}
.hero-tool {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; padding-bottom: 12px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.hero-tool:hover {
  transform: translateY(-4px); text-decoration: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.08); border-color: #C9D2F0;
}
.hero-tool img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--cc-blue-soft); }
.hero-tool span {
  display: block; text-align: center; font-size: 14px; font-weight: 600;
  color: var(--cc-blue); margin-top: 10px;
}
.hero .notice {
  margin: 28px auto 0; max-width: 720px; font-size: 13px; color: var(--ink-2);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 18px; text-align: left;
}

/* ---------- 区块通用 ---------- */
.section { max-width: var(--content-width); margin: 0 auto; padding: 56px 24px 8px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.section-head h2 { font-family: var(--serif); font-size: 26px; color: var(--ink); }
.section-head h2::before { content: ""; display: inline-block; width: 5px; height: 22px; background: var(--cc-blue); border-radius: 3px; margin-right: 12px; vertical-align: -3px; }
.section-head .more { margin-left: auto; font-size: 13px; }

/* ---------- 研究卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(46,58,140,.08); border-color: #C9D2F0; }
/* 卡片缩略图：内缩 + contain 整图展示（2026-09-16 用户：图太大、贴住卡片上边界不好看。
   原为 height:160px + object-fit:cover + 零内边距 → 图贴边且被裁切；缩略图 thumb.jpg 本身
   已是 400x300 裁剪版，这里再 contain 不会二次裁切） */
.card .thumb {
  height: auto; padding: 16px 16px 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.card .thumb img {
  width: auto; max-width: 100%; height: 168px; object-fit: contain; display: block;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.card .info { padding: 14px 16px 16px; }
.card h3 { font-family: var(--serif); font-size: 16px; line-height: 1.45; margin-bottom: 8px; color: var(--ink);
  min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .tag { display: inline-block; font-size: 11px; color: var(--cc-blue); background: var(--cc-blue-soft); border-radius: 12px; padding: 2px 10px; margin-bottom: 8px; font-weight: 600; }
.card .meta { margin-top: 10px; font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 8px; }
.card .meta b { color: var(--ink); font-weight: 600; }

/* ---------- 工具卡片 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(46,58,140,.10); }
.tool-card .thumb { height: 150px; background: var(--cc-blue-soft); display: flex; align-items: center; justify-content: center; }
.tool-card .thumb img { max-width: 100%; max-height: 150px; object-fit: contain; }
.tool-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.tool-card h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }
.tool-card p { color: var(--ink-2); font-size: 13.5px; flex: 1; }
.tool-card .features { margin: 10px 0 16px; font-size: 12.5px; color: var(--ink-2); }
.tool-card .features span { display: block; }
.btn {
  display: inline-block; background: var(--cc-blue); color: #fff !important;
  padding: 9px 22px; border-radius: 22px; font-size: 13.5px; font-weight: 600;
  text-align: center; transition: background .15s;
}
.btn:hover { background: var(--cc-blue-2); text-decoration: none; }
.btn.dl-btn { display: inline-block; margin-top: 12px; font-size: 12.5px; padding: 6px 16px; }
.btn.ghost { background: transparent; color: var(--cc-blue) !important; border: 1.5px solid var(--cc-blue); }
.btn.ghost:hover { background: var(--cc-blue-soft); }

/* ---------- 免费声明条 ---------- */
.free-strip {
  max-width: var(--content-width); margin: 44px auto 0; padding: 16px 24px;
  background: linear-gradient(90deg, #EDF0FB, #F7F6F1);
  border: 1px solid #D7DEF6; border-radius: 12px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--cc-blue);
}
.free-strip b { font-weight: 700; }

/* ---------- 页脚 ---------- */
.footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner { max-width: var(--content-width); margin: 0 auto; padding: 36px 24px 28px; }
.footer-cols { display: flex; gap: 48px; flex-wrap: wrap; margin-bottom: 24px; }
.footer-cols h4 { font-size: 13px; color: var(--ink); margin-bottom: 10px; }
.footer-cols a, .footer-cols span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.footer-disclaimer {
  font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line);
  padding-top: 16px; line-height: 1.8; text-align: center;
}
.footer-disclaimer .icp { margin-top: 6px; }
.footer-disclaimer .icp a { color: var(--ink-2); }
.footer-owner { text-align: center; font-size: 12.5px; color: var(--ink-2); margin-top: 16px; }

/* 广告位（默认隐藏，adsEnabled=true 时显示） */
.ad-slot { display: none; }
body.ads-on .ad-slot { display: block; }
.ad-slot {
  max-width: var(--content-width); margin: 20px auto 0; padding: 0 24px;
}
.ad-slot .ad-box {
  border: 1px dashed #C9D2F0; background: #F7F8FD; border-radius: 10px;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: #9AA3C4; font-size: 12px; letter-spacing: 1px;
}

/* ---------- 联系引导 ---------- */
.contact-call {
  max-width: var(--content-width); margin: 44px auto 0; padding: 0 24px; text-align: center;
  font-size: 14.5px; color: var(--ink-2);
}
.contact-call b { color: var(--cc-blue); font-weight: 600; }

/* ---------- 工具页通用 ---------- */
.tool-page { max-width: var(--content-width); margin: 0 auto; padding: 48px 24px 8px; }
.tool-page h1 { font-family: var(--serif); font-size: 30px; color: var(--cc-blue); }
.tool-page .desc { color: var(--ink-2); margin: 10px 0 30px; max-width: 720px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; margin-bottom: 20px;
}
.panel h2 { font-size: 16px; margin-bottom: 14px; color: var(--ink); }
.panel h2::before { content: ""; display: inline-block; width: 4px; height: 16px; background: var(--cc-blue); border-radius: 2px; margin-right: 10px; vertical-align: -2px; }
label { display: block; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; font-weight: 600; }
textarea, input[type=text], select {
  width: 100%; background: #FCFBF8; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--ink); outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--cc-blue-2); }
select { font-family: var(--sans); }
.hint { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 200px; }
.submit-row { margin-top: 20px; display: flex; align-items: center; gap: 14px; }
#status { font-size: 13px; color: var(--ink-2); }
#status.err { color: var(--red); }
.result-box { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 16px; }
.result-box img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.result-box table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 12px; }
.result-box th, .result-box td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.result-box th { background: var(--cc-blue-soft); color: var(--cc-blue); font-weight: 600; }
.demo-bar { background: #E9F2EC; border: 1px solid #C9E2D5; color: var(--green); font-size: 12.5px; padding: 9px 14px; border-radius: 8px; margin-bottom: 14px; }

/* ---------- 捐赠页 ---------- */
.mall-hero { max-width: 720px; margin: 0 auto; text-align: center; padding: 64px 24px 20px; }
.mall-hero h1 { font-family: var(--serif); font-size: 32px; color: var(--cc-blue); }
.mall-hero p { color: var(--ink-2); margin-top: 12px; line-height: 1.9; }
.bmc-wrap { display: none; text-align: center; margin: 20px 0; }
body.bmc-on .bmc-wrap { display: block; }
.bmc-btn {
  display: inline-block; background: #FFDD00; color: #000 !important;
  padding: 10px 26px; border-radius: 8px; font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.bmc-btn:hover { text-decoration: none; filter: brightness(.97); }

/* ============================================================
   移动端适配（2026-09-16 用户手机实测：导航没适配，logo 挤两行、
   链接被压成「首/页」「费/工/具」竖排、CTA 变三方块）
   —— 只作用于 ≤720px，桌面版式（1080px 定稿）不受影响
   ============================================================ */
.nav-toggle { display: none; }          /* 汉堡按钮：仅手机显示 */

@media (max-width: 720px) {
  /* ---- 导航：汉堡 + 下拉面板 ---- */
  .nav-inner { height: 56px; padding: 0 16px; }
  .logo { font-size: 18px; white-space: nowrap; }
  .logo small { display: none; }        /* 手机去掉「· 科研生信分析平台」副标题 */
  .nav-toggle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; width: 44px; height: 44px; margin-left: auto; padding: 0;
    background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle span {
    display: block; width: 22px; height: 2px; background: var(--ink);
    border-radius: 2px; transition: transform .2s ease, opacity .15s ease;
  }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-links {
    display: none;                      /* 默认收起 */
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(255,255,255,.98);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 30px rgba(0,0,0,.10);
    padding: 4px 0 12px;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a {
    padding: 14px 20px; font-size: 15px;        /* 大点击区，≥44px 高 */
    border-top: 1px solid rgba(0,0,0,.045);
  }
  .nav-links a:first-child { border-top: 0; }
  .nav-links a:hover { text-decoration: none; }
  .nav-links a.active { color: var(--cc-blue); background: var(--cc-blue-soft); }
  .nav-cta {
    margin: 10px 16px 2px; padding: 12px 16px !important; font-size: 14px !important;
    border-radius: 22px; text-align: center; border-top: 0 !important;
  }

  /* ---- 通用排版与间距：收窄、字号降一档 ---- */
  .hero { padding: 40px 16px 28px; }
  .hero h1 { font-size: 27px; }
  .hero .sub { font-size: 15px; }
  .hero .notice { font-size: 12.5px; padding: 10px 14px; }
  .section { padding: 36px 16px 6px; }
  /* 区块标题行：手机端上下堆叠，避免副标题把标题挤成「免费在线工/具」 */
  .section-head { flex-wrap: wrap; row-gap: 4px; margin-bottom: 18px; }
  .section-head h2 { font-size: 21px; white-space: nowrap; }
  .section-head h2::before { height: 18px; width: 4px; margin-right: 9px; }
  .section-head .more { flex: 0 0 100%; margin-left: 0; font-size: 12.5px; }
  .tool-page { padding: 30px 16px 6px; }
  .tool-page h1 { font-size: 23px; }
  .tool-page .desc { font-size: 14px; margin-bottom: 22px; }
  .mall-hero { padding: 38px 16px 14px; }
  .mall-hero h1 { font-size: 25px; }

  /* ---- 网格：一律单列 ---- */
  .grid, .tool-grid, .hero-tools { grid-template-columns: 1fr; gap: 14px; }
  .grid { grid-template-columns: 1fr; }
  .hero-tool img { height: 132px; }

  /* ---- 表单/面板：输入框堆叠、按钮加大 ---- */
  .panel { padding: 18px 16px; }
  .form-row { gap: 0; }
  .form-row > div { flex: 1 1 100%; min-width: 0; }
  .submit-row { flex-wrap: wrap; gap: 10px; }
  .btn { padding: 12px 22px; font-size: 14px; }
  .btn.dl-btn { padding: 10px 16px; font-size: 13px; }
  select, textarea, input[type=text] { font-size: 16px; }  /* 16px 防 iOS 聚焦自动放大 */

  /* ---- 页脚 / 其它 ---- */
  .footer { margin-top: 40px; }
  .footer-inner { padding: 26px 16px 22px; }
  .footer-cols { gap: 22px 28px; margin-bottom: 18px; }
  .free-strip { margin: 30px 16px 0; padding: 14px 16px; font-size: 12.5px; }
  .contact-call { margin-top: 30px; padding: 0 16px; }
  .ad-slot { padding: 0 16px; }

  /* ---- 防横向溢出（表格/图片/长串） ---- */
  .result-box { overflow-x: auto; }
  .result-box table { min-width: 420px; }
  img { max-width: 100%; height: auto; }
}
