/* 文章模版版式；配色与字体对齐首页 body.studio */

.post {
  --post-mono: "JetBrains Mono", ui-monospace, monospace;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 0 56px;
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

.post a {
  color: var(--accent-600);
}

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

.post__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.post__nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.post__nav a:hover {
  color: var(--text);
  border-color: var(--accent);
}

.post__masthead {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

@media (min-width: 720px) {
  .post__masthead {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 28px;
    padding: 32px 36px;
    align-items: start;
  }
}

.post__date-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  color: var(--accent-600);
}

.post__date-block time {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.post__date-block span {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.post__kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 500;
}

.post__title {
  margin: 0 0 12px;
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}

.post__lead {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.post__grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .post__grid {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
}

.post__toc {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

@media (min-width: 900px) {
  .post__toc {
    position: sticky;
    top: 88px;
  }
}

.post__toc-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.post__toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: post-toc;
}

.post__toc li {
  counter-increment: post-toc;
  border-top: 1px solid var(--line);
}

.post__toc a {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 8px;
  padding: 10px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.post__toc a::before {
  content: counter(post-toc, decimal-leading-zero);
  font-family: var(--post-mono);
  font-size: 11px;
  color: var(--accent);
}

.post__toc a:hover {
  color: var(--accent-600);
}

.post__body {
  min-width: 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.post__intro {
  margin: 0 0 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  color: #52525b;
  font-size: 15px;
  line-height: 1.75;
}

.post__section + .post__section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post__section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.post__section-title::before {
  content: '';
  width: 8px;
  height: 20px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.post__h3 {
  margin: 20px 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.post__body p,
.post__body li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.post__body p {
  margin: 0 0 1em;
}

.post__section > ul {
  margin: 0 0 1.25em;
  padding: 0;
  list-style: none;
}

.post__section > ul > li {
  position: relative;
  padding: 6px 0 6px 18px;
}

.post__section > ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.post__section > ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: post-step;
  display: grid;
  gap: 12px;
}

.post__section > ol > li {
  counter-increment: post-step;
  position: relative;
  padding: 16px 16px 16px 56px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.post__section > ol > li::before {
  content: counter(post-step, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 16px;
  font-family: var(--post-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.post__code {
  margin: 8px 0 20px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--post-mono);
  font-size: 13px;
  line-height: 1.55;
}

.post__table-wrap {
  margin: 8px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.post__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.post__table th,
.post__table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.post__table th {
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.post__table td {
  color: var(--muted);
}

.post__table tr:last-child td {
  border-bottom: 0;
}

.post__faq {
  margin: 8px 0 0;
}

.post__faq-item {
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.post__faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: var(--text);
  background: #fafafa;
}

.post__faq-item summary::-webkit-details-marker {
  display: none;
}

.post__faq-item summary::after {
  content: '▼';
  color: #a1a1aa;
  font-size: 10px;
}

.post__faq-item[open] summary::after {
  transform: rotate(180deg);
}

.post__faq-item p {
  margin: 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  color: #52525b;
  font-size: 14px;
}

.post__related {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
}

.post__related-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.post__related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post__related li + li {
  margin-top: 8px;
}

.post__related a {
  font-weight: 500;
  text-decoration: none;
}

.post__footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.post__cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.post__cta:hover {
  background: var(--accent-600);
  color: #fff;
}

.blog-float-cta {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(320px, calc(100vw - 40px));
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.blog-float-cta--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.blog-float-cta__card {
  position: relative;
  padding: 16px 18px 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.blog-float-cta__card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
}

.blog-float-cta__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.blog-float-cta__close:hover {
  background: var(--accent-soft);
}

.blog-float-cta__close svg {
  width: 16px;
  height: 16px;
}

.blog-float-cta__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 12px;
  font-weight: 500;
  color: #1d4ed8;
}

.blog-float-cta__badge svg {
  width: 14px;
  height: 14px;
}

.blog-float-cta__title {
  margin: 0 28px 6px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.blog-float-cta__text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.blog-float-cta__action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.blog-float-cta__action:hover {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.blog-float-cta__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #18181b;
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.08em;
  transition: background 0.15s ease;
}

.blog-float-cta__action:hover .blog-float-cta__mark {
  background: var(--accent);
}

.blog-float-cta__action-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.blog-float-cta__action-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.blog-float-cta__action-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.blog-float-cta__action-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.blog-float-cta__action:hover .blog-float-cta__action-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .blog-float-cta,
  .blog-float-cta__action,
  .blog-float-cta__mark,
  .blog-float-cta__action-arrow {
    transition: none;
  }
}
