/* OPC Agent Library Styles */

/* 容器 */
.opc-agent-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 筛选区 */
.opc-agent-filter {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.opc-agent-filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.opc-department-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.opc-dept-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.opc-dept-tab:hover {
    background: #e8f4ff;
    color: #0066FF;
}

.opc-dept-tab.active {
    background: #0066FF;
    color: #fff;
}

.opc-dept-tab .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

.opc-dept-tab.active .count {
    background: rgba(255, 255, 255, 0.2);
}

/* 搜索框 */
.opc-search-box {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.opc-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.opc-search-input:focus {
    border-color: #0066FF;
}

.opc-search-btn {
    padding: 12px 24px;
    background: #0066FF;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.opc-search-btn:hover {
    background: #0052cc;
}

/* 智能体网格 */
.opc-agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 智能体卡片 */
.opc-agent-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.opc-agent-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.opc-agent-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.opc-agent-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0066FF 0%, #00a8ff 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

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

.opc-agent-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}

.opc-agent-dept {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f0f7ff;
    color: #0066FF;
    border-radius: 4px;
    font-size: 12px;
}

.opc-agent-source {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.opc-agent-source.original {
    background: #fff3e0;
    color: #ff9800;
}

.opc-agent-source.translated {
    background: #e8f5e9;
    color: #4caf50;
}

/* 积分标签样式 */
.opc-tag-free {
    color: #4caf50 !important;
}

.opc-tag-points {
    color: #ff9800 !important;
}

.opc-agent-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.opc-agent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.opc-agent-tag {
    padding: 4px 10px;
    background: #f5f5f5;
    color: #666;
    border-radius: 4px;
    font-size: 12px;
}

.opc-agent-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.opc-agent-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
}

.opc-agent-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.opc-agent-download-btn {
    padding: 6px 16px;
    background: #0066FF;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.opc-agent-download-btn:hover {
    background: #0052cc;
}

/* 弹窗样式 */
.opc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.opc-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.opc-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.opc-modal-overlay.active .opc-modal {
    transform: scale(1);
}

.opc-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.opc-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.opc-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: #999;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.opc-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.opc-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* 智能体详情弹窗 */
.opc-agent-detail-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.opc-agent-detail-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0066FF 0%, #00a8ff 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
}

.opc-agent-detail-info {
    flex: 1;
}

.opc-agent-detail-name {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.opc-agent-detail-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #666;
}

.opc-agent-detail-section {
    margin-bottom: 20px;
}

.opc-agent-detail-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.opc-agent-detail-section-content {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

/* 工具选择弹窗 */
.opc-tool-select-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.opc-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.opc-tool-card {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.opc-tool-card:hover {
    border-color: #0066FF;
    background: #f8faff;
}

.opc-tool-card.selected {
    border-color: #0066FF;
    background: #e8f4ff;
}

.opc-tool-card.recommended {
    position: relative;
}

.opc-tool-card.recommended::before {
    content: '推荐';
    position: absolute;
    top: -8px;
    right: 12px;
    padding: 2px 8px;
    background: #ff6b00;
    color: #fff;
    font-size: 11px;
    border-radius: 4px;
}

.opc-tool-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.opc-tool-type {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f5f5;
    color: #666;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

.opc-tool-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* 安装指南 */
.opc-install-guide {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.opc-install-guide-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.opc-install-step {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.opc-install-step-num {
    width: 28px;
    height: 28px;
    background: #0066FF;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.opc-install-step-content {
    flex: 1;
}

.opc-install-step-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.opc-install-step-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.opc-install-step-text code {
    display: block;
    margin-top: 8px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    color: #333;
    overflow-x: auto;
}

.opc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.opc-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.opc-btn-primary {
    background: #0066FF;
    color: #fff;
}

.opc-btn-primary:hover {
    background: #0052cc;
}

.opc-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.opc-btn-secondary:hover {
    background: #e0e0e0;
}

/* 分页 */
.opc-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.opc-page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.opc-page-btn:hover {
    border-color: #0066FF;
    color: #0066FF;
}

.opc-page-btn.active {
    background: #0066FF;
    border-color: #0066FF;
    color: #fff;
}

/* 空状态 */
.opc-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.opc-empty-icon {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
}

.opc-empty-text {
    font-size: 16px;
    color: #666;
}

/* 登录提示 */
.opc-login-tip {
    text-align: center;
    padding: 40px 20px;
}

.opc-login-tip-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 16px;
}

.opc-login-tip-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #0066FF;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.opc-login-tip-btn:hover {
    background: #0052cc;
    color: #fff;
}

/* 响应式 */
@media (max-width: 768px) {
    /* body已有padding-top: 56px，这里只需要左右padding */
    .opc-agent-container {
        padding: 0 16px 20px !important;
    }
    
    .opc-agent-filter {
        padding: 16px !important;
    }
    
    .opc-agent-grid {
        grid-template-columns: 1fr !important;
    }
    
    .opc-tool-grid {
        grid-template-columns: 1fr;
    }
    
    .opc-department-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .opc-department-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .opc-dept-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .opc-search-box {
        flex-direction: column;
    }
    
    .opc-search-btn {
        width: 100%;
    }
}
