/* ==========================================================================
   信用卡推广右下角悬浮挂件样式 - 高级精细规范版 (Finance Tech Premium)
   ========================================================================== */

/* 1. 右下角悬浮胶囊按钮 */
.cc-float-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cc-float-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px 9px 11px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #0F172A;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 50px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.cc-float-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.08), transparent);
    animation: cc-shimmer 4s infinite;
}

@keyframes cc-shimmer {
    0% { left: -100%; }
    25% { left: 100%; }
    100% { left: 100%; }
}

.cc-float-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 30px -5px rgba(79, 70, 229, 0.18), 0 0 0 1px #818CF8;
    background: #FFFFFF;
}

.cc-float-btn:active {
    transform: translateY(0) scale(0.98);
}

.cc-float-icon-wrap {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
    flex-shrink: 0;
}

.cc-float-icon-wrap::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    border: 2px solid rgba(79, 70, 229, 0.25);
    animation: cc-pulse 2s infinite;
}

@keyframes cc-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.cc-float-text-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.cc-float-title {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.cc-float-desc {
    font-size: 11px;
    color: #64748B;
    margin-top: 2px;
    line-height: 1.2;
}

.cc-float-close-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(226, 232, 240, 0.85);
    color: #94A3B8;
    border: 1.5px solid rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.cc-float-widget:hover .cc-float-close-btn {
    opacity: 1;
    pointer-events: auto;
}

.cc-float-close-btn:hover {
    background: #EF4444;
    color: #FFFFFF;
    border-color: #FFFFFF;
    transform: scale(1.1);
}

/* 2. 展开的弹窗面板 (Popover Card Panel) */
.cc-popover-card {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 350px;
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9995;
}

.cc-popover-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.cc-card-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #FFFFFF;
    padding: 16px 20px;
    position: relative;
}

.cc-card-header-title {
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF !important;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cc-card-header-title i {
    color: #F59E0B;
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.4));
}

.cc-card-header-sub {
    font-size: 12.5px;
    color: #E2E8F0 !important;
    font-weight: 500;
    margin-top: 4px;
    letter-spacing: 0.2px;
}

.cc-card-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94A3B8;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.cc-card-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* Card Body */
.cc-card-body {
    flex: 1;
    min-height: 0;
    max-height: 420px;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #F8FAFC;
}

.cc-card-body::-webkit-scrollbar {
    width: 4px;
}
.cc-card-body::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

/* 双视图流畅滑移切换 */
.cc-view-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 6px;
    padding-bottom: 6px;
}

.cc-view {
    width: 100%;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.cc-view.is-hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* 列表切详情：列表向左滑移淡出，详情从右滑入 */
.cc-view.view-exit-left {
    position: absolute;
    top: 0; left: 0;
    transform: translateX(-25%);
    opacity: 0;
    pointer-events: none;
}

.cc-view.view-enter-right {
    position: relative;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* 返回列表：详情向右滑移淡出，列表从左滑入 */
.cc-view.view-exit-right {
    position: absolute;
    top: 0; left: 0;
    transform: translateX(25%);
    opacity: 0;
    pointer-events: none;
}

/* 列表视图结构 (Package List View) */
.cc-bank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 2px;
}

.cc-bank-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
    position: relative;
    z-index: 1;
}

.cc-bank-item:hover {
    background: #FFFFFF;
    border-color: #818CF8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.15);
    z-index: 2;
}

.cc-bank-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.cc-bank-title {
    flex: 1;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.3;
}

.cc-bank-arrow {
    font-size: 12px;
    color: #94A3B8;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.cc-bank-item:hover .cc-bank-arrow {
    color: #4F46E5;
    transform: translateX(3px);
}

.cc-bank-content-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.cc-bank-media-wrap {
    width: 62px;
    height: 62px;
    border-radius: 10px;
    overflow: hidden;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4F46E5;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.cc-bank-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cc-bank-hook-list {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cc-hook-line {
    font-size: 11.5px;
    color: #475569;
    font-weight: 500;
    line-height: 1.35;
    word-break: break-word;
}

/* 3. 详情页视图 (Package Detail View) */
.cc-detail-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.cc-detail-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #4F46E5;
    cursor: pointer;
    padding: 6px 12px;
    background: #FFFFFF;
    border: 1px solid #C7D2FE;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cc-detail-nav-back:hover {
    background: #EEF2FF;
    border-color: #A5B4FC;
}

.cc-detail-nav-apply {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #FFFFFF !important;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cc-detail-nav-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.cc-detail-card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #E2E8F0;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.cc-detail-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 12px;
}

.cc-detail-title {
    font-size: 16px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.3;
}

.cc-detail-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748B;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cc-detail-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.cc-feature-block {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.cc-feature-title {
    font-size: 13px;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #F1F5F9;
}

.cc-feature-title i {
    color: #4F46E5;
    font-size: 13px;
}

.cc-feature-desc {
    font-size: 12px;
    color: #475569;
    line-height: 1.65;
    white-space: pre-line;
    word-break: break-word;
}

.cc-card-footer {
    flex-shrink: 0;
    padding: 10px 16px;
    background: #F8FAFC;
    border-top: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11.5px;
    color: #64748B;
    font-weight: 500;
}

.cc-card-footer i {
    color: #10B981;
    font-size: 12px;
}

/* 5. 避免与回到顶部按钮 (.back-to-top) 叠压重合 */
.back-to-top {
    bottom: 92px !important;
    right: 28px !important;
    z-index: 9980 !important;
    transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s ease, opacity 0.3s ease !important;
}

body.cc-widget-closed .back-to-top {
    bottom: 30px !important;
}

/* 4. 移动端响应式规范 */
@media (max-width: 768px) {
    /* 移动端打开弹窗时，背景遮罩模糊效果 */
    .cc-float-widget::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
        z-index: -1;
        pointer-events: none;
        transition: background 0.3s ease, backdrop-filter 0.3s ease;
    }

    .cc-float-widget.popover-open::before {
        background: rgba(15, 23, 42, 0.35);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        pointer-events: auto;
    }

    .cc-float-widget {
        bottom: 20px;
        right: 14px;
    }

    .back-to-top {
        bottom: 80px !important;
        right: 14px !important;
    }

    body.cc-widget-closed .back-to-top {
        bottom: 20px !important;
        right: 20px !important;
    }

    .cc-float-btn {
        padding: 8px 14px 8px 10px;
    }

    .cc-float-desc {
        display: none;
    }

    .cc-popover-card {
        right: -6px;
        width: 320px;
        bottom: 58px;
    }
}
