@import url('tokens.css');

/* ==================== 全局重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%; height: 100%;
    overflow-x: hidden;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 移动端容器 ==================== */
.mobile-container {
    display: none; justify-content: center;
    padding: 70px 20px 40px; min-height: 100vh;
}
.mobile-container.active { display: flex; }
.mobile-frame {
    width: 375px; max-width: 100%; min-height: 100vh;
    background: var(--bg-page);
    box-shadow: var(--shadow-xl); border-radius: 24px;
    overflow-y: auto; overflow-x: hidden; position: relative;
    border: 2px solid #333;
    -webkit-overflow-scrolling: touch;
}

/* 真实手机屏幕：全屏自适应，取消模拟手机外框 */
@media (max-width: 430px) {
    .mobile-container {
        padding: 0;
    }
    .mobile-container.active {
        padding: 0;
    }
    .mobile-frame {
        width: 100%; max-width: 100%;
        border-radius: 0; border: none;
        box-shadow: none;
        min-height: 100vh;
    }
}
.mobile-page { display: none; animation: fadeSlideIn 0.35s cubic-bezier(0.4,0,0.2,1); }
.mobile-page.active { display: block; min-height: 100%; }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* 启动加载页 */
.m-loading-wrap {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 100vh; gap: 14px;
}
.m-loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: mSpin 0.8s linear infinite;
}
.m-loading-text { color: var(--text-secondary); font-size: 14px; }
@keyframes mSpin { to { transform: rotate(360deg); } }

/* ==================== 移动端导航栏 ==================== */
.mobile-navbar {
    background: var(--gradient-primary);
    color: white; padding: 44px 16px 14px;
    font-size: 18px; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
    position: relative; letter-spacing: 0.02em;
}
.mobile-navbar .back-btn {
    background: rgba(255,255,255,0.15); border: none;
    color: white; font-size: 18px; cursor: pointer;
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition-fast);
    backdrop-filter: blur(10px);
}
.mobile-navbar .back-btn:hover { background: rgba(255,255,255,0.25); }

/* ==================== 移动端登录 ==================== */
.mobile-login {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 40%, var(--bg-page) 40%);
    min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    padding-top: 70px;
}
.mobile-login .logo-area {
    text-align: center; color: white; margin-bottom: 32px;
}
.mobile-login .logo-icon {
    width: 68px; height: 68px;
    background: rgba(255,255,255,0.18); backdrop-filter: blur(12px);
    border-radius: var(--radius-xl); display: flex;
    align-items: center; justify-content: center;
    margin: 0 auto 14px;
    border: 1px solid rgba(255,255,255,0.15);
}
.mobile-login .logo-icon svg {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}
.mobile-login .sys-name {
    font-size: 22px; font-weight: 700; letter-spacing: 0.05em;
}
.mobile-login .login-card {
    background: var(--bg-white); border-radius: var(--radius-xl);
    padding: 28px 22px; width: calc(100% - 40px);
    box-shadow: var(--shadow-lg);
}
.mobile-login .login-card h2 {
    text-align: center; font-size: 17px; font-weight: 600;
    margin-bottom: 22px; color: var(--text-primary);
}
.mobile-login .input-group { margin-bottom: 14px; position: relative; }
.mobile-login .input-group label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 5px;
}
.mobile-login .input-group input {
    width: 100%; padding: 11px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px;
    font-family: inherit; outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.mobile-login .input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.10);
}
.mobile-login .pwd-toggle {
    position: absolute; right: 10px; bottom: 10px;
    background: none; border: none; cursor: pointer;
    font-size: 16px; opacity: 0.45; transition: opacity var(--transition-fast);
}
.mobile-login .pwd-toggle:hover { opacity: 0.8; }
.mobile-login .login-btn {
    width: 100%; padding: 12px; background: var(--gradient-primary);
    color: white; border: none; border-radius: var(--radius-full);
    font-size: 15px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all var(--transition);
    box-shadow: var(--shadow-xs);
}
.mobile-login .login-btn:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-sm);
}
.mobile-login .login-btn:disabled {
    background: #A0C4E8; cursor: not-allowed; box-shadow: none;
}

/* ==================== 移动端主页 ==================== */
.welcome-bar {
    background: var(--gradient-primary);
    color: white; padding: 44px 16px 22px;
    font-size: 20px; font-weight: 700; letter-spacing: 0.03em;
}
.welcome-bar .sub {
    font-size: 12px; font-weight: 400;
    opacity: 0.75; margin-top: 4px;
}
.function-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 16px; padding: 20px 14px; text-align: center;
}
.func-ball {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; cursor: pointer;
    transition: transform var(--transition);
}
.func-ball:hover { transform: scale(1.05); }
.func-ball:active { transform: scale(0.94); }
.func-ball .ball-icon {
    width: 72px; height: 72px; border-radius: var(--radius-circle);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: white;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition);
}
.func-ball:hover .ball-icon { box-shadow: var(--shadow-lg); }
.ball-icon.products { background: var(--gradient-primary); }
.ball-icon.recognize { background: var(--gradient-accent); }
.ball-icon.profile { background: var(--gradient-success); }
.func-ball .ball-label {
    font-size: 12px; font-weight: 500;
    color: var(--text-secondary);
}

/* ==================== 搜索与列表 ==================== */
.search-bar {
    display: flex; align-items: center; background: var(--bg-white);
    border-radius: var(--radius-full); padding: 7px 14px;
    gap: 8px; margin-bottom: 14px;
    border: 1.5px solid var(--border);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.08);
}
.search-bar input {
    flex: 1; border: none; outline: none;
    font-size: 13px; font-family: inherit; background: transparent;
    color: var(--text-primary);
}
.search-bar input::placeholder { color: var(--text-disabled); }
.search-bar .search-icon { color: var(--text-disabled); font-size: 14px; }
.search-bar .clear-icon {
    color: var(--text-disabled); cursor: pointer; font-size: 14px;
    border: none; background: none; padding: 2px;
    border-radius: var(--radius-circle);
    transition: color var(--transition-fast), background var(--transition-fast);
}
.search-bar .clear-icon:hover { color: var(--text-secondary); background: var(--bg-gray); }

/* 移动端筛选器 */
.m-filter-row {
    display: flex; gap: 6px; margin-bottom: 14px;
    flex-wrap: wrap;
}
.m-filter-select {
    flex: 1; min-width: 0;
    padding: 6px 4px; font-size: 11px;
    font-family: inherit; color: var(--text-secondary);
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); outline: none;
    cursor: pointer; text-align: center;
    transition: border-color var(--transition-fast);
}
.m-filter-select:focus {
    border-color: var(--primary); color: var(--text-primary);
}

.product-card {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 12px; margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
    display: flex; gap: 10px; cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}
.product-card .card-img {
    width: 72px; height: 72px; border-radius: var(--radius-sm);
    background: var(--bg-gray); display: flex; align-items: center;
    justify-content: center; font-size: 28px; flex-shrink: 0;
    color: var(--text-disabled); overflow: hidden;
}
.product-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .card-info {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; gap: 3px; min-width: 0;
}
.product-card .card-title {
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.src-badge.src-bam {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    background: #fff3e0;
    color: #e65100;
    vertical-align: middle;
}
.pc-table .src-badge.src-bam { margin-left: 2px; }

.product-card .card-title .dup-badge {
    display: inline-block; vertical-align: middle;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    width: 17px; height: 17px; line-height: 17px;
    text-align: center; border-radius: 3px;
    margin-left: 4px; flex-shrink: 0;
}
.product-card .card-meta {
    font-size: 11px; color: var(--text-secondary);
    display: flex; gap: 6px; flex-wrap: wrap;
}
.product-card .card-meta span {
    background: var(--bg-gray); padding: 2px 8px;
    border-radius: 6px; font-weight: 500;
}
.product-card .card-meta span.m-inline-editable {
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}
.product-card .card-meta span.m-inline-editable:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.product-card .card-meta span.m-inline-editable:hover::after {
    content: '✎'; font-size: 9px; margin-left: 2px; opacity: 0.5;
}
.product-card .card-loc-row {
    margin-top: 3px; padding: 2px 6px;
    background: var(--bg-gray); border-radius: 5px;
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition-fast);
    border: 1px dashed transparent;
    width: fit-content; max-width: 50%;
}
.product-card .card-loc-row:hover, .product-card .card-loc-row:active {
    background: var(--primary-light); color: var(--primary);
    border-color: var(--primary);
}
.product-card .card-loc-row .loc-icon { font-size: 10px; flex-shrink: 0; }
.product-card .card-loc-row .loc-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== 商品详情（移动端：完整显示图片） ==================== */
.detail-img,
.record-detail-hero .result-img,
.m-detail-media {
    width: 100%;
    min-height: 140px;
    max-height: min(72vh, 420px);
    height: auto;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: var(--text-disabled);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
}
.detail-img img,
.record-detail-hero .result-img img,
.m-detail-media img {
    width: 100%;
    height: auto;
    max-height: min(68vh, 396px);
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 6px;
}
.detail-img.has-image::after,
.record-detail-hero .result-img.has-image::after,
.m-detail-media.has-image::after {
    content: '点击放大';
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 10px;
    color: var(--text-disabled);
    background: rgba(255,255,255,0.85);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}
.detail-img,
.record-detail-hero .result-img,
.m-detail-media { position: relative; }

.detail-gallery {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}
.detail-gallery--empty {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: var(--text-disabled);
    background: #f5f7fa;
    border-radius: var(--radius-lg);
}
.detail-gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: var(--radius-lg);
    background: #f5f7fa;
}
.detail-gallery-track::-webkit-scrollbar { display: none; }
.detail-gallery-slide {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: start;
    min-height: 140px;
    max-height: min(72vh, 420px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    cursor: zoom-in;
}
.detail-gallery-slide img {
    width: 100%;
    height: auto;
    max-height: min(68vh, 396px);
    object-fit: contain;
    border-radius: 6px;
}
.detail-gallery-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
}
.detail-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}
.detail-gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
}
.detail-gallery-dot.active {
    background: var(--primary);
    width: 16px;
    border-radius: 3px;
}

.detail-img-hint {
    margin: -4px 0 10px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}
.bam-detail-card .m-detail-media .bam-detail-img {
    max-height: min(68vh, 396px);
    margin-bottom: 0;
}

/* 全屏预览 */
.m-image-preview {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.m-image-preview.hidden { display: none !important; }
.m-image-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.m-image-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.detail-info {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 16px; margin-top: 10px;
    box-shadow: var(--shadow-xs);
}
.detail-info .info-row {
    display: flex; justify-content: space-between;
    padding: 9px 0; border-bottom: 1px solid var(--border);
    font-size: 13px; align-items: center;
}
.detail-info .info-row:last-child { border-bottom: none; }
.detail-info .info-label { color: var(--text-secondary); font-weight: 500; }
.detail-info .info-value { font-weight: 600; color: var(--text-primary); text-align: right; max-width: 60%; }
.detail-info .info-row-multiline {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.detail-info .info-row-multiline .info-label { flex-shrink: 0; }
.detail-info .info-row-multiline .info-value,
.detail-info .info-value.xhs-title-value {
    max-width: 100%;
    text-align: left;
    word-break: break-all;
    line-height: 1.5;
    font-weight: 500;
    white-space: normal;
}
.btn-edit {
    width: 100%; padding: 12px; margin-top: 14px;
    background: var(--gradient-primary); color: white;
    border: none; border-radius: var(--radius-full);
    font-size: 15px; font-weight: 600; cursor: pointer;
    font-family: inherit; box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.btn-edit:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }
.btn-edit:disabled { opacity: 0.6; cursor: not-allowed; filter: none; }

/* ==================== 移动端弹框 ==================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.50); z-index: 1000;
    display: flex; align-items: flex-end; justify-content: center;
    animation: fadeIn 0.25s cubic-bezier(0.4,0,0.2,1);
    backdrop-filter: blur(2px);
}
.modal-overlay.center { align-items: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
    width: 375px; background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 22px 18px 28px;
    animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
    max-height: 80vh; overflow-y: auto;
}
.modal-dialog {
    width: 320px; background: var(--bg-white);
    border-radius: var(--radius-xl); padding: 26px 22px;
    animation: scaleIn 0.3s cubic-bezier(0.4,0,0.2,1);
    text-align: center; box-shadow: var(--shadow-lg);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scaleIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-sheet h3, .modal-dialog h3 {
    font-size: 16px; font-weight: 600; margin-bottom: 18px;
    color: var(--text-primary);
}
.modal-sheet .form-group { margin-bottom: 12px; }
.modal-sheet .form-group label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 4px;
}
.modal-sheet .form-group input {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    font-family: inherit; outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.modal-sheet .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.08);
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button {
    flex: 1; padding: 11px; border-radius: var(--radius-full);
    font-size: 14px; font-weight: 500; cursor: pointer;
    font-family: inherit; border: none; transition: all var(--transition-fast);
}
.btn-cancel { background: var(--bg-gray); color: var(--text-primary); }
.btn-cancel:hover { background: var(--border); }
.btn-save { background: var(--gradient-primary); color: white; }
.btn-save:hover { filter: brightness(1.05); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }
.modal-dialog .modal-actions { justify-content: center; }
.modal-dialog .modal-actions button { flex: none; padding: 9px 28px; }
.modal-dialog p { color: var(--text-secondary); margin-bottom: 18px; font-size: 13px; }
.modal-overlay.hidden { display: none !important; }

/* ==================== 零件识别 ==================== */
.recognize-area {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 18px; text-align: center; margin-bottom: 14px;
    box-shadow: var(--shadow-xs);
}
.recognize-actions { display: flex; gap: 10px; }
.recognize-actions button {
    flex: 1; padding: 13px 8px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; border: 2px dashed var(--primary);
    background: var(--primary-light); color: var(--primary);
    transition: all var(--transition-fast);
}
.recognize-actions button:hover {
    background: var(--primary);
    color: white;
    border-style: solid;
}
.recognize-area .placeholder {
    padding: 36px; color: var(--text-disabled);
    font-size: 13px;
}
.recognize-area .placeholder .icon {
    font-size: 42px; display: block; margin-bottom: 10px; opacity: 0.6;
}
.result-card {
    background: var(--bg-white); border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-md);
}
.result-card .result-img {
    width: 100%; height: 180px; background: var(--bg-gray);
    display: flex; align-items: center; justify-content: center;
    font-size: 60px; position: relative; overflow: hidden;
}
.result-card .result-img img { width: 100%; height: 100%; object-fit: cover; }
.result-card .result-img .badge {
    position: absolute; top: 10px; right: 10px;
    background: var(--success-dark); color: white;
    padding: 3px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 600;
}
.result-list { padding: 14px; }
.result-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0; border-bottom: 1px solid var(--border);
}
.result-item:last-child { border-bottom: none; }
.result-item .match { font-weight: 700; font-size: 14px; }
.match-high { color: var(--success); }
.match-mid  { color: var(--accent); }
.match-low  { color: var(--danger); }

/* 识别页 - 范围切换 Tab */
.recog-scope-row {
    display: flex; gap: 6px; margin-bottom: 12px;
    background: var(--bg-gray); padding: 4px; border-radius: var(--radius-full);
}
.scope-tab {
    flex: 1; padding: 7px 0; border: none; border-radius: var(--radius-full);
    background: transparent; color: var(--text-secondary);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all var(--transition-fast); font-family: inherit;
}
.scope-tab.active {
    background: var(--bg-white); color: var(--primary); font-weight: 600;
    box-shadow: var(--shadow-xs);
}

/* 识别页 - 候选列表 */
.recog-empty {
    padding: 28px 20px; text-align: center; color: var(--text-secondary);
}
.recog-empty p { font-size: 14px; margin-bottom: 6px; }
.recog-empty small { font-size: 12px; color: var(--text-disabled); }

.recog-candidates {
    padding: 12px; display: flex; flex-direction: column; gap: 12px;
}
.recog-candidate {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: hidden; background: var(--bg-white);
}
.recog-cand-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; background: var(--bg-gray);
}
.recog-cand-thumb {
    width: 50px; height: 50px; border-radius: var(--radius-sm);
    background: white; display: flex; align-items: center; justify-content: center;
    font-size: 24px; overflow: hidden; flex-shrink: 0;
}
.recog-cand-thumb img { width: 100%; height: 100%; object-fit: contain; }
.recog-cand-info { flex: 1; min-width: 0; }
.recog-cand-title {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recog-cand-meta {
    font-size: 12px; color: var(--text-secondary); margin-top: 3px;
    display: flex; gap: 6px; flex-wrap: wrap;
}
.recog-cand-meta strong { color: var(--primary); }
.recog-type-badge {
    background: var(--primary-light); color: var(--primary);
    padding: 1px 7px; border-radius: var(--radius-sm); font-size: 11px;
}
.recog-cand-head .match {
    font-weight: 700; font-size: 14px; min-width: 44px; text-align: right;
}

.recog-cand-actions {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    padding: 8px 12px; border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.recog-cand-actions .recog-add-btn-inline {
    flex-shrink: 0;
}
.recog-inv-count { color: var(--text-secondary); font-weight: 500; }
.recog-bl-link {
    color: var(--primary); text-decoration: none; font-weight: 500;
}
.recog-bl-link:hover { text-decoration: underline; }

.recog-inv-list { padding: 8px 0; }
.recog-inv-item {
    display: flex; flex-direction: column; align-items: stretch;
    padding: 9px 12px;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--bg-gray);
}
.recog-inv-item .recog-inv-main { cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.recog-inv-item .recog-inv-main:active { opacity: 0.85; }
.recog-inv-item:last-child { border-bottom: none; }
.recog-stock-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
}
.recog-stock-label {
    font-size: 12px; color: var(--text-secondary); min-width: 64px;
}
.recog-stock-stepper {
    display: flex; align-items: center; gap: 4px;
}
.recog-stock-btn {
    width: 32px; height: 32px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--bg-white); font-size: 18px; line-height: 1;
    color: var(--text-primary); cursor: pointer;
}
.recog-stock-btn:active { background: var(--bg-gray); }
.recog-stock-input {
    width: 52px; height: 32px; text-align: center; border: 1px solid var(--border);
    border-radius: 6px; font-size: 14px; -moz-appearance: textfield;
}
.recog-stock-input::-webkit-outer-spin-button,
.recog-stock-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.recog-stock-quick { display: flex; gap: 4px; }
.recog-stock-quick button {
    min-width: 36px; height: 28px; padding: 0 6px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--bg-gray); font-size: 12px; cursor: pointer;
}
.recog-stock-quick button:active { background: var(--border); }
.recog-stock-apply {
    margin-left: auto; padding: 6px 12px !important; font-size: 13px !important;
}
.recog-photo-btn {
    padding: 6px 10px !important; font-size: 12px !important; white-space: nowrap;
}
.recog-photo-preview {
    text-align: center; margin-top: 4px;
}
.recog-photo-preview img {
    max-width: 100%; max-height: 160px; border-radius: 8px;
    object-fit: contain; background: var(--bg-gray);
}
.recog-inv-img {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--bg-gray); display: flex; align-items: center;
    justify-content: center; font-size: 20px; overflow: hidden; flex-shrink: 0;
}
.recog-inv-img img { width: 100%; height: 100%; object-fit: cover; }
.recog-inv-info { flex: 1; min-width: 0; }
.recog-inv-title {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recog-inv-meta {
    font-size: 11px; color: var(--text-secondary); margin-top: 2px;
    display: flex; gap: 4px; flex-wrap: wrap;
}
.recog-color-tag {
    background: var(--warning-light); color: var(--accent);
    padding: 1px 6px; border-radius: var(--radius-sm); font-size: 10px;
}
.recog-inv-loc {
    font-size: 12px; color: var(--primary); margin-top: 3px;
    font-weight: 500;
}
.recog-no-match {
    padding: 16px; text-align: center; color: var(--text-secondary);
    font-size: 13px;
}
.recog-no-match a {
    display: inline-block; margin-top: 8px; color: var(--primary);
    text-decoration: none; font-weight: 500;
}
.recog-add-btn-block {
    display: block !important;
    width: calc(100% - 32px) !important;
    max-width: none !important;
    margin: 14px auto 0 !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-sizing: border-box;
}
.recog-add-btn-inline {
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 0 0 auto !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap;
    border: none;
}

/* ==================== 移动端识别记录列表 ==================== */
.record-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
    display: flex;
    gap: 10px;
    align-items: stretch;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.record-card:active {
    transform: scale(0.99);
    background: var(--bg-gray);
}
.record-card .record-card-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--bg-gray) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    color: var(--text-disabled);
    overflow: hidden;
    position: relative;
}
.record-card .record-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.record-card .record-score-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-xs);
}
.record-card .record-score-badge.match-high { color: var(--success); }
.record-card .record-score-badge.match-mid { color: var(--accent); }
.record-card .record-score-badge.match-low { color: var(--danger); }
.record-card .card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}
.record-card .record-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.record-card .record-card-title .record-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--gradient-accent);
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.record-card .record-time-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
}
.record-card .record-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.record-card .record-clock {
    color: var(--text-secondary);
}
.record-card .card-meta span.record-scope {
    background: var(--primary-light);
    color: var(--primary);
}
.record-card .card-meta span.record-match-hint {
    background: #f0f9eb;
    color: var(--success);
}
.record-card .card-loc-row {
    margin-top: 2px;
}
.record-card .record-arrow {
    align-self: center;
    color: var(--text-disabled);
    font-size: 20px;
    font-weight: 300;
    flex-shrink: 0;
    padding-left: 2px;
}

/* 识别记录详情（移动端） */
.record-detail-hero {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin-bottom: 10px;
}
.record-detail-hero .result-img {
    border-radius: 0;
    max-height: min(65vh, 380px);
}
.record-detail-meta {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 4px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
}
.record-detail-meta .info-row:last-child {
    border-bottom: none;
}
.record-detail-candidates {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.record-detail-candidates .recog-candidate {
    box-shadow: var(--shadow-xs);
}

/* 简易 spinner */
.spinner {
    width: 32px; height: 32px; margin: 0 auto;
    border: 3px solid var(--bg-gray); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 个人中心 ==================== */
.profile-header {
    background: var(--gradient-primary);
    color: white; padding: 44px 16px 28px; text-align: center;
}
.profile-avatar {
    width: 68px; height: 68px; border-radius: var(--radius-circle);
    background: rgba(255,255,255,0.2); backdrop-filter: blur(8px);
    margin: 0 auto 10px; display: flex; align-items: center;
    justify-content: center; font-size: 32px;
    border: 2px solid rgba(255,255,255,0.2);
}
.profile-name { font-size: 17px; font-weight: 600; }
.logout-btn {
    width: calc(100% - 28px); margin: 28px 14px; padding: 12px;
    background: var(--bg-white); color: var(--danger);
    border: 2px solid var(--danger); border-radius: var(--radius-full);
    font-size: 15px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all var(--transition-fast);
}
.logout-btn:hover { background: var(--danger); color: white; }

/* ==================== Toast ==================== */
.toast {
    position: fixed; top: 50px; left: 50%; transform: translateX(-50%);
    background: rgba(38, 38, 38, 0.92); color: white;
    padding: 10px 22px; border-radius: var(--radius-full);
    font-size: 13px; font-weight: 500; z-index: 9999;
    animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1);
    transition: opacity var(--transition);
    backdrop-filter: blur(8px);
}
.toast.hidden { opacity: 0; pointer-events: none; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast.success { background: rgba(82, 196, 26, 0.92); }
.toast.error   { background: rgba(245, 34, 45, 0.92); }
.toast.warning { background: rgba(250, 173, 20, 0.92); }

/* ==================== Loading ==================== */
.loading-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8); backdrop-filter: blur(4px);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; z-index: 100; gap: 14px;
}
.spinner {
    width: 36px; height: 36px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: var(--radius-circle);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-secondary); font-size: 13px; }

/* ==================== PC端容器 ==================== */
.pc-container { display: none; width: 100%; min-height: 100vh; }
.pc-container.active { display: flex; width: 100%; }

/* ==================== PC登录 ==================== */
.pc-login {
    flex: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--gradient-sky);
}
.pc-login-card {
    display: flex; width: 820px; height: 500px;
    background: var(--bg-white); border-radius: var(--radius-xl);
    overflow: hidden; box-shadow: var(--shadow-xl);
}
.pc-login-left {
    width: 400px; background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; color: white; padding: 40px;
    position: relative; overflow: hidden;
}
.pc-login-left::after {
    content: ''; position: absolute; top: -50%; right: -50%;
    width: 200px; height: 200px; border-radius: var(--radius-circle);
    background: rgba(255,255,255,0.05);
}
.pc-login-left .left-icon {
    margin-bottom: 18px;
    background: rgba(255,255,255,0.15); backdrop-filter: blur(12px);
    width: 96px; height: 96px; border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.15);
}
.pc-login-left .left-icon svg {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.12));
}
.pc-login-left h2 {
    font-size: 22px; font-weight: 700; margin-bottom: 6px;
    letter-spacing: 0.03em;
}
.pc-login-left p {
    font-size: 13px; opacity: 0.65; letter-spacing: 0.02em;
}
.pc-login-right {
    width: 420px; padding: 56px 44px;
    display: flex; flex-direction: column; justify-content: center;
}
.pc-login-right .sys-logo { text-align: center; margin-bottom: 28px; }
.pc-login-right .sys-logo .logo {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 4px;
}
.pc-login-right h3 {
    font-size: 18px; font-weight: 600; color: var(--text-primary);
}
.pc-login-right .input-group { margin-bottom: 14px; }
.pc-login-right .input-group label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 5px;
}
.pc-login-right .input-group input {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px;
    font-family: inherit; outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.pc-login-right .input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.08);
}
.pc-login-right .login-btn {
    width: 100%; padding: 11px; background: var(--gradient-primary);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: inherit; margin-top: 6px;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.pc-login-right .login-btn:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.pc-login-right .login-btn:disabled {
    background: #A0C4E8; cursor: not-allowed; box-shadow: none;
}

/* ==================== PC主框架 ==================== */
.pc-main { display: flex; min-height: 100vh; width: 100%; }
.pc-sidebar {
    width: var(--sidebar-width); background: var(--sidebar-bg);
    color: white; flex-shrink: 0; display: flex; flex-direction: column;
    z-index: 10;
}
.pc-sidebar .sidebar-logo {
    padding: 16px 18px; font-size: 15px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    height: var(--header-height); letter-spacing: 0.02em;
}
.pc-sidebar .sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.pc-sidebar .sidebar-logo .logo-icon svg {
    flex-shrink: 0;
}
.pc-sidebar .sidebar-menu { flex: 1; padding: 8px 0; list-style: none; }
.pc-sidebar .sidebar-menu li {
    padding: 12px 20px; margin: 2px 8px; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; font-size: 13px; font-weight: 500;
    color: var(--text-white-secondary);
    transition: all var(--transition-fast);
    border-left: none;
}
.pc-sidebar .sidebar-menu li:hover {
    color: white; background: rgba(255,255,255,0.08);
}
.pc-sidebar .sidebar-menu li.active {
    color: white; background: var(--primary);
    box-shadow: var(--shadow-sm);
}
.pc-content-area {
    flex: 1; display: flex; flex-direction: column;
    background: var(--bg-page); min-width: 0;
}
.pc-header {
    height: var(--header-height); background: var(--bg-white);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; border-bottom: 1px solid var(--border);
    flex-shrink: 0; z-index: 5; box-shadow: var(--shadow-xs);
}
.pc-header .breadcrumb { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.pc-header .user-area {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; position: relative; padding: 4px 8px;
    border-radius: var(--radius-sm); transition: background var(--transition-fast);
}
.pc-header .user-area:hover { background: var(--bg-gray); }
.pc-header .user-avatar {
    width: 34px; height: 34px; border-radius: var(--radius-circle);
    background: var(--gradient-primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600;
}
.pc-header .user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.pc-header .dropdown {
    position: absolute; top: 48px; right: 0; background: var(--bg-white);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    min-width: 140px; display: none; z-index: 100;
    overflow: hidden; border: 1px solid var(--border);
}
.pc-header .dropdown.show { display: block; }
.pc-header .dropdown-item {
    padding: 10px 16px; cursor: pointer; font-size: 13px;
    transition: background var(--transition-fast); font-weight: 500;
}
.pc-header .dropdown-item:hover { background: var(--bg-gray); }
.pc-header .dropdown-item.danger { color: var(--danger); }
.pc-header .dropdown-item.danger:hover { background: var(--danger-light); }
.pc-content { flex: 1; padding: 20px 24px; overflow-y: auto; }

/* ==================== PC卡片/表格 ==================== */
.pc-card {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 20px 24px; box-shadow: var(--shadow-xs);
}
.pc-card .action-bar {
    display: flex; gap: 10px; margin-bottom: 16px;
    flex-wrap: wrap; align-items: center;
}
.pc-card .action-bar input[type="text"],
.pc-card .action-bar input[type="date"] {
    padding: 8px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    font-family: inherit; outline: none;
    transition: border-color var(--transition-fast);
}
.pc-card .action-bar input:focus { border-color: var(--primary); }
.pc-card .action-bar select {
    padding: 8px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    font-family: inherit; outline: none; background: var(--bg-white);
}
.btn-primary, .btn-outline {
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; transition: all var(--transition-fast);
}
.btn-primary {
    background: var(--gradient-primary); color: white;
    border: none; box-shadow: var(--shadow-xs);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.btn-outline {
    background: var(--bg-white); color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-sm {
    padding: 4px 10px; font-size: 12px; border-radius: var(--radius-xs);
    border: 1.5px solid var(--border); background: var(--bg-white);
    cursor: pointer; font-family: inherit; margin-right: 3px;
    font-weight: 500; transition: all var(--transition-fast);
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm.danger { color: var(--danger); border-color: var(--danger); }
.btn-sm.danger:hover { background: var(--danger-light); }
.btn-sm.warning { color: var(--accent); border-color: var(--accent); }
.btn-sm.warning:hover { background: var(--warning-light); }

/* PC 表格 */
.pc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pc-table thead { background: #FAFAFA; }
.pc-table th {
    padding: 10px 12px; text-align: left; font-weight: 600;
    color: var(--text-secondary); border-bottom: 1px solid var(--border);
    font-size: 12px; letter-spacing: 0.01em;
    white-space: nowrap;
}
.pc-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.pc-table tbody tr { transition: background var(--transition-fast); }
.pc-table tbody tr:hover { background: var(--primary-light); }
.pc-table tbody tr:nth-child(even):not(:hover) { background: #FAFBFC; }
.pc-table .thumb-img {
    width: 44px; height: 44px; border-radius: var(--radius-xs);
    background: var(--bg-gray); display: flex; align-items: center;
    justify-content: center; font-size: 18px; overflow: hidden;
}
.pc-table .thumb-img img { width: 100%; height: 100%; object-fit: cover; }

/* 状态徽章 */
.status-badge {
    padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600;
    letter-spacing: 0.01em;
}
.status-badge.enabled  { background: var(--success-light); color: var(--success-dark); }
.status-badge.disabled { background: var(--danger-light);  color: var(--danger); }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.tag-success { background: var(--success-light); color: var(--success-dark); }
.tag-warning { background: var(--warning-light); color: var(--accent); }
.tag-danger  { background: var(--danger-light);  color: var(--danger); }

/* ==================== PC弹框 ==================== */
.pc-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.50); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.25s cubic-bezier(0.4,0,0.2,1);
    backdrop-filter: blur(2px);
}
.pc-modal {
    width: 520px; background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s cubic-bezier(0.4,0,0.2,1);
    max-height: 80vh; overflow-y: auto;
}
.pc-modal .modal-header {
    padding: 16px 22px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; font-weight: 600;
}
.pc-modal .modal-close {
    background: none; border: none; font-size: 18px;
    cursor: pointer; color: var(--text-secondary);
    width: 28px; height: 28px; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.pc-modal .modal-close:hover { background: var(--bg-gray); color: var(--text-primary); }
.pc-modal .modal-body { padding: 20px 22px; }
.pc-modal .modal-footer {
    padding: 14px 22px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
}
.form-hint {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.pc-modal .form-group { margin-bottom: 14px; }
.pc-modal .form-group label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 4px;
}
.pc-modal .form-group input,
.pc-modal .form-group select {
    width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    font-family: inherit; outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.pc-modal .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.08);
}

/* ==================== PC筛选器 ==================== */
.filter-select {
    padding: 8px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 12px;
    font-family: inherit; outline: none; background: var(--bg-white);
    color: var(--text-secondary); cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
    min-width: 130px;
}
.filter-select:focus {
    border-color: var(--primary);
    color: var(--text-primary);
}
.filter-select option:checked {
    color: var(--primary);
    font-weight: 600;
}
.pc-pagination {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 6px; margin-top: 14px; font-size: 12px; color: var(--text-secondary);
    flex-wrap: wrap;
}
.pc-pagination button {
    padding: 5px 10px; border: 1.5px solid var(--border);
    background: var(--bg-white); border-radius: var(--radius-xs);
    cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 500;
    transition: all var(--transition-fast); min-width: 32px;
}
.pc-pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pc-pagination button.active {
    background: var(--primary); color: white; border-color: var(--primary);
}
.pc-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pc-pagination button:disabled:hover { border-color: var(--border); color: inherit; }
.pc-pagination .pager-size {
    padding: 4px 6px; border: 1.5px solid var(--border);
    background: var(--bg-white); border-radius: var(--radius-xs);
    cursor: pointer; font-family: inherit; font-size: 12px;
    color: var(--text-secondary); outline: none;
    transition: border-color var(--transition-fast);
}
.pc-pagination .pager-size:focus { border-color: var(--primary); }
.pc-pagination .pager-ellipsis {
    padding: 5px 4px; color: var(--text-disabled);
    font-size: 14px; user-select: none;
}

/* ==================== 行内编辑 ==================== */
.inline-editable {
    cursor: pointer; position: relative; transition: background var(--transition-fast);
}
.inline-editable:hover {
    background: var(--primary-light);
    border-radius: var(--radius-xs);
}
.inline-editable .inline-val {
    border-bottom: 1px dashed transparent;
    transition: border-color var(--transition-fast);
}
.inline-editable:hover .inline-val {
    border-bottom-color: var(--primary);
    color: var(--primary);
}
.inline-edit-wrap {
    display: flex; align-items: center; gap: 4px;
}
.inline-input {
    width: 100%; max-width: 160px;
    padding: 4px 8px; border: 1.5px solid var(--primary);
    border-radius: var(--radius-xs); font-size: 12px;
    font-family: inherit; outline: none; color: var(--text-primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 2px rgba(26, 111, 212, 0.12);
    transition: all var(--transition-fast);
}
.inline-tip {
    font-size: 10px; color: var(--text-disabled);
    white-space: nowrap;
}

/* ==================== 空状态 ==================== */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-disabled); }
.empty-state .icon { font-size: 48px; display: block; margin-bottom: 10px; opacity: 0.5; }
.empty-state p { font-size: 13px; }

/* ==================== 骨架屏 & 加载 ==================== */
.skeleton-list { padding: 0 14px; }
.sk-item {
    display: flex; gap: 12px; align-items: center;
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 12px; margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
}
.sk-img {
    width: 60px; height: 60px; border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--bg-gray) 25%, #e8e8e8 50%, var(--bg-gray) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-line {
    height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-gray) 25%, #e8e8e8 50%, var(--bg-gray) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
.w70 { width: 70%; } .w60 { width: 60%; } .w80 { width: 80%; }
.w40 { width: 40%; } .w30 { width: 30%; } .w50 { width: 50%; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.load-more {
    text-align: center; padding: 14px; color: var(--text-disabled);
    font-size: 12px;
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-disabled); }

.hidden { display: none !important; }

/* ==================== 基础数据子 Tab ==================== */
.basicdata-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 2px solid var(--border); padding-bottom: 8px;
}
.bd-tab {
    padding: 7px 18px; border: 1.5px solid var(--border);
    background: var(--bg-white); border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 500; cursor: pointer;
    font-family: inherit; color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.bd-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.bd-tab.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: var(--shadow-xs); }
.bd-tab small { font-weight: 400; opacity: 0.7; font-size: 10px; }
.bd-tab.active small { opacity: 1; }
.bd-count { font-size: 12px; color: var(--text-secondary); margin-left: auto; white-space: nowrap; }
.bd-table-wrap { overflow-x: auto; }

/* 客户订单子 Tab */
.co-sub-tabs {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.co-tab {
    padding: 7px 18px; border: 1.5px solid var(--border);
    background: var(--bg-white); border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.co-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.co-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.co-scope-row {
    display: flex; gap: 8px; margin-bottom: 12px;
}
.co-scope-row .scope-tab { flex: 1; text-align: center; }
.gf-order-goods {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px; background: var(--bg-gray); border-radius: var(--radius-sm);
    margin-top: 8px;
}
.gf-order-goods img {
    width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0;
}
.gf-order-goods .title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.gf-order-goods .meta { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.gf-status-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
}
.gf-status-badge.st-11, .gf-status-badge.st-12 { background: #fff7e6; color: #d48806; }
.gf-status-badge.st-21 { background: #e6f4ff; color: #1677ff; }
.gf-status-badge.st-22 { background: #e8f8ef; color: #1b7f4a; }
.gf-status-badge.st-23, .gf-status-badge.st-24 { background: #f5f5f5; color: #8c8c8c; }
.gf-status-badge.xhs-st-1 { background: #fff7e6; color: #d48806; }
.gf-status-badge.xhs-st-4 { background: #fff7e6; color: #d48806; }
.gf-status-badge.xhs-st-6 { background: #e6f4ff; color: #1677ff; }
.gf-status-badge.xhs-st-7 { background: #e8f8ef; color: #1b7f4a; }
.gf-status-badge.xhs-st-8, .gf-status-badge.xhs-st-9 { background: #f5f5f5; color: #8c8c8c; }
.gf-ship-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
}
.gf-ship-panel h4 { margin: 0 0 12px; font-size: 15px; }
.gf-ship-panel .gf-ship-row { margin-bottom: 10px; }
.gf-ship-panel .gf-ship-row label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.gf-ship-panel select,
.gf-ship-panel input[type=text],
.gf-ship-panel textarea.gf-ship-remark {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.gf-ship-panel textarea.gf-ship-remark {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
    font-family: inherit;
}
.gf-ship-panel .gf-ship-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}
.gf-ship-panel .gf-ship-custom.hidden { display: none; }

.print-agent-bar { margin-bottom: 10px; }
.print-agent-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.print-agent-status {
    flex: 1;
    min-width: 120px;
    font-size: 12px;
    line-height: 1.4;
}
.print-agent-status.checking { color: var(--text-secondary); }
.print-agent-status.ok { color: #1b7f4a; }
.print-agent-status.warn { color: #d48806; }
.print-agent-status.err { color: #cf1322; }
.print-agent-dialog {
    max-width: 420px;
    width: calc(100vw - 32px);
    text-align: left;
}
.print-agent-dialog .form-group {
    margin-bottom: 10px;
}
.print-agent-dialog .form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.print-agent-dialog .form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-sizing: border-box;
}
.print-agent-steps {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.5;
}

/* ==================== 响应式: 平板 ==================== */
@media (max-width: 1024px) {
    .pc-sidebar { width: 200px; }
    .pc-modal { width: 90vw; }
}

/* ==================== 多选下拉 ==================== */
.multi-select-wrap {
    position: relative;
    display: inline-block;
}
.multi-select-btn {
    padding: 8px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 12px;
    font-family: inherit; outline: none; background: var(--bg-white);
    color: var(--text-secondary); cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
    min-width: 130px; text-align: left; white-space: nowrap;
}
.multi-select-btn:hover { border-color: var(--primary); }
.multi-select-btn.active { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.multi-select-drop {
    position: absolute; top: 100%; left: 0; z-index: 200;
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    min-width: 220px; max-height: 280px; overflow-y: auto;
    margin-top: 4px; padding: 4px 0;
}
.multi-select-drop .ms-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; cursor: pointer; font-size: 12px;
    color: var(--text-primary); white-space: nowrap;
    transition: background var(--transition-fast);
}
.multi-select-drop .ms-item:hover { background: var(--primary-light); }
.multi-select-drop .ms-item input[type="checkbox"] { accent-color: var(--primary); }
.multi-select-drop .ms-actions {
    display: flex; gap: 6px; padding: 6px 12px;
    border-top: 1px solid var(--border);
}
.multi-select-drop .ms-actions button {
    flex: 1; padding: 4px 0; border-radius: var(--radius-xs);
    font-size: 11px; font-family: inherit; cursor: pointer;
    border: 1.5px solid var(--border); background: var(--bg-white);
    transition: all var(--transition-fast);
}
.multi-select-drop .ms-actions button:hover { border-color: var(--primary); color: var(--primary); }
.multi-select-drop .ms-actions button.ms-confirm {
    background: var(--primary); color: white; border-color: var(--primary);
}
.multi-select-drop .ms-actions button.ms-confirm:hover { filter: brightness(1.05); }

/* 移动端多选 */
.m-multi-select-wrap {
    position: relative;
    flex: 1; min-width: 0;
}
.m-multi-select-btn {
    width: 100%; padding: 6px 4px; font-size: 11px;
    font-family: inherit; color: var(--text-secondary);
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); outline: none;
    cursor: pointer; text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.m-multi-select-btn.active { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.m-multi-select-drop {
    position: absolute; top: 100%; left: 0; z-index: 200;
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    min-width: 180px; max-height: 240px; overflow-y: auto;
    margin-top: 4px; padding: 4px 0;
}
.m-multi-select-drop .ms-item {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px; cursor: pointer; font-size: 11px;
    color: var(--text-primary); white-space: nowrap;
    transition: background var(--transition-fast);
}
.m-multi-select-drop .ms-item:hover { background: var(--primary-light); }
.m-multi-select-drop .ms-item input[type="checkbox"] { accent-color: var(--primary); }
.m-multi-select-drop .ms-actions {
    display: flex; gap: 4px; padding: 4px 10px;
    border-top: 1px solid var(--border);
}
.m-multi-select-drop .ms-actions button {
    flex: 1; padding: 3px 0; border-radius: var(--radius-xs);
    font-size: 10px; font-family: inherit; cursor: pointer;
    border: 1.5px solid var(--border); background: var(--bg-white);
    transition: all var(--transition-fast);
}
.m-multi-select-drop .ms-actions button.ms-confirm {
    background: var(--primary); color: white; border-color: var(--primary);
}

/* ==================== BAM 资料库样式 ==================== */
.bam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    padding: 14px 0;
}
.bam-card {
    background: #fff;
    border: 1px solid #ebedf0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}
.bam-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.bam-card .bam-img {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.bam-card .bam-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}
.bam-card .bam-img .placeholder {
    color: #c0c4cc;
    font-size: 32px;
}
.bam-card .bam-info {
    padding: 10px 12px;
    font-size: 13px;
}
.bam-card .bam-info .bam-name {
    font-weight: 600;
    color: var(--text-primary, #303133);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
    line-height: 1.4;
}
.bam-card .bam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
    color: var(--text-disabled, #909399);
}
.bam-card .bam-tag {
    display: inline-block;
    padding: 1px 7px;
    background: #f5f7fa;
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-regular, #606266);
}
.bam-card .bam-tag.year { background: #ecf5ff; color: #409eff; }
.bam-card .bam-tag.wave { background: #f0f9eb; color: #67c23a; }
.bam-card .bam-tag.theme { background: #fdf6ec; color: #e6a23c; }
.bam-card .bam-tag.new { background: #fef0f0; color: #f56c6c; }
.mobile-navbar .nav-action-btn {
    margin-left: auto;
    border: none;
    background: transparent;
    font-size: 22px;
    color: var(--primary, #409eff);
    padding: 4px 8px;
    cursor: pointer;
}
/* ==================== 移动端通用业务组件（进货/订单等复用） ==================== */
.mobile-body {
    padding: 14px;
}
.empty-tip {
    text-align: center; padding: 28px 16px;
    color: var(--text-disabled); font-size: 13px;
}
.btn-block {
    display: block; width: 100%;
    padding: 12px; margin-top: 8px;
    border-radius: var(--radius-full);
    font-size: 15px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    border: none; transition: all var(--transition-fast);
}
.btn-primary.btn-block {
    background: var(--gradient-primary); color: #fff;
    box-shadow: var(--shadow-xs);
}
.btn-primary.btn-block:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.btn-secondary.btn-block {
    background: var(--bg-white); color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-secondary.btn-block:hover { background: var(--primary-light); }
.btn-cancel.btn-block {
    background: var(--bg-gray); color: var(--text-primary);
}
.btn-cancel.btn-block:hover { background: var(--border); }

.m-stat-banner, .purchase-stat-row {
    display: flex; gap: 16px;
    padding: 10px 12px; margin-bottom: 12px;
    background: var(--warning-light);
    border-radius: var(--radius-md);
    font-size: 13px; color: var(--accent);
}
.m-list-card, .purchase-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 12px; margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.m-list-card:hover, .purchase-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}
.m-card-head, .purchase-card-head {
    display: flex; justify-content: space-between; align-items: center;
}
.m-card-no, .purchase-no {
    font-weight: 600; font-size: 14px; color: var(--text-primary);
}
.m-card-meta, .purchase-card-meta,
.m-card-foot, .purchase-card-foot {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--text-secondary);
    margin-top: 6px;
}
.m-status, .purchase-status {
    font-size: 11px; font-weight: 600;
    padding: 2px 10px; border-radius: 10px;
    letter-spacing: 0.01em;
}
.m-status--draft, .po-st-draft { background: var(--bg-gray); color: var(--text-secondary); }
.m-status--paid, .po-st-paid { background: var(--primary-light); color: var(--primary); }
.m-status--received, .po-st-received, .m-status--pending { background: var(--warning-light); color: var(--accent); }
.m-status--done, .po-st-stocked, .m-status--completed { background: var(--success-light); color: var(--success-dark); }
.m-status--cancelled, .po-st-cancelled { background: var(--danger-light); color: var(--danger); }

.m-section-head, .purchase-items-head {
    display: flex; justify-content: space-between; align-items: center;
    margin: 12px 0 8px; font-weight: 600; font-size: 14px;
    color: var(--text-primary);
}
.m-section-title {
    margin: 16px 0 8px; font-size: 14px; font-weight: 600;
    color: var(--text-primary);
}
.btn-link {
    border: none; background: none; color: var(--primary);
    font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn-link.danger { color: var(--danger); }

.m-form .form-group, .purchase-form-body .form-group {
    margin-bottom: 12px;
}
.m-form label, .purchase-form-body label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 4px;
}
.m-form input[type="text"],
.m-form input[type="date"],
.m-form input[type="number"],
.m-form input[type="tel"],
.m-form input[type="search"],
.m-form textarea,
.m-form select,
.purchase-form-body input[type="text"],
.purchase-form-body input[type="date"],
.purchase-form-body input[type="number"] {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.m-form input:focus,
.m-form textarea:focus,
.m-form select:focus,
.purchase-form-body input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.08);
}
.m-form input:disabled,
.m-form select:disabled,
.purchase-form-body input:disabled,
.purchase-form-body select:disabled {
    background: var(--bg-gray); color: var(--text-disabled);
}

.m-line-card, .purchase-line-card, .po-stock-line {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 12px; margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}
.m-line-card input, .m-line-card select,
.purchase-line-card input, .purchase-line-card select,
.po-stock-line select {
    width: 100%; margin-top: 6px;
    padding: 8px 10px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
}
.m-line-head, .purchase-line-head, .po-stock-line .head {
    display: flex; justify-content: space-between;
    font-size: 13px; font-weight: 600; margin-bottom: 4px;
}
.m-line-card label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); margin-top: 8px; margin-bottom: 4px;
}
.m-line-card .sub {
    color: var(--text-secondary); font-size: 12px; margin-bottom: 4px;
}
.m-line-row, .purchase-line-row { display: flex; gap: 8px; }
.m-line-row input, .purchase-line-row input { flex: 1; }

.m-detail-panel, .purchase-detail-card { padding: 0; }
.m-detail-head, .purchase-detail-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.m-detail-head h3, .purchase-detail-head h3 {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
}
.mobile-body .info-row {
    display: flex; justify-content: space-between;
    padding: 9px 0; border-bottom: 1px solid var(--border);
    font-size: 13px; align-items: center;
}
.mobile-body .detail-info .info-row:last-child,
.mobile-body .detail-info .info-row:last-of-type { border-bottom: none; }
.mobile-body .info-label { color: var(--text-secondary); font-weight: 500; }
.mobile-body .info-value, .mobile-body .info-row > span:last-child {
    font-weight: 600; color: var(--text-primary);
    text-align: right; max-width: 60%;
}
.mobile-body .info-row-multiline { align-items: stretch; gap: 6px; }
.mobile-body .info-row-multiline .info-value,
.mobile-body .info-row-multiline > span:last-child,
.mobile-body .info-value.xhs-title-value {
    max-width: 100%;
    text-align: left;
    word-break: break-all;
    line-height: 1.5;
    font-weight: 500;
    white-space: normal;
}
.m-detail-item, .purchase-detail-item {
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.m-detail-item:last-child, .purchase-detail-item:last-child { border-bottom: none; }
.m-detail-item .sub, .purchase-detail-item .sub {
    color: var(--text-secondary); font-size: 12px; margin-top: 4px;
}
.cand-badge {
    display: inline-block;
    vertical-align: middle;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}
.goofish-badge {
    display: inline-block;
    vertical-align: middle;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    white-space: nowrap;
}
.goofish-badge.goofish-success { background: #e8f8ef; color: #1b7f4a; }
.goofish-badge.goofish-info { background: #e8f4fd; color: #1677ff; }
.goofish-badge.goofish-warning { background: #fff7e6; color: #d48806; }
.goofish-badge.goofish-error { background: #fff1f0; color: #cf1322; }
.goofish-badge.goofish-muted { background: #f5f5f5; color: #8c8c8c; }
.xhs-badge {
    display: inline-block;
    vertical-align: middle;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    white-space: nowrap;
}
.xhs-badge.xhs-success { background: #ffe8ec; color: #ff2442; }
.xhs-badge.xhs-info { background: #fff0f3; color: #e61e45; }
.xhs-badge.xhs-warning { background: #fff7e6; color: #d48806; }
.xhs-badge.xhs-error { background: #fff1f0; color: #cf1322; }
.xhs-badge.xhs-muted { background: #f5f5f5; color: #8c8c8c; }
.m-goofish-body { padding-bottom: 88px; }
.m-goofish-option {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; margin: 10px 0;
}
.m-goofish-cat {
    font-size: 12px; color: var(--text-secondary); margin-bottom: 12px;
}
.m-goofish-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; margin-bottom: 8px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.m-goofish-card input { flex-shrink: 0; width: 18px; height: 18px; }
.m-goofish-card-img {
    width: 52px; height: 52px; flex-shrink: 0;
    border-radius: 6px; overflow: hidden;
    background: var(--bg-gray);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.m-goofish-card-img img { width: 100%; height: 100%; object-fit: cover; }
.m-goofish-card-info { flex: 1; min-width: 0; }
.m-goofish-card-title {
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-goofish-card-meta {
    font-size: 12px; color: var(--text-secondary); margin-top: 4px;
}
.m-goofish-bar {
    position: fixed; left: 0; right: 0; bottom: 0;
    display: flex; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
    z-index: 20;
}
.m-goofish-bar .btn-outline,
.m-goofish-bar .btn-primary { flex: 1; margin: 0; }
.m-goofish-bar.is-busy .btn-outline,
.m-goofish-bar.is-busy .btn-primary {
    opacity: 0.55;
    pointer-events: none;
}
.m-goofish-loading {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.m-goofish-loading.hidden { display: none; }
.mobile-navbar .nav-action-btn { color: #fff; }
.m-create-element-picker { margin-top: 10px; }
.m-create-element-hint {
    padding: 10px 12px; font-size: 12px; color: var(--text-secondary);
    background: var(--bg-gray); border-radius: var(--radius-sm); text-align: center;
}
.m-create-element-head {
    font-size: 12px; color: var(--text-secondary); margin-bottom: 8px;
}
.m-create-element-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 220px; overflow-y: auto;
}
.m-create-element-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-white);
    text-align: left; cursor: pointer; font-family: inherit;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.m-create-element-item b {
    flex-shrink: 0; font-size: 13px; color: var(--primary); min-width: 72px;
}
.m-create-element-item span {
    font-size: 12px; color: var(--text-secondary); line-height: 1.35;
}
.m-create-element-item span .sub { color: var(--text-disabled); }
.m-create-element-item.selected {
    border-color: var(--primary); background: var(--primary-light);
}
.m-create-element-item:active { filter: brightness(0.98); }

.m-element-candidates-wrap {
    margin: 14px 0 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #e8eaed);
}
.m-element-candidates-wrap .m-section-head {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.m-element-candidates-wrap .m-section-head .sub {
    margin-left: 0;
}
.m-element-candidates-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin: -4px 0 8px;
}
.m-element-candidates-ids {
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f5f7fa;
    border-radius: 8px;
    cursor: copy;
}
.m-element-candidates-ids .label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.m-element-candidates-ids code {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    word-break: break-all;
    color: var(--text-primary);
}
.m-element-candidates-more {
    display: block;
    width: 100%;
    text-align: center;
    margin: 6px 0 2px;
}
.m-element-candidates-wrap .m-section-head .sub {
    margin-left: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
}
.m-element-candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 10px;
}
.m-element-candidate {
    border: 1px solid var(--border-color, #e8eaed);
    border-radius: 10px;
    padding: 8px;
    background: var(--card-bg, #fff);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.m-element-candidate.suggested {
    border-color: var(--primary, #1a73e8);
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.15);
}
.m-element-candidate-img {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}
.m-element-candidate-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.m-element-candidate-img .ph { font-size: 28px; opacity: 0.5; }
.m-element-candidate-tag {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 4px;
    background: var(--primary, #1a73e8);
    color: #fff;
}
.m-element-candidate-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    line-height: 1.3;
    word-break: break-all;
}
.m-element-candidate-meta b { font-size: 12px; }
.m-element-candidate-meta span { color: var(--text-secondary); }
.m-element-candidate .btn-sm {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
}
#pcProductElementCandidates { margin: 4px 0 12px; }

.m-purchase-history-wrap {
    margin: 16px 0 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #e8eaed);
}
.m-purchase-history-wrap .m-section-head {
    margin-bottom: 8px;
}
.m-purchase-history-wrap .m-section-head .sub {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
}
.m-purchase-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.m-purchase-history-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-gray, #f5f7fa);
    border: 1px solid var(--border-color, #e8eaed);
}
.m-purchase-history-item:active {
    background: var(--bg-gray-hover, #eef1f5);
}
.m-purchase-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.m-purchase-history-no {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.m-purchase-history-meta {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
#pcProductPurchaseHistory .m-purchase-history-item {
    cursor: default;
}
.m-actions, .purchase-actions {
    margin-top: 16px; display: flex; flex-direction: column; gap: 0;
}

.m-line-pick-row, .po-line-pick-row {
    display: flex; gap: 8px; margin-top: 6px; align-items: center;
}
.m-line-pick-row .btn-secondary, .po-line-pick-row .btn-secondary {
    flex: 1; font-size: 12px; padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--primary-light); color: var(--primary);
    border: 1.5px solid var(--primary); font-weight: 500;
    cursor: pointer; font-family: inherit;
}
.m-linked-box, .po-linked-box {
    display: flex; gap: 8px; align-items: center;
    margin-top: 8px; padding: 8px 10px;
    background: var(--primary-light);
    border-radius: var(--radius-md); font-size: 12px;
}
.m-linked-box img, .po-linked-box img {
    width: 40px; height: 40px; object-fit: contain;
    border-radius: var(--radius-xs); background: var(--bg-white);
}
.m-linked-meta, .po-linked-meta { flex: 1; min-width: 0; }
.m-linked-meta .title, .po-linked-meta .title {
    font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-linked-meta .sub, .po-linked-meta .sub {
    color: var(--text-secondary); margin-top: 2px;
}

.m-suggest-wrap, .po-suggest-wrap { position: relative; }
.m-suggest-dropdown, .po-suggest-dropdown {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
    max-height: 200px; overflow-y: auto; background: var(--bg-white);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.m-suggest-item, .po-suggest-item {
    padding: 8px 10px; font-size: 12px;
    border-bottom: 1px solid var(--border); cursor: pointer;
}
.m-suggest-item:active, .po-suggest-item:active { background: var(--bg-gray); }
.m-suggest-item .tag, .po-suggest-item .tag {
    display: inline-block; font-size: 10px; padding: 1px 5px;
    border-radius: var(--radius-xs); margin-right: 4px;
    background: var(--bg-gray); color: var(--text-secondary);
}

.m-sheet-overlay, .po-pick-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(0,0,0,.45);
    display: flex; align-items: flex-end; justify-content: center;
}
.m-sheet-overlay.hidden, .po-pick-overlay.hidden { display: none; }
.m-sheet-panel, .po-pick-panel {
    width: 100%; max-width: 480px; max-height: 80vh;
    background: var(--bg-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 12px 14px 20px; overflow: hidden;
    display: flex; flex-direction: column;
    animation: slideUp 0.28s cubic-bezier(0.4,0,0.2,1);
}
.m-sheet-head, .po-pick-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; font-weight: 600; font-size: 15px;
}
.m-sheet-filter-row {
    padding: 0 12px 8px;
}
.m-sheet-filter-row.hidden { display: none; }
.m-sheet-filter-row .m-sheet-search {
    margin-bottom: 0;
}
.m-filter-input.full {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e8eaed);
    border-radius: var(--radius-sm, 8px);
    font-size: 14px;
    box-sizing: border-box;
}
.m-sheet-search, .po-pick-search {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-md);
    margin-bottom: 8px; font-family: inherit; font-size: 14px;
}
.m-sheet-search:focus, .po-pick-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.08);
    outline: none;
}
.m-sheet-list, .po-pick-list { overflow-y: auto; flex: 1; }
.m-sheet-load-more {
    padding: 12px 0 4px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}
.m-sheet-load-more.loading { color: var(--text-tertiary, #999); }
.m-sheet-group, .po-pick-group { margin-bottom: 10px; }
.m-sheet-group-title, .po-pick-group-title {
    font-size: 12px; color: var(--text-secondary); margin-bottom: 4px;
}
.m-sheet-row, .po-pick-row {
    display: flex; gap: 8px; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.m-sheet-row:active, .po-pick-row:active { background: var(--bg-gray); }
.m-sheet-row img, .po-pick-row img {
    width: 36px; height: 36px; object-fit: contain;
    border-radius: var(--radius-xs); background: var(--bg-gray);
}
.m-sheet-row .info, .po-pick-row .info { flex: 1; min-width: 0; font-size: 12px; }
.m-sheet-row .info b, .po-pick-row .info b {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-sheet-row .pick-subname, .po-pick-row .pick-subname,
.m-suggest-item .sub {
    display: block;
    color: var(--text-secondary, #888);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m-suggest-item b { font-weight: 600; margin-right: 4px; }
.m-suggest-item .sub { margin-top: 2px; }
.purchase-summary { margin-bottom: 0; }

.bam-card .bam-number {
    color: #909399;
    font-size: 11px;
    font-weight: normal;
    margin-left: 6px;
}

/* 移动端 BAM 网格 */
.bam-grid-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 0;
}
.bam-grid-mobile .bam-card .bam-info {
    padding: 8px 10px;
}
.bam-grid-mobile .bam-card .bam-name {
    font-size: 12px;
}
.bam-grid-mobile .bam-card .bam-meta {
    font-size: 10px;
}
.bam-grid-mobile .bam-card .bam-tag {
    font-size: 10px;
    padding: 1px 5px;
}

/* BAM 绑定选择器 */
.bam-link-modal { max-width: 720px; width: 94vw; max-height: 90vh; display: flex; flex-direction: column; }
.bam-link-modal .modal-body { overflow-y: auto; flex: 1; }
.bam-link-product { margin-bottom: 12px; padding: 10px 12px; background: #f5f7fa; border-radius: 8px; }
.bam-link-product-sub { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.bam-link-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bam-link-toolbar input { flex: 1; min-width: 140px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.bam-link-toolbar select { padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.bam-link-section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin: 12px 0 8px; }
.bam-link-hint { font-size: 12px; color: var(--text-disabled); margin: 8px 0; }
.bam-link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.bam-link-card { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.bam-link-card:hover { border-color: var(--primary); }
.bam-link-card.is-current { border-color: #e65100; background: #fff8f0; }
.bam-link-current-tag { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; color: #e65100; }
.bam-link-current-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.bam-link-current-wrap .bam-link-card { flex: 1; min-width: 200px; }
.bam-link-clear-btn { flex-shrink: 0; margin-top: 8px; }
.bam-link-img { width: 64px; height: 64px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: #f0f2f5; }
.bam-link-img img { width: 100%; height: 100%; object-fit: cover; }
.bam-link-info { flex: 1; min-width: 0; }
.bam-link-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.bam-link-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.bam-link-reason { font-size: 11px; color: #e65100; margin-top: 4px; }
.bam-link-select-btn { margin-top: 6px; }
.bam-link-loading { text-align: center; padding: 16px; color: var(--text-disabled); }

/* BAM 详情页 */
.bam-detail-card {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}
.bam-detail-card .bam-detail-img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 14px;
    background: #f5f7fa;
}
.bam-detail-card .bam-detail-name {
    font-size: 17px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 10px;
}
.bam-detail-card .bam-detail-row {
    display: flex;
    margin: 6px 0;
    font-size: 13px;
}
.bam-detail-card .bam-detail-row .label {
    color: #909399;
    min-width: 80px;
}
.bam-detail-card .bam-detail-row .value {
    color: #303133;
    flex: 1;
}
.bam-detail-card .bam-detail-notes {
    margin-top: 12px;
    padding: 10px;
    background: #fdf6ec;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: #b88230;
}

/* ==================== 响应式: 平板/小屏 ==================== */
@media (max-width: 768px) {
    .pc-container.active { display: none; }
    .pc-sidebar { display: none; }
    .pc-login-card { flex-direction: column; width: 90vw; height: auto; }
    .pc-login-left, .pc-login-right { width: 100%; }
    .pc-login-left { padding: 30px 20px; }
    .pc-login-right { padding: 30px 24px; }
}

.xhs-tracking-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
    max-width: 220px;
}
.xhs-tracking-panel { margin-top: 12px; }
.xhs-tracking-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 8px;
    border-left: 2px solid var(--border);
}
.xhs-tracking-timeline li {
    position: relative;
    padding: 0 0 12px 14px;
    font-size: 13px;
}
.xhs-tracking-timeline li::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}
.xhs-tracking-timeline li:first-child::before { background: #52c41a; }
.xhs-tracking-timeline .time { color: var(--text-secondary); font-size: 12px; }
.xhs-tracking-timeline .loc { color: var(--text-secondary); font-size: 12px; }

.xhs-alert-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.3;
    max-width: 220px;
    white-space: normal;
}
.xhs-alert-badge.danger { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.xhs-alert-badge.warning { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.xhs-tracking-alert-bar {
    margin: 8px 0 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
}
.xhs-tracking-alert-bar.danger { background: #fff1f0; color: #a8071a; border: 1px solid #ffa39e; }
.xhs-tracking-alert-bar.warning { background: #fffbe6; color: #ad6800; border: 1px solid #ffe58f; }
