:root {
  --bg: #dfe7f0;
  --paper: #fbfcfe;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #c8d4e3;
  --navy: #1e3a5f;
  --pen: #e11d48;
  --sky: #0284c7;
  --header-h: 4.2rem;
  --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: var(--ink);
  background:
    linear-gradient(90deg, transparent 2.4rem, rgba(225, 29, 72, 0.22) 2.4rem, rgba(225, 29, 72, 0.22) calc(2.4rem + 1.5px), transparent calc(2.4rem + 1.5px)),
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 31px,
      rgba(30, 58, 95, 0.08) 31px,
      rgba(30, 58, 95, 0.08) 32px
    ),
    var(--bg);
  line-height: 1.7;
}

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

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

.ex-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  border-bottom: 3px solid var(--pen);
}

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

.ex-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  color: #ffffff !important;
}
.ex-brand-mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 2px solid #fff;
  border-radius: 50%;
  color: var(--pen);
  background: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
}
.ex-brand span:last-child {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: clamp(1.02rem, 2.1vw, 1.26rem);
  white-space: nowrap;
}

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

.ex-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;
}
.ex-nav > ul {
  pointer-events: auto;
  display: flex;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ex-nav-item { position: relative; }
.ex-nav-parent {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 1rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: default;
  color: #e2e8f0;
  border: 1px dashed transparent;
}
.ex-nav-item:hover .ex-nav-parent,
.ex-nav-item:focus-within .ex-nav-parent {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(225, 29, 72, 0.28);
}
.ex-sub {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 11rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}
.ex-nav-item:hover .ex-sub,
.ex-nav-item:focus-within .ex-sub { display: block; }
.ex-sub a {
  display: block;
  padding: 0.5rem 0.7rem;
  color: var(--ink);
}
.ex-sub a:hover {
  background: #fff1f2;
  color: var(--pen);
}

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

.ex-banner {
  margin: 0 0 1rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 4px var(--paper);
  position: relative;
}
.ex-banner::after {
  content: "试卷";
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  padding: 0.2rem 0.55rem;
  border: 2px solid var(--pen);
  color: var(--pen);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  transform: rotate(8deg);
  background: rgba(255, 255, 255, 0.9);
}
.ex-banner img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
}

.ex-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
  counter-reset: q;
}

.ex-card {
  display: grid;
  grid-template-columns: 2.6rem 5.2rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.95rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 4px 5px 0 rgba(30, 58, 95, 0.08);
  position: relative;
  transition: transform 0.28s var(--ease);
}
.ex-card::before {
  counter-increment: q;
  content: counter(q);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-top: 0.15rem;
  border: 2px solid var(--navy);
  border-radius: 50%;
  color: var(--navy);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  background:
    radial-gradient(circle at center, transparent 0 0.55rem, rgba(225, 29, 72, 0.12) 0.56rem 0.72rem, transparent 0.73rem);
}
.ex-card:hover {
  transform: translateX(4px);
  border-color: var(--pen);
}
.ex-card:hover::before {
  border-color: var(--pen);
  color: var(--pen);
}
.ex-card-cover {
  overflow: hidden;
  background: #e8eef5;
  min-height: 5.2rem;
  height: 5.2rem;
  border: 1px dashed var(--line);
}
.ex-card-cover img {
  width: 100%;
  height: 5.2rem;
  object-fit: cover;
  min-height: 5.2rem;
}
.ex-card h2 {
  margin: 0 0 0.28rem;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.4;
  font-weight: 750;
}
.ex-card h2 a { color: var(--ink); }
.ex-card h2 a:hover { color: var(--pen); }
.ex-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ex-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  color: var(--sky);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}
.ex-meta-l {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ex-avatar {
  width: 1.05rem;
  height: 1.05rem;
  object-fit: cover;
}

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

.ex-pager {
  display: flex;
  justify-content: flex-start;
  gap: 0.55rem;
  margin: 1.15rem 0 0.2rem;
}
.ex-pager a {
  min-width: 6.8rem;
  text-align: center;
  padding: 0.65rem 1.05rem;
  background: var(--navy);
  color: #ffffff !important;
  font-weight: 700;
  border-bottom: 3px solid var(--pen);
}
.ex-pager a:hover { background: var(--pen); border-bottom-color: var(--navy); }

.ex-aside {
  position: sticky;
  top: calc(var(--header-h) + 0.8rem);
  display: grid;
  gap: 0.85rem;
}
.ex-side {
  background: var(--paper);
  padding: 0.95rem 0.95rem 0.6rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--pen);
}
.ex-side h3 {
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: var(--navy);
}
.ex-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: n;
}
.ex-side li { border-top: 1px dotted var(--line); }
.ex-side li a {
  display: flex;
  gap: 0.5rem;
  padding: 0.58rem 0;
  color: var(--ink);
  font-size: 0.88rem;
}
.ex-side .ex-widlist a::before {
  counter-increment: n;
  content: "(" counter(n) ")";
  color: var(--pen);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: 0 0 1.7rem;
  font-size: 0.76rem;
}
.ex-topthub a {
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0;
}
.ex-topthub img {
  width: 100%;
  height: 7.4rem;
  object-fit: cover;
}
.ex-topthub span { font-weight: 650; }

.ex-article-card {
  background: var(--paper);
  padding: clamp(1.15rem, 3.2vw, 2.2rem);
  border: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--pen);
  position: relative;
}
.ex-article-card::after {
  content: "阅";
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--pen);
  border-radius: 50%;
  color: var(--pen);
  font-size: 1.15rem;
  font-weight: 900;
  opacity: 0.55;
  transform: rotate(-12deg);
  pointer-events: none;
}
.ex-article-card h1 {
  margin: 0 0 0.7rem;
  text-align: left;
  font-size: clamp(1.32rem, 3vw, 1.9rem);
  line-height: 1.35;
  padding-right: 3rem;
}
.ex-bloginfo {
  display: flex;
  justify-content: flex-start;
  color: var(--pen);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}
.ex-bloginfo ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ex-prose {
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.95;
  color: #1e293b;
  max-width: 44rem;
}
.ex-prose img,
.ex-prose video,
.ex-prose iframe,
.ex-prose table { max-width: 100%; }
.ex-prose table { display: block; overflow-x: auto; }
.ex-copyright {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}
.ex-pagerow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.15rem;
}
.ex-pagerow a {
  display: block;
  padding: 0.8rem 0.9rem;
  background: #fff1f2;
  border: 1px dashed var(--line);
  font-size: 0.86rem;
  line-height: 1.45;
}
.ex-pagerow .next { text-align: right; }

.ex-footer {
  background: var(--navy);
  padding: 1.5rem 1rem 2.3rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.86rem;
  border-top: 3px solid var(--pen);
}
.ex-footer p { margin: 0 0 0.7rem; }
.ex-footer a { color: #fda4af; margin: 0 0.35rem; }

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

.ex-mask { display: none; }

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

@media (max-width: 768px) {
  .ex-nav-toggle { display: inline-flex; }
  .ex-nav {
    left: auto;
    right: 0;
    top: 0;
    width: min(84vw, 20rem);
    height: 100dvh;
    margin: 0;
    display: block;
    background: #fff;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 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;
    border-left: 4px solid var(--pen);
  }
  body.nav-open .ex-nav {
    transform: translateX(0);
    visibility: visible;
  }
  .ex-nav > ul {
    flex-direction: column;
    gap: 0.2rem;
  }
  .ex-sub {
    display: block;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 0.4rem 0.8rem;
    background: transparent;
  }
  .ex-nav-parent {
    color: var(--ink);
  }
  .ex-nav-item:hover .ex-nav-parent {
    background: #fff1f2;
    color: var(--pen);
    border-color: transparent;
  }
  .ex-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
    z-index: 40;
  }
  body.nav-open .ex-mask {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }
  .ex-card {
    grid-template-columns: 2.2rem 4.3rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.8rem;
  }
  .ex-card::before {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 0.8rem;
  }
  .ex-card-cover,
  .ex-card-cover img {
    min-height: 4.3rem;
    height: 4.3rem;
  }
  .ex-pagerow { grid-template-columns: 1fr; }
  .ex-pagerow .next { text-align: left; }
}

@media (max-width: 420px) {
  .ex-card {
    grid-template-columns: 2.1rem minmax(0, 1fr);
    grid-template-areas: "num cover" "num body";
  }
  .ex-card::before { grid-area: num; }
  .ex-card-cover { grid-area: cover; }
  .ex-card > div { grid-area: body; }
  .ex-card-cover,
  .ex-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;
  }
}
