@keyframes holographic {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
  }

  @keyframes particleFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-20px) translateX(10px); }
  }

  body {
    display: flex;
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 50%, #80deea 100%);
    padding: 0;
    color: #006064;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    position: relative;
  }

  /* 侧边导航栏 - 重新设计 */
  .sidebar {
    width: 388px;
    background: linear-gradient(145deg, #00796b, #006064);
    color: white;
    padding: 20px 0;
    height: 100vh;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.15);
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
  }

  .sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 20px;
    text-align: center;
  }

  .sidebar-title {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    animation: float 3s infinite ease-in-out;
    background: linear-gradient(90deg, #ffffff, #b2ebf2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 10px 0;
  }

  .sidebar-logo {
    max-width: 80%; /* 控制图片宽度不超过父容器的80% */
    height: auto; /* 保持图片原始比例 */
    display: block; /* 使图片居中 */
    margin: 0 auto; /* 使图片居中 */
    padding: 10px 0; /* 添加一些上下内边距 */
    /* 如果需要可以添加其他效果 */
    transition: all 0.3s ease;
  }

  .sidebar-logo:hover {
    transform: scale(1.05); /* 鼠标悬停时轻微放大 */
    opacity: 0.9; /* 鼠标悬停时轻微透明 */
  }

  .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 30px;
  }

  .nav-btn {
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
  }

  .nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
  }

  .nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(8px);
  }

  .nav-btn:hover::before {
    left: 100%;
  }

  .nav-btn i {
    margin-right: 12px;
    font-size: 18px;
    min-width: 24px;
    text-align: center;
  }

.control-section {
  background: rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0 auto 20px; /* 修改这里 - 上下0 左右auto */
  width: calc(90% - 20px);
  transition: all 0.3s;
  backdrop-filter: blur(5px);
  display: flex;       /* 新增 */
  flex-direction: column; /* 新增 */
  align-items: center; /* 新增 */
}

  .control-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
  }

  /* 科技感背景元素 */
  .tech-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    overflow: hidden;
  }

  .tech-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 188, 212, 0.3);
    animation: float 6s infinite ease-in-out;
  }

  .tech-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 188, 212, 0.5), transparent);
    animation: holographic 15s infinite linear;
  }

  /* 主内容区 */
  .main-container {
    margin-left: 280px;
    margin-right: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-width: 500px;
  }

  /* 知识面板 - 放在右侧 */
  .knowledge-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(145deg, #00796b, #006064);
    color: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 90;
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
  }

  .visualization-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
  }

  canvas {
    border: 2px solid #00bcd4;
    background: #e0f7fa;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 151, 167, 0.2);
    width: 100%;
    height: 540px;
  }

  .visualization-frame {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 15px;
    border: 2px dashed rgba(0, 188, 212, 0.5);
    display: flex;
    flex-direction: column;
    margin-top: 30px; /* 向下移动30像素 */
    height: 550px; /* 增加高度（原为500px） */
  }

  h2 {
    color: #00838f;
    text-shadow: 2px 2px 4px rgba(0, 150, 136, 0.2);
    font-size: 32px;
    margin: 10px 0 5px;
    background: linear-gradient(90deg, #00838f, #00bcd4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
    animation: float 3s infinite ease-in-out;
  }

  .subtitle {
    color: #00838f;
    margin: 5px 0 20px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px dashed rgba(0, 188, 212, 0.5);
    text-align: center;
    font-style: italic;
  }

  label {
    font-size: 16px;
    color: white;
    display: flex;
    align-items: center;
    margin: 12px 0;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.1);
  }

  label:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  input[type="range"] {
    width: 160px;
    margin-left: 15px;
    accent-color: #00bcd4;
    height: 8px;
    border-radius: 5px;
    cursor: pointer;
    background: rgba(255,255,255,0.3);
  }

  .value-display {
    display: inline-block;
    width: 40px;
    text-align: center;
    background: rgba(178, 235, 242, 0.5);
    padding: 5px 10px;
    border-radius: 15px;
    margin-left: 10px;
    font-weight: bold;
    color: #00838f;
    border: 2px solid #4dd0e1;
    font-size: 14px;
    transition: all 0.2s;
  }

  .visualization-toggle {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
  }

  .toggle-btn {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 80px;
    backdrop-filter: blur(5px);
  }

  .toggle-btn.active {
    background: #00bcd4;
    box-shadow: 0 0 12px rgba(0, 188, 212, 0.4);
  }

  .toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.3);
  }

  .logo {
    font-size: 14px;
    color: #00838f;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    border: 2px dashed rgba(0, 188, 212, 0.5);
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: auto;
    max-width: 90%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .panel-title {
    font-size: 20px;
    color: #00bcd4;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    padding-bottom: 8px;
    border-bottom: 2px dashed rgba(0, 188, 212, 0.3);
  }

  /* 知识内容样式 - 右侧面板 */
  .knowledge-content {
    font-size: 14px;
    line-height: 1.6;
    color: white;
  }

  .knowledge-item {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border-left: 3px solid #00bcd4;
    transition: all 0.3s;
  }

  .knowledge-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
  }

  .knowledge-item h3 {
    color: #fff;
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
  }

  .knowledge-item h3 i {
    margin-right: 8px;
    font-size: 18px;
  }

  .knowledge-item p {
    margin: 8px 0;
    font-size: 13px;
  }

  /* AI助手按钮样式 */
  .ai-assistant-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    background: none;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 179, 255, 0.3);
    border-radius: 50%;
    overflow: hidden;
    padding: 0;
  }

  .ai-btn-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
  }

  .ai-assistant-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 179, 255, 0.4);
  }

  .ai-assistant-btn:hover .ai-btn-image {
    transform: scale(1.05);
  }

  /* AI对话框样式 */
  .ai-dialog {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-height: 500px;
    background: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 204, 0.1);
  }

  .ai-dialog.show {
    display: flex;
    animation: fadeInUp 0.3s ease-out;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .ai-dialog-header {
    background: linear-gradient(to right, rgba(0, 255, 204, 0.1), rgba(0, 179, 255, 0.1));
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(136, 146, 176, 0.1);
  }

  .ai-dialog-title {
    font-weight: bold;
    font-size: 16px;
    color: #00ffcc;
  }

  .ai-dialog-close {
    background: none;
    border: none;
    color: #8892b0;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
  }

  .ai-dialog-close:hover {
    color: #00ffcc;
  }

  .ai-dialog-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .ai-dialog-body::-webkit-scrollbar {
    width: 6px;
  }

  .ai-dialog-body::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.5);
  }

  .ai-dialog-body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 204, 0.3);
    border-radius: 3px;
  }

  .ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageAppear 0.3s ease-out;
  }

  @keyframes messageAppear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .ai-message.user {
    align-self: flex-end;
    background: linear-gradient(to right, #00b3ff, #0062ff);
    color: white;
    border-bottom-right-radius: 5px;
  }

  .ai-message.bot {
    align-self: flex-start;
    background-color: #112240;
    color: white;
    border-bottom-left-radius: 5px;
    position: relative;
  }

  .ai-message.bot::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-right: 8px solid #112240;
    border-bottom: 8px solid transparent;
  }

  .ai-message.user::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-left: 8px solid #00b3ff;
    border-bottom: 8px solid transparent;
  }

  .ai-dialog-input {
    display: flex;
    padding: 12px;
    border-top: 1px solid rgba(136, 146, 176, 0.1);
    background-color: rgba(17, 34, 64, 0.5);
  }

  .ai-dialog-input input {
    flex: 1;
    padding: 10px 15px;
    background-color: #112240;
    border: 1px solid rgba(136, 146, 176, 0.3);
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    color: white;
  }

  .ai-dialog-input input:focus {
    border-color: #00ffcc;
    box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.2);
  }

  .ai-dialog-input button {
    margin-left: 10px;
    padding: 10px 20px;
    background: linear-gradient(to right, #00ffcc, #00b3ff);
    color: #0a192f;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.3s;
  }

  .ai-dialog-input button:hover {
    opacity: 0.9;
  }

  .ai-dialog-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .typing-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #00ffcc;
    margin-right: 4px;
    animation: typingAnimation 1.4s infinite ease-in-out;
  }

  @keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
  }

  .typing-container {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #112240;
    border-radius: 15px;
    color: #8892b0;
    font-size: 14px;
    max-width: 85%;
    align-self: flex-start;
    position: relative;
  }

  .typing-container::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-right: 8px solid #112240;
    border-bottom: 8px solid transparent;
  }

  @media (max-width: 1200px) {
    .main-container {
      margin-right: 280px;
    }
  }

  @media (max-width: 900px) {
    .sidebar {
      width: 100%;
      height: auto;
      position: relative;
      padding: 15px;
      border-radius: 0;
    }

    .knowledge-panel {
      position: relative;
      width: 100%;
      height: auto;
      margin-top: 20px;
      border-radius: 0;
    }

    .main-container {
      margin-left: 0;
      margin-right: 0;
      width: 100%;
    }

    .visualization-panel {
      min-height: 500px;
    }

    .ai-dialog {
      width: 90%;
      right: 5%;
      bottom: 80px;
    }
  }

/* 调整 AI 输入区域布局 */
.ai-dialog-input {
  display: flex;
  align-items: center; /* 垂直居中 */
  padding: 10px 12px; /* 调整内边距 */
  border-top: 1px solid rgba(136, 146, 176, 0.1);
  background-color: rgba(17, 34, 64, 0.5);
  gap: 8px; /* 元素之间的间隙 */
}
  
  /* 调整录音按钮大小和样式 */
#recordBtn {
  background: none;
  border: 1px solid rgba(136, 146, 176, 0.3);
  color: #8892b0;
  font-size: 18px; /* 调整图标大小 */
  cursor: pointer;
  padding: 0; /* 移除内边距 */
  border-radius: 50%;
  transition: all 0.3s;
  width: 38px;  /* 调整宽度 */
  height: 38px; /* 调整高度 */
  flex-shrink: 0; /* 防止按钮被压缩 */
  display: flex;
  align-items: center;
  justify-content: center;
}
#recordBtn:hover {
  background-color: #112240;
  color: #00ffcc;
  border-color: #00ffcc;
}
#recordBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
  
/* 调整输入框 */
.ai-dialog-input input {
  flex: 1; /* 占据剩余空间 */
  padding: 10px 15px;
  background-color: #112240;
  border: 1px solid rgba(136, 146, 176, 0.3);
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  color: white;
}
.ai-dialog-input input:focus {
  border-color: #00ffcc;
  box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.2);
}
  
/* 调整发送按钮 */
.ai-dialog-input button#aiSendBtn { /* 使用更精确的选择器 */
  margin-left: 0; /* 移除左边距，使用 gap 控制间距 */
  padding: 10px 18px; /* 微调内边距 */
  background: linear-gradient(to right, #00ffcc, #00b3ff);
  color: #0a192f;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: opacity 0.3s;
  flex-shrink: 0; /* 防止按钮被压缩 */
}
.ai-dialog-input button#aiSendBtn:hover {
  opacity: 0.9;
}
.ai-dialog-input button#aiSendBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
  
/* 状态显示文本 */
#recordingStatus {
  font-size: 12px;
  color: #8892b0;
  /* margin-left: 5px; */ /* 使用 gap 控制间距 */
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 60px; /* 给点最小宽度防止布局跳动 */
  text-align: left;
}

/* 在assets/styles/kepu.css中添加 */
.feature-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 15px 0;
  background: linear-gradient(45deg, #2196f3, #00bcd4);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.feature-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0,0,0,0.15);
  background: linear-gradient(45deg, #00bcd4, #2196f3);
}

.feature-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}