* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* 如果有背景图片，使用下面的配置 */
    background-image: url('assets/images/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    /* 背景图片叠加渐变遮罩 */
    background-blend-mode: overlay;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.title {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: clamp(24px, 5vw, 36px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.clear-cache-btn {
    display: block;
    margin: 0 auto 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.clear-cache-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.clear-cache-btn:active {
    transform: scale(0.95);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.grid-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.grid-item:active {
    transform: scale(0.95);
}

.grid-item.loading {
    pointer-events: none; /* 禁止点击 */
    opacity: 0.6;
    position: relative;
}

.grid-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.icon {
    width: 60%;
    max-width: 80px;
    height: 60%;
    max-height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: white;
}

.icon svg {
    width: 50%;
    height: 50%;
}

/* 自定义图标样式 */
.icon-img {
    width: 100%;
    max-width: 120px;
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.grid-item:hover .icon-img {
    transform: scale(1.1);
}

.label {
    font-size: clamp(12px, 3vw, 16px);
    font-weight: 600;
    color: #667eea;
    text-align: center;
    margin-top: 5px;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
}

.close-btn:hover,
.close-btn:focus {
    color: #667eea;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 90vw;
    max-height: 90vh;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
}

/* 平板适配 */
@media (max-width: 768px) {
    .grid-container {
        gap: 10px;
        padding: 5px;
    }

    .grid-item {
        padding: 15px;
        border-radius: 12px;
    }

    .title {
        margin-bottom: 20px;
    }
}

/* 手机适配 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .grid-container {
        gap: 8px;
    }

    .grid-item {
        padding: 10px;
        border-radius: 10px;
    }

    .icon {
        width: 50%;
        height: 50%;
        max-width: 50px;
        max-height: 50px;
    }

    .label {
        margin-top: 3px;
    }

    .modal-content {
        width: 95%;
    }

    .close-btn {
        top: -35px;
        font-size: 35px;
    }
}

/* 小屏手机适配 */
@media (max-width: 360px) {
    .grid-container {
        gap: 6px;
    }

    .grid-item {
        padding: 8px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .title {
        margin-bottom: 15px;
        font-size: 24px;
    }

    .grid-container {
        gap: 8px;
    }

    .modal-content {
        max-width: 70vh;
    }
}
