/* Dock栏样式 */
/* 为页面添加底部留白，确保内容不会被dock栏遮挡 */
html, body {
    padding-bottom: 5vh !important;
    box-sizing: border-box;
}

/* 确保主要内容区域有足够的底部空间 */
.main, .right {
    padding-bottom: 8vh;
}

/* 确保项目列表底部有足够空间 */
.projectList:last-child {
    margin-bottom: 5vh;
}

/* 确保主内容容器底部留白 */
main {
    margin-bottom: 6vh;
}

.dock-container {
    position: fixed;
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: end;
}

.dock {
    display: flex;
    justify-content: space-evenly; /* 均匀分布按钮 */
    padding: 6px 24px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 600px; /* 增加横向长度 */
}

.dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom;
    padding: 2px;
}

.dock-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dock-icon i {
    font-size: 18px;
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dock-label {
    margin-top: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    pointer-events: none;
    font-weight: 500;
}

/* 悬停效果 */
.dock-item:hover {
    transform: scale(1.3) translateY(-8px);
}

.dock-item:hover .dock-icon {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    transform: rotate(5deg);
}

.dock-item:hover .dock-icon i {
    color: #ffffff;
    transform: scale(1.15);
}

.dock-item:hover .dock-label {
    opacity: 1;
    transform: translateY(0);
}

/* 相邻元素的磁性效果 */
.dock:hover .dock-item:not(:hover) {
    transform: scale(0.9);
}

.dock-item:hover + .dock-item,
.dock-item:has(+ .dock-item:hover) {
    transform: scale(1.15) translateY(-6px);
}

.dock-item:hover + .dock-item + .dock-item,
.dock-item:has(+ .dock-item + .dock-item:hover) {
    transform: scale(1.08) translateY(-3px);
}

/* 点击效果 */
.dock-item:active {
    transform: scale(1.1) translateY(-4px);
    transition: all 0.1s ease;
}

.dock-item:active .dock-icon {
    transform: scale(0.95) rotate(2deg);
}

/* 响应式设计 */
@media (max-width: 768px) {
    html, body {
        padding-bottom: 4vh !important;
    }
    
    .main, .right {
        padding-bottom: 6vh;
    }
    
    .dock-container {
        bottom: 1.5vh;
    }
    
    .dock {
        gap: 14px;
        padding: 6px 20px;
        border-radius: 16px;
        min-width: 420px;
    }
    
    .dock-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    
    .dock-icon i {
        font-size: 16px;
    }
    
    .dock-item:hover {
        transform: scale(1.25) translateY(-6px);
    }
}

@media (max-width: 480px) {
    html, body {
        padding-bottom: 3vh !important;
    }
    
    .main, .right {
        padding-bottom: 5vh;
    }
    
    .dock-container {
        bottom: 1vh;
    }
    
    .dock {
        gap: 12px;
        padding: 4px 18px;
        min-width: 360px;
    }
    
    .dock-icon {
        width: 32px;
        height: 32px;
    }
    
    .dock-icon i {
        font-size: 14px;
    }
    
    .dock-label {
        font-size: 9px;
    }
    
    .dock-item:hover {
        transform: scale(1.2) translateY(-4px);
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .dock {
        background: rgba(0, 0, 0, 0.35);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .dock-icon {
        background: rgba(0, 0, 0, 0.25);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .dock-item:hover .dock-icon {
        background: rgba(0, 0, 0, 0.35);
        border-color: rgba(255, 255, 255, 0.25);
    }
}

/* 自定义 Dark 主题适配 */
html[data-theme="dark"] .dock {
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 20, 0.9));
    border: 2px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(15px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

html[data-theme="dark"] .dock-icon {
    background: linear-gradient(45deg, rgba(20, 20, 20, 0.8), rgba(30, 30, 30, 0.8));
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

html[data-theme="dark"] .dock-item:hover .dock-icon {
    background: linear-gradient(45deg, rgba(212, 175, 55, 0.1), rgba(255, 215, 0, 0.1));
    border-color: #d4af37;
    box-shadow: 
        0 0 15px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(212, 175, 55, 0.2);
    transform: scale(1.1) translateY(-2px);
}

/* 特殊图标颜色 */
.dock-item:nth-child(1) .dock-icon i { color: #007AFF; } /* Safari蓝 */
.dock-item:nth-child(2) .dock-icon i { color: #FF9500; } /* 邮件橙 */
.dock-item:nth-child(3) .dock-icon i { color: #FF2D92; } /* 照片粉 */
.dock-item:nth-child(4) .dock-icon i { color: #FF3B30; } /* 音乐红 */
.dock-item:nth-child(5) .dock-icon i { color: #8E8E93; } /* 设置灰 */
.dock-item:nth-child(6) .dock-icon i { color: #FF3B30; } /* 日历红 */
.dock-item:nth-child(7) .dock-icon i { color: #34C759; } /* 地图绿 */

/* 悬停时保持颜色并增强亮度 */
.dock-item:hover .dock-icon i {
    filter: brightness(1.3) saturate(1.2);
}

/* 添加细微的弹跳动画 */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.dock-item:hover .dock-icon {
    animation: bounce 0.6s ease-in-out infinite;
}

/* 阴影层次效果 */
.dock {
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 8px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dock-icon {
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
