/* ============================================================
   订单录入系统 - 全局美化样式
   清新活力多配色 · 天蓝青绿主调 · 浅色明亮
   ============================================================ */

:root {
    /* 品牌主色系 - 清新海蓝→青绿渐变 */
    --brand:        #38B6FF;
    --brand-light:  #7DD3FC;
    --brand-dark:   #06b6d4;
    --brand-grad:   linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);

    /* 多彩辅助色系 - 清新活力 */
    --c-blue:       #60a5fa;
    --c-green:      #34d399;
    --c-cyan:       #22d3ee;
    --c-amber:      #fbbf24;
    --c-rose:       #fb7185;
    --c-violet:     #a78bfa;
    --c-teal:       #2dd4bf;
    --c-orange:     #fb923c;
    --c-pink:       #f472b6;

    /* 中性色 - 柔和明亮 */
    --bg-page:      #f4f5fb;
    --bg-card:      #ffffff;
    --bg-soft:      #fafbff;
    --border-soft:  #e8ecf4;
    --text-main:    #1e293b;
    --text-muted:   #64748b;

    /* 阴影 - 多层柔和玻璃质感 */
    --shadow-xs: 0 1px 3px rgba(56,182,255,.05), 0 1px 2px rgba(6,182,212,.03);
    --shadow-sm: 0 4px 12px rgba(56,182,255,.06), 0 2px 4px rgba(6,182,212,.04);
    --shadow-md: 0 8px 24px rgba(56,182,255,.08), 0 4px 8px rgba(6,182,212,.06);
    --shadow-lg: 0 16px 48px rgba(56,182,255,.12), 0 8px 16px rgba(6,182,212,.08);
    --radius:    1rem;
    --radius-lg: 1.25rem;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-page);
    background-image:
        radial-gradient(at 0% 0%, rgba(56,182,255,.12) 0px, transparent 45%),
        radial-gradient(at 100% 0%, rgba(6,182,212,.08) 0px, transparent 45%),
        radial-gradient(at 50% 100%, rgba(244,114,182,.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: -apple-system, "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

/* ============================================================
   顶部导航 - 清新海蓝渐变
   ============================================================ */
.navbar {
    background: linear-gradient(135deg, rgba(56,182,255,.95) 0%, rgba(6,182,212,.92) 50%, rgba(56,182,255,.95) 100%) !important;
    box-shadow: 0 4px 24px rgba(56,182,255,.30), 0 2px 8px rgba(6,182,212,.15);
    padding-top: .65rem;
    padding-bottom: .65rem;
    position: relative;
}
.navbar::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 10%;
    right: 10%;
    height: 12px;
    background: radial-gradient(ellipse at center, rgba(56,182,255,.35) 0%, transparent 70%);
    pointer-events: none;
}
.navbar-brand {
    letter-spacing: .5px;
    font-size: 1.15rem;
    background: rgba(255,255,255,.22);
    padding: .35rem .8rem;
    border-radius: .6rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.navbar-brand i { color: #fde68a; }
.navbar .nav-link {
    font-weight: 500;
    position: relative;
    transition: all .2s ease;
    padding: .4rem .85rem !important;
    border-radius: .55rem;
    color: rgba(255,255,255,.92) !important;
}
.navbar .nav-link i { margin-right: 3px; }
.navbar .nav-link:hover {
    background-color: rgba(255,255,255,.22);
    color: #fff !important;
    transform: translateY(-1px);
}
.navbar .nav-link.active {
    font-weight: 600;
    background-color: rgba(255,255,255,.30);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(56,182,255,.15);
}
.navbar-toggler { border-color: rgba(255,255,255,.4); }

/* ============================================================
   通用卡片 - 柔和阴影 + 圆润边角
   ============================================================ */
.card {
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04);
    background: var(--bg-card);
    transition: box-shadow .25s ease, transform .25s ease;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand-grad);
    border-radius: 16px 0 0 16px;
    opacity: .85;
}
.card:hover {
    box-shadow: 0 16px 40px rgba(56,182,255,.10), 0 6px 14px rgba(6,182,212,.06);
    transform: translateY(-2px);
}
.card-header {
    font-weight: 600;
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    border-bottom: 1px solid var(--border-soft);
    padding: .85rem 1.1rem;
    border-radius: 16px 16px 0 0 !important;
}
.card-header.bg-white { background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%) !important; }

/* 页面标题 */
h4, h5 { color: var(--text-main); }
h4 .bi, h5 .bi { vertical-align: -2px; color: var(--brand); }

/* ============================================================
   统计卡片 - 多彩渐变（每个卡片独立配色）
   ============================================================ */
.stat-card {
    position: relative;
    transition: transform .22s ease, box-shadow .22s ease;
    overflow: hidden;
    border: none !important;
    border-radius: 16px !important;
    background: #fff;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(56,182,255,.12), 0 6px 14px rgba(6,182,212,.08) !important;
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    z-index: 1;
}
/* 4 张统计卡片：海蓝青 / 薄荷青 / 暖阳橙 / 粉樱青 */
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #38B6FF, #06b6d4); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #34d399, #22d3ee); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #fbbf24, #fb923c); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #f472b6, #06b6d4); }

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.stat-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.35), transparent);
}
/* 多彩渐变图标 */
.stat-icon.bg-primary { background: linear-gradient(135deg, #38B6FF, #06b6d4) !important; color: #fff !important; }
.stat-icon.bg-success { background: linear-gradient(135deg, #34d399, #10b981) !important; color: #fff !important; }
.stat-icon.bg-info    { background: linear-gradient(135deg, #22d3ee, #06b6d4) !important; color: #fff !important; }
.stat-icon.bg-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b) !important; color: #fff !important; }
.stat-icon.bg-danger  { background: linear-gradient(135deg, #fb7185, #f43f5e) !important; color: #fff !important; }

/* ============================================================
   供应商选择卡片
   ============================================================ */
.supplier-card {
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
    border-radius: .8rem !important;
    position: relative;
    overflow: hidden;
    border: 1.5px solid #d8dee8 !important;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    box-shadow: var(--shadow-sm);
}
.supplier-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #38B6FF, #06b6d4);
    opacity: 0;
    transition: opacity .18s ease;
}
.supplier-card:hover {
    border-color: var(--brand-light) !important;
    background-color: rgba(125,211,252,.08);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(125,211,252,.20);
}
.supplier-card:hover::before { opacity: 1; }
.supplier-card.border-primary {
    background: linear-gradient(135deg, rgba(167,139,250,.14) 0%, rgba(244,114,182,.10) 100%) !important;
    border-color: var(--brand) !important;
    border-width: 2px !important;
    box-shadow: 0 4px 18px rgba(125,211,252,.26);
}
.supplier-card.border-primary::before { opacity: 1; }

/* 供应商卡片内图标彩色背景包装 */
.supplier-card i.bi-building-fill {
    width: 40px;
    height: 40px;
    border-radius: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem !important;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.supplier-card i.bi-building-fill.text-primary { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #38B6FF !important; }
.supplier-card i.bi-building-fill.text-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #10b981 !important; }
.supplier-card i.bi-building-fill.text-info    { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #06b6d4 !important; }
.supplier-card i.bi-building-fill.text-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #f59e0b !important; }
.supplier-card i.bi-building-fill.text-danger  { background: linear-gradient(135deg, #ffe4e6, #fecaca); color: #f43f5e !important; }

.supplier-card.border-primary i.bi-building-fill {
    background: linear-gradient(135deg, #38B6FF, #06b6d4) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(56,182,255,.4);
}

/* ============================================================
   表格 - 渐变表头 + 细腻分隔线
   ============================================================ */
.table > :not(caption) > * > * { vertical-align: middle; }
.table .text-end input { text-align: right; }
.table thead th {
    border-bottom: 2px solid rgba(56,182,255,.2);
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
    font-size: .875rem;
    letter-spacing: .3px;
    white-space: nowrap;
    padding: .7rem .85rem;
}
.table-responsive { max-height: 70vh; border-radius: 16px; overflow: auto; box-shadow: 0 4px 12px rgba(56,182,255,.06); }
.table thead.position-sticky th { position: sticky; top: 0; z-index: 1; }
.table-hover tbody tr { transition: background-color .18s ease, transform .18s ease; }
.table-hover tbody tr:hover {
    background-color: rgba(56,182,255,.06) !important;
    transform: scale(1.005);
}
.table-hover tbody tr:hover td {
    color: var(--brand-dark);
}
.table tfoot tr td { border-top: 2px solid rgba(56,182,255,.2); }
.table-bordered {
    border: 1px solid rgba(56,182,255,.12) !important;
    border-collapse: separate !important;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
}
.table-bordered > :not(caption) > * > * {
    border-width: 1px;
    border-style: solid;
    border-color: rgba(56,182,255,.08) !important;
}

/* 金额列强调 */
.text-money {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
    color: #38B6FF;
}

/* ============================================================
   明细输入框紧凑化
   ============================================================ */
#itemsBody input.form-control { padding: .35rem .55rem; font-size: .9rem; }
#itemsBody .input-group-text { padding: .35rem .4rem; }
#grandTotal { font-variant-numeric: tabular-nums; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 3.5rem 1rem;
}
.empty-state .bi { color: #c7d2fe; }

/* ============================================================
   表单 - 圆润边角 + 柔和外发光
   ============================================================ */
.form-label { font-weight: 500; color: #334155; margin-bottom: .35rem; }
.form-control, .form-select {
    border: 1.5px solid #d8dee8;
    border-radius: 10px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
    background-color: #fff;
    color: #1e293b;
}
.form-control:focus, .form-select:focus, .form-control[type=date]:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(56,182,255,.15), 0 4px 12px rgba(56,182,255,.08);
    border-width: 1.5px;
    background-color: #fff;
}
.form-control::placeholder { color: #9ca3af; }

/* ============================================================
   Badge / 按钮 - 多彩渐变
   ============================================================ */
.badge { border-radius: .45rem; font-weight: 500; padding: .4em .65em; }
.badge.bg-primary { background: linear-gradient(135deg, #38B6FF, #06b6d4) !important; }
.badge.bg-success { background: linear-gradient(135deg, #34d399, #10b981) !important; }
.badge.bg-danger  { background: linear-gradient(135deg, #fb7185, #f43f5e) !important; }
.badge.bg-info    { background: linear-gradient(135deg, #22d3ee, #06b6d4) !important; }
.badge.bg-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b) !important; color: #fff !important; }

.btn { border-radius: 10px; font-weight: 500; transition: all .22s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(56,182,255,.30);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0EA5E9 0%, #0891b2 100%);
    box-shadow: 0 8px 24px rgba(56,182,255,.40);
    transform: translateY(-2px);
    color: #fff;
}
.btn-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(52,211,153,.30);
    color: #fff;
}
.btn-success:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 24px rgba(16,185,129,.40);
    transform: translateY(-2px);
    color: #fff;
}

/* 通用渐变背景工具类 */
.bg-gradient {
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 50%, #f472b6 100%);
}
.modal-header.bg-gradient {
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 50%, #f472b6 100%) !important;
    border-bottom: none;
}
.modal-header.bg-gradient .modal-title { font-weight: 600; }

/* AI 识别功能按钮：海蓝青绿渐变 */
.btn-ai {
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%) !important;
    border: none;
    color: #fff;
    box-shadow: 0 4px 16px rgba(56,182,255,.32);
    transition: all .22s ease;
    border-radius: 10px;
}
.btn-ai:hover {
    background: linear-gradient(135deg, #0EA5E9 0%, #0891b2 100%) !important;
    box-shadow: 0 8px 24px rgba(56,182,255,.45);
    transform: translateY(-2px);
    color: #fff;
}
.btn-ai:active { transform: translateY(0); }

/* 上传单据照片按钮：青绿→薄荷渐变 */
.btn-outline-image {
    border: 2px dashed #34d399;
    color: #059669;
    background: rgba(52, 211, 153, .06);
    font-weight: 500;
    transition: all .22s ease;
    border-radius: 10px;
}
.btn-outline-image:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #fff !important;
    border-color: #10b981;
    box-shadow: 0 8px 24px rgba(16, 185, 129, .35);
    transform: translateY(-2px);
}
.btn-outline-image:active { transform: translateY(0); }

/* 照片来源徽章 */
.bg-gradient-ai {
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%) !important;
    color: #fff;
    border: none;
}
.bg-gradient-manual {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
    color: #fff;
    border: none;
}
/* 薰衣草紫徽章（数量） */
.bg-lavender {
    background: linear-gradient(135deg, #c4b5fd, #7DD3FC) !important;
    color: #fff;
}

/* AI 识别结果 Toast 中显示 HTML（允许换行和子样式） */
#toastContainer .toast-body { white-space: normal; line-height: 1.5; }
#toastContainer .toast-msg-content { white-space: normal; line-height: 1.6; display: block; }

/* AI 弹窗样式 */
.ai-modal-img-preview {
    border: 1px solid rgba(56,182,255,.15);
    border-radius: 12px;
    background: linear-gradient(135deg, #fafbff, #ffffff);
}
.ai-modal-info {
    border-left: 4px solid #38B6FF;
    background: linear-gradient(135deg, #f5f3ff, #fdf2ff);
}
.ai-modal-info li { margin-bottom: .25rem; }

/* 弹窗动画 */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(56,182,255,.18), 0 8px 20px rgba(6,182,212,.10);
    overflow: hidden;
    animation: modalIn .25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-12px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.btn-outline-primary { color: var(--brand); border-color: var(--brand); border-radius: 10px; }
.btn-outline-primary:hover { background: linear-gradient(135deg, #38B6FF, #06b6d4); border-color: var(--brand); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(56,182,255,.3); }
.btn-group .btn + .btn { margin-left: 2px; }

/* ============================================================
   分页
   ============================================================ */
.pagination .page-link {
    color: var(--brand);
    border-color: rgba(56,182,255,.3);
    border-radius: 10px !important;
    margin: 0 3px;
    transition: all .22s ease;
}
.pagination .page-link:hover { background: rgba(56,182,255,.08); color: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56,182,255,.15); }
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(56,182,255,.3);
}

/* ============================================================
   模态框
   ============================================================ */
.modal-header {
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
    color: #fff;
    border-bottom: none;
    padding: 1rem 1.25rem;
}
.modal-header .btn-close { filter: brightness(0) invert(1); opacity: .8; }
.modal-title { font-weight: 600; }
.modal-title .bi { margin-right: .3rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top: 1px solid var(--border-soft); padding: .85rem 1.25rem; }

/* ============================================================
   页脚
   ============================================================ */
footer {
    font-size: .8rem;
    background: linear-gradient(180deg, transparent, rgba(56,182,255,.05));
    color: var(--text-muted) !important;
}

/* ============================================================
   滚动条美化
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #38B6FF, #06b6d4); border-radius: 6px; border: 2px solid var(--bg-page); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #0EA5E9, #0891b2); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   小屏适配
   ============================================================ */
@media (max-width: 575.98px) {
    .stat-icon { width: 42px; height: 42px; font-size: 1.2rem; }
    .fs-4 { font-size: 1.15rem !important; }
    .navbar-brand { font-size: 1rem; }
}

/* ============================================================
   手机端全面适配（< 768px）
   ============================================================ */

/* ---- 底部导航栏（仅手机端） ---- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1035;
    display: flex;
    background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 50%, #38B6FF 100%);
    box-shadow: 0 -4px 20px rgba(56,182,255,.25);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-radius: 0;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: .4rem .2rem .3rem;
    color: rgba(255, 255, 255, .65);
    text-decoration: none !important;
    font-size: .68rem;
    line-height: 1.2;
    transition: all .2s ease;
    position: relative;
}
.bottom-nav-item i {
    font-size: 1.25rem;
    line-height: 1;
}
.bottom-nav-item.active {
    color: #fff;
}
.bottom-nav-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: #fff;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 10px rgba(255, 255, 255, .6);
}
.bottom-nav-item:active {
    background: rgba(255, 255, 255, .1);
}

@media (max-width: 767.98px) {
    /* 隐藏顶部导航的折叠按钮和链接区（手机端用底部导航） */
    .navbar-toggler { display: none; }
    .navbar-collapse { display: none !important; }
    .navbar { justify-content: center; }

    /* body 底部留出底部导航的空间，顶部留出固定导航栏的空间 */
    body { padding-bottom: 60px; padding-top: 56px; }

    /* ---- 数据表卡片式布局（手机端自动转换） ---- */
    .table-mobile-card thead { display: none; }
    .table-mobile-card,
    .table-mobile-card tbody,
    .table-mobile-card tr,
    .table-mobile-card td { display: block; width: 100%; }
    .table-mobile-card tr {
        border: 1px solid rgba(56,182,255,.12);
        border-radius: 16px;
        margin-bottom: .6rem;
        padding: .5rem .6rem;
        background: var(--bg-card);
        box-shadow: 0 4px 12px rgba(56,182,255,.06);
    }
    .table-mobile-card tr:last-child { margin-bottom: 0; }
    .table-mobile-card td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none !important;
        padding: .3rem 0 !important;
        text-align: right;
        font-size: .85rem;
    }
    .table-mobile-card td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: .78rem;
        text-align: left;
        padding-right: .8rem;
        flex-shrink: 0;
    }
    .table-mobile-card td[data-full] {
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid var(--border-soft) !important;
        padding-bottom: .4rem !important;
        margin-bottom: .3rem;
    }
    .table-mobile-card td[data-full]::before { margin-bottom: .2rem; }
    .table-mobile-card td[data-actions] {
        justify-content: flex-end;
        padding-top: .4rem !important;
        border-top: 1px solid var(--border-soft) !important;
    }
    .table-mobile-card td[data-actions]::before { display: none; }
    .table-mobile-card tfoot {
        display: block;
        margin-top: .6rem;
    }
    .table-mobile-card tfoot tr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: .3rem;
        background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(124,58,237,.08));
        border: 1px solid rgba(79,70,229,.2);
        border-radius: .6rem;
        padding: .5rem .8rem;
        font-weight: 700;
        font-size: .85rem;
    }
    .table-mobile-card tfoot td {
        display: inline;
        border: none !important;
        padding: 0 !important;
        text-align: right;
    }
    .table-mobile-card tfoot td:first-child {
        width: 100%;
        text-align: left;
        color: var(--text-muted);
        font-size: .78rem;
        font-weight: 600;
    }
    /* 卡片模式下移除 table-bordered / table-sm 的边框干扰 */
    .table-mobile-card.table-bordered td,
    .table-mobile-card.table-bordered tr { border: none !important; }
    .table-mobile-card.table-sm td { padding: .3rem 0 !important; }

    /* ---- 容器 ---- */
    .container { padding-left: 12px; padding-right: 12px; }
    .container.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

    /* ---- 导航栏（手机端仅显示品牌，导航在底部） ---- */
    .navbar {
        padding-top: .5rem;
        padding-bottom: .5rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        /* 强制硬件加速，防止 iOS Safari 滚动时消失 */
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        will-change: transform;
        -webkit-backface-visibility: hidden;
    }
    .navbar-brand { font-size: 1rem; padding: .25rem .6rem; }
    .navbar-brand i { font-size: 1rem; }

    /* ---- 页面标题区 ---- */
    h4 { font-size: 1.2rem; }
    .d-flex.justify-content-between { flex-wrap: wrap; gap: .5rem; }
    .d-flex .btn { font-size: .85rem; padding: .35rem .7rem; }

    /* ---- 统计卡片 ---- */
    .stat-card .card-body { padding: .75rem !important; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 12px; }
    .stat-card .ms-3 { margin-left: .6rem !important; }
    .stat-card .fs-4 { font-size: 1.1rem !important; }
    .stat-card .small { font-size: .72rem !important; }

    /* ---- 通用卡片 ---- */
    .card {
        border: 1px solid rgba(56,182,255,.1);
        box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04) !important;
        margin-bottom: .75rem;
        border-radius: 16px;
    }
    .card-header {
        padding: .65rem .8rem;
        font-size: .9rem;
        border-bottom: 1px solid rgba(56,182,255,.08) !important;
        font-weight: 600;
        border-radius: 16px 16px 0 0 !important;
    }
    .card-body { padding: .8rem; }

    /* ---- 按钮组 ---- */
    .btn { font-size: .85rem; padding: .4rem .75rem; border-radius: 10px; }
    .btn-sm { font-size: .8rem; padding: .3rem .55rem; }
    /* 操作按钮在手机端铺满 */
    .d-flex.gap-2 .btn { flex: 1 1 auto; }
    .d-flex.just-content-between .btn { white-space: nowrap; }

    /* ---- 供应商选择卡片 ---- */
    .supplier-card {
        padding: .7rem !important;
        border-radius: 16px !important;
        border: 1.5px solid rgba(56,182,255,.15) !important;
        box-shadow: 0 4px 14px rgba(56,182,255,.06) !important;
    }
    .supplier-card .fs-4 { font-size: 1.1rem !important; }
    .supplier-card .small { font-size: .72rem !important; color: #64748b !important; }
    .supplier-card.border-primary {
        border: 2px solid var(--brand) !important;
        background: linear-gradient(135deg, rgba(56,182,255,.12), rgba(6,182,212,.10)) !important;
        box-shadow: 0 4px 16px rgba(56,182,255,.20) !important;
    }

    /* ---- 通用卡片手机端增强 ---- */
    .card {
        border: 1px solid rgba(56,182,255,.1) !important;
        box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04) !important;
        margin-bottom: .75rem;
        border-radius: 16px;
    }
    .card-header {
        padding: .65rem .8rem;
        font-size: .9rem;
        border-bottom: 1px solid rgba(56,182,255,.08) !important;
        font-weight: 600;
        border-radius: 16px 16px 0 0 !important;
    }
    .card-body { padding: .8rem; }

    /* ---- 表单手机端增强 ---- */
    .form-label { font-size: .85rem; margin-bottom: .2rem; }
    .form-control, .form-select {
        font-size: .9rem;
        padding: .45rem .65rem;
        border: 1.5px solid rgba(56,182,255,.2) !important;
        border-radius: 10px;
        background-color: #fff !important;
    }
    .form-control:focus, .form-select:focus {
        border-color: var(--brand) !important;
        border-width: 1.5px !important;
        box-shadow: 0 0 0 3px rgba(56,182,255,.15) !important;
    }
    .form-text { font-size: .72rem; }

    /* ---- 筛选区 ---- */
    .row.g-2 > [class*="col-"] { margin-bottom: .5rem; }

    /* ---- 表格通用 ---- */
    .table { font-size: .82rem; }
    .table thead th { font-size: .78rem; padding: .4rem .5rem; }
    .table td { padding: .4rem .5rem; }
    .table-responsive {
        max-height: none;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
        border: 1px solid rgba(56,182,255,.12) !important;
        box-shadow: 0 4px 12px rgba(56,182,255,.06);
        overflow-x: auto !important;
        overflow-y: auto !important;
        touch-action: pan-x pan-y;
        overscroll-behavior-x: contain;
    }
    /* 横向滚动提示阴影 */
    .table-responsive::after {
        content: "";
        display: none;
    }

    /* ---- 分页 ---- */
    .pagination { flex-wrap: wrap; gap: 2px; }
    .pagination .page-link { padding: .3rem .5rem; font-size: .8rem; }

    /* ---- 订单录入明细表 ---- */
    #itemsBody input.form-control { padding: .35rem .45rem; font-size: .85rem; border: 1.5px solid rgba(56,182,255,.15) !important; }
    #itemsBody .input-group-text { padding: .35rem .4rem; border: 1.5px solid rgba(56,182,255,.15); border-left: none; background: #f8fafc; }
    .table-bordered { min-width: 600px; width: max-content; border: 1.5px solid rgba(56,182,255,.15) !important; }
    .table-bordered th, .table-bordered td { border: 1px solid rgba(56,182,255,.08) !important; white-space: nowrap; }
    #entrySection .d-flex { flex-direction: column; gap: .5rem; }
    #entrySection .d-flex .d-flex { flex-direction: row; flex-wrap: wrap; }
    #entrySection .btn { width: 100%; }
    #entrySection .d-flex.justify-content-between > div:last-child {
        display: flex; gap: .5rem; width: 100%;
    }
    #entrySection .d-flex.justify-content-between > div:last-child .btn { flex: 1; }
    /* 录入明细表格：横向+纵向滚动 */
    #entrySection .table-responsive {
        border-left: 3px solid var(--brand);
        border: 1.5px solid rgba(56,182,255,.15) !important;
        position: relative;
        border-radius: 16px;
        box-shadow: inset 0 1px 3px rgba(56,182,255,.04);
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        overscroll-behavior-x: contain;
    }

    /* ============================================================
       手机端：订单录入卡片布局（多行网格新版）
       ============================================================ */
    #itemsCards { padding-bottom: .5rem; }

    .order-item-card {
        background: #ffffff;
        border: none;
        border-radius: 14px;
        margin-bottom: .5rem;
        overflow: visible;
        box-shadow: 0 3px 14px rgba(0,0,0,.05), 0 1px 4px rgba(0,0,0,.03);
        position: relative;
        transition: box-shadow .2s ease, transform .15s ease;
        max-width: 100%;
        box-sizing: border-box;
        border: 1px solid rgba(0,0,0,.04);
    }
    .order-item-card:active { transform: scale(0.997); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
    .order-item-card::before {
        content: '';
        position: absolute;
        left: 8px; top: 8px; bottom: 8px;
        width: 4px;
        border-radius: 4px;
        background: linear-gradient(180deg, #38B6FF, #a78bfa);
        opacity: .9;
        z-index: 2;
        pointer-events: none;
    }

    /* ========== 6种鲜艳浅色卡片主题（循环配色） ========== */
    /* 粉色 */
    .order-item-card.card-theme-0 {
        background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 60%, #fff 100%);
        border-color: rgba(251, 113, 133, .25);
        box-shadow: 0 4px 16px rgba(251, 113, 133, .10), 0 1px 4px rgba(251, 113, 133, .05);
    }
    .order-item-card.card-theme-0::before { background: linear-gradient(180deg, #fb7185, #f43f5e); }
    .order-item-card.card-theme-0 .oic-num {
        background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
        box-shadow: 0 2px 8px rgba(251, 113, 133, .40);
    }
    .order-item-card.card-theme-0 .oic-header { border-bottom-color: rgba(251, 113, 133, .12); }
    .order-item-card.card-theme-0 .oic-header .oic-auto-check.active {
        background: linear-gradient(135deg, #fb7185, #f43f5e);
        box-shadow: 0 2px 8px rgba(251, 113, 133, .35);
    }

    /* 橙色 */
    .order-item-card.card-theme-1 {
        background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 60%, #fff 100%);
        border-color: rgba(251, 146, 60, .25);
        box-shadow: 0 4px 16px rgba(251, 146, 60, .10), 0 1px 4px rgba(251, 146, 60, .05);
    }
    .order-item-card.card-theme-1::before { background: linear-gradient(180deg, #fb923c, #f97316); }
    .order-item-card.card-theme-1 .oic-num {
        background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
        box-shadow: 0 2px 8px rgba(251, 146, 60, .40);
    }
    .order-item-card.card-theme-1 .oic-header { border-bottom-color: rgba(251, 146, 60, .12); }
    .order-item-card.card-theme-1 .oic-header .oic-auto-check.active {
        background: linear-gradient(135deg, #fb923c, #f97316);
        box-shadow: 0 2px 8px rgba(251, 146, 60, .35);
    }

    /* 黄色 */
    .order-item-card.card-theme-2 {
        background: linear-gradient(135deg, #fefce8 0%, #fef9c3 60%, #fff 100%);
        border-color: rgba(250, 204, 21, .28);
        box-shadow: 0 4px 16px rgba(250, 204, 21, .10), 0 1px 4px rgba(250, 204, 21, .05);
    }
    .order-item-card.card-theme-2::before { background: linear-gradient(180deg, #facc15, #eab308); }
    .order-item-card.card-theme-2 .oic-num {
        background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
        color: #713f12;
        box-shadow: 0 2px 8px rgba(250, 204, 21, .40);
    }
    .order-item-card.card-theme-2 .oic-header { border-bottom-color: rgba(250, 204, 21, .14); }
    .order-item-card.card-theme-2 .oic-header .oic-auto-check.active {
        background: linear-gradient(135deg, #facc15, #eab308);
        color: #713f12;
        box-shadow: 0 2px 8px rgba(250, 204, 21, .35);
    }

    /* 绿色 */
    .order-item-card.card-theme-3 {
        background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 60%, #fff 100%);
        border-color: rgba(52, 211, 153, .25);
        box-shadow: 0 4px 16px rgba(52, 211, 153, .10), 0 1px 4px rgba(52, 211, 153, .05);
    }
    .order-item-card.card-theme-3::before { background: linear-gradient(180deg, #34d399, #10b981); }
    .order-item-card.card-theme-3 .oic-num {
        background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
        box-shadow: 0 2px 8px rgba(52, 211, 153, .40);
    }
    .order-item-card.card-theme-3 .oic-header { border-bottom-color: rgba(52, 211, 153, .12); }
    .order-item-card.card-theme-3 .oic-header .oic-auto-check.active {
        background: linear-gradient(135deg, #34d399, #10b981);
        box-shadow: 0 2px 8px rgba(52, 211, 153, .35);
    }

    /* 青色 */
    .order-item-card.card-theme-4 {
        background: linear-gradient(135deg, #ecfeff 0%, #cffafe 60%, #fff 100%);
        border-color: rgba(34, 211, 238, .25);
        box-shadow: 0 4px 16px rgba(34, 211, 238, .10), 0 1px 4px rgba(34, 211, 238, .05);
    }
    .order-item-card.card-theme-4::before { background: linear-gradient(180deg, #22d3ee, #06b6d4); }
    .order-item-card.card-theme-4 .oic-num {
        background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
        box-shadow: 0 2px 8px rgba(34, 211, 238, .40);
    }
    .order-item-card.card-theme-4 .oic-header { border-bottom-color: rgba(34, 211, 238, .12); }
    .order-item-card.card-theme-4 .oic-header .oic-auto-check.active {
        background: linear-gradient(135deg, #22d3ee, #06b6d4);
        box-shadow: 0 2px 8px rgba(34, 211, 238, .35);
    }

    /* 紫色 */
    .order-item-card.card-theme-5 {
        background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 60%, #fff 100%);
        border-color: rgba(167, 139, 250, .25);
        box-shadow: 0 4px 16px rgba(167, 139, 250, .10), 0 1px 4px rgba(167, 139, 250, .05);
    }
    .order-item-card.card-theme-5::before { background: linear-gradient(180deg, #a78bfa, #8b5cf6); }
    .order-item-card.card-theme-5 .oic-num {
        background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
        box-shadow: 0 2px 8px rgba(167, 139, 250, .40);
    }
    .order-item-card.card-theme-5 .oic-header { border-bottom-color: rgba(167, 139, 250, .12); }
    .order-item-card.card-theme-5 .oic-header .oic-auto-check.active {
        background: linear-gradient(135deg, #a78bfa, #8b5cf6);
        box-shadow: 0 2px 8px rgba(167, 139, 250, .35);
    }

    /* ---- 卡片头部 ---- */
    .oic-header {
        display: flex;
        align-items: center;
        gap: .35rem;
        padding: .5rem .6rem .45rem;
        padding-left: 1rem; /* 为左侧彩色竖条留空间 */
        border-bottom: 1px solid rgba(0,0,0,.06);
    }
    .oic-num {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        border-radius: 8px;
        background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
        color: #fff;
        font-size: .75rem;
        font-weight: 700;
        box-shadow: 0 2px 6px rgba(56,182,255,.35);
    }
    .oic-product-wrap {
        flex: 1 1 auto;
        min-width: 0;
        position: relative;
    }
    .oic-product {
        font-size: .85rem;
        padding: .32rem .55rem;
        border: 1.5px solid rgba(0,0,0,.08) !important;
        border-radius: 10px;
        background: #fff !important;
        transition: all .2s ease;
        font-weight: 600;
        color: #334155;
    }
    .oic-product::placeholder { color: #94a3b8; font-weight: 400; }
    .oic-product:focus {
        border-color: #6366f1 !important;
        border-width: 1.5px !important;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, .14), 0 4px 12px rgba(99, 102, 241, .08);
        background: #fff !important;
        transform: translateY(-0.5px);
    }
    /* 头部总价输入区域 */
    .oic-total-wrap {
        flex: 0 0 auto;
        width: 92px;
        min-width: 82px;
    }
    .oic-total-input {
        font-size: .84rem;
        padding: .3rem .45rem;
        border: 1.5px solid rgba(0,0,0,.08) !important;
        border-radius: 10px;
        background: #fff !important;
        transition: all .2s ease;
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-weight: 700;
        color: #4338ca;
        width: 100%;
    }
    .oic-total-input::placeholder { color: #cbd5e1; font-weight: 400; }
    .oic-total-input:focus {
        border-color: #4f46e5 !important;
        border-width: 1.5px !important;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
        background: #fff !important;
        transform: translateY(-0.5px);
    }
    .oic-total-input.is-auto {
        background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
        border-color: rgba(99, 102, 241, .25) !important;
        color: #4338ca;
    }
    .oic-total-input.is-auto:focus {
        background: #fff !important;
    }
    /* 头部紧凑自动开关（仅图标） */
    .oic-header .oic-auto-check {
        flex: 0 0 auto;
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 8px;
        background: rgba(148,163,184,.10);
        color: #94a3b8;
        font-size: .72rem;
        font-weight: 600;
        cursor: pointer;
        transition: all .2s ease;
        user-select: none;
        margin: 0;
        line-height: 1;
    }
    .oic-header .oic-auto-check input {
        display: none;
    }
    .oic-header .oic-auto-check i {
        font-size: .8rem;
    }
    .oic-header .oic-auto-check.active {
        background: linear-gradient(135deg, #38B6FF, #06b6d4);
        color: #fff;
        box-shadow: 0 2px 6px rgba(56,182,255,.35);
    }
    .oic-header .oic-auto-check:active {
        transform: scale(0.95);
    }
    .oic-del-btn {
        flex: 0 0 auto;
        width: 26px;
        height: 26px;
        min-width: 26px;
        padding: 0;
        border-radius: 7px;
        border: 1.5px solid rgba(251,113,133,.25);
        background: linear-gradient(135deg, #fff 0%, #fff1f2 100%);
        color: #e11d48;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: .75rem;
        line-height: 1;
        transition: all .2s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }
    .oic-del-btn:hover,
    .oic-del-btn:active {
        background: linear-gradient(135deg, #fee2e2, #fecaca);
        color: #b91c1c;
        border-color: rgba(239,68,68,.45);
        box-shadow: 0 4px 12px rgba(239,68,68,.20);
        transform: translateY(-1px);
    }

    /* ---- 卡片主体网格 ---- */
    .oic-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: .4rem .5rem;
        padding: .55rem .6rem .5rem;
        padding-left: 1rem; /* 为左侧彩色竖条留空间 */
    }
    .oic-field {
        display: flex;
        flex-direction: column;
        gap: .2rem;
        min-width: 0;
    }
    .oic-label {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        font-size: .68rem;
        font-weight: 600;
        color: #475569;
        margin: 0;
        line-height: 1.2;
    }
    .oic-label i {
        font-size: .68rem;
        color: #6366f1;
        opacity: .9;
    }
    .oic-label-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: .25rem;
        gap: .5rem;
    }
    .oic-input {
        font-size: .83rem;
        padding: .32rem .5rem;
        border: 1.5px solid rgba(0,0,0,.08) !important;
        border-radius: 10px;
        background: #fff !important;
        transition: all .2s ease;
        width: 100%;
        color: #334155;
    }
    .oic-input::placeholder { color: #cbd5e1; }
    .oic-input:focus {
        border-color: #6366f1 !important;
        border-width: 1.5px !important;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
        background: #fff !important;
        transform: translateY(-0.5px);
    }
    .oic-input.input-qty,
    .oic-input.input-price {
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
    }

    /* ---- 卡片底部自动计算开关（保留兼容） ---- */
    .oic-auto-check {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: .25rem .5rem;
        border-radius: 8px;
        background: rgba(148,163,184,.10);
        color: #64748b;
        font-size: .7rem;
        font-weight: 600;
        cursor: pointer;
        transition: all .2s ease;
        user-select: none;
        margin: 0;
        line-height: 1.2;
    }
    .oic-auto-check input {
        display: none;
    }
    .oic-auto-check i {
        font-size: .68rem;
    }
    .oic-auto-check.active {
        background: linear-gradient(135deg, rgba(56,182,255,.18), rgba(34,211,238,.18));
        color: #0e7490;
        box-shadow: inset 0 0 0 1px rgba(56,182,255,.3);
    }
    .oic-auto-check.active i {
        color: #06b6d4;
    }
    .oic-auto-check:active {
        transform: scale(0.97);
    }

    /* ---- 卡片底部 ---- */
    .oic-footer {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0 .6rem .45rem;
        padding-left: 1rem; /* 为左侧彩色竖条留空间 */
    }
    .oic-footer .diff-hint {
        font-size: .7rem;
        font-weight: 600;
        padding: 4px 12px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        letter-spacing: .01em;
    }
    .oic-footer .diff-hint::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        opacity: .8;
    }
    .diff-hint.text-muted { background: rgba(100,116,139,.10); color: #64748b; }
    .diff-hint.text-success { background: rgba(52,211,153,.18); color: #047857; }
    .diff-hint.text-danger { background: rgba(251,113,133,.18); color: #be123c; }

    /* 合计栏（新版增强） */
    .card-item-total-bar {
        background: linear-gradient(135deg, #fafbff 0%, #eef2ff 50%, #fdf4ff 100%);
        border: 1.5px solid rgba(99,102,241,.20);
        border-radius: 16px;
        padding: .75rem 1rem;
        margin-top: .6rem;
        margin-bottom: .5rem;
        box-shadow: 0 6px 20px rgba(99,102,241,.10), 0 2px 6px rgba(167,139,250,.08);
        position: relative;
        overflow: hidden;
    }
    .card-item-total-bar::before {
        content: '';
        position: absolute;
        top: 0; left: -30%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, rgba(255,255,255,.4), rgba(255,255,255,0));
        transform: skewX(-20deg);
        pointer-events: none;
    }
    .card-item-total-bar .total-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }
    .card-item-total-bar .total-label {
        font-size: .86rem;
        font-weight: 700;
        color: #4338ca;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    .card-item-total-bar .total-label::before {
        content: '';
        width: 12px;
        height: 12px;
        border-radius: 4px;
        background: linear-gradient(135deg, #6366f1, #a855f7);
        box-shadow: 0 1px 4px rgba(99,102,241,.3);
    }
    .card-item-total-bar .total-value {
        font-size: 1.35rem;
        font-weight: 800;
        background: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #ec4899 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        font-variant-numeric: tabular-nums;
        filter: drop-shadow(0 1px 2px rgba(99,102,241,.15));
    }
    .card-item-total-bar .diff-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: .5rem;
        padding-top: .5rem;
        border-top: 1px dashed rgba(99,102,241,.25);
        font-size: .75rem;
        position: relative;
    }
    .card-item-total-bar .diff-total-badge {
        font-weight: 700;
        padding: 4px 14px;
        border-radius: 999px;
        background: rgba(99,102,241,.14);
        color: #4338ca;
        font-variant-numeric: tabular-nums;
    }

    /* ============================================================
       全局：操作按钮视觉样式（桌面端+手机端共用）
       ============================================================ */
    .action-bar {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        width: 100%;
        background: linear-gradient(135deg, #fafbff 0%, #eef2ff 50%, #fdf4ff 100%);
        padding: .85rem 1rem;
        box-shadow: 0 2px 12px rgba(99,102,241,.08);
        border: 1.5px solid rgba(99,102,241,.12);
        border-radius: 14px;
        margin: 1rem 0 .5rem;
        box-sizing: border-box;
    }
    .ab-tools-row, .ab-actions-row {
        display: flex;
        gap: .5rem;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
    .action-bar .btn.ab-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: .5rem 1rem;
        border-radius: 10px !important;
        font-weight: 500;
        font-size: .88rem;
        transition: all .2s ease;
        border: none !important;
        cursor: pointer;
        text-decoration: none;
        line-height: 1.5;
        white-space: nowrap;
    }
    .action-bar .btn.ab-btn:hover { text-decoration: none; }
    .action-bar .btn.ab-btn i { font-size: 1rem; }
    .action-bar .ab-btn-add {
        background-image: none !important;
        background-color: #10b981 !important;
        color: #fff !important;
        box-shadow: 0 3px 12px rgba(52,211,153,.28);
    }
    .action-bar .ab-btn-add:hover { background-image: none !important; background-color: #059669 !important; color: #fff !important; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(52,211,153,.38); }
    .action-bar .ab-btn-preset {
        background-image: none !important;
        background-color: #f59e0b !important;
        color: #fff !important;
        box-shadow: 0 3px 12px rgba(251,191,36,.28);
    }
    .action-bar .ab-btn-preset:hover { background-image: none !important; background-color: #d97706 !important; color: #fff !important; transform: translateY(-2px); }
    .action-bar .ab-btn-ai {
        background-image: none !important;
        background-color: #6366f1 !important;
        color: #fff !important;
        box-shadow: 0 3px 12px rgba(139,92,246,.30);
    }
    .action-bar .ab-btn-ai:hover { background-image: none !important; background-color: #4f46e5 !important; color: #fff !important; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(139,92,246,.42); }
    .action-bar .ab-btn-image {
        background-image: none !important;
        background-color: #f0fdf4 !important;
        color: #059669 !important;
        border: 2px dashed #34d399 !important;
        box-shadow: none;
    }
    .action-bar .ab-btn-image:hover { background-image: none !important; background-color: #10b981 !important; color: #fff !important; border-color: #10b981 !important; transform: translateY(-2px); }
    .action-bar .ab-btn-auto {
        background-image: none !important;
        background-color: #fff !important;
        color: #475569 !important;
        border: 1.5px solid #cbd5e1 !important;
    }
    .action-bar .ab-btn-auto:hover { background-image: none !important; background-color: #f8fafc !important; color: #1e293b !important; border-color: #94a3b8 !important; }
    .action-bar .ab-btn-save {
        background-image: none !important;
        background-color: #06b6d4 !important;
        color: #fff !important;
        box-shadow: 0 4px 16px rgba(56,182,255,.35);
        padding: .5rem 1.2rem;
        font-weight: 600;
    }
    .action-bar .ab-btn-save:hover { background-image: none !important; background-color: #0891b2 !important; color: #fff !important; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(56,182,255,.45); }
    .action-bar .ab-count {
        display: inline-block;
        background: rgba(255,255,255,.95);
        color: #d97706;
        border-radius: 10px;
        padding: 0 6px;
        font-size: .7rem;
        font-weight: 700;
        margin-left: 3px;
        font-style: normal;
        line-height: 1.4;
    }

    /* ============================================================
       桌面端：操作按钮保持原有风格（居中布局）
       ============================================================ */
    @media (min-width: 768px) {
        .action-bar {
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: .75rem;
        }
        .ab-tools-row {
            justify-content: center;
            gap: .75rem;
        }
        .ab-actions-row {
            justify-content: center;
            gap: .75rem;
        }
    }

    /* ============================================================
       手机端：操作栏 - 两行网格布局（新版增强）
       ============================================================ */
    @media (max-width: 767.98px) {
        .action-bar {
            padding: .75rem .5rem;
            box-shadow: 0 -4px 16px rgba(99,102,241,.08);
            margin: .6rem 0 .5rem;
        }
        /* 工具行：4个等分图标按钮居中对齐 */
        .ab-tools-row {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: .35rem;
            margin-bottom: .3rem;
            justify-content: center;
            align-content: center;
            padding: 0 .5rem;
        }
        .ab-btn-wrap { min-width: 0; }
        /* 操作行：2个按钮，居中 */
        .ab-actions-row {
            display: grid;
            grid-template-columns: minmax(0, 160px) minmax(0, 200px);
            gap: .5rem;
            justify-content: center;
            align-content: center;
            padding: 0 .5rem;
        }
        /* 手机端按钮：更紧凑，竖排图标+文字 */
        .action-bar .btn.ab-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            padding: .35rem .1rem;
            border-radius: 12px !important;
            font-weight: 600;
            font-size: .62rem;
            transition: all .18s ease;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            line-height: 1.1;
            width: 100%;
            position: relative;
            overflow: hidden;
        }
        .action-bar .btn.ab-btn::after {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 35%;
            background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0));
            pointer-events: none;
        }
        .action-bar .btn.ab-btn:active { transform: scale(0.94); }
        .action-bar .btn.ab-btn i {
            font-size: 1.05rem;
            line-height: 1;
            filter: drop-shadow(0 1px 2px rgba(0,0,0,.12));
        }
        .action-bar .btn.ab-btn span {
            white-space: nowrap;
            font-size: .62rem;
            letter-spacing: .02em;
        }
    }

        /* 操作栏已移入文档流内（合计金额下方），不再需要额外底部空间 */
        #entrySection {
            padding-bottom: 1rem !important;
        }
        #entrySection .card-header {
            padding: .5rem .65rem;
            font-size: .88rem;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
            border-bottom: 1px solid rgba(56,182,255,.1) !important;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: .4rem;
            flex-wrap: wrap;
        }
        #entrySection .card-header strong {
            font-size: .85rem;
            display: inline-flex;
            align-items: center;
            gap: 3px;
        }
        #entrySection .card-header .small {
            font-size: .7rem;
        }
        #entrySection .card-body {
            padding: .45rem .45rem;
        }
        /* 移动端缩小标题间距 */
        h4.mb-3 {
            margin-bottom: .55rem !important;
            font-size: 1.1rem;
        }
        .container.py-4 {
            padding: .65rem .5rem !important;
            padding-bottom: 1rem !important;
        }
        .card.shadow-sm {
            box-shadow: 0 3px 10px rgba(56,182,255,.07), 0 1px 3px rgba(6,182,212,.04) !important;
            border-radius: 12px !important;
        }
        footer.py-4 {
            padding: .35rem .7rem !important;
            padding-bottom: 60px !important;
            font-size: .65rem;
            margin-top: .4rem !important;
        }
        #itemsCardsWrap {
            margin-bottom: .4rem !important;
        }
        #itemsCards {
            padding-bottom: .25rem;
        }
        /* 供应商卡片手机端增强 */
        #supplierGrid {
            display: grid !important;
            grid-template-columns: 1fr 1fr;
            gap: .5rem !important;
        }
        #supplierGrid > [class*="col-"] {
            width: 100% !important;
            padding: 0 !important;
        }
    }

    /* 预设下拉面板在卡片模式下的定位 */
    .order-item-card .preset-dropdown-panel {
        position: absolute !important;
        z-index: 1000;
        background: #fff;
        border: 1px solid rgba(56,182,255,.2);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(56,182,255,.15);
        max-height: 240px;
        overflow-y: auto;
        margin-top: 6px;
        width: calc(100% - 2rem);
        left: 1rem !important;
    }

    #entrySection .table-responsive::after {
        content: "← 左右滑动查看更多 →";
        display: block;
        text-align: center;
        font-size: .7rem;
        color: var(--text-muted);
        padding: .3rem 0;
        background: linear-gradient(180deg, transparent, rgba(56,182,255,.04));
    }

    /* ---- 弹窗 ---- */
    .modal-dialog { margin: .5rem; }
    .modal-dialog.modal-lg { max-width: calc(100vw - 1rem); }
    .modal-content { border-radius: 16px; }
    .modal-header { padding: .75rem 1rem; }
    .modal-title { font-size: 1rem; }
    .modal-body { padding: 1rem; }
    .modal-footer { padding: .6rem 1rem; flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; font-size: .85rem; }

    /* ---- AI 识别弹窗 ---- */
    #aiRecognizeModal .row > .col-md-6 { width: 100%; }
    #aiRecognizeModal .ai-modal-img-preview { min-height: 180px !important; }
    #aiRecognizeModal .ai-modal-img-preview img { max-height: 240px !important; }
    #aiRecognizeModal .ai-modal-info { padding: .6rem !important; font-size: .8rem !important; }
    #aiRecognizeModal .ai-modal-info ul { padding-left: 1.1rem; }
    #aiRecognizeModal .ai-modal-info li { font-size: .78rem; }

    /* ---- Toast ---- */
    #toastContainer { padding: .5rem !important; left: 0 !important; right: 0 !important; }
    #toastContainer .toast { min-width: auto; max-width: calc(100vw - 1rem); }

    /* ---- 趋势图 ---- */
    #trendChart { height: 200px !important; }

    /* ---- 对账信息条 ---- */
    .alert { padding: .5rem .75rem; font-size: .82rem; }

    /* ---- 预设下拉面板 ---- */
    .preset-dropdown-panel { max-height: 200px; }
    .preset-dropdown-panel .preset-item { font-size: .8rem !important; }
    /* 常用商品下拉菜单手机端全宽 */
    #presetMenu { min-width: 100% !important; max-width: calc(100vw - 2rem); }
    .dropdown-menu { max-width: calc(100vw - 2rem); }

    /* 顶部常用商品按钮 - 去除默认下拉箭头 */
    #presetDropdown .dropdown-toggle::after {
        display: none;
    }

    /* ---- 页脚 ---- */
    footer { padding: 1.5rem 1rem 4.5rem !important; font-size: .72rem; }
    footer .d-inline-flex { flex-wrap: wrap; justify-content: center; gap: .25rem !important; }

    /* ---- 对账-供应商卡片 ---- */
    .recon-sup-cards { padding: .75rem; }

    .recon-sup-card {
        display: flex;
        gap: .75rem;
        padding: .75rem;
        margin-bottom: .75rem;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04);
        border: 1px solid rgba(56,182,255,.08);
        align-items: stretch;
    }

    .recon-sup-rank {
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
        font-size: 1.05rem;
        box-shadow: 0 4px 14px rgba(56,182,255,.25);
    }

    .recon-sup-body {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: .35rem;
    }

    .recon-sup-name {
        font-size: .95rem;
        font-weight: 700;
        color: var(--text);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .recon-sup-stats {
        display: flex;
        gap: .6rem;
        font-size: .75rem;
        color: var(--text-muted);
    }
    .recon-sup-stats i { margin-right: 3px; }

    .recon-sup-orders {
        background: rgba(56,182,255,.08);
        color: #38B6FF;
        padding: 1px 8px;
        border-radius: 10px;
        font-weight: 600;
        font-size: .72rem;
    }

    .recon-sup-bar {
        height: 6px;
        background: var(--border-soft);
        border-radius: 3px;
        overflow: hidden;
        margin: .2rem 0;
    }
    .recon-sup-bar-fill {
        height: 100%;
        border-radius: 3px;
        transition: width .5s ease;
    }

    .recon-sup-footer {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }
    .recon-sup-amount {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--brand);
    }
    .recon-sup-pct {
        font-size: .82rem;
        font-weight: 600;
        color: var(--text-muted);
    }

    /* 供应商汇总 - 总合计卡片 */
    .recon-sup-total {
        margin-top: 1rem;
        padding: .75rem 1rem;
        background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
        border-radius: 16px;
        border: 1px solid rgba(102, 126, 234, .15);
    }
    .recon-sup-total-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .35rem 0;
        font-size: .82rem;
        color: var(--text-muted);
        border-bottom: 1px dashed var(--border-soft);
    }
    .recon-sup-total-row:last-child { border-bottom: none; }
    .recon-sup-total-num {
        font-weight: 700;
        color: var(--text);
    }
    .recon-sup-total-row-grand {
        margin-top: .35rem;
        padding-top: .6rem;
        border-top: 2px solid rgba(99, 102, 241, .2);
        border-bottom: none;
        font-size: .95rem;
        font-weight: 600;
        color: var(--text);
    }
    .recon-sup-total-value {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--brand);
    }

    /* ---- 仪表盘-供应商卡片 ---- */
    .dash-sup-cards { display: flex; flex-direction: column; gap: .5rem; }
    .dash-sup-card {
        display: flex;
        gap: .6rem;
        padding: .6rem;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 4px 14px rgba(56,182,255,.06), 0 2px 4px rgba(6,182,212,.04);
        border: 1px solid rgba(56,182,255,.08);
    }
    .dash-sup-rank {
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
        font-size: .95rem;
        box-shadow: 0 3px 10px rgba(56,182,255,.25);
    }
    .dash-sup-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
    .dash-sup-name { font-weight: 700; font-size: .88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dash-sup-bar { height: 5px; background: var(--border-soft); border-radius: 3px; overflow: hidden; }
    .dash-sup-bar-fill { height: 100%; border-radius: 3px; }
    .dash-sup-footer { display: flex; justify-content: space-between; font-size: .78rem; }
    .dash-sup-amt { font-weight: 700; color: var(--brand); }
    .dash-sup-cnt { color: var(--text-muted); }

    /* ---- 仪表盘-订单卡片 ---- */
    .dash-order-cards { display: flex; flex-direction: column; gap: .5rem; }
    .dash-order-card {
        border-radius: 16px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04);
        border: 1px solid var(--border-soft);
    }
    .dash-order-header {
        padding: .55rem .75rem;
        color: #fff;
        background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
    }
    .dash-order-no { font-weight: 700; font-size: .9rem; letter-spacing: .5px; }
    .dash-order-date { font-size: .72rem; opacity: .9; margin-top: 2px; }
    .dash-order-body { padding: .55rem .75rem; display: flex; justify-content: space-between; align-items: center; }
    .dash-order-sup { font-size: .82rem; font-weight: 600; color: var(--text); }
    .dash-order-sup i { color: var(--text-muted); margin-right: 4px; }
    .dash-order-items { font-size: .72rem; color: var(--text-muted); }
    .dash-order-items i { margin-right: 2px; }
    .dash-order-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .5rem .75rem;
        background: linear-gradient(90deg, rgba(56,182,255,.04), rgba(6,182,212,.04));
        border-top: 1px solid var(--border-soft);
    }
    .dash-order-amount { font-size: 1rem; font-weight: 700; color: var(--brand); }
    .dash-order-actions { display: flex; gap: .25rem; }
    .dash-order-actions .btn { padding: .2rem .45rem; font-size: .75rem; }
}

/* ---- 对账-供应商表格美化（电脑端全局样式） ---- */
.recon-sup-table .recon-sup-th {
    background: linear-gradient(135deg, #38B6FF, #06b6d4) !important;
    color: #fff !important;
    font-weight: 600;
    font-size: .85rem;
    padding: .6rem .75rem;
    border: none !important;
}
.recon-sup-table tbody td {
    padding: .5rem .75rem;
    font-size: .9rem;
    border-bottom: 1px solid rgba(56,182,255,.08);
    vertical-align: middle;
}
.recon-sup-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(56,182,255,.05), rgba(6,182,212,.03)) !important;
}
.recon-sup-table .recon-sup-bar-lg {
    height: 8px;
    background: #F3F4F6;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
    max-width: 100px;
}
.recon-sup-table .recon-sup-bar-fill-lg {
    height: 100%;
    border-radius: 4px;
    transition: width .5s ease;
}
.recon-sup-table .recon-sup-tfoot {
    background: linear-gradient(135deg, #f8f9ff, #faf5ff) !important;
    font-weight: 700;
    border-top: 2px solid rgba(56,182,255,.2) !important;
}

/* ---- 对账-订单明细表格美化（电脑端） ---- */
.recon-detail-header {
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%) !important;
    border-bottom: 2px solid rgba(56,182,255,.2) !important;
    padding: .8rem 1.1rem;
}
.recon-detail-header strong {
    background: linear-gradient(135deg, #38B6FF, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.recon-detail-table {
    border: 1px solid rgba(56,182,255,.1);
    border-collapse: separate !important;
    border-spacing: 0;
}
.recon-detail-table .recon-detail-th {
    background: linear-gradient(135deg, #38B6FF, #06b6d4) !important;
    color: #fff !important;
    font-weight: 600;
    font-size: .82rem;
    padding: .55rem .75rem;
    border: none !important;
    border-bottom: 2px solid #5568d3 !important;
    letter-spacing: .3px;
    white-space: nowrap;
}
.recon-detail-table tbody td {
    padding: .45rem .75rem;
    font-size: .875rem;
    border-bottom: 1px solid rgba(56,182,255,.06);
    vertical-align: middle;
}
/* 新订单首行：顶部加渐变分隔线 */
.recon-detail-table tbody tr.recon-detail-new-order td {
    border-top: 2px solid rgba(56,182,255,.25);
}
/* 订单号渐变徽章 */
.recon-detail-table .recon-order-badge {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .3px;
    padding: .25rem .55rem;
    border-radius: .4rem;
    box-shadow: 0 1px 4px rgba(56,182,255,.25);
}
.recon-detail-table .recon-detail-ditto {
    font-size: .9rem;
    opacity: .4;
}
/* 单位徽章 */
.recon-detail-table .recon-detail-unit {
    background: rgba(56,182,255,.08);
    color: #38B6FF;
    padding: .1rem .45rem;
    border-radius: .3rem;
    font-size: .75rem;
    font-weight: 500;
}
/* 小计列 */
.recon-detail-table .recon-detail-subtotal {
    color: #38B6FF;
    font-size: .9rem;
}
/* 行悬浮效果 */
.recon-detail-table tbody tr:hover td {
    background: linear-gradient(90deg, rgba(56,182,255,.08), rgba(6,182,212,.05)) !important;
}
/* 合计行 */
.recon-detail-table .recon-detail-tfoot td {
    background: linear-gradient(135deg, #f8f9ff, #faf5ff) !important;
    font-weight: 700;
    border-top: 2px solid rgba(56,182,255,.2) !important;
    border-bottom: none !important;
    padding: .65rem .75rem;
}
.recon-detail-table .recon-detail-grand {
    font-size: 1.05rem !important;
    color: #38B6FF !important;
    font-weight: 800;
}
/* 订单小计行 */
.recon-detail-table .recon-detail-order-subtotal td {
    padding: .5rem .75rem !important;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .3px;
}
.recon-detail-table .recon-detail-order-subtotal td:first-child {
    font-size: .8rem;
}
.recon-detail-table .recon-detail-order-subtotal td:last-child {
    font-size: 1rem !important;
    font-weight: 800 !important;
}
/* 行悬浮效果覆盖小计行 */
.recon-detail-table tbody tr.recon-detail-order-subtotal:hover td {
    background: inherit !important;
}

/* ============================================================
   手机端对账样式
   ============================================================ */
@media (max-width: 767.98px) {
    .recon-mobile-cards { padding: .75rem; }

    .recon-order-card {
        border: 1px solid rgba(56,182,255,.1);
        border-radius: 16px;
        margin-bottom: .75rem;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04);
    }

    .recon-order-header {
        padding: .75rem .9rem;
        color: #fff;
        background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
    }
    .recon-order-no {
        font-size: 1rem;
        font-weight: 700;
        letter-spacing: .5px;
        text-shadow: 0 1px 2px rgba(56,182,255,.2);
    }
    .recon-order-meta {
        display: flex;
        flex-wrap: wrap;
        gap: .6rem;
        margin-top: .25rem;
        font-size: .78rem;
        opacity: .92;
    }
    .recon-order-meta i { margin-right: 3px; }

    .recon-order-items {
        padding: .25rem .9rem;
    }

    .recon-item-row {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: .5rem 0;
        border-bottom: 1px dashed var(--border-soft);
        font-size: .82rem;
    }
    .recon-item-row:last-child { border-bottom: none; }
    .recon-item-name {
        flex: 1;
        min-width: 0;
        font-weight: 600;
        color: var(--text);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .recon-item-meta {
        display: flex;
        align-items: center;
        gap: .25rem;
        font-size: .72rem;
        color: var(--text-muted);
        white-space: nowrap;
    }
    .recon-item-unit {
        background: rgba(56,182,255,.08);
        color: #38B6FF;
        padding: 1px 5px;
        border-radius: 3px;
        font-weight: 500;
    }
    .recon-item-price {
        color: var(--text-muted);
    }
    .recon-item-qty {
        color: var(--text);
        font-weight: 600;
    }
    .recon-item-subtotal {
        min-width: 64px;
        text-align: right;
        font-weight: 700;
        color: var(--brand);
        font-size: .88rem;
    }

    .recon-order-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .6rem .9rem;
        font-size: .8rem;
        color: var(--text-muted);
    }
    .recon-order-total {
        font-size: .88rem;
        color: var(--text);
    }
    .recon-order-total b {
        font-size: 1.05rem;
        color: var(--brand);
    }

    .recon-total-card {
        margin-top: 1rem;
        padding: 1rem 1.25rem;
        background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 50%, #38B6FF 100%);
        border-radius: 16px;
        color: #fff;
        text-align: center;
        box-shadow: 0 8px 28px rgba(56,182,255,.35);
    }
    .recon-total-label {
        font-size: .78rem;
        opacity: .9;
        letter-spacing: 1px;
    }
    .recon-total-value {
        font-size: 1.6rem;
        font-weight: 700;
        margin: .35rem 0 .25rem;
        letter-spacing: .5px;
    }
    .recon-total-sub {
        font-size: .72rem;
        opacity: .85;
    }

    /* ---- 订单详情头部按钮组 ---- */
    .btn-group { display: flex; width: 100%; }
    .btn-group .btn { flex: 1; font-size: .8rem; padding: .3rem .4rem; }

    /* ---- 确认弹窗 ---- */
    .modal-confirm .modal-dialog { max-width: calc(100vw - 1rem); }
}

/* ============================================================
   超小屏适配（< 375px）
   ============================================================ */
@media (max-width: 374.98px) {
    .container { padding-left: 8px; padding-right: 8px; }
    .stat-card .card-body { padding: .5rem !important; }
    .stat-icon { width: 36px; height: 36px; font-size: 1rem; }
    .stat-card .fs-4 { font-size: 1rem !important; }
    .navbar-brand { font-size: .9rem; }
    .btn { font-size: .8rem; padding: .35rem .5rem; }
}

/* ============================================================
   打印样式
   ============================================================ */
@media print {
    .navbar, .d-print-none, footer, .btn, .card-header button, #toastContainer { display: none !important; }
    body { background: #fff !important; }
    .card { border: 1px solid #dee2e6 !important; box-shadow: none !important; }
    .card-header { background: #f8f9fa !important; }
    .table { font-size: 0.9rem; }
    .container { max-width: 100% !important; padding: 0 !important; }
}

/* ============================================================
   商品名称预设下拉
   ============================================================ */
.product-preset-wrapper { position: relative; }
.preset-dropdown-panel {
    border-radius: 12px;
    animation: presetFadeIn .15s ease;
}
.preset-dropdown-panel .preset-item {
    border-radius: 8px;
    margin: 2px 4px;
    transition: background-color .12s ease;
}
.preset-dropdown-panel .preset-item:hover,
.preset-dropdown-panel .preset-item:focus { background-color: #e0e7ff; }
.preset-dropdown-panel .preset-item.active { background-color: var(--brand); color: #fff; }
.preset-dropdown-panel::-webkit-scrollbar { width: 6px; }
.preset-dropdown-panel::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #38B6FF, #06b6d4); border-radius: 3px; }
.preset-dropdown-panel::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #0EA5E9, #0891b2); }
@keyframes presetFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   动态活动流（仪表盘最近操作）
   ============================================================ */
.activity-feed li { position: relative; padding-left: .25rem; }
.activity-feed li::before {
    content: "";
    position: absolute;
    left: -.5rem;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #38B6FF, #06b6d4);
}
.activity-feed li:last-child::before { display: none; }

/* 最近操作卡片：列表项填充高度 */
.activity-feed > li {
    display: flex;
    align-items: center;
}
.activity-feed > li > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================================
   渐入动画
   ============================================================ */
.card { animation: cardFadeIn .3s ease; }
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   手机端订单卡片（orders.php）
   ============================================================ */
@media (max-width: 767.98px) {
    .order-cards { display: flex; flex-direction: column; gap: .75rem; padding: .25rem; }

    .order-card {
        border-radius: 16px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04);
        border: 1px solid var(--border-soft);
        transition: transform .22s ease, box-shadow .22s ease;
    }
    .order-card:active {
        transform: scale(.98);
        box-shadow: 0 4px 12px rgba(56,182,255,.08);
    }

    .order-card-header {
        padding: .7rem .9rem;
        color: #fff;
        position: relative;
        background: linear-gradient(135deg, #38B6FF 0%, #06b6d4 100%);
    }
    .order-card-header::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: linear-gradient(to top, rgba(255,255,255,.1), transparent);
    }
    .order-card-no {
        font-size: 1rem;
        font-weight: 700;
        letter-spacing: .5px;
        text-shadow: 0 1px 2px rgba(56,182,255,.2);
    }
    .order-card-date {
        font-size: .75rem;
        opacity: .9;
        margin-top: 2px;
    }
    .order-card-date i { margin-right: 3px; }

    .order-card-body {
        padding: .7rem .9rem;
    }
    .order-card-sup {
        font-size: .9rem;
        font-weight: 600;
        color: var(--text-main);
        margin-bottom: .5rem;
    }
    .order-card-sup i { color: var(--text-muted); margin-right: 4px; }
    .order-card-info {
        display: flex;
        gap: 1rem;
        font-size: .78rem;
        color: var(--text-muted);
    }
    .order-card-info i { margin-right: 3px; }

    .order-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .6rem .9rem;
        background: linear-gradient(90deg, rgba(56,182,255,.04), rgba(6,182,212,.04));
        border-top: 1px solid rgba(56,182,255,.08);
    }
    .order-card-amount {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--brand);
    }
    .order-card-actions {
        display: flex;
        gap: .3rem;
    }
    .order-card-actions .btn {
        padding: .25rem .5rem;
        font-size: .78rem;
    }
}

/* ============================================================
   手机端供应商卡片（suppliers.php）
   ============================================================ */
@media (max-width: 767.98px) {
    .supplier-cards { display: flex; flex-direction: column; gap: .75rem; padding: .25rem; }

    .supplier-card-mobile {
        display: flex;
        gap: .75rem;
        padding: .75rem;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(56,182,255,.06), 0 4px 8px rgba(6,182,212,.04);
        border: 1px solid var(--border-soft);
        position: relative;
        overflow: hidden;
    }
    .supplier-card-mobile::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(180deg, var(--grad-from, #38B6FF), var(--grad-to, #06b6d4));
        border-radius: 4px 0 0 4px;
    }

    .supplier-card-avatar {
        flex-shrink: 0;
        width: 50px;
        height: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 1.4rem;
        box-shadow: 0 4px 14px rgba(56,182,255,.15);
    }

    .supplier-card-body {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: .35rem;
    }
    .supplier-card-name {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-main);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .supplier-card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: .5rem;
        font-size: .78rem;
        color: var(--text-muted);
    }
    .supplier-card-meta i { margin-right: 3px; }
    .supplier-card-addr {
        font-size: .75rem;
        color: var(--text-muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .supplier-card-addr i { margin-right: 3px; }

    .supplier-card-stats {
        display: flex;
        gap: .35rem;
        margin-top: .3rem;
    }
    .supplier-stat-badge {
        font-size: .7rem;
        padding: 2px 8px;
        border-radius: 10px;
        color: #fff;
        font-weight: 500;
    }
    .supplier-stat-badge i { margin-right: 2px; }

    .supplier-card-actions {
        display: flex;
        gap: .3rem;
        margin-top: .5rem;
    }
    .supplier-card-actions .btn {
        flex: 1;
        font-size: .78rem;
        padding: .3rem .4rem;
    }
}

/* ============================================================
   手机端日志卡片（logs.php）
   ============================================================ */
@media (max-width: 767.98px) {
    .log-cards { display: flex; flex-direction: column; gap: .6rem; padding: .25rem; }

    .log-card {
        border-radius: .85rem;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 2px 10px rgba(99,102,241,.06);
        border: 1px solid var(--border-soft);
    }

    .log-card-header {
        padding: .6rem .85rem;
        color: #fff;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .log-card-action .badge {
        font-size: .75rem;
        font-weight: 600;
    }
    .log-card-target {
        font-size: .82rem;
        font-weight: 600;
    }
    .log-card-target i { margin-right: 4px; }

    .log-card-body {
        padding: .65rem .85rem;
    }
    .log-card-name {
        font-size: .9rem;
        font-weight: 600;
        color: var(--text-main);
        margin-bottom: .3rem;
    }
    .log-card-detail {
        font-size: .8rem;
        color: var(--text-muted);
        margin-bottom: .4rem;
        line-height: 1.4;
    }
    .log-card-meta {
        display: flex;
        gap: .8rem;
        font-size: .75rem;
        color: var(--text-muted);
    }
    .log-card-meta i { margin-right: 3px; }
}

/* ============================================================
   手机端订单详情卡片（order_detail.php）
   ============================================================ */
@media (max-width: 767.98px) {
    /* 订单头部卡片 */
    .detail-header-card {
        border-radius: .85rem;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 2px 12px rgba(99,102,241,.08);
        border: 1px solid var(--border-soft);
        margin-bottom: .75rem;
    }
    .detail-header-top {
        padding: .75rem .9rem;
        background: linear-gradient(135deg, #a78bfa 0%, #7DD3FC 50%, #60a5fa 100%);
        color: #fff;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .detail-order-no {
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: .5px;
    }
    .detail-header-info {
        padding: .75rem .9rem;
    }
    .detail-info-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: .4rem 0;
        border-bottom: 1px dashed var(--border-soft);
        font-size: .85rem;
    }
    .detail-info-row:last-child { border-bottom: none; }
    .detail-info-label {
        color: var(--text-muted);
        font-weight: 500;
        flex-shrink: 0;
        margin-right: .5rem;
    }
    .detail-info-label i { margin-right: 3px; }
    .detail-info-value {
        color: var(--text-main);
        font-weight: 600;
        text-align: right;
        word-break: break-all;
    }

    /* 商品明细卡片 */
    .detail-items-cards {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        padding: .25rem;
    }

    .detail-item-card {
        border-radius: .75rem;
        background: #fff;
        box-shadow: 0 2px 8px rgba(99,102,241,.06);
        border: 1px solid var(--border-soft);
        overflow: hidden;
    }

    .detail-item-header {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: .55rem .75rem;
        background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(124,58,237,.06));
        border-bottom: 1px solid var(--border-soft);
    }
    .detail-item-index {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        border-radius: .4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
        font-size: .75rem;
    }
    .detail-item-name {
        flex: 1;
        font-size: .9rem;
        font-weight: 600;
        color: var(--text-main);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .detail-item-body {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: .35rem;
        padding: .6rem .75rem;
    }
    .detail-item-body > div {
        text-align: center;
    }
    .detail-item-body .label {
        display: block;
        font-size: .7rem;
        color: var(--text-muted);
        margin-bottom: 2px;
    }
    .detail-item-body .value {
        display: block;
        font-size: .88rem;
        font-weight: 600;
        color: var(--text-main);
    }
    .unit-badge {
        display: inline-block;
        background: rgba(99, 102, 241, .1);
        color: #a78bfa;
        padding: 2px 8px;
        border-radius: 10px;
        font-weight: 600;
        font-size: .82rem;
    }
    .detail-item-subtotal .value {
        color: var(--brand);
    }

    /* 合计卡片 */
    .detail-total-card {
        margin-top: .75rem;
        padding: .85rem 1rem;
        background: linear-gradient(135deg, #a78bfa 0%, #7DD3FC 50%, #60a5fa 100%);
        border-radius: .85rem;
        color: #fff;
        text-align: center;
        box-shadow: 0 4px 18px rgba(79, 70, 229, .3);
    }
    .detail-total-label {
        font-size: .78rem;
        opacity: .9;
        letter-spacing: 1px;
    }
    .detail-total-value {
        font-size: 1.6rem;
        font-weight: 700;
        margin: .25rem 0;
        letter-spacing: .5px;
    }
    .detail-total-items {
        font-size: .72rem;
        opacity: .85;
    }
}

/* ============================================================
   手机端订单录入/编辑页优化
   ============================================================ */
@media (max-width: 767.98px) {
    /* 供应商选择卡片调整 */
    #supplierGrid .col-6 {
        width: 50%;
        padding: 0 .3rem;
    }
    .supplier-card {
        padding: .6rem !important;
    }
    .supplier-card .fs-4 { font-size: 1rem !important; }
    .supplier-card .small { font-size: .72rem !important; }

    /* 表单区域优化 */
    #entrySection .row.mb-3 {
        flex-direction: column;
        margin-bottom: .35rem !important;
    }
    #entrySection .row.mb-3 > [class*="col-"] {
        width: 100%;
        margin-bottom: .2rem;
    }
    #entrySection .form-label {
        font-size: .78rem;
        margin-bottom: .1rem;
    }
    #entrySection .form-control {
        font-size: .82rem;
        padding: .28rem .4rem;
    }
    #entrySection .form-text {
        display: none;
    }

    /* 商品明细表格容器 */
    #itemsBody input.form-control {
        padding: .3rem .4rem;
        font-size: .82rem;
    }
    #itemsBody .input-group-text {
        padding: .3rem .3rem;
    }

    /* 操作按钮区域 */
    #entrySection .d-flex.justify-content-between {
        flex-direction: column;
        gap: .75rem;
    }
    #entrySection .d-flex.justify-content-between > div {
        width: 100%;
    }
    #entrySection .d-flex.justify-content-between .d-flex {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    #entrySection .btn {
        flex: 1;
        min-width: 120px;
    }

    /* 筛选区优化 */
    .card.shadow-sm.mb-3 .row.g-2 {
        flex-direction: column;
    }
    .card.shadow-sm.mb-3 .row.g-2 > [class*="col-"] {
        width: 100%;
        margin-bottom: .5rem;
    }
    .card.shadow-sm.mb-3 .row.g-2 .d-flex {
        gap: .5rem;
    }
    .card.shadow-sm.mb-3 .row.g-2 .d-flex .btn {
        flex: 1;
    }
}

/* ============================================================
   手机端超小屏（< 375px）补充优化
   ============================================================ */
@media (max-width: 374.98px) {
    .order-card-header,
    .order-card-body,
    .order-card-footer {
        padding: .55rem .7rem;
    }
    .order-card-amount {
        font-size: 1rem;
    }

    .supplier-card-mobile {
        padding: .6rem;
        gap: .6rem;
    }
    .supplier-card-avatar {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    .supplier-card-actions .btn {
        font-size: .72rem;
        padding: .25rem .3rem;
    }

    .log-card-header,
    .log-card-body {
        padding: .5rem .7rem;
    }

    .detail-header-info {
        padding: .55rem .75rem;
    }
    .detail-item-body {
        grid-template-columns: repeat(2, 1fr);
    }
    .detail-total-value {
        font-size: 1.3rem;
    }
}

/* ============================================================
   AI 智能问答卡片
   ============================================================ */
.ai-chat-card {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #fafbff 0%, #f3f0ff 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, .08);
}
.ai-chat-card .card-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    padding: .75rem 1rem;
}
.ai-chat-card .card-header .badge {
    background: rgba(255, 255, 255, .25) !important;
    color: #fff;
}
.ai-chat-card .card-header strong i {
    margin-right: .25rem;
}
.ai-chat-card .card-body {
    padding: 1rem;
}

/* 对话消息区 */
.ai-chat-messages {
    max-height: 420px;
    min-height: 220px;
    overflow-y: auto;
    padding: .5rem .25rem;
    margin-bottom: .75rem;
    scroll-behavior: smooth;
}
.ai-chat-messages::-webkit-scrollbar { width: 6px; }
.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, .3);
    border-radius: 3px;
}
.ai-chat-messages::-webkit-scrollbar-track { background: transparent; }

/* 欢迎区域 */
.ai-chat-welcome {
    text-align: center;
    padding: 1.5rem .5rem;
    color: #6b7280;
}
.ai-chat-welcome > i.bi-robot {
    font-size: 3rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: .75rem;
}
.ai-chat-welcome-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: .25rem;
}
.ai-chat-welcome-sub {
    font-size: .82rem;
    margin-bottom: 1rem;
}
.ai-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
}
.ai-suggestion-chip {
    border: 1px solid #c7d2fe;
    background: #fff;
    color: #4338ca;
    padding: .35rem .75rem;
    border-radius: 20px;
    font-size: .8rem;
    cursor: pointer;
    transition: all .2s ease;
}
.ai-suggestion-chip:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, .3);
}

/* 消息气泡 */
.ai-chat-msg {
    display: flex;
    margin-bottom: .85rem;
    animation: aiMsgIn .25s ease;
}
.ai-chat-msg.user {
    flex-direction: row-reverse;
}
.ai-chat-msg-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    margin: 0 .5rem;
}
.ai-chat-msg.ai .ai-chat-msg-avatar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.ai-chat-msg.user .ai-chat-msg-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
}
.ai-chat-msg-bubble {
    max-width: 80%;
    padding: .6rem .85rem;
    border-radius: 12px;
    font-size: .875rem;
    line-height: 1.6;
    word-break: break-word;
}
.ai-chat-msg.ai .ai-chat-msg-bubble {
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(99,102,241,.04);
}
.ai-chat-msg.user .ai-chat-msg-bubble {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-top-right-radius: 4px;
}
.ai-chat-msg-bubble p { margin: 0 0 .4rem 0; }
.ai-chat-msg-bubble p:last-child { margin-bottom: 0; }
.ai-chat-msg-bubble ul,
.ai-chat-msg-bubble ol { margin: .3rem 0 .3rem 1.1rem; padding: 0; }
.ai-chat-msg-bubble strong { font-weight: 600; }
.ai-chat-msg-bubble table {
    border-collapse: collapse;
    margin: .4rem 0;
    font-size: .82rem;
    width: 100%;
}
.ai-chat-msg-bubble th,
.ai-chat-msg-bubble td {
    border: 1px solid #e5e7eb;
    padding: .25rem .5rem;
}
.ai-chat-msg-bubble th {
    background: #f3f4f6;
    font-weight: 600;
}
.ai-chat-msg-meta {
    font-size: .7rem;
    color: #9ca3af;
    margin-top: .25rem;
}
.ai-chat-msg.user .ai-chat-msg-meta { text-align: right; }

/* 加载中状态 */
.ai-chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .8rem .85rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    border-top-left-radius: 4px;
}
.ai-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6366f1;
    opacity: .4;
    animation: aiTyping 1.2s infinite;
}
.ai-chat-typing span:nth-child(2) { animation-delay: .2s; }
.ai-chat-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes aiTyping {
    0%, 60%, 100% { opacity: .4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 输入区 */
.ai-chat-input-wrap {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
}
.ai-chat-input {
    flex: 1;
    resize: none;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: .55rem .75rem;
    font-size: .88rem;
    max-height: 120px;
    transition: border-color .2s, box-shadow .2s;
}
.ai-chat-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
    outline: none;
}
.ai-chat-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .35);
}
.ai-chat-send:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .5);
}
.ai-chat-send:active:not(:disabled) {
    transform: translateY(0);
}
.ai-chat-send:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* 折叠状态 */
.ai-chat-card.collapsed .card-body { display: none; }
.ai-chat-card.collapsed #aiChatToggle i { transform: rotate(180deg); }
#aiChatToggle i { transition: transform .25s ease; }

/* 手机端调整 */
@media (max-width: 767.98px) {
    .ai-chat-messages { max-height: 340px; min-height: 180px; }
    .ai-chat-msg-bubble { max-width: 88%; font-size: .85rem; }
    .ai-chat-welcome > i.bi-robot { font-size: 2.5rem; }
    .ai-chat-welcome-title { font-size: .98rem; }
    .ai-suggestion-chip { font-size: .76rem; padding: .3rem .6rem; }
}

/* ============================================================
   AI 浮动按钮 + 弹框（全站）
   ============================================================ */

/* 右下角浮动按钮 */
.ai-float-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #a78bfa 0%, #7DD3FC 50%, #60a5fa 100%);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 24px rgba(99, 102, 241, .4),
        0 2px 8px rgba(99,102,241,.12);
    transition: all .28s cubic-bezier(.4, 0, .2, 1);
    overflow: visible;
}
.ai-float-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 12px 30px rgba(99, 102, 241, .5),
        0 4px 14px rgba(99,102,241,.18);
}
.ai-float-btn:active {
    transform: translateY(0) scale(.98);
}
/* 呼吸光晕 */
.ai-float-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, .4);
    opacity: 0;
    animation: aiFloatPulse 2.4s ease-out infinite;
    pointer-events: none;
}
@keyframes aiFloatPulse {
    0%   { opacity: .6; transform: scale(1); }
    80%  { opacity: 0;  transform: scale(1.45); }
    100% { opacity: 0;  transform: scale(1.45); }
}
/* 手机端浮块上移避开底部导航 */
@media (max-width: 767.98px) {
    .ai-float-btn {
        right: 18px;
        bottom: 84px;
        width: 54px;
        height: 54px;
        font-size: 1.45rem;
    }
}

/* ============================================================
   AI 弹框 Modal
   ============================================================ */
.ai-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}
.ai-chat-modal.show {
    opacity: 1;
    visibility: visible;
}

/* 遮罩 */
.ai-chat-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(99,102,241,.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* 弹框容器 */
.ai-chat-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(720px, 92vw);
    height: min(88vh, 760px);
    max-height: 90vh;
    transform: translateY(20px) scale(.97);
    opacity: 0;
    transition: transform .26s cubic-bezier(.2, .8, .3, 1.1),
                opacity .22s ease;
}
.ai-chat-modal.show .ai-chat-modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 弹框内容 */
.ai-chat-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 30px 80px rgba(99,102,241,.18),
        0 10px 30px rgba(99, 102, 241, .15);
    animation: aiModalGlow 6s ease-in-out infinite alternate;
}
@keyframes aiModalGlow {
    from { box-shadow: 0 30px 80px rgba(99,102,241,.18), 0 10px 30px rgba(99,102,241,.15); }
    to   { box-shadow: 0 30px 80px rgba(99,102,241,.18), 0 10px 40px rgba(139,92,246,.24); }
}

/* 头部 */
.ai-chat-modal-header {
    padding: .9rem 1.1rem;
    background: linear-gradient(135deg, #a78bfa 0%, #7DD3FC 45%, #60a5fa 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.ai-chat-modal-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #22d3ee, #a855f7, #f472b6);
}
.ai-chat-modal-title {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.ai-chat-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
    animation: aiRobotBob 3s ease-in-out infinite;
}
@keyframes aiRobotBob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-3px) rotate(2deg); }
}
.ai-chat-modal-title strong {
    font-size: 1rem;
    letter-spacing: .3px;
}
.ai-chat-modal-title .badge {
    font-size: .7rem;
    font-weight: 500;
    background: rgba(255, 255, 255, .22) !important;
    color: #fff !important;
    vertical-align: middle;
}
.ai-chat-modal-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}
.ai-chat-modal-btn-icon:hover {
    background: rgba(255, 255, 255, .22);
    transform: translateY(-1px);
}
.ai-chat-modal-btn-icon:active {
    transform: translateY(0);
}

/* 提示条 */
.ai-chat-modal-tip {
    padding: .45rem 1.1rem;
    background: linear-gradient(90deg, #eef2ff 0%, #f5f3ff 100%);
    color: #4338ca;
    font-size: .78rem;
    border-bottom: 1px solid #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}
.ai-chat-modal-hotkey {
    color: #6d28d9;
    font-weight: 500;
}
.ai-chat-modal-hotkey kbd {
    padding: 1px 6px;
    font-size: .7rem;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-bottom-width: 2px;
    border-radius: 4px;
    color: #4338ca;
    font-family: inherit;
    margin: 0 1px;
}

/* 对话区（弹框内） */
.ai-chat-modal-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 1rem;
    background:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, .06) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, .06) 0, transparent 50%),
        linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
    scroll-behavior: smooth;
}
.ai-chat-modal-messages::-webkit-scrollbar { width: 7px; }
.ai-chat-modal-messages::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, .3);
    border-radius: 4px;
}
.ai-chat-modal-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, .5);
}
.ai-chat-modal-messages::-webkit-scrollbar-track { background: transparent; }

/* 弹框输入区 */
.ai-chat-modal-input-wrap {
    padding: .8rem 1rem 1rem;
    background: #fff;
    border-top: 1px solid #eef2ff;
    display: flex;
    gap: .55rem;
    align-items: flex-end;
}
.ai-chat-modal-input {
    flex: 1;
    resize: none;
    border-radius: 12px;
    border: 1.5px solid #c7d2fe;
    padding: .65rem .9rem;
    font-size: .88rem;
    line-height: 1.55;
    max-height: 140px;
    background: linear-gradient(180deg, #ffffff 0%, #fafaff 100%);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.ai-chat-modal-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
    outline: none;
}
.ai-chat-modal-send {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #a78bfa, #7DD3FC, #60a5fa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.ai-chat-modal-send:hover:not(:disabled) {
    transform: translateY(-2px) rotate(-3deg);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .5);
}
.ai-chat-modal-send:active:not(:disabled) {
    transform: translateY(0) rotate(0);
}
.ai-chat-modal-send.sending,
.ai-chat-modal-send:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: saturate(.8);
}

/* Markdown 预格式化样式补充（弹框内用） */
.ai-md-pre {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #4c1d95;
    border-radius: 8px;
    padding: .7rem .9rem;
    font-size: .78rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: .4rem 0;
    border-left: 3px solid #6366f1;
}
.ai-md-pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* 手机端弹框全屏 */
@media (max-width: 640px) {
    .ai-chat-modal-dialog {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .ai-chat-modal-content { border-radius: 0; }
    .ai-chat-modal-header { padding: .75rem .9rem; }
    .ai-chat-modal-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; }
    .ai-chat-modal-title strong { font-size: .95rem; }
    .ai-chat-modal-tip { font-size: .72rem; padding: .35rem .9rem; }
    .ai-chat-modal-messages { padding: .9rem .75rem; }
    .ai-chat-modal-input-wrap { padding: .6rem .75rem .85rem; }
    .ai-chat-modal-send { width: 44px; height: 44px; }
}

