/* 自定义UI弹框样式 */

/* Toast 消息提示 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #28a745;
    border-radius: 0 4px 4px 0;
}

.toast.success::before {
    background: #28a745;
}

.toast.error::before {
    background: #dc3545;
}

.toast.warning::before {
    background: #ffc107;
}

.toast.info::before {
    background: #17a2b8;
}

.toast-icon {
    font-size: 24px;
}

.toast.success .toast-icon {
    color: #28a745;
}

.toast.error .toast-icon {
    color: #dc3545;
}

.toast.warning .toast-icon {
    color: #ffc107;
}

.toast.info .toast-icon {
    color: #17a2b8;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: #333;
}

.toast-message {
    font-size: 14px;
    color: #666;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all 0.2s;
}

.toast-close:hover {
    color: #666;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Modal 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 90%;
    min-width: 450px;
    max-height: 50%;
    animation: modalIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #666;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* Modal内的输入框样式，覆盖main.css的全局样式 */
.modal-body input,
.modal-body .form-control,
.modal-body select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.modal-body select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.modal-body input:focus,
.modal-body .form-control:focus,
.modal-body select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* Modal内的文本样式 */
.modal-body p {
    margin: 0;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

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

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

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

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

/* 分页组件 */
.item-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.pagination-btns {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.page-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

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

.page-ellipsis {
    padding: 0 4px;
    color: #999;
}

/* 物品列表 */
.item-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
}

.item-row:last-child {
    border-bottom: none;
}

.item-row:hover {
    background: rgba(102,126,234,0.05);
}

.item-row.selected {
    background: rgba(102,126,234,0.12);
    border-left: 3px solid #667eea;
    padding-left: 9px;
}

.item-id {
    color: #999;
    font-family: monospace;
    font-size: 12px;
    min-width: 80px;
    margin-right: 10px;
    flex-shrink: 0;
}

.item-name {
    color: #333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 响应式 */
@media (max-width: 768px) {
    .modal {
        width: 90%;
        max-width: 400px;
        max-height: 90vh;
        margin: 15px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 0;
    }
    
    .modal-body input,
    .modal-body .form-control,
    .modal-body select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .modal-body p {
        font-size: 14px;
    }
    
    .modal-footer {
        padding: 10px 16px;
    }
    
    .toast {
        min-width: 250px;
        padding: 12px 16px;
    }
}
