/* 侵权词替换规则表格样式 */
.replace-word-container {
    width: 100%;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.replace-word-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.new-rule-row {
    background: #f8f9fa;
    border-top: 2px dashed #dee2e6;
}

.new-rule-row:hover {
    background: #e9ecef;
}

.new-rule-row .replace-word-input {
    background: #fff;
    border-style: dashed;
}

.new-rule-row .replace-word-input:focus {
    border-style: solid;
    background: #fff;
}

.replace-word-table th,
.replace-word-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.replace-word-table th {
    background: #007bff;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.replace-word-table tbody tr:hover {
    background: #f8f9fa;
}

.replace-word-table tbody tr:last-child td {
    border-bottom: none;
}

.replace-word-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.replace-word-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.replace-word-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.replace-word-btn-add {
    background: #28a745;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: auto;
}

.replace-word-btn-add:hover {
    background: #218838;
    transform: scale(1.1);
}

.replace-word-btn-remove {
    background: #dc3545;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: auto;
}

.replace-word-btn-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

.replace-word-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.replace-word-info {
    color: #666;
    font-size: 14px;
}

.replace-word-btn-group {
    display: flex;
    gap: 10px;
}

.replace-word-btn-secondary {
    background: #6c757d;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.replace-word-btn-secondary:hover {
    background: #5a6268;
}

.replace-word-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.replace-word-empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* 批量导入弹窗样式 */
.batch-import-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.batch-import-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.batch-import-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.batch-import-close {
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.batch-import-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.batch-import-modal-body {
    padding: 20px 24px;
}

.batch-import-instructions {
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.batch-import-instructions p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #1f2937;
}

.batch-import-instructions ul {
    margin: 0;
    padding-left: 20px;
    color: #4b5563;
}

.batch-import-instructions li {
    margin-bottom: 4px;
}

#batchImportTextarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

#batchImportTextarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.batch-import-preview {
    margin-top: 16px;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.batch-import-preview h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1f2937;
}

.preview-valid-rules {
    margin-bottom: 16px;
}

.preview-valid-rules h5 {
    margin: 0 0 8px 0;
    color: #059669;
    font-size: 14px;
}

.preview-valid-rules ul {
    margin: 0;
    padding-left: 20px;
    max-height: 150px;
    overflow-y: auto;
}

.preview-valid-rules li {
    margin-bottom: 4px;
    color: #374151;
    font-size: 13px;
}

.preview-errors h5 {
    margin: 0 0 8px 0;
    color: #dc2626;
    font-size: 14px;
}

.preview-errors ul {
    margin: 0;
    padding-left: 20px;
    max-height: 100px;
    overflow-y: auto;
}

.error-item {
    margin-bottom: 4px;
    color: #dc2626;
    font-size: 13px;
}

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

.batch-import-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.batch-import-btn-primary {
    background-color: #3b82f6;
    color: white;
}

.batch-import-btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

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

.batch-import-btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .replace-word-table {
        font-size: 12px;
    }
    
    .replace-word-table th,
    .replace-word-table td {
        padding: 8px 10px;
    }
    
    .replace-word-input {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .replace-word-btn {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 50px;
    }
    
    .replace-word-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .replace-word-btn-group {
        justify-content: center;
    }
    
    .batch-import-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .batch-import-modal-header,
    .batch-import-modal-body,
    .batch-import-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .batch-import-modal-footer {
        flex-direction: column;
    }
    
    .batch-import-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .replace-word-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .replace-word-actions {
        flex-direction: column;
        gap: 4px;
    }
}