@import url('service-avatar.css?v=5');
/* ============ 智能客服（24小时） ============ */
.cs-fab {
    position: fixed;
    right: 22px;
    bottom: 96px;
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
    font-family: inherit;
}

.cs-fab-avatar {
    position: relative;
    width: 78px;
    height: 96px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    overflow: hidden;
    border: 2.5px solid #fff;
    animation: csFloat 3.2s ease-in-out infinite;
}

.cs-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: inherit;
    display: block;
}

.cs-fab-avatar .cs-avatar-img { animation: csBreath 3.2s ease-in-out infinite; }

.cs-fab-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(transparent, rgba(29, 78, 216, 0.88));
}

.cs-fab-avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 22px;
    border: 2px solid rgba(59, 130, 246, 0.45);
    animation: csPulse 2.4s ease-out infinite;
}

.cs-fab-dot {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-sizing: content-box;
}

.cs-fab-badge {
    position: absolute;
    left: 48px;
    top: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    display: none;
}

.cs-fab-badge.show { display: block; }

.cs-fab-tip {
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px 12px 2px 12px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(6px);
    transition: all .35s ease;
    pointer-events: none;
}

.cs-fab-tip.show { opacity: 1; transform: translateY(0); }

@keyframes csFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes csPulse {
    0% { transform: scale(.9); opacity: .9; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes csBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ---------- 二级页面 ---------- */
.cs-page {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.cs-page.open { opacity: 1; visibility: visible; }

.cs-shell {
    position: relative;
    width: 100%;
    max-width: 760px;
    height: min(86vh, 860px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(18px) scale(.98);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.cs-page.open .cs-shell { transform: translateY(0) scale(1); }

.cs-head {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cs-head-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.cs-head-info { flex: 1; min-width: 0; }

.cs-head-info h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.cs-head-info span {
    font-size: 12.5px;
    opacity: .92;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cs-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .28);
}

.cs-head-btn {
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: background .2s;
}

.cs-head-btn:hover { background: rgba(255, 255, 255, .24); }

.cs-close {
    border: none;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

.cs-close:hover { background: rgba(255, 255, 255, .3); }

.cs-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 8px;
    background: #f6f8fc;
    scroll-behavior: smooth;
}

.cs-msg {
    display: flex;
    gap: 9px;
    margin-bottom: 14px;
    align-items: flex-end;
}

.cs-msg.me { flex-direction: row-reverse; }

.cs-ava {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    overflow: hidden;
    border: 1.5px solid #fff;
}

.cs-ava-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.cs-msg.me .cs-ava { background: linear-gradient(135deg, #94a3b8, #64748b); border-color: transparent; }

.cs-bubblewrap {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.cs-msg.me .cs-bubblewrap { align-items: flex-end; }

.cs-bubble {
    max-width: 100%;
    background: #fff;
    color: var(--text);
    padding: 11px 14px;
    border-radius: 14px 14px 14px 4px;
    font-size: 14.5px;
    line-height: 1.7;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
    word-break: break-word;
}

.cs-msg.me .cs-bubble {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-radius: 14px 14px 4px 14px;
}

.cs-bubble b { font-weight: 700; }

.cs-bubble .cs-line { display: block; }

.cs-card {
    margin-top: 9px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    font-size: 13.5px;
    line-height: 1.65;
}

.cs-card h5 {
    margin: 0 0 4px;
    font-size: 13.5px;
    color: var(--primary-dark);
}

.cs-card a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.cs-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }

.cs-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: csBlink 1.2s infinite;
}

.cs-typing i:nth-child(2) { animation-delay: .2s; }
.cs-typing i:nth-child(3) { animation-delay: .4s; }

@keyframes csBlink {
    0%, 60%, 100% { opacity: .3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.cs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 4px;
    background: #f6f8fc;
    flex-shrink: 0;
}

.cs-chips:empty { display: none; }

.cs-chip {
    border: 1px solid #c7d8fb;
    background: #fff;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all .18s;
}

.cs-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.cs-foot {
    padding: 10px 14px 14px;
    background: #fff;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.cs-inputbar {
    display: flex;
    gap: 9px;
    align-items: center;
}

.cs-inputbar input {
    flex: 1;
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 14.5px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, background .2s;
}

.cs-inputbar input:focus { border-color: var(--primary); background: #fff; }

.cs-send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
}

.cs-send:active { transform: scale(.95); }

.cs-hint {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-light);
    margin: 8px 0 0;
}

/* ---------- 消息元信息 ---------- */
.cs-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 0 3px;
    font-size: 11px;
    color: #94a3b8;
    opacity: .9;
}

.cs-msg.me .cs-meta { justify-content: flex-end; }

.cs-time { letter-spacing: .3px; }

.cs-act {
    border: none;
    background: none;
    padding: 0;
    color: #a3aec2;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: inherit;
    transition: color .18s;
}

.cs-act:hover,
.cs-act.on { color: var(--primary); }

.cs-fb-done {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #16a34a;
}

/* ---------- 服务导航 ---------- */
.cs-hint-line {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    color: #94a3b8;
}

.cs-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.cs-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 10px 9px;
    border: 1px solid #e2e8f5;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}

.cs-tile i {
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 3px;
}

.cs-tile b {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.2;
}

.cs-tile small {
    font-size: 10.5px;
    color: #94a3b8;
    line-height: 1.3;
}

.cs-tile:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, .10);
}

/* ---------- 常见问题 ---------- */
.cs-faq {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 9px;
}

.cs-faq button {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    text-align: left;
    border: 1px solid #e2e8f5;
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    transition: all .18s;
}

.cs-faq button i { color: #93c5fd; font-size: 12px; }

.cs-faq button:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
    color: var(--primary-dark);
}

/* ---------- 景点标签 ---------- */
.cs-spot-city {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-left: 2px;
}

.cs-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 6px;
}

.cs-tag-wx { background: #dcfce7; color: #15803d; }
.cs-tag-paid { background: #dbeafe; color: #1d4ed8; }
.cs-tag-free { background: #f1f5f9; color: #475569; }

.cs-note { font-size: 11.5px; color: #94a3b8; }

/* ---------- 正在输入 ---------- */
.cs-typing-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.cs-typing-txt { font-size: 12px; color: #94a3b8; }

/* ---------- 航班/火车/行程条目样式 ---------- */
.cs-t-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    font-size: 13px;
    line-height: 1.5;
}

.cs-t-row b { color: var(--primary-dark); font-weight: 600; }
.cs-t-p { color: #dc2626; font-weight: 600; font-size: 13.5px; }
.cs-t-tip { color: #94a3b8; font-size: 11.5px; }
.cs-t-row a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
    padding: 2px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    transition: all .15s;
}

.cs-t-row a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.cs-t-time {
    display: inline-block;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 11.5px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 3px;
}

.cs-t-detail { color: #475569; font-size: 12.5px; }

.cs-d-item {
    padding: 4px 0 4px 10px;
    border-left: 2px solid #dbeafe;
    margin: 3px 0;
    font-size: 13px;
    line-height: 1.6;
}

.cs-d-item b { color: #1e293b; }

/* ---------- 回到最新 ---------- */
.cs-tobottom {
    position: absolute;
    right: 18px;
    bottom: 124px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f5;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .14);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3;
    font-size: 13px;
}

.cs-tobottom.show { display: flex; }

/* ---------- 更多菜单 ---------- */
.cs-more-wrap { position: relative; flex-shrink: 0; }
.cs-more-btn { padding: 7px 10px; }

.cs-more-list {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    display: none;
    min-width: 156px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .22);
    padding: 6px;
    z-index: 8;
}

.cs-more-list.open { display: block; }

.cs-more-list button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: none;
    background: none;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.cs-more-list button:hover { background: #f1f5f9; color: var(--primary-dark); }
.cs-more-list i { width: 14px; color: #93c5fd; }

.cs-send:disabled { opacity: .45; cursor: default; box-shadow: none; }

body.cs-lock { overflow: hidden; }

@media (max-width: 768px) {
    .cs-page { padding: 0; align-items: flex-end; }

    .cs-shell {
        max-width: none;
        height: 92vh;
        border-radius: 18px 18px 0 0;
    }

    .cs-fab { right: 14px; bottom: 84px; }
    .cs-fab-avatar { width: 64px; height: 80px; border-radius: 16px; font-size: 23px; }
    .cs-fab-tip { display: none; }
    .cs-bubblewrap { max-width: 84%; }
    .cs-bubble { font-size: 14px; }
    .cs-head { padding: 13px 14px; gap: 8px; }
    .cs-head-info h4 { font-size: 16px; }
    .cs-head-btn span { display: none; }
    .cs-menu { grid-template-columns: repeat(2, 1fr); }
    .cs-tobottom { right: 12px; bottom: 120px; }
}
