:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light;
  color: #000000;
  background-color: #ffffff;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #00bfff;
  text-decoration: inherit;
}

a:hover {
  color: #1e90ff;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100vh;
  height: 100vh;
  background-color: #ffffff !important;
  color: #000000;
  overflow: hidden;
}

html {
  background-color: #ffffff !important;
}

.container {
  background-color: #ffffff !important;
  color: #000000;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

#app {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: #ffffff;
  color: #000000;
  overflow: hidden;
}

/* 用户头部样式 */
#user-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  margin-top: 16px;
  margin-bottom: 32px;
}

#user-box {
  display: flex;
  align-items: center;
  background-color: rgba(50, 50, 50, 0.5);
  border-radius: 20px;
  padding: 4px 16px;
  cursor: pointer;
  position: relative;
}

#user-box:hover {
  background-color: rgba(60, 60, 60, 0.6);
}

/* 下拉菜单样式 */
#voice-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  background-color: rgba(40, 40, 40, 0.95);
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  z-index: 150;
  margin-top: 8px;
  overflow: hidden;
}

#voice-dropdown.show {
  display: block;
  animation: fadeIn 0.2s;
}

/* 选中状态的样式 */
.voice-option.selected {
  background-color: rgba(0, 191, 255, 0.2);
}

.voice-option {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.voice-option:hover {
  background-color: rgba(60, 60, 60, 0.8);
}

.voice-icon {
  margin-right: 10px;
  color: #00bfff;
  font-size: 18px;
}

.voice-name {
  color: #000000;
  font-weight: 500;
}

#user-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #4caf50;
  margin-right: 8px;
}

.user-name {
  color: #000000;
  font-weight: 500;
  margin-right: 4px;
}

@keyframes voiceWave {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}


@keyframes particleFloat {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 0;
  }
  10% {
    opacity: 0.1;
    transform: translate(0, 0) scale(0.6);
  }
  30% {
    opacity: 0.7;
    transform: translate(-5px, -15px) scale(0.9);
  }
  70% {
    opacity: 0.6;
    transform: translate(-12px, -35px) scale(1);
  }
  90% {
    opacity: 0.2;
    transform: translate(-18px, -48px) scale(0.9);
  }
  100% {
    transform: translate(-20px, -50px) scale(0.8);
    opacity: 0;
  }
}

/* 添加更平滑的粒子样式 */
@keyframes smoothParticleFloat {
  0% {
    transform: translate(0, 0) scale(0.3);
    opacity: 0;
  }
  15% {
    opacity: 0.8;
    transform: translate(var(--x1), var(--y1)) scale(0.8);
  }
  40% {
    transform: translate(var(--x2), var(--y2)) scale(1);
    opacity: 0.7;
  }
  70% {
    transform: translate(var(--x3), var(--y3)) scale(0.9);
    opacity: 0.5;
  }
  100% {
    transform: translate(var(--x4), var(--y4)) scale(0.6);
    opacity: 0;
  }
}

@keyframes rotateGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* 3D效果增强 */
#pulsating-orb::before {
  content: "";
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  filter: blur(5px);
  pointer-events: none;
}

/* 按钮样式 */
button,
.button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  background-color: transparent;
  color: white;
}

.button:hover {
  transform: scale(1.05);
}

button:focus,
button:focus-visible {
  outline: none;
}

button:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 状态样式 */
#status {
  padding: 10px;
  border-radius: 4px;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  font-size: 14px;
  background-color: rgba(50, 50, 50, 0.7);
  color: #000000;
}

.connected {
  color: #56c6da;
}

.disconnected {
  color: #ffbd59;
}

.error {
  color: #ff8f8f;
}

.ready {
  color: #6eb9f7;
}

.recording {
  color: #59dfe6;
}

.processing {
  color: #d5dbdb;
}

/* 聊天容器样式 */
#chat-container {
  flex: 1;
  overflow-y: auto;
  margin: 8px;
  padding: 16px;
  margin-bottom: 120px; /* Space for controls */
  display: flex;
  flex-direction: column;
  background-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  max-height: 40vh;
}

#chat-container::-webkit-scrollbar {
  width: 4px;
}

#chat-container::-webkit-scrollbar-track {
  background: transparent;
}

#chat-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

#empty-chat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #000000;
  padding: 32px;
  text-align: center;
}

#empty-chat-title {
  font-weight: 500;
  margin-bottom: 8px;
  color: #00bfff;
}

#empty-chat-subtitle {
  color: #666666;
  font-size: 14px;
}

/* 消息样式 */
.message {
  margin: 8px 0;
  padding: 12px 16px;
  border-radius: 12px;
  position: relative;
  max-width: 85%;
  word-wrap: break-word;
}

.user {
  background-color: transparent;
  color: #666666;
  align-self: flex-end;
  margin-left: auto;
}

.assistant {
  background-color: transparent;
  color: #000000;
  align-self: flex-start;
  margin-right: auto;
}

.system {
  background-color: transparent;
  color: #666666;
  font-style: italic;
  max-width: 90%;
  align-self: center;
  text-align: center;
  font-size: 14px;
  padding: 12px;
  border-radius: 12px;
  margin: 16px 0;
}

.role-label {
  font-size: 12px;
  color: #999999;
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: 0.5px;
  display: none; /* 隐藏角色标签 */
}

.assistant .role-label {
  color: #00bfff;
}

.message.thinking {
  opacity: 0.7;
}

/* 思考指示器样式 */
.thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 20px;
  vertical-align: middle;
}

.thinking-text {
  display: inline-block;
  margin-right: 4px;
}

.thinking-dots .dot {
  width: 8px;
  height: 8px;
  background-color: #888;
  border-radius: 50%;
  display: inline-block;
  animation: dotPulse 1.5s infinite ease-in-out;
}

.user .thinking-dots .dot {
  background-color: rgba(255, 255, 255, 0.5);
}

.assistant .thinking-dots .dot {
  background-color: #00bfff;
}

.thinking-dots .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dots .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 控制按钮样式 */
#controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
}

#status-text {
  color: #000000;
  text-align: center;
  margin-bottom: 16px;
  font-size: 14px;
}

#buttons-container {
  display: flex;
  justify-content: center;
  gap: 32px;
  width: 100%;
}

.control-button {
  background-color: rgba(50, 50, 50, 0.8);
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  color: #000000;
  font-size: 14px;
  font-weight: 500;
  min-width: 80px;
}

.control-button:hover {
  background-color: rgba(70, 70, 70, 0.9);
  transform: scale(1.05);
}

.control-button:active {
  transform: scale(0.95);
}

.control-button:disabled {
  background-color: rgba(50, 50, 50, 0.4);
  color: rgba(255, 255, 255, 0.3);
}

#stop-button {
  background-color: #ff3b30;
}



/* Voice selection in the middle */
.voice-selection {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
}

.voice-box {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.voice-box:hover {
  background-color: rgba(255, 255, 255, 1);
  border-color: rgba(0, 122, 255, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.voice-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #007AFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.voice-avatar .voice-icon {
  font-size: 20px;
}

.voice-info {
  display: flex;
  flex-direction: column;
  margin-right: 8px;
}

.voice-name {
  font-weight: 600;
  font-size: 16px;
  color: #000000;
}

.current-voice {
  font-size: 13px;
  color: #666666;
}



/* 配置弹窗样式 */
.modal {
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: #121212;
  margin: 0;
  padding: 0;
  width: 80%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 0;
}

/* 标签页样式 */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-tabs .tab {
  padding: 12px 20px;
  cursor: pointer;
  color: #666666;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.modal-tabs .tab:hover {
  color: #000000;
}

.modal-tabs .tab.active {
  color: #00bfff;
  border-bottom: 2px solid #00bfff;
}

/* 标签页内容样式 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.modal-header h2 {
  margin: 0;
  color: #000000;
  font-size: 20px;
  font-weight: 500;
}

.close-modal {
  color: #666666;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #000000;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.modal-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #000000;
  font-size: 14px;
}

.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  background-color: rgba(50, 50, 50, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #000000;
}

.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #00bfff;
  box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

/* MCP服务器样式 */
.mcp-server {
  background-color: rgba(50, 50, 50, 0.5);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mcp-server-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mcp-server-name {
  font-weight: 500;
  color: #000000;
  font-size: 16px;
  word-wrap: break-word;
  word-break: break-all;
  max-width: 80%;
}

.mcp-server-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background-color: rgba(76, 217, 100, 0.2);
  color: #4cd964;
}

.mcp-server-status.disabled {
  background-color: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
}

.mcp-server-info {
  color: #666666;
  font-size: 13px;
  margin-bottom: 12px;
}

.mcp-tools-title {
  font-size: 14px;
  color: #000000;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mcp-tools-title:hover {
  color: #007AFF;
}

.mcp-tools-title::after {
  content: "▼";
  font-size: 12px;
  transition: transform 0.3s;
}

.mcp-tools-title.collapsed::after {
  transform: rotate(-90deg);
}

.mcp-tool {
  background-color: rgba(30, 30, 30, 0.5);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.mcp-tool-name {
  font-weight: 500;
  color: #000000;
  margin-bottom: 4px;
}

.mcp-tool-description {
  font-size: 12px;
  color: #666666;
}

.mcp-tools-list {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 8px;
}

.mcp-tools-list::-webkit-scrollbar {
  width: 4px;
}

.mcp-tools-list::-webkit-scrollbar-track {
  background: transparent;
}

.mcp-tools-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-footer .button:first-child {
  background-color: #00bfff;
  color: white;
  border: none;
}

.modal-footer .button:last-child {
  background-color: transparent;
  color: #000000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-footer .button:hover {
  transform: translateY(-1px);
}

/* 媒体查询 */
@media (max-width: 768px) {
  .message {
    max-width: 85%;
  }

  #empty-chat {
    padding: 16px;
  }

  .modal-content {
    width: 90%;
    margin: 15% auto;
  }
}

@media (max-width: 480px) {
  .message {
    max-width: 90%;
  }

  #chat-container {
    margin: 4px;
    padding: 8px;
  }

  #controls {
    padding: 8px;
    padding-bottom: 24px;
  }

  .control-button {
    width: 50px;
    height: 50px;
  }

  .modal-content {
    width: 95%;
    margin: 20% auto;
  }

  #config-button {
    top: 5px;
    right: 5px;
  }
}
