/* QilyLean Header + Project Integrity V3 | 2026-08-31
 * Final visual authority for two public redlines:
 * 1) the global header must never clip first-level labels, active borders or the language frame;
 * 2) project evidence grades must remain unmistakably readable on list and dark-hero surfaces.
 * V3 materially enlarges A/B/C/D letterforms and locks high-contrast grade badges.
 * This file intentionally loads last.
 */
:root{
  --qily-integrity-deep:#0f4b5a;
  --qily-integrity-deep-2:#12606f;
  --qily-integrity-gold:#caa15f;
  --qily-integrity-gold-soft:#ffe39b;
  --qily-integrity-line:#b9d9d4;
  --qily-integrity-track:#dbe8e6;
}

/* ===== 01 | HEADER: KEEP EVERYTHING INSIDE THE CONTENT AXIS ===== */
html body :is(header.qily-site-header,header.qily-global-header,header.topbar.qily-site-header,header.top.qily-site-header){
  box-sizing:border-box!important;
  overflow:visible!important;
  padding-left:0!important;
  padding-right:14px!important;
  column-gap:0!important;
}

html body :is(header.qily-site-header,header.qily-global-header,header.topbar.qily-site-header,header.top.qily-site-header)
:is(nav.site-nav,nav.qily-global-nav,nav.nav,nav[aria-label="主导航"],nav[aria-label="网站导航"],nav[aria-label="QilyLean核心导视"]){
  box-sizing:border-box!important;
  flex:1 1 0!important;
  min-width:0!important;
  width:auto!important;
  max-width:none!important;
  margin-left:auto!important;
  margin-right:0!important;
  padding:4px 10px 18px 2px!important;
  scroll-padding-left:10px!important;
  scroll-padding-right:14px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  white-space:nowrap!important;
}
html body :is(header.qily-site-header,header.qily-global-header,header.topbar.qily-site-header,header.top.qily-site-header)
:is(nav.site-nav,nav.qily-global-nav,nav.nav,nav[aria-label="主导航"],nav[aria-label="网站导航"],nav[aria-label="QilyLean核心导视"])>a[href]{
  box-sizing:border-box!important;
  flex:0 0 auto!important;
  min-width:max-content!important;
  max-width:none!important;
  min-height:42px!important;
  margin-block:1px!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
  word-break:keep-all!important;
  overflow-wrap:normal!important;
}

/* Translator stays geometrically fixed; native select popup owns its own painting. */
html body .qily-web-translate{
  box-sizing:border-box!important;
  flex:0 0 206px!important;
  width:206px!important;
  min-width:206px!important;
  max-width:206px!important;
  min-height:42px!important;
  margin-left:8px!important;
  margin-right:0!important;
  padding:0 8px!important;
  align-self:center!important;
  overflow:hidden!important;
  border:1.5px solid var(--qily-integrity-line)!important;
  border-radius:10px!important;
  background:#f8fffd!important;
  background-clip:padding-box!important;
}
html body .qily-web-translate__mark{
  box-sizing:border-box!important;
  flex:0 0 24px!important;
  width:24px!important;
  min-width:24px!important;
  height:24px!important;
  overflow:visible!important;
}
html body .qily-web-translate__select{
  box-sizing:border-box!important;
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:34px!important;
  padding:0 28px 0 10px!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
  word-break:keep-all!important;
  font-size:16px!important;
  line-height:1.2!important;
  animation:none!important;
  transition:none!important;
  transform:none!important;
  will-change:auto!important;
}

html body .qily-primary-nav-scroll-rail{
  background:var(--qily-integrity-track)!important;
  box-shadow:inset 0 0 0 1px rgba(15,75,90,.12)!important;
}
html body .qily-primary-nav-scroll-thumb{
  background:var(--qily-integrity-deep)!important;
  box-shadow:0 1px 4px rgba(15,75,90,.22)!important;
}
html body .qily-primary-nav-scroll-rail:hover .qily-primary-nav-scroll-thumb,
html body .qily-primary-nav-scroll-thumb:active{
  background:var(--qily-integrity-deep-2)!important;
}

/* ===== 02 | PROJECT LIST: A/B/C/D MUST READ AT FIRST GLANCE ===== */
html body.project-list-page .project-list-card .qily-project-list-grade{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr)!important;
  align-items:center!important;
  gap:12px!important;
  width:100%!important;
  max-width:100%!important;
  min-height:64px!important;
  margin:0 0 12px!important;
  padding:8px 14px!important;
  border:2px solid #89bbb3!important;
  border-radius:16px!important;
  background:#f5fbf9!important;
  color:#073c47!important;
  -webkit-text-fill-color:#073c47!important;
  box-shadow:none!important;
  text-decoration:none!important;
  opacity:1!important;
}
html body.project-list-page .project-list-card .qily-project-list-grade>b{
  display:grid!important;
  place-items:center!important;
  width:48px!important;
  min-width:48px!important;
  height:48px!important;
  min-height:48px!important;
  border:2px solid #fff!important;
  border-radius:50%!important;
  background:#063842!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-family:Arial,Helvetica,sans-serif!important;
  font-size:26px!important;
  font-style:normal!important;
  font-weight:900!important;
  letter-spacing:0!important;
  line-height:1!important;
  opacity:1!important;
  text-shadow:0 1px 1px rgba(0,0,0,.28)!important;
  box-shadow:0 0 0 2px #063842!important;
  -webkit-font-smoothing:antialiased!important;
  text-rendering:geometricPrecision!important;
}
html body.project-list-page .project-list-card .qily-project-list-grade>span{
  display:block!important;
  min-width:0!important;
  color:#073c47!important;
  -webkit-text-fill-color:#073c47!important;
  font-size:17px!important;
  font-weight:950!important;
  line-height:1.3!important;
  opacity:1!important;
  text-shadow:none!important;
  white-space:normal!important;
}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-a{
  border-color:#4b9688!important;
  background:#edf8f5!important;
}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-a>b{background:#0b513f!important;box-shadow:0 0 0 2px #0b513f!important}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-b{
  border-color:#69ad9f!important;
  background:#edf8f5!important;
}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-b>b{background:#0f4b5a!important;box-shadow:0 0 0 2px #0f4b5a!important}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-c{
  border-color:var(--qily-integrity-gold)!important;
  background:#fff5d8!important;
}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-c>b{background:#6b4900!important;box-shadow:0 0 0 2px #6b4900!important}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-d{
  border-color:#9cbab5!important;
  background:#f3f7f6!important;
}
html body.project-list-page .project-list-card .qily-project-list-grade.qily-grade-d>b{background:#314f54!important;box-shadow:0 0 0 2px #314f54!important}

/* ===== 03 | PROJECT DETAIL HERO: HIGH-CONTRAST EVIDENCE CONTRACT ===== */
html body.project-detail-page .module-hero .qily-project-evidence-grade,
html body.project-detail-page .project-hero .qily-project-evidence-grade{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:54px minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  align-items:center!important;
  column-gap:14px!important;
  row-gap:3px!important;
  width:min(720px,100%)!important;
  max-width:100%!important;
  min-height:74px!important;
  margin:12px 0 10px!important;
  padding:10px 16px!important;
  border:2px solid var(--qily-integrity-gold)!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#073c47!important;
  -webkit-text-fill-color:#073c47!important;
  box-shadow:0 10px 24px rgba(0,0,0,.16)!important;
  text-decoration:none!important;
  opacity:1!important;
}
html body.project-detail-page .module-hero .qily-project-evidence-grade>b,
html body.project-detail-page .project-hero .qily-project-evidence-grade>b{
  grid-column:1!important;
  grid-row:1/3!important;
  display:grid!important;
  place-items:center!important;
  width:54px!important;
  min-width:54px!important;
  height:54px!important;
  min-height:54px!important;
  border:2px solid #fff!important;
  border-radius:50%!important;
  background:#063842!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-family:Arial,Helvetica,sans-serif!important;
  font-size:29px!important;
  font-style:normal!important;
  font-weight:900!important;
  letter-spacing:0!important;
  line-height:1!important;
  opacity:1!important;
  text-shadow:0 1px 1px rgba(0,0,0,.28)!important;
  box-shadow:0 0 0 2px #063842!important;
  -webkit-font-smoothing:antialiased!important;
  text-rendering:geometricPrecision!important;
}
html body.project-detail-page .module-hero .qily-project-evidence-grade.qily-grade-a>b,
html body.project-detail-page .project-hero .qily-project-evidence-grade.qily-grade-a>b{background:#0b513f!important;box-shadow:0 0 0 2px #0b513f!important}
html body.project-detail-page .module-hero .qily-project-evidence-grade.qily-grade-b>b,
html body.project-detail-page .project-hero .qily-project-evidence-grade.qily-grade-b>b{background:#0f4b5a!important;box-shadow:0 0 0 2px #0f4b5a!important}
html body.project-detail-page .module-hero .qily-project-evidence-grade.qily-grade-c>b,
html body.project-detail-page .project-hero .qily-project-evidence-grade.qily-grade-c>b{background:#6b4900!important;box-shadow:0 0 0 2px #6b4900!important}
html body.project-detail-page .module-hero .qily-project-evidence-grade.qily-grade-d>b,
html body.project-detail-page .project-hero .qily-project-evidence-grade.qily-grade-d>b{background:#314f54!important;box-shadow:0 0 0 2px #314f54!important}
html body.project-detail-page .module-hero .qily-project-evidence-grade>span,
html body.project-detail-page .project-hero .qily-project-evidence-grade>span{
  grid-column:2!important;
  grid-row:1!important;
  color:#073c47!important;
  -webkit-text-fill-color:#073c47!important;
  font-size:18px!important;
  font-weight:950!important;
  line-height:1.35!important;
  opacity:1!important;
  text-shadow:none!important;
}
html body.project-detail-page .module-hero .qily-project-evidence-grade>small,
html body.project-detail-page .project-hero .qily-project-evidence-grade>small{
  grid-column:2!important;
  grid-row:2!important;
  display:block!important;
  color:#315b61!important;
  -webkit-text-fill-color:#315b61!important;
  font-size:15.5px!important;
  font-weight:850!important;
  line-height:1.45!important;
  opacity:1!important;
  text-shadow:none!important;
  white-space:normal!important;
}
html body.project-detail-page .module-hero .module-inner>.module-lead,
html body.project-detail-page .project-hero .module-inner>.module-lead{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  margin-right:0!important;
  padding-right:0!important;
}

@media(max-width:900px){
  html body :is(header.qily-site-header,header.qily-global-header,header.topbar.qily-site-header,header.top.qily-site-header){
    padding-right:0!important;
  }
  html body .qily-web-translate{
    flex:0 0 auto!important;
    width:min(206px,calc(100vw - 36px))!important;
    min-width:0!important;
    max-width:calc(100vw - 36px)!important;
    margin-left:0!important;
    margin-right:0!important;
  }
}

@media(max-width:620px){
  html body.project-list-page .project-list-card .qily-project-list-grade{
    grid-template-columns:44px minmax(0,1fr)!important;
    min-height:60px!important;
    padding:8px 12px!important;
  }
  html body.project-list-page .project-list-card .qily-project-list-grade>b{
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    font-size:24px!important;
  }
  html body.project-detail-page .module-hero .qily-project-evidence-grade,
  html body.project-detail-page .project-hero .qily-project-evidence-grade{
    grid-template-columns:48px minmax(0,1fr)!important;
    width:100%!important;
    min-height:68px!important;
    padding:9px 12px!important;
  }
  html body.project-detail-page .module-hero .qily-project-evidence-grade>b,
  html body.project-detail-page .project-hero .qily-project-evidence-grade>b{
    width:48px!important;
    min-width:48px!important;
    height:48px!important;
    min-height:48px!important;
    font-size:26px!important;
  }
  html body.project-detail-page .module-hero .qily-project-evidence-grade>span,
  html body.project-detail-page .project-hero .qily-project-evidence-grade>span{font-size:16px!important}
  html body.project-detail-page .module-hero .qily-project-evidence-grade>small,
  html body.project-detail-page .project-hero .qily-project-evidence-grade>small{font-size:14px!important}
}
