/* 知识库页面内联样式 - 从HTML中提取 */

/* 通知模态框样式 */
.notification-modal {
    display: none;
    position: fixed;
    z-index: 100000; /* 比模态框更高，确保在最顶层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.notification-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 600px;
    width: 90%;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.notification-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-body {
    padding: 24px;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.notification-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.notification-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.notification-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.notification-btn:active {
    transform: translateY(0);
}

/* 通知类型样式 */
.notification-success .notification-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification-error .notification-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification-warning .notification-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification-info .notification-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
}

.notification-modal.hiding {
    /* 移除动画效果，直接隐藏 */
}

/* 确保通知模态框内容可见 */
.notification-modal[style*="display: block"] .notification-content {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) !important;
}

.notification-modal[style*="display: block"] .notification-body {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 管理员标签页样式 */
.admin-tabs {
    width: 100%;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
}

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

.tab-btn.active {
    background: #ffffff;
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    box-shadow: 0 -2px 4px rgba(79, 70, 229, 0.1);
}

.tab-btn i {
    font-size: 16px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

.tab-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tab-section h4 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-section h4 i {
    color: #6b7280;
}

.admin-controls {
    margin-bottom: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.search-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-width: 300px;
}

.search-hint {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
    cursor: help;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.search-hint:hover {
    opacity: 1;
}

.search-hint i {
    font-size: 14px;
}

/* 搜索框获得焦点时显示提示 */
#search-input:focus + .search-hint {
    opacity: 1;
}

/* 提示工具样式 */
.search-tooltip {
    position: absolute;
    top: -35px;
    right: 0;
    background: #374151;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.search-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    border: 5px solid transparent;
    border-top-color: #374151;
}

.search-hint:hover .search-tooltip,
.search-hint:focus .search-tooltip {
    opacity: 1;
    visibility: visible;
}

.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cleanup-config {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-item label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.config-item input[type="number"] {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.cleanup-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.status-value {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
}

.status-value.success {
    color: #059669;
}

.status-value.error {
    color: #dc2626;
}

.control-hint {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* 文件管理子标签样式 */
.file-management-tabs {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.sub-tab-buttons {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
    background: #f8f9fa;
    border-radius: 0;
}

.sub-tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
}

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

.sub-tab-btn.active {
    background: #ffffff;
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.sub-tab-content {
    display: none;
    padding: 16px;
    background: #ffffff;
}

.sub-tab-content.active {
    display: block;
}

.file-overview {
    display: grid;
    gap: 16px;
}

.overview-section {
    padding: 16px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.overview-section h5 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.summary-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #4f46e5;
}

.summary-item h6 {
    margin: 0 0 4px 0;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
}

.summary-item .count {
    font-size: 18px;
    font-weight: 700;
    color: #4f46e5;
}

.summary-item .detail {
    font-size: 11px;
    color: #6b7280;
}

.file-table-container {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.file-table th {
    background: #f8f9fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.file-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.file-table tr:hover {
    background: #f8f9fa;
}

.filter-select {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    min-width: 150px;
}

.file-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.file-type-attachment {
    background: #dbeafe;
    color: #1e40af;
}

.file-type-pasted_image {
    background: #dcfce7;
    color: #166534;
}

.file-type-network_image {
    background: #fef3c7;
    color: #92400e;
}

.file-size {
    font-family: 'Courier New', monospace;
    color: #6b7280;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
}

.session-info {
    font-size: 11px;
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

.user-avatar {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    color: white;
    text-align: center;
    line-height: 24px;
    font-size: 10px;
    font-weight: 600;
}

/* 管理员用户选择器样式 - 下拉式 */
.admin-user-selector {
    margin-left: 15px;
    position: relative;
}

.user-selector-dropdown {
    min-width: 200px;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-header:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.dropdown-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.selected-count {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: normal;
}

.dropdown-toggle {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.dropdown-toggle:hover {
    color: #495057;
}

.dropdown-toggle.open {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 250px;
}

.dropdown-actions {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.dropdown-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

.user-search {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
}

.user-search input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
}

.user-search input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.user-checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.user-checkbox-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.user-checkbox-item:hover {
    background: #f8f9fa;
}

.user-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.user-checkbox-item label {
    margin: 0;
    font-size: 13px;
    cursor: pointer;
    color: #495057;
    flex: 1;
    user-select: none;
}

.user-checkbox-item .user-role {
    font-size: 11px;
    color: #6c757d;
    background: #e9ecef;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* 调整sort-options布局以容纳用户选择器 */
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .tab-buttons {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: 1px solid #e5e7eb;
        border-radius: 0;
    }

    .tab-btn.active {
        border-bottom-color: #4f46e5;
        border-left: 3px solid #4f46e5;
    }

    .sub-tab-buttons {
        flex-direction: column;
    }

    .sub-tab-btn {
        border-bottom: 1px solid #e5e7eb;
        border-radius: 0;
    }

    .sub-tab-btn.active {
        border-bottom-color: #4f46e5;
        border-left: 3px solid #4f46e5;
    }

    .cleanup-config {
        grid-template-columns: 1fr;
    }

    .search-group {
        flex-direction: column;
    }

    .button-group {
        justify-content: center;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .file-table-container {
        font-size: 11px;
    }

    .file-table th,
    .file-table td {
        padding: 6px 8px;
    }
}