/* ============================================================
   common.css —— 模板公共组件样式（每个项目共用）
   ------------------------------------------------------------
   包含：
     1. Get a Quote 弹窗（.quote-modal，由 data-quote-modal 触发）
     2. 通用滚动入场动效（[data-reveal] → .is-in-view）
     3. 图片 Lightbox（.lightbox）
     4. 面包屑（.rank-math-breadcrumb，Rank Math 插件输出结构）
   说明：页面级样式请放入各自页面级 CSS，不要污染本文件。
   配套脚本：js/common.js
   加载顺序：framework.css → common.css → 页面级 css
   ============================================================ */

/* ============================================================
   1. Get a Quote 弹窗
   ------------------------------------------------------------
   打开方式：任意元素加 data-quote-modal 属性（见 common.js 接入规则）。
   弹窗结构（JS 自动创建或页面静态提供 #quoteModal）：
     .quote-modal.is-open
       .quote-modal__overlay
       .quote-modal__dialog
         .quote-modal__head
           .quote-modal__title
           .quote-modal__hero（可选）
         .quote-modal__close
         <form>…（来自 <template data-quote-form> 或页面静态结构）
   ============================================================ */
.quote-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quote-modal.is-open {
    opacity: 1;
    visibility: visible;
}

body.quote-modal-open {
    overflow: hidden;
}

.quote-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(0.04rem);
}

.quote-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 7.77rem;
    /* 777px，按项目改 */
    max-width: 100%;
    max-height: 100%;
    background: var(--c-bg);
    border-radius: 0.1rem;
    /* 10px */
    overflow: hidden;
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.3);
    transform: translateY(0.2rem) scale(0.98);
    transition: transform 0.35s var(--ease-out);
}

.quote-modal.is-open .quote-modal__dialog {
    transform: translateY(0) scale(1);
}

/* ---------- 头部：深色渐变 + 右上角装饰图 ---------- */
.quote-modal__head {
    position: relative;
    flex: 0 0 1.44rem;
    /* 144px，按项目改 */
    border-radius: 0.1rem 0.1rem 0 0;
    background: linear-gradient(270deg, #000 9.9%, #1d2235 90.78%);
    /* 允许 hero 图溢出 head，配合 z-index 浮在表单之上 */
    overflow: visible;
}

.quote-modal__title {
    position: absolute;
    left: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    color: #fff;
    font-family: var(--font-base);
    font-size: 0.4rem;
    /* 40px，按项目改 */
    font-weight: 600;
    line-height: normal;
}

/* hero 图保持原尺寸，溢出的下半部分通过 z-index 浮在表单之上 */
.quote-modal__hero {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 3.17rem;
    /* 317px，按项目改 */
    height: 2.38rem;
    /* 238px，按项目改 */
    object-fit: cover;
    pointer-events: none;
}

/* ---------- 关闭按钮 ---------- */
.quote-modal__close {
    position: absolute;
    top: 0.16rem;
    right: 0.16rem;
    z-index: 3;
    width: 0.44rem;
    height: 0.44rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.28rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.quote-modal__close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

/* ---------- 表单容器（form 内部样式由项目 / wpcf7.css 提供） ---------- */
.quote-modal__dialog form {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 0.49rem 0.4rem 0.28rem;
    background: transparent;
    border-radius: 0;
    overflow-y: auto;
}

/* ---------- H5 适配 ---------- */
html[data-mode="h5"] .quote-modal {
    padding: 0.16rem;
}

html[data-mode="h5"] .quote-modal__dialog {
    width: 100%;
    height: auto;
    max-height: 92vh;
    overflow: auto;
}

html[data-mode="h5"] .quote-modal__head {
    flex-basis: 1.44rem;
}

html[data-mode="h5"] .quote-modal__title {
    left: 0.4rem;
    font-size: 0.4rem;
}

html[data-mode="h5"] .quote-modal__hero {
    display: none;
}

html[data-mode="h5"] .quote-modal__close {
    width: 0.56rem;
    height: 0.56rem;
    font-size: 0.36rem;
    top: 0.12rem;
    right: 0.12rem;
}

html[data-mode="h5"] .quote-modal__dialog form {
    padding: 0.3rem;
}

/* ============================================================
   2. 通用滚动入场动效
   ------------------------------------------------------------
   用法：<any data-reveal>，进入视口后 JS 添加 .is-in-view。
   可选：data-reveal-delay="0.2s"（错峰）/ data-reveal-once="false"（重复播放）。
   默认效果：淡入 + 上移；项目可在自己的 CSS 中改为任意过渡。
   ============================================================ */
[data-reveal] {
    opacity: 0;
    transform: translateY(0.24rem);
    transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
    will-change: opacity, transform;
}

[data-reveal].is-in-view {
    opacity: 1;
    transform: translateY(0);
}

/* 无 JS 时兜底：直接显示（html.js 由 rem-boot.js 添加） */
html:not(.js) [data-reveal] {
    opacity: 1;
    transform: none;
}

/* ============================================================
   4. 面包屑（Rank Math 插件输出结构，全站共用，全部 !important）
   ------------------------------------------------------------
   插件输出结构：
   <nav aria-label="breadcrumbs" class="rank-math-breadcrumb">
     <p><a href="…">首页</a><span class="separator"> - </span><span class="last">当前页</span></p>
   </nav>
   对齐原设计：1920×60 #F5F5F5 灰条，文字 #333，悬浮 #0265B2
   ============================================================ */
.rank-math-breadcrumb {
    height: 0.6rem !important;
    background: #f5f5f5 !important;
    /* 锁定字号：separator 为文本，必须防止继承到根元素的 rem 基准字号 */
    font-size: 0.14rem !important;
    animation: rankCrumbBarIn 0.5s var(--ease-out) 0.1s backwards !important;
}

.rank-math-breadcrumb p {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.04rem !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 1.6rem !important;
    /* 左缘 160px，与 Hero / 导航 logo 对齐 */
}

/* 条目自左错峰滑入（只做位移，不碰透明度，动画被禁用时内容仍可见） */
.rank-math-breadcrumb p>* {
    animation: rankCrumbItemIn 0.5s var(--ease-out) backwards !important;
}

.rank-math-breadcrumb p>*:nth-child(1) {
    animation-delay: 0.25s !important;
}

.rank-math-breadcrumb p>*:nth-child(2) {
    animation-delay: 0.35s !important;
}

.rank-math-breadcrumb p>*:nth-child(3) {
    animation-delay: 0.45s !important;
}

.rank-math-breadcrumb p>*:nth-child(4) {
    animation-delay: 0.55s !important;
}

.rank-math-breadcrumb p>*:nth-child(5) {
    animation-delay: 0.65s !important;
}

.rank-math-breadcrumb a {
    color: #333 !important;
    font-size: 0.14rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    display: flex;
    align-items: center;
}

.rank-math-breadcrumb a:hover,
.rank-math-breadcrumb a:focus-visible {
    color: #0265B2 !important;
}

/* 首页图标：第一个链接前加房子图标（mask + currentColor，悬浮变色自动跟随） */
.rank-math-breadcrumb p>a:first-child::before {
    content: "" !important;
    display: inline-block !important;
    width: 0.24rem !important;
    height: 0.24rem !important;
    background-color: currentColor !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M16.8456%2013.0457C15.7348%2012.1252%2014.6293%2011.1994%2013.5212%2010.2754C13.0117%209.85109%2012.5023%209.42673%2011.992%209.00061C11.9473%209.03339%2011.9097%209.05997%2011.8738%209.0892C10.2799%2010.4198%208.68418%2011.7496%207.09373%2013.0847C7.03509%2013.1343%206.99395%2013.2415%206.99307%2013.3221C6.98694%2014.6696%206.98782%2016.0179%206.98957%2017.3654C6.98957%2017.7836%207.20752%2017.9997%207.62505%2017.9997C8.65004%2018.0006%209.67415%2017.9997%2010.6991%2017.9997C10.7543%2017.9997%2010.8094%2017.9935%2010.8795%2017.9891C10.8795%2016.8631%2010.8795%2015.7522%2010.8795%2014.6333C11.6226%2014.6333%2012.35%2014.6333%2013.0931%2014.6333C13.0931%2015.7486%2013.0931%2016.8604%2013.0931%2018.0006C13.1772%2018.0006%2013.2332%2018.0006%2013.2901%2018.0006C14.3037%2018.0006%2015.3164%2018.0006%2016.33%2018.0006C16.7782%2018.0006%2016.9856%2017.7898%2016.9856%2017.3317C16.9865%2016.0073%2016.9839%2014.6829%2016.9883%2013.3593C16.9891%2013.2229%2016.9498%2013.1334%2016.8456%2013.0457Z'/%3E%3Cpath%20d='M19.7655%2011.7079C19.1705%2011.2461%2018.5815%2010.7777%2017.9755%2010.3289C17.7694%2010.1768%2017.6904%2010.021%2017.6934%209.77191C17.7094%208.65511%2017.7014%207.53738%2017.7004%206.42058C17.7004%206.14907%2017.6084%206.03898%2017.3644%206.03711C16.7424%206.03245%2016.1204%206.03245%2015.4984%206.03711C15.2794%206.03898%2015.1734%206.13974%2015.1654%206.3478C15.1574%206.53254%2015.1624%206.7182%2015.1624%206.90294C15.1624%207.29666%2015.1624%207.69039%2015.1624%208.12797C15.0624%208.05333%2015.0064%208.01228%2014.9514%207.96936C14.2614%207.43102%2013.5714%206.89268%2012.8804%206.35433C12.2734%205.88317%2011.7064%205.88224%2011.0983%206.35433C9.83232%207.33678%208.5673%208.3211%207.30128%209.30448C6.27527%2010.1022%205.24925%2010.9008%204.22223%2011.6986C3.92523%2011.9299%203.91523%2012.0466%204.16823%2012.3265C4.31324%2012.4869%204.45624%2012.6484%204.60124%2012.8088C4.81824%2013.0486%204.96125%2013.0607%205.21925%2012.8592C6.92028%2011.5353%208.6213%2010.2095%2010.3233%208.88556C10.8753%208.45545%2011.4293%208.02534%2011.9884%207.59056C12.5464%208.02441%2013.0954%208.45079%2013.6434%208.87717C15.3494%2010.2058%2017.0564%2011.5344%2018.7625%2012.8629C19.0175%2013.0617%2019.1595%2013.0477%2019.3785%2012.8051C19.5275%2012.64%2019.6755%2012.4739%2019.8245%2012.3087C20.0575%2012.0503%2020.0455%2011.9253%2019.7655%2011.7079Z'/%3E%3C/svg%3E") center / contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M16.8456%2013.0457C15.7348%2012.1252%2014.6293%2011.1994%2013.5212%2010.2754C13.0117%209.85109%2012.5023%209.42673%2011.992%209.00061C11.9473%209.03339%2011.9097%209.05997%2011.8738%209.0892C10.2799%2010.4198%208.68418%2011.7496%207.09373%2013.0847C7.03509%2013.1343%206.99395%2013.2415%206.99307%2013.3221C6.98694%2014.6696%206.98782%2016.0179%206.98957%2017.3654C6.98957%2017.7836%207.20752%2017.9997%207.62505%2017.9997C8.65004%2018.0006%209.67415%2017.9997%2010.6991%2017.9997C10.7543%2017.9997%2010.8094%2017.9935%2010.8795%2017.9891C10.8795%2016.8631%2010.8795%2015.7522%2010.8795%2014.6333C11.6226%2014.6333%2012.35%2014.6333%2013.0931%2014.6333C13.0931%2015.7486%2013.0931%2016.8604%2013.0931%2018.0006C13.1772%2018.0006%2013.2332%2018.0006%2013.2901%2018.0006C14.3037%2018.0006%2015.3164%2018.0006%2016.33%2018.0006C16.7782%2018.0006%2016.9856%2017.7898%2016.9856%2017.3317C16.9865%2016.0073%2016.9839%2014.6829%2016.9883%2013.3593C16.9891%2013.2229%2016.9498%2013.1334%2016.8456%2013.0457Z'/%3E%3Cpath%20d='M19.7655%2011.7079C19.1705%2011.2461%2018.5815%2010.7777%2017.9755%2010.3289C17.7694%2010.1768%2017.6904%2010.021%2017.6934%209.77191C17.7094%208.65511%2017.7014%207.53738%2017.7004%206.42058C17.7004%206.14907%2017.6084%206.03898%2017.3644%206.03711C16.7424%206.03245%2016.1204%206.03245%2015.4984%206.03711C15.2794%206.03898%2015.1734%206.13974%2015.1654%206.3478C15.1574%206.53254%2015.1624%206.7182%2015.1624%206.90294C15.1624%207.29666%2015.1624%207.69039%2015.1624%208.12797C15.0624%208.05333%2015.0064%208.01228%2014.9514%207.96936C14.2614%207.43102%2013.5714%206.89268%2012.8804%206.35433C12.2734%205.88317%2011.7064%205.88224%2011.0983%206.35433C9.83232%207.33678%208.5673%208.3211%207.30128%209.30448C6.27527%2010.1022%205.24925%2010.9008%204.22223%2011.6986C3.92523%2011.9299%203.91523%2012.0466%204.16823%2012.3265C4.31324%2012.4869%204.45624%2012.6484%204.60124%2012.8088C4.81824%2013.0486%204.96125%2013.0607%205.21925%2012.8592C6.92028%2011.5353%208.6213%2010.2095%2010.3233%208.88556C10.8753%208.45545%2011.4293%208.02534%2011.9884%207.59056C12.5464%208.02441%2013.0954%208.45079%2013.6434%208.87717C15.3494%2010.2058%2017.0564%2011.5344%2018.7625%2012.8629C19.0175%2013.0617%2019.1595%2013.0477%2019.3785%2012.8051C19.5275%2012.64%2019.6755%2012.4739%2019.8245%2012.3087C20.0575%2012.0503%2020.0455%2011.9253%2019.7655%2011.7079Z'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

/* 分隔符：隐藏 " - " 文本（字号随 rem 缩放会过细），用 ::before 还原设计稿箭头图标 */
.rank-math-breadcrumb .separator {
    color: #333 !important;
    font-size: 0 !important;
    flex: 0 0 auto !important;
}

.rank-math-breadcrumb .separator::before {
    content: "" !important;
    display: inline-block !important;
    width: 0.24rem !important;
    height: 0.24rem !important;
    background-color: currentColor !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M10.2493%2016.25C10.1486%2016.2466%2010.0497%2016.2227%209.95854%2016.1797C9.8674%2016.1367%209.78601%2016.0756%209.71934%2016C9.57889%2015.8594%209.5%2015.6688%209.5%2015.47C9.5%2015.2713%209.57889%2015.0806%209.71934%2014.94L12.7193%2011.94L9.71934%208.94002C9.66002%208.79601%209.647%208.63711%209.68209%208.48536C9.71719%208.33361%209.79866%208.19656%209.91519%208.09322C10.0317%207.98988%2010.1775%207.92538%2010.3324%207.90868C10.4872%207.89198%2010.6435%207.92391%2010.7793%208.00002L14.2793%2011.5C14.4198%2011.6407%2014.4987%2011.8313%2014.4987%2012.03C14.4987%2012.2288%2014.4198%2012.4194%2014.2793%2012.56L10.7793%2016C10.7127%2016.0756%2010.6313%2016.1367%2010.5401%2016.1797C10.449%2016.2227%2010.35%2016.2466%2010.2493%2016.25Z'/%3E%3C/svg%3E") center / contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M10.2493%2016.25C10.1486%2016.2466%2010.0497%2016.2227%209.95854%2016.1797C9.8674%2016.1367%209.78601%2016.0756%209.71934%2016C9.57889%2015.8594%209.5%2015.6688%209.5%2015.47C9.5%2015.2713%209.57889%2015.0806%209.71934%2014.94L12.7193%2011.94L9.71934%208.94002C9.66002%208.79601%209.647%208.63711%209.68209%208.48536C9.71719%208.33361%209.79866%208.19656%209.91519%208.09322C10.0317%207.98988%2010.1775%207.92538%2010.3324%207.90868C10.4872%207.89198%2010.6435%207.92391%2010.7793%208.00002L14.2793%2011.5C14.4198%2011.6407%2014.4987%2011.8313%2014.4987%2012.03C14.4987%2012.2288%2014.4198%2012.4194%2014.2793%2012.56L10.7793%2016C10.7127%2016.0756%2010.6313%2016.1367%2010.5401%2016.1797C10.449%2016.2227%2010.35%2016.2466%2010.2493%2016.25Z'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

.rank-math-breadcrumb .last {
    color: #333 !important;
    font-size: 0.14rem !important;
    font-weight: 500 !important;
}

@keyframes rankCrumbBarIn {
    from {
        transform: translateY(-0.1rem);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes rankCrumbItemIn {
    from {
        transform: translateX(-0.24rem);
    }

    to {
        transform: translateX(0);
    }
}

/* ---------- 面包屑 H5 ---------- */
html[data-mode="h5"] .rank-math-breadcrumb {
    height: max-content !important;
}

html[data-mode="h5"] .rank-math-breadcrumb p {
    max-width: none !important;
    padding: 0 0.4rem !important;
}

html[data-mode="h5"] .rank-math-breadcrumb a,
html[data-mode="h5"] .rank-math-breadcrumb .last {
    font-size: 0.32rem !important;
}

html[data-mode="h5"] .rank-math-breadcrumb p>a:first-child::before {
    width: 0.4rem !important;
    height: 0.4rem !important;
}

html[data-mode="h5"] .rank-math-breadcrumb .separator::before {
    width: 0.4rem !important;
    height: 0.4rem !important;
}

/* ============================================================
   3. 图片 Lightbox
   ------------------------------------------------------------
   用法：<img src="…" data-lightbox alt="…" />
   DOM 由 common.js 首次使用时动态创建，全站共用一个实例。
   ============================================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.78);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox__img {
    display: block;
    height: 85vh;
    border-radius: 0.08rem;
    box-shadow: 0 0.24rem 0.8rem rgba(0, 0, 0, 0.5);
    transform: scale(0.92);
    transition: transform 0.3s var(--ease-out);
}

.lightbox.is-open .lightbox__img {
    transform: scale(1);
}

.lightbox__close {
    position: absolute;
    top: 0.24rem;
    right: 0.32rem;
    width: 0.44rem;
    height: 0.44rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.28rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.lightbox__close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

html[data-mode="h5"] .lightbox__close {
    width: 0.56rem;
    height: 0.56rem;
    font-size: 0.36rem;
    top: 0.16rem;
    right: 0.16rem;
}
