/* 激活码网格容器 */
.activation-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
    /* 优化性能，减少重排 */
    contain: layout;
}

/* 大屏幕：1366px及以上显示4列 */
@media (min-width: 1366px) {
    .activation-code-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 中等屏幕：小于1366px显示3列 */
@media (min-width: 992px) and (max-width: 1365px) {
    .activation-code-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 平板：2列 */
@media (min-width: 768px) and (max-width: 991px) {
    .activation-code-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机：2列 */
@media (max-width: 767px) {
    .activation-code-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* 激活码卡片 */
.activation-code-card {
    background: #f3f4f5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* 预留边框空间，避免hover时尺寸变化 */
    border: 2px solid transparent;
    /* 优化性能，减少重排 */
    will-change: transform, box-shadow;
    /* 使用GPU加速 */
    transform: translateZ(0);
}

.activation-code-card:hover {
    background: #e8eaed;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
    transform: translateY(-2px) translateZ(0);
}

/* 软件图标 */
.activation-code-card .icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
}

.activation-code-card .icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 软件名称 */
.activation-code-card .title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* 激活码内容区域 */
.activation-code-card .code-content {
    font-size: 13px;
    color: #666;
    word-break: break-all;
    line-height: 1.6;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    flex: 1;
    position: relative;
}

/* 遮罩状态 */
.activation-code-card .code-masked {
    color: #999;
    letter-spacing: 2px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* 使用visibility而不是display，避免布局重排 */
    visibility: visible;
}

/* 鼠标悬浮时隐藏遮罩 */
.activation-code-card:hover .code-masked {
    opacity: 0;
    visibility: hidden;
    /* 保持display属性不变，避免布局变化 */
}

/* 复制按钮 */
.activation-code-card .copy-button {
    /* 使用opacity和visibility代替display，避免布局重排 */
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #6c757d;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
    white-space: nowrap;
    /* 优化性能 */
    will-change: transform, opacity;
}

.activation-code-card .copy-button:hover {
    background: #5a6268;
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.activation-code-card .copy-button:active {
    transform: translate(-50%, -50%) scale(0.98);
}

/* 复制成功状态 */
.activation-code-card .copy-button.copy-success {
    background: #4CAF50;
}

.activation-code-card .copy-button.copy-success:hover {
    background: #45a049;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* 鼠标悬浮时显示复制按钮 */
.activation-code-card:hover .copy-button {
    opacity: 1;
    visibility: visible;
}

/* 提示文字 */
.activation-code-card .hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    font-size: 12px;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s;
}

.activation-code-card:hover .hint {
    opacity: 1;
}

/* 开头说明 */
.activation-description {
    font-size: 18px;
    line-height: 1.8;
}

.activation-description p {
    margin: 0;
}

.activation-description a {
    color: #1677ff;
    text-decoration: none;
    transition: color 0.2s;
}

.activation-description a:hover {
    color: #0958d9;
    text-decoration: underline;
}

/* 复制提示动画 */
@keyframes copySuccess {
    0% {
        background: #f3f4f5;
    }
    50% {
        background: #d4edda;
    }
    100% {
        background: #f3f4f5;
    }
}

.activation-code-card.copy-success {
    animation: copySuccess 0.6s ease;
}

/* 复制Toast提示 */
.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.copy-toast.show {
    opacity: 1;
}

