/* 商家后台样式 */

:root {
    --merchant-primary: #52c41a;
    --merchant-success: #52c41a;
    --merchant-warning: #faad14;
    --merchant-danger: #ff4d4f;
    --merchant-info: #1890ff;
    --merchant-bg: #f0f2f5;
    --sidebar-width: 240px;
    --header-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--merchant-bg);
}

/* 侧边栏样式 */
.merchant-sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    left: 0;
    top: var(--header-height);
    overflow-y: auto;
    z-index: 50;
}

.merchant-sidebar::-webkit-scrollbar {
    width: 6px;
}

.merchant-sidebar::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

.sidebar-menu-item {
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
}

.sidebar-menu-item:hover {
    background: #f0f2f5;
    color: var(--merchant-primary);
}

.sidebar-menu-item.active {
    background: #e6f7e6;
    color: var(--merchant-primary);
    border-right: 3px solid var(--merchant-primary);
}

.sidebar-menu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* 主内容区域 */
.merchant-main {
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
}

/* 卡片样式 */
.merchant-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.merchant-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

/* 数据卡片 */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 20px;
}

.stat-icon.primary {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #faad14 0%, #ffc53d 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
}

.stat-icon.info {
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

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

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

.stat-trend {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
}

.stat-trend.up {
    color: #52c41a;
    background: #f6ffed;
}

.stat-trend.down {
    color: #ff4d4f;
    background: #fff1f0;
}

/* 表格样式 */
.merchant-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.merchant-table thead {
    background: #fafafa;
}

.merchant-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
}

.merchant-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.merchant-table tbody tr:hover {
    background: #fafafa;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--merchant-primary);
    color: white;
}

.btn-primary:hover {
    background: #73d13d;
}

.btn-danger {
    background: var(--merchant-danger);
    color: white;
}

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

.btn-warning {
    background: var(--merchant-warning);
    color: white;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-info {
    background: var(--merchant-info);
    color: white;
}

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

.btn-default {
    background: white;
    color: #333;
    border: 1px solid #d9d9d9;
}

.btn-default:hover {
    color: var(--merchant-primary);
    border-color: var(--merchant-primary);
}

/* 订单状态标签 */
.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.order-status.pending {
    background: #fff7e6;
    color: #faad14;
}

.order-status.paid {
    background: #e6f7ff;
    color: #1890ff;
}

.order-status.shipped {
    background: #f6ffed;
    color: #52c41a;
}

.order-status.completed {
    background: #f0f0f0;
    color: #666;
}

.order-status.cancelled {
    background: #fff1f0;
    color: #ff4d4f;
}

/* 商品状态标签 */
.product-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.product-status.on-sale {
    background: #f6ffed;
    color: #52c41a;
}

.product-status.off-sale {
    background: #f0f0f0;
    color: #999;
}

.product-status.draft {
    background: #fff7e6;
    color: #faad14;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-label.required::before {
    content: '*';
    color: #ff4d4f;
    margin-right: 4px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--merchant-primary);
    box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--merchant-primary);
    box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--merchant-primary);
}

/* 图片上传 */
.image-upload {
    display: inline-block;
    width: 120px;
    height: 120px;
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.image-upload:hover {
    border-color: var(--merchant-primary);
}

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.image-upload-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
}

.image-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover {
    color: var(--merchant-primary);
    border-color: var(--merchant-primary);
}

.pagination-btn.active {
    background: var(--merchant-primary);
    color: white;
    border-color: var(--merchant-primary);
}

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

/* Toast 提示 - 现代化样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-message {
    min-width: 320px;
    max-width: 420px;
    padding: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 14px;
    cursor: pointer;
    pointer-events: auto;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid;
}

.toast-message:hover {
    transform: translateX(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toast-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon-wrapper i {
    font-size: 20px;
    font-weight: 600;
}

.toast-content {
    flex: 1;
    padding: 14px 0;
    display: flex;
    align-items: center;
}

.toast-text {
    font-weight: 500;
    line-height: 1.5;
    color: #1f2937;
}

.toast-close {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

.toast-close i {
    font-size: 12px;
}

/* 成功样式 */
.toast-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.toast-success .toast-icon-wrapper {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.toast-success .toast-text {
    color: #065f46;
}

/* 错误样式 */
.toast-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.toast-error .toast-icon-wrapper {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
}

.toast-error .toast-text {
    color: #991b1b;
}

/* 警告样式 */
.toast-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.toast-warning .toast-icon-wrapper {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
}

.toast-warning .toast-text {
    color: #92400e;
}

/* 信息样式 */
.toast-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.toast-info .toast-icon-wrapper {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
}

.toast-info .toast-text {
    color: #1e40af;
}

/* 动画效果 */
.toast-enter-active {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-leave-active {
    transition: all 0.3s cubic-bezier(0.4, 0, 1, 1);
}

.toast-enter-from {
    transform: translateX(120%) scale(0.8);
    opacity: 0;
}

.toast-enter-to {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-leave-from {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-leave-to {
    transform: translateX(120%) scale(0.8);
    opacity: 0;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .toast-message {
        min-width: auto;
        max-width: 100%;
    }
}

.toast-enter-active, .toast-leave-active {
    transition: all 0.3s ease;
}

.toast-enter-from {
    transform: translateX(100%);
    opacity: 0;
}

.toast-leave-to {
    transform: translateX(100%);
    opacity: 0;
}

/* 客服消息样式 */
.message-bubble {
    max-width: 70%;
    word-wrap: break-word;
}

.message-merchant {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.message-user {
    background: #f3f4f6;
    color: #1f2937;
}

/* 响应式 */
@media (max-width: 768px) {
    .merchant-sidebar {
        transform: translateX(-100%);
    }
    
    .merchant-main {
        margin-left: 0;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
    }
}

