/* -------------------copy code-------------------- */
.code-editor .copy-code {
  transition: 0.2s opacity ease;
  position: relative;
  opacity: 0.5;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.code-editor .copy-code:focus {
  outline: none;
}
.code-editor .copy-code > svg {
  pointer-events: none;
}
.code-editor .copy-code:hover {
  opacity: 1;
}
.code-editor .copy-code:hover > .tooltip {
  display: block;
}
.code-editor .copy-code > .tooltip {
  font-family: sans-serif;
  display: none;
  position: absolute;
  bottom: -10px;
  left: -96px;
  font-size: 12px;
  color: white;
  width: 84px;
  height: 30px;
  line-height: 30px;
  background: rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  text-align: center;
  border-radius: 4px;
}
/* ----------------------dropdown------------------------ */
.fade-enter-active,
.fade-leave-active {
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}
.code-editor .dropdown {
  cursor: pointer;
  position: relative;
}
.code-editor .dropdown:focus {
  outline: none;
}
.code-editor .disabled {
  cursor: default;
}
.code-editor .disabled:hover > .title {
  opacity: 0.5 !important;
}
.code-editor .dropdown:hover > .title {
  opacity: 1;
}
.code-editor .dropdown > .title {
  transition: opacity 0.2s ease;
  opacity: 0.5;
  display: flex;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
}
.code-editor .dropdown > .title > div {
  white-space: nowrap;
  font-size: 12px;
  line-height: 16px;
}
.code-editor .dropdown > .title > svg {
  transition: 0.2s;
  margin-left: 3px;
  margin-top: 1px;
}
.code-editor .dropdown > .list {
  box-sizing: border-box;
  position: absolute;
  padding: 1px;
  border-radius: 6px;
  overflow: hidden;
  top: 24px;
  left: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.code-editor .dropdown > .list:before {
  content: "";
  position: absolute;
  top: 0px;
  left: 0px;
  z-index: -1;
  width: 100%;
  height: 100%;
  background: currentColor;
  opacity: 0.2;
}
/* -----------------code editor-----------------*/
.code-editor {
  position: relative;
}
.code-editor > div {
  width: 100%;
  height: 100%;
}
/* header */
.code-editor .header {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  height: 34px;
}
.code-editor .header > .dropdown {
  position: absolute;
  top: 12px;
  left: 18px;
}
.code-editor .header > .copy-code {
  position: absolute;
  top: 10px;
  right: 12px;
}
/* code-area */
.code-editor .code-area {
  position: relative;
  z-index: 0;
  text-align: left;
  overflow: hidden;
}
/* font style */
.code-editor .code-area > textarea,
.code-editor .code-area > pre > code,
.code-editor .line-nums > div {
  font-family: Consolas, Monaco, monospace;
  line-height: 1.5;
}
.code-editor .code-area > textarea:hover,
.code-editor .code-area > textarea:focus-visible {
  outline: none;
}
.code-editor .code-area > textarea {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  overflow-y: hidden;
  box-sizing: border-box;
  caret-color: rgb(127, 127, 127);
  color: transparent;
  white-space: pre;
  word-wrap: normal;
  border: 0;
  width: 100%;
  height: 100%;
  background: none;
  resize: none;
}
.code-editor .code-area > pre {
  box-sizing: border-box;
  position: relative;
  z-index: 0;
  overflow: hidden;
  font-size: 0;
  margin: 0;
}
.code-editor .code-area > pre > code {
  background: none;
  display: block;
  position: relative;
  overflow-x: visible !important;
  border-radius: 0;
  box-sizing: border-box;
  margin: 0;
}
/* wrap code */
.code-editor.wrap .code-area > textarea,
.code-editor.wrap .code-area > pre > code {
  white-space: pre-wrap;
  word-wrap: break-word;
}
/* hide-header */
.code-editor.hide-header.scroll .code-area {
  height: 100%;
}
/* scroll */
.code-editor.scroll .code-area {
  height: calc(100% - 34px);
}
.code-editor.scroll .code-area > textarea {
  overflow: auto;
}
.code-editor.scroll .code-area > pre {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
/* dropdown */
.code-editor .list {
  -webkit-user-select: none;
  user-select: none;
  height: 100%;
  font-family: sans-serif;
}
.code-editor .list > .lang-list {
  border-radius: 5px;
  box-sizing: border-box;
  overflow: auto;
  font-size: 13px;
  padding: 0;
  margin: 0;
  list-style: none;
  text-align: left;
}
.code-editor .list > .lang-list > li {
  font-size: 13px;
  transition: background 0.16s ease, color 0.16s ease;
  box-sizing: border-box;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 30px;
}
.code-editor .list > .lang-list > li:first-child {
  padding-top: 5px;
}
.code-editor .list > .lang-list > li:last-child {
  padding-bottom: 5px;
}
.code-editor .list > .lang-list > li:hover {
  background: rgba(160, 160, 160, 0.4);
}
/* line-nums */
.code-editor .line-nums {
  min-width: 36px;
  text-align: right;
  box-sizing: border-box;
  position: absolute;
  left: 0;
  padding-right: 8px;
  padding-left: 8px;
  opacity: 0.3;
}
.code-editor .line-nums::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-right: 1px solid currentColor;
  opacity: 0.5;
}
.code-editor .header.border::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: 0;
  left: 0;
  background: currentColor;
  opacity: 0.15;
}
