/* ============================================================
 * 章鱼IP交互组件 Z2开场动画 + Z3浮标环形菜单 + Z4搜索
 * 独立组件: 无框架依赖, PC/H5 双端自适应
 * ============================================================ */

/* ---------- Z2 开场动画 ---------- */
.oct-intro {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background:
        radial-gradient(ellipse 90% 60% at 50% 30%, rgba(30, 58, 138, .55), transparent 70%),
        radial-gradient(ellipse 70% 50% at 70% 80%, rgba(8, 145, 178, .25), transparent 70%),
        linear-gradient(180deg, #020617 0%, #0a1128 55%, #020617 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .45s ease;
    -webkit-tap-highlight-color: transparent;
}
.oct-intro.oct-show { opacity: 1; }
.oct-intro.oct-fade-out { opacity: 0; }

.oct-intro canvas.oct-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 星云视频背景层(Seedance生成, 加载失败自动隐藏) */
.oct-intro video.oct-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.oct-intro video.oct-bg-video.oct-video-on { opacity: .92; }
/* 叙事视频模式: story.mp4含章鱼四幕动画作为主体层, PNG章鱼隐藏 */
.oct-intro.oct-video-mode video.oct-bg-video.oct-video-on { opacity: 1; }
.oct-intro.oct-video-mode .oct-hero { display: none; }

/* 触手->板块光束能量连线层 */
.oct-intro canvas.oct-beams {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

/* 舞台(章鱼+光点+标题) */
.oct-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 章鱼主体(花冠布局: 上移让出下方文字区) */
.oct-hero {
    position: relative;
    z-index: 3;
    width: min(46vmin, 340px);
    height: min(46vmin, 340px);
    margin-bottom: 8vh; /* flex居中下上移4vh -> 中心46% */
    opacity: 0;
    transform: scale(.06) translateY(-42vh);
    filter: blur(8px);
    will-change: transform, filter, opacity;
}
.oct-hero img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(56, 189, 248, .45)) drop-shadow(0 0 46px rgba(59, 130, 246, .30));
}
.oct-intro.oct-phase-approach .oct-hero {
    animation: octApproach 1.25s cubic-bezier(.16, .84, .28, 1) forwards;
}
@keyframes octApproach {
    0%   { opacity: 0; transform: scale(.06) translateY(-42vh); filter: blur(8px); }
    25%  { opacity: 1; }
    85%  { filter: blur(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
/* 到达后脉动(亮相阶段+板块阶段) */
.oct-intro.oct-phase-hero .oct-hero,
.oct-intro.oct-phase-plates .oct-hero { animation: octPulse 2.2s ease-in-out infinite; }
@keyframes octPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}
/* 收缩飞向右下 */
.oct-intro.oct-phase-shrink .oct-hero {
    animation: none;
    transition: transform .8s cubic-bezier(.55, -.15, .35, 1), opacity .8s ease;
}

/* 板块光点 chip */
.oct-chip {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(56, 189, 248, .5);
    border-radius: 999px;
    color: #e0f2fe;
    /* 2026-08-26 22px醒目版: 原15px, 八触角板块文字放大(备份: octopus.css.bak_chip22_20260826) */
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .5px;
    white-space: nowrap;
    /* 注: 不用 backdrop-filter(合成性能杀手), 实底深色已有同等可读性 */
    box-shadow: 0 0 16px rgba(56, 189, 248, .28), inset 0 0 10px rgba(56, 189, 248, .10);
    opacity: 0;
    transform: scale(.2);
    will-change: transform, opacity;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.oct-chip .oct-chip-icon { font-size: 26px; line-height: 1; }
.oct-chip.oct-lit {
    animation: octChipIn .42s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
@keyframes octChipIn {
    0%   { opacity: 0; transform: scale(.2); }
    70%  { opacity: 1; transform: scale(1.12); }
    100% { opacity: 1; transform: scale(1); }
}
/* 当前正在介绍的板块: 高亮加强 */
.oct-chip.oct-active {
    border-color: rgba(125, 211, 252, .95);
    background: rgba(30, 58, 138, .92);
    box-shadow: 0 0 26px rgba(56, 189, 248, .55), inset 0 0 14px rgba(125, 211, 252, .22);
    color: #ffffff;
}
/* 全景定格: 齐亮 */
.oct-chip.oct-all {
    border-color: rgba(125, 211, 252, .75);
    background: rgba(30, 58, 138, .8);
}
.oct-chip.oct-out {
    animation: octChipOut .3s ease forwards;
}
@keyframes octChipOut {
    to { opacity: 0; transform: scale(.2); }
}

/* 聚光介绍区(章鱼下方大字, 46%基准无遮挡) */
.oct-spotlight {
    position: absolute;
    left: 50%;
    top: calc(46% + min(27vmin, 205px) + 50px); /* +50px: 聚光介绍下移, 避免压到章鱼身体 */
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    width: 90%;
}
.oct-spot-name {
    font-size: clamp(24px, 4.6vmin, 38px);
    font-weight: 800;
    color: #f0f9ff;
    letter-spacing: 3px;
    text-shadow: 0 0 24px rgba(56, 189, 248, .55), 0 2px 8px rgba(2, 6, 23, .6);
}
.oct-spot-desc {
    margin-top: 9px;
    font-size: clamp(13px, 2.2vmin, 17px);
    color: #bae6fd;
    letter-spacing: 2px;
    text-shadow: 0 1px 6px rgba(2, 6, 23, .6);
}
.oct-spotlight.oct-in { animation: octSpotIn .28s ease forwards; }
@keyframes octSpotIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.oct-spotlight.oct-out { animation: octSpotOut .3s ease forwards; }
@keyframes octSpotOut {
    to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* 底部进度点 */
.oct-dots {
    position: absolute;
    bottom: 7vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 11px;
    z-index: 5;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.oct-intro.oct-phase-plates .oct-dots,
.oct-intro.oct-phase-panorama .oct-dots { opacity: 1; }
.oct-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(148, 163, 184, .35);
    transition: background .25s ease, box-shadow .25s ease, transform .25s ease;
}
.oct-dot.on {
    background: #38bdf8;
    box-shadow: 0 0 9px rgba(56, 189, 248, .85);
    transform: scale(1.25);
}

/* 章鱼应答: 点头 */
.oct-hero.oct-nod img { animation: octNod .34s ease; }
@keyframes octNod {
    35% { transform: translateY(6px) scale(.985); }
    100% { transform: none; }
}

/* 品牌标题 */
.oct-brand {
    position: absolute;
    left: 50%;
    top: calc(46% + min(27vmin, 205px) + 50px); /* +50px: 聚光介绍下移, 避免压到章鱼身体 */
    transform: translateX(-50%);
    z-index: 4;
    text-align: center;
    opacity: 0;
    color: #f0f9ff;
}
.oct-brand h1 {
    margin: 0;
    font-size: clamp(26px, 5.2vmin, 42px);
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(92deg, #7dd3fc 10%, #38bdf8 45%, #34d399 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.oct-brand p {
    margin: 6px 0 0;
    font-size: clamp(11px, 1.9vmin, 14px);
    letter-spacing: 6px;
    color: #94a3b8;
}
.oct-intro.oct-phase-hero .oct-brand { animation: octFadeUp .5s .1s ease forwards; }
.oct-intro.oct-phase-plates .oct-brand { animation: octBrandOut .3s ease forwards; }
.oct-intro.oct-phase-panorama .oct-brand { animation: octFadeUp .6s .1s ease forwards; }
@keyframes octFadeUp {
    from { opacity: 0; transform: translate(-50%, 14px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.oct-intro.oct-phase-shrink .oct-brand {
    animation: octBrandOut .35s ease forwards;
}
@keyframes octBrandOut { to { opacity: 0; } }

/* 跳过按钮 */
.oct-skip {
    position: absolute;
    right: 22px;
    bottom: 26px;
    z-index: 9;
    padding: 8px 18px;
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 999px;
    background: rgba(15, 23, 42, .55);
    color: #cbd5e1;
    font-size: 13px;
    letter-spacing: 2px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    animation: octFadeIn .5s .6s ease forwards;
    transition: color .2s, border-color .2s;
}
.oct-skip:hover { color: #7dd3fc; border-color: rgba(125, 211, 252, .7); }
@keyframes octFadeIn { to { opacity: 1; } }

/* 开启声音按钮(被静音回退时显示) */
.oct-sound-btn {
    position: absolute;
    right: 22px;
    bottom: 72px;
    z-index: 9;
    padding: 8px 16px;
    border: 1px solid rgba(125, 211, 252, .5);
    border-radius: 999px;
    background: rgba(15, 23, 42, .6);
    color: #bae6fd;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    opacity: 0;
    animation: octFadeIn .5s .8s ease forwards;
    transition: color .2s, border-color .2s;
}
.oct-sound-btn:hover { color: #7dd3fc; border-color: rgba(125, 211, 252, .9); }
.oct-sound-btn.oct-hide {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity .4s ease;
}

/* ---------- Z3 浮标 + 环形菜单 ---------- */
/* 浮标位置由 JS 控制(left/top), 支持全页拖动+边缘吸附+位置记忆 */
.oct-floater {
    position: fixed;
    z-index: 999989;
    width: 58px;
    height: 58px;
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: grab;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .25s ease;
}
.oct-floater:hover { transform: scale(1.1); }
.oct-floater.oct-dragging {
    cursor: grabbing;
    transform: scale(1.15);
    z-index: 999998;
}
.oct-floater img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(30, 58, 98, .18));
    animation: octBreath 2.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes octBreath {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.05); }
}
/* 光环 */
.oct-floater::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, .5);
    animation: octRing 2.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes octRing {
    0%, 100% { transform: scale(.96); opacity: .35; }
    50% { transform: scale(1.08); opacity: .8; }
}
.oct-floater.oct-pop { animation: octPopIn .55s cubic-bezier(.34, 1.56, .64, 1) backwards; }
@keyframes octPopIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* 菜单遮罩 */
.oct-menu-mask {
    position: fixed;
    inset: 0;
    z-index: 999988;
    background: radial-gradient(circle at var(--ox, 90%) var(--oy, 92%), rgba(15, 42, 90, .06), rgba(15, 42, 90, .22));
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}
.oct-menu-mask.oct-open { opacity: 1; pointer-events: auto; }

/* 环形菜单容器(位置由JS跟随浮标) */
.oct-ring {
    position: fixed;
    z-index: 999990;
    width: 58px;
    height: 58px;
    pointer-events: none; /* 容器不拦截浮标点击, 子项open时自行启用 */
}
.oct-ring .oct-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(160deg, #ffffff, #e3edf8);
    color: #16324a;
    border: 1px solid rgba(21, 50, 84, .12);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-shadow: 0 4px 14px rgba(30, 58, 98, .16), inset 0 0 8px rgba(56, 189, 248, .15);
    transform: translate(0, 0) scale(.2);
    opacity: 0;
    pointer-events: none;
    transition: transform .38s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease;
    -webkit-tap-highlight-color: transparent;
}
.oct-ring .oct-item .oct-item-icon { font-size: 20px; line-height: 1; }
.oct-ring .oct-item .oct-item-name {
    font-size: 9px;
    line-height: 1.2;
    color: #2563eb;
    letter-spacing: 1px;
    writing-mode: horizontal-tb;
}
.oct-ring .oct-item:hover { box-shadow: 0 4px 18px rgba(56, 189, 248, .45), inset 0 0 10px rgba(56, 189, 248, .2); }
.oct-ring.oct-open .oct-item {
    opacity: 1;
    pointer-events: auto;
    transform: translate(var(--tx), var(--ty)) scale(1);
}

/* 搜索条 (Z4, 位置由JS根据浮标位置计算) */
.oct-search {
    position: fixed;
    z-index: 999990;
    display: flex;
    align-items: center;
    width: 230px;
    padding: 8px 12px;
    border: 1px solid rgba(2, 132, 199, .45);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 6px 22px rgba(30, 58, 98, .18);
    opacity: 0;
    transform: translateY(10px) scale(.9);
    transform-origin: center bottom;
    pointer-events: none;
    transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
    will-change: left, top;
}
.oct-search.oct-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.oct-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #16324a;
    font-size: 13px;
}
.oct-search input::placeholder { color: #94a3b8; }
.oct-search .oct-search-btn {
    border: none;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    flex: none;
}
/* Z5 语音麦克风按钮 */
.oct-search .oct-mic-btn {
    margin-right: 6px;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    transition: background .25s ease;
}
.oct-search .oct-mic-btn.oct-listening {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: octMicPulse 1.1s ease-in-out infinite;
}
@keyframes octMicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
    50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
}

/* ---------- H5 适配 ---------- */
@media (max-width: 768px) {
    .oct-hero { width: min(52vmin, 260px); height: min(52vmin, 260px); }
    .oct-chip { font-size: 13px; padding: 6px 11px; gap: 6px; }
    .oct-chip .oct-chip-icon { font-size: 16px; }
    .oct-spot-name { letter-spacing: 2px; }
    .oct-spot-desc { letter-spacing: 1px; }
    .oct-dots { gap: 9px; bottom: 5vh; }
    .oct-skip { right: 14px; bottom: 18px; font-size: 12px; padding: 6px 14px; }
    .oct-floater, .oct-ring {
        width: 50px;
        height: 50px;
    }
    .oct-ring .oct-item { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
    .oct-ring .oct-item .oct-item-icon { font-size: 17px; }
    .oct-search { width: 190px; }
    .oct-sound-btn { right: 14px; bottom: 64px; font-size: 12px; padding: 7px 13px; }
}

/* 轻触进入引导(自动播放被拒时显示, 点击=手势必可播) */
.oct-tap-gate {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background:
        radial-gradient(ellipse 90% 60% at 50% 30%, rgba(30, 58, 138, .5), transparent 70%),
        rgba(2, 6, 23, .88);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: octFadeIn .4s ease both;
}
.oct-tap-gate .oct-tap-logo {
    width: min(34vmin, 190px);
    filter: drop-shadow(0 0 22px rgba(56, 189, 248, .4));
    animation: octBreath 2.6s ease-in-out infinite;
}
.oct-tap-gate .oct-tap-title {
    color: #f0f9ff;
    font-size: clamp(16px, 4.5vmin, 24px);
    font-weight: 800;
    letter-spacing: 5px;
    text-shadow: 0 0 18px rgba(56, 189, 248, .5);
}
.oct-tap-gate .oct-tap-hint {
    color: #7dd3fc;
    font-size: clamp(12px, 2.6vmin, 15px);
    letter-spacing: 8px;
    animation: octGatePulse 1.8s ease-in-out infinite;
}
@keyframes octGatePulse {
    0%, 100% { opacity: .45; letter-spacing: 8px; }
    50% { opacity: 1; letter-spacing: 11px; }
}
.oct-tap-gate.oct-gate-out {
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}

/* ---------- 二维码气泡挂件(全屏游动, PC端) ---------- */
/* 漂移层: 仅做 transform 位移(GPU合成, 不触发重排, 60fps流畅) */
.oct-qrwrap {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 999987;
    width: 172px;
    transition: transform 5s linear;
    pointer-events: none;
    will-change: transform;
}
/* 扫码登录成功提示 */
.oct-qr-toast {
    position: fixed;
    top: 16%;
    left: 50%;
    transform: translate(-50%, -14px);
    z-index: 999992;
    padding: 10px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: 0 8px 26px rgba(14, 165, 233, .42);
    opacity: 0;
    transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}
.oct-qr-toast.oct-in {
    opacity: 1;
    transform: translate(-50%, 0);
}
/* 鼠标悬浮时冻结漂移(方便扫码): 掐断过渡, 位置由JS写回当前渲染值 */
.oct-qrwrap.oct-hold { transition: none; }
/* 弹出/收起动画层 */
.oct-qr-lift {
    opacity: 0;
    transform: translateY(14px) scale(.86);
    transform-origin: center bottom;
    transition: opacity .38s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}
.oct-qr-lift.oct-show {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.oct-qr-bubble {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 14px 12px 12px;
    box-shadow: 0 12px 36px rgba(15, 42, 90, .28), 0 0 0 1px rgba(56, 189, 248, .14);
    animation: octQrBob 3.4s ease-in-out infinite .6s;
    cursor: default;
}
/* 顶部品牌渐变饰条 */
.oct-qr-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #22d3ee, #3b82f6, #22d3ee);
}
@keyframes octQrBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.oct-qr-title {
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;   /* 标题保持单行 */
}
.oct-qr-frame {
    position: relative;
    margin: 9px auto 0;
    width: 146px;
    padding: 6px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(59, 130, 246, .06);
}
.oct-qr-frame img {
    display: block;
    width: 132px;
    height: 132px;
    image-rendering: pixelated;
}
/* 二维码中心章鱼图形徽章(白底圆角居中, 遮挡~9%) */
.oct-qr-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    padding: 3px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, .25), 0 2px 6px rgba(15, 42, 90, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.oct-qr-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
}
.oct-qr-close {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 42, 90, .18);
    transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.oct-qr-close:hover {
    color: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg);
}

