﻿
* {
    box-sizing: border-box;
    font-family: "PingFang SC",Arial,Microsoft YaHei,Helvetica;
}
/*让选中元素背景变黄色*/
::selection{
    background-color: #fff12f;
    color: #000;
}

body {
    background-color: #333;
    color: white;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 顶部盒子 */
.header-box {
    width: 100%;
    height: 270px;
    background-color: rgba(0, 0, 0, 1.0);
    background-image: url('https://picsum.photos/1206/250');
    background-size: cover;
    background-position: center;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding-top: 5px;
    position: relative; /* 添加相对定位，以便伪元素相对于它定位 */
}

/* 添加半透明遮罩 */
.header-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 纯黑色半透明遮罩 */
}

.header-box > * {
    z-index: 0; /* 确保子元素显示在遮罩之上 */
}

.logo {
    font-size: 32px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 4px;
}

.site-description {
    font-size: 16px;
    margin-top: 10px;
    line-height: 1.5;
    width: calc(100% - 20px);
}

/* 超级链接幽灵按钮 */
.ghost-button {
    display: inline-block;
    background-color: transparent;
    color: white;
    border: 1px solid white;
    padding: 8px 12px;
    margin: 25px 0 5px;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
}

.ghost-button:hover {
    color: #fff12f;
    border: 1px solid #fff12f;
    background-color: rgba(0, 0, 0, 0.5);
}
/*腾讯公益公式*/
.gongyi {
    font-size: 14px;
    padding-bottom: 20px;
}
.gongyi a{
    color: #fff;
}
/*公告区*/
    .gonggao{
        font-size: 14px;
        margin:20px 0 15px;
        text-align: center;
    }
    .gonggao a{
        color: #fff;
    }
    .gonggao .fast_key{
        background-color: #ffffff33;
        border-radius: 4px;
        padding: 1px 3px;
        margin: 0 2px;
    }
/* 品牌介绍区容器样式 */
    .brand_show {
        width: 1206px;
        display: flex;
        justify-content: space-between;
        margin: 0 auto 15px;
        gap: 5px;
        -ms-grid-gap:10px;
    }

    /* 链接容器样式 - 关键：通过padding-top实现16:9比例 */
    .brand_show a {
        flex: 1;
        position: relative;
        text-decoration: none;
        color: white;
        border-radius: 5px;
        overflow: hidden;
        border: 1px solid #000;
        transition: all 0.3s ease;
        /* 严格16:9比例（宽度16，高度9） */
        aspect-ratio: 16/9; /* 现代浏览器支持的比例属性 */
        box-sizing: border-box;
        margin-right: 5px;
    }
    .brand_show a:last-child{
        margin-right: 0px;
    }

    /* 为不支持aspect-ratio的旧浏览器提供备选方案 */
    @supports not (aspect-ratio: 16/9) {
        .brand_show a {
            /* 备选方案：通过padding-bottom实现 */
            padding-bottom: 13.25%; /* 9/16 = 56.25% */
            height: 0;
        }
        
        .brand_show img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
    }

    /* 图片样式 */
    .brand_show img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        opacity: 1;
        border-radius: 5px;
    }

    /* 文字标签样式 */
    .brand_show span {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px 10px;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
        font-size: 14px;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        z-index: 1; /* 确保文字在图片上方 */
    }

    /* 悬停效果 */
    .brand_show a:hover {
        transform: translateY(-3px);
        border-color: #fff12f;
        box-shadow: 0 4px 8px rgba(255, 241, 47, 0.2);
    }

    /* 响应式适配 */
    @media (max-width: 1206px) {
        .brand_show {
            width: 94%;
            gap: 1px;
        }
    }

    @media (max-width: 768px) {
        .brand_show {
            overflow: auto;
            width: 100%;
            padding: 0px 10px 0;
            gap: 5px;
        }
        .brand_show a {
            aspect-ratio: 16/9; /* 保持16:9比例 */
            overflow: unset;
            height: 100px;
        }
        .brand_show span {
            font-size: 12px;
            padding: 6px 8px;
        }
        .brand_show a:hover {
            transform: translateY(0px);
            box-shadow: none;
            }
    }

/*专题show-start*/
    /* 链接容器样式 - 关键：通过padding-top实现3:4比例 */
    .zhuanti_show a {
        /* 当专题字体很多的时候启用下一条overflow*/
        /*overflow: unset;*/

        /* 严格3:4比例（宽度3，高度4） */
        aspect-ratio: 3/4; /* 现代浏览器支持的比例属性 */
    }

    /* 为不支持aspect-ratio的旧浏览器提供备选方案 */
    @supports not (aspect-ratio: 3/4) {
        .zhuanti_show a {
            /* 备选方案：通过padding-bottom实现 */
            padding-bottom: 33%;
            height: 0;
        }
    }
    /* 响应式适配 */
    @media (max-width: 768px) {
        .zhuanti_show a {
            aspect-ratio: 3/4; /* 保持3:4比例 */
            overflow: unset;
            height: 200px;
        }
    }

/* 中部筛选组件 */
    .filter-container {
        overflow-x: auto;
        white-space: nowrap;
        background-color: #444;
        padding: 10px;
        position: sticky;
        top: 0;
        z-index: 1;
        width: 1206px;
        display: flex;
        justify-content: left;
        align-items: center;
    }

    .filter-button {
        display: inline-block;
        background-color: #555;
        color: white;
        border: none;
        padding: 10px 20px;
        margin: 0 5px;
        cursor: pointer;
        border-radius: 5px;
        font-size: 14px;
    }
    .filter-button:hover {
        color: #fff12f;
    }

    /*筛选框提示信息*/
    .filter-tips{
        font-size: 14px;
        /*padding: 8px 10px;*/
        margin: 0 5px 0 auto;
    }

    /* 选中状态的样式 */
    .filter-button.selected {
        background-color: #fff12f;
        color: black;
    }

    /* 搜索框样式 */
    #filter-search{
        display: flex;
        align-items: center;
    }
    #search-input {
        padding: 10px;
        border: none;
        border-radius: 5px;
        font-size: 14px;
        margin: 0 0px 0 5px;
        width: 200px;
        background-color: #555;
        color: white;
    }

    #search-input::placeholder {
        color: #aaa;
    }

    #search-button {
        display: inline-block;
        width: 70px;
        /*background-color: #555;*/
        background-color: #3294ff;
        color: white;
        border: none;
        padding: 10px 20px;
        margin: 0 0 0 -71px;
        cursor: pointer;
        border-radius: 5px;
        font-size: 14px;
    }

    #search-button:hover {
        background-color: #2985ea;
    }

    /* 搜索字体抖动动画 */
    .shake {
        animation: shake 0.5s;
        animation-iteration-count: 2;
    }

    @keyframes shake {
        0% { transform: translate(1px, 1px) rotate(0deg); }
        10% { transform: translate(-1px, -2px) rotate(-1deg); }
        20% { transform: translate(-3px, 0px) rotate(1deg); }
        30% { transform: translate(3px, 2px) rotate(0deg); }
        40% { transform: translate(1px, -1px) rotate(1deg); }
        50% { transform: translate(-1px, 2px) rotate(-1deg); }
        60% { transform: translate(-3px, 1px) rotate(0deg); }
        70% { transform: translate(3px, 1px) rotate(-1deg); }
        80% { transform: translate(-1px, -1px) rotate(1deg); }
        90% { transform: translate(1px, 2px) rotate(0deg); }
        100% { transform: translate(1px, -2px) rotate(-1deg); }
    }

    @media (max-width: 768px) {
        #filter-search {
            order: -1;
            height: 38px;
        }
    }

/* 中部字体列表组件 */
    .font-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 0px;
        width: 1206px;
    }

    .jd-item,.font-item {
        width: calc(50% - 6px);
        margin: 16px 0px 0px 0;
        background-color: #444;
        aspect-ratio: 96 / 15;
        min-height: 60px;
        max-height: 90px;
        position: relative;
        color: #fff;
        text-decoration: none;
        cursor: pointer;
        background-size: cover;
        background-position: center;
        border: solid 1px #6a6a6a;
        background-size: 100%;
        transition: all 0.2s ease;
    }
    @media (min-width: 1206px) {
        .jd-item,.font-item {
            height: 93px;
        }
    }
    .jd-item:hover, .font-item:hover{
        border: solid 1px #fff12f;
        /*background-size: 104%;*/
        background-position: -3px ;
        box-shadow: 0px 0px 15px 1px #fff12f  inset;
    }

    .font-name {
        position: absolute;
        bottom: 10px;
        left: 10px;
        background-color: rgba(0, 0, 0, 0.7);
        padding: 5px 10px;
        border-radius: 5px;
        font-size: 14px;
    }
    .font-seoname{
        font-size: 10px;
    }

    /* 字体风格标题 */
    .font-style-title {
        width: 100%;
        text-align: center;
        font-size: 24px;
        margin:0px;
        padding-top: 60px;
        position: relative;
    }
    .font-style-title:before{
        content: "ZITI.XXRIJI.CN";
        position: absolute;
        width: auto;
        color: #656565;
        height: auto; 
        letter-spacing: 4px;
        text-align: center;
        font-weight: 100;
        font-size: 12px;
        top: 30px;
        transform: translate(-50%);
        left: 50%;
        border-bottom: 2px solid #4a4a4a;
    }

/* 底部捐赠按钮组件 */
    .donate-button {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #FF5722;
        color: white;
        border: none;
        padding: 15px 20px;
        cursor: pointer;
        border-radius: 5px;
        z-index: 2;
        font-size: 16px;
        text-align: center;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .time-icon{
        display: inline-block;
        width: 28px;
        height: 20px;
        background-image: url(../imgs/time.png);
        background-repeat: no-repeat;
        background-size: auto 100%;
        text-indent: 35px;
    }
    .donate-button:hover{
        background-color: #cc0f0f;
    }

/*鸣谢-友情链接*/
    .friend-container {
        width: 1206px;
        margin: 0px auto;
    }
    .friend-container p{
        text-align: center;
        font-size: 14px;
        line-height: 14px;
        margin: 5px 0 20px 0;
        color: #aaa;
    }
    .friend_logo_wrap{
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .friend_logo {
        background-color: #fff;
        width: 9.9%;
        height: 60px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        margin:5px 0;
        filter: grayscale(100%);
/*        transition: all 0.3s sease;*/
        opacity: 0.7;
    }
    .friend_logo:hover{
        filter: grayscale(0);
        box-shadow: 0px 0px 15px 1px #fff12f  inset;
        opacity: 1;
    }
    .friend_logo a{
        display: block;
        height: 100%;
        width: 100%;
    }


/* 网页最底部信息 */
    .footer_top{
        background-color: #222;
        margin-top: 50px;
        width: 100%;
    }
    .footer {
        background-color: #222;
        width: 1206px;
        margin: 20px auto 0px auto;
        display: flex;
        flex-wrap: wrap;
        color: #888;
        justify-content: space-between;
    }

    .footer .website-intro {
        text-align: justify;
        width: 35%;
    }

    .footer .latest-fonts {
        text-align: left;
    }

    .footer .font-count {
        text-align: left;
    }

    .footer .wechat-qrcode {
        text-align: left;
        width: 30%;
    }

    .footer .copyright {
        font-size: 12px;
        background-color: #000;
        width: 100%;
        margin: 20px 0 25px;
        padding: 5px 10px;
    }
    .copyright p{
        margin: 5px 0;
    }
    .footer h3 {
        margin: 0 0px 20px;
        padding: 0;
        font-size: 18px;
    }
    .footer #font-count{
        display: block;
        font-size: 50px;
        height: 50px;
        line-height: 50px;
        font-weight: bold;
        position: relative;
    }
    .footer #font-count:before{
        content: "款";
        font-size: 12px;
        position: absolute;
        left: 90px;
        bottom: 0;
        line-height: 22px;
    }

    .footer img {
        width: 1080px;
        height: 394px;
        max-width: 100%;
        height: auto;
    }
    .footer ul{
        margin: 0;
        padding: 0;
        color: #888;
    }
    .footer li{
        list-style: none;
        text-indent: 0;
        margin: 0;
        font-size: 14px;
    }
    .footer a{
        text-decoration: none;
        color: #888;
    }
    .footer a:hover{
        text-decoration: underline;
    }
    .footer .info{
        font-size: 12px;
    }
    .footer .tips{
        text-align: right;
    }

/* 新增到顶部和到底部组件样式 */
    .scroll-buttons {
        position: fixed;
        bottom: 90px;
        right: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        background-color: #444;
        padding: 8px;
        z-index: 2;
        border: 1px solid #000;
    }

    .scroll-button,.audio-btn {
        background-color: #555;
        color: white;
        border: none;
        cursor: pointer;
        border-radius: 4px;
        font-size: 14px;
        width: 30px;
        height: 30px;
        text-align: center;
        font-family: "PingFang SC",Arial,Microsoft YaHei,Helvetica;
        padding: 0;
        margin: 0;
        text-indent: 0;
    }
    .scroll-button:hover,.audio-btn:hover{
        background-color: #fff12f;
        color: black;
    }

/*音频控制按钮*/
    .audio-btns{
        position: fixed; top: 15px; right: 20px; 
        z-index: 2;
    }
    .audio-btn{
        display: block;font-size:16px;width: 38px;height: auto; text-decoration:none;padding: 2px 5px 5px 5px;
        margin: 0 0 4px 0;
        border: 1px solid #000;
    }
    .audio-btn span{
        display: block;
        margin: o auto;
        font-size: 12px;
    }
    .btn-disabled{
        opacity: 0.6;
        cursor: not-allowed;
    }
/*全局*/
.hidden{
    display:none;
}


/* 全设备响应式设计优化 */
    @media (max-width: 1206px) {
        .filter-container,
        .font-list,
        .footer,
        .friend-container{
            width: 94%;
        }
    }
    /*ipad pro*/
    @media (max-width: 1024px) {
        .font-name{
            font-size: 14px;
            bottom: 6px;
            padding: 2px 5px;
        }
    }

    @media (max-width: 768px) {
        .mini_hidden{
            display: none;
        }
        .header-box{
            margin-bottom: 0;
        }
        .jd-item,.font-item {
            width: 100%;
            margin: 6px auto;
        }
        .header-box{
            height: 230px;
        }
        .logo{
            font-size: 20px;
        }
        .logo img{
            width: 24px;
            height: 24px;
        }
        .site-description{
            font-size: 14px;
            width: 94%;
        }
        .ghost-button{
            font-size: 12px;
            margin: 20px 0 5px ;
            padding: 6px 10px;
            /*display: none;*/
        }
        .gongyi a{
            font-size: 12px;
        }
        .gonggao{
            margin: 15px 0;
            font-size: 12px;
            width: 94%;
        }
        /*筛选组件*/
        .filter-container{
            width: 100%;
        }
        #search-input{
            font-size: 12px;
            margin: 0;
            border: 1px solid #fff12f;
            height: 100%;
        }
        #search-button{
            font-size: 12px;
            background-color: #858585;
            height: calc(100% - 2px);
        }
        #search-button:hover{
            background-color: #858585;
        }
        .filter-button{
            font-size: 12px;
        }

        .font-style-title{
            font-size: 18px;
        }
        .font-style-title:before{
            margin-top: 8px;
            font-size: 10px;
        }
        .font-name{
            font-size: 12px;
            bottom: 5px;
            padding: 2px 5px;
        }
        .donate-button{
            padding: 10px 20px;
            font-size: 14px;
            width: 94%;
            bottom: 15px;
        }

        .donate-btn-wrap{
            position: fixed;
            bottom: 0;
            padding: 10px 10px 15px 10px;
            background-color: #444;
            width: 100%;
            height: 63px;
            border: 10px solid #444;
            border-bottom: 15px solid #444;
            border-radius: 0;
        }
        /* 鸣谢*/
        .friend_logo_wrap{
            width:100%;
        }
        .friend_logo{
            width: 24.4%;
            height: 50px;
        }
        /*版权部分*/
        .footer .website-intro{
            width: 100%;
            margin-bottom: 20px;
        }
        .footer .latest-fonts{
            width: 50%;
            margin-bottom: 20px;
        }
        .footer .font-count{
            width: 40%;
            margin-bottom: 20px;
        }
        .footer .wechat-qrcode{
            width: 100%;
            margin-top: 12px;
        }

        .footer .copyright {
            width: 100%;
            margin-bottom: 80px;
            font-size: 10px;
        }
        .footer li{
            font-size: 12px;
        }
        .footer .tips{
            text-align: left;
        }
        .footer h3{
            font-size: 20px;
            margin-bottom: 10px;
        }
        .scroll-button:hover{
            background-color: #555;
            color: white;
        }
        /*音乐控制案例*/
        .audio-btns{
            position: fixed; top: 130px; right: 20px; 
        }
    }
