/* ==================== Figma 设计令牌 ==================== */
:root {
    /* 主色系 */
    --primary: #1A6FD4;
    --primary-hover: #1558A8;
    --primary-light: #E6F4FF;
    --primary-dark: #0D4FA3;

    /* 语义色 */
    --accent: #D4700A;
    --success: #52C41A;
    --success-light: #ECFDF3;
    --success-dark: #008A2E;
    --warning: #FAAD14;
    --warning-light: rgba(250, 173, 20, 0.10);
    --danger: #F5222D;
    --danger-light: rgba(245, 34, 45, 0.10);

    /* 文字 */
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-disabled: #BFBFBF;
    --text-white-secondary: rgba(255, 255, 255, 0.65);

    /* 背景 */
    --bg-white: #FFFFFF;
    --bg-gray: #F5F7FA;
    --bg-page: #F0F2F5;
    --border: #E8E8E8;

    /* Figma 风格渐变 */
    --gradient-primary: linear-gradient(135deg, #1A6FD4 0%, #196DD0 7%, #186ACD 14%, #1768C9 21%, #1666C6 29%, #1563C2 36%, #1461BF 43%, #135FBB 50%, #125DB8 57%, #125AB4 64%, #1158B1 71%, #1056AD 79%, #0F53AA 86%, #0E51A6 93%, #0D4FA3 100%);
    --gradient-accent: linear-gradient(135deg, #1A6FD4 0%, #3472CA 7%, #4675C0 14%, #5677B6 21%, #6378AC 29%, #7079A1 36%, #7D7A97 43%, #887A8C 50%, #947A80 57%, #9F7A74 64%, #AA7967 71%, #B57758 79%, #BF7548 86%, #CA7333 93%, #D4700A 100%);
    --gradient-success: linear-gradient(135deg, #52C41A 0%, #50C119 10%, #4EBE19 20%, #4CBB18 30%, #4AB718 40%, #48B417 50%, #47B117 60%, #45AE16 70%, #43AB16 80%, #41A815 90%, #3FA515 100%);
    --gradient-sky: linear-gradient(135deg, #E6F4FF 0%, #E3F2FF 14%, #E1F1FF 29%, #DEEFFF 43%, #DCEDFF 57%, #D9EBFF 71%, #D7EAFF 86%, #D4E8FF 100%);
    --gradient-gray: linear-gradient(135deg, #F5F7FA 0%, #F2F4F6 20%, #F0F1F3 40%, #EDEEEF 60%, #EBEBEC 80%, #E8E8E8 100%);

    /* Figma 阴影 (多层级) */
    --shadow-xs: 0px 1px 2px -1px rgba(0, 0, 0, 0.10), 0px 1px 3px rgba(0, 0, 0, 0.10);
    --shadow-sm: 0px 2px 4px -2px rgba(0, 0, 0, 0.10), 0px 4px 6px -1px rgba(0, 0, 0, 0.10);
    --shadow-md: 0px 4px 12px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0px 4px 6px -4px rgba(0, 0, 0, 0.10), 0px 10px 15px -3px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0px 20px 40px -8px rgba(0, 0, 0, 0.12), 0px 8px 16px -4px rgba(0, 0, 0, 0.08);

    /* 圆角 */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 20px;
    --radius-circle: 50%;

    /* 布局 */
    --sidebar-bg: #001529;
    --sidebar-width: 220px;
    --header-height: 60px;

    /* 动效 */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 全局重置 ==================== */
* { 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; }
.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%; }
.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;
    padding: 8px 12px; border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.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; align-items: center; gap: 10px;
    padding: 9px 12px; cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--bg-gray);
}
.recog-inv-item:last-child { border-bottom: none; }
.recog-inv-item:active { 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;
}

/* ==================== 移动端识别记录列表 ==================== */
.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;
}
.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; }

/* ==================== 响应式: 平板 ==================== */
@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;
}
.purchase-summary { margin-bottom: 12px; }
.purchase-stat-row {
    display: flex;
    gap: 16px;
    padding: 10px 12px;
    background: #fff7e6;
    border-radius: 8px;
    font-size: 13px;
    color: #ad6800;
}
.purchase-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    cursor: pointer;
}
.purchase-card-head { display: flex; justify-content: space-between; align-items: center; }
.purchase-no { font-weight: 600; font-size: 14px; }
.purchase-status { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.po-st-draft { background: #f4f4f5; color: #909399; }
.po-st-paid { background: #ecf5ff; color: #409eff; }
.po-st-received { background: #fdf6ec; color: #e6a23c; }
.po-st-stocked { background: #f0f9eb; color: #67c23a; }
.po-st-cancelled { background: #fef0f0; color: #f56c6c; }
.purchase-card-meta, .purchase-card-foot {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary, #909399);
    margin-top: 6px;
}
.purchase-line-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}
.purchase-line-card input, .purchase-line-card select { width: 100%; margin-top: 6px; }
.purchase-line-row { display: flex; gap: 8px; }
.purchase-line-row input { flex: 1; }
.purchase-line-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.purchase-items-head { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 8px; }
.btn-link { border: none; background: none; color: var(--primary); font-size: 13px; }
.btn-link.danger { color: #f56c6c; }
.purchase-detail-card { padding: 4px 0; }
.purchase-detail-item { padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.purchase-detail-item .sub { color: #909399; font-size: 12px; margin-top: 4px; }
.purchase-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.purchase-form-body .form-group { margin-bottom: 12px; }
.purchase-form-body label { display: block; font-size: 13px; color: #606266; margin-bottom: 4px; }
.purchase-form-body input[type="text"],
.purchase-form-body input[type="date"],
.purchase-form-body input[type="number"] { width: 100%; padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 6px; }
.purchase-form-body input:disabled, .purchase-form-body select:disabled { background: #f5f7fa; color: #909399; }
.po-line-pick-row { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.po-line-pick-row .btn-secondary { flex: 1; font-size: 12px; padding: 6px 8px; }
.po-linked-box {
    display: flex; gap: 8px; align-items: center;
    margin-top: 8px; padding: 8px; background: #ecf5ff; border-radius: 8px; font-size: 12px;
}
.po-linked-box img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; background: #fff; }
.po-linked-meta { flex: 1; min-width: 0; }
.po-linked-meta .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-linked-meta .sub { color: #909399; margin-top: 2px; }
.po-suggest-wrap { position: relative; }
.po-suggest-dropdown {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
    max-height: 200px; overflow-y: auto; background: #fff;
    border: 1px solid #dcdfe6; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.po-suggest-item {
    padding: 8px 10px; font-size: 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.po-suggest-item:active { background: #f5f7fa; }
.po-suggest-item .tag { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-right: 4px; background: #f4f4f5; color: #606266; }
.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;
}
.po-pick-overlay.hidden { display: none; }
.po-pick-panel {
    width: 100%; max-width: 480px; max-height: 80vh; background: #fff;
    border-radius: 12px 12px 0 0; padding: 12px 14px 20px; overflow: hidden; display: flex; flex-direction: column;
}
.po-pick-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; }
.po-pick-search { width: 100%; padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 8px; margin-bottom: 8px; }
.po-pick-list { overflow-y: auto; flex: 1; }
.po-pick-group { margin-bottom: 10px; }
.po-pick-group-title { font-size: 12px; color: #909399; margin-bottom: 4px; }
.po-pick-row {
    display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.po-pick-row img { width: 36px; height: 36px; object-fit: contain; border-radius: 4px; background: #fafafa; }
.po-pick-row .info { flex: 1; min-width: 0; font-size: 12px; }
.po-pick-row .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-stock-line {
    background: #fafafa; border-radius: 8px; padding: 10px; margin-bottom: 10px; font-size: 13px;
}
.po-stock-line .head { font-weight: 600; margin-bottom: 6px; }
.po-stock-line select { width: 100%; margin-top: 6px; padding: 6px 8px; border-radius: 6px; border: 1px solid #dcdfe6; }

.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; }
}
