/* 热门分类按钮样式 */
.popular-category-btn {
    padding: 8px 16px;
    background-color: #e5e7eb;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border: none;
    position: relative;
    overflow: hidden;
}

.popular-category-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #4F46E5;
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popular-category-btn:hover {
    background-color: #d1d5db;
    transform: translateY(-2px);
}

.popular-category-btn:hover::after {
    transform: scaleX(1);
}

.popular-category-btn.active {
    background-color: #4F46E5;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.popular-category-btn.active::after {
    transform: scaleX(1);
    background-color: white;
}

/* 扩展卡片样式 */
.extension-card {
    background-color: white;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    position: relative;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.extension-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #c7d2fe;
}

.extension-card:active {
    transform: translateY(-2px) scale(1.01);
}

.extension-card.checking-availability {
    opacity: 0.8;
}

.extension-card.unavailable {
    opacity: 0.7;
    filter: grayscale(80%);
    border-color: #d1d5db;
}

.extension-card.unavailable .extension-card-content {
    opacity: 0.9;
}

.extension-card.unavailable .download-btn {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.extension-card.unavailable .download-btn:hover {
    background-color: #94a3b8;
    transform: none;
}

.extension-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.extension-card:hover .extension-card-img {
    transform: scale(1.05);
}

.extension-card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.extension-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    flex-grow: 1;
    color: #1e293b;
}

.extension-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-top: 12px;
}

.extension-card-rating {
    color: #FFB400;
    display: flex;
    align-items: center;
}

.extension-card-rating i {
    margin-right: 4px;
}

.extension-card-author {
    color: #64748b;
}

.extension-card-type {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.repost-badge {
    position: absolute;
    top: 36px;
    right: 8px;
    background-color: rgba(255, 165, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.extension-card-date {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 8px;
}

.unavailable-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}

.unavailable-text {
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* 筛选器样式 */
.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group h3 {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.filter-option:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    transform: translateX(3px);
}

.filter-option:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4F46E5;
    cursor: pointer;
    margin-right: 8px;
}

.filter-option span {
    color: #374151;
    font-size: 0.9rem;
}

.filter-option input:checked + span {
    color: #4F46E5;
    font-weight: 500;
}

/* 详情弹窗样式 */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.detail-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-modal.active .modal-content {
    transform: scale(1);
}

.detail-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 8px;
    color: #94a3b8;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background-color: #f1f5f9;
}

.modal-body {
    padding: 20px;
}

.ext-full-image, .tool-full-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    height: 300px;
    object-fit: cover;
    object-position: center;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ext-full-image:hover, .tool-full-image:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.ext-full-image::before, .tool-full-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 12px;
    z-index: 1;
}

.ext-full-image:hover::before, .tool-full-image:hover::before {
    opacity: 1;
}

.ext-meta-full, .tool-meta-full {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.meta-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.meta-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 4px;
}

.meta-value {
    font-weight: 500;
    color: #1e293b;
}

.ext-desc-full, .tool-desc-full {
    line-height: 1.7;
    color: #334155;
    font-size: 1rem;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.ext-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.download-btn, .open-tool-btn {
    background-color: #4F46E5;
    color: white;
    width: 100%;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.1);
}

.download-btn:hover, .open-tool-btn:hover {
    background-color: #4338CA;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(79, 70, 229, 0.15);
}

/* 重置按钮样式 */
#reset-filters {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    padding: 8px 16px;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#reset-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(79, 70, 229, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

#reset-filters:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

#reset-filters:hover::before {
    left: 0;
}

#reset-filters:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.modal-download.unavailable {
    background-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

.modal-download.unavailable:hover {
    background-color: #94a3b8;
    transform: none;
    box-shadow: none;
}

/* 滚动条样式 */
#extensions-container::-webkit-scrollbar,
#tools-container::-webkit-scrollbar {
    width: 6px;
}

#extensions-container::-webkit-scrollbar-track,
#tools-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#extensions-container::-webkit-scrollbar-thumb,
#tools-container::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

#extensions-container::-webkit-scrollbar-thumb:hover,
#tools-container::-webkit-scrollbar-thumb:hover {
    background: #a5b4fc;
}

/* 全局动画类 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* 优化加载状态 */
.extension-card.loading,
.tool-card.loading {
    animation: pulse 1.5s infinite;
}

/* 渐变背景 */
.bg-gradient-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #10B981 0%, #0EA5E9 100%);
}

/* 微渐变效果 */
.gradient-border {
    position: relative;
    border-radius: 12px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #4F46E5, #8B5CF6, #EC4899);
    z-index: -1;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* 工具箱面板样式 */
#toolbox-panel {
    font-family: 'Inter', sans-serif;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px 0 0 16px;
    padding: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 25px -5px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    border-right: none;
}

/* 工具箱展开按钮样式优化 */
#open-toolbox {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#open-toolbox:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 20px -5px rgba(79, 70, 229, 0.4);
    background-color: #4338CA;
}

#open-toolbox:active {
    transform: scale(0.95) rotate(5deg);
}

/* 工具卡片样式 */
.tool-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tool-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #4F46E5, #8B5CF6);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 3px 0 0 3px;
}

.tool-card:hover {
    background-color: white;
    transform: translateY(-2px) translateX(4px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #c7d2fe;
    border-left-color: transparent;
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:active {
    transform: translateY(0) translateX(6px);
}

.tool-card-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    margin-right: 16px;
    flex-shrink: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tool-card:hover .tool-card-img {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-card-content {
    flex-grow: 1;
    min-width: 0;
}

.tool-card-title {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1e293b;
    transition: color 0.3s ease;
}

.tool-card-author {
    font-size: 0.875rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.tool-card-rating {
    display: flex;
    align-items: center;
    margin-top: 6px;
}

.tool-card-stars {
    color: #FFB400;
    margin-right: 4px;
    transition: color 0.3s ease;
}

.tool-card-rating-value {
    font-size: 0.875rem;
    color: #64748b;
    transition: color 0.3s ease;
}

.tool-card:hover .tool-card-title {
    color: #4F46E5;
}

.tool-card:hover .tool-card-author,
.tool-card:hover .tool-card-rating-value {
    color: #4F46E5;
}

.tool-card:hover .tool-card-stars {
    color: #FFA726;
}

/* 工具箱展开按钮样式 */
#open-toolbox {
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #4F46E5;
    color: white;
    cursor: pointer;
}

#open-toolbox:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
}

#open-toolbox:hover span {
    opacity: 1;
}

#open-toolbox span {
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

@media (min-width: 768px) {
    #open-toolbox:hover {
        width: auto;
        padding: 0 20px;
    }
    
    #open-toolbox span {
        display: inline;
    }
}

/* 多行文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 主内容区域过渡效果 */
#main-content {
    transition: margin-right 0.3s ease-in-out;
}

@media (max-width: 768px) {
    /* 移动端主内容区域过渡效果 */
    #main-content {
        transition: transform 0.3s ease-in-out;
    }
    
    #main-content.mr-80 {
        transform: translateX(-80px);
    }
    
    #open-toolbox span {
        display: none;
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .filter-group {
        min-width: 100%;
    }
    
    .extension-card-content {
        padding: 12px;
    }
    
    .extension-card-title {
        font-size: 1rem;
    }
    
    .extension-card-meta {
        font-size: 0.8125rem;
    }
}

/* 动画效果增强 */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 20px rgba(79, 70, 229, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.extension-card {
    animation: fadeIn 0.5s ease-out;
}

.tool-card {
    animation: slideInUp 0.3s ease-out;
}

#open-toolbox {
    animation: pulse 2s infinite;
}
