html{
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after{
    box-sizing: border-box;
}

body{
    padding: 0;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    width: 100%;
    min-height: 100vh;
}

.container{
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* 顶部背景 */
.header{
    width: 100%;
    height: 500px;
    background: url("../assets/bg.webp") no-repeat center center;
    background-size: cover;
}

.headerContainer{
    width: 100%;
    height: 55px;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between; 
    align-items: center;
}
.null{
    width: 25%;
}

.logoImage{
    width: 400px;
}

/* 搜索 */
.search{
    flex: 1;
    min-width: 0;
    max-width: 460px;
    margin-left: 170px;
    margin-right: 24px;
    display: flex;
    align-items: center;
    height: 40px;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.search-input{
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 8px 0 18px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: #333;
}

.search-input::placeholder{
    color: #999999;
}

.search-input:focus{
    outline: none;
    box-shadow: none;
}

.search-icon{
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 100%;
}

/* 内容部分 */
.content{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 30px;
    /* margin-bottom: 64px; */
    padding: 0 24px;
    box-sizing: border-box;
}

/* 内页正文占位（html/content.html 等，与首页资源区同宽，中间可后续填充） */
.content-main{
    width: 100%;
    max-width: 1000px;
    min-height: 360px;
    box-sizing: border-box;
}

/* 样板库列表页（content.html） */
.content-main--catalog{
    max-width: 1350px;
    min-height: auto;
}

.catalog-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.catalog-grid__empty{
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    padding: 40px 16px;
    margin: 0;
}

.catalog-card{
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 7px;
    background-color: #fafafa;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    min-height: 0;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    cursor: pointer;
}

.catalog-card:hover{
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
}

.catalog-card__media{
    flex: 0 0 170px;
    width: 170px;
    height: 170px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f0f0f0;
    align-self: center;
}

.catalog-card__media img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.28s ease;
}

.catalog-card:hover .catalog-card__media img{
    transform: scale(1.1);
}

.catalog-card__meta{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.catalog-field__label{
    margin: 0;
    padding-left: 8px;
    border-left: 3px solid #c62828;
    font-size: 15px;
    font-weight: 900;
    color: #333;
    line-height: 1.3;
    transition: color 0.28s ease, border-color 0.28s ease;
}

.catalog-card:hover .catalog-field__label{
    color: #b71c1c;
    border-left-color: #b71c1c;
}

.catalog-field__value{
    margin: 2px 0 0;
    padding-left: 11px;
    font-size: 14px;
    font-weight: 400;
    color: #555;
    line-height: 1.4;
    word-break: break-word;
}

.catalog-pagination{
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}

.catalog-pagination__controls{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
}

.catalog-pagination__btn{
    padding: 6px 14px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.catalog-pagination__btn:hover:not(:disabled){
    border-color: #c62828;
    color: #c62828;
}

.catalog-pagination__btn:disabled{
    opacity: 0.45;
    cursor: not-allowed;
}

.catalog-pagination__pages{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.catalog-pagination__page{
    min-width: 36px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.catalog-pagination__page:hover{
    border-color: #c62828;
    color: #c62828;
}

.catalog-pagination__page.is-active{
    background-color: #c62828;
    border-color: #c62828;
    color: #fff;
    cursor: default;
}

@media (max-width: 1100px){
    .catalog-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px){
    .catalog-grid{
        grid-template-columns: 1fr;
    }

    .catalog-card{
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .catalog-card__meta{
        width: 100%;
    }

    .catalog-field__label,
    .catalog-field__value{
        text-align: left;
    }
}

/* 资源中心 */
.resource-section{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1000px;
}

.resource{
    position: relative;
    margin: 0;
    font-size: 26px;
    color: #252525;
    font-weight: 700;
    padding-bottom: 10px;
    text-align: center;
}

/* 浅灰全长底线 */
.resource::after{
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 220px;
    height: 2px;
    background-color: #d8d8d8;
}

/* 中间红色加粗段，叠在灰线之上 */
.resource::before{
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #d81e06;
    z-index: 1;
}

.contentList{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 48px;
    margin-top: 170px;
    padding-top: 4px;
}

.resource-card{
    position: relative;
    width: 322px;
    height: 100px;
    border-radius: 10px;
    background-color: #f9f9f9;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0px 10px 10px 1px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.resource-card__figure{
    position: absolute;
    top: -120%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    display: flex;
    justify-content: center;
}

.resource-card__img{
    width: 160px;
    height: 160px;
    object-fit: contain;
    display: block;
    box-sizing: border-box;
    padding: 4px;
}

.resource-card__title{
    position: relative;
    top: 30px;
    z-index: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 400;
    color: #666666;
}

/* —— 以下为悬停动效（追加，不修改上方原有样式） —— */
.resource-card{
    transition: transform 0.3s ease;
}

.resource-card:hover{
    transform: translateY(-8px);
}

.resource-card__img{
    transition: transform 0.3s ease;
}

.resource-card:hover .resource-card__img{
    transform: scale(1.08);
}

.resource-card__caption{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    position: relative;
    top: 50px;
    box-sizing: border-box;
}

.resource-card__caption .resource-card__title{
    top: 0;
    margin: 0;
}

.resource-card__line{
    flex-shrink: 0;
    width: 40px;
    height: 2px;
    background-color: #b71c1c;
    transform: scaleX(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.resource-card__line--left{
    transform-origin: right center;
}

.resource-card__line--right{
    transform-origin: left center;
}

.resource-card:hover .resource-card__line{
    transform: scaleX(1);
    opacity: 1;
}

.resource-card__title{
    transition: color 0.3s ease;
}

.resource-card:hover .resource-card__title{
    color: #b71c1c;
}

/* —— 页脚 —— */
.footer{
    width: 100%;
    margin-top: 100px;
}

.footer__main{
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 40px 24px 48px;
}

.footer__inner{
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 32px 24px;
    align-items: start;
}

.footer__heading{
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.footer__list{
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer__list li{
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.footer__list li:last-child{
    margin-bottom: 0;
}

.footer__text{
    color: #424242;;
}

.footer__col--aside{
    min-width: 0;
}

.footer__aside{
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.footer__qr-wrap{
    flex-shrink: 0;
}

.footer__qr{
    display: block;
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.footer__hotline{
    flex: 1;
    min-width: 150px;
}

.footer__hotline-label{
    margin: 0 0 4px;
    font-size: 12px;
    color: #424242;;
}

.footer__hotline-num{
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    color: #d81e06;
    line-height: 1.2;
}

.footer__hotline-mail{
    margin: 0;
    font-size: 12px;
}

.footer__bar{
    background-color: #3d3d3d;
    color: #c8c8c8;
    font-size: 12px;
}

.footer__bar-inner{
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.footer__bar-left{
    flex: 1;
    text-align: left;
    min-width: 0;
}

.footer__bar-center{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.footer__bar-right{
    flex: 1;
}

.footer__beian-icon{
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f4d03f, #b8860b 45%, #8b4513);
    flex-shrink: 0;
}

.footer__sub{
    background-color: #ffffff;
    padding: 10px 24px;
    text-align: center;
}

.footer__sub-text{
    margin: 0;
    font-size: 12px;
    color: #888888;
}

@media (max-width: 992px){
    .footer__inner{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer__col--aside{
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px){
    .footer__inner{
        grid-template-columns: 1fr;
    }

    .footer__bar-inner{
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .footer__bar-left,
    .footer__bar-right{
        flex: none;
    }
}

/* —— 首页：小屏铺满宽度，资源卡片取消悬浮重叠 —— */
@media (max-width: 768px){
    .header{
        height: min(42vw, 220px);
        min-height: 180px;
        background-position: center top;
    }

    .headerContainer{
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        row-gap: 8px;
        padding: 8px 10px;
    }

    .null{
        display: none;
        width: 0;
        flex: 0 0 0;
    }

    .logoImage{
        width: min(56vw, 220px);
        height: auto;
        flex-shrink: 0;
    }

    .search{
        flex: 1 1 100%;
        order: 3;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        min-width: 0;
    }

    .content{
        margin-top: 16px;
        padding: 0 12px;
        justify-content: stretch;
    }

    .resource-section{
        max-width: none;
        align-items: stretch;
    }

    .contentList{
        flex-direction: column;
        align-items: stretch;
        margin-top: 20px;
        gap: 20px;
    }

    .resource-card{
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
    }

    .resource-card__figure{
        position: static;
        left: auto;
        top: auto;
        transform: none;
        margin: 0 auto 12px;
    }

    .resource-card__img{
        width: min(140px, 36vw);
        height: auto;
        max-height: 160px;
    }

    .resource-card__caption{
        position: static;
        top: auto;
        padding: 0 12px 16px;
    }

    .resource-card__caption .resource-card__title{
        top: auto;
    }

    .footer__main{
        padding: 28px 12px 36px;
    }

    .footer__bar-inner{
        padding-left: 12px;
        padding-right: 12px;
    }

    .footer__sub{
        padding-left: 12px;
        padding-right: 12px;
    }
}