:root {
  // Dark theme variables
  .theme-dark {
    --bg-color: #141414;
    --bg-color-secondary: #1f1f1f;
    --bg-color-quaternary: #3a3a3a;
    --bg-color-quinary: #2a2a2a;
    --text-color: #ffffff;
    --text-color-secondary: #e0e0e0;
    --text-color-tertiary: #666666;
    --border-color: #333333;
    --border-color-light: #3a3a3a;
    --hover-bg-color: #2a2a2a;
    --scrollbar-thumb: #2a2a2a;
    --scrollbar-track: #1a1a1a;
    --scrollbar-thumb-hover: #3a3a3a;
    --icon-filter: invert(0.25);
    --icon-filter-hover: invert(0.1);
  }

  // Light theme variables
  .theme-light {
    --bg-color: #ffffff;
    --bg-color-secondary: #f5f5f5;
    --bg-color-quaternary: #d9d9d9;
    --bg-color-quinary: #e8e8e8;
    --text-color: #000000;
    --text-color-secondary: #333333;
    --text-color-tertiary: #666666;
    --border-color: #d9d9d9;
    --border-color-light: #e8e8e8;
    --hover-bg-color: #f0f0f0;
    --scrollbar-thumb: #e8e8e8;
    --scrollbar-track: #f5f5f5;
    --scrollbar-thumb-hover: #d9d9d9;
    --icon-filter: invert(0.75);
    --icon-filter-hover: invert(0.9);
  }
}

.history-dropdown-menu {
  .ant-input {
    background-color: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    font-size: 12px !important;
    padding: 0 4px !important;
    height: 16px !important;
    line-height: 16px !important;

    &:focus {
      border-color: #1890ff !important;
      box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2) !important;
    }
  }
}

.ai-chat-custom-tabs {
  :deep(.ant-tabs-tab:not(.ant-tabs-tab-active) .ant-tabs-tab-btn) {
    color: var(--text-color-secondary);
    transition:
      color 0.2s,
      text-shadow 0.2s;
  }

  :deep(.ant-tabs-nav) {
    height: 26px;
    margin-bottom: 2px;
  }

  :deep(.ant-tabs-tab) {
    padding: 0 4px;
    height: 22px;
    line-height: 22px;
    font-size: 12px;
  }

  :deep(.ant-tabs-content-holder) {
    display: flex;
    flex: 1;
    min-height: 0;
    max-height: 100%;
  }

  :deep(.ant-tabs-content) {
    height: 100%;
    width: 100%;
  }

  :deep(.ant-tabs-tabpane) {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
}

.ai-chat-flex-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-color);
  overflow: hidden;
}

.hosts-display-container {
  position: relative;
  background-color: var(--bg-color);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  user-select: text;
  padding: 4px 8px;
  border-radius: 8px 8px 0 0;
  max-height: 100px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-color-secondary);

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: var(--bg-color-secondary);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;

    &:hover {
      background-color: var(--border-color-light);
    }
  }

  :deep(.ant-tag) {
    font-size: 10px;
    padding: 0 6px;
    height: 16px;
    line-height: 16px;
    display: flex;
    align-items: center;
    margin-left: 2px;
    margin-bottom: 2px;
    background-color: var(--bg-color-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;

    .anticon-laptop {
      color: #1890ff !important;
      margin-right: 0cap;
    }
  }

  .host-tag-with-delete {
    position: relative;
    padding-right: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;

    .host-delete-btn {
      position: absolute;
      right: 4px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 8px;
      color: var(--text-color-tertiary);
      cursor: pointer;
      padding: 1px;
      border-radius: 2px;
      transition: all 0.2s ease;

      &:hover {
        color: #ff4d4f;
        background-color: rgba(255, 77, 79, 0.1);
      }
    }
  }
}

.other-hosts-display-container {
  background: var(--bg-color-secondary);
  color: var(--text-color);
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  height: 16px;
  line-height: 16px;
  margin-left: 2px;
  margin-top: 4px;
}

.hosts-display-container-host-tag {
  background-color: var(--bg-color-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-color) !important;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  height: 20px;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a3a3a;

  &:hover {
    background-color: var(--hover-bg-color) !important;
    border-color: var(--border-color-light) !important;
  }
}

.chat-response-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0px 4px 4px 4px;
  margin-top: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color-light) transparent;
  width: 100%;
  min-height: 0;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: var(--border-color-light);
    border-radius: 3px;

    &:hover {
      background-color: var(--text-color-tertiary);
    }
  }
}

.chat-response {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;

  .message {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1.5;
    box-sizing: border-box;
    user-select: text;

    &.user {
      align-self: flex-end;
      background-color: var(--bg-color-secondary);
      color: var(--text-color);
      border-radius: 4px;
      border: none;
      margin-left: auto;
      float: right;
      clear: both;
    }

    &.assistant {
      color: var(--text-color);
      width: 100%;
      padding: 0;

      &.completion-result {
        background-color: var(--bg-color-secondary);
        border-radius: 0 0 4px 4px;
        padding: 0 8px 2px 8px;
        margin-top: 0;
      }

      &.interactive-notification {
        background-color: var(--bg-color-quaternary) !important;
        border: none !important;
        border-radius: 4px !important;
        margin: 8px 0 !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        line-height: 1.5715 !important;
        position: relative;
        overflow: hidden;

        &:before {
          content: '💡';
          position: absolute;
          left: 12px;
          top: 8px;
          font-size: 14px;
          line-height: 1;
        }

        :deep(.markdown-content) {
          color: var(--text-color) !important;
          margin-left: 24px !important;
          padding: 0 !important;
          margin-top: 0 !important;
          margin-bottom: 0 !important;
          font-size: 12px !important;
          line-height: 1.5715 !important;

          p,
          div,
          span {
            color: var(--text-color) !important;
            font-size: 12px !important;
            line-height: 1.5715 !important;
            margin: 0 !important;
          }

          p:first-child {
            margin-top: 0 !important;
          }

          p:last-child {
            margin-bottom: 0 !important;
          }
        }
      }
    }
  }
}

.input-send-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--bg-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  width: 100%;

  .chat-textarea {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 12px !important;
  }

  :deep(.ant-input::placeholder) {
    color: var(--text-color-tertiary) !important;
  }

  .ant-textarea {
    background-color: var(--bg-color) !important;
    border: none !important;
    border-radius: 8px !important;
    color: var(--text-color) !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
}

.input-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 8px;
  flex-wrap: nowrap;
  min-height: 32px;

  // 确保按钮组不会被压缩
  .action-buttons-container {
    flex-shrink: 0;
  }

  .ant-select {
    width: 120px;

    :deep(.ant-select-selector) {
      background-color: transparent !important;
      border: none !important;
      border-radius: 4px !important;
      color: var(--text-color) !important;
      height: 24px !important;
      line-height: 24px !important;
    }

    :deep(.ant-select-selection-item) {
      font-size: 12px !important;
      line-height: 24px !important;
      color: var(--text-color) !important;
    }

    :deep(.ant-select-arrow) {
      color: var(--text-color-tertiary) !important;
    }

    &:hover {
      :deep(.ant-select-selector) {
        background-color: var(--hover-bg-color) !important;
      }
    }
  }

  .action-buttons-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    flex-shrink: 0;

    @media (max-width: 480px) {
      gap: 6px;
      margin-left: 2px;
    }
  }

  .custom-round-button {
    height: 18px;
    width: 18px;
    padding: 0;
    border-radius: 4px;
    font-size: 10px;
    background-color: transparent;
    border: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;

    &:hover {
      transform: scale(1.15);
      background-color: var(--hover-bg-color);
    }

    &:active {
      transform: scale(0.95);
      box-shadow: none;
    }

    &[disabled] {
      cursor: not-allowed;
      opacity: 0.2;
      pointer-events: none;

      &:hover {
        transform: none;
      }
    }
  }
}

.assistant-message-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  position: relative;

  &.last-message {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

    .message-header {
      background-color: var(--bg-color-secondary);
      border-radius: 4px 4px 0 0;
      padding: 4px 8px 0 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: none;
      margin-bottom: 0;
      z-index: 2;
      position: relative;
    }

    .message-title {
      font-size: 12px;
      font-weight: 500;
      color: var(--text-color);
    }

    .message-feedback {
      display: flex;
      gap: 6px;

      .feedback-btn {
        height: 16px;
        width: 16px;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;

        &:hover {
          background: var(--hover-bg-color);
        }

        &[disabled] {
          cursor: not-allowed;

          .anticon:not([style*='opacity: 1']) {
            opacity: 0.5;
          }

          &:hover {
            background: transparent;
          }
        }

        .anticon {
          font-size: 12px;
        }
      }

      .like-btn {
        .anticon {
          color: var(--text-color-tertiary);

          &:hover {
            color: #52c41a;
          }
        }

        &[disabled] .anticon[style*='color: #52c41a'] {
          opacity: 1;
          color: #52c41a !important;
        }
      }

      .dislike-btn {
        .anticon {
          color: var(--text-color-tertiary);

          &:hover {
            color: #ff4d4f;
          }
        }

        &[disabled] .anticon[style*='color: #ff4d4f'] {
          opacity: 1;
          color: #ff4d4f !important;
        }
      }
    }
  }

  .message-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0px;
    width: 100%;

    .options-container {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;

      .option-btn {
        width: 100%;
        height: auto;
        white-space: normal;
        text-align: left;
        padding: 8px 12px;
        line-height: 1.4;
        font-size: 12px;
        background-color: #2a2a2a;
        border: 1px solid #3a3a3a;
        color: #e0e0e0;
        transition: all 0.2s ease;

        &:hover {
          background-color: #3a3a3a;
          border-color: #4a4a4a;
          transform: translateX(4px);
        }

        &:active {
          background-color: #4a4a4a;
          transform: translateX(2px);
        }

        &.selected {
          background-color: #1656b1;
          border-color: #2d6fcd;
          color: white;
          transform: none;

          &:hover {
            background-color: #1656b1;
            border-color: #2d6fcd;
            transform: none;
          }
        }
      }

      .options-radio-group {
        width: 100%;

        .ant-radio-group {
          width: 100%;
          display: flex;
          flex-direction: column;
          gap: 8px;
        }

        .option-radio {
          width: 100%;
          padding: 8px 12px;
          margin: 0;
          background-color: var(--bg-color-tertiary);
          border: 1px solid var(--bg-color-quaternary);
          border-radius: 6px;
          color: var(--text-color);
          transition: all 0.2s ease;

          &:hover {
            background-color: var(--bg-color-quaternary);
            border-color: var(--bg-color-novenary);
          }

          .ant-radio {
            margin-right: 8px;
          }

          .ant-radio-checked .ant-radio-inner {
            background-color: var(--button-bg-color);
            border-color: var(--button-bg-color);
          }

          &.custom-option {
            border-style: dashed;
            border-color: var(--bg-color-novenary);
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 8px 12px;

            .custom-radio {
              margin: 0;
              margin-top: 2px; // 微调对齐到输入框的第一行文本
              flex-shrink: 0; // 防止单选按钮被压缩
            }

            .custom-input {
              flex: 1;
              background-color: transparent;
              border: none;
              color: var(--text-color);
              padding: 0;
              min-height: 20px; // 设置最小高度与其他选项一致

              &:focus {
                border: none;
                box-shadow: none;
                background-color: var(--hover-bg-color);
              }

              &::placeholder {
                color: var(--text-color-tertiary);
              }

              :deep(.ant-input) {
                background-color: transparent !important;
                border: none !important;
                box-shadow: none !important;
                padding: 2px 0 !important;
                color: var(--text-color) !important;
                line-height: 1.4 !important;
                min-height: 20px !important;
                resize: none !important;
              }

              // 确保单行时的高度一致
              :deep(textarea) {
                line-height: 1.4 !important;
                min-height: 20px !important;
              }
            }
          }
        }
      }

      .submit-button-container {
        margin-top: 12px;
        display: flex;
        justify-content: flex-end;

        .submit-option-btn {
          background-color: var(--button-bg-color);
          border-color: var(--button-bg-color);
          color: white;
          border-radius: 6px;
          font-size: 12px;
          height: 32px;
          padding: 0 16px;

          &:hover:not(:disabled) {
            background-color: var(--button-hover-bg);
            border-color: var(--button-hover-bg);
          }

          &:disabled {
            background-color: var(--bg-color-quaternary);
            border-color: var(--bg-color-quaternary);
            color: var(--text-color-tertiary);
          }
        }
      }
    }

    .action-buttons {
      width: 100%;
      margin: 0;
      padding: 0;

      .button-row {
        display: flex;
        gap: 4px;
        width: 100%;

        &:has(.options-container) {
          flex-direction: column;
        }
      }
    }

    .action-btn {
      height: 18px;
      padding: 0 6px;
      border-radius: 4px;
      font-size: 10px;
      display: flex;
      align-items: center;
      gap: 3px;
      transition: all 0.3s ease;
      border: none;

      &.copy-btn {
        background-color: #2a2a2a;
        color: #e0e0e0;

        &:hover {
          background-color: #3a3a3a;
          transform: translateY(-1px);
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        &:active {
          transform: translateY(0);
        }
      }

      &.apply-btn {
        background-color: #4caf50;
        color: white;

        &:hover {
          background-color: #45a049;
          transform: translateY(-1px);
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        &:active {
          transform: translateY(0);
        }
      }

      .anticon {
        font-size: 12px;
      }
    }
  }
}

.right-extra-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;

  .action-icon-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    filter: var(--icon-filter);

    &:hover {
      background-color: rgba(0, 0, 0, 0.06);
      color: var(--text-color);
      filter: var(--icon-filter-hover);
    }

    &:active {
      background-color: rgba(0, 0, 0, 0.1);
    }

    .anticon,
    img {
      width: 14px;
      height: 14px;
      opacity: 0.65;
    }
  }
}

.history-dropdown-menu {
  max-height: none;
  overflow: visible;
  padding: 4px 0 4px 4px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 280px !important;

  :deep(.ant-dropdown-menu-item) {
    padding: 0 4px 0 4px !important;
    line-height: 30px !important;
    height: 30px !important;
  }

  .history-search-container {
    display: flex;
    gap: 10px;
    align-items: center;

    :deep(.ant-input-affix-wrapper) {
      border-color: var(--border-color);
      box-shadow: none;
    }

    .favorites-button {
      flex-shrink: 0;
      border: none;
      background-color: transparent;
      margin-right: 6px;
      padding: 0 6px;
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;

      &.ant-btn-primary {
        background-color: transparent;
        border: none;
      }
    }
  }

  .history-search-input {
    width: 100%;
    background-color: var(--bg-color) !important;

    :deep(.ant-input) {
      background-color: var(--bg-color) !important;
      border: none !important;
      color: var(--text-color) !important;
      height: 20px !important;

      &::placeholder {
        color: var(--text-color-tertiary) !important;
      }
    }

    :deep(.ant-input-clear-icon) {
      color: var(--text-color-tertiary);

      &:hover {
        color: var(--text-color-secondary);
      }
    }
  }
}

.history-virtual-list-container {
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-color-quinary) transparent;

  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 2px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: var(--bg-color-quinary);
    border-radius: 2px;

    &:hover {
      background-color: var(--bg-color-quaternary);
    }
  }
}

.history-menu-item {
  padding: 6px 8px !important;
  margin: 2px 0 !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  min-height: unset !important;

  .menu-action-buttons {
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  &:hover {
    background-color: var(--hover-bg-color) !important;
    transform: translateX(2px);
    border-color: var(--border-color-light);

    .menu-action-buttons {
      opacity: 1;
    }
  }

  &:active {
    background-color: var(--bg-color-secondary) !important;
  }

  &.favorite-item {
    background-color: var(--bg-color) !important;
    border-left: 2px solid #faad14 !important;

    &:hover {
      background-color: var(--bg-color-secondary) !important;
    }
  }
}

.history-item-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;

  :deep(.ant-input) {
    background-color: var(--bg-color-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    font-size: 13px !important;
    padding: 0 4px !important;
    height: 20px !important;
    line-height: 20px !important;

    &:focus {
      border-color: var(--border-color) !important;
      box-shadow: 0 0 0 2px rgba(58, 58, 58, 0.2) !important;
    }
  }

  .menu-action-buttons {
    display: flex;
    gap: 0px;
    margin-left: 0px;

    > .menu-action-btn {
      margin-left: -3px;
    }
  }

  .history-title {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }

  .history-title-input {
    flex: 1;
    margin-right: 8px;
  }

  .history-type {
    color: #888;
    font-size: 10px;
    padding: 1px 4px;
    background-color: #333;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
    flex-shrink: 0;
  }

  :deep(.ant-input::placeholder) {
    color: #666 !important;
  }

  .action-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;

    &.approved {
      background-color: #52c41a20;
      color: #52c41a;
    }

    &.rejected {
      background-color: #ff4d4f20;
      color: #ff4d4f;
    }
  }

  .action-buttons {
    margin: 0;
    padding: 0;
    width: 100%;

    .button-row {
      display: flex;
      gap: 4px;
      justify-content: flex-end;
      margin-top: 2px;

      .options-container {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        width: 100%;
        justify-content: flex-end;

        &.vertical-layout {
          flex-direction: column;
          align-items: stretch;

          .action-btn {
            width: 100%;
            justify-content: flex-start;
            text-align: left;
          }
        }
      }
    }
  }
}

.bottom-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  flex-shrink: 0;
}

.bottom-buttons {
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 4px 8px;

  &.cancel-row {
    padding-top: 0;
  }

  .reject-btn,
  .approve-btn,
  .cancel-btn,
  .retry-btn,
  .resume-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
  }

  .reject-btn {
    .theme-dark & {
      background-color: #2a2a2a;
      border-color: #3a3a3a;
      color: #e0e0e0;

      &:hover {
        background-color: #ff4d4f20;
        border-color: #ff4d4f;
        color: #ff4d4f;
      }

      &[disabled] {
        background-color: #141414 !important;
        border-color: #2a2a2a !important;
        color: #666666 !important;
        cursor: not-allowed;

        &:hover {
          background-color: #141414 !important;
          border-color: #2a2a2a !important;
          color: #666666 !important;
        }
      }
    }

    .theme-light & {
      background-color: #fff;
      border: 1px solid #d9d9d9;
      color: #666;

      &:hover {
        color: #ff4d4f;
        border-color: #ff4d4f;
        background-color: #fff1f0;
      }

      &[disabled] {
        background-color: #f5f5f5 !important;
        border-color: #d9d9d9 !important;
        color: #d9d9d9 !important;
        cursor: not-allowed;
      }
    }
  }

  .approve-btn {
    .theme-dark & {
      color: #e0e0e0;
      background-color: #1656b1;
      border-color: #2d6fcd;

      &:hover {
        background-color: #52c41a20;
        border-color: #52c41a;
        color: #52c41a;
      }

      &[disabled] {
        background-color: #141414 !important;
        border-color: #2a2a2a !important;
        color: #666666 !important;
        cursor: not-allowed;

        &:hover {
          background-color: #141414 !important;
          border-color: #2a2a2a !important;
          color: #666666 !important;
        }
      }
    }

    .theme-light & {
      background-color: #1890ff;
      border-color: #1890ff;
      color: #fff;

      &:hover {
        background-color: #40a9ff;
        border-color: #40a9ff;
      }

      &[disabled] {
        background-color: #f5f5f5 !important;
        border-color: #d9d9d9 !important;
        color: #d9d9d9 !important;
        cursor: not-allowed;
      }
    }
  }

  .cancel-btn {
    .theme-dark & {
      background-color: #2a2a2a;
      border-color: #3a3a3a;
      color: #666666;

      &:hover {
        background-color: #3a3a3a;
        border-color: #4a4a4a;
        color: #888888;
      }

      &[disabled] {
        background-color: #141414 !important;
        border-color: #2a2a2a !important;
        color: #666666 !important;
        cursor: not-allowed;

        &:hover {
          background-color: #141414 !important;
          border-color: #2a2a2a !important;
          color: #666666 !important;
        }
      }
    }

    .theme-light & {
      background-color: #fff;
      border: 1px solid #d9d9d9;
      color: #666;

      &:hover {
        color: #40a9ff;
        border-color: #40a9ff;
      }

      &[disabled] {
        background-color: #f5f5f5 !important;
        border-color: #d9d9d9 !important;
        color: #d9d9d9 !important;
        cursor: not-allowed;
      }
    }
  }

  .resume-btn {
    .theme-dark & {
      background-color: #1656b1;
      border-color: #2d6fcd;
      color: #cccccc;
      opacity: 0.65;

      &:hover {
        opacity: 1;
        background-color: #1656b1;
        border-color: #2d6fcd;
        color: #ffffff;
      }

      &[disabled] {
        background-color: #141414 !important;
        border-color: #2a2a2a !important;
        color: #666666 !important;
        cursor: not-allowed;

        &:hover {
          background-color: #141414 !important;
          border-color: #2a2a2a !important;
          color: #666666 !important;
        }
      }
    }

    .theme-light & {
      background-color: #1890ff;
      border-color: #1890ff;
      color: #fff;
      opacity: 0.65;

      &:hover {
        opacity: 1;
        background-color: #40a9ff;
        border-color: #40a9ff;
      }

      &[disabled] {
        background-color: #f5f5f5 !important;
        border-color: #d9d9d9 !important;
        color: #d9d9d9 !important;
        cursor: not-allowed;
      }
    }
  }
}

.mini-host-search-input {
  background-color: var(--bg-color-secondary) !important;
  border: 1px solid var(--border-color) !important;

  :deep(.ant-input) {
    height: 22px !important;
    font-size: 12px !important;
    background-color: var(--bg-color-secondary) !important;
    color: var(--text-color-secondary) !important;

    &::placeholder {
      color: var(--text-color-tertiary) !important;
    }

    padding: 0px 0px 2px 2px !important;
    line-height: 22px !important;
  }
}

.host-select-popup {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 229px;
  background: var(--bg-color);
  border-radius: 4px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  margin-bottom: 4px;
  margin-left: 8px;
  max-height: 240px;
  // overflow: hidden;
}

.host-select-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 2px 0px 2px 0px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-color-quinary) var(--bg-color-senary);

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 3px;

    &:hover {
      background-color: var(--scrollbar-thumb-hover);
    }
  }
}

.host-select-item {
  padding: 2px 6px;
  cursor: pointer;
  bottom: 100%;
  border-radius: 3px;
  margin-bottom: 2px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 12px;
  line-height: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;

  .host-label {
    flex: 1;
  }

  .host-selected-icon {
    font-size: 10px;
    color: #52c41a;
    margin-left: 4px;
  }

  &.hovered {
    background: var(--hover-bg-color);
  }

  &.keyboard-selected {
    background: var(--hover-bg-color);
    outline: 2px solid rgba(24, 144, 255, 0.5);
    outline-offset: -2px;
  }
}

.host-select-empty {
  color: var(--text-color-tertiary);
  text-align: center;
  padding: 8px 0;
}

.ai-welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .ai-welcome-icon {
    margin-bottom: 12px;

    img {
      width: 28px;
      height: 28px;
      opacity: 0.65;
      filter: var(--icon-filter);
      transition: filter 0.2s ease;
    }
  }

  .ai-welcome-text {
    color: var(--text-color);
    font-size: 14px;
    text-align: center;
    font-weight: 400;
    opacity: 0.65;
  }
}

.menu-action-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-color) !important;
  padding: 0;
  min-width: 0;
  height: 16px;
  line-height: 20px;
  font-size: 12px;
  margin-left: 0;
  margin-right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;

  :deep(.anticon) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  &:hover,
  &:focus {
    background: none !important;
  }

  &:hover :deep(.anticon) {
    color: #1890ff !important;
  }

  &.save-btn:hover :deep(.anticon) {
    color: #52c41a !important;
  }

  &.cancel-btn:hover :deep(.anticon) {
    color: #ff4d4f !important;
  }

  &.favorite-btn:hover :deep(.anticon) {
    color: #faad14 !important;
  }
}

.history-load-more {
  text-align: center;
  padding: 8px;
  color: var(--text-color-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;

  &:hover {
    color: #1890ff;
    background-color: var(--hover-bg-color);
  }
}

.processing-text {
  font-size: 10px;
  color: var(--text-color);
}

.ai-login-prompt {
  text-align: center;
  margin-top: 20px;

  p {
    color: var(--text-color);
    font-size: 12px;
    margin-bottom: 20px;
  }

  .login-button {
    min-width: 150px;
    height: 32px;
    font-size: 14px;
  }
}

.model-label {
  display: inline-flex;
  align-items: center;
}

.thinking-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  filter: var(--icon-filter);
  transition: filter 0.2s ease;
}

// Todo 相关样式
.ai-tab-container {
  position: relative;
  height: 100%;
}

.todo-inline {
  margin: 8px 0;
}
