        :root {
            --primary: #1e3a5f;
            --primary-light: #2c5282;
            --accent: #d4af37;
            --accent-light: #f0d78c;
            --success: #059669;
            --warning: #d97706;
            --danger: #dc2626;
            --info: #0891b2;
            --bg: #f1f5f9;
            --bg-tertiary: #f8fafc;
            --card: #ffffff;
            --text: #1e293b;
            --text-secondary: #64748b;
            --border: #e2e8f0;
            --shadow: 0 1px 3px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
            --radius: 12px;
            --radius-sm: 8px;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            min-height: 100vh;
        }

        /* 登录页 */
        .login-page {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            padding: 20px;
        }

        .login-box {
            background: var(--card);
            border-radius: var(--radius);
            padding: 40px;
            width: 100%;
            max-width: 420px;
            box-shadow: var(--shadow-lg);
        }

        .login-logo {
            text-align: center;
            margin-bottom: 30px;
        }

        .login-logo h1 {
            color: var(--primary);
            font-size: 28px;
            margin-bottom: 8px;
        }

        .login-logo p {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .form-group { margin-bottom: 20px; }

        .form-label {
            display: block;
            margin-bottom: 6px;
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
        }

        .form-control {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 14px;
            transition: all 0.2s;
            background: var(--card);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px 20px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover { background: var(--primary-light); }

        /* 密码输入框包裹 */
        .password-wrapper {
            position: relative;
        }
        .password-wrapper .form-control {
            padding-right: 44px;
        }
        .password-toggle {
            position: absolute;
            right: 2px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            font-size: 18px;
            padding: 8px 10px;
            color: var(--text-secondary);
            line-height: 1;
            transition: color 0.2s;
        }
        .password-toggle:hover {
            color: var(--primary);
        }

        /* 登录按钮loading态 */
        .btn-loading {
            pointer-events: none;
            opacity: 0.7;
            position: relative;
        }
        .btn-loading::after {
            content: '';
            display: inline-block;
            width: 14px;
            height: 14px;
            margin-left: 8px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: btn-spin 0.6s linear infinite;
            vertical-align: middle;
        }
        @keyframes btn-spin {
            to { transform: rotate(360deg); }
        }

        /* 账号管理密码显示按钮 */
        .pwd-show-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 14px;
            padding: 2px 4px;
            vertical-align: middle;
            opacity: 0.6;
            transition: opacity 0.2s;
        }
        .pwd-show-btn:hover {
            opacity: 1;
        }

        /* 侧边栏修改密码按钮 */
        .change-pwd-btn {
            background: rgba(255,255,255,0.08) !important;
            color: rgba(255,255,255,0.85) !important;
            margin-bottom: 6px;
            font-size: 13px !important;
            transition: all 0.2s;
        }
        .change-pwd-btn:hover {
            background: rgba(255,255,255,0.18) !important;
            color: #fff !important;
        }

        .btn-success { background: var(--success); color: white; }
        .btn-success:hover { background: #047857; }

        .btn-warning { background: var(--warning); color: white; }
        .btn-danger { background: var(--danger); color: white; }
        .btn-info { background: var(--info); color: white; }

        .btn-block { width: 100%; padding: 14px; font-size: 16px; }

        /* 主布局 */
        .app-container {
            display: none;
            min-height: 100vh;
        }

        .app-container.show { display: flex; }

        /* 侧边栏 */
        .sidebar {
            width: 260px;
            background: var(--primary);
            color: white;
            display: flex;
            flex-direction: column;
            position: fixed;
            height: 100vh;
            z-index: 100;
            transition: transform 0.3s;
        }

        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .sidebar-header h2 {
            font-size: 20px;
            margin-bottom: 4px;
        }

        .sidebar-header p {
            font-size: 12px;
            opacity: 0.7;
        }

        .nav-menu {
            flex: 1;
            padding: 16px 12px;
            overflow-y: auto;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 4px;
            font-size: 14px;
        }

        .nav-item:hover {
            background: rgba(255,255,255,0.1);
        }

        .nav-item.active {
            background: var(--accent);
            color: var(--primary);
            font-weight: 600;
        }

        .nav-icon { font-size: 18px; width: 24px; text-align: center; }

        .sidebar-footer {
            padding: 16px;
            border-top: 1px solid rgba(255,255,255,0.1);
            font-size: 12px;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            color: var(--primary);
        }

        .user-details { flex: 1; }

        .user-name { font-weight: 500; font-size: 13px; }

        .user-role { font-size: 11px; opacity: 0.7; }

        /* 主内容区 */
        .main-content {
            flex: 1;
            margin-left: 260px;
            padding: 24px;
            min-height: 100vh;
            position: relative;
            z-index: 1;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            position: relative;
            z-index: 10;
        }

        .page-title {
            font-size: 24px;
            font-weight: 700;
            color: var(--primary);
        }

        .page-actions {
            display: flex;
            gap: 10px;
        }

        /* 统计卡片 */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .stat-card {
            background: var(--card);
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow);
            transition: transform 0.2s;
        }

        .stat-card:hover { transform: translateY(-2px); }

        .stat-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            margin-bottom: 12px;
        }

        .stat-label {
            font-size: 13px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .stat-icon {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }

        .stat-icon.blue { background: #dbeafe; }
        .stat-icon.green { background: #d1fae5; }
        .stat-icon.yellow { background: #fef3c7; }
        .stat-icon.red { background: #fee2e2; }
.stat-icon.purple { background: #e9d5ff; }

        .stat-number {
            font-size: 28px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 4px;
        }

        .stat-change {
            font-size: 12px;
            color: var(--success);
            font-weight: 500;
        }

        .stat-change.negative { color: var(--danger); }

        /* 内容区块 */
        .section {
            background: var(--card);
            border-radius: var(--radius);
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: var(--shadow);
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .section-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--primary);
        }

        /* 表格 */
        .data-table {
            width: 100%;
            border-collapse: collapse;
        }

        .data-table th {
            background: var(--bg);
            padding: 12px 16px;
            text-align: left;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .data-table td {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
            font-size: 14px;
        }

        .data-table tr:hover { background: var(--bg); }

        .data-table tr:last-child td { border-bottom: none; }

        /* 订单管理卡片式行（与临期订单提醒统一边框风格） */
        #ordersDataTable.order-cards-table {
            border-collapse: separate;
            border-spacing: 0 6px;
        }
        #ordersDataTable.order-cards-table th {
            border-bottom: 2px solid var(--border);
        }
        #ordersDataTable.order-cards-table td {
            border-top: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            transition: all 0.2s;
        }
        #ordersDataTable.order-cards-table td:first-child {
            border-radius: 8px 0 0 8px;
        }
        #ordersDataTable.order-cards-table td:last-child {
            border-right: 1px solid var(--border);
            border-radius: 0 8px 8px 0;
        }
        #ordersDataTable.order-cards-table tr:hover td {
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            transform: translateX(3px);
        }
        #ordersDataTable.order-cards-table tr:hover td:first-child {
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        }

        /* 标签 */
        .badge {
            display: inline-flex;
            align-items: center;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }

        .badge-blue { background: #dbeafe; color: #1e40af; }
        .badge-green { background: #d1fae5; color: #065f46; }
        .badge-yellow { background: #fef3c7; color: #92400e; }
        .badge-red { background: #fee2e2; color: #991b1b; }
        .badge-purple { background: #f3e8ff; color: #6b21a8; }
        .badge-cyan { background: #cffafe; color: #0e7490; }
        /* 整行状态色 */
        .order-row-status-待生产 { background: #dbeafe !important; }
        .order-row-status-制作中 { background: #fef3c7 !important; }
        .order-row-status-待取货 { background: #f3e8ff !important; }
        .order-row-status-修改中 { background: #fed7aa !important; }
        .order-row-status-已借走 { background: #cffafe !important; }
        .order-row-status-已完成 { background: #ffffff !important; }
        .order-row-status-已借走 td:first-child { border-left: 3px solid #0891b2; }
        .order-row-status-待取货 td:first-child { border-left: 3px solid #6b21a8; }
        .badge-orange { background: #ffedd5; color: #9a3412; }
        .badge-cyan { background: #cffafe; color: #155e75; }
        .badge-order { background: #dbeafe; color: #1e40af; }
        .badge-inventory { background: #d1fae5; color: #065f46; }
        .badge-finance { background: #fef3c7; color: #92400e; }
        .badge-staff { background: #fce7f3; color: #9d174d; }
        .badge-anchor { background: #f3e8ff; color: #6b21a8; }
        .badge-account { background: #e0e7ff; color: #3730a3; }
        .badge-store { background: #ccfbf1; color: #0f766e; }
        .badge-login { background: #f1f5f9; color: #475569; }

        /* 库存明细快速+/-按钮 */
        .qty-adj-btn {
            width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border);
            background: #fff; color: var(--text); font-size: 14px; font-weight: 700;
            cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
            line-height: 1; padding: 0; transition: all 0.15s;
        }
        .qty-adj-btn:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
        .qty-adj-btn:active { transform: scale(0.9); }
        .qty-adj-btn:disabled { opacity: 0.35; cursor: not-allowed; background: #f3f4f6; border-color: #e5e7eb; color: #9ca3af; }
        .qty-minus { color: #dc2626; border-color: #fecaca; }
        .qty-minus:hover:not(:disabled) { background: #fef2f2; border-color: #dc2626; color: #dc2626; }
        .qty-plus { color: #22c55e; border-color: #bbf7d0; }
        .qty-plus:hover:not(:disabled) { background: #f0fdf4; border-color: #22c55e; color: #22c55e; }
        .badge-status-pending { background: #fef3c7; color: #92400e; font-weight: 600; }
        .badge-status-transferring { background: #dbeafe; color: #1e40af; font-weight: 600; }
        .badge-status-received { background: #d1fae5; color: #065f46; font-weight: 600; }
        .badge-status-completed { background: #e0e7ff; color: #3730a3; font-weight: 600; }
        .badge-status-rejected { background: #fee2e2; color: #991b1b; font-weight: 600; }

        .transfer-action-btn {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 4px 10px; border: none; border-radius: 6px;
            font-size: 11px; cursor: pointer; font-weight: 500;
            transition: all 0.2s;
        }
        .transfer-action-btn:hover { filter: brightness(0.92); transform: translateY(-1px); }
        .transfer-action-confirm { background: #059669; color: #fff; }
        .transfer-action-reject { background: #dc2626; color: #fff; }
        .transfer-action-receive { background: #0891b2; color: #fff; }
        .transfer-action-complete { background: #6b21a8; color: #fff; }
        .transfer-action-cancel { background: #9ca3af; color: #fff; }
        .transfer-action-delete { background: #dc2626; color: #fff; }

        /* 弹窗 */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .modal-overlay.show { display: flex; }

        .modal {
            background: var(--card);
            border-radius: var(--radius);
            width: 100%;
            max-width: 600px;
            max-height: 85vh;
            box-shadow: var(--shadow-lg);
            animation: modalSlide 0.3s ease;
            display: flex;
            flex-direction: column;
        }

        .modal-overlay.show .modal,
        .modal.show {
            display: flex;
        }

        .modal > .modal-content {
            background: var(--card);
            border-radius: var(--radius);
            width: 100%;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
            animation: modalSlide 0.3s ease;
            display: flex;
            flex-direction: column;
        }

        .modal-content {
            max-height: 85vh;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .modal-body {
            padding: 24px;
            overflow-y: auto;
            flex: 1;
            min-height: 0;
        }

        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            flex-shrink: 0;
        }

        @keyframes modalSlide {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .modal-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-title { font-size: 18px; font-weight: 600; }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: var(--text-secondary);
        }

        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        /* 表单布局 */
        .form-row {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
            margin-bottom: 16px;
        }

        .form-group { margin-bottom: 16px; }

        .form-group:last-child { margin-bottom: 0; }

        /* 搜索和筛选 */
        .toolbar {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .search-box {
            position: relative;
            flex: 1;
            min-width: 200px;
        }

        .search-box input {
            width: 100%;
            padding-left: 40px;
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
        }

        /* 页面切换 */
        .page { display: none; }
        .page.active { display: block; }

        /* 响应式 */
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar.open { transform: translateX(0); }

            .main-content { margin-left: 0; }

            .stats-grid { grid-template-columns: 1fr; }

            .form-row { grid-template-columns: 1fr; }

            .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
        }

        /* 动画 */
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .fade-in { animation: fadeIn 0.3s ease; }

        /* 加载状态 */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid var(--border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* 空状态 */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-secondary);
        }

        .empty-state-icon {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        /* Toast */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 2000;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .toast {
            background: var(--card);
            border-radius: var(--radius-sm);
            padding: 14px 20px;
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: 10px;
            animation: slideIn 0.3s ease;
            min-width: 280px;
        }

        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        .toast-success { border-left: 4px solid var(--success); }
        .toast-error { border-left: 4px solid var(--danger); }
        .toast-warning { border-left: 4px solid var(--warning); }

        /* 进度条 */
        .progress-bar {
            height: 8px;
            background: var(--border);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 4px;
            transition: width 0.3s ease;
        }

        /* 门店标签 */
        .store-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .store-tab {
            padding: 8px 16px;
            border-radius: var(--radius-sm);
            background: var(--bg);
            border: none;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .store-tab:hover { background: var(--border); }

        .store-tab.active {
            background: var(--primary);
            color: white;
        }

        /* 移动端菜单按钮 */
        .mobile-menu-btn {
            display: none;
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 101;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--primary);
            color: white;
            border: none;
            font-size: 20px;
            cursor: pointer;
        }

        @media (max-width: 768px) {
            .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
        }

        /* 分页样式 */
        .pagination-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 6px;
            margin-top: 16px;
            padding: 12px 0;
            flex-wrap: wrap;
        }
        .pagination-wrapper .page-btn {
            min-width: 36px;
            height: 36px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--card);
            color: var(--text-primary);
            cursor: pointer;
            font-size: 14px;
            padding: 0 8px;
            transition: all 0.2s;
        }
        .pagination-wrapper .page-btn:hover:not(:disabled) {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }
        .pagination-wrapper .page-btn.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
            font-weight: 600;
        }
        .pagination-wrapper .page-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .pagination-info {
            font-size: 13px;
            color: var(--text-secondary);
            margin-right: 12px;
        }
        /* 禁止 number 输入框鼠标滚轮改变数值 */
        input[type=number] { -moz-appearance: textfield; }
        input[type=number]::-webkit-outer-spin-button,
        input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
