:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --soft: #f0f2f5;
  --text: #20242a;
  --muted: #858b93;
  --line: #e7e9ed;
  --accent: #188c8c;
  --accent-soft: #dff4f2;
  --shadow: 0 16px 40px rgb(23 31 42 / 5%);
  --radius: 12px;
  --category-color: #047857;
}

[data-color-scheme="dark"] {
  color-scheme: dark;
  --bg: #111417;
  --panel: #181c20;
  --soft: #20252a;
  --text: #eff3f6;
  --muted: #a0a8b0;
  --line: #2b3137;
  --accent: #4fb8b4;
  --accent-soft: #143333;
  --shadow: 0 16px 42px rgb(0 0 0 / 24%);
  --category-color: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

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

.site-footer {
  padding: 18px 16px;
  color: #1677ff;
  font-size: 13px;
  line-height: 24px;
  text-align: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: top;
}

.site-footer .site-footer-badge {
  width: 18px;
  height: 20px;
  flex: none;
  object-fit: contain;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #0958d9;
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

.theme-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 34px;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 40px;
}

.theme-shell.public-shell {
  min-height: 100vh;
  --public-inline-padding: 40px;
  --public-bead-inset: 12px;
  --public-bead-size: 54px;
  --public-banner-top: 18px;
  --public-rail-width: 300px;
  --public-column-gap: 34px;
  --public-rail-space: 0px;
  --public-banner-min: 128px;
  --public-banner-height: max(var(--public-banner-min), calc((100vw - 2 * var(--public-inline-padding) - var(--public-rail-space)) / 12));
  --public-content-top: calc(var(--public-banner-top) + var(--public-banner-height) + 18px);
  position: relative;
  grid-template-areas:
    "rail header"
    "rail content";
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 18px;
  width: 100%;
}

.theme-home {
  width: 100%;
}

.public-header {
  position: static;
  grid-area: header;
  min-width: 0;
  /* Reserve the banner's space while its artwork stays fixed in the viewport. */
  height: var(--public-banner-height);
}

.public-header::before {
  content: "";
  position: fixed;
  top: 0;
  left: calc(var(--public-inline-padding) + var(--public-rail-space));
  right: 0;
  height: calc(var(--public-content-top) - 12px);
  z-index: 79;
  background: var(--bg);
  pointer-events: none;
}

.public-header .cover-strip.mountain-strip {
  position: fixed;
  top: var(--public-banner-top);
  left: calc(var(--public-inline-padding) + var(--public-rail-space));
  right: var(--public-inline-padding);
  z-index: 80;
  width: auto;
  height: var(--public-banner-height);
  aspect-ratio: auto;
  min-width: 0;
  margin: 0;
}

.site-rail-control {
  position: fixed;
  /* Keep the control still when scrolling or opening the sidebar. */
  top: 30px;
  left: calc(var(--public-inline-padding) + var(--public-bead-inset));
  z-index: 130;
  width: var(--public-bead-size);
  height: var(--public-bead-size);
}

.site-rail-bead {
  appearance: none;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.site-rail-bead:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.public-shell > .content-stream {
  display: flex;
  flex-direction: column;
  grid-area: content;
  padding-top: 0;
}

.public-shell > .content-stream > * { flex-shrink: 0; }
.public-shell > .content-stream > .site-footer { margin-top: auto; }

.theme-shell.public-shell[data-site-rail-state="closed"] {
  grid-template-areas:
    "header"
    "content";
}

.theme-shell.public-shell[data-site-rail-state="open"] {
  --public-rail-space: calc(var(--public-rail-width) + var(--public-column-gap));
}

.theme-shell[data-site-rail-state="closed"] {
  grid-template-columns: minmax(0, 1fr);
}

.site-rail {
  grid-area: rail;
  position: sticky;
  align-self: start;
  display: flex;
  flex-direction: column;
  padding: 84px 6px 18px;
  top: 18px;
  height: calc(100vh - 36px);
  overflow-y: auto;
}

.theme-shell[data-site-rail-state="closed"] .site-rail {
  display: none;
}

/* 手机导航抽屉的背景遮罩。 */
.site-rail-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgb(15 20 25 / 45%);
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
}

.brand-avatar {
  position: relative;
  z-index: 0;
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  isolation: isolate;
  overflow: visible;
}

.brand-avatar img {
  position: relative;
  z-index: 1;
  animation: none;
  transform: none;
}

.brand img,
.site-rail-bead img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.brand-avatar img {
  box-shadow: none;
}

.site-rail-bead img {
  filter: drop-shadow(2px 4px 3px rgb(30 53 68 / 24%));
  animation: tianni-bead-rotation 48s linear infinite;
  transform-origin: 50% 50%;
  transition: filter .25s ease;
}

@keyframes tianni-bead-rotation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .site-rail-bead img { animation: none; }
}

.site-rail-bead:hover img,
.site-rail-bead:focus-visible img {
  filter: drop-shadow(2px 4px 3px rgb(30 53 68 / 28%)) drop-shadow(0 0 3px rgb(99 203 237 / 30%));
}

.brand-title,
.brand-email {
  display: block;
  width: fit-content;
}

.brand strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.brand small,
.login-link small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.brand-email:hover small {
  color: var(--accent);
}

.search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin: 14px 0 22px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
}

.search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.search span {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

kbd {
  min-width: 26px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.nav-block {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.nav-menu-item {
  display: grid;
  gap: 3px;
}

.nav-block h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.nav-block a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 15px;
}

.nav-block a.active,
.nav-block a:hover {
  background: var(--soft);
  color: var(--text);
}

.nav-block span {
  width: 22px;
  text-align: center;
}

.nav-menu-group {
  gap: 0;
}

.nav-menu-summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.nav-menu-summary::-webkit-details-marker {
  display: none;
}

.nav-menu-summary > a,
.nav-menu-summary > .nav-menu-label {
  flex: 1;
}

.nav-menu-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 15px;
}

.nav-caret {
  color: var(--muted);
  transition: transform 0.15s ease;
}

.nav-menu-group[open] > .nav-menu-summary .nav-caret {
  transform: rotate(180deg);
}

.nav-submenu {
  display: grid;
  gap: 2px;
  margin: 0 0 4px 21px;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.nav-submenu a {
  min-height: 34px;
  color: var(--muted);
  font-size: 14px;
}

.nav-submenu span {
  color: var(--muted);
}

.nav-block em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.display-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.display-control label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.display-control select {
  width: auto;
  min-width: 78px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  color: var(--text);
  font: inherit;
}

.display-control select:focus {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.rail-bottom {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-bottom: 8px;
}

.login-link {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 8px;
}

.login-link.signed-in {
  cursor: default;
}

.login-link span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
}

.login-info-link,
.login-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-info-link:hover strong {
  color: var(--accent);
}

.login-avatar-link span {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-avatar-link:hover span {
  background: var(--accent-soft);
  color: var(--accent);
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-left: 52px;
  width: 148px;
}

.account-actions a,
.account-actions .logout-form button {
  display: grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  color: color-mix(in srgb, var(--text) 76%, var(--muted));
  font-size: 12px;
}

.account-actions .logout-form {
  display: contents;
}

.account-actions .logout-form button {
  width: 100%;
  padding: 0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.account-actions a:hover,
.account-actions .logout-form button:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent);
}

/* pjax 局部导航请求进行中的轻量反馈 */
html.pjax-loading,
html.pjax-loading body {
  cursor: progress;
}

.not-found-page {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.not-found-page .not-found-code {
  color: var(--muted);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 4px;
  margin: 0;
}

.not-found-page h1 {
  margin: 0;
}

.not-found-page .not-found-home {
  color: var(--accent);
}

.theme-tools {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 2px;
  width: max-content;
  margin-left: 52px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}

.theme-tools button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-tools button.active {
  background: var(--soft);
  color: var(--text);
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 2px;
  margin-left: 52px;
  width: max-content;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}

.profile-links a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 26px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.profile-links a:hover,
.profile-links a:focus-visible {
  background: var(--soft);
  color: var(--accent);
  outline: 0;
}

.profile-links span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.profile-links a:nth-child(1) span,
.profile-links a:nth-child(3) span {
  font-size: 11px;
}

.content-stream {
  min-width: 0;
  padding-top: 34px;
}

.cover-strip {
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
  height: clamp(130px, 14vw, 170px);
  border: 1px solid color-mix(in srgb, #79b6d4 28%, var(--line));
  border-radius: 12px;
  background: #b9dcf1;
  box-shadow: var(--shadow);
}

.cover-strip.mountain-strip {
  height: auto;
  min-height: 80px;
  aspect-ratio: 12 / 1;
}

.cover-strip.pencil-banner {
  --banner-brand-start: 84px;
  --banner-brand-width: clamp(180px, 30%, 300px);
  border-color: color-mix(in srgb, #736b5d 16%, var(--line));
  background-color: transparent;
  background-repeat: repeat-x;
  background-position: left center;
  background-size: auto 100%;
}

.banner-brand {
  position: absolute;
  top: 0;
  bottom: 14px;
  left: var(--banner-brand-start);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: var(--banner-brand-width);
  min-width: 0;
}

.banner-brand-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.banner-brand-description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (min-width: 821px) {
  .public-shell[data-site-rail-state="open"] .pencil-banner {
    --banner-brand-start: 16px;
  }
}

.cover-strip::-webkit-scrollbar {
  display: none;
}

.cover-track {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0;
}

.cover-slide {
  min-width: 0;
}

.pencil-motor-runway {
  position: absolute;
  inset: 0 8px 0 calc(var(--banner-brand-start) + var(--banner-brand-width) + 16px);
  z-index: 0;
  display: block;
  pointer-events: none;
}

.molecular-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.molecular-motor-shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 5px;
  border-radius: 50%;
  background: rgb(59 66 82 / 20%);
  filter: blur(2px);
  transform-origin: 50% 50%;
  will-change: transform;
}

.pencil-motor {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  max-width: none;
  height: min(86px, 72%);
  transform-origin: 50% 84%;
  will-change: transform;
}

.mountain-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgb(255 255 255 / 4%), transparent 62%, rgb(20 55 77 / 9%));
  pointer-events: none;
}

.pencil-banner::after {
  display: none;
}

.mountain-cloud-layer {
  position: absolute;
  left: -26%;
  top: -12%;
  z-index: 1;
  width: 152%;
  height: 78%;
  opacity: .34;
  filter: blur(7px);
  mix-blend-mode: screen;
  pointer-events: none;
  will-change: transform;
}

.mountain-cloud-layer-back {
  background:
    radial-gradient(ellipse at 9% 38%, rgb(255 255 255 / 74%) 0 7%, transparent 22%),
    radial-gradient(ellipse at 32% 28%, rgb(255 255 255 / 55%) 0 6%, transparent 20%),
    radial-gradient(ellipse at 58% 43%, rgb(255 255 255 / 63%) 0 8%, transparent 24%),
    radial-gradient(ellipse at 84% 25%, rgb(255 255 255 / 58%) 0 6%, transparent 19%);
  animation: mountain-cloud-drift-back 54s linear infinite;
}

.mountain-cloud-layer-front {
  top: 7%;
  height: 68%;
  opacity: .26;
  filter: blur(11px);
  background:
    radial-gradient(ellipse at 18% 45%, rgb(255 255 255 / 78%) 0 7%, transparent 22%),
    radial-gradient(ellipse at 47% 35%, rgb(255 255 255 / 65%) 0 8%, transparent 25%),
    radial-gradient(ellipse at 73% 49%, rgb(255 255 255 / 62%) 0 7%, transparent 22%),
    radial-gradient(ellipse at 94% 31%, rgb(255 255 255 / 72%) 0 6%, transparent 20%);
  animation: mountain-cloud-drift-front 36s linear infinite;
}

.mountain-banner-tianni {
  position: absolute;
  left: 76%;
  top: 30%;
  z-index: 2;
  width: clamp(34px, 3.4vw, 42px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.mountain-banner-five-elements {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.mountain-banner-bead {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .94;
  filter: drop-shadow(0 0 4px rgb(112 224 255 / 84%));
}

.mountain-banner-element {
  width: 5px;
  height: 5px;
}

@keyframes mountain-cloud-drift-back {
  from {
    transform: translate3d(-5%, 0, 0);
  }

  to {
    transform: translate3d(8%, 1px, 0);
  }
}

@keyframes mountain-cloud-drift-front {
  from {
    transform: translate3d(-8%, 1px, 0);
  }

  to {
    transform: translate3d(10%, -2px, 0);
  }
}

.gourd-garden {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.gourd-card,
.gourd-title-card {
  --gourd-main: #c9872b;
  --gourd-dark: #7d4a16;
  --gourd-light: #f2c16a;
  --slot-x: 12.1%;
  --slot-top: 56%;
  --gourd-size: 46px;
  --string-height: 5px;
  position: absolute;
  left: var(--slot-x);
  top: var(--slot-top);
  width: min(116px, 13%);
  color: #143347;
  transform: translateX(-50%);
}

.gourd-card {
  top: 0;
  bottom: 0;
  display: block;
  height: auto;
  pointer-events: none;
}

/* The decorative vine is a responsive background image while each gourd is
   positioned independently. Draw the final connector in the gourd's own
   coordinate system so browser zoom cannot open a sub-pixel gap between them. */
.gourd-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -1px;
  width: 3px;
  height: calc(var(--slot-top) + 6px);
  border-radius: 999px;
  background: linear-gradient(180deg, #568529 0%, #47751f 76%, #6f491f 92%, #8a5219 100%);
  box-shadow: inset -1px 0 0 rgb(38 77 15 / 42%);
  transform: translateX(-50%);
}

.gourd-title-card {
  top: var(--slot-top);
  display: block;
  height: calc(var(--string-height) + var(--gourd-size) + 10px);
  z-index: 4;
  transition: transform 0.18s ease;
}

.gourd-card:nth-child(7n + 1),
.gourd-title-card:nth-child(7n + 1) {
  --slot-x: 12.8%;
  --slot-top: 53%;
  --gourd-size: 48px;
  --string-height: 5px;
}

.gourd-card:nth-child(7n + 2),
.gourd-title-card:nth-child(7n + 2) {
  --slot-x: 23.3%;
  --slot-top: 47%;
  --gourd-size: 45px;
  --string-height: 4px;
}

.gourd-card:nth-child(7n + 3),
.gourd-title-card:nth-child(7n + 3) {
  --slot-x: 36.8%;
  --slot-top: 58%;
  --gourd-size: 47px;
  --string-height: 5px;
}

.gourd-card:nth-child(7n + 4),
.gourd-title-card:nth-child(7n + 4) {
  --slot-x: 51.2%;
  --slot-top: 45%;
  --gourd-size: 45px;
  --string-height: 4px;
}

.gourd-card:nth-child(7n + 5),
.gourd-title-card:nth-child(7n + 5) {
  --slot-x: 62.3%;
  --slot-top: 51%;
  --gourd-size: 46px;
  --string-height: 5px;
}

.gourd-card:nth-child(7n + 6),
.gourd-title-card:nth-child(7n + 6) {
  --slot-x: 72.5%;
  --slot-top: 46%;
  --gourd-size: 44px;
  --string-height: 4px;
}

.gourd-card:nth-child(7n),
.gourd-title-card:nth-child(7n) {
  --slot-x: 88.6%;
  --slot-top: 32%;
  --gourd-size: 45px;
  --string-height: 4px;
}

.gourd-title-card:hover,
.gourd-title-card:focus-visible {
  transform: translateX(-50%);
  outline: 0;
}

.gourd-swing {
  position: absolute;
  left: 50%;
  top: var(--slot-top);
  z-index: 1;
  display: grid;
  justify-items: center;
  width: max-content;
  translate: -50% 0;
  transform-origin: 50% 0;
  animation: gourd-sway 4.2s ease-in-out infinite;
  animation-delay: calc(var(--gourd-i, 0) * -0.38s);
}

.gourd-string {
  position: relative;
  display: block;
  width: 10px;
  height: calc(var(--string-height) + 4px);
  margin-bottom: -2px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgb(255 233 174 / 24%), transparent 36%),
    linear-gradient(160deg, #7a4b23 0%, #4e2d15 50%, #9b6c34 100%);
  box-shadow:
    inset -2px 0 0 rgb(55 31 15 / 42%),
    0 2px 2px rgb(57 48 30 / 14%);
  transform: rotate(11deg);
  transform-origin: 50% 0;
}

.gourd-string::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 14px;
  height: 6px;
  border-radius: 60% 45% 48% 52%;
  background:
    linear-gradient(180deg, #a97b45, #5b361a 72%, #342012);
  box-shadow: inset 0 2px 0 rgb(255 225 166 / 24%);
  transform: translateX(-50%) rotate(-10deg);
}

.gourd-string::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 12px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(180deg, #b87b2f, #8a5219);
  transform: translateX(-50%);
}

.gourd-body {
  position: relative;
  display: block;
  width: calc(var(--gourd-size) * 0.76);
  height: var(--gourd-size);
  margin-top: -1px;
  filter: drop-shadow(0 9px 9px rgb(74 52 24 / 22%));
}

.gourd-neck,
.gourd-belly {
  position: absolute;
  left: 50%;
  display: block;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 32% 28%, rgb(255 232 168 / 58%) 0 10%, transparent 11%),
    radial-gradient(circle at 72% 70%, rgb(255 255 255 / 13%) 0 7%, transparent 8%),
    radial-gradient(circle at 63% 42%, rgb(120 65 18 / 14%) 0 8%, transparent 9%),
    linear-gradient(145deg, var(--gourd-light) 0%, var(--gourd-main) 46%, var(--gourd-dark) 100%);
}

.gourd-neck {
  top: 2%;
  width: 56%;
  height: 53%;
  border-radius: 45% 55% 42% 46% / 35% 42% 58% 60%;
}

.gourd-belly {
  bottom: 0;
  width: 100%;
  height: 66%;
  border-radius: 48% 52% 50% 50% / 44% 44% 56% 56%;
}

.gourd-body::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 44%;
  width: 58%;
  height: 12%;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgb(255 221 122 / 34%), rgb(105 58 19 / 30%));
  transform: translateX(-50%);
  opacity: 0.78;
}

.gourd-body::before {
  content: "";
  position: absolute;
  inset: 16% 12% 8%;
  z-index: 1;
  border-radius: 48%;
  background:
    radial-gradient(circle at 28% 22%, rgb(255 244 190 / 42%) 0 5%, transparent 6%),
    radial-gradient(circle at 66% 30%, rgb(116 70 25 / 15%) 0 4%, transparent 5%),
    radial-gradient(circle at 38% 64%, rgb(92 52 20 / 12%) 0 5%, transparent 6%);
  pointer-events: none;
}

.gourd-title {
  display: -webkit-box;
  position: absolute;
  left: 50%;
  top: calc(var(--string-height) + var(--gourd-size) + 6px);
  width: max-content;
  max-width: 160px;
  min-height: 30px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 62%);
  border-radius: 8px;
  padding: 4px 6px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 8px 22px rgb(57 106 137 / 12%);
  color: inherit;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgb(255 255 255 / 80%);
  transform: translate(-50%, 4px);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(7px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gourd-title-card:hover .gourd-title,
.gourd-title-card:focus-visible .gourd-title {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

@keyframes gourd-sway {
  0%,
  100% {
    transform: rotate(-9deg);
  }

  50% {
    transform: rotate(9deg);
  }
}

@keyframes leaf-flutter {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 2px 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gourd-swing,
  .mountain-cloud-layer {
    animation: none;
  }

  .pencil-motor {
    animation: none;
    opacity: 1;
  }
}


.stream-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.stream-toolbar h1 {
  margin: 0;
  color: var(--category-color);
  font-size: 20px;
  font-weight: 650;
}

.stream-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}

.category-menu {
  position: relative;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 15px;
}

.category-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.category-menu summary::-webkit-details-marker {
  display: none;
}

.category-menu summary span {
  color: var(--muted);
  font-size: 12px;
}

.category-menu div {
  position: absolute;
  right: 0;
  z-index: 4;
  display: grid;
  min-width: 150px;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.category-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px;
  border-radius: 6px;
}

.category-menu a span {
  color: var(--muted);
  font-size: 12px;
}

.category-menu a:hover {
  background: var(--soft);
}

.filter-note {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.post-list {
  display: flex;
  flex-direction: column;
}

.home-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.home-column {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  overflow: hidden;
}

.home-column:only-child {
  grid-column: 1 / -1;
}

.home-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.home-column-head h2 {
  margin: 0;
  color: var(--category-color);
  font-size: 20px;
  font-weight: 650;
}

.home-column-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.column-pager-wrapper {
  padding: 12px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.home-column .post-list {
  padding: 0 10px;
}

.home-column .post-item {
  padding: 12px 4px;
}

.home-column .post-item:first-child {
  padding-top: 12px;
}

.home-column .post-item-title {
  font-size: 16px;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.home-column .post-meta {
  gap: 4px 8px;
  font-size: 12px;
}

.home-column-empty {
  padding: 28px 4px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* 一或两栏时填满可用宽度，长标题栏目可适度加宽；三栏时保持等宽。 */
@media (min-width: 821px) {
  .home-columns:not(:has(> .home-column:nth-child(3))) {
    display: flex;
    align-items: flex-start;
  }

  .home-columns:not(:has(> .home-column:nth-child(3))) > .home-column {
    flex: 1 1 auto;
    min-width: calc((100% - 32px) / 3);
    max-width: 100%;
  }

  .home-columns:not(:has(> .home-column:nth-child(3))) > .home-column:only-child {
    min-width: 100%;
  }

  .home-columns:has(> .home-column-teaching):has(> .home-column-notes):not(:has(> .home-column:nth-child(3))) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-columns:has(> .home-column-teaching):has(> .home-column-notes):not(:has(> .home-column:nth-child(3))) > .home-column {
    min-width: 0;
    max-width: none;
  }
}

.public-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.public-pager a,
.public-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 13px;
}

.public-pager a:hover,
.public-pager span {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--soft);
  color: var(--text);
}

/* 首页文章改为标题列表：标题 + 置顶/编辑/删除，下一行放元信息，无封面图 */
.post-item {
  padding: 13px 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  transition: background-color 160ms ease;
}

.post-item:first-child {
  padding-top: 2px;
}

.post-item:last-child {
  border-bottom: 0;
}

.post-item:hover {
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}

.post-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 0 7px;
}

.post-item-title {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-item-title a {
  color: inherit;
}

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

.post-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pin-indicator {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 15px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  flex: 1 0 auto;
  justify-content: flex-start;
  min-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.post-meta a {
  color: color-mix(in srgb, var(--accent) 70%, var(--muted));
}

.post-meta .post-edit-link {
  margin-left: auto;
  padding: 2px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.post-meta .post-edit-link:hover {
  background: var(--accent);
  color: #fff;
}

.empty-state {
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.article-stream {
  container-type: inline-size;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.article-page {
  --reading-width: 70vw;
  padding: 0 0 64px;
}

.article-page header {
  margin-bottom: 36px;
}

.article-hero {
  display: grid;
  gap: 18px;
}

.article-hero.has-cover {
  /* 所有文章封面统一使用缩小后的葫芦图尺寸。 */
  grid-template-columns: minmax(22.8px, 4%) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: calc(var(--radius) * .2);
  object-fit: cover;
  background: var(--soft);
}

/* 无封面时用葫芦默认图：完整显示不裁切 */
.article-cover.is-default-cover {
  object-fit: contain;
  background: #fff;
}

.article-cover-col {
  min-width: 0;
  width: 100%;
}

.article-title-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.article-title-actions form {
  display: inline-flex;
  margin: 0;
}

.post-action-btn {
  background: transparent !important;
  border: none !important;
  padding: 4px !important;
  margin: 0 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
  outline: none;
  border-radius: 4px;
}

.post-action-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform 0.15s ease;
}

.post-action-btn:hover svg {
  transform: scale(1.15);
}

.post-action-btn.edit-btn {
  color: var(--accent);
}

.post-action-btn.edit-btn:hover {
  color: color-mix(in srgb, var(--accent) 85%, black);
  background: var(--accent-soft) !important;
}

.post-action-btn.delete-btn {
  color: color-mix(in srgb, var(--text) 45%, var(--muted));
}

.post-action-btn.delete-btn:hover {
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 10%, transparent) !important;
}

.post-item-actions .pin-toggle {
  display: inline-flex;
  flex-shrink: 0;
  margin: 0;
}

.post-action-btn.pin-btn {
  position: relative;
  color: color-mix(in srgb, var(--text) 40%, var(--muted));
}

/* 悬停时在按钮上方弹出功能说明气泡 */
.post-action-btn.pin-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translate(-50%, 3px);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 40;
}

.post-action-btn.pin-btn::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translate(-50%, 3px) rotate(45deg);
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 41;
}

.post-action-btn.pin-btn:hover::after,
.post-action-btn.pin-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.post-action-btn.pin-btn:hover::before,
.post-action-btn.pin-btn:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) rotate(45deg);
}

.post-action-btn.pin-btn:hover,
.post-action-btn.pin-btn.is-pinned {
  color: var(--accent);
}

.post-action-btn.pin-btn:hover {
  background: var(--accent-soft) !important;
}

.article-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
}

.article-title-row {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.article-heading h1 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: clamp(18px, 2.4vw, 28px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.article-heading > .post-meta {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.reading-layout {
  display: grid;
  grid-template-areas: "body";
  grid-template-columns: minmax(0, var(--reading-width));
  justify-content: center;
  align-items: start;
  gap: 18px 12px;
  min-width: 0;
}

.reading-layout.has-outline {
  /* The outline uses the right margin; equal side tracks keep the body centered. */
  grid-template-areas: ". body outline";
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--reading-width)) minmax(0, 1fr);
}

@media (min-width: 821px) {
  .public-shell[data-site-rail-state="open"] .article-page {
    --reading-width: 70cqw;
  }
}

.reading-layout > .article-content {
  grid-area: body;
  min-width: 0;
}

.reading-layout > .article-content :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: var(--public-content-top);
}

.public-shell #comments {
  scroll-margin-top: var(--public-content-top);
}

.article-outline {
  position: sticky;
  top: var(--public-content-top);
  grid-area: outline;
  min-width: 0;
  max-height: calc(100vh - var(--public-content-top) - 18px);
  max-height: calc(100dvh - var(--public-content-top) - 18px);
  padding: 4px 0 12px 8px;
  border-left: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.article-outline[hidden] {
  display: none;
}

.article-outline-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.article-outline ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-outline li {
  --outline-depth: 0;
  min-width: 0;
  margin: 0;
  padding-left: min(calc(var(--outline-depth) * 10px), 12px);
}

.article-outline [data-outline-level="2"] { --outline-depth: 1; }
.article-outline [data-outline-level="3"] { --outline-depth: 2; }
.article-outline [data-outline-level="4"] { --outline-depth: 3; }
.article-outline [data-outline-level="5"] { --outline-depth: 4; }
.article-outline [data-outline-level="6"] { --outline-depth: 5; }

.article-outline a {
  display: block;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.article-outline a:hover,
.article-outline a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 820px) {
  .reading-layout.has-outline {
    grid-template-areas: "outline" "body";
    grid-template-columns: minmax(0, var(--reading-width));
    gap: 18px;
  }

  .article-outline {
    position: static;
    max-height: min(240px, 40vh);
    max-height: min(240px, 40dvh);
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
}

/* An open navigation rail can also leave a desktop article too narrow. */
@container (max-width: 720px) {
  .reading-layout.has-outline {
    grid-template-areas: "outline" "body";
    grid-template-columns: minmax(0, var(--reading-width));
    gap: 18px;
  }

  .article-outline {
    position: static;
    max-height: min(240px, 40vh);
    max-height: min(240px, 40dvh);
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
}

.article-content {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: 17px;
  line-height: 1.88;
  overflow-wrap: anywhere;
}

/* highlight.js 使用本地 GitHub 主题；深色模式由站点变量统一覆盖。 */
[data-color-scheme="dark"] .article-content .hljs {
  color: #c9d1d9;
  background: #161b22;
}

[data-color-scheme="dark"] .article-content .hljs-doctag,
[data-color-scheme="dark"] .article-content .hljs-keyword,
[data-color-scheme="dark"] .article-content .hljs-meta .hljs-keyword,
[data-color-scheme="dark"] .article-content .hljs-template-tag,
[data-color-scheme="dark"] .article-content .hljs-template-variable,
[data-color-scheme="dark"] .article-content .hljs-type,
[data-color-scheme="dark"] .article-content .hljs-variable.language_ {
  color: #ff7b72;
}

[data-color-scheme="dark"] .article-content .hljs-title,
[data-color-scheme="dark"] .article-content .hljs-title.class_,
[data-color-scheme="dark"] .article-content .hljs-title.function_ {
  color: #d2a8ff;
}

[data-color-scheme="dark"] .article-content .hljs-attr,
[data-color-scheme="dark"] .article-content .hljs-literal,
[data-color-scheme="dark"] .article-content .hljs-number,
[data-color-scheme="dark"] .article-content .hljs-operator,
[data-color-scheme="dark"] .article-content .hljs-variable {
  color: #79c0ff;
}

[data-color-scheme="dark"] .article-content .hljs-regexp,
[data-color-scheme="dark"] .article-content .hljs-string {
  color: #a5d6ff;
}

[data-color-scheme="dark"] .article-content .hljs-comment,
[data-color-scheme="dark"] .article-content .hljs-code,
[data-color-scheme="dark"] .article-content .hljs-formula {
  color: #8b949e;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--text);
  line-height: 1.35;
  font-weight: 650;
}

.article-content h1 {
  font-size: clamp(19px, 1.9vw, 22px);
  margin: 1.6em 0 0.6em;
}

.article-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

.article-content h2 {
  font-size: clamp(17px, 1.7vw, 19px);
  margin: 1.4em 0 0.5em;
}

.article-content h3 {
  font-size: clamp(15px, 1.5vw, 17px);
  margin: 1.2em 0 0.4em;
}

.article-content h4 {
  font-size: 15px;
  margin: 1.1em 0 0.3em;
}

.article-content p {
  margin: 0 0 1.1em;
}

.article-content ul,
.article-content ol {
  padding-left: 1.3em;
}

.article-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--soft);
}

.article-content pre {
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: var(--soft);
}

.article-content img,
.article-content video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 16px 0 22px;
  border-radius: 8px;
  background: var(--soft);
}

.article-content iframe {
  display: block;
  max-width: 100%;
  margin: 16px 0 22px;
  border-radius: 8px;
  background: var(--soft);
}

@media (max-width: 1360px) and (min-width: 1181px) {
  .theme-shell.public-shell {
    --public-inline-padding: 28px;
    --public-rail-width: 260px;
    --public-column-gap: 24px;
  }

  .theme-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding-right: 28px;
    padding-left: 28px;
  }

  .theme-shell[data-site-rail-state="closed"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-heading h1 {
    font-size: clamp(18px, 1.9vw, 25px);
  }
}

.article-content .MathJax,
.article-content mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 38px;
}

.article-tags a {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.comments-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: min(100%, var(--reading-width));
  margin-inline: auto;
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.comments-section :is(.comment-list, .comment-item, .comment-reply, .comment-form, .comment-form label) {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.comments-head,
.comment-item header,
.comment-reply header,
.comment-admin-actions {
  flex-wrap: wrap;
}

@container (max-width: 720px) {
  .comment-reply .comment-reply {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.comments-head h2 {
  margin: 0;
  font-size: 22px;
}

.comments-head span,
.comment-empty {
  color: var(--muted);
  font-size: 14px;
}

.comment-notice {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.comment-identity {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.comment-identity strong {
  color: var(--text);
}

.comment-badge {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--accent);
  font-size: 12px;
  max-width: 100%;
  white-space: normal;
}

.comment-reply {
  display: grid;
  gap: 6px;
  margin-left: 18px;
  border-left: 2px solid var(--line);
  padding: 8px 0 8px 12px;
}

.comment-reply header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.comment-reply p {
  margin: 0;
}

.comment-reply-box summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.comment-reply-box[open] summary {
  margin-bottom: 8px;
}

.comment-login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.comment-admin-actions {
  display: flex;
  gap: 8px;
}

.comment-admin-actions form {
  display: contents;
}

.comment-admin-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.comment-admin-actions button:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent);
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.comment-item header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
}

.comment-item time {
  color: var(--muted);
  font-size: 12px;
}

.comment-item p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  white-space: pre-wrap;
}

.comment-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.comment-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.comment-form textarea {
  resize: vertical;
}

.comment-form button {
  justify-self: start;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .theme-shell.public-shell {
    --public-rail-width: 260px;
  }

  .theme-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

}

@media (max-width: 820px) {
  .theme-shell.public-shell {
    --public-inline-padding: 14px;
    --public-bead-inset: 6px;
    --public-bead-size: 40px;
    --public-banner-top: calc(14px + env(safe-area-inset-top));
    --public-banner-min: 124px;
  }

  .theme-shell.public-shell[data-site-rail-state="open"] {
    --public-rail-space: 0px;
  }

  .home-columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-column:only-child {
    grid-column: auto;
  }

  .theme-shell {
    display: block;
    padding: 14px;
  }

  .site-rail-control {
    top: calc(20px + env(safe-area-inset-top));
  }

  .site-rail-bead,
  .site-rail-bead img {
    width: 40px;
    height: 40px;
  }

  .site-rail-bead .tianni-five-elements {
    transform: none;
  }

  .public-header {
    height: calc(var(--public-banner-height) + env(safe-area-inset-top));
    margin-bottom: 18px;
    padding-top: 0;
  }

  /* 左侧栏改为从左滑出的抽屉，完整保留导航/搜索/登录/主题切换 */
  .site-rail,
  .theme-shell[data-site-rail-state="closed"] .site-rail {
    position: fixed;
    top: calc(82px + env(safe-area-inset-top));
    left: 14px;
    bottom: auto;
    z-index: 120;
    display: flex;
    flex-direction: column;
    width: min(310px, calc(100vw - 28px));
    height: calc(100vh - 96px - env(safe-area-inset-top));
    height: calc(100dvh - 96px - env(safe-area-inset-top));
    border-radius: 12px;
    margin: 0;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--panel);
    box-shadow: 4px 0 24px rgb(0 0 0 / 15%);
    overflow-y: auto;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .theme-shell[data-mobile-rail="open"] .site-rail {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.25s ease;
  }

  .theme-shell[data-mobile-rail="open"] .site-rail-backdrop {
    display: block;
  }

  /* 抽屉打开时锁定背景滚动 */
  body:has(.theme-shell[data-mobile-rail="open"]) {
    overflow: hidden;
  }

  .brand {
    padding: 0 4px 12px;
  }

  .search kbd {
    display: none;
  }

  /* 播放器在手机上固定到右下角并保持低于导航抽屉。 */
  .aplayer.aplayer-fixed {
    left: auto !important;
    right: 12px !important;
    top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    z-index: 50;
    transform: none !important;
    transition: opacity 0.18s ease, visibility 0.18s ease;
  }

  body:has(.theme-shell[data-mobile-rail="open"]) .aplayer.aplayer-fixed {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .content-stream {
    padding-top: 4px;
  }

  .stream-toolbar {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .stream-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* 首页攀登横幅 */
  .cover-strip {
    margin: 0 -2px 22px;
    height: 104px;
    border-radius: 10px;
  }

  .cover-strip.mountain-strip {
    min-height: 52px;
  }

  .cover-strip.pencil-banner {
    --banner-brand-start: 58px;
    --banner-brand-width: min(40%, 180px);
  }

  .banner-brand {
    bottom: 8px;
    gap: 1px;
  }

  .banner-brand-title {
    font-size: 14px;
    line-height: 17px;
  }

  .banner-brand-description {
    font-size: 10px;
    line-height: 12px;
  }

  .mountain-banner-tianni {
    left: 76%;
    top: 32%;
  }

  .cover-track {
    inset: 0;
  }

  .gourd-card,
  .gourd-title-card {
    --gourd-size: 20px;
    --string-height: 3px;
    width: 42px;
  }

  .gourd-card {
    grid-template-rows: calc(var(--gourd-size) + var(--string-height) + 2px) 42px;
  }

  .gourd-card:nth-child(7n + 1),
  .gourd-title-card:nth-child(7n + 1) {
    --slot-x: 12.8%;
    --slot-top: 34%;
    --gourd-size: 22px;
    --string-height: 4px;
  }

  .gourd-card:nth-child(7n + 2),
  .gourd-title-card:nth-child(7n + 2) {
    --slot-top: 30%;
    --gourd-size: 20px;
    --string-height: 3px;
  }

  .gourd-card:nth-child(7n + 3),
  .gourd-title-card:nth-child(7n + 3) {
    --slot-top: 38%;
    --gourd-size: 21px;
    --string-height: 4px;
  }

  .gourd-card:nth-child(7n + 4),
  .gourd-title-card:nth-child(7n + 4) {
    --slot-top: 29%;
    --gourd-size: 20px;
    --string-height: 3px;
  }

  .gourd-card:nth-child(7n + 5),
  .gourd-title-card:nth-child(7n + 5) {
    --slot-top: 34%;
    --gourd-size: 21px;
    --string-height: 4px;
  }

  .gourd-card:nth-child(7n + 6),
  .gourd-title-card:nth-child(7n + 6) {
    --slot-top: 30%;
    --gourd-size: 19px;
    --string-height: 3px;
  }

  .gourd-card:nth-child(7n),
  .gourd-title-card:nth-child(7n) {
    --slot-x: 88.6%;
    --slot-top: 19%;
    --gourd-size: 20px;
    --string-height: 3px;
  }

  .gourd-title {
    min-height: 26px;
    padding: 3px 2px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1.2;
  }

  /* 文章使用标题列表方式 */
  .post-list {
    border-top: 1px solid var(--line);
  }

  .post-item {
    padding: 12px 6px;
  }

  .post-item:hover {
    background: transparent;
  }

  .post-item-head {
    gap: 8px;
    margin: 0 0 6px;
  }

  .post-item-title {
    font-size: 16px;
    line-height: 1.4;
    white-space: normal;
  }

  .post-meta {
    min-width: 0;
    font-size: 12px;
    margin-top: 4px;
    gap: 4px 10px;
  }

  .article-hero.has-cover {
    grid-template-columns: 12% minmax(0, 1fr);
    align-items: start;
  }

  .article-cover {
    width: 100%;
    margin: 0;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-rail,
  .theme-shell[data-mobile-rail="open"] .site-rail {
    transition: none;
  }
}

/* Hiding the banner releases its full layout space; the bead remains floating. */
html[data-banner-hidden="true"] .public-shell {
  --public-banner-height: 0px;
  --public-content-top: var(--public-banner-top);
  row-gap: 0;
}
html[data-banner-hidden="true"] .public-header {
  height: 0;
  margin-bottom: 0;
}
html[data-banner-hidden="true"] .public-header .cover-strip,
html[data-banner-hidden="true"] .public-header::before { display: none; }
/* Align the whole home stream with the bead's right edge. An open desktop
   sidebar already supplies this clearance; the mobile drawer overlays it. */
html[data-banner-hidden="true"] .theme-home > .content-stream {
  margin-left: max(0px, calc(var(--public-bead-inset) + var(--public-bead-size) - var(--public-rail-space)));
}
@media (max-width: 820px) {
  html[data-banner-hidden="true"] .public-shell {
    padding-top: calc(14px + env(safe-area-inset-top));
  }
}

/* Codex announcements: redesigned to match codexreset.com while using site theme */
.home-column-codex {
  background: var(--panel);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
}
.codex-head {
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.codex-head h2 {
  color: var(--text);
  white-space: nowrap;
}
.codex-refresh-btn {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.codex-refresh-btn:hover {
  background: var(--soft);
}
.codex-refresh-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.codex-dashboard {
  padding: 20px 16px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.codex-hero {
  text-align: center;
  margin-bottom: 24px;
}
.codex-reset-since {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.codex-reset-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 4px;
  font-weight: 600;
}
.codex-reset-relative {
  font-size: 42px;
  font-weight: 700;
  margin: 0;
  color: var(--accent);
  line-height: 1.1;
  text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
.codex-reset-abs {
  font-size: 13px;
  margin: 8px 0 0;
  color: var(--muted);
}
.codex-forecast-console {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.codex-console-prompt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  margin: 0 0 16px;
  color: var(--muted);
}
.codex-ps1 {
  color: var(--accent);
  font-weight: bold;
  margin-right: 8px;
}
.codex-verdict {
  color: var(--text);
  font-weight: 600;
}
.verdict-yes {
  color: var(--accent);
}
.codex-signal-box {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.codex-signal-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.codex-signal-icon {
  font-size: 16px;
  line-height: 1.4;
}
.codex-signal-quote {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.codex-signal-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.codex-signal-meta a {
  color: var(--accent);
  text-decoration: none;
}
.codex-signal-meta a:hover {
  text-decoration: underline;
}
.codex-forecast-cols {
  border-top: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding-top: 16px;
}
@media (max-width: 600px) {
  .codex-forecast-cols {
    grid-template-columns: 1fr;
  }
}
.codex-col {
  display: flex;
  flex-direction: column;
}
.codex-col-header {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  font-weight: 600;
}
.codex-chance-main strong {
  font-size: 42px;
  line-height: 1;
  color: var(--accent);
}
.codex-chance-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 12px;
}
.codex-chance-bars {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
}
.codex-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.codex-bar span {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.codex-bar-value {
  font-size: 14px;
  color: var(--accent);
}
.codex-bar progress {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: var(--line);
}
.codex-bar progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 2px;
}
.codex-bar progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 2px;
}
.codex-bar progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 2px;
}
.codex-col-content {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.codex-col-content strong {
  line-height: 1.2;
}
.codex-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.codex-footer p {
  margin: 4px 0;
}
.codex-footer a {
  color: var(--accent);
  text-decoration: none;
}
.codex-footer a:hover {
  text-decoration: underline;
}
.home-column-empty {
  padding: 28px 4px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* 一或两栏时填满可用宽度，长标题栏目可适度加宽；三栏时保持等宽。 */
@media (min-width: 821px) {
  .home-columns:not(:has(> .home-column:nth-child(3))) {
    display: flex;
    align-items: flex-start;
  }

  .home-columns:not(:has(> .home-column:nth-child(3))) > .home-column {
    flex: 1 1 auto;
    min-width: calc((100% - 32px) / 3);
    max-width: 100%;
  }

  .home-columns:not(:has(> .home-column:nth-child(3))) > .home-column:only-child {
    min-width: 100%;
  }

  .home-columns:has(> .home-column-teaching):has(> .home-column-notes):not(:has(> .home-column:nth-child(3))) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-columns:has(> .home-column-teaching):has(> .home-column-notes):not(:has(> .home-column:nth-child(3))) > .home-column {
    min-width: 0;
    max-width: none;
  }
}

.public-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.public-pager a,
.public-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 13px;
}

.public-pager a:hover,
.public-pager span {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--soft);
  color: var(--text);
}

/* 首页文章改为标题列表：标题 + 置顶/编辑/删除，下一行放元信息，无封面图 */
.post-item {
  padding: 13px 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  transition: background-color 160ms ease;
}

.post-item:first-child {
  padding-top: 2px;
}

.post-item:last-child {
  border-bottom: 0;
}

.post-item:hover {
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}

.post-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 0 7px;
}

.post-item-title {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-item-title a {
  color: inherit;
}

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

.post-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pin-indicator {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 15px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  flex: 1 0 auto;
  justify-content: flex-start;
  min-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.post-meta a {
  color: color-mix(in srgb, var(--accent) 70%, var(--muted));
}

.post-meta .post-edit-link {
  margin-left: auto;
  padding: 2px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.post-meta .post-edit-link:hover {
  background: var(--accent);
  color: #fff;
}

.empty-state {
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.article-stream {
  container-type: inline-size;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.article-page {
  --reading-width: 70vw;
  padding: 0 0 64px;
}

.article-page header {
  margin-bottom: 36px;
}

.article-hero {
  display: grid;
  gap: 18px;
}

.article-hero.has-cover {
  /* 所有文章封面统一使用缩小后的葫芦图尺寸。 */
  grid-template-columns: minmax(22.8px, 4%) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: calc(var(--radius) * .2);
  object-fit: cover;
  background: var(--soft);
}

/* 无封面时用葫芦默认图：完整显示不裁切 */
.article-cover.is-default-cover {
  object-fit: contain;
  background: #fff;
}

.article-cover-col {
  min-width: 0;
  width: 100%;
}

.article-title-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.article-title-actions form {
  display: inline-flex;
  margin: 0;
}

.post-action-btn {
  background: transparent !important;
  border: none !important;
  padding: 4px !important;
  margin: 0 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
  outline: none;
  border-radius: 4px;
}

.post-action-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform 0.15s ease;
}

.post-action-btn:hover svg {
  transform: scale(1.15);
}

.post-action-btn.edit-btn {
  color: var(--accent);
}

.post-action-btn.edit-btn:hover {
  color: color-mix(in srgb, var(--accent) 85%, black);
  background: var(--accent-soft) !important;
}

.post-action-btn.delete-btn {
  color: color-mix(in srgb, var(--text) 45%, var(--muted));
}

.post-action-btn.delete-btn:hover {
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 10%, transparent) !important;
}

.post-item-actions .pin-toggle {
  display: inline-flex;
  flex-shrink: 0;
  margin: 0;
}

.post-action-btn.pin-btn {
  position: relative;
  color: color-mix(in srgb, var(--text) 40%, var(--muted));
}

/* 悬停时在按钮上方弹出功能说明气泡 */
.post-action-btn.pin-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translate(-50%, 3px);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 40;
}

.post-action-btn.pin-btn::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translate(-50%, 3px) rotate(45deg);
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 41;
}

.post-action-btn.pin-btn:hover::after,
.post-action-btn.pin-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.post-action-btn.pin-btn:hover::before,
.post-action-btn.pin-btn:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) rotate(45deg);
}

.post-action-btn.pin-btn:hover,
.post-action-btn.pin-btn.is-pinned {
  color: var(--accent);
}

.post-action-btn.pin-btn:hover {
  background: var(--accent-soft) !important;
}

.article-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
}

.article-title-row {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.article-heading h1 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: clamp(18px, 2.4vw, 28px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.article-heading > .post-meta {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.reading-layout {
  display: grid;
  grid-template-areas: "body";
  grid-template-columns: minmax(0, var(--reading-width));
  justify-content: center;
  align-items: start;
  gap: 18px 12px;
  min-width: 0;
}

.reading-layout.has-outline {
  /* The outline uses the right margin; equal side tracks keep the body centered. */
  grid-template-areas: ". body outline";
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--reading-width)) minmax(0, 1fr);
}

@media (min-width: 821px) {
  .public-shell[data-site-rail-state="open"] .article-page {
    --reading-width: 70cqw;
  }
}

.reading-layout > .article-content {
  grid-area: body;
  min-width: 0;
}

.reading-layout > .article-content :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: var(--public-content-top);
}

.public-shell #comments {
  scroll-margin-top: var(--public-content-top);
}

.article-outline {
  position: sticky;
  top: var(--public-content-top);
  grid-area: outline;
  min-width: 0;
  max-height: calc(100vh - var(--public-content-top) - 18px);
  max-height: calc(100dvh - var(--public-content-top) - 18px);
  padding: 4px 0 12px 8px;
  border-left: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.article-outline[hidden] {
  display: none;
}

.article-outline-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.article-outline ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-outline li {
  --outline-depth: 0;
  min-width: 0;
  margin: 0;
  padding-left: min(calc(var(--outline-depth) * 10px), 12px);
}

.article-outline [data-outline-level="2"] { --outline-depth: 1; }
.article-outline [data-outline-level="3"] { --outline-depth: 2; }
.article-outline [data-outline-level="4"] { --outline-depth: 3; }
.article-outline [data-outline-level="5"] { --outline-depth: 4; }
.article-outline [data-outline-level="6"] { --outline-depth: 5; }

.article-outline a {
  display: block;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.article-outline a:hover,
.article-outline a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 820px) {
  .reading-layout.has-outline {
    grid-template-areas: "outline" "body";
    grid-template-columns: minmax(0, var(--reading-width));
    gap: 18px;
  }

  .article-outline {
    position: static;
    max-height: min(240px, 40vh);
    max-height: min(240px, 40dvh);
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
}

/* An open navigation rail can also leave a desktop article too narrow. */
@container (max-width: 720px) {
  .reading-layout.has-outline {
    grid-template-areas: "outline" "body";
    grid-template-columns: minmax(0, var(--reading-width));
    gap: 18px;
  }

  .article-outline {
    position: static;
    max-height: min(240px, 40vh);
    max-height: min(240px, 40dvh);
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
}

.article-content {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: 17px;
  line-height: 1.88;
  overflow-wrap: anywhere;
}

/* highlight.js 使用本地 GitHub 主题；深色模式由站点变量统一覆盖。 */
[data-color-scheme="dark"] .article-content .hljs {
  color: #c9d1d9;
  background: #161b22;
}

[data-color-scheme="dark"] .article-content .hljs-doctag,
[data-color-scheme="dark"] .article-content .hljs-keyword,
[data-color-scheme="dark"] .article-content .hljs-meta .hljs-keyword,
[data-color-scheme="dark"] .article-content .hljs-template-tag,
[data-color-scheme="dark"] .article-content .hljs-template-variable,
[data-color-scheme="dark"] .article-content .hljs-type,
[data-color-scheme="dark"] .article-content .hljs-variable.language_ {
  color: #ff7b72;
}

[data-color-scheme="dark"] .article-content .hljs-title,
[data-color-scheme="dark"] .article-content .hljs-title.class_,
[data-color-scheme="dark"] .article-content .hljs-title.function_ {
  color: #d2a8ff;
}

[data-color-scheme="dark"] .article-content .hljs-attr,
[data-color-scheme="dark"] .article-content .hljs-literal,
[data-color-scheme="dark"] .article-content .hljs-number,
[data-color-scheme="dark"] .article-content .hljs-operator,
[data-color-scheme="dark"] .article-content .hljs-variable {
  color: #79c0ff;
}

[data-color-scheme="dark"] .article-content .hljs-regexp,
[data-color-scheme="dark"] .article-content .hljs-string {
  color: #a5d6ff;
}

[data-color-scheme="dark"] .article-content .hljs-comment,
[data-color-scheme="dark"] .article-content .hljs-code,
[data-color-scheme="dark"] .article-content .hljs-formula {
  color: #8b949e;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--text);
  line-height: 1.35;
  font-weight: 650;
}

.article-content h1 {
  font-size: clamp(19px, 1.9vw, 22px);
  margin: 1.6em 0 0.6em;
}

.article-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

.article-content h2 {
  font-size: clamp(17px, 1.7vw, 19px);
  margin: 1.4em 0 0.5em;
}

.article-content h3 {
  font-size: clamp(15px, 1.5vw, 17px);
  margin: 1.2em 0 0.4em;
}

.article-content h4 {
  font-size: 15px;
  margin: 1.1em 0 0.3em;
}

.article-content p {
  margin: 0 0 1.1em;
}

.article-content ul,
.article-content ol {
  padding-left: 1.3em;
}

.article-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--soft);
}

.article-content pre {
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: var(--soft);
}

.article-content img,
.article-content video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 16px 0 22px;
  border-radius: 8px;
  background: var(--soft);
}

.article-content iframe {
  display: block;
  max-width: 100%;
  margin: 16px 0 22px;
  border-radius: 8px;
  background: var(--soft);
}

@media (max-width: 1360px) and (min-width: 1181px) {
  .theme-shell.public-shell {
    --public-inline-padding: 28px;
    --public-rail-width: 260px;
    --public-column-gap: 24px;
  }

  .theme-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding-right: 28px;
    padding-left: 28px;
  }

  .theme-shell[data-site-rail-state="closed"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-heading h1 {
    font-size: clamp(18px, 1.9vw, 25px);
  }
}

.article-content .MathJax,
.article-content mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 38px;
}

.article-tags a {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.comments-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: min(100%, var(--reading-width));
  margin-inline: auto;
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.comments-section :is(.comment-list, .comment-item, .comment-reply, .comment-form, .comment-form label) {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.comments-head,
.comment-item header,
.comment-reply header,
.comment-admin-actions {
  flex-wrap: wrap;
}

@container (max-width: 720px) {
  .comment-reply .comment-reply {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.comments-head h2 {
  margin: 0;
  font-size: 22px;
}

.comments-head span,
.comment-empty {
  color: var(--muted);
  font-size: 14px;
}

.comment-notice {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.comment-identity {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.comment-identity strong {
  color: var(--text);
}

.comment-badge {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--accent);
  font-size: 12px;
  max-width: 100%;
  white-space: normal;
}

.comment-reply {
  display: grid;
  gap: 6px;
  margin-left: 18px;
  border-left: 2px solid var(--line);
  padding: 8px 0 8px 12px;
}

.comment-reply header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.comment-reply p {
  margin: 0;
}

.comment-reply-box summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.comment-reply-box[open] summary {
  margin-bottom: 8px;
}

.comment-login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.comment-admin-actions {
  display: flex;
  gap: 8px;
}

.comment-admin-actions form {
  display: contents;
}

.comment-admin-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.comment-admin-actions button:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent);
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.comment-item header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
}

.comment-item time {
  color: var(--muted);
  font-size: 12px;
}

.comment-item p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  white-space: pre-wrap;
}

.comment-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.comment-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.comment-form textarea {
  resize: vertical;
}

.comment-form button {
  justify-self: start;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .theme-shell.public-shell {
    --public-rail-width: 260px;
  }

  .theme-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

}

@media (max-width: 820px) {
  .theme-shell.public-shell {
    --public-inline-padding: 14px;
    --public-bead-inset: 6px;
    --public-bead-size: 40px;
    --public-banner-top: calc(14px + env(safe-area-inset-top));
    --public-banner-min: 124px;
  }

  .theme-shell.public-shell[data-site-rail-state="open"] {
    --public-rail-space: 0px;
  }

  .home-columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-column:only-child {
    grid-column: auto;
  }

  .theme-shell {
    display: block;
    padding: 14px;
  }

  .site-rail-control {
    top: calc(20px + env(safe-area-inset-top));
  }

  .site-rail-bead,
  .site-rail-bead img {
    width: 40px;
    height: 40px;
  }

  .site-rail-bead .tianni-five-elements {
    transform: none;
  }

  .public-header {
    height: calc(var(--public-banner-height) + env(safe-area-inset-top));
    margin-bottom: 18px;
    padding-top: 0;
  }

  /* 左侧栏改为从左滑出的抽屉，完整保留导航/搜索/登录/主题切换 */
  .site-rail,
  .theme-shell[data-site-rail-state="closed"] .site-rail {
    position: fixed;
    top: calc(82px + env(safe-area-inset-top));
    left: 14px;
    bottom: auto;
    z-index: 120;
    display: flex;
    flex-direction: column;
    width: min(310px, calc(100vw - 28px));
    height: calc(100vh - 96px - env(safe-area-inset-top));
    height: calc(100dvh - 96px - env(safe-area-inset-top));
    border-radius: 12px;
    margin: 0;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--panel);
    box-shadow: 4px 0 24px rgb(0 0 0 / 15%);
    overflow-y: auto;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .theme-shell[data-mobile-rail="open"] .site-rail {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.25s ease;
  }

  .theme-shell[data-mobile-rail="open"] .site-rail-backdrop {
    display: block;
  }

  /* 抽屉打开时锁定背景滚动 */
  body:has(.theme-shell[data-mobile-rail="open"]) {
    overflow: hidden;
  }

  .brand {
    padding: 0 4px 12px;
  }

  .search kbd {
    display: none;
  }

  /* 播放器在手机上固定到右下角并保持低于导航抽屉。 */
  .aplayer.aplayer-fixed {
    left: auto !important;
    right: 12px !important;
    top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    z-index: 50;
    transform: none !important;
    transition: opacity 0.18s ease, visibility 0.18s ease;
  }

  body:has(.theme-shell[data-mobile-rail="open"]) .aplayer.aplayer-fixed {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .content-stream {
    padding-top: 4px;
  }

  .stream-toolbar {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .stream-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* 首页攀登横幅 */
  .cover-strip {
    margin: 0 -2px 22px;
    height: 104px;
    border-radius: 10px;
  }

  .cover-strip.mountain-strip {
    min-height: 52px;
  }

  .cover-strip.pencil-banner {
    --banner-brand-start: 58px;
    --banner-brand-width: min(40%, 180px);
  }

  .banner-brand {
    bottom: 8px;
    gap: 1px;
  }

  .banner-brand-title {
    font-size: 14px;
    line-height: 17px;
  }

  .banner-brand-description {
    font-size: 10px;
    line-height: 12px;
  }

  .mountain-banner-tianni {
    left: 76%;
    top: 32%;
  }

  .cover-track {
    inset: 0;
  }

  .gourd-card,
  .gourd-title-card {
    --gourd-size: 20px;
    --string-height: 3px;
    width: 42px;
  }

  .gourd-card {
    grid-template-rows: calc(var(--gourd-size) + var(--string-height) + 2px) 42px;
  }

  .gourd-card:nth-child(7n + 1),
  .gourd-title-card:nth-child(7n + 1) {
    --slot-x: 12.8%;
    --slot-top: 34%;
    --gourd-size: 22px;
    --string-height: 4px;
  }

  .gourd-card:nth-child(7n + 2),
  .gourd-title-card:nth-child(7n + 2) {
    --slot-top: 30%;
    --gourd-size: 20px;
    --string-height: 3px;
  }

  .gourd-card:nth-child(7n + 3),
  .gourd-title-card:nth-child(7n + 3) {
    --slot-top: 38%;
    --gourd-size: 21px;
    --string-height: 4px;
  }

  .gourd-card:nth-child(7n + 4),
  .gourd-title-card:nth-child(7n + 4) {
    --slot-top: 29%;
    --gourd-size: 20px;
    --string-height: 3px;
  }

  .gourd-card:nth-child(7n + 5),
  .gourd-title-card:nth-child(7n + 5) {
    --slot-top: 34%;
    --gourd-size: 21px;
    --string-height: 4px;
  }

  .gourd-card:nth-child(7n + 6),
  .gourd-title-card:nth-child(7n + 6) {
    --slot-top: 30%;
    --gourd-size: 19px;
    --string-height: 3px;
  }

  .gourd-card:nth-child(7n),
  .gourd-title-card:nth-child(7n) {
    --slot-x: 88.6%;
    --slot-top: 19%;
    --gourd-size: 20px;
    --string-height: 3px;
  }

  .gourd-title {
    min-height: 26px;
    padding: 3px 2px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1.2;
  }

  /* 文章使用标题列表方式 */
  .post-list {
    border-top: 1px solid var(--line);
  }

  .post-item {
    padding: 12px 6px;
  }

  .post-item:hover {
    background: transparent;
  }

  .post-item-head {
    gap: 8px;
    margin: 0 0 6px;
  }

  .post-item-title {
    font-size: 16px;
    line-height: 1.4;
    white-space: normal;
  }

  .post-meta {
    min-width: 0;
    font-size: 12px;
    margin-top: 4px;
    gap: 4px 10px;
  }

  .article-hero.has-cover {
    grid-template-columns: 12% minmax(0, 1fr);
    align-items: start;
  }

  .article-cover {
    width: 100%;
    margin: 0;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-rail,
  .theme-shell[data-mobile-rail="open"] .site-rail {
    transition: none;
  }
}

/* Hiding the banner releases its full layout space; the bead remains floating. */
html[data-banner-hidden="true"] .public-shell {
  --public-banner-height: 0px;
  --public-content-top: var(--public-banner-top);
  row-gap: 0;
}
html[data-banner-hidden="true"] .public-header {
  height: 0;
  margin-bottom: 0;
}
html[data-banner-hidden="true"] .public-header .cover-strip,
html[data-banner-hidden="true"] .public-header::before { display: none; }
/* Align the whole home stream with the bead's right edge. An open desktop
   sidebar already supplies this clearance; the mobile drawer overlays it. */
html[data-banner-hidden="true"] .theme-home > .content-stream {
  margin-left: max(0px, calc(var(--public-bead-inset) + var(--public-bead-size) - var(--public-rail-space)));
}
@media (max-width: 820px) {
  html[data-banner-hidden="true"] .public-shell {
    padding-top: calc(14px + env(safe-area-inset-top));
  }
}

/* Codex announcements: redesigned to match codexreset.com while using site theme */
.home-column-codex {
  background: var(--panel);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
}
.codex-head {
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.codex-head h2 {
  color: var(--text);
  white-space: nowrap;
}
.codex-refresh-btn {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.codex-refresh-btn:hover {
  background: var(--soft);
}
.codex-refresh-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.codex-dashboard {
  padding: 20px 16px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.codex-hero {
  text-align: center;
  margin-bottom: 24px;
}
.codex-hero-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}
.codex-accent {
  color: var(--accent);
}
.codex-tagline {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}
.codex-reset-since {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 24px;
  background: var(--soft);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.codex-reset-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 4px;
}
.codex-reset-abs {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.codex-forecast-console {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.codex-console-prompt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  margin: 0 0 16px;
  color: var(--text);
}
.codex-ps1 {
  color: var(--accent);
  font-weight: bold;
  margin-right: 8px;
}
.codex-verdict {
  color: var(--text);
  font-weight: 600;
}
.codex-signal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
}
.codex-signal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.codex-signal-title {
  font-weight: 600;
  color: var(--text);
}
.codex-signal-quote {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 8px;
  white-space: pre-wrap;
  font-style: italic;
}
.codex-signal-meta {
  font-size: 12px;
  color: var(--muted);
}
.codex-signal-meta a {
  color: var(--accent);
  text-decoration: none;
}
.codex-signal-meta a:hover {
  text-decoration: underline;
}
.codex-signal-sep {
  margin: 0 6px;
}
.codex-forecast-inline {
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}
.codex-chance-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  font-weight: 600;
}
.codex-chance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.codex-chance-item {
  display: flex;
  flex-direction: column;
}
.codex-chance-item strong {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text);
}
.codex-horizon {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.codex-chance-item progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: var(--line);
}
.codex-chance-item progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 3px;
}
.codex-chance-item progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 3px;
}
.codex-chance-item progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 3px;
}
.codex-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.codex-footer p {
  margin: 4px 0;
}
.codex-footer a {
  color: var(--accent);
  text-decoration: none;
}
.codex-footer a:hover {
  text-decoration: underline;
}
.home-column-empty { grid-column: 1 / -1; padding: 32px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.home-column-empty h2 { font-size: 18px; }

.codex-status-note-top {
  font-size: 12px;
  color: var(--muted);
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.codex-signal-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Keep all three home columns as tall as five article rows. */
.home-columns:has(> .home-column-codex) > .home-column {
  display: flex;
  flex-direction: column;
  height: var(--home-column-height, 412px);
}
.home-columns:has(> .home-column-codex) > .home-column > .home-column-head,
.home-columns:has(> .home-column-codex) > .home-column > .column-pager-wrapper,
.home-columns:has(> .home-column-codex) .post-item { flex: none; }
.home-columns:has(> .home-column-codex) > .home-column > .post-list,
.home-column-codex > .codex-dashboard {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) var(--soft);
}
.codex-dashboard:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Live reset summary; shared by initial render and every refresh. */
.codex-reset-relative { display: block; color: var(--accent); font-size: clamp(24px, 3vw, 36px); line-height: 1.3; margin: 8px 0; }
.codex-reset-abs { font-size: 12px; font-weight: 400; color: var(--muted); }
.codex-stat-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.codex-stat-chips span { border: 1px solid var(--line); border-radius: 20px; padding: 3px 8px; font-size: 11px; color: var(--muted); }
.codex-banked { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 12px; margin-bottom: 16px; border: 1px solid #ad7b30; border-radius: 8px; background: color-mix(in srgb, #ad7b30 8%, var(--panel)); font-size: 12px; }
.codex-banked strong { flex-basis: 100%; }
.codex-banked a { color: var(--accent); }
.codex-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.codex-detail-grid span, .codex-detail-grid strong { display: block; }
.codex-detail-grid span, .codex-wait-summary { color: var(--muted); font-size: 12px; }
.codex-detail-grid strong { font-size: 16px; margin-top: 4px; }
.codex-signal-meta { flex-wrap: wrap; gap: 6px; }
.home-column-codex[data-state="stale"] .codex-status-note-top, .home-column-codex[data-state="unavailable"] .codex-status-note-top { color: #b76b24; }

/* Administrator-only source editor, outside the article's style scope. */
.inline-edit-hint{font-size:13px;color:var(--text-muted,#627268);padding:10px 14px;border:1px dashed #a6b8ab;border-radius:8px;margin:0 0 16px}.inline-edit-hint span{margin-left:8px}
[data-inline-post] [data-inline-block]:hover{outline:1px dashed #a1b9ac;outline-offset:3px}
.inline-editor{box-sizing:border-box;width:min(1240px,96vw);max-width:96vw;height:min(850px,92dvh);max-height:92dvh;margin:auto;padding:0;border:1px solid #b5c5ba;border-radius:16px;background:#f5f8f5;color:#233b2e;box-shadow:0 20px 80px #0005;overflow:hidden}
.inline-editor[open]{display:flex;flex-direction:column}.inline-editor::backdrop{background:#0e201ba6}
.inline-editor-head{display:flex;justify-content:space-between;align-items:center;padding:18px 24px;border-bottom:1px solid #d4dfd7}.inline-editor h2{margin:0;font-size:20px}.inline-editor-head p{margin:4px 0 0;font-size:13px;color:#5e7165}
.inline-editor button{font:inherit;cursor:pointer;padding:8px 18px;border:1px solid #aabeb0;border-radius:8px;background:#fff;color:#254834}.inline-editor button:disabled{opacity:.55;cursor:wait}.inline-editor .inline-editor-close{font-size:25px;line-height:1;padding:7px 12px}
.inline-editor-scope:empty{display:none}.inline-editor-scope{display:flex;gap:8px;padding:10px 20px 0}.inline-editor-scope button{font-size:12px;padding:5px 12px}
.inline-editor-grid{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;padding:16px 20px}.inline-editor-grid section{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid #cfdbd2;border-radius:10px;overflow:hidden;background:#fff}.inline-editor h3{margin:0;padding:10px 14px;font-size:13px;border-bottom:1px solid #dbe4de;background:#edf3ee}.inline-editor textarea{flex:1;resize:none;min-height:0;padding:16px;border:0;font:14px/1.7 monospace}.inline-editor .CodeMirror{flex:1;height:0;min-height:0;font:14px/1.7 ui-monospace,monospace;background:#fff;color:#233b2e}.inline-editor iframe{flex:1;width:100%;min-height:0;border:0;background:white}
.inline-editor footer{display:flex;align-items:center;gap:10px;padding:14px 20px;border-top:1px solid #d4dfd7}.inline-editor [role=status]{flex:1;font-size:13px}.inline-editor .is-error{color:#a22b29}.inline-editor [data-save]{background:#25634c;color:white;border-color:#25634c}.inline-editor button:focus-visible{outline:3px solid #77a88e;outline-offset:2px}
@media(max-width:700px){.inline-editor{width:98vw;max-width:98vw;height:96dvh;max-height:96dvh;border-radius:10px}.inline-editor-head{padding:12px}.inline-editor-grid{grid-template-columns:1fr;grid-template-rows:1fr 1fr;padding:10px;gap:10px}.inline-editor footer{padding:10px}.inline-editor footer button{padding:8px 12px}.inline-edit-hint span{display:block;margin:4px 0 0}}

/* Give the curved molecular journey its own space below the mobile title. */
@media (max-width: 820px) {
  .pencil-banner .banner-brand { top: 8px; bottom: auto; height: auto; }
  .pencil-banner .pencil-motor-runway { inset: 40px 10px 0 10px; }
}
