/* 文章详情页：简洁排版（与 style.css 配合） */

body.detail-page {
  background: #f1f5f9;
}

.detail-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

.detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--kl-muted, #64748b);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.detail-breadcrumb a {
  color: var(--kl-muted, #64748b);
  text-decoration: none;
}

.detail-breadcrumb a:hover {
  color: var(--kl-primary, #4051ee);
}

.detail-breadcrumb-sep {
  color: #cbd5e1;
  user-select: none;
}

.detail-breadcrumb strong,
.detail-breadcrumb .detail-breadcrumb-current {
  color: var(--kl-text, #0f172a);
  font-weight: 600;
}

.detail-layout {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
  }
}

.detail-main {
  min-width: 0;
}

.detail-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--kl-text, #0f172a);
}

.detail-meta {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  color: var(--kl-muted, #64748b);
}

.detail-body {
  background: #fff;
  border: 1px solid var(--kl-border, #e2e8f0);
  border-radius: var(--kl-radius, 12px);
  padding: 1.75rem 1.5rem 2.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

@media (min-width: 640px) {
  .detail-body {
    padding: 2rem 2.25rem 2.5rem;
  }
}

/* 正文内与页眉标题重复的首个 h1 仅对辅助技术保留，避免双标题 */
.detail-body > h1:first-of-type {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.detail-body h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--kl-text, #0f172a);
  line-height: 1.35;
}

.detail-body h2:first-of-type {
  margin-top: 0;
}

.detail-body h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--kl-text, #0f172a);
  line-height: 1.4;
}

.detail-body p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: #334155;
  line-height: 1.75;
}

.detail-body a {
  color: var(--kl-primary, #4051ee);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-body a:hover {
  color: var(--kl-accent, #e44eb6);
}

.detail-body strong {
  font-weight: 700;
  color: var(--kl-text, #0f172a);
}

.detail-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem 0;
  border-radius: 8px;
  border: 1px solid var(--kl-border, #e2e8f0);
}

.detail-body ul,
.detail-body ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: #334155;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.detail-body li {
  margin-bottom: 0.35rem;
}

/* 侧栏 */
.detail-aside {
  min-width: 0;
}

@media (min-width: 1024px) {
  .detail-aside-inner {
    position: sticky;
    top: calc(var(--kl-header-h, 64px) + 1rem);
  }
}

.detail-aside-title {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--kl-text, #0f172a);
  letter-spacing: -0.02em;
}

.detail-rec-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-rec-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--kl-border, #e2e8f0);
  border-radius: var(--kl-radius, 12px);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.detail-rec-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.detail-rec-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.detail-rec-card__body {
  padding: 1rem 1.1rem 1.15rem;
}

.detail-rec-card h4 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--kl-text, #0f172a);
  transition: color 0.15s;
}

.detail-rec-card:hover h4 {
  color: var(--kl-primary, #4051ee);
}

.detail-rec-card p {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--kl-muted, #64748b);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-cta {
  display: block;
  margin-top: 1.75rem;
  padding: 0.9rem 1rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none !important;
  background: var(--kl-gradient, linear-gradient(135deg, #4051ee 0%, #e44eb6 100%));
  border-radius: var(--kl-radius, 12px);
  box-shadow: 0 4px 14px rgba(64, 81, 238, 0.22);
  transition: filter 0.15s, transform 0.15s;
}

.detail-cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
