/* 敌人库容器 - 默认作为侧边栏，但也可以独立使用 */
.library-container {
    width: 100%;
    max-width: 350px;
    height: 100%;
    min-height: 500px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

.library-header {
    padding: 5px 15px;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
}

.library-title {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 操作按钮区 */
.library-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.lib-btn {
    flex: 1;
    padding: 2px 0px;
    font-size: 0.85rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.lib-btn:hover {
    background-color: #e2e6ea;
}

.lib-btn.primary {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.lib-btn.primary:hover {
    background-color: #2980b9;
}

/* 筛选区 */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f1f3f5;
    padding: 10px;
    border-radius: 4px;
}

.search-input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

.filter-row {
    display: flex;
    gap: 5px;
}

.filter-select {
    flex: 1;
    padding: 4px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    max-width: 90px;
}

/* 列表区 */
.enemy-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.enemy-list-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 2px;
    padding-bottom: 2px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
}

.enemy-list-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-color: #adb5bd;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Changed from baseline to center for button alignment */
    margin-bottom: 4px;
}

.item-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 5px;
}

.item-tier {
    font-size: 0.75rem;
    background: #e9ecef;
    padding: 1px 5px;
    border-radius: 10px;
    color: #495057;
    white-space: nowrap;
}

.item-details {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    gap: 8px;
}

.item-tag {
    display: inline-block;
}

/* 删除按钮 */
.lib-item-delete {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    margin-left: 5px;
    transition: color 0.2s;
    display: none; /* 默认隐藏，hover显示 */
}

.enemy-list-item:hover .lib-item-delete {
    display: block;
}

.lib-item-delete:hover {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

/* 来源标记 */
.source-tag {
    position: absolute;
    top: 5px;
    right: 5px; /* Note: Delete button might overlap if not careful, maybe move source tag? */
    /* Wait, source tag is just a dot. */
    width: 6px;
    height: 6px;
    border-radius: 50%;
    /* Moving it slightly to not interfere with content */
    top: 8px;
    left: 4px; 
    /* Changed position: let's put it on the left of item */
    display: none; /* User might not need to see it explicitly if filters exist, but let's keep it */
}
/* Revert source tag position logic, let's put delete button in header flex */

.source-tag {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.source-default { background-color: #adb5bd; } /* 默认数据 */
.source-custom { background-color: #2ecc71; } /* 用户自定义 */

/* 排序控制 */
.sort-controls {
    display: flex;
    justify-content: flex-end;
    padding: 5px 0px 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.sort-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 0 5px;
}

.sort-btn:hover {
    text-decoration: underline;
}

/* Multi-select styles */
.multi-select-container {
    position: relative;
    flex: 1;
    min-width: 80px;
}
.multi-select-btn {
    width: 100%;
    padding: 4px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}
.multi-select-btn::after {
    content: '';
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #666;
    margin-left: 4px;
    flex-shrink: 0;
}
.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 120px;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 5px;
}
.multi-select-dropdown.show {
    display: block;
}
.multi-select-option {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    user-select: none;
}
.multi-select-option:hover {
    background-color: #f1f3f5;
}
.multi-select-option input {
    margin-right: 6px;
}
