:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #a09f9f;
  --accent: #ed5565;
  --accent-strong: #da4453;
  --nav-accent: #e78170;
  --nav-bg: #2a2a2a;
  --border: #d9d9d9;
  --soft: #f6f6f6;
  --shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  --nav-width: 170px;
  --main-pad: 43px;
  --cover-width: calc((100vw - var(--nav-width)) * 0.25 + var(--main-pad));
  --body-width: calc((100vw - var(--nav-width)) * 0.5833333 - var(--main-pad));
  --font-body: Georgia, "lucida grande", "lucida sans unicode", lucida, helvetica,
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font: 14px/1.7 var(--font-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  padding-left: var(--nav-width);
}

a {
  color: #333;
  text-decoration: none;
}

a:hover,
a:active {
  color: #ca0002;
}

pre,
code {
  background: #f3f3f3;
  font-family: var(--font-mono);
  font-size: 14px;
}

code {
  padding: 2px 4px;
  color: #b94a48;
}

pre {
  padding: 8px;
  overflow: auto;
  max-height: 400px;
}

pre code {
  padding: 0;
  color: #444;
}

.highlight {
  position: relative;
  border: 1px solid #d7dde6;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.highlight::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #4a90e2;
}

.highlight > div {
  max-height: 400px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.highlight > div:hover {
  scrollbar-color: rgba(120, 130, 145, 0.6) transparent;
}

.highlight > div::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.highlight > div::-webkit-scrollbar-track {
  background: transparent;
}

.highlight > div::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 8px;
}

.highlight > div:hover::-webkit-scrollbar-thumb {
  background-color: rgba(120, 130, 145, 0.6);
}

.highlight pre {
  margin: 0;
  background: #fff !important;
  max-height: none;
  overflow: visible;
  white-space: pre;
  padding: 6px 12px 8px;
}

.highlight code {
  background: transparent !important;
}

.highlight code span {
  white-space: pre;
}

.highlight table {
  width: 100%;
  border-collapse: collapse;
}

.highlight td {
  padding: 0;
  border: 0;
}

.highlight table td:first-child {
  background: #f2f6ff;
  border-right: 1px solid #d6e2f3;
  width: 1%;
}

.highlight table td:first-child pre {
  padding: 6px 0 8px;
  background: #f2f6ff !important;
  text-align: right;
  overflow: visible;
}

.highlight table td:first-child code,
.highlight table td:first-child code span {
  color: #7f8a98 !important;
}

.highlight table td:first-child code span {
  display: block;
  padding: 0 8px !important;
  margin: 0 !important;
  line-height: 1.8;
}

.highlight table td:last-child pre {
  padding: 6px 0 8px;
}

.highlight table td:last-child code > span {
  display: flex !important;
  width: 100%;
  box-sizing: border-box;
  padding: 0 12px;
  line-height: 1.8;
}

.highlight table td:last-child code > span:nth-child(2n) {
  background: #f7f9fc;
}

.highlight table td:first-child code span:nth-child(2n) {
  background: #eaf1ff;
}

.highlight .lnt {
  display: block;
}

input,
textarea,
select {
  padding: 5px;
  border: 1px solid #e9e9e9;
  width: 100%;
  border-radius: 2px;
  background: #fff;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
  border: 1px solid #008deb;
  box-shadow: 0 0 8px rgba(82, 168, 236, 0.6);
}

textarea {
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
}

::selection {
  color: #fff;
  background: #43a047;
}

blockquote {
  margin: 1em 0;
  padding: 5px 15px;
  border-left: 4px solid #d8d8d8;
  background: #f6f6f6;
  color: #666;
}

table {
  width: 100%;
  border: 1px solid #ddd;
  border-collapse: collapse;
}

table th,
table td {
  padding: 5px 10px;
  border: 1px solid #eee;
}

table th {
  background: #f3f3f3;
}

img {
  border: 0;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

#wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--nav-width);
  background: var(--nav-bg);
  z-index: 2000;
}

#nav .nav-menu a {
  display: flex;
  align-items: center;
  height: 45px;
  padding: 0 18px;
  line-height: 45px;
  width: 100%;
  color: #fff;
  background: none;
  transition: background 0.3s, color 0.3s;
  font-size: 16px;
}

#nav .nav-menu a i {
  font-family: FontAwesome;
  font-style: normal;
  font-size: 18px;
  margin-right: 10px;
  transition: color 0.3s, transform 0.3s;
  width: 24px;
  text-align: center;
}

#nav .nav-menu a span {
  padding-left: 5px;
}

#nav .nav-menu a:hover,
#nav .nav-menu a:focus {
  background: #666;
  color: #fff;
}

#nav .nav-menu a:hover i,
#nav .nav-menu a:focus i {
  color: var(--nav-accent);
  transform: none;
}

#nav .nav-menu a.current,
#nav .nav-menu a.current:hover {
  background: var(--nav-accent);
  color: #fff;
  pointer-events: none;
}

#nav .nav-menu a.current i {
  color: #fff;
  transform: none;
}

#nav .nav-menu a.site-name {
  display: none;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-user {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1400;
  height: 43px;
  line-height: 43px;
  padding-right: 10px;
}

.nav-user a {
  display: inline-block;
  margin-right: 10px;
  height: 43px;
  line-height: 43px;
}

.nav-user a.btn-search {
  display: none;
}

.nav-user i {
  color: #666;
}

#cover {
  position: fixed;
  left: var(--nav-width);
  top: 0;
  width: var(--cover-width);
  height: 100vh;
  background: var(--soft);
  overflow: hidden;
  z-index: 1;
}

#cover .cover-img {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

#cover .cover-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.45));
}

#cover .cover-info {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 30px 0;
  color: #fff;
  text-align: center;
  z-index: 2;
}

#cover .cover-info h3 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: 1px;
}

#cover .cover-info p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#body {
  margin-left: var(--cover-width);
  width: var(--body-width);
  max-width: 1000px;
  position: relative;
  z-index: 5;
  background: #fff;
  flex: 1;
}

.main {
  padding-left: 0;
}

.main-inner {
  padding-top: 45px;
  padding-left: 32px;
}

.page-title {
  position: fixed;
  top: 0;
  left: var(--nav-width);
  margin-left: var(--cover-width);
  height: 45px;
  border-bottom: 2px solid var(--border);
  background: #fff;
  z-index: 10;
  width: var(--body-width);
  max-width: 1000px;
}

.page-title ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 20px;
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
}

.page-title li {
  display: inline-flex;
  align-items: center;
}

.page-title li.search-query {
  display: none;
}

body.search-has-query .page-title li.search-query {
  display: inline-flex;
}

.page-title li a {
  display: inline-flex;
  align-items: center;
  height: 43px;
  padding: 0 15px;
  color: #999;
  transition: background 0.2s, color 0.2s;
}

.page-title li a:hover {
  background: #eee;
  color: #555;
}

.page-title li.active {
  border-bottom: 2px solid #555;
  margin-bottom: -2px;
}

.page-title li.page-search {
  margin-left: auto;
  display: flex;
  align-items: center;
}

#search {
  position: relative;
  height: 32px;
  line-height: 32px;
  margin-top: 0;
}

#search .text {
  height: 32px;
  line-height: 32px;
  padding: 0 34px 0 14px;
  border-radius: 15px;
  border: 1px solid var(--border);
  outline: none;
  width: 160px;
}

#search .submit {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

#search .submit i {
  font-size: 14px;
  color: #888;
}

.section-head h1 {
  font-size: 20px;
  margin: 0 0 6px;
}

.section-head p {
  margin: 0 0 20px;
  color: var(--muted);
}

.post {
  padding: 17px 15px;
  border-bottom: 1px dashed var(--border);
  animation: fadeUp 0.6s ease both;
}

.post::after {
  content: "";
  display: block;
  clear: both;
}

.post:last-child {
  border-bottom: none;
}

.post-header {
  margin: 0 0 2px;
  line-height: 28px;
  font-size: 18px;
}

.post-title {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
}

.post-title:hover {
  color: var(--accent-strong);
}

.post-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.post-meta a {
  color: var(--muted);
}

.post-meta a:hover {
  color: var(--accent-strong);
}

.post-meta em {
  color: #666;
  margin: 0 6px;
}

.post-meta .meta-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.post-meta .meta-tag {
  font-size: 12px;
}

.post-cover {
  float: right;
  width: 100px;
  height: 96px;
  margin-left: 15px;
}

.post-cover a {
  display: block;
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: #262a35;
}

.post-desc {
  color: #666;
  font-size: 14px;
}

.post-single .post-title {
  font-size: 26px;
}

.post-content {
  margin: 20px 0 0;
  padding-bottom: 10px;
  font-size: 16px;
  color: #666;
  line-height: 1.8;
}

.post-content p {
  text-indent: 2em;
  margin: 0.35em 0;
}

.post-content h2 {
  font-size: 1.2em;
  margin-bottom: -0.3em;
}

.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-size: 1em;
  padding-left: 1em;
  margin-top: 0.3em;
  margin-bottom: -0.3em;
}

.post-content a {
  color: var(--accent);
}

.post-content img {
  max-width: 100%;
  display: block;
  margin-bottom: 0.5em;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.avatar,
img.avatar {
  border-radius: 50%;
  vertical-align: middle;
}

.page-navigator {
  list-style: none;
  margin: 15px 0;
  padding: 0;
  text-align: center;
}

.page-navigator li {
  display: inline-block;
  margin: 0 4px;
}

.page-navigator a {
  display: inline-block;
  padding: 0 10px;
  height: 30px;
  line-height: 30px;
  border-radius: 14px;
}

.page-navigator a:hover,
.page-navigator .current a {
  background: #eee;
  color: #444;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.tag-list a {
  padding: 3px 10px;
  background: #eee;
  border-radius: 14px;
  font-size: 13px;
}

.tag-list a:hover {
  background: var(--accent);
  color: #fff;
}

.tag-list-large a {
  font-size: 15px;
  padding: 4px 12px;
}

.taxonomy-head {
  margin: 14px 0 16px;
}

.taxonomy-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.taxonomy-cards {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.taxonomy-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.taxonomy-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.taxonomy-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.taxonomy-card-title:hover {
  color: var(--accent-strong);
}

.taxonomy-card-count {
  font-size: 12px;
  color: #777;
}

.taxonomy-card-desc {
  margin: 0;
  padding: 10px 16px;
  color: #666;
  font-size: 14px;
}

.taxonomy-card-list {
  list-style: none;
  margin: 0;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.taxonomy-card-list a {
  display: block;
  font-size: 14px;
  color: var(--accent);
  line-height: 1.9;
}

.taxonomy-card-list a:hover {
  color: var(--accent-strong);
}

.archive-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 18px;
}

.archive-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.archive-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.archive-card-count {
  font-size: 12px;
  color: #777;
}

.archive-card-list {
  list-style: none;
  margin: 0;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-card-list li {
  display: flex;
  flex-direction: column;
}

.archive-item-title {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.archive-item-title:hover {
  color: var(--accent-strong);
}

.archive-item-date {
  font-size: 12px;
  color: #999;
}

.footer {
  position: relative;
  padding: 0 0 10px 0;
  width: 100%;
  margin-left: 0;
  max-width: none;
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: #999;
  line-height: 20px;
}

.footer-inner {
  margin-left: 0;
  padding-top: 0;
  padding-left: 20px;
  width: var(--body-width);
  max-width: 1000px;
  margin-left: var(--cover-width);
}

.footer a {
  color: #adadad;
}

.fixed-btn {
  display: inline-block;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 43px;
  line-height: 43px;
}

.fixed-btn a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  border-radius: 40%;
  border: none;
  background: transparent;
  color: #666;
  font-size: 16px;
}

.fixed-btn a:hover {
  color: #000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.night-mode {
  --bg: #3f3f3f;
  --text: #c7c7c7;
  --muted: #b1b1b1;
  --border: #2f2f2f;
  background: #3f3f3f;
}

body.night-mode #body,
body.night-mode .page-title,
body.night-mode .fixed-btn {
  background: #3f3f3f;
}

body.night-mode .page-title li a:hover {
  background: #2f2f2f;
  color: #b1b1b1;
}

body.night-mode input,
body.night-mode textarea {
  background: #555;
  color: #b1b1b1;
  outline: none;
  box-shadow: none;
}

body.night-mode .post-content,
body.night-mode .post-content p,
body.night-mode .post-desc {
  color: #999;
}

body.night-mode .post-content a {
  color: #3dbcf5;
}

body.night-mode .post-content a:hover {
  color: #4094c7;
}

body.night-mode .nav-user i {
  color: #c7c7c7;
}

body.night-mode code {
  background: #363b44;
}

body.night-mode pre {
  background: #1f242b;
}

body.night-mode .highlight {
  border-color: #3a404a;
  background: #1f242b;
}

body.night-mode .highlight::before {
  background: #3f7edb;
}

body.night-mode .highlight table td:first-child {
  background: #232a33;
  border-right-color: #323a45;
}

body.night-mode .highlight table td:first-child pre {
  background: #6a7b97 !important;
}

body.night-mode .highlight table td:last-child pre {
  background: #6a7b97 !important;
}

body.night-mode .highlight table td:last-child code > span:nth-child(2n) {
  background: #64748f;
}

body.night-mode .highlight table td:first-child code span:nth-child(2n) {
  background: #64748f;
}

@media (max-width: 1588px) {
  :root {
    --nav-width: 45px;
    --main-pad: 12px;
  }

  #nav .nav-menu a.site-name {
    display: flex;
  }

  #nav .nav-menu a.site-index {
    display: none;
  }

  #nav .nav-menu a .title {
    display: none;
  }

  #nav .nav-menu a {
    justify-content: center;
    padding: 0;
  }

  #nav .nav-menu a i {
    margin-right: 0;
  }

  .footer-inner {
    padding-left: 20px;
  }
}

@media (max-width: 1000px) {
  .page-title li.page-search {
    position: fixed;
    top: 45px;
    right: 10px;
    left: auto;
    width: auto;
    margin-left: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.25s ease,
      padding 0.25s ease;
    z-index: 1300;
  }

  body.search-open .page-title li.page-search {
    max-height: 80px;
    opacity: 1;
    transform: translateY(0);
    padding: 6px 0 10px;
    pointer-events: auto;
  }

  #search {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 0;
    padding: 0;
    background: transparent;
    display: flex;
    justify-content: flex-end;
  }

  #search .text {
    width: 180px;
  }

  .nav-user a.btn-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #body {
    width: 71%;
  }

  .page-title {
    width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    padding: 45px 0 0;
  }

  #wrapper {
    min-height: calc(100vh - 45px);
  }

  :root {
    --cover-width: 0%;
    --body-width: 100%;
  }

  #nav {
    height: auto;
    bottom: auto;
  }

  #nav .nav-menu {
    height: 45px;
    overflow: hidden;
    background: var(--nav-bg);
  }

  #nav .nav-menu:hover {
    height: auto;
  }

  #nav .nav-menu a.site-index {
    display: none;
  }

  #cover {
    display: none;
  }

  #body {
    width: 100%;
    margin-left: 0;
  }

  .main,
  .footer-inner,
  .footer-inner p {
    padding-left: 0;
  }

  .main-inner {
    padding: 0 10px;
  }

  .page-title {
    top: 0;
    left: var(--nav-width);
    right: 0;
    width: 100%;
  }

  .footer {
    padding: 0 10px 10px;
    margin-left: 0;
    width: 100%;
    max-width: none;
  }

  .footer-inner {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .post {
    padding: 16px 10px;
  }

  .nav-user a {
    display: none;
  }

  .nav-user a.btn-read-mode {
    display: inline-flex;
  }

  .nav-user a.btn-search {
    display: inline-flex;
  }
}
