/* Base styles and content styles */

@import 'variables.css';

:root {
    /* Browser default font-size is 16px, this way 1 rem = 10px */
    font-size: 62.5%;
    color-scheme: var(--color-scheme);
}

html {
    font-family: "Open Sans", sans-serif;
    color: var(--fg);
    background-color: var(--bg);
    text-size-adjust: none;
    -webkit-text-size-adjust: none;
}

body {
    margin: 0;
    font-size: 1.6rem;
    overflow-x: hidden;
}

code {
    font-family: var(--mono-font) !important;
    font-size: var(--code-font-size);
    direction: ltr !important;
}

/* make long words/inline code not x overflow */
main {
    overflow-wrap: break-word;
}

/* make wide tables scroll if they overflow */
.table-wrapper {
    overflow-x: auto;
}

/* Don't change font size in headers. */
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
    font-size: unset;
}

.left {
    float: left;
}

.right {
    float: right;
}

.boring {
    opacity: 0.6;
}

.hide-boring .boring {
    display: none;
}

.hidden {
    display: none !important;
}

h2,
h3 {
    margin-block-start: 2.5em;
}

h4,
h5 {
    margin-block-start: 2em;
}

.header+.header h3,
.header+.header h4,
.header+.header h5 {
    margin-block-start: 1em;
}

h1:target::before,
h2:target::before,
h3:target::before,
h4:target::before,
h5:target::before,
h6:target::before {
    display: inline-block;
    content: "»";
    margin-inline-start: -30px;
    width: 30px;
}

/* This is broken on Safari as of version 14, but is fixed
   in Safari Technology Preview 117 which I think will be Safari 14.2.
   https://bugs.webkit.org/show_bug.cgi?id=218076
*/
:target {
    /* Safari does not support logical properties */
    scroll-margin-top: calc(var(--menu-bar-height) + 0.5em);
}

/* .page {
    outline: 0;
    padding: 0 var(--page-padding);
    position: sticky;
    top: 0;
    z-index: 1;
} */

.page {
    outline: 0;
    /* padding: 0 var(--page-padding); */
    margin-block-start: calc(0px - var(--menu-bar-height));
    /* Compensate for the #menu-bar-hover-placeholder */
}

.page-wrapper {
    box-sizing: border-box;
    background-color: var(--bg);
}

.no-js .page-wrapper,
.js:not(.sidebar-resizing) .page-wrapper {
    transition: margin-left 0.3s ease, transform 0.3s ease;
    /* Animation: slide away */
}

[dir=rtl] .js:not(.sidebar-resizing) .page-wrapper {
    transition: margin-right 0.3s ease, transform 0.3s ease;
    /* Animation: slide away */
}

.content {
    overflow-y: auto;
    /* padding: 0 5px 50px 5px; */
}

.content-md {
    padding: 0px 15px 0 22px;
}

.content main {
    margin-inline-start: auto;
    margin-inline-end: auto;
    max-width: var(--content-max-width);
}

.content p {
    line-height: 1.45em;
}

.content ol {
    line-height: 1.45em;
}

.content ul {
    line-height: 1.45em;
}

.content a {
    text-decoration: none;
}

.content a:hover {
    text-decoration: none;
}

.content img,
.content video {
    max-width: 100%;
}

.content .header:link,
.content .header:visited {
    color: var(--fg);
}

.content .header:link,
.content .header:visited:hover {
    text-decoration: none;
}

table {
    margin: 0 auto;
    border-collapse: collapse;
}

table td {
    padding: 3px 20px;
    border: 1px var(--table-border-color) solid;
}

table thead {
    background: var(--table-header-bg);
}

table thead td {
    font-weight: 700;
    border: none;
}

table thead th {
    padding: 3px 20px;
}

table thead tr {
    border: 1px var(--table-header-bg) solid;
}

/* Alternate background colors for rows */
table tbody tr:nth-child(2n) {
    background: var(--table-alternate-bg);
}


blockquote {
    margin: 20px 0;
    padding: 0 20px;
    color: var(--fg);
    background-color: var(--quote-bg);
    border-block-start: .1em solid var(--quote-border);
    border-block-end: .1em solid var(--quote-border);
}

.warning {
    margin: 20px;
    padding: 0 20px;
    border-inline-start: 2px solid var(--warning-border);
}

.warning:before {
    position: absolute;
    width: 3rem;
    height: 3rem;
    margin-inline-start: calc(-1.5rem - 21px);
    content: "ⓘ";
    text-align: center;
    background-color: var(--bg);
    color: var(--warning-border);
    font-weight: bold;
    font-size: 2rem;
}

blockquote .warning:before {
    background-color: var(--quote-bg);
}

kbd {
    background-color: var(--table-border-color);
    border-radius: 4px;
    border: solid 1px var(--theme-popup-border);
    box-shadow: inset 0 -1px 0 var(--theme-hover);
    display: inline-block;
    font-size: var(--code-font-size);
    font-family: var(--mono-font);
    line-height: 10px;
    padding: 4px 5px;
    vertical-align: middle;
}

:not(.footnote-definition)+.footnote-definition,
.footnote-definition+ :not(.footnote-definition) {
    margin-block-start: 2em;
}

.footnote-definition {
    font-size: 0.9em;
    margin: 0.5em 0;
}

.footnote-definition p {
    display: inline;
}

.tooltiptext {
    position: absolute;
    visibility: hidden;
    color: #fff;
    background-color: #333;
    transform: translateX(-50%);
    /* Center by moving tooltip 50% of its width left */
    left: -8px;
    /* Half of the width of the icon */
    top: -35px;
    font-size: 0.8em;
    text-align: center;
    border-radius: 6px;
    padding: 5px 8px;
    margin: 5px;
    z-index: 1000;
}

.tooltipped .tooltiptext {
    visibility: visible;
}

.chapter li.part-title {
    color: var(--sidebar-fg);
    margin: 5px 0px;
    font-weight: bold;
}

.result-no-output {
    font-style: italic;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    /* overflow: hidden; */
}

.custom-select {
    /* 设置宽度 */
    width: 270px;
    /* 设置字体样式 */
    font-family: Arial, sans-serif;
    font-size: 17px;
    /* 背景颜色和前景颜色 */
    background-color: var(--sidebar-bg);
    color: #333;
    /* 边框 */
    border: 1px solid #ccc;
    border-radius: 4px;
    /* 调整下拉箭头样式 */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-repeat: no-repeat;
    background-position: right center;
    white-space: normal;
    padding: 4px 10px;
}

/* 鼠标悬停样式 */
.custom-select:hover {
    background-color: #e6e6e6;
}

/* 选中项样式 */
.custom-select option:checked {
    background-color: #ccc;
    color: #030000;
}

.sidebar-title {
    /* padding-bottom: 5px; */
    background-color: var(--sidebar-bg);
}

.fixed-header {
    position: sticky;
    top: 0;
    background-color: #FAFAFA;
    z-index: 1;
}

.header-title {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
}

.ht-left {
    display: flex;
    align-items: center;
}

.ht-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-title svg {
    margin-right: 12px;
}

.header-title .position {
    display: flex;
    justify-content: center;
}

/* Dialog 蒙层样式 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 111;
}

/* Dialog 容器样式 */
.dialog-container {
    background-color: var(--sidebar-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* 关闭按钮样式 */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}

.config {
    /* height: 56px; */
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.config_key {
    display: inline-block;
    width: 100px;
    margin-right: 10px;
}

.config input,
.config textarea {
    display: inline-block;
    background: transparent;
    border-radius: 4px;
    width: calc(100% - 120px);
    height: 40px;
    border: 1px solid #ccc;
}

.config textarea {
    height: 100px;
}

.config input:focus,
.config textarea:focus {
    outline: none;
    /* 移除默认的选中时边框样式 */
    border-color: #007bff;
}

.config_btn {
    margin-top: 10px;
    text-align: center;
}

.config_btn span {
    margin: 0 50px;
}

.config .debug_mode {
    width: 20px;
    height: 10px;
}

.empty_main {
    padding-left: 8px;
    padding-top: 8px;
}