/* ===== 赛福基因 FAQ 前台样式（还原 ciphergene.com 视觉规范） ===== */
:root {
  --primary: #1E9A9A;        /* 主色 teal */
  --primary-light: #5eb3b3;
  --primary-dark: #178585;
  --grad: linear-gradient(270deg, #33D6D6 0%, #449FD7 100%);
  --link: #0070C0;
  --text: #4C4C4C;
  --muted: #737373;
  --border: #E6ECF0;
  --bg-soft: #F2F7FA;
  --footer-bg: #EEF3F6;
  --footer-bottom: #E6ECF0;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}
a { color: var(--link); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); text-decoration: none; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
img { max-width: 100%; }

/* ===== Header ===== */
.site-header { background: #fff; }
.header-inner { display: flex; align-items: center; height: 86px; flex-wrap: nowrap; padding: 0 96px; max-width: 1440px; margin: 0 auto; }
.logo { display: flex; align-items: center; flex: none; }
.logo-img { height: 35px; width: auto; }            /* 与原站一致，避免偏大 */
.logo-text { font-size: 20px; font-weight: 700; color: var(--primary); }
.logo-text i { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 4px; }

.site-nav { margin-left: auto; flex: none; }
.site-nav ul { display: flex; list-style: none; margin: 0; padding: 0; align-items: center; flex-wrap: nowrap; }
.site-nav li { position: relative; flex: none; }
.site-nav li > a {
  display: block;
  padding: 0 23px;
  line-height: 86px;
  font-size: 20px;
  white-space: nowrap;
  color: var(--text);
  border-bottom: 2px solid transparent;
}
.site-nav li > a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.site-nav li.active > a { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* 查询报告 胶囊按钮（参照原站 scol：定宽 + 图标 + 微光动效） */
.scol-btn {
  margin-left: 10px;
  flex: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 38px;
  padding: 0;
  border-radius: 50px;
  border: 1px solid rgba(30,154,154,.3);
  background: var(--primary);
  color: #fff !important;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  transition: background .25s;
}
.scol-btn .scol-ico { width: 15px; height: 15px; margin-right: 6px; position: relative; top: -1px; }
/* 微光扫过效果 */
.scol-btn::after {
  content: '';
  position: absolute;
  width: 40px;
  top: -60px;
  bottom: -60px;
  left: -80px;
  background: rgba(255,255,255,.4);
  transform: rotate(45deg);
  animation: scolShine .8s infinite ease;
}
@keyframes scolShine { from { left: -80px; } to { left: 200px; } }
.scol-btn:hover { background: var(--primary-dark); }

/* 手机端导航：默认隐藏，≤1100px 显示（还原 ciphergene.com 手机端） */
.header-phone { display: none; }
.phone-logo-text { color: #fff; font-size: 18px; font-weight: 700; }

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0; }
.breadcrumb .sep { margin: 0 8px; color: #cdd5da; }
.breadcrumb .current { color: var(--text); }

/* ===== 布局 ===== */
.faq-layout { display: flex; gap: 32px; align-items: flex-start; padding-bottom: 48px; }

/* 侧边分类 */
.faq-sidebar {
  width: 250px; flex: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  position: sticky; top: 20px;
}
.cat-accordion, .cat-accordion ul { list-style: none; margin: 0; padding: 0; }
.cat-accordion .cat-group { border-bottom: 1px solid var(--border); }
.cat-accordion .cat-group:last-child { border-bottom: none; }

.cat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.cat-name {
  flex: 1;
  font-size: 16px; font-weight: 500;
  color: var(--text);
}
.cat-name:hover { color: var(--primary); }
.cat-name.active { color: var(--primary); font-weight: 600; }

.cat-toggle {
  width: 22px; height: 22px;
  border: none; background: transparent;
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.toggle-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  font-size: 16px; line-height: 1;
  color: var(--muted);
}
.toggle-icon::before { content: "+"; }
.cat-group.expanded > .cat-header .toggle-icon::before { content: "→"; color: var(--primary); }

.cat-children {
  padding: 4px 0 14px 8px;
}
.cat-children li { margin-bottom: 6px; }
.cat-child {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: #555;
  background: #fff;
  border: 1px solid transparent;
}
.cat-child:hover { background: #e3f3f3; color: var(--primary); }
.cat-child.active {
  background: #e3f3f3;
  color: var(--primary);
  border-color: #bfe6e6;
  font-weight: 500;
}

.faq-main { flex: 1; min-width: 0; }
.faq-title { font-size: 24px; margin: 0 0 20px; color: var(--text); }

/* 文章卡片 */
.article-list { display: flex; flex-direction: column; }
.article-card {
  padding: 22px 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.article-card:first-child { padding-top: 0; }
.article-card:last-child { border-bottom: none; }
.article-title { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.article-title a { color: var(--primary); }
.article-title a:hover { color: var(--primary-dark); text-decoration: underline; }
.article-summary { margin: 0 0 10px; color: #666; line-height: 1.7; }
.article-meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; align-items: center; }
.cat-tag { background: #e3f3f3; color: var(--primary); padding: 2px 10px; border-radius: 10px; }
.empty { color: var(--muted); padding: 48px 0; text-align: center; }

/* ===== 详情页（参照 ciphergene.com/company/425.html） ===== */
.detail-wrap { background: #FAFAFA; padding: 60px 20px 100px; }
.detail-article { max-width: 1000px; margin: 0 auto; }

.detail-title {
  font-size: 42px; line-height: 64px; margin: 0;
  color: #19191A; font-weight: 400;
}
.detail-meta { display: flex; margin: 31px 0 60px; }
.detail-meta .date { font-size: 20px; color: #999; line-height: 30px; padding-right: 18px; }
.detail-meta .meta-rule { flex: 1; border-bottom: 1px solid #D9D9D9; height: 15px; align-self: flex-start; }

.detail-content { font-size: 16px; line-height: 1.95; color: var(--text); word-wrap: break-word; }
.detail-content img { display: block; max-width: 100%; height: auto; margin: 40px auto 20px; border-radius: 8px; }
/* 图片对齐：默认居中；编辑器中选择左/右对齐时按选择显示 */
/* 兼容 inline style（style-based align）和 class（class-based align / 旧数据） */
.detail-content p[style*="text-align: left"] img,
.detail-content p[style*="text-align:left"] img,
.detail-content div[style*="text-align: left"] img,
.detail-content div[style*="text-align:left"] img,
.detail-content figure[style*="text-align: left"] img,
.detail-content figure[style*="text-align:left"] img,
.detail-content .ql-align-left img { margin-left: 0; margin-right: auto; }
.detail-content p[style*="text-align: right"] img,
.detail-content p[style*="text-align:right"] img,
.detail-content div[style*="text-align: right"] img,
.detail-content div[style*="text-align:right"] img,
.detail-content figure[style*="text-align: right"] img,
.detail-content figure[style*="text-align:right"] img,
.detail-content .ql-align-right img { margin-left: auto; margin-right: 0; }
.detail-content .ql-align-center img { margin-left: auto; margin-right: auto; }
/* 字号（与编辑器 size 选择器对应） */
.detail-content .ql-size-small { font-size: .75em; }
.detail-content .ql-size-large { font-size: 1.5em; }
.detail-content .ql-size-huge { font-size: 2.5em; }
.detail-content h2, .detail-content h3, .detail-content h4 { color: #19191A; }
.detail-content a { color: var(--link); }

/* 列表（Quill 2.x 统一用 <ol>，靠 data-list 区分类型） */
.detail-content ol[data-list="bullet"] { list-style: none; padding-left: 1.4em; }
.detail-content ol[data-list="bullet"] > li { position: relative; }
.detail-content ol[data-list="bullet"] > li::before { content: '•'; position: absolute; left: -1.1em; }
.detail-content ol[data-list="checked"],
.detail-content ol[data-list="unchecked"] { list-style: none; padding-left: 1.6em; }
.detail-content ol[data-list="checked"] > li,
.detail-content ol[data-list="unchecked"] > li { position: relative; }
.detail-content ol[data-list="unchecked"] > li::before { content: '☐'; position: absolute; left: -1.5em; }
.detail-content ol[data-list="checked"] > li::before { content: '☑'; position: absolute; left: -1.5em; }

/* 表格（Word 粘贴 / 编辑器建表共用，样式由网站统一控制） */
.detail-content .table-wrap,
.detail-content table { width: max-content; max-width: 100%; }
.detail-content table { margin: 28px 0; border-collapse: collapse; border: 1px solid #e0e0e0; font-size: 15px; line-height: 1.7; }
.detail-content table th,
.detail-content table td { border: 1px solid #e0e0e0; padding: 10px 14px; vertical-align: top; word-break: break-word; }
.detail-content table thead th { background: #f5f7fa; font-weight: 600; color: #2a2f36; text-align: left; }
.detail-content table tbody tr:nth-child(even) td { background: #fafbfc; }
.detail-content table p { margin: 0; }
/* 移动端表格横向滚动，避免撑破正文 */
@media (max-width: 640px) {
  .detail-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

.detail-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border-top: 1px solid #D9D9D9; margin-top: 60px; padding-top: 60px;
  font-size: 16px; color: #4D4D4D; line-height: 45px;
}
.detail-nav .nav-prev, .detail-nav .nav-next {
  width: 30%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-nav .nav-next { text-align: right; }
.detail-nav a { color: #4D4D4D; }
.detail-nav a:hover { color: var(--primary); }
.detail-nav .nav-back { flex: none; }
.detail-nav .nav-back a {
  display: inline-block; padding: 10px 40px;
  border: 1px solid #CCCCCC; line-height: 23px; white-space: nowrap;
}
.detail-nav .nav-back a:hover { border-color: var(--primary); color: var(--primary); }

/* 分页 */
.pagination { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.pagination a { padding: 7px 13px; border: 1px solid var(--border); border-radius: 6px; color: #555; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a:hover { text-decoration: none; border-color: var(--primary); }

/* ===== Footer ===== */
.site-footer { background: var(--footer-bg); }
.footer-inner {
  display: flex; justify-content: space-between; padding: 96px 0 80px; flex-wrap: wrap;
  max-width: 80%; margin: 0 auto;
}
.footer-brand { flex: 0 0 auto; }
.footer-logo { width: 260px; height: auto; display: inline-block; margin-bottom: 18px; }
.footer-contact { display: flex; flex-direction: column; gap: 10px; margin-top: 40px; margin-bottom: 29px; font-weight: 700; color: var(--primary); font-size: 22px; line-height: 48px; }
.footer-contact a { display: inline-flex; align-items: center; color: var(--primary); }
.footer-contact .ico { width: 22px; height: 22px; margin-right: 12px; position: relative; top: 2px; }
/* 微信公众号（企业号 / 学术号）二维码 */
.footer-wx { display: flex; }
.footer-wx .wx-item { display: flex; align-items: center; position: relative; cursor: pointer; margin-right: 24px; }
.footer-wx .wx-item img.wx-ico { width: 31px; display: block; }
.footer-wx .wx-item span { margin-left: 4px; color: var(--primary-light); font-size: 14px; }
.footer-wx .wx-item .wx-qr {
  display: none;
  position: absolute;
  bottom: 56px; left: -54px;
  padding: 6px; background: #fff; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.footer-wx .wx-item .wx-qr::after {
  content: ''; position: absolute; right: 50%; bottom: -8px;
  width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #fff;
}
.footer-wx .wx-item:hover .wx-qr { display: block; }
.footer-wx .wx-item .wx-qr img { width: 144px; display: block; }
.footer-cols { display: flex; flex: 0 0 60%; margin-left: auto; flex-wrap: wrap; justify-content: space-between; }
.footer-col h4 { margin: 0 0 38px; font-size: 20px; font-weight: 500; line-height: 28px; color: var(--text); }
.footer-col a { display: block; color: var(--muted); font-size: 16px; line-height: 42px; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { background: var(--footer-bottom); }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 16px; height: 80px; line-height: 80px; color: var(--muted); font-size: 13px; flex-wrap: wrap; max-width: 80%; margin: 0 auto; padding: 0; }
.footer-bottom a { text-decoration: none; }
/* 技术支持 + hover 切换 logo（与官网一致） */
.bottom-mk { display: flex; align-items: center; }
.bottom-mk a { display: inline-flex; align-items: center; color: var(--muted); }
.bottom-mk span { display: inline-block; width: 14px; height: 14px; position: relative; line-height: 80px; top: 3px; margin-left: 6px; }
.bottom-mk span i { position: absolute; left: 0; top: 0; display: flex; }
.bottom-mk span i img { width: 14px; height: 14px; display: block; }
.bottom-mk span i:nth-child(2) { opacity: 0; transition: all .2s linear; }
.bottom-mk a:hover span i:nth-child(1) { opacity: 0; }
.bottom-mk a:hover span i:nth-child(2) { opacity: 1; }

@media (max-width: 1100px) {
  body { padding-top: 49px; }            /* 让出手机端固定顶栏高度 */

  /* PC 顶栏隐藏，切换为手机端汉堡导航 */
  .header-pc { display: none !important; }
  .header-phone { display: block; }

  /* 手机端固定顶栏：渐变背景 + 49px 高，展开时撑满全屏 */
  .site-header { background: transparent; }
  .header-phone {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 9999;
    height: 49px; overflow: hidden;
    background: linear-gradient(270deg, #33D6D6 0%, #449FD7 100%);
    transition: height .3s linear;
  }
  .header-phone.show { height: 100%; }
  .phone-top {
    display: flex; justify-content: space-between; align-items: center;
    height: 49px; padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.2);
  }
  .phone-logo img { width: 83px; height: auto; display: block; }
  .phone-hgang {
    background: none; border: none; padding: 0; cursor: pointer;
    display: inline-flex; flex-direction: column; justify-content: center;
  }
  .phone-hgang i {
    display: block; width: 26px; height: 2px; background: #fff;
    margin-bottom: 5px; position: relative;
    transition: all .3s linear;
  }
  .phone-hgang i:last-child { margin-bottom: 0; }
  .header-phone.show .phone-hgang i:nth-child(1) { transform: rotate(45deg); top: 7px; }
  .header-phone.show .phone-hgang i:nth-child(2) { opacity: 0; }
  .header-phone.show .phone-hgang i:nth-child(3) { transform: rotate(-45deg); top: -7px; }

  .phone-panel { opacity: 0; transition: opacity .3s linear; padding-top: 0; }
  .header-phone.show .phone-panel { opacity: 1; }
  .phone-panel ul { list-style: none; margin: 0 20px; padding: 0; }
  .phone-panel li { border-bottom: 1px solid rgba(255,255,255,.2); }
  .phone-panel li a {
    display: flex; align-items: center;
    line-height: 47px; color: #fff; font-size: 13px;
  }
  .phone-panel li a:hover { color: #fff; }
  .phone-panel li.active a { font-weight: 500; }
  .phone-panel li.phone-report a img { width: 13px; margin-right: 8px; }

  /* 布局：侧边栏与正文纵向堆叠 */
  .faq-layout { flex-direction: column; }
  .faq-sidebar { width: 100%; position: static; }

  /* 页脚在窄屏下收紧内边距 */
  .footer-inner { padding: 56px 20px 48px; max-width: 100%; }
  .footer-bottom .container { padding: 0 20px; height: auto; line-height: 2; max-width: 100%; }
  .footer-bottom .container > span { padding: 12px 0; }

  .detail-wrap { padding: 20px 20px 40px; }
  .detail-title { font-size: 22px; line-height: 34px; }
  .detail-meta { margin: 11px 0 20px; }
  .detail-meta .date { font-size: 16px; }
  .detail-nav { margin-top: 30px; padding-top: 30px; line-height: 1.8; }
  .detail-nav .nav-prev, .detail-nav .nav-next { width: 50%; font-size: 12px; }
  .detail-nav .nav-back { display: none; }
}
