/*
 * XMLuck Typecho Theme
 * Dark image-card journal style.
 */

:root {
  --bg: #eef0e8;
  --bg-soft: #e3e5dc;
  --card: #fffdf6;
  --card-deep: #f5f1e8;
  --footer: #dfe9d2;
  --text: #20231f;
  --muted: #686e64;
  --line: rgba(29, 39, 34, .16);
  --accent: #4f7d38;
  --accent-2: #b8d875;
  --tag: #d6e600;
  --tag-text: #324211;
  --container: clamp(980px, 80vw, 1500px);
  --article: 100%;
}

html[data-theme="dark"] {
  --bg: #202525;
  --bg-soft: #39484d;
  --card: #1c3f3a;
  --card-deep: #1a3b36;
  --footer: #2b5c29;
  --text: #f3f0e8;
  --muted: #ddd8cc;
  --line: rgba(255, 255, 255, .12);
  --accent: #b7d879;
  --accent-2: #c4df88;
  --tag: #d6e600;
  --tag-text: #172015;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.72 "Trebuchet MS", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

html[data-theme="light"] body {
  background: var(--bg);
}

body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  background: url("img/site-bg.png") center / cover no-repeat;
  content: "";
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(rgba(18, 23, 23, .58), rgba(18, 23, 23, .78)),
    radial-gradient(circle at 16% 8%, rgba(183, 216, 121, .2), transparent 30rem);
  content: "";
}

html[data-theme="light"] body::after {
  background:
    linear-gradient(rgba(244, 240, 230, .74), rgba(219, 224, 214, .84)),
    radial-gradient(circle at 16% 8%, rgba(183, 216, 121, .28), transparent 30rem);
}

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

a:hover {
  color: var(--accent-2);
}

img {
  max-width: 100%;
  height: auto;
}

pre,
code {
  background: rgba(0, 0, 0, .18);
  border-radius: 6px;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

pre {
  overflow: auto;
  padding: 16px;
}

blockquote {
  margin: 1.4em 0;
  padding-left: 1.2em;
  border-left: 3px solid var(--accent-2);
  color: var(--muted);
}

.site-container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  background: transparent;
  backdrop-filter: none;
  transition: background .22s ease, border-color .22s ease, backdrop-filter .22s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(18, 23, 23, .14);
  backdrop-filter: blur(8px);
}

html[data-theme="light"] .site-header.is-scrolled {
  background: rgba(244, 240, 230, .18);
}

.header-inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-brand {
  display: grid;
  gap: 3px;
}

#logo {
  display: inline-flex;
  width: 176px;
  height: 52px;
  align-items: center;
  color: var(--text);
}

#logo svg {
  display: block;
  width: 176px;
  height: auto;
}

.site-tagline {
  color: var(--muted);
  font: 13px/1.35 "Noto Sans SC", "PingFang SC", sans-serif;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  font: 800 15px/1.2 "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

.site-nav a {
  padding: 10px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a.current,
.site-nav a:hover {
  color: var(--accent-2);
  border-bottom-color: currentColor;
}

.theme-toggle {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  padding: 0;
  font: 800 13px/1 "Noto Sans SC", "PingFang SC", sans-serif;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.theme-icon {
  grid-area: 1 / 1;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity .18s ease, transform .18s ease;
}

.theme-icon-moon {
  opacity: 0;
  transform: scale(.78) rotate(-18deg);
}

html[data-theme="light"] .theme-icon-sun {
  opacity: 0;
  transform: scale(.78) rotate(18deg);
}

html[data-theme="light"] .theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, var(--article)) minmax(240px, 16vw);
  justify-content: center;
  gap: 18px;
  width: 75vw;
  max-width: none;
  padding-block: 42px 56px;
}

.is-home .content-shell {
  display: block;
  width: 75vw;
  max-width: none;
}

.is-home .site-sidebar {
  display: none;
}

.site-main {
  min-width: 0;
}

.home-intro-bar {
  margin: 10px 0 26px;
}

.home-intro-bar h1,
.section-title {
  margin: 0;
  color: var(--accent-2);
  font: 900 38px/1.1 Georgia, "Times New Roman", "Noto Serif SC", serif;
}

.home-intro-bar p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.section-title {
  margin: 22px 0 22px;
  font-size: 30px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.post-list-item {
  display: flex;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  flex-direction: column;
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .22);
}

.post-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(183, 216, 121, .24), rgba(14, 87, 79, .18)),
    var(--bg-soft);
}

.post-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease, filter .28s ease;
}

.post-thumb:hover img {
  filter: saturate(1.08);
  transform: scale(1.035);
}

.post-thumb-fallback {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 24px;
  color: var(--accent-2);
  font: 900 28px/1.2 Georgia, "Times New Roman", "Noto Serif SC", serif;
  text-align: center;
}

.card-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  max-width: calc(50% - 14px);
  overflow: hidden;
  border-radius: 5px;
  color: #fff;
  padding: 4px 9px;
  font: 800 12px/1.1 "Noto Sans SC", "PingFang SC", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-badge-left {
  left: 8px;
  background: rgba(28, 35, 35, .68);
}

.card-badge-right {
  right: 8px;
  background: var(--badge-color, #ef4444);
}

.post-list-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 16px 16px 0;
}

.post-title {
  margin: 0 0 4px;
  font: 900 21px/1.2 Georgia, "Times New Roman", "Noto Serif SC", serif;
}

.post-title a {
  color: var(--text);
}

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

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: #f4efa5;
  font: 800 12px/1.3 "Noto Sans SC", "PingFang SC", sans-serif;
}

html[data-theme="light"] .post-card-meta {
  color: #776b1f;
}

.post-card-meta span::before {
  content: "·";
  margin-right: 8px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.post-tags a {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  border: 1px solid var(--tag);
  border-radius: 4px;
  color: var(--tag);
  padding: 1px 5px;
  font: 750 12px/1.1 "Noto Sans SC", "PingFang SC", sans-serif;
}

html[data-theme="light"] .post-tags a {
  color: #586100;
}

.post-excerpt {
  display: -webkit-box;
  min-height: 106px;
  margin: 0 0 16px;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.74;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.post-card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin: auto -16px 0;
  background: var(--footer);
  color: #f3f4df;
  padding: 10px 16px;
  font: 800 12px/1.35 "Noto Sans SC", "PingFang SC", sans-serif;
}

html[data-theme="light"] .post-card-footer {
  color: #273821;
}

.post-card-footer span,
.post-card-footer a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-card-footer span::before {
  content: "✎ ";
}

.post-card-footer a::before {
  content: "◎ ";
}

.archive-title {
  margin: 0 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-2);
  font: 900 36px/1.2 Georgia, "Times New Roman", "Noto Serif SC", serif;
}

.site-sidebar {
  color: var(--muted);
  font: 14px/1.6 "Noto Sans SC", "PingFang SC", sans-serif;
}

.widget {
  margin-bottom: 34px;
}

.widget-title {
  margin: 0 0 12px;
  color: var(--text);
  font: 900 17px/1.3 "Noto Sans SC", "PingFang SC", sans-serif;
}

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

.widget-list li {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

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

.tag-cloud a {
  border-bottom: 1px solid currentColor;
}

#search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

input,
textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  font: inherit;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea {
  background: rgba(255, 255, 255, .72);
}

button,
.submit {
  border: 1px solid var(--accent-2);
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  padding: 10px 16px;
  font: 900 14px/1 "Noto Sans SC", "PingFang SC", sans-serif;
  cursor: pointer;
}

button:hover,
.submit:hover {
  background: var(--accent-2);
  color: #142017;
}

.single-main {
  max-width: var(--article);
}

.post-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.single-title {
  margin: 0 0 14px;
  font: 900 46px/1.18 Georgia, "Times New Roman", "Noto Serif SC", serif;
}

.post-date,
.post-meta {
  color: var(--muted);
  font: 14px/1.5 "Noto Sans SC", "PingFang SC", sans-serif;
}

.post-date {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-content {
  color: var(--text);
  font-size: 18px;
  line-height: 1.95;
}

.post-content a,
.comment-content a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: .22em;
}

.post-content img {
  display: block;
  width: 100%;
  margin: 1.7em auto;
  border-radius: 8px;
}

.tags {
  margin-top: 30px;
  color: var(--muted);
}

#comments {
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

#comments h3 {
  margin: 0 0 16px;
  font-size: 24px;
}

.comment-list,
.comment-list ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-body {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

#comment-form p {
  margin: 0 0 14px;
}

#comment-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font: 900 14px/1.4 "Noto Sans SC", "PingFang SC", sans-serif;
}

.post-near {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.post-near li {
  margin: 8px 0;
}

.page-navigator {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.page-navigator a,
.page-navigator span {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  font: 800 14px/1 "Noto Sans SC", "PingFang SC", sans-serif;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  text-align: center;
  font: 13px/1.6 "Noto Sans SC", "PingFang SC", sans-serif;
}

@media (max-width: 980px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-shell {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

@media (max-width: 1120px) and (min-width: 981px) {
  .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-container {
    width: min(calc(100% - 28px), var(--container));
  }

  .header-inner {
    min-height: auto;
    padding: 22px 0 18px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .site-nav {
    gap: 16px;
  }

  .content-shell {
    padding-block: 28px 44px;
    width: min(calc(100% - 28px), var(--container));
  }

  .is-home .content-shell {
    width: min(calc(100% - 28px), var(--container));
  }

  .home-intro-bar h1,
  .section-title {
    font-size: 28px;
  }

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

  .post-title {
    font-size: 24px;
  }

  .post-excerpt {
    min-height: auto;
  }

  .single-title {
    font-size: 34px;
  }

  .post-content {
    font-size: 17px;
  }
}
