:root {
  --journal-bg: #f6f4f8;
  --journal-paper: #fff;
  --journal-ink: #221a30;
  --journal-muted: #62586e;
  --journal-line: #e6e0ec;
  --journal-accent: #6337a6;
  --journal-tint: #f0e9fa;
  --journal-shadow: 0 12px 32px rgba(43, 23, 65, .07);
  --journal-width: 1180px;
  --journal-gutter: clamp(18px, 4vw, 46px);
  --journal-nav-height: 64px;
  --global-bg: var(--journal-bg);
  --card-bg: var(--journal-paper);
  --sidebar-bg: var(--journal-paper);
  --font-color: var(--journal-ink);
  --text-highlight-color: var(--journal-ink);
  --btn-bg: var(--journal-accent);
}

html[data-theme='dark'] {
  --journal-bg: #15111c;
  --journal-paper: #211a2a;
  --journal-ink: #f0eaf8;
  --journal-muted: #beb2ca;
  --journal-line: #3c3048;
  --journal-accent: #d3b5ff;
  --journal-tint: #332444;
  --journal-shadow: none;
  --global-bg: var(--journal-bg);
  --card-bg: var(--journal-paper);
  --sidebar-bg: var(--journal-paper);
  --font-color: var(--journal-ink);
  --text-highlight-color: var(--journal-ink);
  --btn-bg: #7548ad;
}

body {
  font-family: system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

#body-wrap a:focus-visible {
  outline: 2px solid var(--journal-accent);
  outline-offset: 3px;
}

#page-header #nav {
  height: var(--journal-nav-height);
  padding-inline: max(var(--journal-gutter), calc((100% - var(--journal-width)) / 2));
  border-bottom: 1px solid var(--journal-line);
  background: var(--journal-paper);
  box-shadow: none;
  font-size: 1rem;
}

#nav #blog-info > a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  vertical-align: middle;
}

#nav .journal-nav-mark {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #2f1e43;
  color: #e0cbff;
  font: 700 16px/1 Georgia, serif;
}

#page-header #nav a,
#page-header #nav .site-name {
  color: var(--journal-ink);
  text-shadow: none;
}

#nav .site-name {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
}

#nav .menus_items .menus_item,
#nav #search-button {
  padding-left: 10px;
}

#nav .site-page {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 6px;
  font-size: 14px;
  white-space: nowrap;
}

#nav .site-page:not(.child)::after {
  content: none;
}

#nav .menus_item:focus-within .menus_item_child {
  display: block;
}

#nav .menus_items .menus_item .menus_item_child {
  margin-top: 4px;
  padding: 5px;
  border: 1px solid var(--journal-line);
  border-radius: 10px;
  box-shadow: var(--journal-shadow);
}

#nav #search-button .site-page {
  justify-content: center;
  min-width: 40px;
  padding-inline: 10px;
  border: 1px solid var(--journal-line);
  border-radius: 8px;
  background: var(--journal-bg);
}

#page-header #nav a:hover {
  color: var(--journal-accent);
}

#page-header.full_page {
  height: auto;
  padding-top: var(--journal-nav-height);
  background-attachment: scroll;
}

#page-header.full_page::before {
  content: none;
}

.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 86% 65%, #4d2775, transparent 62%), #21182f;
}

.home-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: min(var(--journal-width), 100% - 2 * var(--journal-gutter));
  min-height: clamp(370px, 33vw, 440px);
  margin-inline: auto;
  padding-block: 54px;
}

.home-hero-copy {
  max-width: 560px;
}

.home-hero-art {
  position: absolute;
  z-index: -1;
  right: max(-8vw, calc((100% - 1440px) / 2));
  bottom: 0;
  display: grid;
  align-items: end;
  width: min(69vw, 1020px);
  height: 100%;
  pointer-events: none;
  mask-image: linear-gradient(to right, transparent, #000 27%);
}

.home-hero-art::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #e5c4ff 1px, transparent 1.5px) 0 0 / 8px 8px;
  opacity: .17;
  mask-image: radial-gradient(ellipse at 58% 60%, #000 8%, transparent 65%);
  content: '';
}

.home-hero-art img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}

.home-hero-kicker,
.journal-feed-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  color: var(--journal-accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .15em;
  line-height: 1.5;
  text-transform: uppercase;
}

.home-hero-kicker {
  color: #d9baff;
}

.home-hero-kicker::before {
  width: 22px;
  height: 2px;
  background: currentColor;
  content: '';
}

#page-header .home-hero #site-title {
  max-width: 9.5em;
  color: #fcf7ff;
  font-size: clamp(34px, 4.4vw, 62px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.19;
  text-align: left;
  text-shadow: none;
  text-wrap: balance;
}

.home-hero-description {
  max-width: 34ch;
  margin: 18px 0 0;
  color: #e5d9ef;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.85;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.home-hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.home-hero-actions .home-hero-button {
  background: #e1caff;
  color: #28153d;
}

.home-hero-actions .home-hero-link {
  border-color: #aa92ba;
  color: #fff5ff;
}

.home-hero-actions a:hover {
  border-color: #fff5ff;
  background: #fff5ff;
  color: #28153d;
}

#page-header.not-home-page,
#page-header.post-bg {
  height: auto;
  padding-top: var(--journal-nav-height);
}

#page-header.not-home-page::before,
#page-header.post-bg::before {
  inset: 0;
  background: linear-gradient(110deg, rgba(25, 16, 37, .86), rgba(40, 24, 55, .6));
}

#page-header #page-site-info,
#page-header #post-info {
  position: relative;
  inset: auto;
  width: min(var(--journal-width), 100% - 2 * var(--journal-gutter));
  margin-inline: auto;
  padding: clamp(30px, 5vw, 68px) 0;
  text-align: left;
}

#page-header #page-site-info #site-title,
#page-header #post-info .post-title {
  max-width: 29ch;
  color: #fff7ff;
  font-size: clamp(29px, 4.1vw, 51px);
  font-weight: 760;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: anywhere;
}

#page-header #post-info .post-title {
  display: block;
}

#page-header #post-meta,
#page-header #post-meta a {
  color: #f1e6f8;
}

.read-mode #page-header #post-info .post-title,
.read-mode #page-header #post-meta,
.read-mode #page-header #post-meta a {
  color: var(--font-color);
}

#body-wrap > #content-inner {
  gap: clamp(20px, 3vw, 36px);
  width: min(var(--journal-width), 100% - 2 * var(--journal-gutter));
  max-width: none;
  padding: clamp(26px, 3.2vw, 46px) 0;
}

#body-wrap > #content-inner.hide-aside {
  max-width: 920px;
}

#content-inner > div:first-child {
  order: 0;
  flex: 1 1 auto;
  min-width: 0;
}

#content-inner > #aside-content {
  order: 1;
  flex: 0 0 auto;
  width: min(27%, 286px);
  min-width: 0;
  padding: 0;
}

.journal-feed-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--journal-line);
  scroll-margin-top: calc(var(--journal-nav-height) + 18px);
}

.journal-feed-heading h2 {
  margin: 0;
  color: var(--journal-ink);
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 780;
  line-height: 1.2;
}

.journal-feed-heading a {
  color: var(--journal-accent);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.journal-feed-heading a span {
  margin-left: 6px;
}

#recent-posts > .recent-post-item:not(.ads-wrap),
#aside-content .card-widget,
body:not(.read-mode) #content-inner > div:first-child:not(.recent-posts) {
  border: 1px solid var(--journal-line);
  border-radius: 14px;
  background: var(--journal-paper);
  box-shadow: var(--journal-shadow);
}

#recent-posts > .recent-post-item:not(.ads-wrap) {
  align-items: stretch;
  min-height: 154px;
  height: auto;
}

#recent-posts .recent-post-item:hover {
  border-color: var(--journal-accent);
}

#recent-posts .recent-post-item .post_cover {
  position: relative;
  flex: 0 0 32%;
  align-self: stretch;
  width: auto;
  height: auto;
  background: var(--journal-tint);
}

#recent-posts .recent-post-item .post_cover a {
  position: absolute;
  inset: 0;
}

#recent-posts .recent-post-item .post-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#recent-posts .recent-post-item > .recent-post-info {
  flex: 1 1 0;
  align-self: center;
  width: auto;
  min-width: 0;
  padding: clamp(17px, 3vw, 30px);
}

.post-card-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 750;
  line-height: 1.37;
  overflow-wrap: anywhere;
}

.post-card-title .article-title {
  color: var(--journal-ink);
}

.post-card-title .article-title:hover,
#recent-posts .article-meta-wrap a:hover {
  color: var(--journal-accent);
}

#recent-posts .recent-post-item .article-meta-wrap,
#recent-posts .recent-post-item .article-meta-wrap a {
  color: var(--journal-muted);
  font-size: inherit;
}

#recent-posts .recent-post-item .article-meta-wrap {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.7;
}

#recent-posts .recent-post-info > .content {
  color: var(--journal-muted);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#aside-content .card-widget {
  padding: 19px;
}

#aside-content .card-info {
  border-top: 3px solid var(--journal-accent);
}

#aside-content .card-info .author-info__description,
#aside-content .card-announcement .announcement_content {
  color: var(--journal-muted);
  font-size: 14px;
  line-height: 1.8;
}

#aside-content .item-headline {
  color: var(--journal-ink);
  font-size: 16px;
  font-weight: 720;
}

#aside-content .card-tag-cloud a {
  display: inline-block;
  margin: 3px 5px 3px 0;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--journal-tint);
  color: var(--journal-accent);
  font-size: 13px !important;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

#aside-content #card-info-btn {
  border-radius: 8px;
  background: var(--journal-tint);
  color: var(--journal-accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 2.8;
}

#aside-content #card-info-btn:hover {
  text-decoration: underline;
}

#body-wrap #content-inner > :is(#post, #page, #archive, #tag, #category) {
  padding: clamp(20px, 4vw, 52px);
}

#post > #article-container {
  max-width: 73ch;
  margin-inline: auto;
  font-size: clamp(16px, 1.45vw, 18px);
  line-height: 1.85;
  overflow-wrap: anywhere;
}

#article-container :is(h1, h2, h3, h4) {
  margin-top: 1.65em;
  margin-bottom: .55em;
  line-height: 1.4;
  scroll-margin-top: calc(var(--journal-nav-height) + 18px);
}

#article-container h2 {
  padding-bottom: .4em;
  border-bottom: 1px solid var(--journal-line);
}

#article-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

#article-container :is(pre, .highlight, .table-wrap) {
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: normal;
}

#footer {
  border-top: 1px solid var(--journal-line);
  background: var(--journal-paper);
}

#footer::before {
  content: none;
}

#footer-wrap,
#footer-wrap a {
  color: var(--journal-muted);
}

@media (max-width: 1535px) {
  #live2d-widget {
    display: none;
  }
}

@media (max-width: 900px) {
  #content-inner > #aside-content {
    width: 100%;
  }

  #aside-content > .card-widget:first-child {
    margin-top: 0;
  }

  .home-hero-art {
    right: -19vw;
    width: 93vw;
    opacity: .72;
  }

  .home-hero-copy {
    max-width: 57%;
  }
}

@media (max-width: 600px) {
  :root {
    --journal-nav-height: 58px;
  }

  .home-hero-inner {
    min-height: 420px;
    padding-block: 35px 171px;
  }

  .home-hero-copy {
    max-width: 100%;
  }

  .home-hero-art {
    right: -20%;
    width: 125%;
    max-width: 540px;
    height: auto;
    opacity: .78;
    mask-image: linear-gradient(to bottom, transparent, #000 40%);
  }

  #page-header .home-hero #site-title {
    font-size: clamp(28px, 8vw, 42px);
  }

  #recent-posts > .recent-post-item:not(.ads-wrap) {
    min-height: 0;
  }

  #recent-posts .recent-post-item .post_cover {
    order: -1;
    flex: none;
    width: 100%;
    aspect-ratio: 2 / 1;
  }
}

@media (min-width: 601px) and (max-width: 768px) {
  #recent-posts > .recent-post-item:not(.ads-wrap) {
    flex-direction: row;
  }

  #recent-posts .recent-post-item .post_cover.right {
    order: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #recent-posts .recent-post-item,
  #recent-posts .post-bg {
    transition: none;
  }

  #recent-posts .recent-post-item:hover .post-bg {
    transform: none;
  }
}
