/* 商家后台样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
}

.merchant-container {
    display: flex;
    height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.logo {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h2 {
    font-size: 24px;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-left: 4px solid #ffd700;
}

.nav-item .icon {
    font-size: 20px;
    margin-right: 12px;
}

.nav-item .badge {
    margin-left: auto;
    background: #ff4757;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.shop-selector select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.shop-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #52c41a;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.status-open {
    color: #52c41a;
    font-weight: 600;
}

.status-closed {
    color: #999;
}

.user-info {
    font-weight: 500;
}

/* 页面内容 */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page h1 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #333;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 48px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

.stat-sub {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 最新评价 */
.recent-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.recent-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.review-info {
    flex: 1;
}

.nickname {
    font-weight: 500;
    margin-bottom: 5px;
}

.rating {
    font-size: 14px;
}

.review-time {
    font-size: 12px;
    color: #999;
}

.review-content {
    margin-bottom: 10px;
    color: #666;
}

.order-no {
    font-size: 12px;
    color: #999;
}

/* 订单列表 */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

.filter-bar select,
.filter-bar input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.order-no {
    font-weight: 600;
    font-size: 16px;
}

.order-status {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.status-1 {
    background: #fff3e0;
    color: #ff9800;
}

.status-2 {
    background: #e3f2fd;
    color: #2196f3;
}

.status-3 {
    background: #e8f5e9;
    color: #4caf50;
}

.status-4 {
    background: #f3e5f5;
    color: #9c27b0;
}

.order-info {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.order-items {
    margin-bottom: 15px;
}

.order-items .item {
    padding: 8px 0;
    color: #666;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-amount {
    font-size: 20px;
    font-weight: 600;
    color: #ff4757;
}

.order-actions {
    display: flex;
    gap: 10px;
}

/* 按钮 */
.btn-primary,
.btn-success,
.btn-danger,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover {
    background: #49aa17;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ee3344;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* 商品列表 */
.toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.product-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    gap: 15px;
}

.product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    margin-bottom: 8px;
}

.product-price {
    color: #ff4757;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.product-stock {
    font-size: 14px;
    color: #999;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 表单 */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .logo h2,
    .nav-item span:not(.icon) {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

