/* Dark Mode */
.dark-mode {
    background-color: #393E41;
    color: white;
}

.dark-mode blockquote {
    background: #393E41;
}

.dark-mode a {
    color: #EBC3DB;
}

.dark-mode header {
    background: #393E41;
    border-bottom: 2px dotted #EBC3DB;
}

.dark-mode .article-meta,
.dark-mode .menu a {
    background: #393E41;
    color: white;
}

.dark-mode table {
    margin: auto;
    border-top: 1px solid #666;
    border-bottom: 1px solid #666;
}

.dark-mode table thead th {
    border-bottom: 1px solid #666;
}

.dark-mode th,
.dark-mode td {
    padding: 5px;
}

.dark-mode tr:nth-child(even) {
    background: #666;
}

/* Light Mode */
.light-mode {
    background-color: white;
    color: black;
}

.light-mode blockquote {
    background: #f9f9f9;
}

.light-mode a {
    color: #613DC1;
}

.light-mode header {
    background: #613DC1;
}

.light-mode header a {
    color: #f9f9f9; 
}

.light-mode .article-meta,
.light-mode .menu a {
    background: #f9f9f9;
    color: #000;
}

.light-mode table {
    margin: auto;
    border-top: 1px solid #666;
    border-bottom: 1px solid #666;
}

.light-mode table thead th {
    border-bottom: 1px solid #ddd;
}

.light-mode th,
.light-mode td {
    padding: 5px;
}

.light-mode tr:nth-child(even) {
    background: #eee;
}

/* end of light and dark mode */

button#theme-toggle {
    background: #c0c0c0;
    border: 2px solid #808080;
    color: black;
    padding: 4px 12px;
    cursor: pointer;
}

button#theme-toggle:active {
    border: 2px inset #808080;
    background: #a0a0a0;
}

body {
  max-width: 960px;
  margin: 0 0 0 0:
  padding: .2em;
  line-height: 1.5em;
}

h1 {
  line-height: 1.5em;
}

/* Table of Contents, if wanted

Add to yaml:

output:
  blogdown::html_page:
    toc: true

    */

#TableOfContents, #TOC {
  border: 1px solid #eee;
  border-radius: 5px;
}

/* Header and Footer */
.menu li { display: inline-block; }
.article-meta, .menu a {
  text-decoration: none;
  padding: 5px;
  border-radius: 5px;
  border-style: dotted;
  border-width: 1px;
  margin: 20px 0px 20px 0px;
}

.terms { font-size: .9em; }
.menu, .article-meta, footer { text-align: center; }
.title { font-size: 1.1em; }
footer a { text-decoration: none; }

.pull-left {
    float: left
}
.pull-right {
    float: right
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Adjust background at your leisure! */
header {
    position: sticky;
    top: 0;
    width: 100%;
    height: 1.75rem;
    font-size: 1rem;
    /* background: white; */
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header ul,
header ol {
    margin: 0;
    padding: 0;
    list-style: none
}

header nav {
    flex-wrap: wrap;
    padding: 0 0.5rem
}

header nav a {
    color: white;
    text-decoration: none;
}


header a {
    color: #fff;
    line-height: 1.75rem;
    padding: 0 0.5rem
}
header a:hover,
header .current a {
    color: #fff
}

/* Images, tables, misc. */
img, iframe, video {
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

main {
  hyphens: auto;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7em;
  hyphens: auto;
  display: block;
  font-size: 1.1em;
}
main a {
  font-weight: bold;
}

blockquote {

  border-left: 5px solid #ccc;
  padding: 3px 1em 3px;
}

.content-wrapper {
  padding: 20px 12px 0px 12px;
}
#foxy {
  min-width: 40px;
  float: right;
  padding: 10px;
  display: block;
}


#table-of-contents {
}

/* code block */

pre {
    border-left: 4px solid #613DC1; /* Accent border */
    border-radius: 5px; /* Rounded corners */
    padding: 0.75rem;
    margin: 0;
    overflow-x: auto;
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Preformatted Code */
pre code {
    font-size: 0.8rem;
    white-space: pre-wrap;
    border: none;
    padding: 0;
    margin: 0;
    display: block;
}

/* Inline Code */
code {
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 0.8rem;
}

/* Small devices, phones */
@media (max-width: 768px) {
    #foxy {
      min-width: 40px;
      float: center;
      padding: 10px 10px 10px 20px;
      display: block;
    }

    header nav {
      display: flex;
      flex-wrap: wrap;            /* Allow items to wrap to new lines */
      justify-content: space-between; /* Keep left/right aligned */
      align-items: center;
      width: 100%;
      background: #613DC1;
      padding: 0 0.5rem;
    }

    /* override pull aligh */
    .pull-left {
        float: left
    }
    .pull-right {
        float: left
    }

    nav a {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* 在大屏幕上应用特定样式 */
@media screen and (min-width: 900px) {
    #table-of-contents {
        position: fixed; /* 固定定位，使其悬浮在页面上 */
        top: 50%; /* 上边距为50% */
        right: 15px; /* 右边距为0，将其放在右侧 */
        transform: translateY(-50%); /* 使用transform来垂直居中 */
        background-color: #f0f0f0; /* 设置背景颜色 */
        padding: 10px; /* 添加一些内边距以增加可读性 */
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
        width: 250px; /* 设置宽度 */
        max-height: 70vh; /* 设置最大高度为视口的70% */
        overflow-y: auto; /* 添加垂直滚动条 */
    }
}

