/* ========================================
   进销存系统 - 样式表
   ======================================== */

:root {
    --primary: #4361ee;
    --success: #2ec4b6;
    --danger: #e71d36;
    --warning: #ff9f1c;
    --info: #4cc9f0;
}

body {
    background: #f5f6fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-bottom: 70px;
    -webkit-tap-highlight-color: transparent;
}

/* 统计卡片 */
.stat-card {
    border-radius: 12px;
    border-width: 2px;
    cursor: pointer;
    transition: all 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}
.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 2px;
}

/* 商品列表 */
.product-item {
    border-radius: 10px;
    margin-bottom: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}
.product-item:active {
    transform: scale(0.98);
    background: #f8f9fa;
}
.product-barcode {
    font-size: 0.7rem;
    color: #adb5bd;
    font-family: monospace;
}
.product-stock {
    font-weight: 700;
    font-size: 1.1rem;
}
.stock-low {
    color: #e71d36;
}
.stock-normal {
    color: #2ec4b6;
}

/* 底部导航 */
.navbar.fixed-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-link small {
    font-size: 0.65rem;
}

/* 扫码器 */
#reader {
    border-radius: 8px;
    overflow: hidden;
}
#reader video {
    border-radius: 8px;
}

/* 操作记录动画 */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-in {
    animation: slideIn 0.3s ease;
}

/* 扫描结果区域 */
.scan-product-name {
    font-size: 1.3rem;
    font-weight: 700;
}
.scan-product-stock {
    font-size: 2rem;
    font-weight: 800;
}

/* Toast 自定义 */
.toast-container {
    z-index: 9999;
}

/* 入库/出库标识 */
.badge-in {
    background: #d1fae5;
    color: #065f46;
}
.badge-out {
    background: #fee2e2;
    color: #991b1b;
}

/* 记录列表 */
.record-item {
    border-left: 3px solid transparent;
}
.record-item.record-in {
    border-left-color: #2ec4b6;
}
.record-item.record-out {
    border-left-color: #e71d36;
}

/* 适配深色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a2e;
        color: #e0e0e0;
    }
    .card {
        background: #16213e;
        border-color: #0f3460;
    }
    .list-group-item {
        background: #16213e;
        color: #e0e0e0;
        border-color: #0f3460;
    }
    .input-group-text,
    .form-control {
        background: #16213e;
        color: #e0e0e0;
        border-color: #0f3460;
    }
    .form-control:focus {
        background: #16213e;
        color: #e0e0e0;
    }
    .modal-content {
        background: #1a1a2e;
    }
    .navbar.fixed-bottom {
        background: #16213e !important;
        border-color: #0f3460 !important;
    }
    .nav-link {
        color: #adb5bd !important;
    }
    .nav-link.active {
        color: #4361ee !important;
    }
    .card-header {
        background: #0f3460 !important;
    }
    .text-muted {
        color: #adb5bd !important;
    }
    .product-barcode {
        color: #6c757d;
    }
    .modal-footer {
        border-top-color: #0f3460;
    }
    .modal-header {
        border-bottom-color: #0f3460;
    }
    .product-item {
        border-color: #0f3460;
    }
    .page-link {
        background: #16213e;
        border-color: #0f3460;
        color: #e0e0e0;
    }
    .page-item.active .page-link {
        background: #4361ee;
        border-color: #4361ee;
    }
}
