:root {
  --bg: #e7e1d2;
  --paper: #fffdf6;
  --ink: #14532d;
  --muted: #6b705c;
  --line: #d4ccb4;
  --board: #14532d;
  --chalk: #fef9c3;
  --accent: #eab308;
  --header-h: 4.25rem;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #1c1917;
  background:
    radial-gradient(circle at 18px 22px, rgba(255, 255, 255, 0.35) 1px, transparent 2px),
    var(--bg);
  background-size: 28px 28px;
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--board); }
button { font: inherit; }

.jx-skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--board);
  color: var(--chalk);
  padding: 0.6rem 1rem;
  z-index: 1000;
}
.jx-skip:focus { left: 0.75rem; top: 0.75rem; }

.jx-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--board);
  box-shadow: inset 0 -4px 0 #0f3d22;
}

.jx-header-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.jx-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--chalk) !important;
}
.jx-brand span {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  white-space: nowrap;
}

.jx-nav-toggle {
  margin-left: auto;
  height: 2.4rem;
  padding: 0 0.85rem 0 0.7rem;
  border: 1px solid var(--chalk);
  border-radius: 4px;
  background: transparent;
  color: var(--chalk);
  display: none;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  z-index: 60;
}
.jx-nav-toggle b {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.14em;
}
.jx-nav-toggle i {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.jx-nav-toggle i span {
  width: 14px;
  height: 2px;
  background: var(--chalk);
}

.jx-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--max), calc(100% - 2rem));
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 51;
  pointer-events: none;
}
.jx-nav > ul {
  pointer-events: auto;
  display: flex;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.jx-nav-item { position: relative; }
.jx-nav-parent {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: default;
  color: var(--chalk);
}
.jx-nav-item:hover .jx-nav-parent,
.jx-nav-item:focus-within .jx-nav-parent {
  color: var(--accent);
  background: rgba(254, 249, 195, 0.08);
}
.jx-sub {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 9.5rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--paper);
  border: 2px solid var(--board);
  box-shadow: 6px 6px 0 rgba(20, 83, 45, 0.2);
}
.jx-nav-item:hover .jx-sub,
.jx-nav-item:focus-within .jx-sub { display: block; }
.jx-sub a {
  display: block;
  padding: 0.5rem 0.7rem;
  color: var(--ink);
}
.jx-sub a:hover {
  background: var(--chalk);
  color: var(--board);
}

.jx-wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 1.3rem auto 3rem;
}
.jx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.6rem;
  gap: 1.45rem;
  align-items: start;
}

.jx-banner {
  margin: 0 0 1rem;
  overflow: hidden;
  background: var(--board);
  padding: 10px;
  border-radius: 6px;
}
.jx-banner img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
}

.jx-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}

.jx-card {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr);
  gap: 0.95rem;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 0 var(--board);
  transition: transform 0.3s var(--ease);
}
.jx-card:hover { transform: translateY(-3px); }
.jx-card-cover {
  margin: 0.85rem 0 0.85rem 0.85rem;
  overflow: hidden;
  background: #efe8d6;
  min-height: 6.4rem;
  height: 6.4rem;
  border-radius: 4px;
}
.jx-card-cover img {
  width: 100%;
  height: 6.4rem;
  object-fit: cover;
  min-height: 6.4rem;
}
.jx-card > div {
  padding: 0.85rem 1rem 0.9rem 0;
}
.jx-card h2 {
  margin: 0 0 0.28rem;
  font-size: clamp(1rem, 1.55vw, 1.14rem);
  line-height: 1.4;
  font-weight: 780;
}
.jx-card h2 a { color: var(--ink); }
.jx-card h2 a:hover { color: #166534; }
.jx-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jx-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
  color: #a16207;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
.jx-meta-l {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.jx-avatar {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 3px;
  object-fit: cover;
}

.jx-crumb {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.jx-crumb a { color: var(--board); }

.jx-pager {
  display: flex;
  justify-content: flex-start;
  gap: 0.55rem;
  margin: 1.15rem 0 0.2rem;
}
.jx-pager a {
  min-width: 6.8rem;
  text-align: center;
  padding: 0.65rem 1.05rem;
  background: var(--board);
  color: var(--chalk) !important;
  font-weight: 700;
  border-radius: 4px;
}
.jx-pager a:hover {
  background: #0f3d22;
  color: var(--accent) !important;
}

.jx-aside {
  position: sticky;
  top: calc(var(--header-h) + 0.8rem);
  display: grid;
  gap: 0.85rem;
}
.jx-side {
  background: var(--board);
  color: var(--chalk);
  padding: 0.95rem 0.95rem 0.6rem;
  border-radius: 6px;
}
.jx-side h3 {
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  color: var(--accent);
}
.jx-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: n;
}
.jx-side li { border-top: 1px solid rgba(254, 249, 195, 0.16); }
.jx-side li a {
  display: flex;
  gap: 0.5rem;
  padding: 0.58rem 0;
  color: var(--chalk);
  font-size: 0.88rem;
}
.jx-side li a:hover { color: var(--accent); }
.jx-side .jx-widlist a::before {
  counter-increment: n;
  content: counter(n);
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex: 0 0 1.2rem;
}
.jx-topthub a {
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0;
}
.jx-topthub img {
  width: 100%;
  height: 7.4rem;
  object-fit: cover;
  border-radius: 4px;
  filter: saturate(0.85);
}
.jx-topthub span { font-weight: 650; color: #fffbeb; }

.jx-article-card {
  background: var(--paper);
  padding: clamp(1.15rem, 3.2vw, 2.2rem);
  border: 1px solid var(--line);
  border-top: 12px solid var(--board);
  box-shadow: 0 12px 0 rgba(20, 83, 45, 0.12);
}
.jx-article-card h1 {
  margin: 0 0 0.7rem;
  text-align: left;
  font-size: clamp(1.32rem, 3vw, 1.9rem);
  line-height: 1.35;
  color: var(--ink);
}
.jx-bloginfo {
  display: flex;
  justify-content: flex-start;
  color: #a16207;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}
.jx-bloginfo ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.jx-prose {
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.95;
  color: #292524;
  max-width: 44rem;
}
.jx-prose img,
.jx-prose video,
.jx-prose iframe,
.jx-prose table { max-width: 100%; }
.jx-prose table { display: block; overflow-x: auto; }
.jx-copyright {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}
.jx-pagerow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.15rem;
}
.jx-pagerow a {
  display: block;
  padding: 0.8rem 0.9rem;
  background: var(--chalk);
  font-size: 0.86rem;
  line-height: 1.45;
  border-left: 4px solid var(--board);
}
.jx-pagerow .next { text-align: right; }

.jx-footer {
  background: var(--board);
  padding: 1.5rem 1rem 2.3rem;
  text-align: center;
  color: #d9f99d;
  font-size: 0.86rem;
}
.jx-footer p { margin: 0 0 0.7rem; }
.jx-footer a { color: var(--chalk); margin: 0 0.35rem; }

#go-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.2rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 4px;
  background: var(--accent);
  color: var(--board);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 800;
}
#go-to-top::after { content: "↑"; font-size: 1.05rem; }

.jx-mask { display: none; }

@media (max-width: 980px) {
  .jx-layout { grid-template-columns: 1fr; }
  .jx-aside { position: static; }
}

@media (max-width: 768px) {
  .jx-nav-toggle { display: inline-flex; }
  .jx-nav {
    left: auto;
    right: 0;
    top: 0;
    width: min(84vw, 20rem);
    height: 100dvh;
    margin: 0;
    display: block;
    background: var(--paper);
    box-shadow: -8px 0 28px rgba(20, 83, 45, 0.18);
    padding: 5rem 1.1rem 1.5rem;
    transform: translateX(110%);
    transition: transform 0.35s var(--ease), visibility 0.35s;
    overflow-y: auto;
    visibility: hidden;
    z-index: 55;
    pointer-events: auto;
  }
  body.nav-open .jx-nav {
    transform: translateX(0);
    visibility: visible;
  }
  .jx-nav > ul {
    flex-direction: column;
    gap: 0.2rem;
  }
  .jx-sub {
    display: block;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 0.4rem 0.8rem;
    background: transparent;
  }
  .jx-nav-parent {
    color: var(--ink);
  }
  .jx-nav-item:hover .jx-nav-parent {
    background: var(--chalk);
    color: var(--board);
  }
  .jx-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 83, 45, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
    z-index: 40;
  }
  body.nav-open .jx-mask {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }
  .jx-card {
    grid-template-columns: 4.4rem minmax(0, 1fr);
  }
  .jx-card-cover,
  .jx-card-cover img {
    min-height: 5.4rem;
    height: 5.4rem;
  }
  .jx-pagerow { grid-template-columns: 1fr; }
  .jx-pagerow .next { text-align: left; }
}

@media (max-width: 420px) {
  .jx-card { grid-template-columns: 1fr; }
  .jx-card-cover { margin: 0.75rem 0.75rem 0; }
  .jx-card-cover,
  .jx-card-cover img {
    width: calc(100% - 0px);
    height: 10rem;
    min-height: 10rem;
  }
  .jx-card > div { padding: 0.75rem 0.9rem 0.95rem; }
}

@media (min-width: 1440px) {
  :root { --max: 1260px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
