/*
  The CSS in this style tag is based off of Bear Blog's default CSS.
  https://github.com/HermanMartinus/bearblog/blob/297026a877bc2ab2b3bdfbd6b9f7961c350917dd/templates/styles/blog/default.css
  License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md
 */

:root {
  --width: 720px;
  --min-height: 100vh;
  --font-main: Verdana, sans-serif;
  --font-secondary: Verdana, sans-serif;
  --font-scale: 1em;
  --background-color: #fffcf5;
  --heading-color: #222;
  --text-color: #444;
  --link-color: #0062ff;
  --visited-color: #8b6fcb;
  --code-background-color: #eee;
  --code-color: #222;
  --blockquote-color: #222;
  --sun-color: #f5e0a2;
  --moon-color: #424f56;
  --code-border-color: #ddd;
}

:root[data-theme="dark"] {
  --background-color: linear-gradient(#424f56, #928660);
  --heading-color: #fff;
  --text-color: #fff;
  --link-color: #64ccff;
  --visited-color: #8b6fcb;
  --code-background-color: #000;
  --code-color: #ddd;
  --blockquote-color: #ccc;
  --code-border-color: #ffe183;
}

body {
  font-family: var(--font-secondary);
  font-size: var(--font-scale);
  margin: auto;
  padding: 20px;
  max-width: var(--width);
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  color: var(--text-color);
  min-height: var(--min-height);
  background: var(--background-color);
  transition: color 0.5s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-main);
  color: var(--heading-color);
}

a {
  color: var(--link-color);
  cursor: pointer;
  text-decoration: none;
}

.prose a {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration: underline;
}

nav a {
  margin-right: 12px;
}

nav a.active {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

strong,
b {
  color: var(--heading-color);
}

button {
  margin: 0;
  cursor: pointer;
}

time {
  font-family: monospace;
  font-style: normal;
  font-size: 15px;
}

main {
  line-height: 1.6;
}

table {
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px dashed;
}

img {
  max-width: 100%;
}

blockquote {
  border-left: 1px solid #999;
  color: var(--code-color);
  padding-left: 20px;
  font-style: italic;
}

footer {
  padding: 25px 0;
  text-align: center;
}

.title:hover {
  text-decoration: none;
}

.title h1 {
  font-size: 1.5em;
}

.inline {
  width: auto !important;
}

:not(.astro-code) > code {
  font-family: monospace;
  padding: 2px;
  background-color: var(--code-background-color);
  color: var(--code-color);
  border-radius: 3px;
}

/* 不在 .astro-code 下的 highlight 和 code */
.highlight,
.code {
  padding: 1px 15px;
  background-color: var(--code-background-color);
  color: var(--code-color);
  border-radius: 3px;
  margin-block-start: 1em;
  margin-block-end: 1em;
  overflow-x: auto;
}

/* blog post list */
ul.blog-posts {
  list-style-type: none;
  padding: unset;
}

ul.blog-posts li {
  display: flex;
}

ul.blog-posts li span {
  flex: 0 0 130px;
}

ul.blog-posts li a:visited {
  color: var(--visited-color);
}

#theme-btn {
  color: var(--moon-color);
  cursor: pointer;
}
html[data-theme="dark"] #theme-btn {
  color: var(--sun-color);
}

.theme-icon {
  transition: transform 0.5s ease;
}
.theme-icon:hover {
  transform: rotate(-0.1turn);
  color: var(--link-color);
}

#sun-svg,
html[data-theme="dark"] #moon-svg {
  display: none;
}
#moon-svg,
html[data-theme="dark"] #sun-svg {
  display: block;
}

/* shiki dark mode */
html[data-theme="dark"] .astro-code,
html[data-theme="dark"] .astro-code span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
  /* 可选，用于定义字体样式 */
  /* font-style: var(--shiki-dark-font-style) !important;
  font-weight: var(--shiki-dark-font-weight) !important;
  text-decoration: var(--shiki-dark-text-decoration) !important; */
}

pre.astro-code {
  border: 1px solid var(--code-border-color);
  border-radius: 6px;
  padding: 12px;
}
