:root {
  --bg: #2c2118;
  --paper: #f4e7cc;
  --ink: #2a1c12;
  --muted: #7a5c42;
  --line: #d8c29a;
  --amber: #d0892a;
  --rust: #a33b24;
  --hole: #2c2118;
  --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 Serif SC", "Noto Serif SC", "Songti SC", "SimSun", "Source Han Sans SC", "Microsoft YaHei", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12px 10px, rgba(208, 137, 42, 0.18) 1.2px, transparent 1.6px),
    linear-gradient(180deg, #3a2b1f, var(--bg) 220px);
  background-size: 28px 22px, auto;
  line-height: 1.7;
}

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

.sp-skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--amber);
  color: #2a1c12;
  padding: 0.6rem 1rem;
  z-index: 1000;
}
.sp-skip:focus { left: 0.75rem; top: 0.75rem; }

.sp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #1d150f;
  border-bottom: 3px solid var(--amber);
  box-shadow: inset 0 8px 0 #4a3728;
}

.sp-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;
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  color: #f4e7cc !important;
}
.sp-brand-mark {
  width: 1.55rem;
  height: 1.55rem;
  border: 2px solid var(--amber);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #1d150f, inset 0 0 0 6px var(--amber);
}
.sp-brand span:last-child {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: clamp(1.02rem, 2.1vw, 1.28rem);
  white-space: nowrap;
}

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

.sp-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;
}
.sp-nav > ul {
  pointer-events: auto;
  display: flex;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sp-nav-item { position: relative; }
.sp-nav-parent {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: default;
  color: #f4e7cc;
  border: 1px dashed transparent;
}
.sp-nav-item:hover .sp-nav-parent,
.sp-nav-item:focus-within .sp-nav-parent {
  color: #1d150f;
  background: var(--amber);
  border-color: var(--amber);
}
.sp-sub {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 9.5rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 6px 8px 0 rgba(29, 21, 15, 0.18);
}
.sp-nav-item:hover .sp-sub,
.sp-nav-item:focus-within .sp-sub { display: block; }
.sp-sub a {
  display: block;
  padding: 0.5rem 0.7rem;
  color: var(--ink);
}
.sp-sub a:hover {
  background: #ead7ae;
  color: var(--rust);
}

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

.sp-banner {
  margin: 0 0 1rem;
  overflow: hidden;
  background: #1d150f;
  border: 1px solid #4a3728;
  box-shadow: inset 0 0 0 6px #1d150f, inset 0 0 0 8px var(--amber);
}
.sp-banner img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  filter: sepia(0.28) contrast(1.05);
}

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

.sp-card {
  display: grid;
  grid-template-columns: 1.35rem 5.2rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.95rem 1rem 0.95rem 0.55rem;
  background:
    linear-gradient(90deg, #c9b48a 0 1.35rem, var(--paper) 1.35rem);
  border: 1px solid #cbb894;
  box-shadow: 0 10px 0 rgba(29, 21, 15, 0.12);
  position: relative;
  transition: transform 0.28s var(--ease);
}
.sp-card::before {
  content: "";
  width: 1.35rem;
  min-height: 5.2rem;
  align-self: stretch;
  background-image: radial-gradient(circle, var(--hole) 0.26rem, transparent 0.28rem);
  background-size: 100% 1.15rem;
  background-repeat: repeat-y;
  background-position: center 0.2rem;
}
.sp-card:hover { transform: rotate(-0.35deg) translateY(-3px); }
.sp-card-cover {
  overflow: hidden;
  background: #ead7ae;
  min-height: 5.2rem;
  height: 5.2rem;
  border: 1px solid #cbb894;
  box-shadow: inset 0 0 0 3px #f4e7cc;
}
.sp-card-cover img {
  width: 100%;
  height: 5.2rem;
  object-fit: cover;
  min-height: 5.2rem;
  filter: sepia(0.22);
}
.sp-card h2 {
  margin: 0 0 0.28rem;
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.4;
  font-weight: 780;
}
.sp-card h2 a { color: var(--ink); }
.sp-card h2 a:hover { color: var(--rust); }
.sp-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  color: var(--rust);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  font-family: "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}
.sp-meta-l {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sp-avatar {
  width: 1.05rem;
  height: 1.05rem;
  object-fit: cover;
  border-radius: 2px;
}

.sp-crumb {
  margin: 0 0 0.9rem;
  color: #ead7ae;
  font-size: 0.86rem;
}
.sp-crumb a { color: var(--amber); }

.sp-pager {
  display: flex;
  justify-content: flex-start;
  gap: 0.55rem;
  margin: 1.15rem 0 0.2rem;
}
.sp-pager a {
  min-width: 6.8rem;
  text-align: center;
  padding: 0.65rem 1.05rem;
  background: var(--paper);
  color: var(--ink) !important;
  font-weight: 700;
  border: 1px solid var(--amber);
  box-shadow: 3px 3px 0 var(--rust);
}
.sp-pager a:hover {
  background: var(--amber);
  color: #1d150f !important;
}

.sp-aside {
  position: sticky;
  top: calc(var(--header-h) + 0.8rem);
  display: grid;
  gap: 0.85rem;
}
.sp-side {
  background: var(--paper);
  padding: 0.95rem 0.95rem 0.6rem;
  border: 1px solid #cbb894;
  box-shadow: 4px 5px 0 rgba(29, 21, 15, 0.16);
}
.sp-side h3 {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--rust);
}
.sp-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: n;
}
.sp-side li { border-top: 1px dotted #cbb894; }
.sp-side li a {
  display: flex;
  gap: 0.5rem;
  padding: 0.58rem 0;
  color: var(--ink);
  font-size: 0.88rem;
}
.sp-side .sp-widlist a::before {
  counter-increment: n;
  content: counter(n, decimal-leading-zero);
  color: var(--amber);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex: 0 0 1.5rem;
  font-size: 0.76rem;
  font-family: "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}
.sp-topthub a {
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0;
}
.sp-topthub img {
  width: 100%;
  height: 7.4rem;
  object-fit: cover;
  filter: sepia(0.25);
}
.sp-topthub span { font-weight: 650; }

.sp-article-card {
  background: var(--paper);
  padding: clamp(1.15rem, 3.2vw, 2.2rem);
  border: 1px solid #cbb894;
  outline: 4px double #a33b24;
  outline-offset: -10px;
}
.sp-article-card h1 {
  margin: 0 0 0.7rem;
  text-align: left;
  font-size: clamp(1.32rem, 3vw, 1.9rem);
  line-height: 1.35;
}
.sp-bloginfo {
  display: flex;
  justify-content: flex-start;
  color: var(--rust);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  font-family: "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}
.sp-bloginfo ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sp-prose {
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.95;
  color: #3a2b1f;
  max-width: 44rem;
}
.sp-prose img,
.sp-prose video,
.sp-prose iframe,
.sp-prose table { max-width: 100%; }
.sp-prose table { display: block; overflow-x: auto; }
.sp-copyright {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dotted #cbb894;
  color: var(--muted);
  font-size: 0.8rem;
}
.sp-pagerow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.15rem;
}
.sp-pagerow a {
  display: block;
  padding: 0.8rem 0.9rem;
  background: #ead7ae;
  font-size: 0.86rem;
  line-height: 1.45;
}
.sp-pagerow .next { text-align: right; }

.sp-footer {
  background: #1d150f;
  padding: 1.5rem 1rem 2.3rem;
  text-align: center;
  color: #cbb894;
  font-size: 0.86rem;
  border-top: 3px solid var(--amber);
}
.sp-footer p { margin: 0 0 0.7rem; }
.sp-footer a { color: var(--amber); margin: 0 0.35rem; }

#go-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.2rem;
  width: 2.55rem;
  height: 2.55rem;
  background: var(--rust);
  color: #f4e7cc;
  cursor: pointer;
  display: grid;
  place-items: center;
  border: 2px solid var(--amber);
}
#go-to-top::after { content: "↑"; font-size: 1.05rem; }

.sp-mask { display: none; }

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

@media (max-width: 768px) {
  .sp-nav-toggle { display: inline-flex; }
  .sp-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(29, 21, 15, 0.28);
    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 .sp-nav {
    transform: translateX(0);
    visibility: visible;
  }
  .sp-nav > ul {
    flex-direction: column;
    gap: 0.2rem;
  }
  .sp-sub {
    display: block;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 0.4rem 0.8rem;
    background: transparent;
  }
  .sp-nav-parent {
    color: var(--ink);
  }
  .sp-nav-item:hover .sp-nav-parent {
    background: #ead7ae;
    color: var(--rust);
  }
  .sp-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(29, 21, 15, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
    z-index: 40;
  }
  body.nav-open .sp-mask {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }
  .sp-card {
    grid-template-columns: 1.15rem 4.3rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.8rem 0.8rem 0.8rem 0.4rem;
  }
  .sp-card::before {
    width: 1.15rem;
    min-height: 4.3rem;
  }
  .sp-card-cover,
  .sp-card-cover img {
    min-height: 4.3rem;
    height: 4.3rem;
  }
  .sp-pagerow { grid-template-columns: 1fr; }
  .sp-pagerow .next { text-align: left; }
}

@media (max-width: 420px) {
  .sp-card {
    grid-template-columns: 1.1rem minmax(0, 1fr);
    grid-template-areas: "hole cover" "hole body";
  }
  .sp-card::before { grid-area: hole; }
  .sp-card-cover { grid-area: cover; }
  .sp-card > div { grid-area: body; }
  .sp-card-cover,
  .sp-card-cover img {
    width: 100%;
    height: 8.5rem;
    min-height: 8.5rem;
  }
}

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

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