.login-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #0a1628 0%, #1b263b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-page::before {
    width: 220px;
    height: 220px;
    top: -60px;
    left: -80px;
    background: rgba(24, 144, 255, 0.18);
}

.login-page::after {
    width: 260px;
    height: 260px;
    bottom: -80px;
    right: -60px;
    background: rgba(0, 212, 255, 0.12);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.login-card .subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #f1f5f9;
}

.app-sidebar {
    width: 220px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.app-sidebar .brand {
    padding: 1.25rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

.app-sidebar .brand small {
    display: block;
    font-weight: 400;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.app-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.app-nav a {
    display: block;
    padding: 0.65rem 1.25rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.app-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.app-nav a.active {
    background: rgba(24, 144, 255, 0.15);
    color: #60a5fa;
    border-left-color: #1890ff;
}

.nav-group {
    border-left: 3px solid transparent;
}

.nav-group.active {
    border-left-color: rgba(24, 144, 255, 0.35);
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 1.25rem;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-group.active > .nav-group-toggle {
    color: #93c5fd;
}

.nav-group-chevron {
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-top: -0.15rem;
}

.nav-group.expanded .nav-group-chevron {
    transform: rotate(-135deg);
    margin-top: 0.15rem;
}

.nav-sub {
    display: none;
    padding-bottom: 0.25rem;
}

.nav-group.expanded .nav-sub {
    display: block;
}

.nav-sub a {
    padding: 0.5rem 1.25rem 0.5rem 2rem;
    font-size: 0.9rem;
}

.app-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #94a3b8;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header h2 {
    font-size: 1.15rem;
    margin: 0;
    color: #0f172a;
}

.app-content {
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.mcc-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.mcc-card-title {
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem 1rem;
}

.form-grid label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.alert-mcc {
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
}

.alert-mcc.success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-mcc.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-mcc.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-mcc.warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.mcc-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.mcc-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    font-size: 0.9rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
}

.mcc-toast-show {
    opacity: 1;
    transform: translateY(0);
}

.mcc-toast-body {
    flex: 1;
    word-break: break-word;
}

.mcc-toast-close {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.65;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.mcc-toast-close:hover {
    opacity: 1;
}

.mcc-toast-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.mcc-toast-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.mcc-toast-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.mcc-toast-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.ticket-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.ticket-list button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.ticket-list button:hover { background: #f8fafc; }
.ticket-list button.selected { background: #eff6ff; color: #1d4ed8; }

.raw-text-box {
    font-family: Consolas, monospace;
    font-size: 0.75rem;
    height: 180px;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem;
    white-space: pre-wrap;
}

.label-preview-wrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    background: #f8fafc;
}

.label-preview-box {
    position: relative;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin: 0 auto;
}

.label-preview-box.box-label {
    width: 450px;
    height: 300px;
    background-image: url('/label-images/BoxLabel.jpg');
    background-size: cover;
}

.label-preview-box.volume-label {
    width: 300px;
    height: 450px;
    background-image: url('/label-images/VolumeLabel.jpg');
    background-size: cover;
}

.label-overlay {
    position: absolute;
    font-size: 11px;
    color: #000;
    line-height: 1.2;
}

.label-overlay .big-code {
    font-size: 22px;
    font-weight: 700;
}

.mapping-table {
    width: 100%;
    font-size: 0.85rem;
}

.mapping-table th {
    background: #f8fafc;
    font-weight: 600;
}

.scanner-note {
    font-size: 0.85rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 0.75rem;
}

/* 工作区卡片标签 */
.workspace-toolbar {
    background: #e5e7eb;
    border-bottom: 1px solid #d1d5db;
    padding: 0.45rem 0.75rem 0;
    flex-shrink: 0;
}

.workspace-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-end;
    min-height: 2.25rem;
}

.workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 180px;
    min-width: 96px;
    height: 36px;
    padding: 0 0.35rem 0 0.75rem;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #4b5563;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.15s, color 0.15s;
}

.workspace-tab:hover {
    background: #f3f4f6;
}

.workspace-tab.active {
    background: #fff;
    color: #1890ff;
    border-color: #cbd5e1;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.04);
    z-index: 2;
    margin-bottom: -1px;
    padding-bottom: 1px;
}

.workspace-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #1890ff;
}

.workspace-tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.workspace-tab-close {
    border: none;
    background: transparent;
    color: inherit;
    width: 24px;
    height: 24px;
    line-height: 1;
    border-radius: 4px;
    font-size: 1.1rem;
    padding: 0;
    flex-shrink: 0;
}

.workspace-tab-close:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.workspace-panels {
    flex: 1;
    position: relative;
    background: #f1f5f9;
    min-height: 0;
    overflow: hidden;
}

.workspace-panel {
    display: none;
    position: absolute;
    inset: 0;
    background: #f1f5f9;
}

.workspace-panel.active {
    display: block;
}

.workspace-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #f1f5f9;
}

.embedded-module {
    background: #f1f5f9;
    margin: 0;
}

.embedded-content {
    padding: 1rem 1.25rem;
}

@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: 100%; }
    .app-nav { display: flex; flex-wrap: wrap; }
    .app-nav a { flex: 1 1 auto; border-left: none; border-bottom: 2px solid transparent; }
    .app-nav a.active { border-bottom-color: #1890ff; }
}

.customer-search-wrap {
    position: relative;
}

.customer-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.customer-search-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.customer-search-item:last-child {
    border-bottom: 0;
}

.customer-search-item:hover,
.customer-search-item.active {
    background: #eff6ff;
}

.customer-search-item-main {
    font-size: 0.875rem;
    color: #0f172a;
}

.customer-search-item-sub {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.customer-search-empty {
    padding: 0.75rem;
    font-size: 0.875rem;
}

.customer-page-size-select {
    width: 4.5rem;
}

.customer-data-pager .pagination {
    flex-wrap: wrap;
}

.mcc-guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 2000;
    pointer-events: auto;
}

.mcc-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcc-loading-panel {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    text-align: center;
    min-width: 240px;
}

.mcc-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.75rem;
}

.mcc-loading-message {
    font-size: 0.9rem;
    color: #334155;
}

body.mcc-loading-active {
    overflow: hidden;
}

.mcc-permission-badge {
    display: inline-block;
    padding: 0.25em 0.55em;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    color: #334155;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.mcc-permission-badge--emphasis {
    color: #fff;
    background: #64748b;
    border-color: #64748b;
}

.mcc-guide-highlight {
    position: relative;
    z-index: 2001 !important;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.95), 0 0 0 9999px rgba(15, 23, 42, 0.45) !important;
    border-radius: 0.375rem;
}

.mcc-guide-tooltip {
    position: fixed;
    z-index: 2002;
    width: min(320px, calc(100vw - 24px));
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    padding: 0.9rem 1rem;
}

.mcc-guide-tooltip-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.mcc-guide-tooltip-body {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.5;
}

.mcc-guide-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.mcc-guide-step-indicator {
    font-size: 0.75rem;
    color: #94a3b8;
}

.mcc-guide-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.login-first-deploy-hint {
    border-left: 4px solid #1890ff;
    background: #eff6ff;
    color: #1e3a5f;
    padding: 0.75rem 0.9rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.55;
}
