/* ============================================================
 * 营口市慈善总会官网 · PC 端首页右侧漂浮服务面板（floatpanel.css）
 * 引入位置：template/pc/index.htm（仅 PC 首页）
 * 结构：左侧收起按钮 + 面板主体（公众号二维码 / 联系我们 / 在线捐赠 / 返回顶部）
 * 规范：全部取 Design Token，8px 栅格，圆角 8px，悬停/选中主色底白字
 * ============================================================ */

.yk-float,
.yk-float * { box-sizing: border-box; }

.yk-float {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
}

/* ---------- 收起 / 展开按钮（面板左侧竖排小标签） ---------- */
.yk-float-toggle {
    flex: 0 0 auto;
    width: 24px;
    padding: var(--spacing-xs) 0;
    border: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-text-white);
    font-family: inherit;
    font-size: var(--font-size-xs);
    line-height: 1;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-fast);
}
.yk-float-toggle:hover { background: var(--color-primary-dark); }

/* ---------- 面板主体：一个白色容器，内部纵向排列功能项 ---------- */
.yk-float-body {
    display: flex;
    flex-direction: column;
    width: 96px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.yk-float.is-collapsed .yk-float-body { display: none; }

/* ---------- 单个功能项（无独立卡片：靠分隔线区分，容器整体一个白底） ---------- */
.yk-float-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
    border: 0;
    border-bottom: 1px solid var(--color-border-light);
    border-radius: 0;
    background: transparent;
    color: var(--pc-text-soft);
    font-family: inherit;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-tight);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
/* 首项默认红色系（公众号二维码），末项去掉分隔线并保留容器底部圆角 */
.yk-float-item:first-child {
    background: var(--color-primary);
    color: var(--color-text-white);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.yk-float-item:last-child {
    border-bottom: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.yk-float-item > .ph {
    font-size: 24px;
    line-height: 1;
}
.yk-float-item:hover,
.yk-float-item:focus-visible {
    background: var(--color-primary);
    color: var(--color-text-white);
}

/* ---------- 悬停弹出层（二维码 / 官方电话） ---------- */
.yk-float-pop {
    position: absolute;
    top: 50%;
    right: calc(100% + var(--spacing-md));
    transform: translateY(-50%) translateX(var(--spacing-xs));
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    background: var(--color-bg-card);
    color: var(--color-text-main);
    box-shadow: var(--shadow-lg);
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base),
                visibility var(--transition-base);
}
/* 悬停区域桥梁：补满弹层与功能项之间的 16px 空隙，方便移入点击电话 */
.yk-float-pop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    width: var(--spacing-md);
    height: 100%;
}
/* 指向功能项的白色小箭头 */
.yk-float-pop::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    margin-top: -8px;
    border: 8px solid transparent;
    border-left-color: var(--color-bg-card);
}
.yk-float-item:hover .yk-float-pop,
.yk-float-item:focus-visible .yk-float-pop,
.yk-float-item:focus-within .yk-float-pop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

/* 弹出层内容：公众号二维码 */
.yk-float-qr {
    display: block;
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--color-bg-page);
}
.yk-float-pop-title {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
    color: var(--color-text-sub);
}

/* 弹出层内容：官方电话 */
.yk-float-phone-label {
    display: block;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
    color: var(--color-text-sub);
}
.yk-float-phone {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    text-decoration: none;
}
.yk-float-phone:hover { color: var(--color-primary-dark); }

/* 窄屏兜底：PC 模板在 <1024px 会自动切手机端，此处仅防闪烁 */
@media (max-width: 1023px) {
    .yk-float { display: none; }
}
