/* ==========================================================================
   中策策敏 AI · 移动端适配层（wap/cmai）
   作用：在 PC 版主题之上做移动优先改造 —— 固定顶栏 + 抽屉栏目 + 底部快捷栏，
        并把仅适合宽屏的网格 / 图示 / 表格压缩成单列可读版式。
   原则：只在本目录生效，不改动 PC 端样式源文件。
   ========================================================================== */

:root {
  --m-head-h: 52px;
  --m-bar-h: 56px;
}

html { scroll-padding-top: calc(var(--m-head-h) + 10px); }

/* 顶部/底部让位 */
body.m-site {
  padding-top: var(--m-head-h);
  padding-bottom: calc(var(--m-bar-h) + env(safe-area-inset-bottom, 0px));
  -webkit-text-size-adjust: 100%;
}
/* 白皮书页用自有 sticky 头部，不再额外让位 */
body.m-site--doc { padding-top: 0; }

/* ---------- 固定顶栏 ---------- */
.m-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  height: var(--m-head-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: rgba(255, 255, 255, .93);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line, rgba(74, 142, 255, .16));
}
.m-head__brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m-head__brand img {
  width: 26px; height: 26px; border-radius: 7px; display: block;
  box-shadow: 0 3px 10px rgba(74, 142, 255, .3);
}
.m-head__txt {
  font-size: 15px; font-weight: 600; color: #1f2937;
  letter-spacing: .2px; white-space: nowrap;
}
.m-head__txt b { color: #4a8eff; font-weight: 700; }
.m-head__btn {
  width: 38px; height: 38px; flex-shrink: 0; padding: 0;
  border: 1px solid rgba(74, 142, 255, .26); border-radius: 10px;
  background: #f3f8ff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.m-head__btn span {
  display: block; width: 16px; height: 2px; border-radius: 2px;
  background: #2563eb; transition: transform .24s ease, opacity .18s ease;
}
.m-head__btn.on span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.m-head__btn.on span:nth-child(2) { opacity: 0; }
.m-head__btn.on span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 白皮书页：栏目按钮挂在自有头部里，桌面隐藏 */
.m-navbtn { display: none; margin-left: 4px; }
@media (max-width: 900px) { .m-navbtn { display: flex; } }

/* ---------- 抽屉栏目 ---------- */
.m-mask {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(15, 32, 66, .42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .26s ease, visibility .26s ease;
}
.m-mask.on { opacity: 1; visibility: visible; }

.m-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 140;
  width: 78%; max-width: 320px;
  background: #fff;
  box-shadow: -14px 0 44px rgba(15, 32, 66, .2);
  transform: translateX(102%); transition: transform .3s cubic-bezier(.32, .72, .28, 1);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 0 26px;
}
.m-drawer.on { transform: translateX(0); }
.m-drawer__hd {
  padding: 0 20px 14px; font-size: 13px; color: #909399;
  letter-spacing: 1px; border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.m-drawer__hd b { display: block; font-size: 16px; color: #1f2937; letter-spacing: .2px; margin-bottom: 4px; }
.m-drawer a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; font-size: 15px; color: #333;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.m-drawer a span { font-size: 11.5px; color: #b4b8bf; margin-left: 10px; text-align: right; }
.m-drawer a.on {
  color: #2563eb; font-weight: 600;
  background: linear-gradient(90deg, rgba(74, 142, 255, .12), transparent 82%);
  box-shadow: inset 3px 0 0 #4a8eff;
}
.m-drawer__out {
  margin: 18px 20px 0; padding: 12px 16px !important;
  border: 1px solid rgba(74, 142, 255, .26) !important; border-radius: 10px;
  background: #f6faff; color: #2563eb !important; font-size: 14px !important;
  justify-content: center !important;
}
.m-drawer__ver { padding: 22px 20px 0; font-size: 12px; color: #b4b8bf; line-height: 1.7; }

/* ---------- 底部快捷栏 ---------- */
.m-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  height: calc(var(--m-bar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: stretch;
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, .07);
}
.m-bar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; color: #909399; -webkit-tap-highlight-color: transparent;
}
.m-bar a svg { width: 21px; height: 21px; stroke: #b4b8bf; }
.m-bar a.on { color: #2563eb; font-weight: 600; }
.m-bar a.on svg { stroke: #4a8eff; }

/* ---------- 移动端整体排版收紧 ---------- */
@media (max-width: 900px) {
  .wrap, .hero-in, .foot-in, .container { padding-left: 16px; padding-right: 16px; }

  .sec { padding: 42px 0; }
  .sec-h { margin-bottom: 24px; }
  .sec-h h2 { font-size: 22px; line-height: 1.45; letter-spacing: 0; }
  .sec-h p { font-size: 14px; line-height: 1.8; }
  .sec-h .kicker { font-size: 11px; letter-spacing: 2px; margin-bottom: 8px; }

  .hero { padding: 24px 0 32px; }
  .hero::before { width: 560px; height: 380px; top: -170px; }
  .hero h1 { font-size: 26px; line-height: 1.42; letter-spacing: 0; margin-bottom: 14px; }
  .hero-lead { font-size: 14.5px; line-height: 1.85; margin-bottom: 20px; }
  .answer { padding: 14px 16px; margin-bottom: 20px; border-radius: 12px; }
  .answer-t { font-size: 11px; letter-spacing: 1.2px; margin-bottom: 6px; }
  .answer p { font-size: 14.5px; line-height: 1.8; }

  .hero-btns { flex-direction: column; gap: 10px; }
  .hero-btns .btn { width: 100%; justify-content: center; }
  .btn { padding: 13px 20px; font-size: 14.5px; }

  .stats { margin-top: 26px; grid-template-columns: 1fr 1fr; }
  .stat { padding: 15px 13px; }
  .stat-n { font-size: 23px; }
  .stat-l { font-size: 11.5px; line-height: 1.5; margin-top: 4px; }

  .q-h { font-size: 17.5px; margin: 30px 0 12px; padding-left: 12px; }

  .card, .case, .case2, .vs-col, .distill-stage, .method-card, .mech-card,
  .feat-card, .feat-main, .sb-cell, .plat, .rel a, .post, .ring { padding: 20px; }
  .card h3, .case h3 { font-size: 16px; }
  .card p, .case p { font-size: 13.5px; }
  .card-num { font-size: 32px; top: 14px; right: 18px; }

  .faq summary { padding: 15px 16px; font-size: 14.5px; gap: 10px; }
  .faq-a { padding: 0 16px 18px; font-size: 14px; line-height: 1.85; }

  .cta { padding: 26px 18px; border-radius: 16px; }
  .cta h2 { font-size: 21px; }
  .cta p { font-size: 14px; margin-bottom: 22px; }

  .step { grid-template-columns: 46px 1fr; gap: 14px; padding-bottom: 26px; }
  .step-n { width: 46px; height: 46px; border-radius: 13px; font-size: 16px; }
  .step::before { left: 22px; top: 48px; }
  .step-b h3 { font-size: 15.5px; }

  .sb-grid { grid-template-columns: 1fr; }
  .scoreboard { padding: 20px; }
  .sb-head { flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

  .rel { grid-template-columns: 1fr 1fr; }
  .posts .post { padding: 18px; }
  .post-d { display: none; }

  .foot { padding: 32px 0 22px; }
  .foot-top { gap: 26px; margin-bottom: 26px; }
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 22px; }
  .foot-bot { font-size: 12px; gap: 8px; }

  /* 白皮书下载条：改为上下两段 */
  .wp-bar { padding: 0 16px; margin-top: 14px; }
  .wp-bar-in { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .wp-view { gap: 12px; }
  .wp-txt b { font-size: 14px; line-height: 1.4; }
  .wp-txt i { font-size: 11.5px; line-height: 1.5; }
  .wp-btn { flex: 1 0 100%; justify-content: center; padding: 11px 16px; }

  /* 弹窗 */
  .wp-mask { padding: 14px; }
  .wp-modal { padding: 24px 18px 20px; border-radius: 16px; }
  .wp-modal-hd h3 { font-size: 18px; }
  .wp-modal-hd p { font-size: 12.5px; }
  .wp-field-row { grid-template-columns: 1fr; gap: 0; }

  /* 表格：横向滚动，边到边 */
  .tbl-wrap, .table-wrap { margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .tbl-wrap table, .table-wrap table { min-width: 560px; }
  table { font-size: 13px; }
  thead th { padding: 11px 14px; font-size: 12.5px; }
  tbody td { padding: 11px 14px; font-size: 13px; }

  /* AI 蒸馏层级图示：等比收窄，保留金字塔观感 */
  .layer { flex-direction: column; align-items: stretch; gap: 5px; }
  .layer-bar { width: 100% !important; height: auto; min-height: 40px; padding: 10px 14px; font-size: 13px; line-height: 1.45; }
  .layer:nth-child(1) .layer-bar { width: 52% !important; }
  .layer:nth-child(2) .layer-bar { width: 60% !important; }
  .layer:nth-child(3) .layer-bar { width: 68% !important; }
  .layer:nth-child(4) .layer-bar { width: 76% !important; }
  .layer:nth-child(5) .layer-bar { width: 84% !important; }
  .layer:nth-child(6) .layer-bar { width: 92% !important; }
  .layer:nth-child(7) .layer-bar { width: 100% !important; }
  .layer-tag { font-size: 11.5px; padding-left: 2px; }
}

/* ---------- 白皮书长文页 ---------- */
@media (max-width: 900px) {
  .site-header .container { height: 52px; padding: 0 14px; }
  .site-header .brand img { width: 28px; height: 28px; }
  .site-header .brand span { font-size: 14px; }
  .site-header .brand small { font-size: 10px; }
  .site-nav { gap: 10px; }
  .site-nav .nav-cta { padding: 8px 14px; font-size: 12.5px; border-radius: 99px; }
  .hero .container { padding-top: 26px; padding-bottom: 28px; }
  .hero h1 { font-size: 25px; line-height: 1.4; letter-spacing: 0; }
  .hero .subtitle { font-size: 14.5px; line-height: 1.8; margin-bottom: 14px; }
  .hero .meta { font-size: 12px; line-height: 1.7; }
  .crumb { font-size: 12px; line-height: 1.6; }
  .hero-cta { margin-top: 18px; gap: 10px; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  .main { padding: 22px 16px 56px; }
  .toc-card { padding: 18px 16px; margin: 18px auto; border-radius: 12px; }
  .toc { font-size: 14px; }
  .toc-list > li { margin-bottom: 8px; }
  .wb-h2 { font-size: 20px; margin: 32px 0 12px; padding: 10px 14px; }
  .wb-h3 { font-size: 17px; margin: 24px 0 10px; }
  .wb-p { font-size: 14.5px; line-height: 1.9; margin-bottom: 14px; }
  .wb-list li { font-size: 14.5px; padding-left: 22px; }
  .wb-callout { padding: 14px 16px; font-size: 15px; margin: 20px 0; }
  .wb-figure { margin: 20px 0; }
  .wb-figure .imgwrap { display: block; padding: 6px; }
  .wb-figure img { width: 100%; height: auto; }
  .notice summary { font-size: 14.5px; padding: 14px 16px; }
  .notice-body { padding: 0 16px 16px; }
  .site-footer { padding-top: 0; }
  .site-footer .container { padding: 30px 16px 22px; }
  .footer-bottom { font-size: 11.5px; line-height: 1.7; }
}

/* ---------- 窄屏（≤380）再收一档 ---------- */
@media (max-width: 380px) {
  .hero h1 { font-size: 23px; }
  .sec-h h2 { font-size: 20px; }
  .stats { grid-template-columns: 1fr; }
  .rel { grid-template-columns: 1fr; }
  .m-head__txt { font-size: 14px; }
}
