/* 基础样式 */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 侧边栏滚动条 */
.sidebar-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.sidebar-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 导航项样式 */
.nav-item {
    color: #4b5563;
}

.nav-item:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.nav-item.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.nav-item.active i {
    color: #2563eb;
}

/* 卡片悬停效果 */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background-color: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.data-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.neutral {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* 价格标签 */
.price-tag {
    font-weight: 600;
    color: #059669;
}

.price-tag.best {
    background-color: #d1fae5;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* 输入框样式 */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* 选择框样式 */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
}

/* 标签页 */
.tab-nav {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.tab-item {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-item:hover {
    color: #374151;
}

.tab-item.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 平台图标 */
.platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.platform-icon.ickey {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.platform-icon.lcsc {
    background: linear-gradient(135deg, #00a651, #008f4d);
}

.platform-icon.digikey {
    background: linear-gradient(135deg, #cc0000, #990000);
}

.platform-icon.mouser {
    background: linear-gradient(135deg, #003087, #00226b);
}

.platform-icon.element14 {
    background: linear-gradient(135deg, #f5821f, #e67e22);
}

/* 供应商状态 */
.supplier-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.supplier-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.supplier-status.active .dot {
    background-color: #10b981;
}

.supplier-status.inactive .dot {
    background-color: #9ca3af;
}

.supplier-status.pending .dot {
    background-color: #f59e0b;
}

/* 风险等级 */
.risk-level {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.risk-level.low {
    background-color: #d1fae5;
    color: #065f46;
}

.risk-level.medium {
    background-color: #fef3c7;
    color: #92400e;
}

.risk-level.high {
    background-color: #fee2e2;
    color: #991b1b;
}

/* 采集状态 */
.collection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.collection-status .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 截图预览 */
.screenshot-preview {
    position: relative;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.screenshot-preview:hover {
    transform: scale(1.05);
}

.screenshot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-preview .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.screenshot-preview:hover .overlay {
    opacity: 1;
}

/* 比价矩阵 */
.comparison-matrix {
    overflow-x: auto;
}

.comparison-matrix table {
    width: 100%;
    min-width: 800px;
}

.comparison-matrix th,
.comparison-matrix td {
    padding: 12px 16px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.comparison-matrix th {
    background-color: #f9fafb;
    font-weight: 600;
}

.comparison-matrix .best-price {
    background-color: #d1fae5;
    font-weight: 600;
    color: #065f46;
}

/* 雷达图容器 */
.radar-chart-container {
    width: 100%;
    height: 300px;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #2563eb;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #e5e7eb;
}

.timeline-item.completed::before {
    background-color: #10b981;
}

.timeline-item.pending::before {
    background-color: #9ca3af;
}

/* Toast通知 */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast.info {
    border-left: 4px solid #2563eb;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 图表容器 */
.chart-container {
    width: 100%;
    height: 300px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    aside {
        width: 200px !important;
    }
    
    main {
        margin-left: 200px !important;
    }
}

@media (max-width: 768px) {
    aside {
        display: none;
    }
    
    main {
        margin-left: 0 !important;
    }
}

/* 模块内容动画 */
.module-content {
    animation: fadeIn 0.3s ease;
}

.module-content.hidden {
    display: none;
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background-color: #1f2937;
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

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

/* 采集进度指示器 */
.collection-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 8px;
}

.collection-progress .platform-list {
    display: flex;
    gap: 8px;
}

.collection-progress .platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.collection-progress .platform-item.completed .platform-icon {
    opacity: 1;
}

.collection-progress .platform-item.pending .platform-icon {
    opacity: 0.4;
}

.collection-progress .platform-item .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.collection-progress .platform-item.completed .status-dot {
    background-color: #10b981;
}

.collection-progress .platform-item.collecting .status-dot {
    background-color: #2563eb;
    animation: pulse 1s infinite;
}

.collection-progress .platform-item.pending .status-dot {
    background-color: #9ca3af;
}
