:root { 
  color-scheme: dark; 
}

html, body { 
  margin: 0; 
}

img { 
  max-width: 100%; 
  object-fit: contain; 
}

body { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-y: scroll;
  /* 深色科技背景 */
  background-color: #0d1110;
  color: #e3e8e6;
  line-height: 1.6;
}

/* 添加科技感网格背景 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(94, 234, 212, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

body > header, main { 
  width: 40em; 
  padding: 0.5em; 
}

@media screen and (max-width: 40em) { 
  body > header, main { 
    width: calc(100% - 1em); 
  } 
}

/* 排版优化 */
pre code { 
  line-height: 1.4; 
}

h1, h2, h3, h4, h5 { 
  line-height: 1.3; 
  color: #5eead4;  /* 青色标题 */
  font-weight: 600;
}

td { 
  line-height: 1.2; 
}

body > header { 
  text-align: center;
  margin-bottom: 1em;
}

body > header > h1 { 
  margin-bottom: 0;
  font-size: 2rem;
}

body > header > p { 
  margin: 0.5em 0;
  color: #7a9188;  /* 墨绿灰副标题 */
}

nav { 
  padding: 0.5em 0;
}

nav > ul { 
  display: inline; 
  padding: 0; 
}

nav > ul > li { 
  display: inline; 
}

nav > ul > li + li:before { 
  content: " | ";
  color: #5c756b;
}

body > header > h1 > a { 
  font-size: 1.75rem; 
  text-decoration: inherit;
  color: #5eead4 !important;  /* 强制青色 */
  font-weight: 700;
}

article > header > h1 { 
  margin-bottom: 0.25em;
  border-bottom: 1px solid rgba(94, 234, 212, 0.2);
  padding-bottom: 0.3em;
}

article > header > p { 
  margin-top: 0em;
  color: #7a9188;
  font-size: 0.9em;
}

main { 
  overflow: auto;
  border-bottom: 1px solid rgba(94, 234, 212, 0.15);
}

pre { 
  overflow: auto;
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 8px;
  padding: 1em;
  background-color: #1a1f1d;  /* 深墨绿背景 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

code { 
  font-size: 1rem;
  font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
}

pre code { 
  font-size: 0.875rem;
  background-color: transparent;
  border-radius: 0;
  padding: 0;
}

th, td { 
  padding: 0.5em;
}

table, th, tr, td { 
  border-collapse: collapse;
  border: 1px solid rgba(94, 234, 212, 0.15);
  border-radius: 4px;
}

th { 
  background-color: rgba(94, 234, 212, 0.1);
  color: #5eead4;
  font-weight: 600;
}

tr:nth-child(even) { 
  background-color: rgba(94, 234, 212, 0.03);
}

/* 代码行内样式 */
code { 
  background-color: rgba(94, 234, 212, 0.1);
  color: #5eead4;
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-size: 0.9em;
}

main > ul { 
  padding-left: 0em;
}

main > ul > li { 
  list-style: none;
  margin-bottom: 2em;
  padding: 1em;
  background: rgba(26, 31, 29, 0.6);
  border: 1px solid rgba(94, 234, 212, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
}

main > ul > li:hover {
  border-color: rgba(94, 234, 212, 0.25);
  box-shadow: 0 4px 20px rgba(94, 234, 212, 0.1);
}

ul { 
  padding-left: 1.5em;
}

li { 
  margin-bottom: 0.5em;
}

/* 标题层级 */
h1 { 
  font-size: 1.8rem; 
}

h2 { 
  font-size: 1.4rem;
  margin-top: 1.5em;
}

h3 { 
  font-size: 1.2rem; 
  color: #2dd4bf;
}

h4 { 
  font-size: 1.1rem; 
}

h5 { 
  font-size: 1rem; 
}

/* 链接样式 */
:is(h1, h2, h3, h4, h5) :is(a:link, a:visited) { 
  color: inherit; 
}

a:link { 
  color: #34d399;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

a:visited { 
  color: #3cb086; 
}

a:hover {
  color: #5eead4;
  border-bottom-color: rgba(94, 234, 212, 0.5);
  text-shadow: 0 0 10px rgba(94, 234, 212, 0.3);
}

/* 导航强化 */
nav.site { 
  font-weight: 600;
  letter-spacing: 0.5px;
}

nav > strong { 
  font-weight: 700;
  color: #5eead4;
}

/* 语法高亮 - 青绿色系 */
.hljs-comment { 
  color: #7a9188;
  font-style: italic;
}

.hljs-tag, .hljs-punctuation { 
  color: #a3b5ae; 
}

.hljs-literal { 
  color: #34d399; 
}

.hljs-title.class_, .hljs-tag .hljs-name, .hljs-tag .hljs-attr { 
  color: #5eead4; 
}

.hljs-attr, .hljs-symbol, .hljs-variable, .hljs-template-variable, .hljs-link, .hljs-selector-attr, .hljs-selector-pseudo { 
  color: #2dd4bf; 
}

.hljs-keyword, .hljs-attribute, .hljs-selector-tag, .hljs-meta .hljs-keyword, .hljs-doctag, .hljs-name { 
  color: #34d399; 
}

.hljs-type, .hljs-string, .hljs-number, .hljs-quote, .hljs-template-tag, .hljs-deletion, .hljs-title, .hljs-section, .hljs-meta { 
  color: #5eead4; 
}

.hljs-regexp, .hljs-meta .hljs-string { 
  color: #6ee7b7; 
}

.hljs-title.function_, .hljs-built_in, .hljs-bullet, .hljs-code, .hljs-addition, .hljs-selector-id, .hljs-selector-class { 
  color: #2dd4bf; 
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0d1110;
}

::-webkit-scrollbar-thumb {
  background: #3c4b45;
  border-radius: 5px;
  border: 2px solid #0d1110;
}

::-webkit-scrollbar-thumb:hover {
  background: #5c756b;
}

/* 选中文字颜色 */
::selection {
  background: rgba(94, 234, 212, 0.2);
  color: #5eead4;
}