/* ===== 售后按钮：仅覆盖颜色和图标，尺寸完全继承兄弟 .order-btn / .mo-btn ===== */
.dc-aftersale-btn, .btn-aftersale {
    background:#fff; color:#ff9800; border:1px solid #ff9800;
    transition:all 0.2s ease;
}
.dc-aftersale-btn:hover, .btn-aftersale:hover { background:#ff9800; color:#fff; }
.dc-aftersale-btn:active, .btn-aftersale:active { opacity:0.85; }
/* 状态：检查中（灰色禁用感） */
.dc-aftersale-btn.btn-checking, .btn-aftersale.btn-checking { color:#9ca3af; border-color:#e5e7eb; background:#f9fafb; }
.dc-aftersale-btn.btn-checking:hover, .btn-aftersale.btn-checking:hover { background:#f9fafb; color:#9ca3af; }
/* 状态：已过期 */
.dc-aftersale-btn.btn-expired, .btn-aftersale.btn-expired { color:#bbb; border-color:#e5e5e5; background:#fff; cursor:default; }
.dc-aftersale-btn.btn-expired:hover, .btn-aftersale.btn-expired:hover { background:#fff; color:#bbb; }
/* 状态：已完成（绿） */
.dc-aftersale-btn.btn-completed, .btn-aftersale.btn-completed { color:#10b981; border-color:#10b981; background:#fff; }
.dc-aftersale-btn.btn-completed:hover, .btn-aftersale.btn-completed:hover { background:#10b981; color:#fff; }
/* 状态：已拒绝（红） */
.dc-aftersale-btn.btn-rejected, .btn-aftersale.btn-rejected { color:#ef4444; border-color:#ef4444; background:#fff; }
.dc-aftersale-btn.btn-rejected:hover, .btn-aftersale.btn-rejected:hover { background:#ef4444; color:#fff; }
/* 状态：已关闭（灰） */
.dc-aftersale-btn.btn-closed, .btn-aftersale.btn-closed { color:#6b7280; border-color:#d1d5db; background:#fff; }
.dc-aftersale-btn.btn-closed:hover, .btn-aftersale.btn-closed:hover { background:#6b7280; color:#fff; }
/* 状态：协商历史（橙） */
.dc-aftersale-btn.btn-chat-history, .btn-aftersale.btn-chat-history { color:#ff9800; border-color:#ff9800; background:#fff; }
.dc-aftersale-btn.btn-chat-history:hover, .btn-aftersale.btn-chat-history:hover { background:#ff9800; color:#fff; }

/* ===== 游客查单页按钮适配：对齐 /user/visitors.php 各模板按钮尺寸 ===== */
.order-btn-group .dc-aftersale-btn,
.mvorder-actions .dc-aftersale-btn,
.order-actions .dc-aftersale-btn,
.mn-order-actions .dc-aftersale-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    line-height:1;
    font-weight:600;
    text-decoration:none;
    white-space:nowrap;
    box-sizing:border-box;
}
.order-btn-group .dc-aftersale-btn {
    height:auto;
    padding:10px 20px;
    border-radius:20px;
    font-size:14px;
}
.mvorder-actions .dc-aftersale-btn,
.order-actions .dc-aftersale-btn,
.mn-order-actions .dc-aftersale-btn {
    height:32px;
    padding:0 14px;
    border-radius:16px;
    font-size:12px;
}

/* ===== 底部弹出面板 (Bottom Sheet) ===== */
body.mo-sheet-open { overflow:hidden; }
.mo-sheet-overlay { position:fixed; inset:0; z-index:99980; background:rgba(15,23,42,0.3); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); display:none; align-items:flex-end; justify-content:center; }
.mo-sheet-overlay.is-active { display:flex; }
.mo-sheet { width:100%; max-width:500px; max-height:92vh; display:flex; flex-direction:column; background:#fff; border-radius:20px 20px 0 0; box-shadow:0 -8px 40px rgba(0,0,0,0.12); transform:translateY(100%); transition:transform 0.28s cubic-bezier(.22,.61,.36,1); overflow:hidden; }
.mo-sheet.is-up { transform:translateY(0); }
.mo-sheet-handle { display:flex; justify-content:center; padding:14px 0 6px; flex-shrink:0; cursor:grab; }
.mo-sheet-handle span { width:36px; height:4px; border-radius:4px; background:#e2e8f0; }
.mo-sheet-header { display:flex; align-items:center; gap:10px; padding:10px 18px 14px; border-bottom:1px solid #f1f5f9; flex-shrink:0; }
.mo-sheet-icon { width:38px; height:38px; border-radius:12px; background:linear-gradient(135deg,var(--theme-primary,#667eea),var(--theme-secondary,#764ba2)); color:#fff; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.mo-sheet-title { flex:1; font-size:17px; font-weight:800; color:#1f2937; }
.mo-sheet-close { width:32px; height:32px; border:none; border-radius:50%; background:#f1f5f9; color:#94a3b8; font-size:16px; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; transition:all 0.15s; }
.mo-sheet-close:active { background:#e2e8f0; color:#475569; }
.mo-sheet-body { flex:1 1 auto; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:14px 16px; min-height:80px; background:#f8fafc; }
.mo-sheet-body::-webkit-scrollbar { width:3px; }
.mo-sheet-body::-webkit-scrollbar-thumb { background:#e2e8f0; border-radius:3px; }
.mo-sheet-footer { padding:12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); flex-shrink:0; border-top:1px solid #f1f5f9; }
.mo-sheet-footer-btn { width:100%; height:46px; border:none; border-radius:14px; background:linear-gradient(135deg,var(--theme-primary,#667eea),var(--theme-secondary,#764ba2)); color:#fff; font-size:16px; font-weight:700; cursor:pointer; transition:opacity 0.15s; }
.mo-sheet-footer-btn:active { opacity:0.85; }
.mo-sheet-loading { padding:60px 10px; text-align:center; color:#9ca3af; font-size:13px; }
.mo-sheet-loading i { margin-right:6px; }

/* ===== PC 端 (>=769px)：底部弹出面板改为屏幕居中的模态卡片 ===== */
@media (min-width: 769px) {
    .mo-sheet-overlay { align-items:center; }
    .mo-sheet {
        max-height:80vh;
        border-radius:20px;
        box-shadow:0 20px 60px rgba(0,0,0,0.18);
        transform:translateY(24px) scale(0.96);
    }
    .mo-sheet.is-up { transform:translateY(0) scale(1); }
    .mo-sheet-handle { display:none; }
}

/* ===== 售后表单 ===== */
.aftersale-modal-body { padding:0; }
.aftersale-field { margin-bottom:14px; }
.aftersale-field label { display:block; margin-bottom:6px; font-weight:600; color:#1f2937; font-size:13px; }
.aftersale-field select,.aftersale-field input,.aftersale-field textarea { width:100%; border:1px solid #e5e7eb; border-radius:8px; padding:10px 12px; font-size:16px; outline:none; box-sizing:border-box; font-family:inherit; }
.aftersale-field select:focus,.aftersale-field input:focus,.aftersale-field textarea:focus { border-color:var(--theme-primary,#667eea); }
.aftersale-field textarea { resize:vertical; min-height:70px; }
.aftersale-field small { display:block; margin-top:6px; color:#94a3b8; font-size:12px; line-height:1.5; }
.aftersale-image-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.aftersale-image-item { width:56px; height:56px; border-radius:6px; overflow:hidden; position:relative; border:1px solid #e5e7eb; }
.aftersale-image-item img { width:100%; height:100%; object-fit:cover; }
.aftersale-image-item .remove { position:absolute; top:0; right:0; width:16px; height:16px; background:rgba(0,0,0,0.55); color:#fff; border-radius:0 0 0 6px; display:flex; align-items:center; justify-content:center; font-size:10px; cursor:pointer; }
.aftersale-image-upload { width:56px; height:56px; border:1px dashed #c7d2fe; border-radius:6px; color:var(--theme-primary,#667eea); display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:20px; }
.aftersale-reopen-reason { min-height:100px; }
.dc-aftersale-hidden { display:none; }

/* ===== 全屏聊天页 ===== */
.mo-chat-page { display:none; position:fixed; top:0; left:0; right:0; bottom:0; z-index:99970; background:#f5f7fa; flex-direction:column; overflow:hidden; }
.mo-chat-page.is-open { display:flex; }
.mo-chat-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; padding-top:calc(12px + env(safe-area-inset-top, 0px)); background:#fff; box-shadow:0 1px 6px rgba(0,0,0,0.06); flex-shrink:0; z-index:1; position:relative; }
.mo-chat-back { display:flex; align-items:center; justify-content:center; width:32px; height:32px; color:var(--theme-primary,#667eea); font-size:16px; text-decoration:none; flex-shrink:0; position:relative; z-index:2; cursor:pointer; background:transparent; border:none; padding:0; }
.mo-chat-title { position:absolute; left:0; right:0; text-align:center; font-size:16px; font-weight:700; color:#1f2937; pointer-events:none; }
.mo-chat-close-btn { display:inline-flex; align-items:center; gap:4px; color:#ef4444; font-size:12px; text-decoration:none; padding:5px 10px; border-radius:999px; border:1px solid #fecaca; background:#fff; flex-shrink:0; position:relative; z-index:2; cursor:pointer; }
.mo-chat-messages { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:14px; min-height:0; overscroll-behavior:contain; touch-action:pan-y; }
.mo-chat-empty { text-align:center; color:#9ca3af; padding:50px 16px; font-size:13px; }
.mo-chat-empty i { display:block; font-size:36px; margin-bottom:12px; color:#d1d5db; }
.mo-chat-empty-hint { display:block; margin-top:8px; font-size:12px; }
.chat-time { font-size:11px; color:#9ca3af; text-align:center; margin:12px 0 8px; }
.chat-msg { display:flex; margin-bottom:14px; gap:8px; }
.chat-msg.user { flex-direction:row-reverse; }
.chat-msg.system { justify-content:center; }
.chat-avatar { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:12px; flex-shrink:0; }
.chat-msg.user .chat-avatar { background:#10b981; }
.chat-msg.admin .chat-avatar { background:var(--theme-primary,#667eea); }
.chat-bubble { max-width:72%; padding:10px 14px; border-radius:12px; font-size:14px; line-height:1.6; word-break:break-word; }
.chat-msg.user .chat-bubble { background:var(--theme-primary,#667eea); color:#fff; border-bottom-right-radius:4px; }
.chat-msg.admin .chat-bubble { background:#fff; color:#1f2937; box-shadow:0 1px 3px rgba(0,0,0,0.08); border-bottom-left-radius:4px; }
.chat-msg.system .chat-bubble { background:#f3f4f6; color:#6b7280; font-size:12px; padding:6px 14px; border-radius:14px; max-width:80%; }
.chat-msg.system .chat-bubble.is-completed { background:#10b9811a; border:1px solid #10b98133; color:#10b981; font-weight:600; }
.chat-msg.system .chat-bubble.is-closed { background:#6b72801a; border:1px solid #6b728033; color:#6b7280; font-weight:600; }
.chat-msg.system .chat-bubble.is-rejected { background:#ef44441a; border:1px solid #ef444433; color:#ef4444; font-weight:600; }
.chat-bubble img { max-width:160px; max-height:160px; border-radius:8px; margin-top:5px; cursor:pointer; display:block; }
.mo-chat-input-area { display:flex; gap:8px; align-items:center; padding:10px 12px; padding-bottom:calc(10px + env(safe-area-inset-bottom, 0px)); background:#fff; border-top:1px solid #e5e7eb; flex-shrink:0; }
.mo-chat-input-area .chat-img-btn { width:38px; height:38px; border:1px solid #e5e7eb; border-radius:8px; background:#f9fafb; color:var(--theme-primary,#667eea); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; font-size:16px; }
.mo-chat-input-area input[type="text"] { flex:1; height:38px; border:1px solid #e5e7eb; border-radius:8px; padding:0 12px; font-size:16px; outline:none; background:#fff; }
.mo-chat-input-area input[type="text"]:focus { border-color:var(--theme-primary,#667eea); }
.mo-chat-input-area .chat-send-btn { height:38px; padding:0 16px; background:linear-gradient(135deg,var(--theme-primary,#667eea),var(--theme-secondary,#764ba2)); color:#fff; border:none; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; flex-shrink:0; }
.mo-chat-input-area .chat-send-btn:disabled { background:#cbd5e1; cursor:not-allowed; }

/* ===== PC 端 (>=769px)：聊天页改为居中模态卡片，避免全屏放大 ===== */
@media (min-width: 769px) {
    .mo-chat-page {
        background:rgba(15,23,42,0.45);
        backdrop-filter:blur(4px);
        -webkit-backdrop-filter:blur(4px);
        align-items:center;
        justify-content:center;
        padding:20px;
    }
    .mo-chat-header,
    .mo-chat-messages,
    .mo-chat-input-area {
        width:100%;
        max-width:560px;
        flex:0 0 auto;
    }
    .mo-chat-header {
        border-radius:16px 16px 0 0;
        padding-top:14px;
    }
    .mo-chat-messages {
        height:60vh;
        background:#f5f7fa;
        overflow-y:auto;
    }
    .mo-chat-input-area {
        border-radius:0 0 16px 16px;
        padding-bottom:12px;
    }
}

/* ===== App 风格确认弹窗 ===== */
.mo-app-modal-mask { position:fixed; inset:0; z-index:99999; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; opacity:0; visibility:hidden; transition:opacity .25s,visibility .25s; }
.mo-app-modal-mask.is-show { opacity:1; visibility:visible; }
.mo-app-modal { width:min(88vw,340px); background:#fff; border-radius:20px; overflow:hidden; transform:translateY(24px) scale(.96); transition:transform .28s cubic-bezier(.22,.61,.36,1); box-shadow:0 20px 50px rgba(0,0,0,.18); }
.mo-app-modal-mask.is-show .mo-app-modal { transform:translateY(0) scale(1); }
.mo-app-modal-header { padding:22px 22px 0; text-align:center; }
.mo-app-modal-icon { width:52px; height:52px; margin:0 auto 12px; border-radius:50%; background:linear-gradient(135deg,var(--theme-primary,#667eea),var(--theme-secondary,#764ba2)); color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; }
.mo-app-modal-title { font-size:17px; font-weight:800; color:#252d3b; }
.mo-app-modal-body { padding:16px 22px 6px; text-align:center; }
.mo-app-modal-text { padding:2px 0 8px; color:#5f6673; font-size:13px; line-height:1.8; }
.mo-app-modal-sub { display:block; margin-top:4px; color:#9ca3af; font-size:12px; line-height:1.7; }
.mo-app-modal-foot { display:flex; gap:10px; padding:10px 22px 22px; }
.mo-app-modal-btn { flex:1; height:44px; border:none; border-radius:14px; font-size:15px; font-weight:700; cursor:pointer; transition:.15s; font-family:inherit; }
.mo-app-modal-btn:disabled { opacity:.65; }
.mo-app-modal-cancel { background:#f3f4f6; color:#5f6673; }
.mo-app-modal-cancel:active { background:#e8ebf0; }
.mo-app-modal-confirm { background:linear-gradient(135deg,var(--theme-primary,#667eea),var(--theme-secondary,#764ba2)); color:#fff; }
.mo-app-modal-confirm:active { transform:scale(.97); }

/* ===== 售后结果 ===== */
.aftersale-result { padding:20px 16px; }
.aftersale-result-status { margin-bottom:16px; text-align:center; }
.aftersale-result-icon { display:inline-flex; align-items:center; justify-content:center; width:50px; height:50px; margin-bottom:8px; border-radius:50%; }
.aftersale-result-icon i { font-size:24px; }
.aftersale-result-title { color:#1f2937; font-size:16px; font-weight:700; }
.aftersale-result.is-completed .aftersale-result-icon { background:#10b9811a; }
.aftersale-result.is-completed .aftersale-result-icon i { color:#10b981; }
.aftersale-result.is-closed .aftersale-result-icon { background:#6b72801a; }
.aftersale-result.is-closed .aftersale-result-icon i { color:#6b7280; }
.aftersale-result.is-rejected .aftersale-result-icon { background:#ef44441a; }
.aftersale-result.is-rejected .aftersale-result-icon i { color:#ef4444; }
.aftersale-result-remark { margin-bottom:14px; padding:12px 14px; border:1px solid #e5e7eb; border-radius:8px; background:#f9fafb; }
.aftersale-result-remark-label { margin-bottom:4px; color:#9ca3af; font-size:11px; }
.aftersale-result-remark-content { color:#374151; font-size:13px; line-height:1.6; }
.aftersale-result-reopen-pending { margin-bottom:14px; padding:10px 14px; border:1px solid #fed7aa; border-radius:8px; background:#fff7ed; color:#92400e; font-size:12px; font-weight:500; text-align:center; }
.aftersale-result-reopen-pending i { margin-right:4px; color:#f59e0b; }
.aftersale-result-actions { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
.aftersale-result-action { display:inline-flex; align-items:center; gap:5px; padding:8px 16px; border-radius:16px; background:var(--theme-primary,#667eea); color:#fff; font-size:12px; font-weight:600; text-decoration:none; }
.aftersale-result-action.is-reopen { background:#ff9800; }
