@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");

/* 基础重置与全局样式（精简重复定义） */
* {
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-text-size-adjust: none;
  -webkit-touch-callout: none;
  box-sizing: border-box;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  color: #FFF;
  font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  overflow-x: hidden;
  background: radial-gradient(ellipse at top center, #0fdfff3e 0%, rgba(0,0,0,0) 60%) center top / 100% 40vh no-repeat, #121826;
}

/* 加载状态 */
body:not(.ready) {
  overflow: hidden;
}
body:not(.ready) [data-cloak],
body:not(.ready) .app-nav,
body:not(.ready) > nav {
  display: none;
}
div#app {
  font-size: 30px;
  font-weight: lighter;
  margin: 40vh auto;
  text-align: center;
  color: #FFF;
}
div#app:empty::before {
  content: 'Loading...';
  color: #66BAF5;
}

/* 进度条 */
.progress {
  background-color: var(--theme-color, #66BAF5);
  height: 3px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transition: width 0.2s, opacity 0.4s;
  width: 0%;
  z-index: 999999;
  border-radius: 0 3px 3px 0;
}

.search {
  position: relative;
  margin: 16px auto 24px;
  max-width: 600px;
  width: 100%;
  border-bottom: 1px solid #2A3A4E !important;
}
.search input {
  border-radius: 12px;
  background-color: #1E2634;
  color: #FFF;
  border: 1px solid #38465E;
  padding: 8px 14px;
  /*transition: all 0.3s;*/
  width: 100%;
}
.search input:focus {
  border-color: #66BAF5 !important;
  box-shadow: 0 0 0 2px rgba(102, 186, 245, 0.2) !important;
  outline: none !important;
}
.search a:hover {
  color: #88C8FA;
}
.search .search-keyword {
  color: #66BAF5;
  font-style: normal;
  font-weight: bold;
}

/* 搜索框清除按钮（精简冗余样式） */
.clear-button.show {
  background: transparent !important;
  border: none !important;
  padding: 4px !important;
  border-radius: 8px !important;
  transition: background 0.2s ease !important;
}
.clear-button.show svg circle {
  fill: #38465E !important;
  transition: fill 0.2s ease !important;
}
.clear-button.show svg path {
  stroke: #FFF !important;
  transition: stroke 0.2s ease !important;
}
.clear-button.show:hover svg circle {
  fill: #66BAF5 !important;
}
.clear-button.show:hover svg path {
  stroke: #FFFFFF !important;
}

/* 通用元素样式（精简重复定义） */
img {
  max-width: 100%;
  border-radius: 12px;
}
img.emoji, span.emoji {
  vertical-align: middle;
  height: 1.2em;
  font-size: 1.2em;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
a[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}
kbd {
  border: 1px solid #38465E;
  border-radius: 8px;
  display: inline-block;
  font-size: 12px !important;
  line-height: 12px;
  margin-bottom: 3px;
  padding: 5px 8px;
  vertical-align: middle;
  background-color: #1E2634;
  color: #FFF;
}
li input[type='checkbox'] {
  margin: 0 0.2em 0.25em 0;
  vertical-align: middle;
}

/* 导航栏（精简重复样式） */
.app-nav {
  position: absolute;
  top: 25px;
  right: 0;
  margin-right: 60px;
  text-align: right;
  z-index: 10;
}
.app-nav.no-badge {
  margin-right: 25px;
}
.app-nav p {
  margin: 0;
}
.app-nav > a, .app-nav li {
  display: inline-block;
  margin: 0 1rem;
  padding: 5px 0;
  list-style: none;
  position: relative;
  cursor: pointer;
}
.app-nav a {
  color: #D0D8F0;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.3s;
}
.app-nav a:hover {
  color: var(--theme-color, #88C8FA);
}
.app-nav a.active {
  border-bottom: 2px solid var(--theme-color, #66BAF5);
  color: var(--theme-color, #66BAF5);
}
.app-nav li ul {
  background-color: #1E2634;
  border: 1px solid #38465E;
  border-radius: 12px;
  box-sizing: border-box;
  display: none;
  max-height: calc(100vh - 61px);
  overflow-y: auto;
  padding: 12px 0;
  position: absolute;
  right: -15px;
  top: 100%;
  text-align: left;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.app-nav li ul li {
  display: block;
  font-size: 14px;
  line-height: 1rem;
  margin: 8px 18px;
  white-space: nowrap;
}
.app-nav li ul a {
  display: block;
  font-size: inherit;
  margin: 0;
  padding: 0;
}
.app-nav li ul a.active {
  border-bottom: 0;
  color: #88C8FA;
}
.app-nav li:hover ul {
  display: block;
}

/* GitHub 角标 */
.github-corner {
  border-bottom: 0;
  position: fixed;
  right: 0;
  top: 0;
  text-decoration: none;
  z-index: 1;
}
.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}
.github-corner svg {
  color: #121826;
  fill: var(--theme-color, #66BAF5);
  height: 80px;
  width: 80px;
  border-radius: 0 0 0 12px;
}

/* 主体布局（精简重复定义） */
main {
  display: block;
  position: relative;
  width: 100vw;
  height: 100%;
  z-index: 0;
}
main.hidden {
  display: none;
}
.anchor {
  display: inline-block;
  text-decoration: none;
  transition: all 0.3s;
}
.anchor span {
  color: #FFF;
}
.anchor:hover {
  text-decoration: underline;
  color: #88C8FA;
}

/* 侧边栏：核心修改 - Flex布局 + 搜索框置顶（标题在下方） */
.sidebar {
  display: flex; /* 启用Flex实现内部排序 */
  flex-direction: column; /* 垂直排列 */
  border-right: 1px solid #38465E;
  overflow-y: auto;
  padding: 40px 16px 0;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  transition: transform 250ms ease-out;
  width: 300px;
  z-index: 20;
  background-color: #181F2C;
  border-top-right-radius: 24px;
  border-bottom-right-radius: 24px;
  margin: 16px 0;
  box-shadow: 4px 0 16px rgba(0,0,0,0.1);
}
/* 侧边栏标题：移到搜索框下方，调整间距 */
.sidebar > h1 {
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: #FFF;
  order: 0; /* 标题排序在搜索框之后 */
  margin-top: 0; /* 取消顶部间距，紧贴搜索框 */
}
.sidebar > h1 a {
  color: #66BAF5;
  text-decoration: none;
  font-weight: bold;
}
.sidebar > h1 .app-nav {
  display: block;
  position: static;
}

/* 侧边栏导航（精简重复样式） */
.sidebar .sidebar-nav {
  line-height: 2em;
  padding-bottom: 40px;
  order: 1;
}
.sidebar li {
  margin: 6px 0;
  list-style: none;
}
.sidebar li.collapse .app-sub-sidebar {
  display: none;
}
.sidebar ul {
  margin: 0 0 0 15px;
  padding: 0;
}
.sidebar li > p {
  font-weight: 700;
  margin: 0;
  color: #D0D8F0;
  padding: 0 16px;
}
.sidebar ul li a {
  display: block;
  color: #F0F5FFFF;
  font-size: 14px;
  font-weight: normal;
  padding: 4px 16px;
  border-radius: 8px;
  margin: 2px 8px;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar ul li a:hover {
  background-color: #283448;
  color: #FFF;
  text-decoration: none;
}
.sidebar ul li ul {
  padding-left: 20px;
}
.sidebar ul li.active > a {
  background-color: rgba(102, 186, 245, 0.25);
  border-right: 2px solid var(--theme-color, #66BAF5);
  color: var(--theme-color, #66BAF5);
  font-weight: 600;
}
.app-sub-sidebar li::before {
  content: '-';
  padding-right: 4px;
  float: left;
  color: #F0F5FFFF;
}
/* 侧边栏滚动条 */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(102, 186, 245, 0.4);
  border-radius: 3px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(102, 186, 245, 0.6);
}
.sidebar:hover::-webkit-scrollbar-track {
  background: rgba(29, 41, 60, 0.3);
  border-radius: 3px;
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
  background-color: #181F2C;
  border: 0;
  outline: none;
  padding: 10px;
  position: absolute;
  bottom: 0;
  left: 0;
  text-align: center;
  transition: opacity 0.3s;
  width: 284px;
  z-index: 30;
  cursor: pointer;
  border-bottom-right-radius: 24px;
}
.sidebar-toggle:hover .sidebar-toggle-button {
  opacity: 0.7;
}
.sidebar-toggle span {
  background-color: var(--theme-color, #66BAF5);
  display: block;
  margin-bottom: 4px;
  width: 16px;
  height: 2px;
  border-radius: 1px;
}

.sidebar-nav ul:not(.app-sub-sidebar)>li:not(.file)::before {
    border-right: 1px solid #fff; /* 浅白色 */
    border-bottom: 1px solid #fff;
}
.sidebar-nav ul:not(.app-sub-sidebar)>li.open::before {
    border-color: var(--theme-color, #60a5fa); /* 展开时箭头变亮/变色 */
}
.sidebar-nav ul:not(.app-sub-sidebar)>li:not(.file)::before {
    width: 7px;
    height: 7px;
    border-width: 2px; 
}

/* 内容区域 */
.content {
  padding-top: 60px;
  position: absolute;
  top: 20px;
  right: 0;
  bottom: 0;
  left: 300px;
  transition: left 250ms ease;
  padding: 32px;
}

/* Markdown 内容（精简重复样式） */
.markdown-section {
  margin: 0 auto;
  max-width: 1000px;
  padding: 30px 32px 40px;
  position: relative;
  background-color: #181F2C4A;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.markdown-section > * {
  box-sizing: border-box;
  font-size: inherit;
}
.markdown-section > :first-child {
  margin-top: 0 !important;
}
/* 搜索框在标题下方的兼容（页面内标题） */
.markdown-section h1 + .search,
.markdown-section h2 + .search,
.markdown-section h3 + .search {
  margin-top: 16px;
  margin-bottom: 24px;
  order: 1; /* 页面内搜索框在标题下方 */
}

/* Markdown 通用样式 */
.markdown-section hr {
  border: none;
  border-bottom: 1px solid #38465E;
  margin: 2em 0;
}
.markdown-section iframe {
  border: 1px solid #38465E;
  width: 1px;
  min-width: 100%;
  border-radius: 12px;
  margin: 1em 0;
}
.markdown-section table {
  border-collapse: separate;
  border-spacing: 0;
  /*display: block;*/
  margin-bottom: 1rem;
  overflow: auto;
  width: 100%;
  border-radius: 12px;
  /*background-color: #1E2634;*/
  /*border: 1px solid #38465E;*/
}
.markdown-section th {
  border: 1px solid #38465E;
  font-weight: bold;
  padding: 12px 16px;
  background-color: #283448;
  color: #FFF;
}
.markdown-section td {
  border: 1px solid #38465E;
  padding: 12px 16px;
  color: #F0F5FFFF;
}
.markdown-section tr:first-child th:first-child { border-top-left-radius: 12px; }
.markdown-section tr:first-child th:last-child { border-top-right-radius: 12px; }
.markdown-section tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.markdown-section tr:last-child td:last-child { border-bottom-right-radius: 12px; }
.markdown-section tr:nth-child(2n) {
  background-color: #283448;
}

/* Markdown 提示/警告框 */
.markdown-section p.tip {
  background-color: #261c29;
  border-radius: 12px;
  border-left: 4px solid #f65353;
  margin: 2em 0;
  padding: 16px 24px;
  position: relative;
  color: #FFF;
}
.markdown-section p.tip:before {
  background-color: #f65353;
  border-radius: 50%;
  color: #261c29;
  content: '!';
  font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  left: -12px;
  line-height: 20px;
  position: absolute;
  height: 20px;
  width: 20px;
  text-align: center;
  top: 20px;
}
.markdown-section p.tip code { background-color: #283448; }
.markdown-section p.tip em { color: #D0D8F0; }
.markdown-section p.warn {
  background: rgba(102, 186, 245, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  border-left: 4px solid var(--theme-color, #66BAF5);
  color: #FFF;
}
.markdown-section ul.task-list > li { list-style-type: none; }

/* Markdown 标题/文字样式 */
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section strong {
  color: #FFF;
  font-weight: 600;
}
.markdown-section h1 {
  font-size: 2rem;
  margin: 0 0 1rem;
  padding-bottom: 12px;
  border-bottom: 1px solid #38465E;
}
.markdown-section h2 {
  font-size: 1.6rem;
  margin: 45px 0 0.8rem;
  padding-bottom: 8px;
  border-bottom: 1px solid #38465E;
}
.markdown-section h3 { font-size: 1.3rem; margin: 40px 0 0.6rem; }
.markdown-section h4 { font-size: 1.25rem; }
.markdown-section h5 { font-size: 1rem; }
.markdown-section h6 { color: #F0F5FFFF; font-size: 1rem; }

.markdown-section a {
  color: var(--theme-color, #66BAF5);
  font-weight: 600;
  text-decoration: none;
}
.markdown-section a:hover {
  color: #88C8FA;
  text-decoration: underline;
}
.markdown-section figure,
.markdown-section p {
  margin: 0.1em 0;
}
.markdown-section p,
.markdown-section ul,
.markdown-section ol {
  line-height: 1.6rem;
  word-spacing: 0.05rem;
  color: #F0F5FFFF;
}
.markdown-section ul,
.markdown-section ol {
  padding-left: 1.5rem;
}
.markdown-section blockquote {
  border-left: 4px solid var(--theme-color, #66BAF5);
  color: #D0D8F0;
  margin: 2em 0;
  padding: 16px 24px;
  background-color: #1E2634;
  border-radius: 0 12px 12px 0;
}
.markdown-section blockquote p {
  font-weight: 600;
  margin-left: 0;
  color: #FFF;
}
.markdown-section em { color: #F0F5FFFF; }

/* Markdown 代码样式 */
.markdown-section code,
.markdown-section pre,
.markdown-section output::after {
  font-family: 'Roboto Mono', Monaco, courier, monospace;
}
.markdown-section code,
.markdown-section pre {
  background-color: #1E2634;
  border: 1px solid #38465E;
}
.markdown-section pre,
.markdown-section output {
  margin: 1.2em 0;
  position: relative;
  border-radius: 12px;
}
.markdown-section pre > code,
.markdown-section output {
  border-radius: 12px;
  display: block;
  -moz-osx-font-smoothing: initial;
  -webkit-font-smoothing: initial;
}
.markdown-section code {
  border-radius: 8px;
  color: #ECF5FF;
  margin: 0 2px;
  padding: 3px 5px;
  white-space: pre-wrap;
}
.markdown-section > :not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) code {
  font-size: 0.8rem;
}
.markdown-section pre {
  padding: 20px;
  line-height: 1.5rem;
  overflow: auto;
  word-wrap: normal;
}
.markdown-section pre > code {
  color: #ECF5FF;
  font-size: 0.8rem;
  padding: 0;
  line-height: inherit;
  margin: 0;
  max-width: inherit;
  overflow: inherit;
  white-space: inherit;
  border: none;
}
.markdown-section output {
  padding: 1.7rem 1.4rem;
  border: 1px dotted #38465E;
  background-color: #1E2634;
}
.markdown-section output > :first-child { margin-top: 0; }
.markdown-section output > :last-child { margin-bottom: 0; }
.markdown-section pre::after,
.markdown-section output::after {
  color: #F0F5FFFF;
  font-size: 0.6rem;
  font-weight: 600;
  height: 15px;
  line-height: 15px;
  padding: 5px 10px 0;
  position: absolute;
  right: 0;
  text-align: right;
  top: 0;
  content: attr(data-lang);
}

/* 代码高亮（精简重复定义） */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #B0D0FF; }
.token.namespace { opacity: 0.8; }
.token.boolean, .token.number { color: #FFC8B0; }
.token.punctuation { color: #ECF5FF; }
.token.property { color: #FFF8B0; }
.token.tag { color: #B0E0FF; }
.token.string, .token.entity, .token.url, .language-css .token.string, .style .token.string, .token.attr-value, .token.control, .token.directive, .token.unit { color: var(--theme-color, #B0FFEE); }
.token.selector, .token.attr-name { color: #D0B0FF; }
.token.keyword, .token.function, .token.important { color: #FFB0C8; }
.token.statement, .token.regex, .token.atrule, .token.placeholder, .token.variable { color: #B0E0FF; }
.token.deleted { text-decoration: line-through; }
.token.inserted { border-bottom: 1px dotted #B0E0FF; text-decoration: none; }
.token.italic { font-style: italic; }
.token.important, .token.bold { font-weight: bold; }
.token.entity { cursor: help; }
code .token {
  -moz-osx-font-smoothing: initial;
  -webkit-font-smoothing: initial;
  min-height: 1.5rem;
  position: relative;
  left: auto;
}

/* 响应式与关闭状态 */
body.sticky .sidebar,
body.sticky .sidebar-toggle {
  position: fixed;
}
body.close .sidebar { transform: translateX(-300px); }
body.close .sidebar-toggle { width: auto; }
body.close .content { left: 0; }

/* 动画 */
@keyframes octocat-wave {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(-25deg); }
  40%, 80% { transform: rotate(10deg); }
}

/* 封面页（精简重复样式） */
section.cover {
  position: relative;
  align-items: center;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 100vh;
  width: 100%;
  display: none;
  background-color: #121826;
}
section.cover.show { display: flex; }
section.cover.has-mask .mask {
  background-color: #121826;
  opacity: 0.9;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}
section.cover .cover-main {
  flex: 1;
  margin: 32px 16px;
  text-align: center;
  position: relative;
  background-color: #181F2C;
  border-radius: 24px;
  padding: 48px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
section.cover a {
  color: var(--theme-color, #66BAF5);
  text-decoration: none;
}
section.cover a:hover {
  text-decoration: underline;
  color: #88C8FA;
}
section.cover p {
  line-height: 1.5rem;
  margin: 1em 0;
  color: #D0D8F0;
}
section.cover h1 {
  color: #FFF;
  font-size: 2.5rem;
  font-weight: 600;
  margin: 0.625rem 0 2.5rem;
  position: relative;
  text-align: center;
}
section.cover h1 a {
  display: block;
  color: var(--theme-color, #66BAF5);
}
section.cover h1 small {
  bottom: -0.4375rem;
  font-size: 1rem;
  position: absolute;
  color: #F0F5FFFF;
}
section.cover blockquote {
  font-size: 1.5rem;
  text-align: center;
  color: #FFF;
}
section.cover ul {
  line-height: 1.8;
  list-style-type: none;
  margin: 1em auto;
  max-width: 500px;
  padding: 0;
  color: #D0D8F0;
}
section.cover .cover-main > p:last-child a {
  border: 1px solid var(--theme-color, #66BAF5);
  border-radius: 24px;
  box-sizing: border-box;
  color: var(--theme-color, #66BAF5);
  display: inline-block;
  font-size: 1.05rem;
  letter-spacing: 0.1rem;
  margin: 0.5rem 1rem;
  padding: 0.75em 2rem;
  text-decoration: none;
  transition: all 0.15s ease;
  background-color: transparent;
}
section.cover .cover-main > p:last-child a:last-child {
  background-color: var(--theme-color, #66BAF5);
  color: #121826;
  font-weight: 600;
}
section.cover .cover-main > p:last-child a:last-child:hover {
  background-color: #88C8FA;
  opacity: 0.9;
}
section.cover .cover-main > p:last-child a:hover {
  color: #88C8FA;
  border-color: #88C8FA;
}
section.cover blockquote > p > a {
  border-bottom: 2px solid var(--theme-color, #66BAF5);
  transition: color 0.3s;
}
section.cover blockquote > p > a:hover {
  color: var(--theme-color, #88C8FA);
}

/* 媒体查询（精简重复样式） */
@media print {
  .github-corner, .sidebar-toggle, .sidebar, .app-nav { display: none; }
  .markdown-section { background: none; box-shadow: none; border-radius: 0; }
}
@media screen and (max-width: 768px) {
  .github-corner, .sidebar-toggle, .sidebar { position: fixed; }
  .app-nav { margin-top: 16px; }
  .app-nav li ul { top: 30px; }
  main { height: auto; min-height: 100vh; overflow-x: hidden; }
  .sidebar {
    left: -300px;
    transition: transform 250ms ease-out;
    margin: 0;
    border-radius: 0;
  }
  .content {
    left: 0;
    max-width: 100vw;
    position: static;
    padding: 20px;
    transition: transform 250ms ease;
  }
  .markdown-section { border-radius: 16px; padding: 24px; }
  .app-nav, .github-corner { transition: transform 250ms ease-out; }
  .sidebar-toggle {
    background-color: #181F2C;
    width: auto;
    padding: 30px 30px 10px 10px;
    border-radius: 0;
  }
  body.close .sidebar { transform: translateX(300px); }
  body.close .sidebar-toggle {
    background-color: #181F2C;
    transition: 1s background-color;
    width: 284px;
    padding: 10px;
  }
  body.close .content { transform: translateX(300px); }
  body.close .app-nav, body.close .github-corner { display: none; }
  .github-corner:hover .octo-arm { animation: none; }
  .github-corner .octo-arm { animation: octocat-wave 560ms ease-in-out; }
}