: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;
}

[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%);
}

* {
  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;
}

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[data-site-rail-state="closed"] {
  grid-template-columns: minmax(0, 1fr);
}

.theme-shell[data-info-rail-state="open"],
.theme-shell[data-info-rail-state="toc"] {
  grid-template-columns: 300px minmax(0, 1fr) 300px;
}

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

.site-rail,
.info-rail {
  position: sticky;
  top: 18px;
  align-self: start;
  height: calc(100vh - 36px);
}

.site-rail {
  display: flex;
  flex-direction: column;
  padding: 18px 6px;
}

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

.info-rail-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: var(--shadow);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.site-rail-hide,
.site-rail-show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.site-rail-hide {
  align-self: flex-end;
  margin: 0 6px 10px 0;
}

.site-rail-show {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 22;
  display: none;
  box-shadow: var(--shadow);
}

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

.theme-shell[data-site-rail-state="closed"] .info-rail-toggle {
  top: 60px;
}

.site-rail-hide:hover,
.site-rail-show:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  color: var(--accent);
}

.info-rail-toggle:hover,
.theme-shell[data-info-rail-state="open"] .info-rail-toggle,
.theme-shell[data-info-extra-state="open"] .info-rail-toggle {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  color: var(--accent);
}

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

.brand-avatar {
  flex: 0 0 auto;
}

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

.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,
.side-widget h2,
.ad-widget 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);
}

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

.account-actions a {
  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 a:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  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 {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 22px;
  scrollbar-width: none;
}

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

.cover-track {
  display: flex;
  gap: 16px;
  width: max-content;
}

.cover-slide {
  display: grid;
  grid-template-rows: 60px 34px;
  gap: 6px;
  flex: 0 0 auto;
  width: 240px;
  min-height: 100px;
  color: var(--text);
}

.cover-slide img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel);
  transition: transform 0.3s ease;
}

.cover-slide:hover img {
  transform: scale(1.04);
}

.cover-slide span {
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* meting 音乐播放器悬浮位置 */
.aplayer.aplayer-fixed {
  display: flex !important;
  flex-direction: column;
  width: 300px !important;
  max-width: min(300px, calc(100vw - 40px));
  overflow: visible !important;
  z-index: 90;
}

.aplayer.aplayer-fixed.aplayer-narrow {
  width: 84px !important;
  height: 66px !important;
}

.aplayer.aplayer-fixed .aplayer-body {
  position: relative !important;
  order: 1;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100%;
  transform: none !important;
}

.aplayer.aplayer-fixed .aplayer-info {
  padding-top: 8px !important;
}

.aplayer.aplayer-fixed .aplayer-music {
  width: calc(100% - 24px) !important;
  height: 35px !important;
  margin: 0 0 3px 5px !important;
  padding-bottom: 0 !important;
  line-height: 16px !important;
  white-space: nowrap;
}

.aplayer.aplayer-fixed .aplayer-title {
  font-size: 13px !important;
  line-height: 16px !important;
}

.aplayer.aplayer-fixed .aplayer-author {
  font-size: 11px !important;
  line-height: 16px !important;
}

.aplayer.aplayer-fixed .wendu-player-lyric {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aplayer.aplayer-fixed .aplayer-lrc {
  position: absolute !important;
  left: 66px !important;
  right: auto !important;
  top: 0 !important;
  bottom: auto !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  transform: none !important;
  z-index: -1;
}

.aplayer.aplayer-fixed .aplayer-lrc p {
  font-size: 12px !important;
  line-height: 16px !important;
}

.aplayer.aplayer-fixed .aplayer-list {
  order: 3;
  width: 100% !important;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
}

.aplayer.aplayer-fixed .aplayer-list.aplayer-list-hide {
  display: none !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.aplayer button,
.aplayer .aplayer-icon {
  min-width: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  line-height: 1 !important;
}

.aplayer .aplayer-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 15px !important;
  height: 15px !important;
}

.aplayer .aplayer-pic .aplayer-button {
  width: 26px !important;
  height: 26px !important;
}

.aplayer.aplayer-fixed.aplayer-narrow .aplayer-miniswitcher {
  top: 50% !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
  transform: translateY(-50%);
}

.aplayer svg {
  display: block;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.aplayer .aplayer-icon svg {
  width: 15px !important;
  height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
}

body[data-music-pos="right"] .aplayer.aplayer-fixed {
  left: auto;
  right: 20px;
  bottom: 20px;
}

body[data-music-pos="left"] .aplayer.aplayer-fixed {
  left: 20px;
  right: auto;
  bottom: 20px;
}

body[data-music-pos="right-center"] .aplayer.aplayer-fixed {
  left: auto;
  right: 20px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

body[data-music-pos="left-center"] .aplayer.aplayer-fixed {
  left: 20px;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

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

.stream-toolbar h1 {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  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: grid;
  gap: 14px;
}

.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-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 18px;
  min-height: 134px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  box-shadow: 0 12px 24px rgb(28 34 45 / 3%);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: var(--shadow);
}

.post-media {
  display: grid;
  align-self: start;
  gap: 8px;
}

.post-cover {
  aspect-ratio: 2 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--soft);
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-main {
  min-width: 0;
  padding: 4px 0;
}

.post-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
  margin: 0 0 8px;
}

.post-main h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 20px;
  line-height: 1.35;
}

.post-main h2 a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-main h2 span {
  color: var(--muted);
  font-size: 15px;
}

.post-main p {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.info-rail {
  display: none;
  align-content: start;
  gap: 18px;
  padding-top: 0;
}

.theme-shell[data-info-rail-state="open"] .info-rail,
.theme-shell[data-info-rail-state="toc"] .info-rail {
  display: grid;
}

.info-rail-extras {
  display: grid;
  gap: 18px;
}

.theme-shell[data-has-toc="true"][data-info-extra-state="closed"] .info-rail-extras {
  display: none;
}

.side-widget,
.ad-widget {
  padding: 0;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--soft);
}

.stat-row span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.stat-row strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.ad-widget img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--soft);
}

.tech-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--soft);
}

.tech-list div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  color: var(--text);
  font-size: 14px;
}

.tech-list dt {
  color: var(--muted);
}

.tech-list dd {
  margin: 0;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud h2 {
  flex: 0 0 100%;
}

.tag-cloud a {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 13px;
}

.article-toc-widget {
  display: grid;
  gap: 10px;
}

.article-toc {
  display: grid;
  gap: 3px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--soft);
}

.theme-shell[data-info-extra-state="open"] .article-toc {
  max-height: 260px;
}

.article-toc a {
  display: block;
  border-radius: 7px;
  padding: 6px 8px 6px calc(8px + (var(--level) - 1) * 12px);
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 13px;
  line-height: 1.38;
}

.article-toc a:hover,
.article-toc a.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.article-stream {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.article-page {
  padding: 0 0 64px;
}

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

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

.article-hero.has-cover {
  grid-template-columns: minmax(190px, 34%) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

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

.article-heading {
  min-width: 0;
}

.article-page h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.18;
}

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

.article-content h1,
.article-content h2,
.article-content h3 {
  margin: 1.7em 0 0.6em;
  color: var(--text);
  line-height: 1.28;
}

.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 {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding-right: 28px;
    padding-left: 28px;
  }

  .theme-shell[data-info-rail-state="open"],
  .theme-shell[data-info-rail-state="toc"] {
    grid-template-columns: 260px minmax(0, 1fr) 240px;
  }

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

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

  .article-stream {
    max-width: 100%;
  }

  .article-page h1 {
    font-size: clamp(30px, 3.2vw, 42px);
  }

  .article-toc a {
    font-size: 12px;
  }
}

.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;
  gap: 18px;
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.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-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%;
  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 {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .theme-shell[data-info-rail-state] .info-rail,
  .info-rail-toggle {
    display: none;
  }

  .site-rail-show {
    display: none;
  }
}

@media (max-width: 820px) {
  .theme-shell {
    display: block;
    padding: 14px;
  }

  .site-rail {
    position: static;
    height: auto;
    padding: 0;
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav-block,
  .rail-bottom {
    display: none;
  }

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

  .cover-slide {
    width: 200px;
    height: 110px;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-cover {
    aspect-ratio: 16 / 8;
  }

  .article-hero.has-cover {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .article-cover {
    aspect-ratio: 16 / 9;
  }
}
