/* ============ 右侧浮动侧边栏 ============ */
.side-float{
    position: fixed;
    right: 0;
    top: 40%;
    transform: translateY(-50%);
    z-index: 900;
    background: #fff;
    border-radius: 12px 0 0 12px;
    box-shadow: -2px 0 16px rgba(0,0,0,.1);
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64px;
}
.sf-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 6px;
    color: var(--color-text-light);
    font-size: 10px;
    transition: color .2s, background .2s;
    width: 100%;
    text-align: center;
}
.sf-item:hover{
    color: var(--color-primary);
    background: var(--color-primary-light);
}
.sf-item svg{
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.sf-item.sf-primary{
    color: #fff;
    background: var(--color-primary);
    border-radius: 8px;
    margin: 4px 6px;
    width: calc(100% - 12px);
    padding: 10px 6px;
}
.sf-item.sf-primary:hover{
    background: var(--color-primary-dark);
    color: #fff;
}
.sf-item.sf-accent{
    color: var(--color-accent);
}
.sf-item.sf-accent:hover{
    background: #FFF3EB;
    color: #E85C23;
}
.sf-divider{
    width: 32px;
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

/* ============ 底部浮动报名条 ============ */
.bottom-bar{
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    z-index: 900;
    background: linear-gradient(90deg, #FF7A45, #FBBF24);
    box-shadow: 0 -4px 16px rgba(0,0,0,.12);
    padding: 12px 0;
    transition: transform .3s ease;
}
.bottom-bar.hidden{
    transform: translateY(100%);
}
.bottom-bar-inner{
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}
.bb-text{
    flex-shrink: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}
.bb-text em{
    font-style: normal;
    font-weight: 800;
    font-size: 15px;
    background: rgba(255,255,255,.2);
    padding: 2px 6px;
    border-radius: 4px;
}
.bb-form{
    display: flex;
    gap: 8px;
    flex: 1;
    align-items: center;
}
.bb-form input,
.bb-form select{
    padding: 9px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    min-width: 0;
    flex: 1;
}
.bb-form input:focus,
.bb-form select:focus{
    outline: 2px solid var(--color-primary);
}
.bb-submit{
    padding: 9px 24px;
    background: #DC2626;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.bb-submit:hover{ background: #B91C1C; }
.bb-close{
    position: absolute;
    top: -14px;
    right: 12px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #fff;
    color: #6B7280;
    font-size: 15px;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    cursor: pointer;
    border: none;
    line-height: 1;
}
.bb-close:hover{ color: #DC2626; }

/* ============ 右下角在线客服对话框 ============ */
.cs-widget{
    position: fixed;
    right: 80px;
    bottom: 16px;
    z-index: 950;
    font-family: inherit;
}
/* 收起态：让 widget 本身不占位，tab 自己 fixed 到底部居中 */
.cs-widget:not(.cs-widget--open){
    right: auto; left: 0; bottom: 0; width: 100%;
    pointer-events: none; /* 只让 tab 可点 */
}

.cs-tab{
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 12px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(220,38,38,.45), 0 2px 6px rgba(0,0,0,.08);
    position: fixed;
    right: 24px;
    bottom: 24px;
    transition: transform .2s ease, box-shadow .2s ease, bottom .2s ease;
    pointer-events: auto;
    animation: csTabIn .35s cubic-bezier(.3,1.2,.5,1);
}
.cs-tab:hover{
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(220,38,38,.55), 0 2px 6px rgba(0,0,0,.1);
}
@keyframes csTabIn{
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cs-tab-avatar{
    width: 32px; height: 32px;
    flex-shrink: 0;
    display: block;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    border-radius: 50%;
}
.cs-tab-avatar svg{ width: 100%; height: 100%; display: block; }
.cs-tab-text{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}
.cs-tab-text strong{
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
}
.cs-tab-text em{
    font-size: 11px;
    font-style: normal;
    opacity: .9;
    margin-top: 2px;
}
.cs-tab-arrow{
    width: 16px; height: 16px;
    margin-left: 4px;
    opacity: .85;
}
.cs-widget:not(.cs-widget--open) .cs-tab{ display: inline-flex; }
/* 有底部吸底条时把 tab 往上顶 */
body:has(.bottom-bar:not(.hidden)) .cs-tab{ bottom: 104px; }

.cs-card{
    width: 268px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.06);
    overflow: hidden;
    display: none;
    animation: csCardIn .28s cubic-bezier(.3,1.2,.5,1);
    flex-direction: column;
    position: relative;
}
.cs-widget--open .cs-card{ display: flex; }
@keyframes csCardIn{
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cs-chat-header{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: #fff;
    position: relative;
}
.cs-chat-header::after{
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 30%, rgba(255,255,255,.12), transparent 50%);
    pointer-events: none;
}
.cs-chat-avatar{
    width: 30px; height: 30px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.cs-chat-avatar svg{ width: 100%; height: 100%; display: block; }
.cs-chat-title{
    flex: 1;
    position: relative;
    z-index: 1;
}
.cs-chat-title strong{
    display: block;
    font-size: 13px;
    font-weight: 700;
}
.cs-chat-title span{
    display: block;
    font-size: 11px;
    opacity: .85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-online-dot{
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4ADE80;
    display: inline-block;
    box-shadow: 0 0 6px rgba(74,222,128,.6);
    animation: csPulse 2s infinite;
}
@keyframes csPulse{
    0%,100%{ opacity: 1; }
    50%{ opacity: .5; }
}
.cs-card-close{
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 32px; height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s;
    flex-shrink: 0;
}
.cs-card-close:hover{ background: rgba(255,255,255,.5); }

/* 对话区域 */
.cs-chat-body{
    height: 260px;
    overflow-y: auto;
    padding: 8px 10px 4px;
    background: #F7F8FA;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cs-chat-body::-webkit-scrollbar{ width: 4px; }
.cs-chat-body::-webkit-scrollbar-thumb{ background: #D1D5DB; border-radius: 2px; }

.cs-msg{ display: flex; gap: 8px; align-items: flex-start; }
.cs-msg--sys{
    justify-content: center;
    gap: 0;
}
.cs-msg--sys span{
    font-size: 11px;
    color: #9CA3AF;
    background: #E5E7EB;
    padding: 3px 12px;
    border-radius: 999px;
}

/* 公告区（新航道式关键词引导） */
.cs-notice{
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    text-align: center;
    font-size: 12px;
    line-height: 1.7;
    color: #374151;
}
.cs-notice p{ margin: 0; }
.cs-notice .cs-notice-slogan{
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 2px;
}
.cs-notice .cs-notice-head{
    color: #1F2937;
    margin-bottom: 4px;
}
.cs-notice .cs-notice-line{
    font-size: 11px;
    color: #4B5563;
    text-align: left;
}
.cs-notice .cs-notice-soft{
    font-size: 11px;
    color: #6B7280;
    margin-top: 4px;
}
.cs-notice em{ font-style: normal; font-weight: 600; }
.cs-notice em.r{ color: #C0392B; }
.cs-notice em.b{ color: #07A9FE; }
.cs-notice em.y{ color: #F39C12; }
.cs-notice em.g{ color: #16A085; }
.cs-notice em.p{ color: #F32784; }

.cs-msg-avatar{
    width: 28px; height: 28px;
    flex-shrink: 0;
}
.cs-msg-avatar svg{ width: 100%; height: 100%; display: block; }
.cs-msg-bubble{
    max-width: 230px;
    padding: 8px 11px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--color-text);
    background: #fff;
    border-radius: 2px 14px 14px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    word-break: break-word;
}
.cs-msg-bubble a{
    color: #DC2626;
    font-weight: 700;
}
.cs-msg--user{
    flex-direction: row-reverse;
}
.cs-msg--user .cs-msg-bubble{
    background: #DC2626;
    color: #fff;
    border-radius: 14px 2px 14px 14px;
}
.cs-msg--user .cs-msg-bubble a{ color: #fff; text-decoration: underline; }

/* 气泡内的操作按钮（仿新航道"复制微信"样式 → 这里用于拨打电话） */
.cs-msg-actions{
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #E5E7EB;
    display: flex;
    gap: 6px;
}
.cs-copy-btn{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #DC2626;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}
.cs-copy-btn:hover{
    background: #DC2626;
    color: #fff;
    border-color: #DC2626;
}
.cs-copy-btn svg{ width: 12px; height: 12px; }
.cs-msg--typing .cs-msg-bubble{
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 18px;
}
.cs-typing-dot{
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #9CA3AF;
    animation: csTyping 1.2s infinite;
}
.cs-typing-dot:nth-child(2){ animation-delay: .2s; }
.cs-typing-dot:nth-child(3){ animation-delay: .4s; }
@keyframes csTyping{
    0%,60%,100%{ opacity: .3; transform: translateY(0); }
    30%{ opacity: 1; transform: translateY(-4px); }
}

/* 快捷回复 */
.cs-quick-replies{
    padding: 6px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    background: #fff;
    border-top: 1px solid #F1F5F9;
}
.cs-quick-btn{
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #DC2626;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s;
}
.cs-quick-btn:hover{
    background: #DC2626;
    color: #fff;
    border-color: #DC2626;
}

/* 输入框 */
.cs-chat-footer{
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-top: 1px solid #E5E7EB;
}
.cs-chat-input{
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #F9FAFB;
    transition: border-color .2s;
}
.cs-chat-input:focus{
    outline: none;
    border-color: #DC2626;
    background: #fff;
}
.cs-chat-input::placeholder{ color: #9CA3AF; }
.cs-chat-send{
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #DC2626;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.cs-chat-send:hover{ background: #B91C1C; }

body:has(.bottom-bar:not(.hidden)) .cs-widget{
    bottom: 96px;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px){
    .side-float{ display: none; }
    .cs-widget{ right: 16px; }
}
@media (max-width: 768px){
    .cs-widget{ right: 12px; bottom: 80px; }
    .cs-card{ width: calc(100vw - 24px); max-width: 360px; }
    .cs-tab{ padding: 8px 14px 8px 10px; right: 12px; bottom: 16px; }
    .cs-tab-avatar{ width: 28px; height: 28px; }
    .cs-tab-text strong{ font-size: 13px; }
    .cs-tab-text em{ font-size: 10px; }
    .cs-chat-body{ height: 240px; }
    body:has(.bottom-bar:not(.hidden)) .cs-widget{ bottom: 140px; }
    body:has(.bottom-bar:not(.hidden)) .cs-tab{ bottom: 92px; }
}
@media (max-width: 768px){
    .bb-text{ display: none; }
    .bb-form{ flex-wrap: wrap; }
    .bb-form input,
    .bb-form select{ flex-basis: calc(50% - 4px); }
}
@media (max-width: 480px){
    .bottom-bar{ padding: 10px 0; }
    .bb-form input,
    .bb-form select{ font-size: 12px; padding: 8px 10px; }
    .bb-submit{ padding: 8px 16px; font-size: 13px; }
}

/* ============ 站内通用预约弹窗（掌门式） ============ */
.bk-modal{
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.bk-modal.bk-open{ display: flex; }
.bk-backdrop{
    position: absolute;
    inset: 0;
    background: rgba(8,16,38,.58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: bkFade .22s ease;
}
.bk-dialog{
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px 24px 20px;
    box-shadow: 0 32px 80px rgba(15,23,42,.35), 0 4px 12px rgba(15,23,42,.1);
    animation: bkPop .25s cubic-bezier(.3,1.2,.5,1);
}
@keyframes bkFade{
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes bkPop{
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.bk-close{
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border: none;
    background: #F3F4F6;
    color: #6B7280;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s, color .2s;
}
.bk-close:hover{ background: #FEE2E2; color: #DC2626; }

.bk-head{ text-align: center; margin-bottom: 14px; }
.bk-eyebrow{
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #FF7A45, #FBBF24);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    margin-bottom: 10px;
}
.bk-head h3{
    font-size: 19px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.35;
    margin: 0 0 6px;
}
.bk-head h3 em{
    font-style: normal;
    color: #DC2626;
    font-size: 22px;
}
.bk-head p{
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.55;
    margin: 0;
}

.bk-perks{
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 0;
    margin: 12px 0;
    border-top: 1px dashed #E5E7EB;
    border-bottom: 1px dashed #E5E7EB;
    list-style: none;
    flex-wrap: wrap;
}
.bk-perks li{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text);
}
.bk-perks li svg{
    width: 14px; height: 14px;
    color: #22C55E;
}

.bk-form{ display: grid; gap: 10px; }
.bk-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-field{ position: relative; }
.bk-field input,
.bk-field select{
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.bk-field input:focus,
.bk-field select:focus{
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(46,107,230,.14);
}
.bk-submit{
    width: 100%;
    padding: 13px;
    background: linear-gradient(90deg, #FF7A45 0%, #DC2626 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 2px;
    box-shadow: 0 10px 24px -6px rgba(220,38,38,.45);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.bk-submit:hover{
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 14px 28px -6px rgba(220,38,38,.55);
}
.bk-submit:active{ transform: translateY(0); }
.bk-privacy{
    font-size: 11px;
    color: var(--color-text-light);
    text-align: center;
    margin: 2px 0 0;
    line-height: 1.5;
}

.bk-foot{
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
    font-size: 12px;
    color: var(--color-text-light);
    text-align: center;
}
.bk-foot a{
    color: #DC2626;
    font-weight: 700;
    margin-left: 6px;
}

body.bk-lock{ overflow: hidden; }

@media (max-width: 480px){
    .bk-dialog{ padding: 20px 18px 16px; border-radius: 14px; }
    .bk-head h3{ font-size: 17px; }
    .bk-head h3 em{ font-size: 20px; }
    .bk-row{ grid-template-columns: 1fr; }
}

/* ============ 二维码弹窗 ============ */
.qr-modal{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.5);
    align-items: center;
    justify-content: center;
}
.qr-modal.show{
    display: flex;
}
.qr-modal-content{
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
    max-width: 320px;
    width: 90%;
}
.qr-modal-content img{
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 16px;
}
.qr-modal-content p{
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.qr-modal-close{
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    color: #666;
    transition: background .2s;
}
.qr-modal-close:hover{
    background: #e5e7eb;
}

/* ============ 浮动栏小程序码弹出 ============ */
.sf-qr-wrap{
    position: relative;
    cursor: pointer;
}
.sf-qr-popup{
    position: fixed;
    right: 80px;
    top: 40%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 12px;
    padding: 8px 8px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    text-align: center;
    z-index: 899;
    width: 180px;
}
.sf-qr-popup.sf-qr-always{
    display: block;
}
.sf-qr-popup img{
    width: 164px;
    height: 164px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto 6px;
}
.sf-qr-popup p{
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}
.sf-qr-popup::after{
    display: none;
}
.sf-qr-popup::after{
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    box-shadow: 2px -2px 4px rgba(0,0,0,.06);
}

/* 二维码弹窗关闭按钮 */
.sf-qr-close{
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0,0,0,.08);
    border-radius: 50%;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    color: #666;
    transition: background .2s;
    z-index: 10;
}
.sf-qr-close:hover{
    background: rgba(0,0,0,.15);
}
