* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
}

/* ========== 左侧导航 ========== */
.sidebar {
    width: 220px;
    background: #2c3e50;
    /* 固定为视口高度（此前 min-height 随导航项增长，fixed 容器超出部分
       无法滚动到，底部租户切换/退出登录被推出可视区）。 */
    height: 100vh;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h1 {
    font-size: 1rem;
    font-weight: 600;
    color: #ecf0f1;
}

.nav-list {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
    /* 导航项超出侧边栏高度时自身滚动，底部的 footer 保持可见 */
    min-height: 0;
    overflow-y: auto;
}

.nav-list::-webkit-scrollbar {
    width: 6px;
}

.nav-list::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 3px;
}

.nav-list::-webkit-scrollbar-thumb:hover {
    background: #46617e;
}

.nav-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #bdc3c7;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #34495e;
    color: #ecf0f1;
}

.nav-item.active {
    background: #34495e;
    color: #3498db;
    border-left-color: #3498db;
}

.nav-item .nav-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #34495e;
    /* 纵向堆叠：租户切换器 / 用户名 / 退出按钮各占一行。
       此前是横向 flex，三者挤一行导致 select 被横向截断。 */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* superadmin 的代入租户切换器 */
.acting-tenant-wrap label {
    display: block;
    font-size: 0.75rem;
    color: #95a5a6;
    margin-bottom: 0.25rem;
}

.acting-tenant-select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    background: #34495e;
    color: #ecf0f1;
    border: 1px solid #46617e;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.acting-tenant-select:focus {
    outline: none;
    border-color: #3498db;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #ecf0f1;
}

.user-icon {
    font-size: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #bdc3c7;
}

.logout-btn {
    /* footer 已改纵向布局，不再需要 margin-left:auto 挤到行尾 */
    padding: 0.375rem 0.75rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    align-self: flex-start;
}

.logout-btn:hover {
    background: #c0392b;
}

/* ========== 管理后台容器 ========== */
.admin-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ========== 主内容区 ========== */
.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 1.5rem 2rem;
    min-height: 100vh;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    color: #333;
    font-weight: 600;
}

.section-header p {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* ========== 登录页面 ========== */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: white;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333;
}

.login-error {
    color: #c00;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.login-btn:hover {
    background: #2980b9;
}

/* ========== 卡片容器 ========== */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

/* ========== 按钮 ========== */
button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

button.primary {
    background: #3498db;
    color: white;
}

button.primary:hover {
    background: #2980b9;
}

button.secondary,
a.secondary {
    background: #ecf0f1;
    color: #333;
}

button.secondary:hover,
a.secondary:hover {
    background: #bdc3c7;
}

button.danger {
    background: #e74c3c;
    color: white;
}

button.danger:hover {
    background: #c0392b;
}

button.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ========== Tab栏 ========== */
.tab-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== 表格 ========== */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.875rem;
}

th {
    background: #f8f8f8;
    font-weight: 600;
    color: #555;
}

tbody tr:hover {
    background: #fafafa;
}

.expand-icon {
    cursor: pointer;
    color: #3498db;
    font-size: 0.7rem;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: #666;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* ========== 消息提示 ========== */
.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    display: none;
}

.message.error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.message.success {
    background: #efe;
    color: #060;
    border: 1px solid #cfc;
}

.message.show {
    display: block;
}

/* ========== 上传区域 ========== */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.upload-area:hover {
    border-color: #3498db;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.upload-label:hover {
    background: #2980b9;
}

/* ========== 阈值输入 ========== */
.threshold-input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.threshold-save {
    padding: 0.25rem 0.5rem;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.pagination .info {
    font-size: 0.875rem;
    color: #666;
}

/* ========== 弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* ========== 阻塞式处理中遮罩 ========== */
/* 覆盖全页（z-index 高于普通弹窗），长耗时操作期间禁止一切页面交互 */
#blockingOverlay {
    z-index: 2000;
    background: rgba(0,0,0,0.65);
}

.blocking-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto;
    border: 4px solid #e0e6ed;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: blocking-spin 0.9s linear infinite;
}

@keyframes blocking-spin {
    to { transform: rotate(360deg); }
}

/* ========== 订单详情弹窗 ========== */
.od-modal {
    max-width: 960px !important;
    width: 92% !important;
    max-height: 88vh !important;
}
.od-modal .modal-header {
    position: sticky;
    top: -1.5rem;
    margin: -1.5rem -1.5rem 1rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 10;
}
.od-tab-bar {
    position: relative;
    align-items: center;
}
.od-tab-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}
.od-tab-content {
    display: none;
}
.od-tab-content.active {
    display: block;
}
.od-body {
    font-size: 0.85rem;
    color: #333;
}
.od-section {
    margin-bottom: 1.2rem;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}
.od-section-title {
    background: #f7f7f9;
    padding: 0.5rem 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
}
.od-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem 0.8rem;
    padding: 0.6rem 0.8rem;
}
.od-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.od-field {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0;
    min-width: 0;
}
.od-field-label {
    font-size: 0.72rem;
    color: #888;
    margin-bottom: 0.1rem;
}
.od-field-value {
    font-size: 0.85rem;
    color: #222;
    word-break: break-word;
}
.od-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.od-table th, .od-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}
.od-table th {
    background: #fafafa;
    color: #555;
    font-weight: 600;
}
.od-json {
    padding: 0.75rem;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.75rem;
    border-radius: 6px;
    max-height: 360px;
    overflow: auto;
    white-space: pre;
}
.od-empty {
    padding: 1rem;
    text-align: center;
    color: #999;
}
.oq-order-link {
    color: #2980b9;
    cursor: pointer;
    text-decoration: underline;
}
.oq-order-link:hover {
    color: #1a5276;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

/* ========== 加载状态 ========== */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* ========== 链接 ========== */
.section-link {
    font-size: 0.875rem;
    color: #3498db;
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

/* ========== 统计模块 ========== */
.empty {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.sku-link {
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
}

.sku-link:hover {
    color: #2980b9;
}

.chart-container {
    position: relative;
    height: 350px;
}

/* ========== 同步工具栏 ========== */
.sync-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.sync-toolbar-hint {
    font-size: 0.875rem;
    color: #666;
}

.sync-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sync-status-text {
    font-size: 0.8rem;
    color: #999;
}

/* ========== 异常订单拦截页面 ========== */
.mp-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
}

.mp-label {
    flex: 0 0 140px;
    font-weight: 600;
    color: #444;
}

.mp-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mp-hint {
    font-size: 0.8rem;
    color: #888;
}

.mp-divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 0 0.25rem;
}

.mp-hidden-input {
    display: none;
}

.mp-link-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.mp-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mp-badge-on {
    background: #e6f7ec;
    color: #27ae60;
    border: 1px solid #b6e5c5;
}

.mp-badge-off {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

.mp-toggle-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0 0.25rem;
    border-top: 1px dashed #eee;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.mp-toggle-hint {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

.mp-sub-tab-bar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.mp-sub-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    font-size: 0.85rem;
    color: #777;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.mp-sub-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: 600;
}

.mp-sub-tab-content {
    display: none;
}

.mp-sub-tab-content.active {
    display: block;
}

.mp-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
}

.mp-price-value {
    color: #c0392b;
    font-weight: 600;
}

/* ========== 禁止发货区域管理 ========== */
.sr-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.sr-tab-bar {
    flex: 1;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
}

.sr-table th {
    background: #fafafa;
    font-weight: 600;
    color: #4b5563;
}

.sr-status-active {
    color: #16a34a;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sr-status-active::before {
    content: "●";
    color: #22c55e;
}

.sr-status-inactive {
    color: #9ca3af;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sr-status-inactive::before {
    content: "●";
    color: #d1d5db;
}

.sr-state-all {
    color: #dc2626;
    font-weight: 600;
}

.sr-no-attachment {
    color: #f97316;
}

.sr-attachment-link {
    color: #2563eb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    word-break: break-all;
}

.sr-attachment-link:hover {
    text-decoration: underline;
}

.sr-attachment-link::before {
    content: "📎";
}

.sr-empty {
    text-align: center;
    color: #9ca3af;
    padding: 2rem 0;
}

.sr-deactivate-btn {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.sr-deactivate-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* 新增弹窗 */
.sr-modal {
    max-width: 460px;
}

.sr-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.sr-form-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: start;
    gap: 0.75rem;
}

.sr-form-label {
    font-size: 0.9rem;
    color: #374151;
    padding-top: 0.45rem;
    text-align: right;
}

.sr-required {
    color: #dc2626;
    margin-right: 0.2rem;
}

.sr-form-row select,
.sr-form-row textarea,
.sr-form-row input[type="text"] {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.sr-form-row textarea {
    resize: vertical;
    min-height: 70px;
}

.sr-file-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sr-file-row input[type="file"] {
    font-size: 0.85rem;
}

.sr-file-hint {
    font-size: 0.8rem;
    color: #6b7280;
}

.sr-form-hint {
    grid-column: 2 / 3;
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

.sr-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

.mp-price-empty {
    color: #aaa;
}

.mp-component-list {
    color: #666;
    font-size: 0.8rem;
}

/* ===================================================== */
/* 手工单上传弹窗（mo- 前缀，避免与现有类冲突）                */
/* ===================================================== */
.mo-modal {
    max-width: 1080px !important;
    width: 96% !important;
    max-height: 90vh !important;
    padding: 0 !important;
}
.mo-modal .modal-header {
    padding: 14px 22px;
    border-bottom: 1px solid #eef0f3;
    margin-bottom: 0;
}
.mo-body {
    padding: 22px 24px 12px;
    max-height: 72vh;
    overflow-y: auto;
}
.mo-footer {
    padding: 12px 22px;
    border-top: 1px solid #eef0f3;
    background: #fafbfc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 步骤条 */
.mo-steps {
    display: flex;
    align-items: center;
    margin-bottom: 22px;
}
.mo-step {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #9ca3af;
}
.mo-step-num {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    margin-right: 8px;
}
.mo-step.active { color: #2563eb; font-weight: 600; }
.mo-step.active .mo-step-num { background: #2563eb; }
.mo-step.done .mo-step-num { background: #16a34a; }
.mo-step.done { color: #16a34a; }
.mo-step-line {
    flex: 1; height: 2px; background: #e5e7eb; margin: 0 14px;
}
.mo-step-line.done { background: #16a34a; }

.mo-pane { display: none; }
.mo-pane.show { display: block; }

/* 模式切换 */
.mo-mode-tabs {
    display: inline-flex;
    border: 1px solid #d5d9e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 18px;
}
.mo-mode-tab {
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    color: #4b5563;
    border: none;
}
.mo-mode-tab.active { background: #2563eb; color: #fff; }

/* 上传区 */
.mo-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 36px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: .15s;
    margin-bottom: 18px;
}
.mo-upload-zone:hover { border-color: #2563eb; background: #f0f6ff; }
.mo-upload-icon { font-size: 38px; }
.mo-upload-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.mo-upload-filename { color: #2563eb; font-weight: 600; margin-top: 8px; }

.mo-row-flex {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.mo-btn {
    border: none; border-radius: 4px; padding: 8px 18px; font-size: 14px; cursor: pointer;
}
.mo-btn-default { background: #fff; border: 1px solid #d5d9e0; color: #4b5563; }
.mo-btn-default:hover { background: #f3f4f6; }
.mo-btn-sm { padding: 6px 14px; font-size: 13px; }

/* 折叠面板 */
.mo-collapse {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}
.mo-collapse-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 16px; background: #f8fafc;
    cursor: pointer; user-select: none;
    font-size: 14px; font-weight: 600; color: #334155;
}
.mo-collapse-head:hover { background: #f1f5f9; }
.mo-arrow { transition: transform .2s; color: #94a3b8; }
.mo-collapse.open .mo-arrow { transform: rotate(90deg); }
.mo-collapse-body { display: none; }
.mo-collapse.open .mo-collapse-body { display: block; }

.mo-note-list { max-height: 240px; overflow-y: auto; }
.mo-note-line {
    padding: 8px 16px; font-size: 13px;
    border-bottom: 1px solid #eef3fa;
    color: #374151; line-height: 1.5;
}
.mo-note-line:nth-child(even) { background: #f7fafe; }

.mo-field-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.mo-field-tbl th, .mo-field-tbl td {
    border: 1px solid #e2e8f0; padding: 7px 10px; text-align: left;
}
.mo-field-tbl th { background: #dbeafe; font-weight: 600; }
.mo-field-tbl td:first-child {
    font-weight: 600; color: #1e40af; white-space: nowrap; background: #f0f6ff;
}
.mo-field-tbl-scroll { max-height: 300px; overflow-y: auto; }

/* 单笔表单 */
.mo-form-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px; margin-bottom: 18px;
}
.mo-fg { display: flex; flex-direction: column; gap: 5px; }
.mo-fg-full { grid-column: 1 / -1; }
.mo-fg label { font-size: 12px; color: #5b6472; }
.mo-req { color: #dc2626; }
.mo-fg input, .mo-fg select, .mo-fg textarea {
    height: 34px; border: 1px solid #d5d9e0; border-radius: 4px;
    padding: 0 10px; font-size: 13px; outline: none;
}
.mo-fg textarea { height: 56px; padding: 8px 10px; resize: vertical; }
.mo-fg input:focus, .mo-fg select:focus, .mo-fg textarea:focus { border-color: #2563eb; }
/* 锁定字段：自动填充且不可更改（如 Client_Name / Order Status） */
.mo-fg input[readonly], .mo-fg select[disabled] {
    background: #f1f5f9; color: #64748b; cursor: not-allowed;
}

/* SKU 段 */
.mo-sku-section {
    border: 1px solid #e2e8f0; border-radius: 6px; padding: 14px; margin-bottom: 18px;
}
.mo-sku-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mo-sku-head h4 { font-size: 14px; color: #334155; }
.mo-sku-row {
    display: grid; grid-template-columns: 40px 1fr 140px 40px; gap: 10px; align-items: center;
    margin-bottom: 8px;
}
.mo-idx { font-size: 13px; color: #94a3b8; text-align: center; }
.mo-sku-row input { height: 32px; border: 1px solid #d5d9e0; border-radius: 4px; padding: 0 10px; font-size: 13px; }
.mo-del {
    border: none; background: #fee2e2; color: #b91c1c;
    border-radius: 4px; cursor: pointer; height: 32px;
}
.mo-del:hover { background: #fecaca; }
.mo-add-sku-btn {
    border: 1px dashed #93c5fd; background: #eff6ff; color: #2563eb;
    border-radius: 4px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.mo-add-sku-btn:hover { background: #dbeafe; }
.mo-add-sku-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 第②步：统计卡 + 数据表 */
.mo-tip-box {
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
    padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px;
}
.mo-stat-cards { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.mo-stat-card {
    flex: 1; min-width: 150px; background: #f8fafc;
    border: 1px solid #eceef1; border-radius: 6px; padding: 14px 18px;
}
.mo-stat-card .mo-stat-v { font-size: 26px; font-weight: 700; }
.mo-stat-card .mo-stat-l { font-size: 13px; color: #6b7280; margin-top: 2px; }
.mo-stat-blue .mo-stat-v { color: #2563eb; }
.mo-stat-green .mo-stat-v { color: #16a34a; }
.mo-stat-red .mo-stat-v { color: #dc2626; }

.mo-table-wrap {
    border: 1px solid #eceef1; border-radius: 6px;
    overflow: auto; max-height: 360px;
}
table.mo-data {
    width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap;
}
table.mo-data th {
    position: sticky; top: 0; background: #f3f4f6; padding: 10px;
    text-align: left; font-weight: 600; color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}
table.mo-data td { padding: 9px 10px; border-bottom: 1px solid #f1f3f5; }
table.mo-data tr:hover td { background: #f8fafc; }

.mo-upload-cell { display: flex; align-items: center; gap: 8px; }
.mo-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.mo-badge-ok { background: #dcfce7; color: #15803d; }
.mo-badge-no { background: #fee2e2; color: #b91c1c; }
.mo-mini-up-btn {
    border: 1px solid #d5d9e0; background: #fff;
    border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.mo-mini-up-btn:hover { background: #f0f6ff; border-color: #2563eb; color: #2563eb; }
.mo-create-shipping {
    height: 30px; border: 1px solid #d5d9e0; border-radius: 4px; padding: 0 8px; font-size: 13px; background: #fff;
}

/* 第③步：结果 */
.mo-result-hero {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0; border-radius: 12px;
    padding: 28px; text-align: center; margin-bottom: 22px;
}
.mo-result-hero .mo-check-circle {
    width: 64px; height: 64px; margin: 0 auto 14px;
    background: #22c55e; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 34px;
    box-shadow: 0 4px 14px rgba(34,197,94,.4);
}
.mo-result-hero h3 { font-size: 22px; color: #166534; }
.mo-result-hero p { font-size: 13px; color: #15803d; margin-top: 4px; }

/* 进度条（第③步轮询期间显示） */
.mo-progress { height: 8px; width: 100%; background: #dcfce7; border-radius: 999px; overflow: hidden; }
.mo-progress-bar {
    height: 100%; width: 0%; background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 999px; transition: width 0.4s ease;
}

.mo-result-stats { display: flex; gap: 16px; margin-bottom: 22px; }
.mo-rs-card {
    flex: 1; border-radius: 10px; padding: 20px;
    display: flex; align-items: center; gap: 16px;
    border: 1px solid; position: relative; overflow: hidden;
}
.mo-rs-icon {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.mo-rs-num { font-size: 30px; font-weight: 800; line-height: 1; }
.mo-rs-label { font-size: 13px; margin-top: 4px; }
.mo-rs-total { background: #eff6ff; border-color: #bfdbfe; }
.mo-rs-total .mo-rs-icon { background: #dbeafe; color: #2563eb; }
.mo-rs-total .mo-rs-num { color: #1d4ed8; }
.mo-rs-total .mo-rs-label { color: #3b6fc4; }
.mo-rs-ok { background: #f0fdf4; border-color: #bbf7d0; }
.mo-rs-ok .mo-rs-icon { background: #dcfce7; color: #16a34a; }
.mo-rs-ok .mo-rs-num { color: #15803d; }
.mo-rs-ok .mo-rs-label { color: #2f9e5a; }
.mo-rs-fail { background: #fef2f2; border-color: #fecaca; }
.mo-rs-fail .mo-rs-icon { background: #fee2e2; color: #dc2626; }
.mo-rs-fail .mo-rs-num { color: #b91c1c; }
.mo-rs-fail .mo-rs-label { color: #c4524f; }

.mo-fail-alert {
    background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px;
    padding: 14px 18px; margin-bottom: 20px;
}
.mo-fail-alert .mo-fa-title {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600; color: #92400e; font-size: 14px; margin-bottom: 8px;
}
.mo-fail-alert ul { margin-left: 24px; }
.mo-fail-alert li { font-size: 13px; color: #92400e; margin-bottom: 4px; }

.mo-download-row { display: flex; gap: 16px; margin-bottom: 24px; }
.mo-dl-card {
    flex: 1; border-radius: 12px; padding: 18px 20px; cursor: pointer;
    display: flex; align-items: center; gap: 14px;
    border: 1.5px solid; transition: .18s; background: #fff;
}
.mo-dl-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.mo-dl-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.mo-dl-main { font-size: 15px; font-weight: 600; }
.mo-dl-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.mo-dl-arrow { margin-left: auto; font-size: 18px; color: #cbd5e1; }
.mo-dl-report { border-color: #bfdbfe; }
.mo-dl-report .mo-dl-icon { background: #dbeafe; color: #2563eb; }
.mo-dl-report .mo-dl-main { color: #1d4ed8; }
.mo-dl-report:hover { border-color: #2563eb; }
.mo-dl-error { border-color: #fecaca; }
.mo-dl-error .mo-dl-icon { background: #fee2e2; color: #dc2626; }
.mo-dl-error .mo-dl-main { color: #b91c1c; }
.mo-dl-error:hover { border-color: #dc2626; }

.mo-result-section {
    border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden;
}
.mo-result-section .mo-rs-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: #f8fafc; border-bottom: 1px solid #eef0f3;
}
.mo-result-section .mo-rs-head h4 { font-size: 15px; color: #334155; display: flex; align-items: center; gap: 8px; }
.mo-rs-count { font-size: 12px; color: #94a3b8; }

.mo-status-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500;
}
.mo-status-pill.ok { background: #dcfce7; color: #15803d; }
.mo-status-pill.fail { background: #fee2e2; color: #b91c1c; }
