/* ============================================
   通用组件样式
   可复用的 UI 组件
   ============================================ */

/* ========== 欢迎访问框 ========== */
.welcome-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    background: var(--color-bg-overlay);
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow var(--transition-base) ease;
    width: auto;
}

/* 平板和桌面端适配 - 绝对定位居中 */
@media (min-width: 768px) {
    .welcome-box {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: 0.625rem;
        margin-bottom: 1.875rem;
        z-index: 20;
        padding: 0.625rem 3.125rem;
    }
    
    /* 窗口较窄时，调整位置避免重叠 */
    @media (max-width: 1200px) {
        .welcome-box {
            left: calc(50% - 13rem);
        }
    }
}

.welcome-box:hover {
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.welcome-text {
    font-size: clamp(0.875rem, 3vw, 1.25rem);
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: 1px;
    white-space: normal;
    text-transform: uppercase;
}

.welcome-text .underlined-text {
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 2px;
}

.welcome-box:hover .welcome-text {
    color: var(--color-primary);
}

/* ========== 网站链接按钮 ========== */
.website-link {
    padding: 2px 8px;
    background: var(--color-secondary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: clamp(0.875rem, 3vw, 1.25rem);
    font-weight: bold;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background var(--transition-base) ease;
}

.welcome-box:hover .website-link {
    background: var(--color-primary);
}

/* 水波效果 */
.website-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.website-link:hover::before {
    animation: ripple 0.5s ease-out;
}

@keyframes ripple {
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* ========== 下载区域 ========== */
.download-section {
    width: 100%;
    position: relative;
    z-index: 10;
}

.download-section > div {
    width: 100%;
    padding: 0 var(--spacing-md);
    background-color: var(--color-primary);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.download-section div h3 {
    width: 100%;
    height: 3.125rem;
    line-height: 3.125rem;
    color: var(--color-white);
    font-size: clamp(1.125rem, 4vw, 1.5rem);
    font-weight: 500;
}

.download-section div .download-item {
    position: relative;
    flex: 0 0 50%;
    margin: 2px 0 0 0;
    text-align: center;
    box-sizing: border-box;
}

.download-mask {
    display: none;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(7.5rem * 801 / 1090); /* 801是图片宽度，1090是图片高度 */
    height: 3.75rem;
    line-height: 3.75rem;
    background-color: rgba(0, 0, 0, 0.4);
    color: var(--color-white);
    text-decoration: none;
    font-size: 0.75rem;
    text-align: center;
    pointer-events: auto;
    box-sizing: border-box;
}

.download-mask:last-of-type {
    top: 3.8125rem;
}

.download-section div:hover .download-item .download-mask {
    display: block;
}

.download-section div .download-item img {
    margin: 0;
    height: 7.5rem;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: top;
}

.download-section div .download-item span {
    display: block;
    text-align: center;
    font-size: 0.6875rem;
    color: var(--color-white);
    padding: 0.3125rem;
}

.download-section hr {
    width: 100%;
    border: none;
    border-top: 1px solid var(--color-white);
    flex: 0 0 100%;
}

/* 平板和桌面端适配 - 绝对定位靠右 */
@media (min-width: 768px) {
    .download-section {
        position: absolute;
        right: 0.625rem;
        bottom: 0.625rem;
        width: auto;
    }

    .download-section > div {
        width: 25rem;
        padding: 0 var(--spacing-md);
    }

    .download-section div h3 {
        height: 3.75rem;
        line-height: 3.75rem;
    }

    .download-section div .download-item img {
        height: 8.75rem;
    }

    .download-mask {
        width: calc(8.75rem * 801 / 1090); /* 801是图片宽度，1090是图片高度 */
        height: 4.375rem;
        line-height: 4.375rem;
    }

    .download-mask:last-of-type {
        top: 4.4375rem;
    }
}

/* 桌面端适配 */
@media (min-width: 992px) {
    .download-section div h3 {
        height: 4rem;
        line-height: 4rem;
    }

    .download-section div .download-item img {
        height: 9.375rem;
    }

    .download-mask {
        width: calc(9.375rem * 801 / 1090); /* 801是图片宽度，1090是图片高度 */
        height: 4.6875rem;
        line-height: 4.6875rem;
    }

    .download-mask:last-of-type {
        top: 4.75rem;
    }
}

/* ========== 证书滚动组件 ========== */
.certificate-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--spacing-md) 0;
}

.certificate-scroll ul {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md);
    min-width: min-content;
}

.certificate-scroll ul li {
    flex-shrink: 0;
}

.certificate-scroll ul li img {
    height: clamp(150px, 30vw, 424px);
    width: auto;
    object-fit: cover;
}

