/**
 * 库存盘点差异管理系统 - 自定义样式
 * Modern UI with clean design
 */

/* ==================== 变量定义 ==================== */
:root {
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --success-color: #10B981;
    --success-light: #D1FAE5;
    --warning-color: #F59E0B;
    --warning-light: #FEF3C7;
    --danger-color: #EF4444;
    --danger-light: #FEE2E2;
    --info-color: #3B82F6;
    --info-light: #DBEAFE;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s ease-in-out;
}

/* ==================== 基础样式 ==================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== 布局 ==================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.9375rem;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: var(--primary-color);
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

.nav-section-title {
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-wrapper {
    padding: 1.5rem;
}

/* ==================== 卡片 ==================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: none;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

/* ==================== 统计卡片 ==================== */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: var(--info-light); color: var(--primary-color); }
.stat-icon.success { background: var(--success-light); color: var(--success-color); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning-color); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger-color); }
.stat-icon.info { background: var(--info-light); color: var(--info-color); }

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--gray-800);
}

.stat-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-secondary {
    background-color: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ==================== 表格 ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: white;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead th {
    background: var(--gray-50);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 差异状态行颜色 */
.table .row-profit { background-color: rgba(16, 185, 129, 0.08); }
.table .row-loss { background-color: rgba(239, 68, 68, 0.08); }
.table .row-missing { background-color: rgba(245, 158, 11, 0.08); }
.table .row-extra { background-color: rgba(245, 158, 11, 0.08); }

.table .row-profit:hover { background-color: rgba(16, 185, 129, 0.15); }
.table .row-loss:hover { background-color: rgba(239, 68, 68, 0.15); }
.table .row-missing:hover { background-color: rgba(245, 158, 11, 0.15); }
.table .row-extra:hover { background-color: rgba(245, 158, 11, 0.15); }

/* ==================== 徽章 ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success { background-color: var(--success-light); color: var(--success-color); }
.badge-warning { background-color: var(--warning-light); color: var(--warning-color); }
.badge-danger { background-color: var(--danger-light); color: var(--danger-color); }
.badge-info { background-color: var(--info-light); color: var(--info-color); }
.badge-primary { background-color: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.badge-gray { background-color: var(--gray-100); color: var(--gray-600); }

/* ==================== 模态框 ==================== */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.modal-title {
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    gap: 0.5rem;
}

/* ==================== 公告区域 ==================== */
.announcement-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.announcement-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.announcement-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.announcement-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.announcement-meta {
    font-size: 0.75rem;
    opacity: 0.8;
}

.announcement-content {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ==================== 文件上传区域 ==================== */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-50);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.upload-zone i {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.upload-zone p {
    margin: 0;
    color: var(--gray-600);
}

.upload-zone .hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
}

/* ==================== 分页 ==================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.pagination {
    display: flex;
    gap: 0.25rem;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-link:hover {
    background-color: var(--gray-100);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== 搜索框 ==================== */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* ==================== 功能按钮组 ==================== */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==================== 登录页面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 50%, var(--primary-dark) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2.5rem;
    text-align: center;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.login-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

.login-body {
    padding: 2.5rem;
}

.login-footer {
    padding: 1.5rem 2.5rem;
    background: var(--gray-50);
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin-right: 0.5rem;
    color: var(--gray-400);
}

.breadcrumb-item a {
    color: var(--gray-500);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--gray-700);
    font-weight: 500;
}

/* ==================== 步骤指示器 ==================== */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    align-items: center;
}

.step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step-item.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step-item.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--gray-800);
    font-weight: 500;
}

.step-connector {
    width: 4rem;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.5rem;
}

.step-item.completed + .step-connector {
    background: var(--success-color);
}

/* ==================== 工具提示 ==================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    background: var(--gray-800);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ==================== Toast提示 ==================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }
.toast.info { border-left: 4px solid var(--info-color); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h4 {
    font-size: 1.125rem;
    color: var(--gray-700);
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* ==================== 加载状态 ==================== */
.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* ==================== 响应式 ==================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
}

/* ==================== 辅助类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.w-100 { width: 100%; }

/* ==================== 差异状态特殊样式 ==================== */
.diff-profit { color: var(--success-color); font-weight: 600; }
.diff-loss { color: var(--danger-color); font-weight: 600; }
.diff-missing { color: var(--warning-color); font-weight: 600; }
.diff-extra { color: var(--warning-color); font-weight: 600; }
.diff-none { color: var(--gray-500); }

/* ==================== 重置密码页面 ==================== */
.reset-password-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.reset-password-card {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
}

.reset-password-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.reset-password-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* ==================== 侧边栏收起/展开 ==================== */
.sidebar.collapsed {
    width: 70px;
}
.sidebar.collapsed .sidebar-brand h1,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-link span {
    display: none;
}
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}
.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}
.sidebar.collapsed .sidebar-brand {
    padding: 1rem;
    text-align: center;
}

.main-content {
    margin-left: 260px;
    transition: margin-left 0.3s ease;
}
.main-content.expanded {
    margin-left: 70px;
}

/* 移动端样式 */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 1050;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar.collapsed {
        width: 260px;
    }
    .sidebar.collapsed .sidebar-brand h1,
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .nav-link span {
        display: inline;
    }
    .sidebar.collapsed .nav-link {
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
    .sidebar.collapsed .nav-link i {
        margin-right: 0.75rem;
    }
    .main-content {
        margin-left: 0;
    }
    .main-content.expanded {
        margin-left: 0;
    }
    .mobile-header {
        display: flex !important;
    }
}

.mobile-header {
    display: none;
    background: white;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
}
.sidebar-overlay.show {
    display: block;
}

.toggle-sidebar-btn {
    position: fixed;
    left: 260px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
    width: 20px;
    height: 60px;
    background: var(--gray-800);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease, background 0.2s;
}
.toggle-sidebar-btn:hover {
    background: var(--primary-color);
}
.toggle-sidebar-btn.collapsed {
    left: 70px;
}
@media (max-width: 991.98px) {
    .toggle-sidebar-btn {
        left: 0;
        top: auto;
        bottom: 1rem;
        transform: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        box-shadow: var(--shadow-lg);
    }
    .toggle-sidebar-btn.collapsed {
        left: 0;
    }
}

/* ==================== 增强移动端适配 ==================== */
@media (max-width: 767.98px) {
    /* 基础字体缩放 */
    html {
        font-size: 14px;
    }
    
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* 表格横向滚动 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.375rem;
        white-space: nowrap;
    }
    
    .table td small {
        font-size: 11px;
    }
    
    /* 卡片优化 */
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
    }
    
    /* 表单优化 */
    .form-label {
        font-size: 13px;
    }
    
    .form-control {
        font-size: 14px;
        padding: 0.5rem 0.75rem;
    }
    
    /* 按钮优化 */
    .btn {
        font-size: 13px;
        padding: 0.4rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 12px;
        padding: 0.3rem 0.5rem;
    }
    
    /* 徽章优化 */
    .badge {
        font-size: 10px;
        padding: 0.15rem 0.4rem;
    }
    
    /* 统计卡片 */
    .stat-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .stat-info h3 {
        font-size: 1.25rem;
    }
    
    .stat-info p {
        font-size: 11px;
    }
    
    /* 顶部栏 */
    .top-bar {
        padding: 0.75rem 1rem;
    }
    
    .top-bar h4 {
        font-size: 1rem;
    }
    
    /* 搜索框 */
    .search-box {
        max-width: 100%;
    }
    
    /* 分页 */
    .pagination-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination-info {
        font-size: 12px;
    }
    
    /* 模态框 */
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    /* 上传区域 */
    .upload-zone {
        padding: 1rem;
    }
    
    .upload-zone i {
        font-size: 1.5rem;
    }
    
    /* 公告区域 */
    .announcement-bar {
        padding: 0.75rem;
    }
    
    .announcement-title {
        font-size: 13px;
    }
    
    .announcement-content {
        font-size: 12px;
    }
    
    /* 操作按钮组 */
    .action-buttons {
        gap: 0.5rem;
    }
    
    /* 筛选表单 */
    .row.g-3 > div {
        margin-bottom: 0.5rem;
    }
    
    /* 输入组优化 */
    .input-group {
        font-size: 14px;
    }
    
    /* 下拉选择 */
    select.form-control {
        font-size: 14px;
    }
    
    /* 步骤指示器 */
    .step-indicator {
        margin-bottom: 1rem;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    /* 差异数字 */
    .diff-profit, .diff-loss, .diff-missing, .diff-extra {
        font-size: 12px;
    }
}

/* 极小屏幕 */
@media (max-width: 375px) {
    html {
        font-size: 12px;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.4rem 0.25rem;
    }
}
