/* 通用样式 */
body {
    margin: 0;
    min-height: 100vh;
    background-color: #f0f0f0; /* 备用颜色 */
    position: relative; /* 为伪元素提供定位上下文 */
}

/* 手机端（屏幕宽度 < 768px） */
@media only screen and (max-width: 767px) {
    body::before {
        content: '';
        position: fixed; /* 固定背景 */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('/static/bg_mobile.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.3; /* 设置透明度，0.0（完全透明）到 1.0（不透明） */
        z-index: -1; /* 确保背景在内容后面 */
    }
}

/* 平板端（屏幕宽度 768px - 1024px） */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('/static/bg_tablet.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.3; /* 设置透明度 */
        z-index: -1;
    }
}

/* 电脑端（屏幕宽度 > 1024px） */
@media only screen and (min-width: 1025px) {
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('/static/bg_tablet.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.3; /* 设置透明度 */
        z-index: -1;
    }
}
/* 全局表格样式 */
.table {
    width: 100%;
    margin-bottom: 20px;
    font-size: 14px;
}

/* 表头和单元格 */
th, td {
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

/* 相位表格（三角形） */
.aspect-grid {
    max-width: 600px;
    margin: 0 auto;
}

.aspect-grid th, .aspect-grid td {
    min-width: 40px;
    height: 40px;
    font-size: 16px;
}

/* 相位颜色 */
.aspect-conjunction {
    background-color: #ffff99 !important; /* 黄色 - 合相 */
}
.aspect-sextile {
    background-color: #99ccff !important; /* 蓝色 - 六分相 */
}
.aspect-square {
    background-color: #ff9999 !important; /* 红色 - 四分相 */
}
.aspect-trine {
    background-color: #99ff99 !important; /* 绿色 - 三分相 */
}
.aspect-opposition {
    background-color: #cc99ff !important; /* 紫色 - 冲相 */
}

.aspect-grid td:empty {
    background-color: #f8f9fa; /* 空单元格浅灰色 */
}


/* 响应式调整 */
@media (max-width: 768px) {
    .table {
        font-size: 12px;
    }
    .aspect-grid th, .aspect-grid td {
        min-width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* 容器样式 */
.container {
    max-width: 1200px;
}

/* 标题 */
h3, h4 {
    margin-top: 20px;
    margin-bottom: 10px;
}

/* 覆盖 style.css 的潜在冲突 */
#aspectGrid th, #aspectGrid td {
    padding: 5px;
    text-align: center;
}
.conjunction { background-color: #ffff99; }
.opposition { background-color: #ff9999; }
.trine { background-color: #99ff99; }
.square { background-color: #ffcc99; }
.sextile { background-color: #ccffcc; }

.radar-container {
    max-width: 500px;        /* 容器最大宽度限制 */
    margin: 20px auto;       /* 上下边距20px，左右自动居中 */
    min-height: 400px;       /* 最小高度保障布局空间 */
    position: relative;      /* 创建相对定位上下文 */
    border: 1px solid #ddd;  /* 调试用临时边框（正式使用建议删除） */
}

.canvas {
    display: block !important;          /* 强制转为块级元素显示 */
    width: 100% !important;             /* 宽度撑满父容器 */
    height: 400px !important;           /* 固定高度设置 */
    max-width: 500px;                   /* 最大宽度限制 */
    max-height: 400px;                  /* 最大高度限制 */

}
.label-container{

}



.trait-label {

    margin: 5px;         /* 标签外间距：四周各5px的留白 */
    font-size: 14px;     /* 文字大小：标准正文尺寸（约10.5pt） */
    color: #333333;      /* 文字颜色：深灰色（非纯黑更柔和） */
    padding: 6px 12px;   /* 内边距：上下6px/左右12px的呼吸空间 */
    display: inline-bloc; /* 确保标签按顺序排列 */
    vertical-align:middle;
}
.sp-bg-color {
      transform: scale(0.95);  /* 等比例缩小5% */
      transform-origin: center;
      position: relative;
      font-weight: bold;
      color: white;     /* 文字颜色 */
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
      transition: 0.3s;
      /* 柔和的渐变背景 */
      background:
      linear-gradient(
        45deg,
        #a8edea 0%,
        #fed6e3 25%,
        #c3a9f6 50%,
        #89d4cf 75%,
        #a8edea 100%
      );
      background-size: 300% 300%;
      animation: gradientFlow 3s ease infinite; /* 总循环时间（当前12秒） */
      /* 精致边框 */
      border: 3px solid rgba(255,255,255,0.3);
      border-image: linear-gradient(45deg, #a8edea, #fed6e3) 1;
      animation:
      gradientFlow 3s ease infinite,
      borderFlash 0.5s ease infinite;
      /* 新增边框闪烁动画 */
      @keyframes borderFlash {
     0% { border-color: #a8edea; }
     50% { border-color: #fed6e3; }
     100% { border-color: #a8edea; }
     }
}
    /* 简化光晕效果 */
    .sp-bg-color::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      right: -50%;
      bottom: -50%;
      background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255,255,255,0.2) 50%,
        transparent 60%
      );
      animation: rotate 2s linear infinite; /* 光晕旋转速度（当前8秒） */
      opacity: 0.6;
    }
    @keyframes gradientFlow {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }
    @keyframes rotate {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    /* 清新的悬停效果 */
    .sp-bg-color:hover {
      box-shadow: 0 4px 20px rgba(168,237,234,0.3);
       transform: scale(1.05);
    }
    /* 文字强化 */
    .sp-bg-color span {
      position: absolute;
      z-index: 2;
      text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.sp-bg-gold{
  transform: scale(0.95);  /* 等比例缩小5% */
  position: relative;
  font-weight: bold;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.3s;

  /* 鎏金渐变背景 */
  background: linear-gradient(
    135deg,
    #ffd700 0%,
    #ffec8b 25%,
    #ffd700 50%,
    #fff3a0 75%,
    #ffd700 100%
  );
  background-size: 300% 300%;
  animation: gradientFlow 3s ease infinite;

  /* 金边效果 */
  border: 3px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* 强化光晕效果 */
.sp-bg-gold::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255,255,255,0.6) 50%,
    transparent 60%
  );
  animation: rotate 2s linear infinite;
  mix-blend-mode: overlay;
  opacity: 0.8;
}

/* 新增金沙特效 */
.sp-bg-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
      radial-gradient(circle at 20% 30%,
      rgba(255,255,255,0.3) 0%,
      transparent 15%),
    radial-gradient(circle at 80% 70%,
      rgba(255,255,255,0.3) 0%,
      transparent 15%);
  animation: sparkle 2s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 强化悬停效果 */
.sp-bg-gold:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

/* 金字特效 */
.sp-bg-gold span {
  position: absolute;
  z-index: 2;
  background: linear-gradient(45deg, #fff3b0, #ffd700);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 8px rgba(255, 215, 0, 0.5),
    0 2px 4px rgba(0,0,0,0.2);
}
.sp-bg-dark{
    transform: scale(0.9);  /* 等比例缩小5% */
    background: linear-gradient(145deg, #151515, #272727);
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid #4a4a4a;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8), inset 0 0 5px rgba(255, 0, 0, 0.2);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    animation: flicker 2s infinite alternate;
    transition: all 0.3s ease;
}
.sp-bg-dark:hover {
    background: linear-gradient(145deg, #272727, #151515);
    color: #ff3333;
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
    transform: scale(1.05);
    }
.sp-bg-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.3), transparent);
    animation: glitch 2.5s infinite;
    }
@keyframes flicker {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; } }

@keyframes glitch {
    0% { left: -100%; }
    100% { left: 100%; } }

@keyframes text-flicker {
    0% { text-shadow: 0 0 5px rgba(255, 0, 0, 0.6); }
    50% { text-shadow: 0 0 7px rgba(255, 0, 0, 0.8); }
    100% { text-shadow: 0 0 5px rgba(255, 0, 0, 0.6); } }



.bg-red { background-color: #ff9999; }
.bg-orange { background-color: #ffd699; }
.bg-yellow { background-color: #ffff99; }
.bg-green { background-color: #99cc99; }
.bg-blue { background-color: #9999ff; }
.bg-purple { background-color: #cc99ff; }

   .radar-label-container {
    display: flex;
    align-items: center;    /* 垂直居中 */
    flex-wrap: wrap;        /* 允许换行 */
    }
    /* ... 现有样式 ... */
    .radar-labels {
        margin-top: 10px;
        text-align: center;
        align-items:center;
        justify-content:center;

    }
    .radar-label {
        display: inline-block;
        align-items:center;
        justify-content:center;
        margin: 5px;
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 4px;
    }
    .radar-label-positive-social {
        border: 1px solid rgba(255, 182, 193, 1);
        background-color: rgba(255, 182, 193, 0.5);
    }
    .radar-label-negative-social {
        border: 1px solid rgba(173, 216, 230, 1);
        background-color: rgba(173, 216, 230, 0.5);
    }
    .radar-label-positive-cognitive {
        border: 1px solid rgba(173, 216, 230, 1);
        background-color: rgba(173, 216, 230, 0.5);
    }
    .radar-label-negative-cognitive {
        border: 1px solid rgba(255, 182, 193, 1);
        background-color: rgba(255, 182, 193, 0.5);
    }

       /* 保留原网页样式 */
        body {
            margin: 0;
            padding: 0;

            /* 允许滚动 */
        }


                 /* Live2D 画布样式 */
        #live2d-container {
            position: fixed;
            bottom: 0;
            right: 0;
            width: 100%;
            height: 100%;
            z-index: 1000; /* 确保在顶层 */
            pointer-events: none;
            touch-action:none;
        }
        #live2d-canvas {
            display: block;
            width: 100%  ;
            height: 100%  ;
            pointer-events: none;
            touch-action:none;
        }

#live2d-bubble {
    position: fixed;
    background: rgba(240, 245, 255, 0.92); /* 超浅白粉蓝背景 */
    border: 3px solid #d4eaff; /* 极浅粉蓝边框 */
    border-radius: 16px; /* 更圆润的边角 */
    padding: 8px 14px; /* 稍大内边距，显得更轻盈 */
    font-size: 14px;
    color: #3b5e80; /* 柔和蓝灰色文字 */
    pointer-events: none;
    transform: translateX(-70%);
    z-index: 1001;
    min-width: 60px;
    text-align: center;
    display: none; /* 初始隐藏 */
    animation: breathe 2s ease-in-out infinite; /* 呼吸动画，稍慢更优雅 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 轻微阴影，增加立体感 */
}
/* 呼吸效果关键帧 */
@keyframes breathe {
    0% {
        transform: translateX(-70%) scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-70%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateX(-70%) scale(0.8);
        opacity: 0.8;
    }
}


    /* 聊天按钮 */
    #chat-button {
        position: fixed;
        bottom: 20px;
        left: 20px;
        padding: 10px 20px;
        background: #ff6b81; /* 粉色主题 */
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
        z-index: 401;
        transition: background 0.3s;
    }
    #chat-button:hover {
        background: #ff4757; /* 深粉色 */
    }

    /* 聊天框容器 */
    #chat-container {
        display: none;
        position: fixed;
        bottom: 70px;
        left: 20px;
        width: 300px;
        background: #ffe6e6; /* 浅粉色背景 */
        border: 1px solid #ff9999;
        padding: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        border-radius: 10px;
        z-index: 100;
    }


    /* 聊天消息区域 */
    #chat-box {
        height: 300px;
        overflow-y: auto;
        border: 1px solid #ff9999;
        padding: 10px;
        background: #fff0f5; /* 更浅的粉色 */
        border-radius: 5px;
        margin-bottom: 10px;
    }
    .message {
        margin: 5px 0;
        font-size: 14px;
        color: #333;
    }

    /* 输入框 */
    #user-input {
        width: 100%;
        min-height: 1.5em; /* 1行高度 */
        max-height: 6em; /* 4行高度 */
        padding: 8px;
        margin-top: 10px;
        box-sizing: border-box;
        border: 1px solid #ff9999;
        border-radius: 5px;
        background: #fff;
        resize: none; /* 禁用手动调整大小 */
        overflow-y: auto; /* 超过4行滚动 */
        font-size: 14px;
        line-height: 1.5em;
    }
    #user-input:focus {
        outline: none;
        border-color: #ff6b81;
        box-shadow: 0 0 5px rgba(255, 107, 129, 0.3);
    }

    /* 发送按钮 */
    #send-button {
        width: 100%;
        padding: 8px;
        margin-top: 5px;
        background: #ff6b81;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 14px;
        transition: background 0.3s;
    }
    #send-button:hover {
        background: #ff4757;
    }

    /* 自定义滚动条（可选） */
    #chat-box::-webkit-scrollbar,
    #user-input::-webkit-scrollbar {
        width: 6px;
    }
    #chat-box::-webkit-scrollbar-thumb,
    #user-input::-webkit-scrollbar-thumb {
        background: #ff9999;
        border-radius: 3px;
    }


/* Basic body and layout */
.music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #8cc8ff; /* 蓝色边 */
  background-color: rgba(140, 200, 255, 0.15);  /* 浅蓝透明 */
  color: #4a90e2;
  cursor: pointer;
  z-index: 400;
  outline: none;
  padding: 0;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, border 0.3s, transform 0.5s;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.music-btn.playing {
  background-color: rgba(136, 209, 138, 0.15);  /* 浅绿透明 */
  border-color: #88d18a;
  color: #5cb85c;
}

.music-btn .note {
   font-size: 36px;
}

.music-btn.playing .note {
  animation: spin 2s linear infinite;
}

.music-btn .slash {
  content: "";
  position: absolute;
  width: 2px;
  height: 48px;
  background: #8cc8ff;
  transform: rotate(45deg);
  display: block;
  opacity: 1;
  transition: opacity 0.3s;
}

.music-btn.playing .slash {
  opacity: 0;
}

@keyframes spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}