/* 全局变量 */
:root {
    --primary-color: #1e90ff;
    --secondary-color: #ff3e00;
    --text-color: #333;
    /* --bg-color: #fff;
    --light-bg: #f5f5f5; */
    /* --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.2); */
    --border-radius-sm: 15px;
    --border-radius-md: 20px;
    --border-radius-lg: 30px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease-in-out;
    --max-width: 750px;
    --link-item-width: 70%;
    /* 控制链接项的宽度，改为70%使其更短 */
    --container-padding: 15px 20px 15px 15px;
    /* 右侧多一点padding，为按钮留出空间 */
    --link-gap: 10px;
    /* 链接项与按钮之间的间距 */
    --button-width: 70px;
    /* 按钮的固定宽度 */
    --overlay-max-width: 700px;
    /* 确保不超过图片宽度750px */
    --overlay-max-height: 500px;
    /* 确保不超过图片高度529px */
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--light-bg);
    padding-bottom: 60px;
    /* 为底部固定banner预留空间 */
    color: var(--text-color);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    overflow: hidden;
    background-color: var(--bg-color);
}

.content-area {
    padding: 0;
    /* 不再需要为底部服务链接预留空间 */
}

/* 固定在底部的banner */
.fixed-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* 确保显示在最上层 */
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* 图片响应式处理 */
.image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.responsive-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.responsive-img.loaded {
    opacity: 1;
}

/* 定义放大缩小动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* 定义立即访问按钮的缩放动画 */
@keyframes visitButtonPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* 飘窗客服样式 */
.floating-service {
    position: fixed;
    right: 15px;
    bottom: 50%;
    transform: translateY(50%);
    z-index: 1001;
    /* 确保显示在banner上方 */
    cursor: pointer;
    transition: all var(--transition-normal);
}

/* .floating-service:hover {
    transform: translateY(50%) scale(1.05);
} */

.floating-service a {
    display: block;
    text-decoration: none;
}

.service-icon {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    animation: pulse 2s infinite ease-in-out;
}

/* 媒体查询 - 适配不同手机尺寸 */
/* iPhone SE, 5, 5S (320px) */
@media only screen and (max-width: 320px) {
    body {
        padding-bottom: 50px;
    }

    .service-icon {
        width: 50px;
    }

    .floating-service {
        right: 10px;
    }

    .overlay-links {
        width: 90%;
        padding: 10px;
    }

    .overlay-links .link-item {
        height: 30px;
    }

    .overlay-links .speed-badge {
        min-width: 40px;
        font-size: 12px;
    }

    .overlay-links .url {
        font-size: 12px;
    }

    .overlay-links .visit-button {
        font-size: 11px;
        padding: 3px 6px;
        width: 60px;
    }
}

/* iPhone 6, 7, 8 (375px) */
@media only screen and (min-width: 321px) and (max-width: 375px) {
    /* 已经适配良好 */
}

/* iPhone X, XS, 11 Pro, 12 mini (375px but taller) */
@media only screen and (min-width: 321px) and (max-width: 375px) and (min-height: 812px) {
    body {
        padding-bottom: 65px;
    }
}

/* iPhone 6+, 7+, 8+ (414px) */
@media only screen and (min-width: 376px) and (max-width: 414px) {
    /* 已经适配良好 */
}

/* iPhone XR, XS Max, 11, 11 Pro Max (414px but taller) */
@media only screen and (min-width: 376px) and (max-width: 414px) and (min-height: 896px) {
    body {
        padding-bottom: 70px;
    }
}

/* 更大尺寸手机和小平板 */
@media only screen and (min-width: 640px) {
    .container {
        max-width: 450px;
        position: relative;
    }

    .service-icon {
        width: 70px;
    }

    body {
        padding-bottom: 80px;
    }

    .fixed-banner {
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 450px;
        z-index: 1000;
    }

    .floating-service {
        position: fixed;
        right: 50%;
        bottom: 50%;
        transform: translate(300%, 50%);
        z-index: 1001;
        cursor: pointer;
        transition: all var(--transition-normal);
    }
}

/* 图片带链接叠加样式 */
.image-with-overlay {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-links {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: var(--overlay-max-width);
    max-height: var(--overlay-max-height);
    overflow-y: auto;
    /* 内容超出时显示滚动条 */
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

/* 修改容器内部的对齐方式 */
.overlay-links .link-container {
    padding-left: 0;
}

/* 链接列表修改 - 新的包装器样式 */
.link-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    /* 减小间距，确保内容紧凑 */
    position: relative;
    width: 100%;
    justify-content: space-between;
    /* 将内容推向两端 */
}

.overlay-links .link-item {
    height: 35px;
    /* 减小高度 */
    border-radius: var(--border-radius-md);
    border: 1px solid var(--primary-color);
    width: var(--link-item-width);
    margin-left: 0;
    margin-right: var(--link-gap);
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0;
}

.overlay-links .speed-badge {
    min-width: 45px;
    /* 减小宽度 */
    font-size: 13px;
    /* 减小字体 */
}

.overlay-links .url {
    font-size: 13px;
    /* 减小字体 */
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    text-align: center;
    /* 文本居中对齐 */
    display: flex;
    /* 使用弹性布局 */
    align-items: center;
    /* 垂直居中 */
    justify-content: center;
    /* 水平居中 */
}

.overlay-links .visit-button {
    padding: 4px 8px;
    /* 减小内边距 */
    font-size: 12px;
    border-radius: var(--border-radius-md);
    white-space: nowrap;
    align-self: center;
    width: var(--button-width);
    text-align: center;
    flex-shrink: 0;
    margin-left: auto;
    /* 推到最右侧 */
    transition: transform var(--transition-fast);
    animation: visitButtonPulse 2s infinite ease-in-out;
    text-decoration: none;
    /* 确保链接没有下划线 */
    color: white;
    /* 保持文字颜色为白色 */
}

.overlay-links .visit-button:hover {
    transform: scale(1.05);
    animation: none;
    /* 悬停时停止动画 */
}

.overlay-links .visit-button:active {
    transform: scale(0.95);
}

/* 链接列表样式 */
.link-container {
    width: 100%;
    max-width: 720px;
    margin: auto;
    padding: 10px 15px;
    background-color: var(--bg-color);
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 两端对齐 */
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 50px;
    border: 1px solid var(--primary-color);
}

.speed-badge {
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.url {
    flex-grow: 1;
    /* 允许URL占据剩余空间 */
    padding: 0 20px;
    font-size: 16px;
    color: var(--text-color);
    text-align: left;
    /* 文本左对齐 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visit-button {
    background: linear-gradient(to bottom, #ff6a3d, var(--secondary-color));
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    margin-right: 15px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(255, 62, 0, 0.3);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 14px;
    white-space: nowrap;
    align-self: center;
}

/* 下载按钮样式 */
.download-btn {
    cursor: pointer;
}

.download-btn:hover {
    /* transform: scale(1.02); */
}

.download-btn:active {
    /* transform: scale(0.98); */
}