/* 全局样式 */
body {
    font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
        "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    background-image: url('https://cdn.xpdbk.com/gh/1x000/zdzy/tp/123.jpg');
    /* 您的背景图片地址 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.window {
    margin-bottom: 20px;
    transition: background-color 0.5s ease, color 0.5s ease;
    animation: fadeIn 1s ease;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    overflow: hidden;
}

.window.active {
    background-color: rgba(255, 255, 255, 0.8);
    /* 白色半透明背景 */
    backdrop-filter: blur(5px);
    /* 背景模糊 */
    transition: background-color 0.5s ease;
}

.window.active .title-bar {
    background-color: #0078d7;
    transition: background-color 0.5s ease;
}

/* 标题栏 */
.title-bar {
    background-color: #fff;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-bar-text {
    font-size: 2rem;
    /* 调整标题大小 */
    font-weight: bold;
    color: #fff;
    /* 设置标题栏文字颜色为白色 */
}

.title-bar ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.title-bar li {
    margin-left: 20px;
}

.title-bar a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, opacity 0.3s ease;
    /* 添加 opacity 过渡 */
}

.title-bar a:hover {
    color: #0078d7;
    opacity: 0.5;
    /* 鼠标悬停时半透明 */
}

/* 内容区域 */
.window-body {
    padding: 20px;
}

.window-body h2 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #0078d7;
}

.window-body p {
    font-size: 1rem;
    margin-bottom: 15px;
}

/* API 网格布局 */
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* 自动适应列数 */
    grid-gap: 20px;
    /* 设置网格间距 */
}

.api-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.api-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: index-link-active 0.5s ease-in-out; /* 鼠标悬停时播放动画 */
    animation-fill-mode: forwards; /* 动画结束后保持最终状态 */
}

.api-card:not(:hover) { /* 鼠标离开时恢复初始状态 */
    animation: index-link-active-reverse 0.5s ease-in-out; 
    animation-fill-mode: forwards; /* 动画结束后保持最终状态 */
}

.api-card h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #0078d7;
}

.api-card p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.api-card a {
    color: #0078d7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 8px 16px;
    border-radius: 4px;
    background-color: #f0f0f0;
    display: inline-block;
}

.api-card a:hover {
    color: #fff;
    background-color: #0078d7;
}

/* 版权信息 */
.copyright-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
    animation: fadeInUp 1s ease;
}

.copyright-info .col-md-6 {
    text-align: center;
    display: flex;
    /* 使用 flex 布局 */
    align-items: center;
    /* 垂直居中 */
}

.copyright-info p {
    margin: 0;
}

.copyright-info a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright-info a:hover {
    color: #0078d7;
}

.copyright-info button {
    background-color: #0078d7;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.5s ease;
    border-radius: 4px;
    margin-right: 20px;
    /* 调整按钮和进度条之间的间距 */
}

.copyright-info .progress {
    /* 调整进度条宽度 */
    width: 200px;
    /* 根据您的需求调整宽度 */
}

.copyright-info .progress-bar {
    width: 100%;
    margin-top: 10px;
    background-color: #0078d7;
}

/* index-link-active 动画 */
@keyframes index-link-active {
    0% {
        transform: perspective(1600px) rotateX(0deg) rotateY(0deg) translateZ(0px);
    }
    16% {
        transform: perspective(1600px) rotateX(10deg) rotateY(5deg) translateZ(32px);
    }
    to {
        transform: perspective(1600px) rotateX(0deg) rotateY(0deg) translateZ(65px);
    }
}

/* index-link-active 的反向动画 */
@keyframes index-link-active-reverse {
    from {
        transform: perspective(1600px) rotateX(0deg) rotateY(0deg) translateZ(65px);
    }
    84% {
        transform: perspective(1600px) rotateX(10deg) rotateY(5deg) translateZ(32px);
    }
    to {
        transform: perspective(1600px) rotateX(0deg) rotateY(0deg) translateZ(0px);
    }
}

.nav-item a {
    color: #fff;
    font-weight: 600;
}

.nav-item a:hover {
    color: #0078d7;
    opacity: 0.5;
    /* 鼠标悬停时半透明 */
}

/* 媒体查询：针对手机屏幕尺寸进行调整 */
@media (max-width: 768px) {

    /* 调整 API 卡片布局，每行显示两个 */
    .api-card {
        flex: 0 0 calc(50% - 20px);
    }

    /* 调整版权信息布局，垂直排列 */
    .copyright-info {
        flex-direction: column;
        align-items: flex-start;
    }

    /* 调整版权信息列宽度 */
    .copyright-info .col-md-6 {
        width: 100%;
        text-align: center;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
