/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== 电脑版样式 (宽度 > 768px) ==================== */
@media screen and (min-width: 769px) {
    /* 导航栏 */
    .navbar {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 1rem 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-bottom: 30px;
    }
    
    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .navbar-brand {
        color: white;
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .navbar-menu {
        display: flex;
        gap: 20px;
        align-items: center;
    }
    
    .navbar-menu a {
        color: white;
        text-decoration: none;
        padding: 8px 15px;
        border-radius: 5px;
        transition: background-color 0.3s;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    .navbar-menu a:hover {
        background-color: rgba(255,255,255,0.2);
    }
    
    .navbar-menu .dropdown {
        position: relative;
        display: inline-block;
    }
    
    .dropdown-content {
        display: none;
        position: absolute;
        background-color: white;
        min-width: 160px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        border-radius: 5px;
        z-index: 1;
        top: 100%;
        left: 0;
    }
    
    .dropdown:hover .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        color: #333;
        padding: 12px 16px;
        display: block;
        border-radius: 0;
    }
    
    .dropdown-content a:hover {
        background-color: #f1f1f1;
    }
    
    /* 卡片样式 */
    .card {
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-bottom: 20px;
        overflow: hidden;
    }
    
    .card-header {
        padding: 20px;
        border-bottom: 1px solid #eee;
    }
    
    .card-header h4 {
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    /* 按钮样式 */
    .btn {
        display: inline-block;
        padding: 10px 20px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        text-decoration: none;
        font-size: 16px;
        transition: all 0.3s;
        margin: 5px;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }
    
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }
    
    .btn-success {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: white;
    }
    
    .btn-warning {
        background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
        color: white;
    }
    
    .btn-info {
        background: linear-gradient(135deg, #17a2b8 0%, #0dcaf0 100%);
        color: white;
    }
    
    .btn-secondary {
        background: #6c757d;
        color: white;
    }
    
    .btn-light {
        background: #f8f9fa;
        color: #333;
        border: 1px solid #ddd;
    }
    
    .btn-lg {
        padding: 15px 30px;
        font-size: 18px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 14px;
    }
    
    /* 表单样式 */
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
    }
    
    .form-control {
        width: 100%;
        padding: 12px;
        border: 2px solid #e1e1e1;
        border-radius: 8px;
        font-size: 16px;
        transition: border-color 0.3s;
    }
    
    .form-control:focus {
        outline: none;
        border-color: #667eea;
    }
    
    .form-text {
        font-size: 14px;
        color: #6c757d;
        margin-top: 5px;
    }
    
    .input-group {
        display: flex;
        gap: 10px;
    }
    
    .input-group .form-control {
        flex: 1;
    }
    
    .input-group .btn {
        margin: 0;
    }
    
    /* 表格样式 */
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        width: 100%;
        border-collapse: collapse;
    }
    
    .table th,
    .table td {
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #eee;
    }
    
    .table th {
        background-color: #f8f9fa;
        font-weight: 600;
    }
    
    .table tbody tr:hover {
        background-color: #f5f5f5;
    }
    
    /* 警告框样式 */
    .alert {
        padding: 15px 20px;
        border-radius: 8px;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .alert-success {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }
    
    .alert-danger {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }
    
    .alert-warning {
        background-color: #fff3cd;
        color: #856404;
        border: 1px solid #ffeeba;
    }
    
    .alert-info {
        background-color: #d1ecf1;
        color: #0c5460;
        border: 1px solid #bee5eb;
    }
    
    .close {
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        color: inherit;
    }
    
    /* 徽章样式 */
    .badge {
        display: inline-block;
        padding: 5px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
    }
    
    .bg-success {
        background-color: #28a745;
        color: white;
    }
    
    .bg-warning {
        background-color: #ffc107;
        color: #333;
    }
    
    .bg-danger {
        background-color: #dc3545;
        color: white;
    }
    
    .bg-info {
        background-color: #17a2b8;
        color: white;
    }
    
    /* 网格系统 */
    .row {
        display: flex;
        flex-wrap: wrap;
        margin: -10px;
    }
    
    .col-4 {
        flex: 0 0 33.333333%;
        padding: 10px;
    }
    
    .col-6 {
        flex: 0 0 50%;
        padding: 10px;
    }
    
    .col-8 {
        flex: 0 0 66.666667%;
        padding: 10px;
    }
    
    .col-12 {
        flex: 0 0 100%;
        padding: 10px;
    }
    
    /* 首页卡片 */
    .warehouse-card {
        transition: transform 0.3s;
        height: 100%;
    }
    
    .warehouse-card:hover {
        transform: translateY(-5px);
    }
    
    /* 条码样式 */
    code {
        background: #f1f1f1;
        padding: 3px 6px;
        border-radius: 4px;
        font-family: monospace;
        font-size: 14px;
        color: #d63384;
    }
    
    /* 隐藏手机版元素 */
    .mobile-only {
        display: none;
    }
}

/* ==================== 手机版样式 (宽度 ≤ 768px) ==================== */
@media screen and (max-width: 768px) {
    /* 隐藏电脑版导航栏 */
    .navbar {
        display: none;
    }
    
    /* 手机版顶部栏 */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 12px 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 999;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-sizing: border-box;
    }
    
    .mobile-header-title {
        font-size: 18px;
        font-weight: bold;
        color: white;
    }
    
    .mobile-header-title i {
        margin-right: 5px;
    }
    
    .mobile-header-actions {
        display: flex;
        gap: 10px;
    }
    
    .mobile-header-actions a {
        color: white;
        text-decoration: none;
        font-size: 13px;
        display: flex;
        align-items: center;
        gap: 3px;
        background: rgba(255,255,255,0.2);
        padding: 5px 10px;
        border-radius: 20px;
    }
    
    /* 手机版主要内容区域 */
    .mobile-content {
        margin-top: 70px;
        margin-bottom: 70px;
        padding: 15px;
    }
    
    /* 快速操作卡片 - 4个一排 */
    .mobile-quick-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .mobile-quick-action {
        flex: 1 1 calc(25% - 6px);
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 12px 0;
        border-radius: 8px;
        text-align: center;
        text-decoration: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 12px;
    }
    
    .mobile-quick-action i {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    /* 统计卡片 - 3个一排 */
    .mobile-cards {
        display: flex;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .mobile-card {
        flex: 1;
        background: white;
        border-radius: 8px;
        padding: 12px 0;
        text-align: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        text-decoration: none;
        color: #333;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .mobile-card i {
        font-size: 22px;
        margin-bottom: 5px;
        color: #667eea;
    }
    
    .mobile-card .title {
        font-size: 12px;
        font-weight: bold;
    }
    
    .mobile-card .count {
        font-size: 16px;
        font-weight: bold;
        color: #667eea;
    }
    
    .mobile-card .label {
        font-size: 10px;
        color: #999;
    }
    
    /* 列表样式 */
    .mobile-list {
        background: white;
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .mobile-list-item {
        padding: 15px;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-list-item:last-child {
        border-bottom: none;
    }
    
    .mobile-list-item-content {
        flex: 1;
    }
    
    .mobile-list-item-title {
        font-weight: bold;
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .mobile-list-item-subtitle {
        font-size: 12px;
        color: #999;
    }
    
    .mobile-list-item-actions {
        display: flex;
        gap: 12px;
    }
    
    .mobile-list-item-actions a {
        color: #667eea;
        font-size: 16px;
        text-decoration: none;
    }
    
    .mobile-list-item-badge {
        background: #667eea;
        color: white;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 11px;
        text-decoration: none;
        white-space: nowrap;
    }
    
    /* 按钮样式 */
    .mobile-btn {
        display: block;
        padding: 14px;
        border-radius: 8px;
        text-decoration: none;
        text-align: center;
        font-size: 15px;
        font-weight: bold;
        margin-bottom: 10px;
    }
    
    .mobile-btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }
    
    .mobile-btn-success {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: white;
    }
    
    .mobile-btn-warning {
        background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
        color: white;
    }

    .mobile-btn-secondary {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: white;
    }
    
    /* 底部导航栏 - 水平排列 */
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 8px 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 999;
        border-top: 1px solid #eee;
        height: 60px;
    }
    
    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #999;
        text-decoration: none;
        font-size: 11px;
        padding: 5px 0;
        height: 100%;
    }
    
    .mobile-nav-item i {
        font-size: 20px;
        margin-bottom: 3px;
    }
    
    .mobile-nav-item.active {
        color: #667eea;
    }
    
    .mobile-nav-item.active i {
        color: #667eea;
    }
    
    /* 表单样式 */
    .mobile-form-group {
        margin-bottom: 15px;
    }
    
    .mobile-form-label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
        font-size: 14px;
    }
    
    .mobile-form-control {
        width: 100%;
        padding: 12px;
        border: 2px solid #e1e1e1;
        border-radius: 8px;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    .mobile-form-control:focus {
        outline: none;
        border-color: #667eea;
    }
    
    .mobile-input-group {
        display: flex;
        gap: 8px;
    }
    
    .mobile-input-group .mobile-form-control {
        flex: 1;
    }
    
    .mobile-input-group .mobile-btn {
        margin: 0;
        padding: 12px 15px;
        width: auto;
    }
    
    /* 警告框 */
    .alert {
        padding: 12px 15px;
        border-radius: 8px;
        margin-bottom: 15px;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* 隐藏电脑版元素 */
    .desktop-only {
        display: none;
    }
}

/* ==================== 通用工具类 ==================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #6c757d;
}

.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }