/* css/products.css - 产品管理样式 */

.product-controls {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.products-list {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.product-item:hover {
    background-color: #f5f9ff;
}

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

.product-info {
    flex: 1;
}

.product-code {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

.product-name {
    color: #555;
    margin: 5px 0;
}

.product-meta {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.product-meta span {
    margin-right: 15px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.edit-product-btn, .delete-product-btn, .link-product-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.edit-product-btn {
    background-color: #3498db;
    color: white;
}

.edit-product-btn:hover {
    background-color: #2980b9;
}

.delete-product-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-product-btn:hover {
    background-color: #c0392b;
}

.link-product-btn {
    background-color: #2ecc71;
    color: white;
}

.link-product-btn:hover {
    background-color: #27ae60;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #4b6cb7;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #95a5a6;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

/* 产品预览样式 */
.product-preview {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #ddd;
}

.product-preview h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 关联状态指示器 */
.linked-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.linked-indicator.linked {
    background-color: #2ecc71;
}

.linked-indicator.unlinked {
    background-color: #e74c3c;
}

/* 产品关联表格 */
.product-links-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.product-links-table th,
.product-links-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.product-links-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.product-links-table tr:hover {
    background-color: #f9f9f9;
}