/* 最新收录小工具样式 - 310x310 */
.latest-collection-container {
    width: 310px;
    height: 310px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.latest-collection-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.02) 0%, rgba(0, 123, 255, 0.05) 100%);
    z-index: 0;
}

/* 头部区域 */
.collection-header {
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* 内容网格 - 横向展示 */
.collection-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    padding-right: 5px;
}

/* 自定义滚动条 */
.collection-grid::-webkit-scrollbar {
    width: 4px;
}

.collection-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.collection-grid::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 2px;
}

.collection-grid::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* 收录项目 - 横向布局 */
.collection-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    min-height: 40px;
    width: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.collection-item:hover {
    background: #fff;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.1);
    text-decoration: none;
    color: inherit;
}

.collection-item:visited {
    color: inherit;
}

.collection-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 3px;
}

.item-icon i {
    font-size: 12px;
    color: #007bff;
}

.item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.item-type {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: 500;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.item-date {
    color: #999;
}

/* 无内容状态 */
.no-items {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.no-items i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.no-items p {
    font-size: 14px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .latest-collection-container {
        width: 100%;
        max-width: 310px;
        height: auto;
        min-height: 310px;
    }
    
    .collection-grid {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .latest-collection-container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .collection-grid {
        gap: 6px;
    }
    
    .collection-item {
        padding: 6px 10px;
        min-height: 35px;
    }
    
    .item-icon {
        width: 24px;
        height: 24px;
    }
    
    .icon-img {
        width: 16px;
        height: 16px;
    }
    
    .item-icon i {
        font-size: 10px;
    }
    
    .item-title {
        font-size: 12px;
    }
    
    .item-meta {
        font-size: 10px;
    }
}

/* 动画效果 */
.collection-item {
    animation: fadeInUp 0.6s ease-out;
}

.collection-item:nth-child(1) { animation-delay: 0.1s; }
.collection-item:nth-child(2) { animation-delay: 0.2s; }
.collection-item:nth-child(3) { animation-delay: 0.3s; }
.collection-item:nth-child(4) { animation-delay: 0.4s; }
.collection-item:nth-child(5) { animation-delay: 0.5s; }
.collection-item:nth-child(6) { animation-delay: 0.6s; }
.collection-item:nth-child(7) { animation-delay: 0.7s; }
.collection-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 悬停时的整体效果 */
.latest-collection-container:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* 加载状态 */
.collection-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
