/**
 * 侧边悬浮窗（仅 voohu.cn 国内站使用, 由 common/vh_sidebar.html 引入）
 * 设计稿: 侧边悬浮窗-VOOHU.dc.html (2026-07 品牌组)
 * 结构: 右侧中部固定 rail(客服/V+视界/手机查看/反馈/收起/置顶) + 左弹面板 + 收起后竖条 tab
 * 交互逻辑在 static/js/vh-sidebar.js（模板内不写内联 JS, 见 CLAUDE.md Footgun 5）
 */

/* 根节点: 模板里内联 display:none 防未加载样式时闪烁, 此处 !important 接管显示 */
#vh-sidebar { display: block !important; }

/* 新悬浮窗替代旧的右下角返回顶部按钮(本 CSS 仅国内站加载, 海外站不受影响) */
#gotoTop { display: none !important; }

#vh-sidebar, #vh-sidebar * { box-sizing: border-box; }

#vh-sidebar button {
    font-family: inherit;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

@keyframes vhSbPanelIn {
    from { opacity: 0; transform: translateY(-50%) translateX(10px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}
@keyframes vhSbFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes vhSbTabIn {
    from { opacity: 0; transform: translateY(-50%) translateX(20px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}
@keyframes vhSbFacePop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.42); }
    70%  { transform: scale(1.18); }
    100% { transform: scale(1.3); }
}

/* ---- 展开态容器(rail + 面板) ---- */
.vh-sb-wrap {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 998;
    width: 66px;
}
#vh-sidebar.is-collapsed .vh-sb-wrap { display: none; }

/* ---- rail ---- */
.vh-sb-rail {
    width: 66px;
    background: #fff;
    border: 1px solid #E5E5E5;
    border-right: none;
    border-radius: 14px 0 0 14px;
    box-shadow: -8px 12px 34px -20px rgba(26,26,26,0.34);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vh-sb-nav {
    color: #5a5a5a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 4px;
    border-radius: 10px;
    transition: background .18s, color .18s;
    min-height: 58px;
    font-size: 12px;
    line-height: 1.2;
}
.vh-sb-nav:hover { background: #F4F4F4; color: #1A1A1A; }
.vh-sb-nav.is-active { background: #C30D23; color: #fff; }

.vh-sb-divider { height: 1px; background: #EEEEEE; margin: 6px 8px; }

.vh-sb-collapse, .vh-sb-top {
    color: #8C8C8C;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 4px;
    border-radius: 10px;
    font-size: 12px;
    transition: background .18s, color .18s;
}
.vh-sb-collapse:hover { background: #F4F4F4; color: #1A1A1A; }
.vh-sb-top { display: none; }
#vh-sidebar.is-scrolled .vh-sb-top { display: flex; animation: vhSbFadeUp .3s cubic-bezier(0.22,1,0.36,1); }
.vh-sb-top:hover { background: #F4F4F4; color: #C30D23; }

/* ---- 面板公共 ---- */
.vh-sb-panel {
    display: none;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #E5E5E5;
    border-radius: 14px;
    box-shadow: 0 24px 60px -20px rgba(26,26,26,0.32);
    padding: 22px;
    color: #1A1A1A;
    text-align: left;
}
.vh-sb-panel.is-open { display: block; animation: vhSbPanelIn .26s cubic-bezier(0.22,1,0.36,1); }

.vh-sb-panel--service  { width: 296px; }
.vh-sb-panel--vplus    { width: 300px; }
.vh-sb-panel--mobile   { width: 300px; }
.vh-sb-panel--feedback { width: 396px; }

.vh-sb-panel-title { font-size: 18px; font-weight: 700; margin: 0 0 16px; }
.vh-sb-panel-title--tight { margin-bottom: 4px; }
.vh-sb-panel-sub { font-size: 13px; color: #8C8C8C; margin: 0 0 16px; }

/* ---- 在线客服面板 ---- */
.vh-sb-svc-list { display: flex; flex-direction: column; gap: 2px; }
.vh-sb-svc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 8px;
    border-radius: 10px;
    color: #1A1A1A;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background .16s, color .16s;
}
a.vh-sb-svc-item:hover { background: #FDF0F1; color: #C30D23; }
.vh-sb-svc-ico {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #C30D23;
    color: #fff;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.vh-sb-svc-qr {
    margin: 16px 4px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.vh-sb-svc-qr img {
    width: 132px;
    height: 132px;
    border-radius: 12px;
    border: 1px solid #E5E5E5;
    object-fit: cover;
    display: block;
}
.vh-sb-svc-hours { text-align: center; font-size: 13px; line-height: 1.7; color: #8C8C8C; }

/* ---- V+视界 / 手机查看 面板(二维码行) ---- */
.vh-sb-qr-list { display: flex; flex-direction: column; gap: 16px; }
.vh-sb-qr-row { display: flex; align-items: center; gap: 16px; }
.vh-sb-qr-row img {
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid #E5E5E5;
    object-fit: cover;
    display: block;
}
.vh-sb-qr-name { font-size: 15px; font-weight: 500; }
.vh-sb-qr-desc { font-size: 13px; color: #8C8C8C; margin-top: 3px; }

/* ---- 反馈面板 ---- */
.vh-sb-faces { display: flex; justify-content: space-between; margin-bottom: 18px; }
.vh-sb-face {
    flex: 1;
    color: #8C8C8C;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 2px;
    border-radius: 10px;
    font-size: 12px;
    transform: scale(1);
    transition: color .18s, transform .2s cubic-bezier(0.34,1.56,0.64,1);
}
.vh-sb-face.is-active {
    color: #C30D23;
    transform: scale(1.3);
    animation: vhSbFacePop .5s cubic-bezier(0.34,1.56,0.64,1);
}
.vh-sb-face-ico {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.vh-sb-face-ico--4 {
    background: radial-gradient(circle at 33% 27%, rgba(255,255,255,0.85), rgba(255,255,255,0) 45%), linear-gradient(150deg, #4FD08C, #1E9E5E);
    box-shadow: 0 5px 10px -3px rgba(30,158,94,0.5), inset 0 -3px 6px rgba(0,0,0,0.18), inset 0 3px 5px rgba(255,255,255,0.35);
}
.vh-sb-face-ico--3 {
    background: radial-gradient(circle at 33% 27%, rgba(255,255,255,0.85), rgba(255,255,255,0) 45%), linear-gradient(150deg, #A6D85E, #6BA82C);
    box-shadow: 0 5px 10px -3px rgba(107,168,44,0.5), inset 0 -3px 6px rgba(0,0,0,0.18), inset 0 3px 5px rgba(255,255,255,0.35);
}
.vh-sb-face-ico--2 {
    background: radial-gradient(circle at 33% 27%, rgba(255,255,255,0.85), rgba(255,255,255,0) 45%), linear-gradient(150deg, #FFC85C, #E09A1E);
    box-shadow: 0 5px 10px -3px rgba(224,154,30,0.5), inset 0 -3px 6px rgba(0,0,0,0.18), inset 0 3px 5px rgba(255,255,255,0.35);
}
.vh-sb-face-ico--1 {
    background: radial-gradient(circle at 33% 27%, rgba(255,255,255,0.85), rgba(255,255,255,0) 45%), linear-gradient(150deg, #FF9E4D, #DA6C15);
    box-shadow: 0 5px 10px -3px rgba(218,108,21,0.5), inset 0 -3px 6px rgba(0,0,0,0.18), inset 0 3px 5px rgba(255,255,255,0.35);
}
.vh-sb-face-ico--0 {
    background: radial-gradient(circle at 33% 27%, rgba(255,255,255,0.85), rgba(255,255,255,0) 45%), linear-gradient(150deg, #FF6A5E, #D62B20);
    box-shadow: 0 5px 10px -3px rgba(214,43,32,0.5), inset 0 -3px 6px rgba(0,0,0,0.18), inset 0 3px 5px rgba(255,255,255,0.35);
}

.vh-sb-fb-note { font-size: 13px; line-height: 1.7; color: #8C8C8C; margin: 0 0 12px; }
.vh-sb-fb-text {
    width: 100%;
    height: 90px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    color: #1A1A1A;
    background: #F4F4F4;
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
    margin-bottom: 14px;
}
.vh-sb-fb-text:focus { border-color: #C30D23; }
.vh-sb-fb-foot { display: flex; justify-content: flex-end; }
.vh-sb-fb-submit {
    font-size: 14px;
    background: #C30D23;
    color: #fff;
    padding: 11px 24px;
    border-radius: 6px;
    transition: background .18s, opacity .18s;
}
.vh-sb-fb-submit:hover { background: #8A0A18; }
.vh-sb-fb-submit[disabled] { opacity: .6; cursor: default; }

/* ---- 收起后的竖条 tab ----
 * 选择器带 #vh-sidebar 前缀提权: 站内全局 button/span 样式(nc.css 等)会盖掉
 * 低特异度类选择器, 曾导致线上收起态文字发蓝、字小不明显 */
#vh-sidebar .vh-sb-tab {
    display: none;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 998;
    border: 1px solid #E5E5E5;
    border-right: none;
    background: #fff;
    color: #1A1A1A;
    border-radius: 12px 0 0 12px;
    box-shadow: -10px 14px 36px -14px rgba(26,26,26,0.35), 0 4px 14px rgba(26,26,26,0.10);
    padding: 18px 12px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#vh-sidebar.is-collapsed .vh-sb-tab { display: flex; animation: vhSbTabIn .3s cubic-bezier(0.22,1,0.36,1); }
#vh-sidebar .vh-sb-tab:hover { color: #C30D23; }
#vh-sidebar .vh-sb-tab svg { display: block; flex: 0 0 auto; }
#vh-sidebar .vh-sb-tab span {
    writing-mode: vertical-rl;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.16em;
    color: inherit;
}

/* 窄屏(平板/手机宽度窗口)隐藏——手机流量本就 302 到 /h5/, 这里兜底 */
@media (max-width: 1023px) {
    #vh-sidebar { display: none !important; }
}
