:global {
  :root {
    --code-c-text: #9e9e9e;
    --code-c-highlight-bg: rgb(142 150 170 / 14%);
    --code-line-height: 1.6;
    --code-line-number-width: 3rem;
    --code-font-family: consolas, monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    --code-font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  }

  pre.shiki {
    position: relative;
    padding: 6px 12px;

    > code {
      position: relative;
      font-family: var(--code-font-family);
    }
  }
}

.text {
  border-radius: 8px;
  overflow: hidden;

  &.lineNumber {
    :global {
      pre.shiki {
        padding: 6px 12px 6px 3rem;

        &:has(code > span.line:nth-of-type(1000)) {
          padding-left: 4rem !important;
        }

        > code {
          counter-reset: line-number 0;

          &:before {
            position: absolute;
            top: 0;
            left: -12px;
            bottom: 0;
            z-index: 3;
            content: '';
            border-right: 1px solid rgb(142 150 170 / 14%);
          }

          > span.line {
            position: relative;

            &:after {
              position: absolute;
              top: 0;
              right: calc(100% + 20px);
              bottom: 0;
              z-index: 3;
              text-align: right;
              color: var(--code-c-text);
              content: counter(line-number);
              counter-increment: line-number 1;
            }
          }
        }
      }
    }
  }
}
