.theme-header {
  min-height: 4.8rem;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(247, 244, 237, 0.96);
}

.theme-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.4rem;
}

.theme-links > a {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.theme-links > a:hover,
.theme-links > a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.theme-status {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.72rem;
  line-height: 1.55;
}

.theme-status strong { color: var(--ink); }

.theme-papers {
  background: var(--paper-2);
}

.theme-paper small {
  display: block;
  margin-top: 0.8rem;
  color: var(--ink-2);
  font-size: 0.68rem;
  line-height: 1.45;
}

.theme-caution {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-left: 0.3rem solid var(--coral);
  background: rgba(255, 255, 255, 0.6);
}

.theme-caution strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-caution p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1.65;
}

.theme-next {
  color: var(--white);
  background: var(--ink);
}

.theme-next-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(255,255,255,0.22);
  border-left: 1px solid rgba(255,255,255,0.22);
}

.theme-next-grid a {
  min-height: 9rem;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255,255,255,0.22);
  border-bottom: 1px solid rgba(255,255,255,0.22);
  color: var(--white);
  text-decoration: none;
}

.theme-next-grid a[aria-current="page"] { color: var(--ink); background: var(--acid); }
.theme-next-grid a:hover, .theme-next-grid a:focus-visible { color: var(--ink); background: var(--white); }
.theme-next-grid span { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.theme-next-grid strong { font: 400 1.35rem/1.1 var(--serif); }

html[lang^="zh"] .theme-links > a,
html[lang^="zh"] .theme-caution strong,
html[lang^="zh"] .theme-next-grid span {
  letter-spacing: 0.03em;
  text-transform: none;
}

@media (max-width: 760px) {
  .theme-header { align-items: flex-start; padding-top: 1rem; padding-bottom: 1rem; }
  .theme-links { gap: 0.65rem; flex-wrap: wrap; }
  .theme-links > a { display: none; }
  .theme-next-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .theme-next-grid { grid-template-columns: 1fr; }
}
