        /* ========== 全局样式（来自您原有的 style.css） ========== */
        :root {
            --primary: #FF8C2F;
            --primary-soft: #FFA559;
            --primary-bg: #FFF3E9;
            --primary-glow: rgba(255, 140, 47, 0.18);
            --accent: #F59E0B;
            --success: #10B981;
            --success-bg: #ECFDF5;
            --danger: #EF4444;
            --danger-bg: #FEF2F2;
            --warning: #F59E0B;
            --warning-bg: #FEF3C7;
            --bg: #F5F5F5;
            --card: #FFFFFF;
            --card-alt: #FFFFFF;
            --text: #1F1F1F;
            --text-secondary: #6B7280;
            --text-muted: #9CA3AF;
            --border: #E5E9F0;
            --border-light: #F0F0F0;
            --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
            --radius-xs: 8px;
            --radius-sm: 12px;
            --radius: 16px;
            --radius-lg: 20px;
            --radius-xl: 24px;
            --radius-full: 9999px;
            --safe-bottom: env(safe-area-inset-bottom, 16px);
            --nav-height: 68px;
            --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
            --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
            -webkit-font-smoothing: antialiased;
        }

        html, body {
            height: 100%;
            overflow: hidden;
            background: #f5f5f5;
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
            color: var(--text);
            user-select: none;
        }

        #app {
            height: 100%;
            width: 100%;
            max-width: 440px;
            margin: 0 auto;
            position: relative;
            background: var(--bg);
            overflow: hidden;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
        }

        @media (min-width: 441px) {
            #app {
                border-radius: 36px;
                margin-top: 16px;
                height: calc(100% - 32px);
                border: 1px solid #e0e0e0;
            }
        }

        .app-container {
            display: flex;
            flex-direction: column;
            height: 100%;
            background: var(--bg);
            overflow: hidden;
        }

        .scroll-area {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 6px 12px calc(var(--nav-height) + 16px) 12px;
            -webkit-overflow-scrolling: touch;
            scroll-behavior: smooth;
        }

        .scroll-area::-webkit-scrollbar {
            width: 0;
            height: 0;
        }

        .scroll-area > div {
            animation: pageEnter 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        }

        @keyframes pageEnter {
            from {
                opacity: 0;
                transform: translateY(16px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .card {
            background: var(--card);
            border-radius: var(--radius-lg);
            padding: 18px 16px;
            margin-bottom: 12px;
            box-shadow: var(--shadow-xs);
            border: 0.5px solid var(--border-light);
            transition: box-shadow var(--transition);
        }

        .top-gradient {
            background: linear-gradient(135deg, #FFF8F2 0%, #FFFFFF 100%);
            border-radius: 20px;
            padding: 12px 16px;
            margin-bottom: 12px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: transparent;
        }

        .page-header h2 {
            font-size: 26px;
            font-weight: 800;
            letter-spacing: -0.6px;
            color: var(--text);
        }

        .page-header span {
            font-size: 12px;
            color: var(--primary);
            background: var(--primary-bg);
            padding: 6px 14px;
            border-radius: var(--radius-full);
            font-weight: 600;
        }

        .back-header {
            display: flex;
            align-items: center;
            gap: 12px;
            background: transparent;
        }

        .back-btn {
            width: 36px;
            height: 36px;
            background: var(--card);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            cursor: pointer;
            box-shadow: var(--shadow-xs);
            border: 0.5px solid var(--border);
            transition: all var(--transition-fast);
            font-weight: 700;
        }

        .back-btn:active {
            transform: scale(0.9);
            background: #f3f4f6;
        }

        .btn-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
            margin-bottom: 14px;
        }

        .func-btn {
            background: var(--card);
            border: 0.5px solid var(--border-light);
            padding: 16px 6px 12px 6px;
            border-radius: var(--radius-lg);
            text-align: center;
            font-weight: 600;
            font-size: 12px;
            cursor: pointer;
            transition: all var(--transition);
            box-shadow: var(--shadow-xs);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            position: relative;
            overflow: hidden;
        }

        .func-btn:active {
            transform: scale(0.94);
            box-shadow: var(--shadow-md);
            border-color: var(--primary-soft);
        }

        .func-btn .emoji {
            font-size: 28px;
            line-height: 1;
            transition: transform var(--transition);
        }

        .func-btn:active .emoji {
            transform: scale(1.12) translateY(-2px);
        }

        .section-title {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 14px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: var(--text);
        }

        .record-card {
            background: #FFFFFF;
            border-radius: var(--radius);
            padding: 14px;
            margin-bottom: 8px;
            border: 0.5px solid var(--border-light);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
            transition: all var(--transition-fast);
        }

        .record-card:last-child {
            margin-bottom: 0;
        }

        .record-item-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            font-size: 13px;
            padding: 6px 0;
            border-bottom: 0.5px dashed var(--border-light);
        }

        .record-item-row:last-child {
            border-bottom: none;
        }

        .record-label {
            color: var(--text-secondary);
            font-weight: 500;
            flex-shrink: 0;
        }

        .record-value {
            font-weight: 600;
            color: var(--text);
            text-align: right;
            flex: 1;
            word-break: break-word;
        }

        .badge {
            background: var(--primary-bg);
            color: var(--primary);
            border-radius: var(--radius-full);
            padding: 4px 12px;
            font-size: 10.5px;
            font-weight: 700;
            display: inline-block;
        }

        .empty-state {
            text-align: center;
            padding: 36px 20px;
            color: var(--text-muted);
            background: #FAFBFC;
            border-radius: var(--radius-lg);
            font-size: 13px;
            font-weight: 500;
            border: 1.5px dashed #e5e7eb;
        }

        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 440px;
            background: rgba(255, 255, 255, 0.96);
            backdrop-filter: blur(20px);
            display: flex;
            justify-content: space-around;
            padding: 8px 16px calc(8px + var(--safe-bottom));
            border-top: 0.5px solid rgba(0, 0, 0, 0.05);
            z-index: 20;
            border-radius: 20px 20px 0 0;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            font-size: 10px;
            color: var(--text-muted);
            cursor: pointer;
            padding: 5px 14px;
            border-radius: var(--radius-full);
            transition: all var(--transition);
            font-weight: 500;
        }

        .nav-item.active {
            color: var(--primary);
            font-weight: 700;
        }

        .nav-item:active {
            transform: scale(0.88);
        }

        .nav-icon {
            font-size: 20px;
        }

        .form-input,
        .form-select {
            width: 100%;
            padding: 12px 16px;
            border-radius: var(--radius-sm);
            border: 1.5px solid #e8e9ee;
            font-size: 14px;
            background: #F9FAFB;
            transition: all var(--transition);
            color: var(--text);
            outline: none;
        }

        .form-input:focus {
            border-color: var(--primary);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(255, 140, 47, 0.1);
        }

        .btn-primary {
            background: var(--primary);
            border: none;
            padding: 12px 18px;
            border-radius: var(--radius-sm);
            color: white;
            font-weight: 700;
            cursor: pointer;
            font-size: 14px;
            transition: all var(--transition-fast);
            box-shadow: 0 2px 8px rgba(255, 140, 47, 0.25);
        }

        .btn-primary:active {
            transform: scale(0.94);
            background: #E57A1A;
        }

        .btn-primary:disabled {
            opacity: 0.6;
            transform: none;
            cursor: not-allowed;
        }

        .btn-secondary {
            background: #F3F4F6;
            border: none;
            padding: 12px 18px;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            font-size: 14px;
            color: #4B5563;
            transition: all var(--transition-fast);
        }

        .btn-secondary:active {
            background: #e5e7eb;
            transform: scale(0.94);
        }

        .demo-btn {
            background: var(--primary-bg);
            border: none;
            padding: 10px 14px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: var(--primary);
            width: 100%;
            cursor: pointer;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
        }

        .form-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            margin-top: 12px;
        }

        .scan-icon-btn {
            background: var(--primary-bg);
            border: none;
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            cursor: pointer;
            color: var(--primary);
            transition: all var(--transition-fast);
            flex-shrink: 0;
        }

        .scan-icon-btn:active {
            transform: scale(0.9);
        }

        .flex-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .btn-delete-rounded {
            background: var(--danger-bg);
            border: 1px solid #FEE2E2;
            color: var(--danger);
            border-radius: 40px;
            padding: 8px 24px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: all var(--transition-fast);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            backdrop-filter: blur(2px);
            letter-spacing: 0.3px;
        }

        .btn-delete-rounded:active {
            transform: scale(0.94);
            background: #FEE2E2;
            color: #DC2626;
        }

        .batch-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin: 8px 0 16px 0;
        }

        .batch-card {
            background: #FFFFFF;
            border-radius: 20px;
            padding: 14px 16px;
            border: 1.5px solid var(--border-light);
            transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
            cursor: pointer;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
        }

        .batch-card:active {
            transform: scale(0.98);
            background: #FAFBFD;
        }

        .batch-card.active {
            background: linear-gradient(135deg, #FFF8F2 0%, #FFF3E9 100%);
            border-color: var(--primary);
            box-shadow: 0 4px 12px rgba(255, 140, 47, 0.12);
        }

        .batch-card.disabled {
            opacity: 0.55;
            background: #F9FAFB;
            filter: grayscale(0.04);
            cursor: not-allowed;
        }

        .batch-card.disabled:active {
            transform: none;
        }

        .batch-info {
            flex: 1;
        }

        .batch-drug-name {
            font-weight: 800;
            font-size: 16px;
            color: var(--text);
            margin-bottom: 8px;
            letter-spacing: -0.2px;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .batch-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 8px;
            font-size: 12.5px;
            color: var(--text-secondary);
        }

        .batch-meta span {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: #F3F4F6;
            padding: 4px 10px;
            border-radius: 40px;
            font-weight: 500;
        }

        .batch-stock {
            display: flex;
            align-items: baseline;
            gap: 8px;
            margin-top: 6px;
        }

        .stock-number {
            font-size: 18px;
            font-weight: 800;
            color: var(--primary);
        }

        .stock-unit {
            font-size: 12px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .batch-check-icon {
            width: 26px;
            height: 26px;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: 800;
            color: var(--primary);
            border: 2px solid var(--border);
            transition: all 0.2s ease;
            flex-shrink: 0;
            margin-left: 12px;
        }

        .batch-card.active .batch-check-icon {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
            box-shadow: 0 0 0 3px rgba(255, 140, 47, 0.2);
        }

        .batch-badge-expiry {
            background: #FEF3C7;
            color: #B45309;
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 40px;
            font-weight: 700;
        }

        .supplier-card {
            background: #F9FAFB;
            border-radius: var(--radius-sm);
            padding: 12px 14px;
            margin-bottom: 8px;
            border: 1px solid var(--border-light);
            transition: all 0.15s ease;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .supplier-card:active {
            transform: scale(0.98);
            background: #F3F4F6;
        }

        .supplier-card.supplier-selected {
            background: var(--primary-bg);
            border-color: var(--primary-soft);
            box-shadow: 0 2px 8px rgba(255, 140, 47, 0.1);
        }

        .supplier-radio {
            width: 20px;
            height: 20px;
            accent-color: var(--primary);
            margin: 0;
            flex-shrink: 0;
            pointer-events: none;
        }

        .supplier-info {
            flex: 1;
        }

        .supplier-name {
            font-weight: 700;
            font-size: 15px;
            color: var(--text);
            margin-bottom: 4px;
        }

        .supplier-contact {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .modal-mask {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            z-index: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.2s ease;
        }

        .modal-container {
            background: white;
            border-radius: 32px;
            width: 300px;
            max-width: 85%;
            padding: 24px 20px 20px;
            box-shadow: 0 30px 40px -20px rgba(0, 0, 0, 0.4);
            animation: modalPop 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        }

        .modal-title {
            font-size: 20px;
            font-weight: 800;
            text-align: center;
            margin-bottom: 18px;
            color: var(--text);
        }

        .modal-input {
            width: 100%;
            padding: 12px 14px;
            border-radius: 14px;
            border: 1.5px solid #e8e9ee;
            margin-bottom: 14px;
            font-size: 14px;
            background: #F9FAFB;
            transition: all 0.2s;
        }

        .modal-input:focus {
            border-color: var(--primary);
            outline: none;
            background: white;
        }

        .modal-actions {
            display: flex;
            gap: 10px;
            margin-top: 8px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px 0;
            border-radius: 40px;
            font-weight: 700;
            font-size: 15px;
            border: none;
            cursor: pointer;
            transition: all 0.12s linear;
        }

        .modal-btn.cancel {
            background: #F3F4F6;
            color: #4B5563;
        }

        .modal-btn.confirm {
            background: var(--primary);
            color: white;
        }

        .modal-btn:active {
            transform: scale(0.96);
        }

        @keyframes modalPop {
            from {
                opacity: 0;
                transform: scale(0.92);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .scan-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(12px);
            z-index: 300;
            display: flex;
            align-items: stretch;
            justify-content: center;
        }

        .scan-container {
            background: #000;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .scanner-header {
            padding: 14px 18px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: white;
            background: rgba(10, 10, 10, 0.85);
            backdrop-filter: blur(10px);
        }

        .close-scan {
            background: rgba(255, 255, 255, 0.2);
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            cursor: pointer;
        }

        #qr-reader {
            width: 100%;
            flex: 1;
            background: #000;
        }

        .scan-tip {
            text-align: center;
            padding: 14px;
            color: #aaa;
            background: rgba(0, 0, 0, 0.8);
            font-size: 12px;
        }

        .manual-scan-area {
            background: #1a1a1a;
            padding: 22px;
            border-radius: var(--radius-lg);
            margin: 18px;
            color: white;
            text-align: center;
        }

        .toast {
            position: fixed;
            top: 44px;
            left: 50%;
            transform: translateX(-50%) translateY(-120px);
            background: #1F2937;
            color: white;
            padding: 10px 20px;
            border-radius: var(--radius-full);
            font-size: 12.5px;
            z-index: 1000;
            transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
            pointer-events: none;
            white-space: nowrap;
            max-width: 82%;
            text-align: center;
            font-weight: 500;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
        }

        .toast.show {
            transform: translateX(-50%) translateY(0);
        }

        .confirm-modal-mask {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(6px);
            z-index: 400;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .confirm-modal-container {
            background: white;
            border-radius: 32px;
            width: 280px;
            max-width: 80%;
            padding: 24px 20px 20px;
            text-align: center;
            box-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.4);
            animation: modalPop 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        }

        .confirm-modal-icon {
            font-size: 44px;
            margin-bottom: 12px;
        }

        .confirm-modal-message {
            font-size: 17px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 24px;
            line-height: 1.4;
        }

        .confirm-modal-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        .confirm-modal-btn {
            flex: 1;
            padding: 10px 0;
            border-radius: 60px;
            font-weight: 700;
            font-size: 15px;
            border: none;
            cursor: pointer;
        }

        .confirm-modal-btn.cancel {
            background: #F3F4F6;
            color: #4B5563;
        }

        .confirm-modal-btn.confirm {
            background: var(--danger);
            color: white;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
        }

        .confirm-modal-btn:active {
            transform: scale(0.96);
        }

        .vip-card {
            background: linear-gradient(135deg, #FFFFFF 0%, #FFF9F2 100%);
            border-radius: 28px;
            padding: 20px 18px;
            margin-bottom: 16px;
            border: 1px solid rgba(255, 140, 47, 0.25);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
        }

        .vip-card.vip-warning {
            background: linear-gradient(135deg, #FFFBF5, #FFF7ED);
            border-color: #F59E0B80;
        }

        .vip-card.vip-expired {
            background: linear-gradient(135deg, #FFF5F5, #FFEBEB);
            border-color: #EF444480;
        }

        .vip-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .vip-avatar {
            width: 56px;
            height: 56px;
            background: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            color: white;
        }

        .vip-info {
            flex: 1;
        }

        .vip-name {
            font-size: 18px;
            font-weight: 800;
            color: var(--text);
        }

        .vip-phone {
            font-size: 12px;
            color: var(--primary);
            margin-top: 2px;
        }

        .vip-days {
            text-align: right;
            background: rgba(255, 140, 47, 0.1);
            padding: 6px 12px;
            border-radius: 40px;
        }

        .vip-days-number {
            font-size: 24px;
            font-weight: 800;
            color: var(--primary);
        }

        .vip-days-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--primary);
            margin-left: 4px;
        }

        .vip-footer {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            margin-top: 8px;
            padding-top: 8px;
            border-top: 0.5px dashed #eee;
            font-size: 12px;
        }

        .vip-expiry {
            color: var(--text-secondary);
        }

        .vip-status span {
            font-weight: 700;
            background: #F3F4F6;
            padding: 2px 10px;
            border-radius: 40px;
        }

        .vip-tip {
            margin-top: 12px;
            background: #FFF3E9;
            padding: 8px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            color: #B45309;
            text-align: center;
        }

        .flex-stats {
            display: flex;
            justify-content: space-between;
            margin: 8px 0;
            gap: 12px;
            text-align: center;
        }

        .flex-stats>div {
            flex: 1;
            background: #FAFBFC;
            border-radius: var(--radius);
            padding: 14px 6px;
            border: 0.5px solid var(--border-light);
        }

        .stat-number {
            font-size: 30px;
            font-weight: 800;
            color: var(--primary);
            letter-spacing: -1px;
        }

        .license-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .license-item {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            font-size: 13px;
            padding: 6px 0;
            border-bottom: 0.5px dashed var(--border-light);
        }

        .license-label {
            color: var(--text-secondary);
            width: 100px;
            flex-shrink: 0;
        }

        .license-value {
            font-weight: 500;
            text-align: right;
            color: var(--text);
        }

        .training-progress {
            background: #F5F5F5;
            border-radius: var(--radius-sm);
            padding: 8px 12px;
            margin: 8px 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 13px;
        }

        .progress-text {
            font-weight: 700;
            color: var(--success);
        }

        .status-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 40px;
            font-size: 11px;
            font-weight: 700;
        }

        .status-approved {
            background: #ECFDF5;
            color: #0B5E42;
        }

        .status-pending {
            background: #FEF3C7;
            color: #B45309;
        }

        .status-rejected {
            background: #FEF2F2;
            color: #B91C1C;
        }

        .status-none {
            background: #F3F4F6;
            color: #6B7280;
        }

        .cert-action-btn {
            background: var(--primary-bg);
            border: none;
            padding: 8px 16px;
            border-radius: 40px;
            font-size: 12px;
            font-weight: 700;
            color: var(--primary);
            cursor: pointer;
            margin-top: 12px;
            width: 100%;
            transition: 0.1s;
        }

        .cert-action-btn:active {
            transform: scale(0.96);
        }

        .image-preview {
            width: 100%;
            max-height: 120px;
            object-fit: contain;
            margin-top: 8px;
            border-radius: 12px;
            border: 1px solid #eee;
        }

        .upload-btn {
            background: #F3F4F6;
            border: 1px dashed #ccc;
            padding: 8px;
            border-radius: 40px;
            font-size: 12px;
            text-align: center;
            margin-bottom: 12px;
            cursor: pointer;
        }

        .reject-reason {
            font-size: 11px;
            color: var(--danger);
            margin-top: 6px;
            background: #FEF2F2;
            padding: 6px 10px;
            border-radius: 12px;
        }

        .validity-alert {
            background: #FFFBEB;
            border-radius: var(--radius);
            padding: 10px 12px;
            margin-top: 12px;
            font-size: 12.5px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            color: #B45309;
            border-left: 3px solid var(--warning);
        }

        .validity-alert.expired {
            background: #FEF2F2;
            color: #B91C1C;
            border-left-color: var(--danger);
        }

        .auth-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: white;
            z-index: 1200;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 20px;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #eee;
            border-top-color: #FF8C2F;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .modal-textarea {
            width: 100%;
            padding: 10px;
            border-radius: 14px;
            border: 1px solid #e8e9ee;
            background: #F9FAFB;
            font-family: inherit;
        }

        .image-preview img {
            width: 100%;
            max-height: 100px;
            object-fit: contain;
            border-radius: 12px;
        }

        .form-group {
            margin-bottom: 14px;
        }

        .form-label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

        .form-label.required::after {
            content: "*";
            color: var(--danger);
            margin-left: 4px;
        }

        /* ========== 新增样式（出库扫码暂存 & 批次弹窗） ========== */
        .scan-outbound-area {
            background: #f8fafc;
            border-radius: 20px;
            padding: 20px 16px;
            margin-bottom: 16px;
            border: 2px dashed #d1d5db;
            transition: all 0.2s;
        }
        .scan-outbound-area.scan-active {
            border-color: var(--primary);
            background: var(--primary-bg);
        }
        .scan-btn-large {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            width: 100%;
            padding: 18px 0;
            background: var(--primary);
            color: #fff;
            border: none;
            border-radius: 16px;
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
            box-shadow: 0 4px 12px rgba(255, 140, 47, 0.30);
        }
        .scan-btn-large:active {
            transform: scale(0.97);
            background: #E57A1A;
        }
        .scan-btn-large:disabled {
            background: #9ca3af;
            cursor: not-allowed;
            box-shadow: none;
        }
        .scan-btn-large .scan-icon {
            font-size: 28px;
        }

        .outbound-pending-list {
            margin-top: 12px;
        }
        .outbound-pending-item {
            background: #ffffff;
            border-radius: 14px;
            padding: 14px 16px;
            margin-bottom: 10px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-left: 4px solid #f59e0b;
            animation: slideIn 0.3s ease;
        }
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateX(-20px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        .outbound-pending-info {
            flex: 1;
            min-width: 0;
        }
        .outbound-pending-info .record-main {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .outbound-pending-info .record-main .drug-name {
            font-weight: 600;
            color: #1f2937;
            font-size: 15px;
        }
        .outbound-pending-info .record-main .reg-no {
            font-size: 12px;
            color: #6b7280;
            background: #f3f4f6;
            padding: 2px 8px;
            border-radius: 10px;
        }
        .outbound-pending-info .record-meta {
            display: flex;
            gap: 12px;
            font-size: 12px;
            color: #6b7280;
            margin-top: 4px;
            flex-wrap: wrap;
        }
        .outbound-pending-info .record-meta span {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .outbound-pending-delete {
            background: var(--danger-bg);
            border: none;
            color: var(--danger);
            width: 36px;
            height: 36px;
            border-radius: 50%;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: background 0.2s;
        }
        .outbound-pending-delete:active {
            background: #fecaca;
        }

        .outbound-summary {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 4px 0;
            border-top: 1px solid #e5e7eb;
            margin-top: 8px;
            font-size: 14px;
            color: #4b5563;
        }
        .outbound-summary .count-num {
            font-weight: 700;
            color: var(--primary);
            font-size: 18px;
        }

        .batch-modal-mask {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.45);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 99990;
            backdrop-filter: blur(4px);
            animation: fadeIn 0.2s ease;
        }
        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }
        .batch-modal-container {
            background: #ffffff;
            border-radius: 28px;
            width: 92%;
            max-width: 400px;
            max-height: 80vh;
            overflow-y: auto;
            padding: 24px 20px 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
            animation: slideUp 0.25s ease;
        }
        @keyframes slideUp {
            from {
                transform: translateY(30px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        .batch-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        .batch-modal-header h4 {
            margin: 0;
            font-size: 18px;
            font-weight: 700;
            color: #1f2937;
        }
        .batch-modal-close {
            background: #f3f4f6;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #6b7280;
        }
        .batch-modal-close:active {
            background: #e5e7eb;
        }
        .batch-modal-drug-info {
            background: #f8fafc;
            border-radius: 12px;
            padding: 12px 14px;
            margin-bottom: 16px;
            font-size: 14px;
        }
        .batch-modal-drug-info .label {
            color: #6b7280;
        }
        .batch-modal-drug-info .value {
            font-weight: 600;
            color: #1f2937;
        }
        .batch-list-modal {
            max-height: 300px;
            overflow-y: auto;
        }
        .batch-item-modal {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            border-radius: 12px;
            margin-bottom: 8px;
            background: #f9fafb;
            border: 2px solid transparent;
            cursor: pointer;
            transition: all 0.15s;
        }
        .batch-item-modal:active {
            transform: scale(0.97);
        }
        .batch-item-modal.selected {
            border-color: var(--primary);
            background: var(--primary-bg);
        }
        .batch-item-modal.disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }
        .batch-item-modal .batch-info {
            flex: 1;
        }
        .batch-item-modal .batch-info .batch-prod {
            font-weight: 600;
            font-size: 15px;
            color: #1f2937;
        }
        .batch-item-modal .batch-info .batch-detail {
            font-size: 12px;
            color: #6b7280;
            margin-top: 2px;
        }
        .batch-item-modal .batch-stock-badge {
            font-size: 13px;
            font-weight: 600;
            color: #059669;
            background: #d1fae5;
            padding: 4px 12px;
            border-radius: 20px;
        }
        .batch-item-modal .batch-stock-badge.empty {
            color: #dc2626;
            background: #fee2e2;
        }
        .batch-modal-actions {
            display: flex;
            gap: 10px;
            margin-top: 18px;
        }
        .batch-modal-actions button {
            flex: 1;
            padding: 12px 0;
            border: none;
            border-radius: 14px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s;
        }
        .batch-modal-actions .btn-cancel {
            background: #f3f4f6;
            color: #4b5563;
        }
        .batch-modal-actions .btn-cancel:active {
            background: #e5e7eb;
        }
        .batch-modal-actions .btn-confirm {
            background: var(--primary);
            color: #fff;
        }
        .batch-modal-actions .btn-confirm:active {
            background: #E57A1A;
        }
        .batch-modal-actions .btn-confirm:disabled {
            background: #9ca3af;
            cursor: not-allowed;
        }

        .empty-state-sm {
            text-align: center;
            padding: 20px 0;
            color: #9ca3af;
            font-size: 14px;
        }

        /* 授权到期覆盖层 */
        .license-expired-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1100;
        }
        .license-expired-content {
            text-align: center;
            max-width: 340px;
            padding: 40px 30px;
            background: #fff;
            border-radius: 32px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
            margin: 0 20px;
        }
        .license-expired-icon {
            font-size: 64px;
            margin-bottom: 16px;
            display: block;
        }
        .license-expired-content h2 {
            font-size: 22px;
            font-weight: 700;
            color: #1f2937;
            margin: 0 0 12px 0;
            letter-spacing: 0.5px;
        }
        .license-expired-content .expired-message {
            font-size: 16px;
            color: #4b5563;
            line-height: 1.6;
            margin: 0;
            padding: 16px 20px;
            background: #fef2f2;
            border-radius: 16px;
            border: 1px solid #fecaca;
            color: #991b1b;
            font-weight: 500;
        }
        .license-expired-content .expired-message strong {
            color: #dc2626;
        }
        .license-expired-content .expired-sub {
            font-size: 13px;
            color: #9ca3af;
            margin-top: 20px;
            padding-top: 16px;
            border-top: 1px solid #f3f4f6;
        }
        .registration-modal-mask {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            z-index: 600;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .registration-modal-container {
            background: #fff;
            border-radius: 32px;
            width: 300px;
            max-width: 85%;
            padding: 24px 20px 20px;
            box-shadow: 0 30px 40px -20px rgba(0, 0, 0, 0.4);
            animation: modalPop 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        }
        .registration-modal-title {
            font-size: 18px;
            font-weight: 700;
            text-align: center;
            margin-bottom: 12px;
            color: var(--text, #1F1F1F);
        }
        .registration-modal-desc {
            font-size: 14px;
            color: var(--text-secondary, #6B7280);
            text-align: center;
            margin-bottom: 16px;
        }
        .registration-modal-input {
            width: 100%;
            padding: 12px 14px;
            border-radius: 14px;
            border: 1.5px solid #e8e9ee;
            margin-bottom: 14px;
            font-size: 14px;
            background: #F9FAFB;
            transition: all 0.2s;
            box-sizing: border-box;
        }
        .registration-modal-input:focus {
            border-color: var(--primary, #FF8C2F);
            outline: none;
            background: white;
            box-shadow: 0 0 0 4px rgba(255, 140, 47, 0.1);
        }
        .registration-modal-actions {
            display: flex;
            gap: 10px;
            margin-top: 8px;
        }
        .registration-modal-btn {
            flex: 1;
            padding: 12px 0;
            border-radius: 40px;
            font-weight: 700;
            font-size: 15px;
            border: none;
            cursor: pointer;
            transition: all 0.12s linear;
        }
        .registration-modal-btn.cancel {
            background: #F3F4F6;
            color: #4B5563;
        }
        .registration-modal-btn.confirm {
            background: var(--primary, #FF8C2F);
            color: white;
        }
        .registration-modal-btn:active {
            transform: scale(0.96);
        }
        @keyframes modalPop {
            from { opacity: 0; transform: scale(0.92); }
            to { opacity: 1; transform: scale(1); }
        }