@font-face {
    font-family: 'Font Awesome 6 Free';
    src: url('fa-solid-900.woff2') format('woff2');
    font-display: swap;
}

:root {
    --width: 900px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-secondary: 'Fira Code', monospace;
    --font-scale: 1.25em;
    --background-color: #f5f5f5;       /* 浅灰色背景 */
    --heading-color: #111111;          /* 深黑色标题 */
    --text-color: #1a1a1a;             /* 深黑色正文 */
    --link-color: #007842;             /* 邮政绿/浓绿，用作链接 */
    --hover-color: #005f33;            /* 深绿，用作 hover 状态 */
    --visited-color: #4a6a5b;          /* 灰绿，用作已访问 */
    --main-color: #007842;             /* 主强调色，统一绿色 */
    --code-background-color: #e8e8e8;  /* 浅灰，用作代码块背景 */
    --code-color: #111111;             /* 深黑色代码文字 */
    --blockquote-color: #4a6a5b;       /* 灰绿，用作引用或线条 */
}

@media (prefers-color-scheme: dark) {
    :root {
    --background-color: #0b1f1a;
    --heading-color: #e3dfd0;
    --text-color: #dcd7c9;
    --link-color: #8cc2b3;
    --visited-color: #460101;
    --main-color: #7ba98f;
    --code-background-color: #1a2a25;
    --code-color: #e3dfd0;
    --blockquote-color: #6d8075;
    }
}

body.light-mode {
    --background-color: #f5f5f5;       /* 浅灰色背景 */
    --heading-color: #111111;          /* 深黑色标题 */
    --text-color: #1a1a1a;             /* 深黑色正文 */
    --link-color: #007842;             /* 邮政绿/浓绿，用作链接 */
    --hover-color: #005f33;            /* 深绿，用作 hover 状态 */
    --visited-color: #4a6a5b;          /* 灰绿，用作已访问 */
    --main-color: #007842;             /* 主强调色，统一绿色 */
    --code-background-color: #e8e8e8;  /* 浅灰，用作代码块背景 */
    --code-color: #111111;             /* 深黑色代码文字 */
    --blockquote-color: #4a6a5b;       /* 灰绿，用作引用或线条 */
}

body.dark-mode {
    --background-color: #0b1f1a;
    --heading-color: #e3dfd0;
    --text-color: #dcd7c9;
    --link-color: #8cc2b3;
    --hover-color: #297F37; 
    --visited-color: #512D03;
    --main-color: #7ba98f;
    --code-background-color: #1a2a25;
    --code-color: #e3dfd0;
    --blockquote-color: #6d8075;
}

#theme-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 999;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

#theme-toggle i {
  font-size: 1.2em;
  color: var(--link-color);
}

#publish-btn {
  position: fixed;
  top: 10px;
  right: 50px;
  z-index: 999;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}
#publish-btn i{
  font-size: 1.2em;
  color: var(--link-color);
}


/* 控制小图样式 */
.small-image {
    max-width: 150px;
    width: auto;
    display: inline-block;
    vertical-align: top;
    margin: 5px;
}

/* 让只包含图片的 <p> 横向排列 */
p.small-image-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.full-width-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 30px 0;
}

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

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

a {
    color: var(--link-color);
    font-family: var(--font-main);
    cursor: pointer;
    text-decoration: none;
/*    border-bottom: 1px dashed var(--main-color);*/
}

a:hover {
    background-color: var(--hover-color);
    text-decoration: none;
    color: white;
}


header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px dotted #232333;
}

.domain {
    font-size: 1em;
    font-family: Arial;
    color: var(----heading-color);
    margin: 0 auto -32px;
    letter-spacing: 0px;
    width:150px;
    background-color: var(--background-color);
    padding: 0 5px;
    text-align: center;
}

nav a {
    margin-right: 8px;
    border-bottom: none;
}

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

button {
    margin: 0;
    cursor: pointer;
}

main {
    line-height: 1.6;
}

main p{
	margin:30px 0;
}


table {
    width: 100%;
}

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

img {
    max-width: 100%;
}

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

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

header {
  border-bottom: 0.5px dashed var(--main-color);
}

footer {
    margin-top: 40px;
/*    border-top: 1px dashed var(--main-color);*/
    padding: 25px 0;
    text-align: center;
}

footer a{
    font-size: 0.75em;
    color: var(--main-color);
    border-bottom:none;
}

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

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

.inline {
    width: auto !important;
}

.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;
    margin-bottom: 10px;
}

i time {
    font-style: normal;
    opacity: 0.7;
}

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

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

ul.blog-posts li a:hover {
    color: white;
}*/

table {
    border-spacing: 0;
}

th,
td {
    padding: 6px 13px;
    font-size: 1em;
}

/* external link marker */
a[href^="http"]:where(:not([href*="knhash.in/"])):not(:has(img))::after {
    content: "↗"
}

/* Form elements */
input, button, textarea, select {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font: inherit;
}
legend {
  margin: 20px 0;
  font-weight: bold;
}
label {
  display: block;
  font-weight: bold;
}
input,
textarea {
  margin: 0 0 10px;
  padding: 5px 10px;
  color: var(--text-color);
  background: var(--accent-color);
  border: 2px solid var(--link-color);
  border-radius: 5px;
}
input {
  width: 55%;
}
textarea {
  width: 95%;
}
input[type=button], input[type=submit], input[type=reset] {
  margin: 0 0 20px;
  padding: 7px;
  font-family: var(--font-secondary);
  font-weight: bold;
  color: var(--background-color);
  background: var(--link-color);
  border-radius: 5px;
  cursor: pointer;
}
::placeholder {
  color: var(--text-color);
  opacity: 0.7;
}
      
  