/* Mac风格桌面CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-image: url('../bg/macos_12_monterey_blue_modd_official_stock_wallpaper_6k_resolution_light-3840x2160.jpg');
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease;
}

.desktop-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 桌面图标网格 */
.desktop {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-rows: 120px;
    gap: 20px;
    padding: 20px 150px;
    overflow: auto;
}

/* 应用图标样式 */
.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
}

.app-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.app-icon img {
    width: 76.5px;
    height: 76.5x;
    object-fit: contain;
    /* border-radius由JavaScript根据data-appicon.js中的borderRadius值动态设置 */
    /* border-radius: var(--icon-border-radius, 14.375px); */
    /* border-radius: 14.375px; */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.2s ease;
}

.app-icon:hover img {
    transform: translateY(-5px);
}

.app-icon .app-name {
    margin-top: 2.5px;
    font-size: 12px;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 窗口样式 */
.window-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    animation: window-appear 0.3s ease forwards;
}

@keyframes window-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.window {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
}

.window-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    border-bottom: 1px solid #d0d0d0;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close {
    background-color: #ff5f57;
}

.minimize {
    background-color: #ffbd2e;
}

.maximize {
    background-color: #28c940;
}

.window-title {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.window-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.app-details {
    display: flex;
    gap: 20px;
}

.app-icon-large {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
}

.app-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.app-info {
    flex: 1;
}

.app-info h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.app-info p {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 15px;
}

.app-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.platform-badge {
    padding: 4px 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
}

.platform-badge img {
    width: 16px;
    height: 16px;
}

.app-link {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(to bottom, #0d6efd, #0b5ed7);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.app-link:hover {
    background: linear-gradient(to bottom, #0b5ed7, #0a58ca);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Dock栏样式 */
.dock-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0 20px;
    position: relative;
    z-index: 100;
}

.dock {
    display: flex;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dock-icon {
    width: 48px;
    height: 48px;
    margin: 0 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.dock-icon:hover {
    transform: translateY(-10px) scale(1.1);
}

.dock-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dock-icon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dock-icon.active::after {
    opacity: 1;
}

/* 背景切换按钮 */
.background-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.background-switcher button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.background-switcher button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .desktop {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        grid-auto-rows: 90px;
        gap: 5px;
        padding: 10px 15px;
    }
    
    .app-icon img {
        width: 42px;
        height: 42px;
        /* border-radius: 9.433px;  */
        /* border-radius: var(--icon-border-radius, 9.433px); */
        /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); */
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    }
    
    .window-container {
        width: 95%;
        max-width: none;
    }
    
    .app-details {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .dock-container {
        overflow-x: auto;
        padding: 10px 5px 20px;
        justify-content: center;
    }
    
    .dock {
        min-width: min-content;
        padding: 8px 12px;
    }
    
    .dock-icon {
        width: 36px;
        height: 36px;
        margin: 0 3px;
        flex-shrink: 0;
    }
}
