/* 管理后台样式 */

/* 全局样式 */
body {
    font-family: 'SimSun', 'STFangsong', 'FangSong', serif; /* 使用与主站相同的仿宋字体 */
    background-color: #FFF8E1; /* 与主站相同的背景色 */
}

/* 侧边栏样式 */
.sidebar {
    min-height: 100vh;
    background-color: #8B4513; /* 褐色，与主站主色调一致 */
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    z-index: 1;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    margin-bottom: 0.2rem;
    border-radius: 0.35rem;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
}

/* 卡片样式 */
.card {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(139, 69, 19, 0.1); /* 褐色阴影 */
    border: none;
    border-radius: 0.35rem;
}

.card-header {
    background-color: #F5F5DC; /* 米黄色 */
    border-bottom: 1px solid #D2B48C; /* 棕褐色边框 */
}

/* 边框样式 */
.border-left-primary {
    border-left: 0.25rem solid #8B4513 !important; /* 褐色 */
}

.border-left-success {
    border-left: 0.25rem solid #2F4F4F !important; /* 墨绿 */
}

.border-left-info {
    border-left: 0.25rem solid #B87333 !important; /* 古铜色 */
}

.border-left-warning {
    border-left: 0.25rem solid #D2B48C !important; /* 棕褐色 */
}

/* 文本颜色 */
.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* 页面区域 */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border: 1px solid #D2B48C; /* 棕褐色边框 */
}

.table th {
    background-color: #8B4513; /* 褐色 */
    color: #FFF8E1; /* 淡雅的象牙白 */
    font-weight: normal;
    padding: 12px 15px;
    border-bottom: 2px solid #D2B48C; /* 棕褐色边框 */
}

.table td {
    padding: 10px 15px;
    border-bottom: 1px solid #D2B48C; /* 棕褐色边框 */
    color: #333333;
}

.table tbody tr:hover {
    background-color: #F5F5DC; /* 米黄色 */
}

/* 状态标签 */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending {
    background-color: #F5F5DC; /* 米黄色 */
    color: #8B4513; /* 褐色 */
}

.status-paid {
    background-color: #E6F2E6; /* 淡绿色 */
    color: #2F4F4F; /* 墨绿 */
}

/* 商品管理样式 */
.product-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* 订单管理样式 */
.order-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* 用户管理样式 */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.status-shipped {
    background-color: #FFF0D9; /* 淡黄色 */
    color: #B87333; /* 古铜色 */
}

.status-delivered {
    background-color: #E6F2E6; /* 淡绿色 */
    color: #2F4F4F; /* 墨绿 */
}

.status-cancelled {
    background-color: #F9E4E4; /* 淡红色 */
    color: #8B0000; /* 暗红色 */
}

/* 登录页面 */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FFF8E1; /* 淡雅的象牙白 */
}

.login-card {
    max-width: 400px;
    width: 100%;
    border: 1px solid #D2B48C; /* 棕褐色边框 */
    background-color: #FFFAF0; /* 花白色 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1030;
    }
}

/* 加载遮罩 */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.spinner-container {
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.spinner-message {
    color: #333;
    font-size: 16px;
    margin-top: 15px;
    font-weight: 500;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.form-control {
    border: 1px solid #D2B48C; /* 棕褐色边框 */
    border-radius: 4px;
    padding: 8px 12px;
    background-color: #FFFAF0; /* 花白色 */
    color: #333333;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #8B4513; /* 褐色 */
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25); /* 褐色阴影 */
    outline: none;
}

.form-label {
    color: #2F4F4F; /* 墨绿 */
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}

.form-text {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 图片预览 */
.product-image-preview {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    border: 1px solid #D2B48C; /* 棕褐色边框 */
    border-radius: 4px;
    padding: 3px;
    background-color: #FFFAF0; /* 花白色 */
    box-shadow: 0 2px 5px rgba(139, 69, 19, 0.1); /* 褐色阴影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-image-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.2); /* 褐色阴影 */
}

/* 操作按钮 */
.action-buttons .btn {
    margin-right: 0.5rem;
}

.btn-primary {
    background-color: #8B4513; /* 褐色 */
    border-color: #8B4513;
    color: white;
}

.btn-primary:hover {
    background-color: #7C3A0A; /* 深褐色 */
    border-color: #7C3A0A;
}

.btn-success {
    background-color: #2F4F4F; /* 墨绿 */
    border-color: #2F4F4F;
}

.btn-success:hover {
    background-color: #1F3F3F; /* 深墨绿 */
    border-color: #1F3F3F;
}

.btn-info {
    background-color: #B87333; /* 古铜色 */
    border-color: #B87333;
    color: white;
}

.btn-info:hover {
    background-color: #A86323; /* 深古铜色 */
    border-color: #A86323;
}

.btn-danger {
    background-color: #8B0000; /* 暗红色 */
    border-color: #8B0000;
}

.btn-danger:hover {
    background-color: #7B0000; /* 深暗红色 */
    border-color: #7B0000;
}

/* 分页控件 */
.pagination-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item {
    margin: 0 2px;
}

.page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #8B4513; /* 褐色 */
    background-color: #FFFAF0; /* 花白色 */
    border: 1px solid #D2B48C; /* 棕褐色边框 */
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #F5F5DC; /* 米黄色 */
    color: #7C3A0A; /* 深褐色 */
}

.page-item.active .page-link {
    background-color: #8B4513; /* 褐色 */
    color: white;
    border-color: #8B4513;
}

.page-item.disabled .page-link {
    color: #999;
    pointer-events: none;
    background-color: #F5F5DC; /* 米黄色 */
    border-color: #D2B48C; /* 棕褐色边框 */
}

/* Toast容器 */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

/* 评价查看模态框 */
.review-images-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.review-image-item {
    width: calc(33.333% - 10px);
    border-radius: 4px;
    overflow: hidden;
}

.review-image-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 状态标签样式 */
.status-badge {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-pending {
    background-color: #ffeeba;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* 回复图片预览区域 */
#replyImagePreview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.preview-item {
    position: relative;
    width: calc(20% - 8px);
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #dc3545;
}

.remove-image:hover {
    background-color: #fff;
    color: #bd2130;
}

/* 进度条容器 */
#uploadProgressContainer {
    margin-top: 15px;
}

/* 图片缩略图 */
.review-image-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.review-image-thumbnail:hover {
    transform: scale(1.05);
}

/* 商品缩略图 */
.product-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* 星级评分 */
.review-stars {
    color: #ffc107;
}

/* 评价内容预览 */
.review-content-preview {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 暂无图片占位符 */
.no-image {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 4px;
    color: #6c757d;
    font-size: 12px;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 5px;
}

/* 图片错误状态 */
.img-error {
    opacity: 0.7;
    filter: grayscale(0.5);
}