.site-modal-trigger-image {
    cursor: zoom-in;
}

.site-modal-trigger-image:focus-visible {
    outline: 3px solid #d76445;
    outline-offset: 4px;
}

.detail-trigger,
.modal-link-button {
    border: 0;
    background: transparent;
    color: #b94831;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.detail-trigger {
    margin-top: 18px;
    padding: 8px 0 3px;
    border-bottom: 1px solid currentColor;
    font-size: 14px;
}

.modal-link-button {
    padding: 0;
}

.detail-trigger:hover,
.modal-link-button:hover,
.detail-trigger:focus-visible,
.modal-link-button:focus-visible {
    color: #8f3424;
    outline: none;
}

#services .service-card[data-modal-target] {
    position: relative;
    padding-bottom: 76px;
    border: 1px solid transparent;
    cursor: pointer;
    overflow: hidden;
}

#services .service-card[data-modal-target]::after {
    content: "点击查看详情";
    position: absolute;
    right: 24px;
    bottom: 23px;
    padding-right: 18px;
    color: #b94831;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
    opacity: 0;
    transform: translateY(6px);
}

#services .service-card[data-modal-target]::before {
    content: "";
    position: absolute;
    right: 25px;
    bottom: 25px;
    width: 7px;
    height: 7px;
    border-top: 2px solid #b94831;
    border-right: 2px solid #b94831;
    opacity: 0;
    transform: translate(-4px, 4px) rotate(45deg);
}

#services .service-card[data-modal-target]:focus-visible {
    border-color: rgba(215, 100, 69, 0.72) !important;
    box-shadow: 0 0 0 4px rgba(215, 100, 69, 0.16), 0 15px 40px rgba(0, 0, 0, 0.12) !important;
    outline: none;
}

#services .service-card[data-modal-target]:focus-visible::after,
#services .service-card[data-modal-target]:focus-visible::before {
    opacity: 1;
    transform: translate(0, 0) rotate(0);
}

#services .service-card[data-modal-target]:focus-visible::before {
    transform: rotate(45deg);
}

@media (hover: hover) {
    #services .service-card[data-modal-target]:hover {
        border-color: rgba(215, 100, 69, 0.42) !important;
        box-shadow: 0 18px 46px rgba(105, 61, 36, 0.14) !important;
    }

    #services .service-card[data-modal-target]:hover::after,
    #services .service-card[data-modal-target]:hover::before {
        opacity: 1;
    }

    #services .service-card[data-modal-target]:hover::after {
        transform: translateY(0);
    }

    #services .service-card[data-modal-target]:hover::before {
        transform: rotate(45deg);
    }
}

body.site-modal-open {
    overflow: hidden;
}

.site-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 24px;
    border: 0;
    background: transparent;
    color: #29231f;
    overflow: hidden;
}

.site-modal::backdrop {
    background: rgba(15, 17, 20, 0.78);
}

.site-modal-panel {
    position: relative;
    width: min(920px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    margin: 0 auto;
    border: 1px solid rgba(116, 86, 67, 0.22);
    border-radius: 8px;
    background: #fffdf8;
    box-shadow: 0 24px 80px rgba(9, 11, 14, 0.34);
    overflow: hidden;
}

.site-modal-body {
    max-height: calc(100vh - 48px);
    overflow: auto;
    overscroll-behavior: contain;
}

.site-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(79, 65, 56, 0.22);
    border-radius: 50%;
    background: rgba(255, 253, 248, 0.94);
    color: #392f29;
    font: 300 28px/1 Arial, sans-serif;
    cursor: pointer;
}

.site-modal-close:hover,
.site-modal-close:focus-visible {
    border-color: #c75437;
    background: #c75437;
    color: #fff;
    outline: none;
}

.site-modal-detail {
    padding: 52px clamp(24px, 5vw, 58px) 42px;
}

.site-modal-detail h2,
.site-modal-media-title {
    margin: 0 54px 18px 0;
    color: #29231f;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.25;
    letter-spacing: 0;
}

.site-modal-detail p,
.site-modal-detail li {
    color: #5f554f;
    font-size: 16px;
    line-height: 1.85;
}

.site-modal-detail .modal-kicker {
    margin: 0 0 10px;
    color: #c75437;
    font-size: 12px;
    font-weight: 700;
}

.modal-contact-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 22px;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e6ded8;
}

.modal-contact-links {
    display: grid;
    gap: 10px;
}

.modal-contact-links a {
    color: #bd4037;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.modal-contact-actions img {
    width: 112px;
    height: 112px;
    object-fit: cover;
}

.site-modal-detail .news-detail-image {
    display: block;
    width: 100%;
    max-height: 420px;
    margin: 0 0 22px;
    border-radius: 6px;
    object-fit: cover;
}

.site-modal-media {
    min-height: 280px;
    display: flex;
    margin: 0;
    padding: 58px 24px 22px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #17191d;
}

.site-modal-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    object-fit: contain;
}

.site-modal-caption {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.site-modal-video-wrap {
    padding: 54px 24px 24px;
    background: #17191d;
}

.site-modal-media-title {
    color: #fff;
    font-size: 22px;
}

.site-modal-video {
    width: 100%;
    max-height: calc(100vh - 150px);
    display: block;
    background: #000;
    object-fit: contain;
}

.site-modal-sr-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    #services .service-card[data-modal-target] {
        padding-bottom: 58px;
    }

    .site-modal[open] {
        display: flex;
        padding: 0;
        align-items: flex-end;
    }

    .site-modal-panel {
        width: 100%;
        max-height: 92dvh;
        margin: auto 0 0;
        border-width: 1px 0 0;
        border-radius: 8px 8px 0 0;
    }

    .site-modal-body {
        max-height: 92dvh;
    }

    .site-modal-detail {
        padding: 54px 20px 32px;
    }

    .site-modal-detail h2 {
        font-size: 26px;
    }

    .site-modal-media,
    .site-modal-video-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    #services .service-card[data-modal-target] {
        transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s ease;
    }

    #services .service-card[data-modal-target]::after,
    #services .service-card[data-modal-target]::before {
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .site-modal[open] .site-modal-panel {
        animation: site-modal-enter 180ms ease-out;
    }
}

@keyframes site-modal-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
