/* ============================================
   Services Page Styles - 服务项目页面样式
   根据 Figma 设计 1:1 还原
   ============================================ */

.services-main-content {
    width: 100%;
    min-height: 2080px;
    position: relative;
    background-color: #FCFBFB;
    margin-top: 0;
    padding-top: 0;
}

/* Banner Section - 1920px × 620px, 位置: (0, 140) */
.services-banner {
    width: 100%;
    height: 620px;
    position: relative;
    margin-top: 0;
    padding-top: 0;
    overflow: hidden;
    border-radius: 0 0 0 175px;
}

/* Services Intro Section - 位置: (555, 940), 宽度: 810px */
.services-intro-section {
    width: 100%;
    padding: 0;
    margin-top: 180px;
    position: relative;
}

.services-intro-section .container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 220px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.services-intro-title {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 600;
    font-size: 56px;
    line-height: 1.06em;
    color: #C69D7A;
    text-align: center;
    margin-bottom: 26px;
    height: 59px;
}

.services-intro-subtitle {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.4em;
    color: #384963;
    text-align: center;
    margin-bottom: 35px;
    height: 25px;
}

.services-intro-description {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6em;
    letter-spacing: 0.04em;
    color: #384963;
    text-align: center;
    width: 810px;
    min-height: 78px;
}

/* Services Content Section - 位置: (220, 1440), 尺寸: 1480px × 520px */
.services-content-section {
    width: 100%;
    height: 520px;
    position: relative;
    margin-top: 280px;
    overflow: visible;
}

.services-content-section .container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    height: 100%;
    width: 100%;
}

/* Blue Background - 位置: (220, 1440), 尺寸: 1480px × 520px */
.services-blue-bg {
    position: absolute;
    border-radius: 0 115px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(300px, calc(1480px * 100vw / 1920px), 1480px);
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.services-blue-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 默认：PC 显示，隐藏 H5 图 */
.services-blue-bg .services-bg-h5 {
    display: none;
}

.services-image .services-image-h5 {
    display: none;
}

/* 移动端：只显示 H5 图 */
@media screen and (max-width: 768px) {
    .services-blue-bg .services-bg-pc {
        display: none;
    }
    .services-blue-bg .services-bg-h5 {
        display: block;
    }
    
    .services-image .services-image-pc {
        display: none;
    }
    .services-image .services-image-h5 {
        display: block;
    }
}

/* Services Image - 位置: (210, 1318), 尺寸约 630px × 370px（PC 自适应缩放） */
.services-image {
    position: absolute;
    top: -122px;
    left: clamp(20px, calc(210px * 100vw / 1920px), 210px);
    z-index: 2;
    overflow: hidden;
}

/* PC 尺寸下，根据屏幕宽度自适应宽度，高度按比例缩放 */
@media screen and (min-width: 769px) {
    .services-image {
        width: clamp(280px, calc(630px * 100vw / 1920px), 630px); /* 1920 下约 630px，窄屏时按比例缩小 */
        aspect-ratio: 630 / 370;
    }
    .services-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

/* Services Grid - 4个服务卡片，相对于 container */
.services-grid {
    display: -webkit-grid; /* Safari 兼容性 */
    display: grid;
    -webkit-grid-template-columns: repeat(2, clamp(155px, calc(310px * 100vw / 1920px), 310px)); /* Safari 兼容性 */
    grid-template-columns: repeat(2, clamp(155px, calc(310px * 100vw / 1920px), 310px));
    -webkit-grid-template-rows: repeat(2, auto); /* Safari 兼容性 */
    grid-template-rows: repeat(2, auto);
    -webkit-grid-gap: 10px clamp(35px, calc(70px * 100vw / 1920px), 70px); /* Safari 兼容性 */
    grid-gap: 10px clamp(35px, calc(70px * 100vw / 1920px), 70px); /* 旧版 Safari 支持 */
    gap: 10px clamp(35px, calc(70px * 100vw / 1920px), 70px);
    width: clamp(350px, calc(700px * 100vw / 1920px), 700px);
    position: absolute;
    left: clamp(0px, calc(1000px * 100vw / 1920px), 1000px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

/* Japanese language: adjust top position for services-grid */
.lang-ja .services-grid,.lang-en .services-grid {
    left: clamp(0px, calc(880px * 100vw / 1920px), 1000px);
}

/* Service Content Item Base Styles */
.service-content-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    min-width: 235px;
}

/* Safari 兼容性：为不支持 gap 的浏览器添加 margin */
@supports not (gap: 16px) {
    .service-content-item > *:not(:last-child) {
        margin-bottom: 16px;
    }
}

.service-content-title {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1.5em;
    letter-spacing: 0.04em;
    color: #B29786;
    text-align: left;
    width: 100%;
    margin-bottom: 0;
    white-space: nowrap;
}

.service-content-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.service-content-list li {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6em;
    letter-spacing: 0.04em;
    color: #FCFBFB;
    text-align: left;
    margin: 0 0 1px 0;
    padding-left: 16px;
    position: relative;
}

.service-content-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #FCFBFB;
    transform: translateY(-50%);
}

.service-content-note {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6em;
    letter-spacing: 0.04em;
    color: #FCFBFB;
    text-align: left;
    width: 100%;
    margin-top: 0;
}

/* Japanese language: adjust font size for service-content-note */
.lang-ja .service-content-note {
    font-size: 15px;
}

/* English language: slightly smaller fonts for services grid on PC */
@media screen and (min-width: 769px) {
    .lang-en .service-content-title {
        font-size: 18px;
        white-space: wrap;
    }
    .lang-en .service-content-list li {
        font-size: 14px;
    }
    .lang-en .service-content-note {
        font-size: 14px;
    }
}

/* PC 端 1440px 以内：英文版本的 gap 改为 5px */
@media screen and (min-width: 769px) and (max-width: 1620px) {
    .lang-en .service-content-item {
        gap: 5px;
    }
    
    /* Safari 兼容性：为不支持 gap 的浏览器添加 margin */
    @supports not (gap: 5px) {
        .lang-en .service-content-item > *:not(:last-child) {
            margin-bottom: 5px;
        }
    }
    .lang-en .services-grid{
        left: clamp(0px, calc(880px * 100vw / 1920px), 1000px);
    }
}

/* Service Content Positioning */
/* Service 1: 网络内容制作 - 位置: (1000, 1520) */
.service-content-1 {
    -webkit-grid-column: 1; /* Safari 兼容性 */
    grid-column: 1;
    -webkit-grid-row: 1; /* Safari 兼容性 */
    grid-row: 1;
}

/* Service 2: 网络推广支援 - 位置: (1390, 1520) */
.service-content-2 {
    -webkit-grid-column: 2; /* Safari 兼容性 */
    grid-column: 2;
    -webkit-grid-row: 1; /* Safari 兼容性 */
    grid-row: 1;
}

/* Service 3: 轻量网站制作 - 位置: (1000, 1740) */
.service-content-3 {
    -webkit-grid-column: 1; /* Safari 兼容性 */
    grid-column: 1;
    -webkit-grid-row: 2; /* Safari 兼容性 */
    grid-row: 2;
}

/* Service 4: 信息整理与企划支援 - 位置: (1390, 1740) */
.service-content-4 {
    -webkit-grid-column: 2; /* Safari 兼容性 */
    grid-column: 2;
    -webkit-grid-row: 2; /* Safari 兼容性 */
    grid-row: 2;
}

/* 响应式适配 - 1440px以内 */
@media screen and (max-width: 1440px) {
    .services-grid {
        left: clamp(0px, calc(880px * 100vw / 1920px), 880px);
        gap: 10px clamp(30px, calc(40px * 100vw / 1920px), 40px);
    }
    
    .lang-ja .services-intro-subtitle,
    .lang-en .services-intro-subtitle {
        font-size: 16px; /* 18px - 2px */
    }
    
    .lang-ja .services-intro-description,
    .lang-en .services-intro-description {
        font-size: 14px; /* 16px - 2px */
    }
    
    .lang-ja .service-content-title,
    .lang-en .service-content-title {
        font-size: 18px; /* 20px - 2px */
    }
    
    .lang-ja .service-content-list li,
    .lang-en .service-content-list li {
        font-size: 14px; /* 16px - 2px */
    }
    
    .lang-ja .service-content-note,
    .lang-en .service-content-note {
        font-size: 14px; /* 16px - 2px，日语原本是 15px，但也要减 2px 所以是 13px，但根据通用规则应该是 16px-2px=14px */
    }
    
    /* 日语原本的 15px 在 1440px 下也要减 2px */
    .lang-ja .service-content-note {
        font-size: 13px; /* 15px - 2px */
    }
}

/* ============================================
   移动端适配 - 将所有绝对定位改为相对定位
   ============================================ */
@media screen and (max-width: 768px) {
    /* services-main-content 内部所有使用绝对定位的元素改为相对定位 */
    .services-main-content section > * {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
    }
    
    /* 保持某些元素的特殊定位（不在main-content内） */
    #header-container {
        position: relative;
    }
    
    /* 移动端导航弹窗必须保持 fixed 定位 */
    .mobile-nav-overlay {
        position: fixed !important;
    }
    
    /* 移动端多语言弹窗打开时，header-container 变为 fixed */
    #header-container.lang-dropdown-open {
        position: fixed;
    }
    
    #footer-container {
        position: absolute;
    }
    
    .mobile-nav-footer {
        position: absolute;
    }
    
    /* 容器元素保持相对定位 */
    .container,
    .services-main-content {
        position: relative;
    }
    
    .services-main-content .services-banner {
        height: auto;
    }
    
    .services-main-content .services-intro-section {
        margin-top: 80px;
    }
    .services-content-section {
        margin-top: 150px;
        height: auto;
        padding: 0 30px;
    }
    
    .services-content-section div.container {
        height: 960px;
        padding: 0 30px;
        width: fit-content;
    }
    
    .services-content-section .container .services-blue-bg {
        width: 370px;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0 60px;
    }
    
    .services-content-section .container .services-image {
        left: -10px;
        top: -60px;
        transform: none;
        width: 254px;
        height: 170px;
    }
    
    .services-content-section .container .services-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .services-content-section .services-grid {
        position: relative;
        left: 0;
        top: 160px;
        transform: translateY(0);
        display: flex;
        flex-direction: column;
        gap: 40px;
        width: 100%;
    }
    
    /* Safari 兼容性：为不支持 gap 的浏览器添加 margin */
    @supports not (gap: 40px) {
        .services-content-section .services-grid > *:not(:last-child) {
            margin-bottom: 40px;
        }
    }
    
    /* 移动端英文和日语：gap 改为 8px */
    .lang-en .services-content-section .services-grid,
    .lang-ja .services-content-section .services-grid {
        gap: 8px;
    }
    
    /* Safari 兼容性：为不支持 gap 的浏览器添加 margin */
    @supports not (gap: 8px) {
        .lang-en .services-content-section .services-grid > *:not(:last-child),
        .lang-ja .services-content-section .services-grid > *:not(:last-child) {
            margin-bottom: 8px;
        }
    }
    
    /* 移动端英文：top 改为 105px */
    /* .lang-en .services-content-section .services-grid {
        top: 105px;
    } */
    
    .services-content-section .service-content-item {
        width: 300px;
        gap: 0;
    }
    .services-content-section h3.service-content-title {
        margin-bottom: 10px;
        font-size: 18px;
        white-space: wrap;
        padding: 0;
    }
    
    .services-content-section .service-content-item:first-child .service-content-title {
        font-size: 20px;
    }
    .services-content-section .service-content-list li{
        font-size: 14px;
        margin-bottom: 0;
    }
    .services-content-section p.service-content-note{
        margin-top: 10px;
        font-size: 14px;
        padding: 0;
    }
    
    /* 为各个section内部元素添加间距占位 */
    .services-main-content > section > * {
        margin-bottom: calc(20px * 100vw / 390px);
    }
    
    .services-main-content > section > *:last-child {
        margin-bottom: 0;
    }
    
    .services-main-content {
        min-height: auto;
        padding-bottom: 160px;
    }
}

