@import url("https://fonts.geekzu.org/css2?family=LXGW%20Marker%20Gothic:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,900&display=swap");

:root {
  color-scheme: light;
  --bg: #faf8f9;
  --paper: #f2edee;
  --text: #232323;
  --muted: #7a5a65;
  --line: #ad7a8b;
  --accent: #8b6572;
  --accent-deep: #b88294;
  --accent-soft: #efeaeb;
  --hover: #f4f0f1;
  --shadow: 0 16px 45px rgba(91, 61, 72, 0.08);
  --radius: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1b1d;
  --paper: #292326;
  --text: #f1ecee;
  --muted: #b6aab0;
  --line: #453940;
  --accent: #d2a6b6;
  --accent-deep: #e1bdca;
  --accent-soft: #3a2c32;
  --hover: #352c30;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

*::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

*::-webkit-scrollbar-track {
  background-color: var(--bg);
}

*::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 5px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "LXGW Marker Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

body > main {
  flex: 1;
  width: 100%;
}

.site-header {
  position: static;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand strong {
  display: block;
  color: var(--accent-deep);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.nav a,
.theme-toggle {
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 6px 12px;
}

.nav a:hover,
.nav a[aria-current="page"],
.theme-toggle:hover {
  background: var(--hover);
  color: var(--text);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
}

.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}

.home-layout {
  max-width: 1290px;
  margin: 0 auto;
  padding: 26px 24px 36px;
}

.archive-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 36px;
}

.home-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.home-note span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.home-note strong {
  color: var(--text);
}

.archive-list {
  display: grid;
  gap: 22px;
}

.archive-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  overflow: hidden;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--accent));
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 12px 18px -6px color-mix(in srgb, var(--accent) 26%, transparent);
}

.archive-thumb {
  overflow: hidden;
  border-radius: 12px;
  background: var(--accent-soft);
}

.archive-thumb img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  transition: transform 0.9s ease;
}

.archive-card:hover .archive-thumb img {
  transform: scale(1.12);
}

.archive-body {
  display: grid;
  align-content: start;
  padding: 2px 8px 2px 0;
}

.archive-category {
  width: fit-content;
  margin: 0 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

.archive-body h2 {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 24px;
  line-height: 1.4;
}

.archive-body h2 a:hover {
  color: var(--accent);
}

.archive-body p {
  margin: 0 0 12px;
  color: var(--muted);
}

.archive-body .post-meta {
  margin-top: auto;
}

.archive-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 30px;
}

.archive-pagination a,
.archive-pagination span,
.load-more {
  min-width: 36px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 34px;
}

.archive-pagination a[aria-current="page"],
.archive-pagination a:hover,
.load-more:hover {
  background: var(--accent);
  color: var(--paper);
}

.load-more {
  display: block;
  width: fit-content;
  margin: 16px auto 0;
  cursor: pointer;
}

.archive-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 34px;
}

.mini-posts {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.mini-posts a:hover {
  color: var(--accent);
}

.intro {
  max-width: 760px;
  margin-bottom: 54px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.intro h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.2;
  font-weight: 800;
}

.intro p:last-child {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 44px;
  align-items: start;
}

.masonry-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feed-card {
  display: flex;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--accent));
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 12px 18px -6px color-mix(in srgb, var(--accent) 32%, transparent);
}

.feed-card a {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  width: 100%;
}

.feed-card figure {
  overflow: hidden;
  margin: 0;
  background: var(--accent-soft);
}

.feed-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s ease;
}

.feed-card a:hover img {
  transform: scale(1.12);
}

.feed-card figure {
  aspect-ratio: 4 / 3;
}

.card-body {
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding: 14px 16px 18px;
}

.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.feed-card h1 {
  margin: 5px 0 7px;
  color: var(--accent-deep);
  font-size: 20px;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feed-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.module-section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  color: var(--accent-deep);
  font-size: 22px;
  line-height: 1.3;
}

.section-head a {
  color: var(--muted);
  font-size: 14px;
}

.section-head a:hover {
  color: var(--accent);
}

.notice-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: -22px 0 42px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}

.notice-strip strong {
  color: var(--accent-deep);
  white-space: nowrap;
}

.post-list {
  border-top: 1px solid var(--line);
}

.post-row {
  border-bottom: 1px solid var(--line);
}

.post-row a {
  display: block;
  padding: 26px 0;
}

.post-row a:hover h2 {
  color: var(--accent-deep);
}

.post-row time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.post-row h2 {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.35;
  transition: color 0.18s ease;
}

.post-row p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.featured {
  margin: 0 0 10px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.read-more {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.inline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--accent);
  font-size: 14px;
}

.sidebar {
  display: grid;
  gap: 18px;
}

.side-block {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.side-block h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.side-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.profile img {
  margin-bottom: 14px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.timeline time {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 42px 24px 48px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.page-title {
  max-width: 760px;
  margin-bottom: 34px;
}

.page-title h1 {
  margin: 0 0 10px;
  font-size: 42px;
  line-height: 1.2;
}

.page-title p {
  margin: 0;
  color: var(--muted);
}

.article {
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 42px;
}

.entry-content {
  scroll-margin-top: 88px;
}

.article header {
  margin-bottom: 34px;
}

.article time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
}

.article h1 {
  margin: 10px 0 14px;
  font-size: 42px;
  line-height: 1.25;
}

.article p,
.article li {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.article .entry-content > p {
  text-indent: 2em;
}

.article h2,
.article h3,
.article h4 {
  scroll-margin-top: 92px;
}

.article h2 {
  margin: 34px 0 12px;
  font-size: 26px;
}

.article h3 {
  margin: 26px 0 10px;
  font-size: 20px;
}

.article a {
  color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  text-decoration: none;
  transition: background-size 0.18s ease, color 0.18s ease;
}

.article a:hover {
  color: var(--paper);
  background-image: linear-gradient(var(--accent-deep), var(--accent-deep));
  background-size: 100% 100%;
}

.article blockquote {
  margin: 28px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--muted);
}

.article pre {
  max-height: 450px;
  overflow: auto;
  padding: 16px;
  border-radius: var(--radius);
  background: #171717;
  color: #f6f0e8;
  font-size: 14px;
  line-height: 1.7;
}

.simple-list {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.simple-list a {
  display: block;
}

.simple-list article {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.simple-list h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.simple-list p {
  margin: 0;
  color: var(--muted);
}

.content_toc {
  position: fixed;
  right: 16px;
  bottom: 164px;
  z-index: 18;
  display: block;
  width: 210px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 30%, transparent);
  scrollbar-width: none;
  transition: width 0.35s ease, height 0.35s ease, border-radius 0.35s ease, background-color 0.35s ease;
}

.content_toc::-webkit-scrollbar,
.content_toc_main::-webkit-scrollbar {
  display: none;
}

.content_toc.less {
  width: 42px;
  height: 42px;
  border-color: var(--accent);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: none;
}

.content_toc.less .content_toc_title h6,
.content_toc.less .content_toc_main {
  display: none;
}

.content_toc_title {
  position: relative;
  height: 42px;
  margin: 0;
}

.content_toc_title h6 {
  margin: 0;
  padding-left: 12px;
  color: var(--accent-deep);
  font-size: 17px;
  font-weight: 700;
  line-height: 42px;
}

.content_toc_title h6::before {
  content: "|";
  margin-right: 10px;
  color: var(--accent);
  background: var(--accent);
  border-radius: 5px;
}

.content_toc_title .btn {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.content_toc_title .btn:hover,
.content_toc_title .btn.close:hover {
  background: var(--accent-deep);
  color: var(--paper);
}

.content_toc_title .btn.close {
  top: 0;
  right: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent);
  line-height: 42px;
}

.content_toc_main {
  overflow-y: auto;
  padding: 0;
  margin: 0;
  transition: height 0.35s ease;
}

.content_toc_tree {
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
}

.content_toc_tree li {
  position: relative;
  width: 174px;
  margin-left: 10px;
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
}

.content_toc_tree li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.content_toc_tree li.active,
.content_toc_tree li:hover {
  background: var(--accent);
  color: var(--paper);
}

.content_toc_tree li.active::before,
.content_toc_tree li:hover::before {
  background: var(--accent);
}

.content_toc_tree li.level_H1,
.content_toc_tree li.level_H2 {
  padding-left: 5px;
}

.content_toc_tree li.level_H3 {
  padding-left: 1em;
}

.content_toc_tree li.level_H4 {
  padding-left: 2em;
}

.toolbar {
  --button-size: 38px;
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 20;
  display: grid;
  gap: 10px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toolbar.is-hidden {
  transform: translateX(58px);
  opacity: 0.2;
}

.tool {
  position: relative;
}

.tool-button {
  display: grid;
  place-items: center;
  width: var(--button-size);
  height: var(--button-size);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.tool-button:hover,
.tool-button.is-active {
  background: var(--accent-deep);
}

.tool-button svg {
  width: 18px;
  height: 18px;
}

.tool-panel {
  position: absolute;
  right: 52px;
  bottom: 0;
  width: 210px;
  max-height: min(420px, 72vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tool-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tool-panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.toc-list,
.palette-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list button,
.palette-list button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}

.toc-list button {
  padding: 6px 8px 6px 16px;
}

.toc-list button::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 8px;
  margin: 0 8px 0 -10px;
  border-radius: 2px;
  background: currentColor;
}

.toc-list .level-h3 button {
  padding-left: 28px;
}

.toc-list button:hover,
.toc-list button.is-active,
.palette-list button:hover,
.palette-list button.is-active {
  background: var(--accent);
  color: var(--paper);
}

.palette-list button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
}

.swatch {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr auto;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .masonry-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-card {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .archive-widgets {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  .site-header,
  .layout,
  .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .brand small {
    display: none;
  }

  .intro {
    margin-bottom: 36px;
  }

  .post-row h2,
  .article h1,
  .page-title h1 {
    font-size: 28px;
  }

  .featured {
    padding: 0 16px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .home-layout {
    padding: 18px 18px 34px;
  }

  .masonry-feed {
    grid-template-columns: 1fr;
  }

  .archive-layout {
    padding: 32px 18px;
  }

  .archive-card {
    grid-template-columns: 1fr;
  }

  .archive-thumb img {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .feed-card h1 {
    font-size: 19px;
  }

  .notice-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .content_toc {
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    width: 178px;
  }

  .content_toc_tree li {
    width: 142px;
  }

  .toolbar {
    right: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    grid-auto-flow: column;
    justify-content: center;
    width: 100%;
    padding-bottom: 10px;
  }

  .toolbar.is-hidden {
    transform: translateY(58px);
  }

  .tool-panel {
    right: 50%;
    bottom: 50px;
    transform: translate(50%, 8px);
  }

  .tool-panel.is-open {
    transform: translate(50%, 0);
  }
}
