/* 右侧边缘固定「AI 分析平台」入口（公共组件，由 js/ai-entry.js 注入 DOM）
   视觉语言对齐 aiIndex.html 玻璃质感；首页与内页共用同一份样式 */

/* 横向浮标：默认隐藏（下方 display:none），恢复时删掉该行即可 */
.ai-fixed-entry {
    display: none;
    /* 横向浮标暂时隐藏（当前只保留右侧竖签入口）；
       恢复时删掉本行 display:none 即可，其余样式与 JS 逻辑都保留着 */
    position: fixed;
    right: 15px;
    /* 右侧留出 15px 给 Chrome 经典滚动条，避免贴边被切 */
    bottom: 64px;
    z-index: 999;
    cursor: pointer;
}

/* 浮标：徽章 + 两行文字，背后一团飘渺的紫蓝光晕（无底色块、无描边） */
.ai-fixed-entry .ai-fixed-pet {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    /* 呼吸与 hover 放大都由徽章图形承担，文字始终保持固定大小 */
}

/* 呼吸：只让徽章图形轻微缩胀，文字保持静止清晰 */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* 光晕：径向渐变叠高斯模糊，缓慢呼吸
   中心用 0% 与 28% 两个同色标做平缓软核，避免出现一块亮心；
   外圈提前衰减 + 大模糊，让它看不出圆的边界，才是"弥散的光" */
.ai-fixed-entry .ai-fixed-pet::before {
    content: "";
    position: absolute;
    left: -32px;
    /* 徽章 62px、圆心在 31px 处；光晕 126px 半宽 63 → 31 - 63 = -32 */
    top: 50%;
    width: 126px;
    height: 126px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: radial-gradient(closest-side,
            rgba(139, 92, 246, 0.20) 0%,
            rgba(139, 92, 246, 0.15) 28%,
            rgba(79, 139, 255, 0.09) 56%,
            rgba(150, 222, 255, 0) 100%);
    filter: blur(20px);
    pointer-events: none;
    z-index: 0;
    animation: aiAura 4.5s ease-in-out infinite;
}

@keyframes aiAura {
    0%, 100% {
        opacity: 0.55;
        transform: translateY(-50%) scale(0.99);
    }
    50% {
        opacity: 0.78;
        transform: translateY(-50%) scale(1.04);
    }
}

.ai-fixed-entry .ai-fixed-pet img {
    position: relative;
    z-index: 1;
    display: block;
    flex: none;
    width: 62px;
    height: 62px;
    transform-origin: center;
    animation: badgePulse 4.5s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(99, 91, 255, 0.22));
    transition: filter 0.25s, scale 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* 中英双行层级：主行中文 + 副行大写宽字距英文 */
.ai-fixed-entry .ai-fixed-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.ai-fixed-entry .ai-fixed-txt {
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.2px;
    color: #6d4fe0;
    white-space: nowrap;
}

/* 发丝线：收束文字块 */
.ai-fixed-entry .ai-fixed-rule {
    display: block;
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, rgba(109, 79, 224, 0.55), rgba(109, 79, 224, 0));
}

.ai-fixed-entry .ai-fixed-en {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a86ad;
    white-space: nowrap;
    transition: color 0.25s;
}

/* hover：徽章放大 + 投影加强 + 英文行点亮（光晕由动画控制节奏）
   放大只作用于徽章 img，文字尺寸保持不变；scale 是独立属性，
   与 img 上的呼吸 transform 动画叠加而非互相覆盖（1.10 × 1.05 ≈ 1.16） */
.ai-fixed-entry:hover .ai-fixed-pet img {
    scale: 1.10;
}

.ai-fixed-entry:hover .ai-fixed-pet img {
    filter: drop-shadow(0 12px 26px rgba(99, 91, 255, 0.3));
}

.ai-fixed-entry:hover .ai-fixed-en {
    color: #6d4fe0;
}

.ai-fixed-entry:hover .ai-fixed-rule {
    background: linear-gradient(90deg, rgba(109, 79, 224, 0.85), rgba(109, 79, 224, 0));
}

/* 引导气泡：从竖签左侧滑出，带右向尖角 */
.ai-fixed-entry .ai-fixed-tip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translate(6px, -50%);
    padding: 6px 12px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(90, 80, 180, 0.26);
    color: #4b4778;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s;
}

.ai-fixed-entry .ai-fixed-tip::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    margin-top: -4px;
    border: 4px solid transparent;
    border-left-color: #fff;
}

/* ===== 侧边竖签版 AI 入口（贴右边缘，位于横排浮标上方；图标用 ai-entry.png） ===== */
.ai-vert-entry {
    position: fixed;
    right: 0;
    /* 贴死右边界：`right` 相对的是「不含滚动条的可视区宽度」，
       所以 0 正好停在滚动条左侧，不会被滚动条压住 */
    bottom: 180px;
    /* 与横排浮标的 bottom:64px 错开：竖签在上、浮标在下，两者不重叠 */
    z-index: 999;
    cursor: pointer;
}

.ai-vert-entry .ai-vert-pet {
    display: flex;
    flex-direction: column;
    /* 纵向 flex 排列，子项各管各的朝向，不再用 writing-mode 管整块 */
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background-color: #ece7fa;
    border: 1px solid rgba(109, 79, 224, 0.20);
    border-right: none;
    /* 贴右边缘：只在左侧留圆角 */
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.25s;
}

/* 图标呼吸：与横排浮标同节奏；文字不参与缩放 */
.ai-vert-entry .ai-vert-pet img {
    display: block;
    flex: none;
    width: 44px;
    height: 44px;
    transform-origin: center;
    animation: badgePulse 4.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 10px rgba(99, 91, 255, 0.18));
    transition: scale 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* 「AI」显式横排一行（vertical-rl 会被子元素继承，不显式改回就会变成 A、I 换行）；
   line-height: 1 是必须的，否则横排文字按 1.5 倍行高占位，把中文推远、签变高 */
.ai-vert-entry .ai-vert-latin {
    writing-mode: horizontal-tb;
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1px;
    color: #6d4fe0;
    transition: color 0.25s;
}

/* 中文竖排：与「AI」同一支紫色，整条字色统一 */
.ai-vert-entry .ai-vert-cn {
    writing-mode: vertical-rl;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    color: #6d4fe0;
    transition: color 0.25s;
}

.ai-vert-entry:hover .ai-vert-pet {
    box-shadow: -4px 2px 14px rgba(109, 79, 224, 0.16);
}

.ai-vert-entry:hover .ai-vert-pet img {
    scale: 1.10;
}

/* 常态已是紫色，hover 再压深一档保持反馈 */
.ai-vert-entry:hover .ai-vert-cn {
    color: #5535cf;
}

@media (prefers-reduced-motion: reduce) {
    .ai-fixed-entry .ai-fixed-pet,
    .ai-fixed-entry .ai-fixed-pet img,
    .ai-fixed-entry .ai-fixed-pet::before,
    .ai-fixed-entry.guiding .ai-fixed-pet::after,
    .ai-vert-entry .ai-vert-pet img,
    .ai-vert-entry.guiding .ai-vert-pet {
        animation: none;
    }
}

/* 关闭广告后，高亮并提示右侧 AI 入口 */
.ai-fixed-entry.guiding .ai-fixed-tip {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
    color: #6d4fe0;
    border-color: rgba(124, 92, 246, 0.45);
}

/* 引导光环：圆形扩散套在徽章外 */
.ai-fixed-entry.guiding .ai-fixed-pet::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 62px;
    height: 62px;
    transform: translateY(-50%);
    border-radius: 50%;
    animation: aiGuideRing 1.5s ease-out infinite;
}

@keyframes aiGuideRing {
    0% {
        box-shadow: 0 0 0 0 rgba(109, 79, 224, 0.35);
    }
    100% {
        box-shadow: 0 0 0 18px rgba(109, 79, 224, 0);
    }
}

/* ===== 引导气泡与光环：挂在竖签入口上（横向浮标隐藏期间的引导目标） ===== */
.ai-vert-entry .ai-vert-tip {
    position: absolute;
    /* 竖签贴右边缘，气泡从其左侧滑出，尖角指向右侧 */
    right: calc(100% + 12px);
    top: 50%;
    transform: translate(6px, -50%);
    padding: 6px 12px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(90, 80, 180, 0.26);
    color: #4b4778;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s;
}

.ai-vert-entry .ai-vert-tip::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    margin-top: -4px;
    border: 4px solid transparent;
    border-left-color: #fff;
}

.ai-vert-entry.guiding .ai-vert-tip {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
    color: #6d4fe0;
    border-color: rgba(124, 92, 246, 0.45);
}

/* 引导光环：沿竖签轮廓向外扩散（box-shadow 动画跟随 border-radius） */
.ai-vert-entry.guiding .ai-vert-pet {
    animation: aiGuideRing 1.5s ease-out infinite;
}
