@import url("../doc/doc_style.css");

pre {
  margin: 0;
}

.btn {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.btn.primary {
  border-color: rgb(255, 255, 255);
  color: rgb(5, 5, 5);
  background: rgb(255, 255, 255);
}

.card {
  min-height: 0;
  padding: 18px;
}

.card-head, .code-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.caret {
  flex: 0 0 14px;
  width: 14px;
  text-align: center;
  color: var(--subtle);
  cursor: pointer;
}

.code-file, .title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.code-line {
  display: grid;
  grid-template-columns: var(--line-no-width, 4ch) minmax(0, 1fr);
  min-height: 1.65em;
}

.code-meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.code-top {
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.code-wrap, .tree-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.indent-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1.8ch;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(2ch - 1px),
    rgba(255, 255, 255, 0.12) calc(2ch - 1px),
    rgba(255, 255, 255, 0.12) 2ch,
    transparent 2ch,
    transparent 4ch
  );
  pointer-events: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1.38fr);
  gap: 18px;
  min-height: 76vh;
}

.layout > .card {
  display: flex;
  flex-direction: column;
}

.line-content {
  position: relative;
  min-width: 0;
  white-space: pre;
}

.line-no {
  padding-right: 1ch;
  text-align: right;
  color: rgb(111, 111, 111);
  user-select: none;
}

.node-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255, 255, 255, 0.035);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  color: rgb(216, 216, 216);
  cursor: default;
}

.row:hover, .row.file.active {
  background: rgba(255, 255, 255, 0.08);
}

.row.file {
  cursor: pointer;
}

.search {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.search::placeholder {
  color: rgb(119, 119, 119);
}

.tree ul {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.tree-wrap {
  padding: 10px;
}

.tree, .tree ul {
  list-style: none;
}

#codeView {
  flex: 1;
  min-width: 100%;
  overflow: auto;
  padding: 14px;
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.65;
  tab-size: 4;
  color: rgb(232, 232, 232);
}

@media (width < 1024px) {
  .btn {
    width: 100%;
  }

  .card {
    padding: 18px;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .layout > .card {
    min-height: 460px;
  }
}
