/* 商品管理页面样式 */

/* 页面头部样式 */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 500;
    color: #333;
    margin-bottom: 20px;
}

/* 统计卡片样式 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.stat-icon i {
    font-size: 24px;
    color: #fff;
}

.stat-icon.primary {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
}

.stat-icon.success {
    background: linear-gradient(135deg, #4cc9f0, #4895ef);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #ffa776, #ff7b54);
}

.stat-icon.danger {
    background: linear-gradient(135deg, #f72585, #b5179e);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #1890ff;
}

.breadcrumb i {
    margin: 0 8px;
    font-size: 12px;
    color: #999;
}

/* 顶部用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-icon {
    position: relative;
    font-size: 20px;
    color: #666;
    cursor: pointer;
}

.notification-icon .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background-color: #f5222d;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.action-bar .left {
    display: flex;
    gap: 12px;
}

.action-bar .right {
    display: flex;
    gap: 12px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.left-tools {
    display: flex;
    gap: 12px;
}

.right-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 筛选下拉菜单 */
.filter-dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 280px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 10;
}

.filter-dropdown:hover .dropdown-content {
    display: block;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-range input {
    width: calc(50% - 8px);
}

.price-range span {
    color: #999;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* 搜索框 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 0 12px;
    transition: all 0.3s;
}

.search-box:hover {
    background: #f0f0f0;
}

.search-box:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.search-box i {
    font-size: 16px;
    color: #999;
}

.search-box input {
    width: 240px;
    height: 36px;
    border: none;
    background: none;
    margin-left: 8px;
    outline: none;
    font-size: 14px;
    color: #333;
}

.search-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.search-btn:hover {
    color: #1890ff;
}

/* 按钮样式 */
.btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.btn i {
    margin-right: 6px;
    font-size: 16px;
}

.btn-primary {
    background-color: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

.btn-default {
    background-color: #fff;
    border-color: #d9d9d9;
    color: #666;
}

.btn-default:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

.btn-danger {
    background-color: #ff4d4f;
    color: #fff;
}

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

.btn:disabled {
    background-color: #f5f5f5 !important;
    border-color: #d9d9d9 !important;
    color: #bfbfbf !important;
    cursor: not-allowed;
}

/* 数据表格 */
.table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #fafafa;
    color: #333;
    font-weight: 500;
}

td {
    color: #666;
}

.data-table tbody tr {
    transition: background-color 0.3s;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* 数据表格排序样式 */
.data-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s;
}

.data-table th[data-sort]:hover {
    background-color: #f0f0f0;
}

.data-table th[data-sort] i {
    font-size: 14px;
    margin-left: 4px;
    vertical-align: middle;
    color: #ccc;
    transition: all 0.2s;
}

.data-table th[data-sort]:hover i {
    color: #999;
}

.data-table th.sort-asc i,
.data-table th.sort-desc i {
    color: var(--primary-color);
}

.data-table th.sort-asc i {
    transform: rotate(180deg);
}

/* 表格行悬停效果增强 */
.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f0f7ff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
}

/* 添加表格行分隔样式 */
.data-table tbody tr:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* 复选框样式 */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    transition: all 0.3s;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background-color: #1890ff;
    border-color: #1890ff;
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 4px;
    height: 8px;
    border-bottom: 2px solid #fff;
    border-right: 2px solid #fff;
}

/* 商品图片样式 */
.product-img-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    position: relative;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-img-wrapper:hover .product-img {
    transform: scale(1.05);
}

/* 商品名称单元格样式 */
.product-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-weight: 500;
    color: #333;
}

.product-category {
    font-size: 12px;
    color: #999;
}

/* 价格单元格样式 */
.price-cell {
    font-weight: 500;
    color: #ff4d4f;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.on-sale {
    background-color: #e6f7ff;
    color: #1890ff;
}

.status-badge.out-of-stock {
    background-color: #fff1f0;
    color: #f5222d;
}

.status-badge.off-shelf {
    background-color: #f5f5f5;
    color: #999;
}

/* 表格操作按钮 */
.operation {
    white-space: nowrap;
}

.icon-btn {
    border: none;
    background: transparent;
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.icon-btn:hover {
    background-color: #f5f5f5;
}

.icon-btn.edit-btn:hover {
    color: #1890ff;
}

.icon-btn.view-btn:hover {
    color: #52c41a;
}

.icon-btn.delete-btn:hover {
    color: #f5222d;
}

/* 分页器优化样式 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 16px;
    background-color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pagination-size {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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 8px center;
    padding-right: 28px;
}

.pagination-size:hover {
    border-color: #1890ff;
}

.pagination-size:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.pagination-text {
    font-size: 14px;
    color: #666;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    color: #1890ff;
    border-color: #1890ff;
    z-index: 1;
}

.pagination-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
    font-weight: 500;
    z-index: 2;
}

.pagination-btn:disabled {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #ccc;
    cursor: not-allowed;
}

.pagination-btn.first,
.pagination-btn.prev,
.pagination-btn.next,
.pagination-btn.last {
    color: #666;
}

.pagination-btn.first:hover:not(:disabled),
.pagination-btn.prev:hover:not(:disabled),
.pagination-btn.next:hover:not(:disabled),
.pagination-btn.last:hover:not(:disabled) {
    color: #1890ff;
    background-color: #f0f8ff;
}

.pagination-ellipsis {
    color: #999;
    padding: 0 4px;
    user-select: none;
}

.pagination-jumper {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.pagination-jumper-input {
    width: 50px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
}

.pagination-jumper-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.pagination-jumper-button {
    height: 32px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-jumper-button:hover {
    color: #1890ff;
    border-color: #1890ff;
    background-color: #f0f8ff;
}

@media screen and (max-width: 768px) {
    .pagination {
        flex-direction: column;
        align-items: center;
        padding: 16px;
    }
    
    .pagination-info, 
    .pagination-buttons, 
    .pagination-jumper {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-pages {
        overflow-x: auto;
        max-width: 100%;
        padding: 4px 0;
    }
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal.show .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

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

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

/* 商品表单样式 */
.product-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.form-group label .required {
    color: #f5222d;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

/* 图片上传区域 */
.image-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.image-upload-box {
    width: 100px;
    height: 100px;
    border: 1px dashed #d9d9d9;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.image-upload-box:hover {
    border-color: #1890ff;
}

.image-upload-box i {
    font-size: 24px;
    color: #999;
    margin-bottom: 8px;
}

.image-upload-box span {
    font-size: 12px;
    color: #999;
}

/* 批量导入样式 */
.import-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-area {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #1890ff;
}

.upload-area i {
    font-size: 48px;
    color: #999;
    margin-bottom: 16px;
}

.upload-area p {
    margin: 8px 0;
    color: #666;
}

.upload-area p.text-muted {
    color: #999;
    font-size: 12px;
}

.upload-area button {
    margin-top: 16px;
}

.import-tips {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
}

.import-tips p {
    display: flex;
    align-items: center;
    color: #666;
    margin-bottom: 8px;
}

.import-tips p i {
    margin-right: 8px;
    color: #1890ff;
}

.import-tips ul {
    padding-left: 24px;
    margin: 8px 0;
}

.import-tips li {
    color: #666;
    margin-bottom: 4px;
    font-size: 14px;
}

.import-tips a {
    color: #1890ff;
    text-decoration: none;
}

.import-tips a:hover {
    text-decoration: underline;
}

/* 响应式适配 */
@media screen and (max-width: 1200px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .left-tools, .right-tools {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .pagination {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
} 