/* ========== 全局样式 ========== */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light-bg: #f8fafc;
    --border: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
}

body {
    background-color: var(--light-bg);
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== 导航栏 ========== */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

.navbar-brand .brand-icon {
    color: #ffffff !important;
    text-shadow: none;
}

.search-box {
    max-width: 400px;
}

/* ========== 商品卡片 ========== */
.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

.product-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.product-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--danger);
}

.product-card .original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========== 徽章 ========== */
.badge-stock-ok { background-color: var(--success); }
.badge-stock-low { background-color: var(--warning); }
.badge-stock-out { background-color: var(--danger); }

.badge-status-pending { background-color: #94a3b8; }
.badge-status-paid { background-color: #3b82f6; }
.badge-status-shipped { background-color: #8b5cf6; }
.badge-status-completed { background-color: var(--success); }
.badge-status-cancelled { background-color: var(--danger); }

/* ========== 按钮 ========== */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ========== 管理后台侧边栏 ========== */
.admin-sidebar {
    min-height: calc(100vh - 56px);
    background: #1e293b;
}

.admin-sidebar .nav-link {
    color: #cbd5e1;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.2s;
}

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

.admin-sidebar .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.admin-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.admin-content {
    padding: 1.5rem;
}

/* ========== 统计卡片 ========== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ========== 表格 ========== */
.table {
    vertical-align: middle;
}

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

/* ========== 购物车 ========== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #f1f5f9;
}

.qty-input {
    width: 60px;
    text-align: center;
}

/* ========== 分页 ========== */
.pagination .page-link {
    color: var(--primary);
    border-radius: 6px;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ========== 其他 ========== */
.text-price {
    color: var(--danger);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
}

footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* 商品详情描述中的图片 */
.product-description img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px 0;
}

