/* =============================================================
   Fluid — Gridea Pro Theme
   100% pixel replica of fluid-dev/hexo-theme-fluid
   ============================================================= */

/* ---------- 0. CSS Variables ---------- */
:root {
  --link-hover-color: #30a9de;
  --link-hover-bg-color: #ebedef;

  --body-bg-color: #eeeeee;
  --board-bg-color: #ffffff;
  --text-color: #3c4858;
  --sec-text-color: #718096;
  --post-text-color: #2c3e50;
  --post-heading-color: #1a202c;
  --line-color: #eaecef;

  --navbar-bg-color: #2f4154;
  --navbar-text-color: #ffffff;
  --subtitle-color: #ffffff;

  --button-bg-color: #f6f8fa;
  --button-hover-bg-color: #f2f3f5;
  --highlight-bg-color: #f6f8fa;
  --inlinecode-bg-color: rgba(175, 184, 193, 0.2);

  --scrollbar-color: #c4c6c9;
  --scrollbar-hover-color: #a6a6a6;

  --container-max: 960px;
  --banner-height: 100vh;
  --inner-banner-height: 60vh;
  --banner-mask-alpha: 0.3;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-user-color-scheme="dark"] {
  --body-bg-color: #181c27;
  --board-bg-color: #252d38;
  --text-color: #c4c6c9;
  --sec-text-color: #a7a9ad;
  --post-text-color: #c4c6c9;
  --post-heading-color: #c4c6c9;
  --line-color: #435266;
  --navbar-bg-color: #1f3144;
  --navbar-text-color: #d0d0d0;
  --subtitle-color: #d0d0d0;
  --button-bg-color: #2f4154;
  --button-hover-bg-color: #46647e;
  --highlight-bg-color: #2d333b;
  --inlinecode-bg-color: rgba(99, 110, 123, 0.4);
  --scrollbar-color: #687582;
  --scrollbar-hover-color: #9da8b3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-user-color-scheme="light"]) {
    --body-bg-color: #181c27;
    --board-bg-color: #252d38;
    --text-color: #c4c6c9;
    --sec-text-color: #a7a9ad;
    --post-text-color: #c4c6c9;
    --post-heading-color: #c4c6c9;
    --line-color: #435266;
    --navbar-bg-color: #1f3144;
    --navbar-text-color: #d0d0d0;
    --subtitle-color: #d0d0d0;
    --button-bg-color: #2f4154;
    --button-hover-bg-color: #46647e;
    --highlight-bg-color: #2d333b;
    --inlinecode-bg-color: rgba(99, 110, 123, 0.4);
    --scrollbar-color: #687582;
    --scrollbar-hover-color: #9da8b3;
  }
}

/* ---------- 1. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 16px;
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; overflow-wrap: break-word; }
body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--body-bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color .2s ease-in-out, background-color .2s ease-in-out;
}
body a {
  color: var(--text-color);
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease-in-out, background-color .2s ease-in-out;
}
body a:hover { color: var(--link-hover-color); }
p { margin: 0 0 1rem 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; vertical-align: middle; border: 0; }
[data-user-color-scheme="dark"] img { filter: brightness(0.9); }
button { font: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background-color: var(--scrollbar-color); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-hover-color); }

.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: var(--container-max); } }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
@media (min-width: 768px) {
  .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; padding: 0 15px; }
  .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; padding: 0 15px; }
  .col-md-10 { flex: 0 0 83.3333%; max-width: 83.3333%; padding: 0 15px; }
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.m-auto { margin: auto; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }

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

/* ---------- 2. Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 0;
  background-color: transparent;
  font-size: 0.875rem;
  transition: background-color .5s ease-in-out, padding .5s ease-in-out;
  box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
}
.navbar.top-nav-collapse {
  background-color: var(--navbar-bg-color);
  padding-top: 5px;
  padding-bottom: 5px;
}
.navbar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  display: inline-block;
  padding: 0.3125rem 0;
  margin-right: 1rem;
  font-size: 1.25rem;
  white-space: nowrap;
  color: var(--navbar-text-color);
  font-weight: bold;
}
.navbar-brand:hover { color: var(--navbar-text-color); }

.navbar-nav {
  display: flex;
  flex-direction: row;
  list-style: none;
  margin: 0; padding: 0;
  align-items: center;
}
.nav-item { position: relative; }
.nav-link {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--navbar-text-color);
  transition: color .2s ease-in-out;
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: inherit;
}
.nav-link:hover { color: var(--link-hover-color); }
.nav-link .icon { font-size: 1rem; }

.navbar-toggler {
  background-color: transparent;
  border: 0;
  padding: 0.25rem 0.75rem;
  outline: 0;
  cursor: pointer;
  display: none;
  margin-left: auto;
}
.animated-icon {
  width: 30px; height: 20px;
  position: relative;
  transition: .5s ease-in-out;
  cursor: pointer;
}
.animated-icon span {
  display: block;
  position: absolute;
  height: 3px; width: 100%;
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transition: .25s ease-in-out;
  background: #ffffff;
}
.animated-icon span:nth-child(1) { top: 0; }
.animated-icon span:nth-child(2) { top: 10px; }
.animated-icon span:nth-child(3) { top: 20px; }
.animated-icon.open span:nth-child(1) { top: 11px; transform: rotate(135deg); }
.animated-icon.open span:nth-child(2) { opacity: 0; left: -60px; }
.animated-icon.open span:nth-child(3) { top: 11px; transform: rotate(-135deg); }

@media (max-width: 991.98px) {
  .navbar-toggler { display: inline-block; }
  .navbar-nav { display: none; }
  .navbar { font-size: 1rem; line-height: 2.5rem; }
}

#mobile-grid-menu {
  display: block;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1029;
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .18s ease, transform .18s ease;
  background-color: var(--navbar-bg-color);
}
#mobile-grid-menu.show {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}
.mobile-grid-menu-inner {
  padding-top: 70px;
  padding-bottom: 2rem;
}
.mobile-grid-cell {
  flex: 0 0 33.3333%;
  max-width: 33.3333%;
  padding: 0.5rem;
}
.mobile-grid-cell a { display: block; text-decoration: none; color: var(--navbar-text-color); }
.mobile-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.08);
  transition: background-color .2s ease-in-out, transform .15s ease-in-out;
  cursor: pointer;
  min-height: 80px;
}
.mobile-grid-item:hover, .mobile-grid-item:active {
  background-color: rgba(255, 255, 255, 0.18);
  transform: scale(0.96);
}
.mobile-grid-item .icon {
  font-size: 1.6rem;
  color: var(--navbar-text-color);
  margin-bottom: 0.4rem;
  line-height: 1;
}
.mobile-grid-item span {
  font-size: 0.78rem;
  color: var(--navbar-text-color);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

@media (min-width: 992px) {
  #mobile-grid-menu { display: none !important; }
}

body.mobile-menu-open { overflow: hidden; }

/* ---------- 3. Header / Banner ---------- */
.header-inner {
  width: 100%;
  height: 100vh;
  position: relative;
}
.banner {
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: default;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}
.banner .full-bg-img {
  width: 100%;
  height: 100%;
  position: relative;
}
.banner .mask {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, var(--banner-mask-alpha, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.banner-text {
  color: var(--subtitle-color);
  max-width: calc(960px - 6rem);
  width: 80%;
  text-align: center;
  overflow-wrap: break-word;
}
.banner-text .h2 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.banner-text #subtitle {
  font-size: 2rem;
  display: inline;
}
.banner-text .typed-cursor {
  display: inline-block;
  margin-left: 4px;
  font-weight: 100;
  animation: blink-cursor 1s infinite;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.scroll-down-bar {
  position: absolute;
  width: 100%;
  height: 6rem;
  text-align: center;
  cursor: pointer;
  bottom: 0;
}
.scroll-down-bar .icon-arrow-down {
  display: inline-block;
  position: relative;
  padding-top: 2rem;
  color: var(--subtitle-color);
  font-size: 2rem;
  font-weight: bold;
  animation: scroll-down 1.5s infinite;
}
@keyframes scroll-down {
  0% { transform: translateY(0); }
  50% { transform: translateY(0.4rem); }
  100% { transform: translateY(0); }
}

.fade-in-up { animation: fade-in-up 1s ease forwards; }
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
  .banner-text .h2 { font-size: 1.8rem; }
  .banner-text #subtitle, .banner-text .typed-cursor { font-size: 1.5rem; }
}
@media (max-width: 575px) {
  .banner-text { font-size: 0.9rem; }
  .banner-text #subtitle, .banner-text .typed-cursor { font-size: 1.35rem; }
}

.header-inner.is-inner { height: var(--inner-banner-height, 60vh); }
.header-inner.is-inner .banner-text .h2 { font-size: 2rem; }

/* ---------- 4. Board (white card) ---------- */
#board {
  background-color: var(--board-bg-color);
  border-radius: 0.4rem;
  padding: 2.5rem 2rem;
  margin-top: -1rem;
  margin-bottom: 2rem;
  box-shadow: 0 5px 11px 0 rgba(0,0,0,0.08), 0 4px 15px 0 rgba(0,0,0,0.05);
  position: relative;
  z-index: 1;
}
@media (max-width: 767px) {
  #board { padding: 1.5rem 1rem; }
}

main {
  min-height: calc(100vh - 60px);
  padding-bottom: 2rem;
}

/* ---------- 5. Index card ---------- */
.index-card {
  margin-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}
.index-card .col-12 { padding: 0 15px; flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
  .index-card .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .index-card .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
  .index-card .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
.index-img img {
  display: block;
  width: 100%;
  height: 10rem;
  object-fit: cover;
  box-shadow: 0 5px 11px 0 rgba(0,0,0,0.18), 0 4px 15px 0 rgba(0,0,0,0.15);
  border-radius: 0.25rem;
}
.index-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.index-header {
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 0.25rem 0;
}
.index-header a { color: inherit; }
.index-header a:hover { color: var(--link-hover-color); }
.index-pin {
  color: var(--link-hover-color);
  font-size: 1.2rem;
  margin-right: 0.25rem;
}
.index-btm { color: var(--sec-text-color); }
.index-btm a { color: var(--sec-text-color); }
.index-btm a:hover { color: var(--link-hover-color); }

.index-excerpt {
  color: var(--sec-text-color);
  margin: 0.5rem 0;
  height: calc(1.4rem * 3);
  overflow: hidden;
  display: flex;
}
.index-excerpt > div {
  width: 100%;
  line-height: 1.4rem;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.index-excerpt__noimg { height: auto; max-height: calc(1.4rem * 3); }

.post-metas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.875rem;
}
.post-meta { margin-right: 1rem; display: inline-flex; align-items: center; }
.post-meta .icon { margin-right: 0.25rem; opacity: 0.85; }

@media (max-width: 767px) {
  .index-info { padding-top: 1.25rem; }
  .index-header {
    font-size: 1.25rem;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .index-pin { font-size: 1.25rem; }
  .index-excerpt { height: auto; max-height: calc(1.4rem * 3); margin: 0.25rem 0; }
}

/* ---------- 6. Post detail ---------- */
.post {
  font-size: 1rem;
  color: var(--post-text-color);
  word-wrap: break-word;
  line-height: 1.85;
}
.post-meta-top {
  text-align: center;
  color: var(--subtitle-color);
  margin-top: 1rem;
  font-size: 0.875rem;
}
.post-meta-top span { margin: 0 0.5rem; opacity: 0.95; }
.post-meta-top a { color: inherit; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }
.post-meta-top a:hover { color: var(--link-hover-color); border-bottom-color: var(--link-hover-color); }

#post-meta-bottom {
  border-top: 1px solid var(--line-color);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  color: var(--sec-text-color);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.post h1, .post h2, .post h3, .post h4, .post h5, .post h6 {
  color: var(--post-heading-color);
  font-weight: bold;
  line-height: 1.4;
  margin: 1.6rem 0 1rem;
}
.post h1 { font-size: 1.6rem; }
.post h2 { font-size: 1.4rem; }
.post h3 { font-size: 1.25rem; }
.post h4 { font-size: 1.1rem; }
.post h5 { font-size: 1rem; }
.post h6 { font-size: 0.95rem; color: var(--sec-text-color); }
.post p { margin: 0 0 1rem 0; }
.post a {
  color: var(--link-hover-color);
  word-break: break-word;
}
.post a:hover { text-decoration: underline; }
.post ul, .post ol { padding-left: 2rem; margin: 0 0 1rem; }
.post ul { list-style: disc; }
.post ol { list-style: decimal; }
.post li { margin-bottom: 0.4rem; line-height: 1.85; }
.post img {
  display: block;
  margin: 1.2rem auto;
  border-radius: 4px;
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.post blockquote {
  margin: 1.2rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--link-hover-color);
  background: var(--button-bg-color);
  color: var(--sec-text-color);
  border-radius: 0 4px 4px 0;
}
.post blockquote p:last-child { margin-bottom: 0; }
.post hr {
  height: 1px;
  border: 0;
  background: var(--line-color);
  margin: 2rem 0;
}
.post table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.post table th, .post table td {
  border: 1px solid var(--line-color);
  padding: 8px 12px;
}
.post table th {
  background: var(--button-bg-color);
  font-weight: bold;
  text-align: left;
}

/* code */
.post p code, .post li code {
  background: var(--inlinecode-bg-color);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 85%;
  word-break: break-word;
}
.post pre {
  background: var(--highlight-bg-color);
  color: inherit;
  padding: 1rem 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.2rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  position: relative;
}
.post pre code {
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  white-space: pre;
  display: block;
}
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--button-bg-color);
  color: var(--sec-text-color);
  border: 1px solid var(--line-color);
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s;
  z-index: 3;
}
.post pre:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover {
  background: var(--button-hover-bg-color);
  color: var(--text-color);
}

/* Tags row at post bottom */
.post-tags {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-color);
}
.post-tags a {
  display: inline-block;
  margin-right: 0.4rem;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.875rem;
  color: var(--link-hover-color);
  border-radius: 4px;
  background: var(--link-hover-bg-color);
  transition: all .2s ease-in-out;
}
.post-tags a:hover {
  background: var(--link-hover-color);
  color: #fff;
}

/* ---------- 7. Pagination ---------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2.5rem 0 1rem;
  padding: 0;
  list-style: none;
}
.pagination .page-prev,
.pagination .page-next {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.2rem;
  background: var(--button-bg-color);
  color: var(--text-color);
  border-radius: 999px;
  font-size: 0.95rem;
  transition: all .2s ease-in-out;
}
.pagination .page-prev:hover,
.pagination .page-next:hover {
  background: var(--button-hover-bg-color);
  color: var(--link-hover-color);
}
.pagination .is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pagination .page-info {
  color: var(--sec-text-color);
  font-size: 0.875rem;
}

/* ---------- 8. Post nav ---------- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}
.post-nav-item {
  background: var(--button-bg-color);
  padding: 1rem 1.2rem;
  border-radius: 6px;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
}
.post-nav-item:hover {
  background: var(--button-hover-bg-color);
}
.post-nav-item .label {
  font-size: 0.75rem;
  color: var(--sec-text-color);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.post-nav-item .title {
  color: var(--text-color);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav-item.is-next { text-align: right; }
@media (max-width: 575px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.is-next { text-align: left; }
}

/* ---------- 9. Comments ---------- */
.post-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-color);
}
.post-comments h3 {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}
.comments-mount { min-height: 60px; }
.comments-placeholder {
  color: var(--sec-text-color);
  font-size: 0.875rem;
  text-align: center;
  padding: 2rem 0;
  background: var(--button-bg-color);
  border-radius: 6px;
}

/* ---------- 10. Footer ---------- */
.footer-inner {
  background: var(--body-bg-color);
  padding: 2rem 0 3rem;
  text-align: center;
  color: var(--sec-text-color);
  font-size: 0.875rem;
  line-height: 1.8;
}
.footer-inner p { margin: 0 0 0.4rem; }
.footer-inner a { color: var(--sec-text-color); }
.footer-inner a:hover { color: var(--link-hover-color); }

/* ---------- 11. Scroll-top button ---------- */
#scroll-top-button {
  position: fixed;
  z-index: 99;
  background: var(--board-bg-color);
  color: var(--sec-text-color);
  transition: background-color .2s ease-in-out, bottom .3s ease;
  border-radius: 4px;
  min-width: 40px;
  min-height: 40px;
  bottom: -60px;
  right: 16px;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
}
#scroll-top-button.is-visible { bottom: 30px; }
#scroll-top-button .icon { font-size: 24px; line-height: 1; }
#scroll-top-button:hover .icon, #scroll-top-button:active .icon {
  animation: scroll-top-bounce 1s ease-in-out infinite alternate;
}
@keyframes scroll-top-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

/* ---------- 12. Reading progress bar ---------- */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #1896c4, var(--link-hover-color));
  width: 0;
  z-index: 1100;
  transition: width .15s linear;
  box-shadow: 0 0 6px var(--link-hover-color);
  border-radius: 0 2px 2px 0;
}

/* 深色模式加粗 + 更强光晕：细线在深底上对比不足，靠辉光把它托出来 */
[data-user-color-scheme="dark"] .reading-progress {
  height: 4px;
  box-shadow: 0 0 10px 2px var(--link-hover-color);
}

/* ---------- 13. Search modal ---------- */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
  backdrop-filter: blur(4px);
}
.search-modal.is-open { display: flex; }
.search-modal-panel {
  background: var(--board-bg-color);
  border-radius: 6px;
  width: min(720px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  position: relative;
}
.search-modal-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  border: 1px solid var(--line-color);
  background: var(--button-bg-color);
  color: var(--text-color);
  border-radius: 4px;
  outline: none;
}
.search-modal-input:focus { border-color: var(--link-hover-color); }
.search-modal-tip {
  margin: 12px 0 18px;
  color: var(--sec-text-color);
  font-size: 12px;
  text-align: right;
}
.search-modal-results { border-top: 1px solid var(--line-color); padding-top: 12px; }
.search-result-item {
  display: block;
  padding: 12px 8px;
  border-bottom: 1px dashed var(--line-color);
  color: var(--text-color);
}
.search-result-item:hover { background: var(--button-bg-color); }
.search-result-item h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text-color);
  font-weight: 600;
}
.search-result-item p {
  margin: 0;
  font-size: 13px;
  color: var(--sec-text-color);
  line-height: 1.6;
}
.search-result-item mark {
  background: var(--link-hover-color);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}
.search-modal-empty {
  padding: 30px 0;
  text-align: center;
  color: var(--sec-text-color);
  font-size: 14px;
}
.search-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--button-bg-color);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--sec-text-color);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

/* ---------- 14. Tags & Categories ---------- */
.taxonomy-section { margin-bottom: 3rem; }
.taxonomy-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.2rem;
  position: relative;
  padding-left: 1rem;
}
.taxonomy-title::before {
  content: "";
  position: absolute;
  left: 0; top: 0.4rem;
  width: 4px; height: 1.1rem;
  background: var(--link-hover-color);
  border-radius: 2px;
}

.tag-cloud, .category-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.4rem;
}
.tag-cloud-item, .category-cloud-item {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background: var(--button-bg-color);
  color: var(--text-color);
  border-radius: 999px;
  font-size: 0.9rem;
  transition: all .2s ease;
  border: 1px solid transparent;
}
.tag-cloud-item:hover, .category-cloud-item:hover {
  background: var(--link-hover-color);
  color: #fff;
}
.tag-cloud-item .count, .category-cloud-item .count {
  margin-left: 0.4rem;
  font-size: 0.78rem;
  opacity: 0.7;
}

/* ---------- 15. Archives ---------- */
.archive-year {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 2rem 0 1rem;
  color: var(--post-heading-color);
  position: relative;
  padding-left: 1rem;
}
.archive-year::before {
  content: "";
  position: absolute;
  left: 0; top: 0.4rem;
  width: 4px; height: 1.2rem;
  background: var(--link-hover-color);
  border-radius: 2px;
}
.archive-list {
  border-left: 2px solid var(--line-color);
  margin-left: 0.5rem;
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}
.archive-item {
  position: relative;
  padding: 0.5rem 0;
  font-size: 1rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.archive-item::before {
  content: "";
  position: absolute;
  left: -1.95rem;
  top: 0.85rem;
  width: 10px; height: 10px;
  background: var(--board-bg-color);
  border: 2px solid var(--link-hover-color);
  border-radius: 50%;
}
.archive-item:hover::before { background: var(--link-hover-color); }
.archive-item time {
  color: var(--sec-text-color);
  font-size: 0.875rem;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.archive-item a {
  color: var(--text-color);
  transition: padding-left .2s ease;
}
.archive-item a:hover {
  color: var(--link-hover-color);
  padding-left: 4px;
}

/* Year collapse (details/summary) */
.archive-year-block > summary.archive-year {
  cursor: pointer;
  list-style: none;
}
.archive-year-block > summary.archive-year::-webkit-details-marker {
  display: none;
}
.archive-year::after {
  content: "▸";
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--sec-text-color);
  transition: transform 0.2s ease;
}
.archive-year-block[open] > .archive-year::after {
  transform: rotate(90deg);
}
.archive-year .archive-count {
  font-size: 1rem;
  font-weight: normal;
  opacity: 0.55;
  margin-left: 0.3rem;
}

/* ---------- 16. Memos ---------- */
.memo-item {
  background: var(--button-bg-color);
  padding: 1.2rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.memo-date {
  flex-shrink: 0;
  text-align: center;
  width: 4rem;
}
.memo-date-day {
  display: block;
  font-size: 2.4rem;
  font-weight: bold;
  color: var(--link-hover-color);
  line-height: 1;
}
.memo-date-month {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sec-text-color);
  margin-top: 0.25rem;
}
.memo-body { flex: 1; min-width: 0; }
.memo-body p { margin: 0 0 0.6rem; line-height: 1.7; }
.memo-meta {
  font-size: 0.8rem;
  color: var(--sec-text-color);
}
.memo-meta span { margin-right: 0.6rem; }

@media (max-width: 575px) {
  .memo-item { flex-direction: column; gap: 0.5rem; }
  .memo-date { display: flex; align-items: baseline; gap: 0.5rem; width: auto; text-align: left; }
  .memo-date-day { font-size: 1.4rem; }
  .memo-date-month { margin-top: 0; }
}

.heatmap {
  background: var(--button-bg-color);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  margin: 0 0 2rem;
}
.heatmap-title {
  margin: 0 0 0.8rem;
  font-size: 0.875rem;
  color: var(--sec-text-color);
  letter-spacing: 0.5px;
}
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.heatmap-cell {
  background: var(--line-color);
  border-radius: 2px;
  width: 12px; height: 12px;
}
.heatmap-cell[data-level="1"] { background: rgba(48, 169, 222, 0.25); }
.heatmap-cell[data-level="2"] { background: rgba(48, 169, 222, 0.5); }
.heatmap-cell[data-level="3"] { background: rgba(48, 169, 222, 0.75); }
.heatmap-cell[data-level="4"] { background: var(--link-hover-color); }
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--sec-text-color);
  justify-content: flex-end;
}
.heatmap-legend-cell {
  width: 12px; height: 12px;
  border-radius: 2px;
  background: var(--line-color);
}
.heatmap-legend-cell[data-level="1"] { background: rgba(48, 169, 222, 0.25); }
.heatmap-legend-cell[data-level="2"] { background: rgba(48, 169, 222, 0.5); }
.heatmap-legend-cell[data-level="3"] { background: rgba(48, 169, 222, 0.75); }
.heatmap-legend-cell[data-level="4"] { background: var(--link-hover-color); }

/* ---------- 17. Links ---------- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.link-card {
  background: var(--button-bg-color);
  padding: 1.2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all .25s ease;
  color: var(--text-color);
}
.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  color: var(--text-color);
}
.link-card .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--line-color);
  flex-shrink: 0;
}
.link-card .meta { min-width: 0; flex: 1; }
.link-card .meta h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}
.link-card .meta p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--sec-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 18. About page ---------- */
.about-avatar {
  position: absolute;
  width: 8rem;
  height: 8rem;
  left: 50%;
  top: -4rem;
  transform: translateX(-50%);
  z-index: 2;
}
.about-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--board-bg-color);
  box-shadow: 0 5px 11px 0 rgba(0,0,0,0.18), 0 4px 15px 0 rgba(0,0,0,0.15);
  background: var(--board-bg-color);
}
#board.has-avatar { padding-top: 5rem; margin-top: 4rem; }
.about-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: bold;
  margin: 0 0 1.5rem;
  color: var(--post-heading-color);
}
.about-intro {
  text-align: center;
  color: var(--sec-text-color);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ---------- 19. Page header ---------- */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-color);
}
.page-header h1 {
  font-size: 2rem;
  font-weight: bold;
  margin: 0 0 0.5rem;
  color: var(--post-heading-color);
}
.page-header p {
  margin: 0;
  color: var(--sec-text-color);
}

/* ---------- 20. 404 ---------- */
.error-page {
  text-align: center;
  padding: 100px 20px;
}
.error-page h1 {
  font-size: 4rem;
  font-weight: bold;
  margin: 0 0 1rem;
  color: var(--link-hover-color);
}
.error-page p {
  color: var(--sec-text-color);
  margin-bottom: 2rem;
}
.error-page form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}
.error-page input[type="text"] {
  flex: 1;
  border: 1px solid var(--line-color);
  background: var(--button-bg-color);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-color);
  border-radius: 999px;
}
.error-page button {
  background: var(--link-hover-color);
  border: none;
  color: #fff;
  padding: 10px 22px;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- 21. Inline icon ---------- */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.15em;
}

/* ---------- 22. Empty state ---------- */
.empty-state {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--sec-text-color);
}

/* ---------- 23. Print ---------- */
@media print {
  .navbar, .header-inner, #scroll-top-button,
  .search-modal, #mobile-grid-menu, .reading-progress,
  .post-nav, .post-comments, .footer-inner,
  .post-toc { display: none !important; }
  body, #board {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  #board { padding: 0; margin: 0; }
}

/* ---------- Valine 评论组件深色模式适配（2026-11-17：深色下评论文字灰色看不清，只覆盖坏的颜色，不动本来就达标的） ---------- */

[data-user-color-scheme="dark"] .v[data-class=v] .vinput,
[data-user-color-scheme="dark"] .v[data-class=v] .veditor,
[data-user-color-scheme="dark"] .v[data-class=v] p,
[data-user-color-scheme="dark"] .v[data-class=v] pre code,
[data-user-color-scheme="dark"] .v[data-class=v] .status-bar,
[data-user-color-scheme="dark"] .v[data-class=v] .vnick,
[data-user-color-scheme="dark"] .v[data-class=v] .vbtn,
[data-user-color-scheme="dark"] .v[data-class=v] .vempty {
  color: #c4c6c9;
}

[data-user-color-scheme="dark"] .v[data-class=v] blockquote {
  color: #aab0ba;
  border-left-color: #3a4453;
}

[data-user-color-scheme="dark"] .v[data-class=v] pre,
[data-user-color-scheme="dark"] .v[data-class=v] code {
  background-color: #1b212c;
}

[data-user-color-scheme="dark"] .v[data-class=v] .vicon {
  fill: #c4c6c9;
}

[data-user-color-scheme="dark"] .v[data-class=v] .vwrap,
[data-user-color-scheme="dark"] .v[data-class=v] .vcards .vcard .vimg {
  border-color: #3a4453;
}

[data-user-color-scheme="dark"] .v[data-class=v] .vwrap .vheader .vinput {
  border-bottom-color: #4a5262;
}

[data-user-color-scheme="dark"] .v[data-class=v] .vcards .vcard .vh {
  border-bottom-color: #3a4453;
}

[data-user-color-scheme="dark"] .v[data-class=v] .vbtn:disabled {
  border-color: #4a5262;
  color: #6b7280;
  background-color: transparent;
}

[data-user-color-scheme="dark"] .v[data-class=v] .vcards .vcard .vcontent.expand::before {
  background: linear-gradient(180deg, rgba(37, 45, 56, 0), rgba(37, 45, 56, 0.92));
}

[data-user-color-scheme="dark"] .v[data-class=v] .vcards .vcard .vcontent.expand::after {
  color: #8a8f99;
  background: rgba(37, 45, 56, 0.92);
}

[data-user-color-scheme="dark"] .v[data-class=v] .vcards .vcard .vquote {
  border-left-color: rgba(122, 128, 140, 0.4);
}

[data-user-color-scheme="dark"] .v[data-class=v] hr {
  border-color: #3a4453;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vinput,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .veditor,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] p,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] pre code,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .status-bar,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vnick,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vbtn,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vempty {
    color: #c4c6c9;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] blockquote {
    color: #aab0ba;
    border-left-color: #3a4453;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] pre,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] code {
    background-color: #1b212c;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vicon {
    fill: #c4c6c9;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vwrap,
  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vcards .vcard .vimg {
    border-color: #3a4453;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vwrap .vheader .vinput {
    border-bottom-color: #4a5262;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vcards .vcard .vh {
    border-bottom-color: #3a4453;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vbtn:disabled {
    border-color: #4a5262;
    color: #6b7280;
    background-color: transparent;
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vcards .vcard .vcontent.expand::before {
    background: linear-gradient(180deg, rgba(37, 45, 56, 0), rgba(37, 45, 56, 0.92));
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vcards .vcard .vcontent.expand::after {
    color: #8a8f99;
    background: rgba(37, 45, 56, 0.92);
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] .vcards .vcard .vquote {
    border-left-color: rgba(122, 128, 140, 0.4);
  }

  :root:not([data-user-color-scheme="light"]) .v[data-class=v] hr {
    border-color: #3a4453;
  }
}

/* ============================================================================
   23. Post image lightbox
   ========================================================================== */
.post img { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.86);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 4px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lightbox-img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close .icon { font-size: 22px; line-height: 1; }

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(90deg);
}

/* =============================================================
   24. Post TOC — right-side floating nav (desktop ≥1280px only)
       层级缩进：h1/h2 顶格，h3 缩进，h4 再缩进
   ============================================================= */
.post-toc {
  position: fixed;
  top: 15vh;
  right: 1rem;
  width: 220px;
  max-height: 68vh;
  overflow-y: auto;
  padding: 14px 10px;
  background: var(--board-bg-color);
  border: 1px solid var(--line-color);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.5;
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color) transparent;
}

.post-toc-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-color);
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--line-color);
  margin-bottom: 6px;
}

.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-toc-item a {
  display: block;
  padding: 4px 8px;
  color: var(--sec-text-color);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease, background 0.2s ease;
}

.post-toc-item a:hover {
  color: var(--link-hover-color);
  background: var(--link-hover-bg-color);
}

.post-toc-item.active a {
  color: var(--link-hover-color);
  border-left-color: var(--link-hover-color);
  font-weight: 600;
}

.post-toc-h3 a { padding-left: 20px; }
.post-toc-h4 a { padding-left: 32px; font-size: 12px; }

/* 窄屏隐藏 TOC（正文 col-md-10 两侧空隙不足） */
@media (max-width: 1279.98px) {
  .post-toc { display: none !important; }
}
