﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
}

.video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.bg-video {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
}

/* 热点外层锚点 */
.hotspot-item {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    /* 扩大一点点热区，让鼠标更容易点到 */
    padding: 10px; 
    /* 将热点定位基准点移到中心，防止展开时往右单向平移 */
    transform: translate(-50%, -50%); 
}

/* 默认玻璃菱形 */
.hot-diamond {
    min-width: 26px;      /* 初始正方形的宽 */
    height: 26px;         /* 固定的高度 */
    max-width: 26px;      /* 初始限制最大宽度，使其保持正方形 */
    background: linear-gradient(135deg, rgba(50, 150, 220, 0.85), rgba(30, 100, 170, 0.75));
    transform: rotate(45deg);
    box-shadow:
        0 0 18px rgba(30, 130, 200, 0.85),
        0 0 30px rgba(20, 110, 180, 0.65),
        inset 0 0 8px rgba(255,255,255,0.3);
    border: 1px solid rgba(120, 190, 255, 0.8);
    border-radius: 3px;
    position: relative;
    
    /* 核心：内部用 flex 居中，并隐藏溢出的文字 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 

    /* 丝滑过渡：旋转、最大宽度、内边距、圆角 */
    transition: 
        transform 0.3s ease, 
        max-width 0.3s ease 0.1s, 
        padding 0.3s ease, 
        border-radius 0.3s ease;
}

/* 中心白色标记 */
.hot-diamond::after {
    content: "";
    position: absolute;
    width: 7px; height: 7px;
    background: #fff;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1px;
    box-shadow: 0 0 6px #fff;
    z-index: 1;
    /* 悬停时淡出，避免干扰文字阅读 */
    transition: opacity 0.2s ease;
}

/* 文字提示 */
.hot-tip {
    color: #ffffff;
    font-size: 16px;
    white-space: nowrap;
    opacity: 0;
    z-index: 2;
    /* 核心：取消 position: absolute 和坐标位移！ */
    /* 撑开容器的关键：给文字左右留出呼吸内边距 */
    padding: 0 12px; 
    /* 延迟显示：等盒子转正并拉伸得差不多了，文字再浮现 */
    transition: opacity 0.2s ease 0.3s;
    pointer-events: none;
    
    /* 关键：因为父级默认旋转了45度，为了让默认隐藏的文字不把盒子撑歪，
       我们在文字上反向旋转-45度，保持文字永远是水平正向的 */
    transform: rotate(-45deg);
    transition: opacity 0.2s ease 0.3s, transform 0.3s ease;
}

/* ========== 悬停效果：先旋转变矩形，再流式展开 ========== */

/* 1. 容器转正、解除最大宽度限制、增加左右 padding 空间 */
.hotspot-item:hover .hot-diamond {
    transform: rotate(0deg);      
    max-width: 300px;             /* 给一个足够大的上限，让内容物自动撑开 */
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(60, 160, 230, 0.9), rgba(35, 110, 180, 0.8));
    box-shadow:
        0 0 22px rgba(40, 140, 210, 0.95),
        inset 0 0 8px rgba(255,255,255,0.4);
}

/* 2. 悬停时，文字的旋转回归 0 度，并亮起 */
.hotspot-item:hover .hot-tip {
    opacity: 1;
    transform: rotate(0deg);
}

/* 3. 悬停时隐藏中心白点 */
.hotspot-item:hover .hot-diamond::after {
    opacity: 0;
}

/* ===================== 移动端热点&视频容器自适应 ===================== */
/* 平板 992px 以下 */
@media (max-width: 992px) {
  .video-container {
    height: 60vh !important;
    width: 100%;
  }
  /* 缩小热点菱形基础尺寸 */
  .hot-diamond {
    min-width: 22px;
    height: 22px;
    max-width: 22px;
  }
  /* 文字缩小 */
  .hot-tip {
    font-size: 14px;
    padding: 0 10px;
  }
  /* 悬停最大宽度收窄 */
  .hotspot-item:hover .hot-diamond {
    max-width: 220px;
  }
  /* 中心白点缩小 */
  .hot-diamond::after {
    width: 6px;
    height: 6px;
  }
}

/* 手机 768px 以下 */
@media (max-width: 768px) {
  .video-container {
    height: 60vh !important;
  }
  /* 扩大点击热区，适配触屏 */
  .hotspot-item {
    padding: 14px;
  }
  /* 菱形再缩小 */
  .hot-diamond {
    min-width: 20px;
    height: 20px;
    max-width: 20px;
  }
  .hot-tip {
    font-size: 13px;
    padding: 0 8px;
  }
  .hotspot-item:hover .hot-diamond {
    max-width: 180px;
  }
}

/* 小屏手机 576px 以下 */
@media (max-width: 576px) {
  .video-container {
    height: 45vh !important;
  }
  .hotspot-item {
    padding: 16px;
  }
  .hot-diamond {
    min-width: 18px;
    height: 18px;
    max-width: 18px;
  }
  .hot-tip {
    font-size: 12px;
  }
  .hotspot-item:hover .hot-diamond {
    max-width: 140px;
  }
  /* 弱化发光阴影，小屏避免刺眼 */
  .hot-diamond {
    box-shadow:
        0 0 12px rgba(30, 130, 200, 0.7),
        0 0 20px rgba(20, 110, 180, 0.5),
        inset 0 0 6px rgba(255,255,255,0.3);
  }
  .hotspot-item:hover .hot-diamond {
    box-shadow:
        0 0 16px rgba(40, 140, 210, 0.8),
        inset 0 0 6px rgba(255,255,255,0.4);
  }
}