/* ============================================================
   艺友官网 · Footer V1.0 (方案 B 淡蓝科技)

   - 两层结构：第一层浅色联系区，第二层深蓝版权条。
   - 右侧快捷工具条 (.float-bar) 结构与 id 全部保留，依赖
     quickToolsToggle / quickToolsPanel / backToTop 的现有
     site.js 不变；视觉随方案 B 重做。
   - 视觉令牌优先引用 wwwroot/home/theme-b.css；在 .footer 作用域内
     提供一份等值兜底，使内页（不走 theme-b.css）也能保持一致。
   ============================================================ */

.footer {
    --c-brand:        #1F5FBF;
    --c-brand-bright: #3F8CFF;
    --c-brand-deep:   #163A7A;
    --c-accent:       #F0C330;
    --c-bg:           #FFFFFF;
    --c-bg-blue:      #EAF4FF;
    --c-border:       #D9E4F2;
    --c-title:        #163A7A;
    --c-text:         #4B5D73;
    --c-muted:        #8A9BB0;
    --c-on-dark:      #FFFFFF;

    --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
                 "Noto Sans SC", "Source Han Sans SC", "Hiragino Sans GB",
                 Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-en: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;

    --fs-body: 17px;
    --fs-sm:   15px;
    --fs-en:   13px;

    --radius:    12px;
    --radius-sm: 8px;

    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: .25s;

    position: relative;
    color: var(--c-text);
    background: var(--c-bg-blue);
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: 1.8;
}

.footer,
.footer * { box-sizing: border-box; }

.public-footer__container {
    width: min(1280px, calc(100% - 48px));
    margin-inline: auto;
}

/* ============================================================
   第一层 · 浅色联系区
   ============================================================ */

.footer__contact {
    position: relative;
    overflow: hidden;
    min-height: 146px;
    display: flex;
    align-items: center;
    padding-block: 26px 24px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.footer__contact-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(390px, 1.2fr) minmax(650px, 2fr) minmax(150px, .5fr);
    gap: 20px;
    align-items: center;
}

/* 左：品牌 + Slogan */

.public-footer__logo {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    color: var(--c-brand-deep);
    text-decoration: none;
}
.footer__brand {
    min-width: 0;
    padding-right: 20px;
    border-right: 1px solid rgba(31, 95, 191, .2);
}
.public-footer__logo img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    flex: none;
}
.public-footer__logo > span {
    display: grid;
    line-height: 1.25;
}
.public-footer__logo strong {
    color: var(--c-brand-deep);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .02em;
}
.public-footer__logo small {
    color: var(--c-muted);
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .04em;
    margin-top: 2px;
}

.footer__slogan {
    margin: 6px 0 0;
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.5;
}
.footer__slogan-en {
    display: block;
    margin-top: 3px;
    color: var(--c-brand);
    font-family: var(--font-en);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .055em;
    text-transform: uppercase;
}

/* 中：图标化联系方式 */

.footer__contact-list {
    display: grid;
    grid-template-columns: minmax(315px, 1.45fr) minmax(120px, .72fr) minmax(190px, 1.05fr);
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer__contact-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 4px;
    row-gap: 2px;
    align-items: start;
}

.footer__contact-icon {
    grid-row: 1 / span 2;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: none;
    color: var(--c-brand-deep);
    background: transparent;
    border: 0;
    border-radius: 0;
}
.footer__contact-icon svg {
    width: 20px;
    height: 20px;
}

.footer__contact-text {
    display: contents;
}
.footer__contact-text h4 {
    grid-column: 2;
    margin: 0;
    color: var(--c-brand-deep);
    font-size: 13px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: .02em;
}
.footer__contact-text p {
    grid-column: 2;
    margin: 0;
    color: var(--c-text);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
html[lang="zh"] .footer__contact-item:first-child .footer__contact-text p,
html[lang="ja"] .footer__contact-item:first-child .footer__contact-text p {
    white-space: nowrap;
    overflow-wrap: normal;
}
.footer__contact-text a {
    color: var(--c-text);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}
.footer__contact-text a:hover { color: var(--c-brand); }

/* 右：CTA + 装饰天际线 */

.footer__cta {
    --cta-offset-x: 0px;

    position: relative;
    align-self: center;
    padding: 0;
    color: var(--c-brand-deep);
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    transform: translate(var(--cta-offset-x), 4px);
}
.footer__cta strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .04em;
}
/* 设计稿里这两行英文是辅助信息，走 --c-muted，不与中文标题抢层级 */
.footer__cta-en {
    display: block;
    margin-top: 5px;
    color: var(--c-muted);
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.footer__skyline {
    display: block;
    position: absolute;
    right: 12px;
    bottom: 0;
    width: 420px;
    max-width: none;
    height: auto;
    margin: 0;
    color: #a8c6e5;
    opacity: .5;
    pointer-events: none;
}

/* ============================================================
   第二层 · 深蓝版权条
   ============================================================ */

.footer__bottom {
    background: var(--c-brand-deep);
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
}
.footer__bottom a {
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}
.footer__bottom a:hover { color: #fff; }

.footer__bottom-inner {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-block: 14px;
}
.footer__copyright {
    margin: 0;
    line-height: 1.7;
}
.footer__copyright-main,
.footer__filing { display: block; }
.footer__filing {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 255, 255, .65);
}

.footer__bottom-links {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
.footer__bottom-links a {
    position: relative;
    padding: 4px 14px;
    white-space: nowrap;
}
.footer__bottom-links a + a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, .28);
    transform: translateY(-50%);
}

/* ============================================================
   右下快捷工具条 .float-bar（结构/id 与 V0 完全一致）
   ============================================================ */

.float-bar,
.float-bar * { box-sizing: border-box; }

.float-bar {
    --c-brand: #1F5FBF;
    --c-brand-deep: #163A7A;
    --c-accent: #F0C330;
    --c-border: #D9E4F2;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: .25s;
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.float-bar__item {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--c-brand-deep);
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(22, 58, 122, .14);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--dur) var(--ease),
                color var(--dur) var(--ease),
                border-color var(--dur) var(--ease),
                transform var(--dur) var(--ease);
}
.float-bar__item svg {
    width: 22px;
    height: 22px;
}
.float-bar__item:hover {
    color: #fff;
    background: var(--c-brand);
    border-color: var(--c-brand);
    transform: translateY(-2px);
}

.float-bar__top {
    color: #fff;
    background: var(--c-accent);
    border-color: var(--c-accent);
    opacity: 0;
    pointer-events: none;
    transform: scale(.85);
}
.float-bar__top--visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.float-bar__wechat { position: relative; }
.float-bar__qr {
    position: absolute;
    right: calc(100% + 12px);
    bottom: 0;
    width: 168px;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: 0 18px 42px rgba(22, 58, 122, .2);
    transform: translateX(10px);
    transition: opacity var(--dur) var(--ease),
                visibility var(--dur) var(--ease),
                transform var(--dur) var(--ease);
    pointer-events: none;
}
.float-bar__wechat:hover .float-bar__qr,
.float-bar__wechat:focus-within .float-bar__qr {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.float-bar__qr img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}
.float-bar__qr-tip {
    margin: 8px 0 0;
    color: var(--c-text);
    font-size: 12px;
    text-align: center;
}

/* 在线留言弹窗 */
.message-modal {
    --c-brand: #1F5FBF;
    --c-brand-bright: #3F8CFF;
    --c-brand-deep: #163A7A;
    --c-border: #D9E4F2;
    --c-text: #4B5D73;
    --c-muted: #8A9BB0;
    --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "Hiragino Sans GB", Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}
.message-modal[hidden] { display: none; }
.message-modal { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 24px; font-family: var(--font-sans); }
.message-modal__backdrop { position: absolute; inset: 0; background: rgba(7, 29, 57, .5); backdrop-filter: blur(4px); }
.message-modal__panel { position: relative; width: min(680px, 100%); max-height: min(780px, calc(100vh - 48px)); overflow-y: auto; padding: clamp(24px, 4vw, 40px); color: var(--c-text); background: linear-gradient(145deg, #fff 0%, #f5faff 100%); border: 1px solid rgba(31, 95, 191, .18); border-radius: 18px; box-shadow: 0 24px 80px rgba(7, 29, 57, .3); }
.message-modal__header { display: flex; gap: 18px; justify-content: space-between; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--c-border); }
.message-modal__eyebrow { margin: 0 0 5px; color: var(--c-brand); font-family: var(--font-en); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
.message-modal__header h2 { margin: 0; color: var(--c-brand-deep); font-size: clamp(24px, 4vw, 32px); line-height: 1.3; }
.message-modal__lead { margin: 8px 0 0; color: var(--c-muted); font-size: 14px; line-height: 1.65; }
.message-modal__close { display: grid; width: 36px; height: 36px; flex: none; place-items: center; padding: 0; color: var(--c-brand-deep); background: #fff; border: 1px solid var(--c-border); border-radius: 50%; font-size: 25px; line-height: 1; cursor: pointer; transition: .2s ease; }
.message-modal__close:hover, .message-modal__close:focus-visible { color: #fff; background: var(--c-brand); border-color: var(--c-brand); }
.message-modal__form { padding-top: 22px; }
.message-modal__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.message-modal__field { display: grid; gap: 7px; color: var(--c-brand-deep); font-size: 13px; font-weight: 650; }
.message-modal__field em { color: #c75555; font-style: normal; }
.message-modal__field input, .message-modal__field textarea { width: 100%; padding: 11px 13px; color: var(--c-text); background: #fff; border: 1px solid #cbdced; border-radius: 8px; font: inherit; font-weight: 400; outline: 0; transition: border-color .2s ease, box-shadow .2s ease; }
.message-modal__field textarea { resize: vertical; min-height: 100px; }
.message-modal__field input:focus, .message-modal__field textarea:focus { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(31, 95, 191, .12); }
.message-modal__field--full { grid-column: 1 / -1; }
.message-modal__consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; color: var(--c-muted); font-size: 12px; line-height: 1.6; }
.message-modal__consent input { width: 16px; height: 16px; flex: none; margin-top: 2px; accent-color: var(--c-brand); }
.message-modal__consent input[aria-invalid="true"] { outline: 2px solid #c75555; outline-offset: 2px; }
.message-modal__consent a { color: var(--c-brand); }
.message-modal__consent-error { margin: 10px 0 0; padding: 10px 12px; color: #9b302d; background: #fff2f0; border: 1px solid #f2c6c1; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.message-modal__consent-error[hidden] { display: none; }
.message-modal__status { min-height: 22px; margin: 14px 0 0; color: #c75555; font-size: 13px; line-height: 1.6; }
.message-modal__status.is-success { color: #287c5b; }
.message-modal__header[hidden], .message-modal__form[hidden], .message-modal__success[hidden] { display: none; }
.message-modal__success { position: relative; display: grid; min-height: 300px; justify-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; }
.message-modal__success .message-modal__close { position: absolute; top: 0; right: 0; }
.message-modal__success-icon { display: grid; width: 68px; height: 68px; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c-brand), var(--c-brand-bright)); border-radius: 50%; box-shadow: 0 10px 24px rgba(31, 95, 191, .24); font-size: 38px; font-weight: 700; line-height: 1; }
.message-modal__success h2 { margin: 8px 0 0; color: var(--c-brand-deep); font-size: clamp(24px, 4vw, 30px); }
.message-modal__success p { max-width: 30em; margin: 0; color: var(--c-text); font-size: 15px; line-height: 1.7; }
.message-modal__actions { display: flex; justify-content: flex-end; margin-top: 2px; }
.message-modal__submit { min-width: 150px; padding: 11px 24px; color: #fff; background: linear-gradient(135deg, var(--c-brand), var(--c-brand-bright)); border: 0; border-radius: 8px; box-shadow: 0 8px 18px rgba(31, 95, 191, .2); font: inherit; font-weight: 700; cursor: pointer; transition: .2s ease; }
.message-modal__submit:hover, .message-modal__submit:focus-visible { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(31, 95, 191, .28); }
.message-modal__submit:disabled { opacity: .6; cursor: wait; transform: none; }
.message-modal__honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
body.message-modal-open { overflow: hidden; }
@media (max-width: 560px) {
    .message-modal { align-items: end; padding: 12px; }
    .message-modal__panel { max-height: calc(100vh - 24px); padding: 22px 18px; border-radius: 16px; }
    .message-modal__grid { grid-template-columns: 1fr; gap: 13px; }
    .message-modal__field--full { grid-column: auto; }
    .message-modal__actions, .message-modal__submit { width: 100%; }
}

/* 桌面端不需要展开按钮；移动端切换为单点 launcher 形态（与 V0 行为一致） */
.float-bar__launcher { display: none; }
.float-bar__panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 900px) {
    .footer__bottom-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-block: 18px;
    }
    .footer__copyright { font-size: 13px; }
    .footer__bottom-links { flex-wrap: wrap; }
    .float-bar {
        right: 14px;
        bottom: 72px;
        gap: 8px;
    }
    .float-bar__item {
        width: 46px;
        height: 46px;
    }
    .float-bar__item svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 640px) {
    .public-footer__container { width: min(100% - 32px, 1280px); }
    .footer__bottom-inner {
        text-align: center;
        align-items: center;
    }
    .footer__bottom-links { justify-content: center; width: 100%; }
    .footer__contact-icon { width: 24px; height: 24px; }
    .footer__contact-icon svg { width: 20px; height: 20px; }
}

@media (max-width: 1024px) {
    /* ≤1024px：四个图标竖排会压住各栏标题右侧副标题与页脚右栏，改为单点 launcher */
    .footer { padding-bottom: env(safe-area-inset-bottom); background: var(--c-brand-deep); }

    .float-bar {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
        display: block;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 50%;
        box-shadow: none;
        transform: none;
    }
    .float-bar__launcher {
        display: grid;
        width: 48px;
        height: 48px;
        padding: 0;
        place-items: center;
        color: #fff;
        background: var(--c-brand-deep);
        border: 1px solid rgba(255, 255, 255, .28);
        border-radius: 50%;
        box-shadow: 0 10px 28px rgba(22, 58, 122, .28);
    }
    .float-bar__launcher svg { width: 22px; height: 22px; }
    .float-bar__panel {
        position: absolute;
        right: 2px;
        bottom: 58px;
        align-items: center;
        gap: 8px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px) scale(.96);
        transform-origin: bottom right;
        transition: opacity .2s var(--ease),
                    transform .2s var(--ease),
                    visibility .2s;
        pointer-events: none;
    }
    .float-bar.is-open .float-bar__panel {
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
    }
    .float-bar__item {
        width: 44px;
        height: 44px;
        box-shadow: 0 8px 22px rgba(22, 58, 122, .2);
    }
    .float-bar__qr {
        right: calc(100% + 10px);
        bottom: 0;
        left: auto;
    }

    /* 悬浮 launcher 固定在右下角，滚到底时会压住版权条里的链接 */
    .footer__bottom-inner { padding-bottom: 62px; }
}

/* 英文站点公司名与英文副名相同，隐藏副名避免重复 */
html[lang="en"] .public-footer__logo small {
    display: none;
}

/* 页脚在中等屏幕保持品牌独占一行，联系方式仍横向排列 */
@media (max-width: 1279px) {
    .footer__contact-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .footer__brand {
        display: flex;
        align-items: center;
        padding-right: 0;
        border-right: 0;
    }
    /* 堆叠后这块落到整行左侧，靠右才和设计稿一致，也压在天际线一侧；
       此时文字已贴容器右缘，桌面端那点右移量要去掉 */
    .footer__cta {
        --cta-offset-x: 0px;
        min-height: 64px;
        padding-top: 0;
        text-align: right;
        transform: none;
    }
    .footer__skyline { bottom: 0; }
}

@media (max-width: 640px) {
    .footer__contact {
        min-height: 0;
        padding-block: 22px 16px;
    }
    .footer__contact-inner { gap: 0; }

    /* 手机上品牌文案占据完整行，避免小 Logo 的空白列把公司名向右推开。 */
    .footer__brand {
        display: block;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(31, 95, 191, .14);
    }
    .public-footer__logo {
        display: block;
    }
    .public-footer__logo img { display: none; }
    .public-footer__logo > span { display: block; }
    .public-footer__logo strong { display: block; font-size: 17px; line-height: 1.35; }
    .public-footer__logo small { display: block; }
    .footer__slogan { display: block; margin-top: 5px; }

    /* 联系方式：图标独占左列，标题与内容统一对齐右列。
       条目之间用细线与留白区分三组信息。 */
    .footer__contact-list {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .footer__contact-item {
        grid-template-columns: 20px minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 4px;
        align-items: start;
        padding-block: 12px;
    }
    .footer__contact-icon { width: 20px; height: 22px; }
    .footer__contact-icon svg { width: 19px; height: 19px; }
    .footer__contact-item + .footer__contact-item {
        border-top: 1px solid rgba(31, 95, 191, .1);
    }
    .footer__contact-text p {
        grid-column: 2;
        font-size: 14px;
        line-height: 1.45;
    }
    /* 桌面端给中日文地址加的 nowrap 会在窄屏撑出横向滚动 */
    html[lang="zh"] .footer__contact-item:first-child .footer__contact-text p,
    html[lang="ja"] .footer__contact-item:first-child .footer__contact-text p {
        white-space: normal;
        overflow-wrap: normal;
        text-wrap: pretty;
    }

    /* CTA：右对齐在窄屏上成了一块无所依附的孤字，且英文压在天际线上几乎读不出，
       改为整行居中 + 分隔线，天际线退成背景。 */
    .footer__cta {
        min-height: 0;
        margin-top: 2px;
        padding-top: 12px;
        text-align: center;
        border-top: 1px solid rgba(31, 95, 191, .14);
    }
    .footer__cta-en {
        margin-top: 6px;
        color: #7F92A8;
        letter-spacing: .12em;
    }
    .footer__skyline {
        right: 50%;
        width: 340px;
        opacity: .3;
        transform: translateX(50%);
    }

    /* 链接换行时第 2 行会以一根孤立竖线开头，窄屏改用间距分隔 */
    .footer__bottom-links { gap: 4px 20px; }
    .footer__bottom-links a { padding: 4px 0; }
    .footer__bottom-links a + a::before { display: none; }

    /* 版权信息按公司名、英文权益、备案号分行，短链接保留清晰间距。 */
    .footer__bottom { margin-top: 0; padding: 0; }
    .footer__bottom-inner {
        min-height: 0;
        gap: 6px;
        padding-top: 14px;
        padding-bottom: 52px;
    }
    .footer__copyright { line-height: 1.55; }
    .footer__copyright-main,
    .footer__copyright-company,
    .footer__copyright-rights,
    .footer__filing { display: block; }
    .footer__copyright-rights { margin-top: 1px; }
    .footer__filing { margin-top: 4px; line-height: 1.5; }
    .footer__filing-record,
    .footer__filing-security { display: block; }
    .footer__filing-separator { display: none; }
}
