/* ============================================
   千牛揽收助手 - 手机端专属样式
   仅在 max-width: 768px 时生效
   ============================================ */

/* ========== 默认隐藏手机端专属元素 ========== */
.mobile-quick-bar { display: none; }
.mobile-status-bar { display: none; }

/* ========== 手机端媒体查询 ========== */
@media (max-width: 768px) {

    /* --- 顶部状态栏 --- */
    .mobile-status-bar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 8px 16px;
        padding-top: calc(8px + env(safe-area-inset-top, 0px));
        background: var(--bg-card, #fff);
        border-bottom: 1px solid var(--border-color, #e5e7eb);
        font-size: 13px;
        flex-shrink: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    .mobile-status-left {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .mobile-status-right {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .mobile-status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ef4444;
        flex-shrink: 0;
    }
    .mobile-status-dot.online {
        animation: onlinePulse 2s infinite;
    }
    .mobile-status-text {
        color: var(--text-primary, #1f2937);
        font-weight: 500;
    }
    .mobile-status-mode {
        color: var(--text-tertiary, #6b7280);
        font-size: 12px;
    }
    .mobile-theme-btn {
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: var(--text-primary, #1f2937);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
    }
    .mobile-theme-btn:active {
        transform: scale(0.85);
        opacity: 0.6;
    }
    /* 深色模式下主题按钮颜色 */
    [data-theme="dark"] .mobile-theme-btn {
        background: transparent;
        color: #f3f4f6;
    }
    [data-theme="dark"] .mobile-theme-btn:active {
        opacity: 0.6;
    }
    /* 手机端用户头像按钮 */
    .mobile-avatar-btn {
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: transparent;
        padding: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        position: relative;
    }
    .mobile-avatar-btn:active {
        transform: scale(0.9);
        opacity: 0.7;
    }
    .mobile-avatar-wrap {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary, #3b82f6), var(--primary-light, #60a5fa));
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background-size: cover;
        background-position: center;
    }
    .mobile-avatar-text {
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
    }
    /* 手机端用户菜单 */
    .mobile-user-menu {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        min-width: 220px;
        background: var(--bg-card, #fff);
        border: 1px solid var(--border-color, #e5e7eb);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        padding: 6px 0;
        z-index: 1001;
        display: none;
        overflow: hidden;
    }
    .mobile-user-menu.show {
        display: block;
    }
    .mobile-user-menu .auth-menu-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        font-size: 15px;
        color: var(--text-primary, #1f2937);
        cursor: pointer;
        transition: background 0.15s;
        position: relative;
    }
    .mobile-user-menu .auth-menu-item:active {
        background: var(--bg-hover, #f3f4f6);
    }
    .mobile-user-menu .auth-menu-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    .mobile-user-menu .auth-menu-divider {
        height: 1px;
        background: var(--border-color, #e5e7eb);
        margin: 4px 8px;
    }
    .mobile-user-menu .auth-menu-item.danger {
        color: #ef4444;
    }
    .mobile-user-menu .auth-menu-badge {
        margin-left: auto;
        font-size: 11px;
        font-weight: 600;
        color: #fff !important;
    }
    [data-theme="dark"] .mobile-user-menu {
        background: var(--bg-card, #1f2937);
        border-color: var(--border-color, #374151);
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }
    [data-theme="dark"] .mobile-user-menu .auth-menu-item {
        color: var(--text-primary, #e5e7eb);
    }
    [data-theme="dark"] .mobile-user-menu .auth-menu-item:active {
        background: rgba(255,255,255,0.08);
    }
    [data-theme="dark"] .mobile-user-menu .auth-menu-divider {
        background: var(--border-color, #374151);
    }
    /* 菜单内签到按钮适配 */
    .mobile-user-menu .menu-checkin-btn {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        height: 24px;
        padding: 0 12px;
        border-radius: 12px;
        font-size: 11px;
    }
    /* 远程启动按钮 */
    .mobile-launch-btn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 5px 10px;
        border: none;
        border-radius: 14px;
        background: linear-gradient(135deg, var(--primary, #3b82f6), var(--primary-light, #60a5fa));
        color: #fff;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
    .mobile-launch-btn:active {
        transform: scale(0.92);
        opacity: 0.8;
    }
    [data-theme="dark"] .mobile-launch-btn {
        background: linear-gradient(135deg, #93c5fd, #a78bfa);
    }
    [data-theme="dark"] .mobile-status-bar {
        background: #1f2937;
        border-bottom-color: #374151;
    }
    [data-theme="dark"] .mobile-status-text {
        color: #f3f4f6;
    }
    [data-theme="dark"] .mobile-status-mode {
        color: #9ca3af;
    }

    /* --- 对话模式容器顶部留出状态栏空间 --- */
    .chat-mode-container {
        padding-top: 40px !important;
    }

    /* --- 隐藏经典模式元素 --- */
    .top-bar { display: none !important; }
    .titlebar { display: none !important; }
    .sidebar, .app-sidebar, .left-sidebar { display: none !important; }
    /* 对话模式侧边栏：使用高优先级选择器覆盖 member-chat.css */
    body.chat-mode-body .chat-sidebar { display: none !important; }
    .sidebar-toggle-btn { display: none !important; }

    /* --- 主内容区全屏 --- */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .content-area {
        padding: 0 !important;
        margin: 0 !important;
    }
    /* 手机端对话模式容器全屏（ID选择器，优先级匹配member-chat.css） */
    body.chat-mode-body #chatMode.chat-mode-container {
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        padding: 0 !important;
        margin: 0 !important;
        padding-top: 40px !important;
        position: fixed !important;
    }
    .chat-header { display: none !important; }

    /* --- 隐藏快捷指令栏 --- */
    #remoteOnlineStatus { display: none !important; }


    /* --- 欢迎页面 --- */
    .chat-welcome {
        padding: 20px 15px !important;
    }
    .chat-welcome-icon {
        width: 64px !important;
        height: 64px !important;
    }
    .chat-welcome-tags {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    .welcome-tag {
        flex: 0 0 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        justify-content: center !important;
    }

    /* --- 手机端专属快捷按钮栏 --- */
    .mobile-quick-bar {
        display: flex !important;
        gap: 6px;
        padding: 4px 12px 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
        scrollbar-width: none;
        justify-content: flex-start;
    }
    .mobile-quick-bar::-webkit-scrollbar {
        display: none;
    }
    .mobile-quick-btn {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 0 0 auto;
        min-width: auto;
        height: 28px;
        padding: 0 10px;
        border: none;
        border-radius: 14px;
        background: rgba(59, 130, 246, 0.08);
        color: var(--text-primary, #1f2937);
        font-size: 12px;
        font-weight: 500;
        flex-shrink: 0;
        white-space: nowrap;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        z-index: 10;
    }
    .mobile-quick-btn:active {
        transform: scale(0.94);
        background: rgba(59, 130, 246, 0.2);
        color: var(--primary, #3b82f6);
    }
    .mobile-quick-icon-wrap {
        width: auto;
        height: auto;
        border-radius: 0;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: none;
    }
    .mobile-quick-btn:active .mobile-quick-icon-wrap {
        background: transparent;
    }
    .mobile-quick-icon {
        font-size: 12px;
        margin-bottom: 0;
        line-height: 1;
        filter: none;
    }
    .mobile-quick-text {
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        max-width: none;
        color: inherit;
    }
    /* 深色模式 */
    [data-theme="dark"] .mobile-quick-btn {
        background: #374151;
        color: #e5e7eb;
    }
    [data-theme="dark"] .mobile-quick-btn:active {
        background: var(--primary);
        color: #fff;
    }

    /* --- 底部输入区域（高端对话输入 · 移动端） --- */
    .chat-input-area {
        padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        background: var(--bg-primary) !important;
    }
    .chat-input-container {
        border-radius: 20px !important;
        border: 1px solid var(--border-color) !important;
        background: var(--bg-secondary) !important;
        overflow: visible !important;
        box-shadow:
            0 0 0 1px rgba(255,255,255,0.5) inset,
            0 1px 2px rgba(0,0,0,0.03),
            0 3px 8px rgba(0,0,0,0.04),
            0 8px 16px rgba(0,0,0,0.04) !important;
    }
    .chat-input-container:focus-within {
        border-color: var(--primary) !important;
        background: var(--bg-card) !important;
        box-shadow:
            0 0 0 1px rgba(255,255,255,0.7) inset,
            0 0 0 3px var(--primary-glow),
            0 6px 14px rgba(79,124,255,0.1),
            0 12px 22px rgba(79,124,255,0.06) !important;
        transform: translateY(-1px) !important;
    }
    .chat-input-row {
        padding: 10px 12px 4px !important;
    }
    .chat-input {
        min-height: 44px !important;
        max-height: 120px !important;
        font-size: 15px !important;
        padding: 0 !important;
        line-height: 1.55 !important;
    }
    .chat-input::placeholder {
        font-size: 14px !important;
        color: var(--text-tertiary, #9ca3af) !important;
        opacity: 0.8 !important;
    }
    .chat-input-toolbar {
        padding: 4px 8px 8px !important;
        gap: 6px !important;
    }
    .chat-plus-btn {
        width: 34px !important;
        height: 34px !important;
        border-radius: 9px !important;
    }
    .chat-mention-tag {
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 12px !important;
        border-radius: 9px !important;
    }
    .chat-mention-tag svg {
        width: 12px !important;
        height: 12px !important;
    }
    .chat-voice-btn {
        width: 32px !important;
        height: 32px !important;
    }
    .chat-voice-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    .chat-send-btn {
        width: 34px !important;
        height: 34px !important;
        border-radius: 50% !important;
        background: #f3f4f6 !important;
        color: #374151 !important;
    }
    .chat-send-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    .chat-plus-btn { background: rgba(0,0,0,0.04) !important; }
    .chat-plus-btn:hover { background: rgba(0,0,0,0.08) !important; }
    [data-theme="dark"] .chat-plus-btn { background: rgba(255,255,255,0.08) !important; }
    [data-theme="dark"] .chat-plus-btn:hover { background: rgba(255,255,255,0.12) !important; }
    [data-theme="dark"] .chat-send-btn {
        background: rgba(255,255,255,0.12) !important;
        color: #e5e7eb !important;
    }
    [data-theme="dark"] .chat-send-btn:hover {
        background: rgba(255,255,255,0.18) !important;
        color: #fff !important;
    }

    /* --- 按钮自适应 --- */
    .chat-action-btn, .chat-quick-btn, .welcome-tag {
        min-height: 40px !important;
        font-size: 13px !important;
        padding: 8px 14px !important;
    }
    .chat-msg-bubble [style*="display:grid"] {
        grid-template-columns: 1fr !important;
    }

    /* --- 店铺数据卡片单列 --- */
    .chat-msg-bubble [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 10px !important;
    }
    .chat-msg-bubble [style*="grid-template-columns"] > div {
        padding: 8px 10px !important;
    }
    .chat-msg-bubble [style*="grid-template-columns"] > div > div:last-child > div:last-child {
        font-size: 13px !important;
    }
    .chat-msg-bubble [style*="linear-gradient"] {
        padding: 10px 12px !important;
    }
    .chat-msg-bubble [style*="linear-gradient"] > span:last-child {
        font-size: 13px !important;
    }

    /* --- 智能建议面板 --- */
    .chat-shop-suggest {
        max-height: 120px !important;
    }

    /* --- 打字指示器 --- */
    .chat-typing-msg .chat-msg-avatar {
        width: 28px !important;
        height: 28px !important;
        border-radius: 50% !important;
        overflow: hidden;
        animation: avatarPulse 2s ease-in-out infinite;
    }
    @keyframes avatarPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
        50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    }
    .chat-typing-indicator {
        display: flex;
        gap: 4px;
        padding: 4px 0;
    }
    .chat-typing-indicator span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--text-tertiary, #9ca3af);
        animation: chatTyping 1.4s ease-in-out infinite;
    }
    .chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
    .chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes chatTyping {
        0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
        30% { transform: translateY(-4px); opacity: 1; }
    }

    /* --- 终止按钮 --- */
    .chat-msg-bubble .fetch-cancel-btn,
    .fetch-cancel-btn {
        display: inline-block !important;
        padding: 6px 16px !important;
        background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
        color: #dc2626 !important;
        border: 1px solid #fca5a5 !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        flex-shrink: 0 !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s;
        box-shadow: 0 1px 3px rgba(220, 38, 38, 0.15);
        position: relative;
        z-index: 10;
    }
    .chat-msg-bubble .fetch-cancel-btn:active,
    .fetch-cancel-btn:active {
        background: #dc2626 !important;
        color: #fff !important;
        transform: scale(0.95);
        box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    }

    /* --- 骨架屏 --- */
    .skeleton {
        position: relative;
        overflow: hidden;
        background: var(--bg-hover, #f3f4f6);
        border-radius: 8px;
    }
    .skeleton::after {
        content: '';
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
        animation: skeleton-loading 1.4s ease-in-out infinite;
        will-change: transform;
    }
    [data-theme="dark"] .skeleton { background: var(--bg-tertiary, #2a2f45); }
    [data-theme="dark"] .skeleton::after {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    }
    @keyframes skeleton-loading {
        100% { transform: translateX(100%); }
    }
    @media (prefers-reduced-motion: reduce) {
        .skeleton::after { animation: none; }
    }
}

/* ========== 小屏优化 (max-width: 480px) ========== */
@media (max-width: 480px) {
    .chat-welcome-title {
        font-size: 20px !important;
    }
    .chat-welcome-desc {
        font-size: 13px !important;
    }
    .chat-msg-bubble {
        max-width: 92% !important;
    }
    .mobile-quick-btn {
        min-width: auto !important;
        height: 30px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
    }
}


/* ============================================================
   ========== UI/UX 深度优化（触控区/输入区/横屏等）==========
   ============================================================ */

/* ---------- 1. 手机端触控区提升到 44px ---------- */
@media (max-width: 768px) {
    .mobile-quick-btn {
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
    }
    .mobile-quick-icon {
        font-size: 16px !important;
    }
    .chat-action-btn,
    .chat-quick-btn,
    .welcome-tag {
        min-height: 44px !important;
    }
    /* 运单操作按钮加大 */
    .waybill-op-btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }
    /* 店铺卡片操作按钮加大 */
    .shop-op-btn {
        width: 36px !important;
        height: 36px !important;
    }
}

/* 480px 以下快捷栏保持 44px，但字号略小 */
@media (max-width: 480px) {
    .mobile-quick-btn {
        height: 44px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }
}

/* ---------- 2. 输入区优化：聚焦时隐藏快捷栏 ---------- */
@media (max-width: 768px) {
    /* 输入框聚焦时，通过 body 类控制快捷栏隐藏 */
    body.chat-input-focused .mobile-quick-bar {
        display: none !important;
    }

    /* 对话模式内容区独立滚动 */
    body.chat-mode-body #chatMode.chat-mode-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }
    .chat-messages {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .chat-input-area {
        flex-shrink: 0 !important;
    }

    /* 输入框默认更紧凑 */
    .chat-input {
        min-height: 44px !important;
        max-height: 120px !important;
        font-size: 16px !important;   /* 避免 iOS 聚焦时自动放大 */
        padding: 10px 4px !important;
    }
}

/* ---------- 3. 横屏 / 短高屏适配 ---------- */
@media (max-height: 600px) and (orientation: landscape) {
    /* 横屏时顶部状态栏更紧凑 */
    .mobile-status-bar {
        height: 32px !important;
        padding: 0 12px !important;
    }
    .mobile-status-title {
        font-size: 14px !important;
    }

    /* 快捷栏高度降低 */
    .mobile-quick-btn {
        height: 36px !important;
        min-height: 36px !important;
    }

    /* 输入区更紧凑 */
    .chat-input {
        min-height: 36px !important;
        max-height: 80px !important;
        font-size: 14px !important;
    }
    /* 对话模式 padding 减少 */
    body.chat-mode-body #chatMode.chat-mode-container {
        padding-top: 32px !important;
    }

    /* 欢迎区缩小 */
    .chat-welcome-title {
        font-size: 18px !important;
    }
    .chat-welcome-desc {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }

    /* 模态框横屏优化 */
    .modal {
        max-height: 90vh !important;
        width: 80% !important;
        max-width: 520px !important;
    }
}

/* 超短屏（如折叠屏外屏） */
@media (max-height: 480px) and (orientation: landscape) {
    .mobile-quick-bar {
        display: none !important;
    }
    .chat-input-footer {
        padding: 2px 10px 4px !important;
    }
}

/* ---------- 8. 错误状态与空状态统一优化 ---------- */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 12px;
}
.error-state-icon {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.6;
}
.error-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.error-state-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.5;
}
.error-state-retry {
    margin-top: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.error-state-retry:active {
    transform: scale(0.96);
    background: var(--bg-tertiary);
}

/* ---------- 9. 长内容模态框优化 ---------- */
@media (max-width: 768px) {
    .modal {
        max-height: 85vh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
        width: 100% !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }
    .modal-header {
        flex-shrink: 0 !important;
    }
    .modal-body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    }
    .modal-footer {
        flex-shrink: 0 !important;
        position: sticky !important;
        bottom: 0 !important;
        background: var(--card-bg, #fff) !important;
        border-top: 1px solid var(--border-color) !important;
        padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }
}

/* ---------- 11. 圆角体系统一（手机端对齐设计 token）---------- */
@media (max-width: 768px) {
    /* 输入框圆角统一为 12px */
    .chat-input-container {
        border-radius: 12px !important;
    }
    /* 快捷按钮圆角统一为 12px */
    .mobile-quick-btn {
        border-radius: 12px !important;
    }
    /* 卡片圆角统一 */
    .chat-msg-bubble {
        border-radius: 16px !important;
    }
    /* toast 手机端底部居中显示 */
    .toast-container {
        top: auto !important;
        right: auto !important;
        left: 50% !important;
        bottom: 80px;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 400px;
        align-items: center;
    }
    .toast {
        min-width: auto !important;
        max-width: 100% !important;
        width: 100%;
    }
}

/* ---------- 输入框左下角 ➕ 上拉菜单（整合快捷按钮）---------- */
@media (max-width: 768px) {
    .mobile-quick-bar { display: none !important; }   /* 快捷能力已整合进「+ 工具」菜单 */
    .chat-plus-btn,
    #chatPlusBtn { display: inline-flex !important; }
    .chat-input-row { gap: 2px !important; padding: 6px 8px !important; }
    .chat-tools-menu { left: 8px !important; min-width: 160px; max-width: calc(100vw - 24px); }
}


/* ============================================================
   ============= 店铺快捷操作卡 (.shop-quick-card) =============
   用 CSS 变量驱动主题，data-theme=dark/light 自动适配，
   不依赖 JS 读 isDark（之前依赖 JS 内联判定导致深色模式下
   简写 background:#fff 无法被 fixDarkModeCards 识别）
   ============================================================ */
.shop-quick-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(79, 124, 255, 0.14);
}
[data-theme="dark"] .shop-quick-card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.sqc-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}
.sqc-emoji { font-size: 20px; flex-shrink: 0; line-height: 1; }
.sqc-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}
.sqc-name-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.sqc-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--text-tertiary);
}
.sqc-status.is-online { color: #22c55e; }
.sqc-status.is-offline { color: var(--text-tertiary); }
.sqc-status .sqc-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}
.sqc-abn {
    margin-left: 2px;
    color: #ef4444;
    font-weight: 600;
}
.sqc-close {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    padding: 0;
}
.sqc-close:hover { background: var(--bg-tertiary); }

.sqc-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sqc-btn {
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    text-align: left;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.15s ease;
}
.sqc-btn:hover { background: var(--bg-card-hover); }
.sqc-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.sqc-btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.sqc-btn-danger {
    background: var(--bg-card);
    color: #ef4444;
    border-color: #fecaca;
}
[data-theme="dark"] .sqc-btn-danger {
    border-color: #7f1d1d;
    background: var(--bg-card);
}
.sqc-btn-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.sqc-btn-text { flex: 1; }

/* 卡片宽度破开 mobile 默认 chat-msg max-width 链 */
.chat-msg-bubble > .shop-quick-card,
.chat-msg-bubble .shop-quick-card {
    max-width: 380px;
}
/* 含 .shop-quick-card 的气泡容器，让卡片自己撑出宽度 */
.chat-msg:has(.shop-quick-card) { max-width: 92%; }
.chat-msg-content:has(.shop-quick-card) { max-width: 100%; }
.chat-msg-bubble:has(.shop-quick-card) { max-width: 100%; padding: 0; background: transparent; border: none; box-shadow: none; }
