/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 序号样式 */
.product-id {
    position: relative;
}

.product-index {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #27ae60;
    color: white;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    margin-left: 10px;
    vertical-align: middle;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* 页面标题 */
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* 操作按钮 */
.action-buttons {
    margin-bottom: 20px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-count {
    font-size: 14px;
    color: #666;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 300px;
}

.search-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    margin-right: 10px;
}

.btn-logout {
    background-color: #e74c3c;
}

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

/* 操作按钮容器 */
.action-buttons-cell {
    white-space: nowrap;
}

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

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

.btn-danger {
    background-color: #e74c3c;
}

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

.btn-download {
    background-color: #f39c12;
}

.btn-download:hover {
    background-color: #e67e22;
}

/* 商品列表 */
.products-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.products-table th,
.products-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

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

.products-table tr:hover {
    background-color: #f5f5f5;
}

/* 可复制文本样式 */
.copyable {
    cursor: pointer;
    position: relative;
}

.copyable:hover {
    background-color: #e3f2fd;
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: 4px;
}

.copyable::after {
    content: '点击复制';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.copyable:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 图片显示 */
.product-image {
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
}

/* 分页 */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination .active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #666;
}

/* 提示框 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background-color: #27ae60;
}

.notification.error {
    background-color: #e74c3c;
}

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

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 900px;
    border-radius: 4px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.form-group label {
    display: inline-block;
    width: 150px;
    font-weight: bold;
    margin-right: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.input-with-add {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-add {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

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

.input-with-paste {
    flex: 1;
    display: flex;
    align-items: center;
}

.input-with-paste input,
.input-with-paste textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

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

.btn-paste {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.btn-paste:hover {
    background-color: #229954;
}



.form-actions {
    margin-top: 20px;
    text-align: right;
}

.modal-large {
    width: 85%;
    max-width: 1600px;
}

.modal-large .modal-body {
    max-height: 90vh;
    overflow: auto;
}

.modal-large iframe {
    height: 85vh !important;
    min-height: 800px;
}

/* 图片预览模态框 */
.modal-image-preview {
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-image-preview .modal-body {
    padding: 0;
    height: 80vh;
    max-height: 700px;
    overflow: hidden;
}

.modal-image-preview iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .products-table {
        font-size: 14px;
    }
    
    .products-table th,
    .products-table td {
        padding: 8px;
    }
    
    .product-image {
        max-width: 50px;
        max-height: 50px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
    
    .modal-image-preview {
        width: 95%;
        max-width: 95vw;
    }
    
    .modal-image-preview .modal-body {
        height: 70vh;
        max-height: 500px;
    }
    
    .modal-image-preview iframe {
        min-height: 400px;
    }
}