/* 管理界面样式 */

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 选项卡样式 */
.tab-btn {
    transition: all 0.2s ease;
    position: relative;
}

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

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

/* 选项卡内容 */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* 统计卡片 */
.stats-card {
    transition: all 0.3s ease;
}

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

/* 表格样式 */
.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

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

/* 模态框样式 */
.modal {
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-backdrop {
    animation: backdropFadeIn 0.2s ease-out;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 知识库条目卡片 */
.knowledge-item {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.knowledge-item:hover {
    border-left-color: #10b981;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.knowledge-item.category-content-strategy {
    border-left-color: #3b82f6;
}

.knowledge-item.category-platform-operation {
    border-left-color: #8b5cf6;
}

.knowledge-item.category-data-analysis {
    border-left-color: #f59e0b;
}

.knowledge-item.category-local-marketing {
    border-left-color: #10b981;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #e5e7eb;
    color: #374151;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.tag-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.tag-green {
    background-color: #d1fae5;
    color: #065f46;
}

.tag-purple {
    background-color: #ede9fe;
    color: #5b21b6;
}

.tag-orange {
    background-color: #fed7aa;
    color: #9a3412;
}

/* 搜索框增强 */
.search-input {
    position: relative;
}

.search-input:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-online {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

.status-offline {
    background-color: #ef4444;
}

.status-warning {
    background-color: #f59e0b;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 文件上传区域 */
.file-upload {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: #2563eb;
    background-color: #f0f9ff;
}

.file-upload.dragover {
    border-color: #2563eb;
    background-color: #eff6ff;
}

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

.progress-fill {
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s ease;
}

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

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.tooltip:hover::before {
    opacity: 1;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 600px;
    }

    .hide-mobile {
        display: none;
    }
}

/* 移动端优化 */
@media (max-width: 640px) {
    .grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }

    .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-nav::-webkit-scrollbar {
        display: none;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }

    .print-break {
        page-break-after: always;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .table {
        border-collapse: collapse;
        width: 100%;
    }

    .table th,
    .table td {
        border: 1px solid #000;
        padding: 8px;
    }
}