/* 基础样式 */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    background: #f0f0f0;
}

/* 桌面容器 */
.desktop {
    position: relative;
    width: 100%;
    height: 100vh;
    background-image: url('/assets/images/background.jpeg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* 应用图标网格 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;

    padding-left:20%;
    padding-right:20%;
    padding-top:80px;
    padding-bottom:30px;
    max-width: 100%;
    overflow-y: auto;
    margin-top: 80px;
}

/* 应用图标 */
.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    user-select: none;
}

.app-icon:hover {
    transform: scale(1.05);
}

.app-icon:active {
    transform: scale(0.95);
}

.app-icon-img {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4a90e2, #5637d9);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.app-icon-img i {
    font-size: 28px;
    color: white;
}

.app-icon-name {
    font-size: 13px;
    color: white;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Dock */
.dock {
    position: fixed !important;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    z-index: 9999 !important;
    opacity: 0;
}

.dock.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.dock-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dock-icons {
    display: flex;
    gap: 8px;
}

.dock-icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
}

.dock-icon-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dock-clear-btn .dock-icon-img {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
}

.dock-clear-btn:hover .dock-icon-img {
    background: linear-gradient(135deg, #ff5252 0%, #ff7043 100%);
}

.dock-icon:hover {
    transform: translateY(-8px) scale(1.2);
}

.dock-icon-indicator {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #4CAF50;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dock-icon.active .dock-icon-indicator {
    opacity: 1;
}

/* 视图切换按钮 */
.view-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.view-btn {
    border: none;
    background: transparent;
    padding: 10px 15px;
    cursor: pointer;
    color: white;
    font-size: 16px;
    transition: background 0.2s;
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.3);
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 文件夹视图 */
.folder-view {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: calc(100% - 150px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 40;
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.folder-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin: 0;
    flex: 1;
}

.folder-search {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 5px 10px;
    width: 200px;
}

.folder-search input {
    border: none;
    background: transparent;
    padding: 5px;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.folder-search i {
    color: #666;
    margin-right: 5px;
}

.folder-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.folder-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.folder-tool {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.folder-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a90e2, #5637d9);
    border-radius: 10px;
    margin-right: 10px;
    flex-shrink: 0;
}

.tool-icon i {
    font-size: 18px;
    color: white;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-desc {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 窗口样式 */
.window {
    position: absolute;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    min-width: 200px;
    min-height: 150px;
    /* 只对特定属性添加过渡，不包括transform和position */
    transition: box-shadow 0.2s ease, opacity 0.3s ease;
    z-index: 100;
}

.window.active {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.window-header {
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: 40px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    cursor: move;
    user-select: none;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.window-control:hover {
    transform: scale(1.1);
}

.window-close {
    background: #ff5f57;
}

.window-close:hover::after {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #fff;
    font-weight: bold;
}

.window-minimize {
    background: #ffbd2e;
}

.window-minimize:hover::after {
    content: '−';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #fff;
    font-weight: bold;
}

.window-maximize {
    background: #28ca42;
}

.window-maximize:hover::after {
    content: '□';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #fff;
    font-weight: bold;
}

.window-external {
    background: #007aff;
}

.window-external:hover::after {
    content: '↗';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #fff;
    font-weight: bold;
}

.window-title {
    flex: 1;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.window-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.window-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 50px) !important; /* 减去任务栏高度 */
    border-radius: 0 !important;
    z-index: 999999 !important;
    /* 最大化时添加过渡 */
    transition: all 0.3s ease;
}

/* 窗口打开/关闭动画 */
.window.opening, .window.closing {
    transition: all 0.3s ease !important;
}

/* 窗口最小化样式 */
.window.minimized {
    display: none !important;
}

/* 窗口拖拽时禁用所有过渡 */
.window.dragging {
    transition: none !important;
}

/* 窗口调整大小时禁用所有过渡 */
.window.resizing {
    transition: none !important;
}

/* 任务栏样式 */
.taskbar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 50;
    gap: 10px;
}

.taskbar-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    width: 180px;
}

.taskbar-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.taskbar-item.active {
    background: rgba(255, 255, 255, 0.3);
}

.taskbar-item.minimized {
    opacity: 0.7;
}

.taskbar-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4a90e2, #5637d9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.taskbar-icon i {
    font-size: 16px;
    color: white;
}

.taskbar-title {
    font-size: 13px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .taskbar {
        left: 10px;
    }
    
    .taskbar-item {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .taskbar {
        left: 0;
        bottom: 70px;
        top: auto;
        transform: none;
        flex-direction: row;
        width: 100%;
        border-radius: 0;
        overflow-x: auto;
        padding: 8px;
    }
    
    .taskbar-item {
        width: auto;
        flex-shrink: 0;
    }
}

/* 添加搜索框样式 */
.search-container {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-width: 90%;
    z-index: 50;
}

.search-box {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 20px;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    outline: none;
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

/* 搜索结果容器 */
.search-results {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-result-item {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4a90e2, #5637d9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 18px;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.search-result-category {
    font-size: 12px;
    color: #666;
}

/* 添加浏览器打开按钮样式 */
.window-open-browser {
    background-color: #5cb85c;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-open-browser i {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.8);
    display: none;
}

.window-open-browser:hover i {
    display: block;
}

.window-control:hover {
    filter: brightness(0.9);
}

/* 移除文件夹视图相关样式 */
.view-toggle, .folder-view {
    display: none !important;
}

/* 窗口恢复动画 */
.window.restoring {
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

/* 文件夹图标样式 */
.folder-icon-img {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
}

.folder-icon-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.folder-icon-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    padding: 8px;
}

.folder-preview-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    opacity: 0.9;
    transform: scale(0.9);
    transition: all 0.2s ease;
}

.folder-icon:hover .folder-preview-item {
    transform: scale(1);
    opacity: 1;
}


.folder-popup-open {
    opacity: 1;
    transform: scale(1);
}

.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.folder-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.folder-close {
    cursor: pointer;
    font-size: 18px;
    color: #666;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.folder-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.folder-content {
    padding: 12px;
  
    overflow-y: auto;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    justify-items: center;
}

.folder-item.app-icon {
    width: 70px;
    height: 85px;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-item.app-icon:hover {
    transform: translateY(-2px);
}

.folder-item .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin: 0 auto 6px;
    font-size: 20px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.folder-item .name {
    font-size: 11px;
    text-align: center;
    color: #333;
    line-height: 1.2;
    word-break: break-word;
    max-height: 24px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 调整应用图标网格 */
    .app-grid {
        padding-left: 10%;
        padding-right: 10%;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
    
    /* 调整应用图标大小 */
    .app-icon {
        width: 80px;
        height: 80px;
    }
    
    .app-icon-img {
        width: 50px;
        height: 50px;
    }
    
    .app-icon-name {
        font-size: 12px;
        max-width: 70px;
    }
    
    /* 移动端文件夹弹出窗口全屏显示 */
    .folder-popup {
        position: fixed;
        top: 35px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        z-index: 1000;
        display: flex;
        flex-direction: column;
    }
    
 
    
    .folder-tool-icon {
        width: 70px;
        height: 80px;
    }
    
    .folder-tool-img {
        width: 45px;
        height: 45px;
    }
    
    /* 调整Dock大小 */
    .dock {
        bottom: 80px; /* 避免与移动端导航冲突 */
        padding: 8px 12px;
    }
    
    .dock-icon {
        width: 40px;
        height: 40px;
    }
    
    .dock-icon-img {
        font-size: 16px;
        border-radius: 10px;
    }
    
    /* 隐藏任务栏 */
    .taskbar {
        display: none !important;
    }
}

/* 键盘快捷键提示样式 */
.window-switch-hint {
    user-select: none;
    pointer-events: none;
}

.keyboard-shortcuts-hint {
    user-select: none;
}

.keyboard-shortcuts-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    color: #FFD700;
}

/* 响应式：移动端隐藏键盘快捷键提示 */
@media (max-width: 768px) {
    .keyboard-shortcuts-hint {
        display: none;
    }
    
    .window-switch-hint {
        display: none;
    }
}

/* 自定义Dock工具提示样式 */
.dock-tooltip {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    user-select: none;
}

.dock-tooltip-content {
    background: rgba(40, 44, 52, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 120px;
    max-width: 200px;
}

.dock-tooltip-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
}

.dock-tooltip-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.dock-tooltip-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 500;
}

.dock-tooltip-arrow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(40, 44, 52, 0.95);
}

.dock-tooltip-arrow::before {
    content: '';
    position: absolute;
    bottom: 1px;
    left: -5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.15);
}

/* 移动端隐藏工具提示 */
@media (max-width: 768px) {
    .dock-tooltip {
        display: none;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .dock-tooltip-content {
        background: rgba(28, 32, 40, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .dock-tooltip-arrow {
        border-top-color: rgba(28, 32, 40, 0.95);
    }
}