/* 博客文章页 — 正文排版（版心加宽 + 中文阅读节奏） */
.article-page {
  padding-top: 72px;
  padding-bottom: 96px;
}

.article-page--feature {
  position: relative;
  overflow-x: clip;
  isolation: isolate;
  background:
    radial-gradient(ellipse 85% 50% at 50% -5%, rgba(99, 102, 241, 0.09) 0%, transparent 52%),
    radial-gradient(ellipse 45% 38% at 12% 55%, rgba(167, 139, 250, 0.1) 0%, transparent 48%),
    radial-gradient(ellipse 45% 38% at 88% 42%, rgba(244, 114, 182, 0.07) 0%, transparent 48%),
    linear-gradient(180deg, #f8faff 0%, #fafbff 40%, #ffffff 100%);
}

/* 两侧卡通风 Mac 装饰：铺在 main 内，随页面滚动（非视口固定） */
.article-feature-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.article-feature-decor__left,
.article-feature-decor__right {
  position: absolute;
  top: clamp(72px, 14vh, 140px);
  width: min(280px, 28vw);
  height: min(400px, 48vh);
  max-height: 420px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center top;
  opacity: 0.24;
}

.article-feature-decor__left {
  left: clamp(0px, 1.5vw, 28px);
  background-image: url("../images/article-decor-mac-left.svg");
}

.article-feature-decor__right {
  right: clamp(0px, 1.5vw, 28px);
  background-image: url("../images/article-decor-mac-right.svg");
}

@media (max-width: 1024px) {
  .article-feature-decor__left,
  .article-feature-decor__right {
    opacity: 0.14;
    width: min(200px, 24vw);
    height: min(300px, 40vh);
    top: 88px;
  }
}

@media (max-width: 720px) {
  .article-feature-decor {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .article-feature-decor__left,
  .article-feature-decor__right {
    opacity: 0;
    filter: blur(14px);
  }

  .article-feature-decor__left {
    animation:
      articleDecorEnterLeft 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards,
      articleDecorDrift 16s ease-in-out 1.05s infinite;
  }

  .article-feature-decor__right {
    animation:
      articleDecorEnterRight 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards,
      articleDecorDrift 20s ease-in-out 1.17s infinite reverse;
  }
}

@keyframes articleDecorEnterLeft {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: translateX(-28px) scale(0.88);
  }
  to {
    opacity: 0.24;
    filter: blur(0);
    transform: translateX(0) scale(1);
  }
}

@keyframes articleDecorEnterRight {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: translateX(28px) scale(0.88);
  }
  to {
    opacity: 0.24;
    filter: blur(0);
    transform: translateX(0) scale(1);
  }
}

@keyframes articleDecorDrift {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-feature-decor__left,
  .article-feature-decor__right {
    animation: none;
    filter: none;
  }
}

.article-reading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 10000;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #6366f1, #a855f7, #06b6d4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
  transition: transform 0.12s ease-out;
}

/* 与站点 .container(1160) 对齐：版心明显加宽，减少两侧留白 */
.article-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(100%, 920px);
  margin: 0 auto;
  padding: 32px clamp(12px, 3.5vw, 28px) 0;
  box-sizing: border-box;
}

.article-header {
  margin-bottom: 8px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.article-back:hover {
  text-decoration: none;
  color: #4f46e5;
  transform: translateX(-3px);
}

.article-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 20px;
}

.article-crumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.article-crumb-sep {
  color: #cbd5e1;
  user-select: none;
  margin: 0 1px;
  font-weight: 500;
}

.article-crumb-current {
  color: #64748b;
  font-weight: 700;
}

.article-series {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5b21b6;
  margin-bottom: 12px;
}

.article-title {
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 900;
  line-height: 1.22;
  color: var(--dark);
  margin: 0 0 18px;
  letter-spacing: -0.025em;
}

.article-page--feature .article-back {
  opacity: 0;
  animation: articleHeaderIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.article-page--feature .article-crumb {
  opacity: 0;
  animation: articleHeaderIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.article-page--feature .article-title {
  animation: articleTitleIn 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

.article-page--feature .article-meta {
  opacity: 0;
  animation: articleHeaderIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both;
}

@keyframes articleHeaderIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes articleTitleIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e2e8f0;
  line-height: 1.5;
}

.article-body {
  font-size: 17px;
  line-height: 1.92;
  color: #334155;
  letter-spacing: 0.02em;
}

.article-page--feature .article-body > .article-section:first-child p {
  font-size: 1.06em;
  line-height: 1.95;
  color: #1e293b;
}

.article-page--feature .article-section {
  opacity: 0;
  transform: translateY(22px) scale(0.992);
  transition:
    opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-page--feature .article-section.is-visible {
  opacity: 1;
  transform: none;
}

.article-page--feature .article-cta {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease;
}

.article-page--feature .article-cta.is-visible {
  opacity: 1;
  transform: none;
}

.article-page--feature .article-section.is-visible .article-callout {
  animation: articleCalloutIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes articleCalloutIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.article-page--feature .article-section.is-visible .article-checklist li {
  opacity: 0;
  animation: articleCheckIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.article-page--feature .article-section.is-visible .article-checklist li:nth-child(1) {
  animation-delay: 0.08s;
}

.article-page--feature .article-section.is-visible .article-checklist li:nth-child(2) {
  animation-delay: 0.16s;
}

.article-page--feature .article-section.is-visible .article-checklist li:nth-child(3) {
  animation-delay: 0.24s;
}

.article-page--feature .article-section.is-visible .article-checklist li:nth-child(4) {
  animation-delay: 0.32s;
}

@keyframes articleCheckIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.article-body h2 {
  font-size: clamp(1.2rem, 2.1vw, 1.35rem);
  font-weight: 800;
  color: var(--dark);
  margin: 2.25rem 0 0.85rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.article-page--feature .article-body h2 {
  position: relative;
  padding-left: 18px;
  margin-top: 2.5rem;
}

.article-page--feature .article-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #6366f1, #a855f7);
}

.article-body p {
  margin: 0 0 1.2em;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body ul {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
}

.article-body li {
  margin-bottom: 0.45em;
  line-height: 1.85;
}

.article-body strong {
  color: #1e293b;
  font-weight: 800;
}

.article-body code {
  font-size: 0.88em;
  background: #f1f5f9;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.article-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px 22px;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 1.35em 0;
  border: 1px solid #1e293b;
}

.article-callout {
  margin: 1.5em 0;
  padding: 18px 22px 18px 24px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-left: 4px solid #6366f1;
  background: rgba(99, 102, 241, 0.06);
  font-size: 16px;
  line-height: 1.82;
  color: #334155;
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.06);
}

.article-callout strong {
  color: #312e81;
}

.article-checklist {
  list-style: none;
  padding: 0;
  margin: 1.1em 0 0.5em;
}

.article-checklist li {
  position: relative;
  padding: 14px 16px 14px 46px;
  margin-bottom: 12px;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-size: 16px;
  line-height: 1.75;
}

.article-checklist li:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.07);
}

.article-checklist li::before {
  content: "✓";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #059669;
  font-weight: 900;
  font-size: 15px;
}

.article-cta {
  margin-top: 40px;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(14, 165, 233, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.article-page--feature .article-cta {
  position: relative;
  margin-top: 3rem;
  padding: 24px 28px 26px;
  overflow: hidden;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, transparent 42%),
    linear-gradient(110deg, #f8f5ff 0%, #eef2ff 38%, #f5f0ff 72%, #faf8ff 100%);
  border: 1px solid rgba(196, 181, 253, 0.85);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 18px 48px rgba(99, 102, 241, 0.1),
    0 6px 20px rgba(15, 23, 42, 0.05);
}

/* 右侧大圆形柔光（参考图右侧半透明圆斑） */
.article-page--feature .article-cta::before {
  content: "";
  position: absolute;
  z-index: 0;
  right: -18%;
  top: 50%;
  transform: translateY(-50%);
  width: min(72%, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 40%,
    rgba(167, 139, 250, 0.28) 0%,
    rgba(196, 181, 253, 0.12) 42%,
    transparent 70%
  );
  pointer-events: none;
}

/* 右上角书页折角 */
.article-page--feature .article-cta__fold {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  background: linear-gradient(210deg, #ffffff 0%, #f8fafc 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  box-shadow: -3px 4px 14px rgba(15, 23, 42, 0.07);
  pointer-events: none;
}

.article-page--feature .article-cta__inner {
  position: relative;
  z-index: 1;
}

.article-page--feature .article-cta__lead {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 2px 44px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.article-page--feature .article-cta__title strong {
  color: #0f172a;
  font-weight: 900;
}

.article-page--feature .article-cta__logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.article-page--feature .article-cta__logo svg {
  display: block;
  filter: drop-shadow(0 2px 10px rgba(99, 102, 241, 0.2));
}

.article-cta p {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}

.article-page--feature .article-cta p:not(.article-cta__lead) {
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.article-cta .article-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.article-page--feature .article-cta .article-cta-links {
  gap: 12px 14px;
}

.article-cta a {
  display: inline-block;
  margin-right: 12px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.article-page--feature .article-cta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 0;
  margin-top: 0;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(196, 181, 253, 0.7);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.2s ease, color 0.2s ease;
}

.article-page--feature .article-cta a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  color: #4f46e5;
}

.article-page--feature .article-cta a::after {
  content: "→";
  font-weight: 800;
  transition: transform 0.22s ease;
}

.article-page--feature .article-cta a:hover::after {
  transform: translateX(4px);
}

/* 右侧限时优惠：inline-flex + 子级 max-content 定宽，避免 stretch 与 max-content 互锁导致算窄；加大 padding 让顶栏与长句不贴云朵描边 */
.article-page--feature .article-promo-cloud {
  position: fixed;
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  z-index: 850;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: max-content;
  max-width: min(380px, calc(100vw - 20px));
  min-width: 168px;
  padding: 42px 36px 32px;
  text-align: center;
  text-decoration: none;
  color: #312e81;
  font-family: inherit;
  line-height: 1.35;
  overflow: visible;
  filter: drop-shadow(0 10px 28px rgba(139, 92, 246, 0.16)) drop-shadow(0 4px 10px rgba(99, 102, 241, 0.08));
  transition: transform 0.28s ease, filter 0.28s ease;
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.12);
}

.article-page--feature .article-promo-cloud__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.article-page--feature .article-promo-cloud__path {
  transition: stroke 0.2s ease;
}

.article-page--feature .article-promo-cloud__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-page--feature .article-promo-cloud:active {
  animation: none !important;
  transform: scale(0.97);
}

.article-page--feature .article-promo-cloud:hover {
  animation: none;
  transform: scale(1.04) translateY(-2px);
  filter: drop-shadow(0 14px 36px rgba(139, 92, 246, 0.22)) drop-shadow(0 6px 14px rgba(99, 102, 241, 0.1));
}

.article-page--feature .article-promo-cloud:hover .article-promo-cloud__path {
  stroke: #a78bfa;
}

.article-page--feature .article-promo-cloud:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.55);
  outline-offset: 4px;
}

.article-page--feature .article-promo-cloud__tag {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #6d28d9;
  background: rgba(196, 181, 253, 0.35);
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-page--feature .article-promo-cloud__line {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
}

.article-page--feature .article-promo-cloud__go {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
  max-width: 100%;
  text-align: center;
  line-height: 1.3;
}

@media (prefers-reduced-motion: no-preference) {
  .article-page--feature .article-promo-cloud {
    animation: articlePromoBob 5s ease-in-out infinite;
  }
}

@keyframes articlePromoBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (max-width: 900px) {
  .article-page--feature .article-promo-cloud {
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    max-width: min(340px, calc(100vw - 12px));
    min-width: 156px;
    padding: 38px 26px 28px;
  }

  .article-page--feature .article-promo-cloud__inner {
    gap: 5px;
  }

  .article-page--feature .article-promo-cloud__tag {
    font-size: 10px;
    letter-spacing: 0.03em;
    padding: 4px 10px;
  }

  .article-page--feature .article-promo-cloud__line {
    font-size: 14px;
  }

  .article-page--feature .article-promo-cloud__go {
    font-size: 12px;
    margin-top: 1px;
  }
}

@media (hover: none) {
  .article-page--feature .article-promo-cloud:hover {
    transform: none;
    filter: drop-shadow(0 10px 28px rgba(139, 92, 246, 0.16)) drop-shadow(0 4px 10px rgba(99, 102, 241, 0.08));
  }

  .article-page--feature .article-promo-cloud:hover .article-promo-cloud__path {
    stroke: #c4b5fd;
  }
}

@media print {
  .article-page--feature .article-promo-cloud {
    display: none !important;
  }
}

@media (min-width: 1100px) {
  .article-wrap {
    max-width: 960px;
  }
}

@media (max-width: 520px) {
  .article-body {
    font-size: 16px;
    line-height: 1.88;
  }

  .article-title {
    font-size: clamp(24px, 6.5vw, 30px);
  }

  .article-meta {
    font-size: 12px;
    gap: 6px 10px;
  }

  .article-page--feature .article-cta {
    padding: 20px 18px 22px;
    border-radius: 22px;
  }

  .article-page--feature .article-cta::before {
    right: -22%;
    width: min(85%, 260px);
    opacity: 0.9;
  }

  .article-page--feature .article-cta__fold {
    width: 30px;
    height: 30px;
  }

  .article-page--feature .article-cta__lead {
    font-size: 14px;
    margin-bottom: 16px;
    gap: 10px;
    padding-right: 36px;
  }

  .article-page--feature .article-cta__logo svg {
    width: 24px;
    height: 24px;
  }

  .article-page--feature .article-cta a {
    padding: 9px 12px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-page--feature .article-back,
  .article-page--feature .article-crumb,
  .article-page--feature .article-title,
  .article-page--feature .article-meta {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .article-page--feature .article-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .article-page--feature .article-cta {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .article-page--feature .article-section.is-visible .article-callout,
  .article-page--feature .article-section.is-visible .article-checklist li {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .article-reading-bar {
    transition: none !important;
  }
  .article-back,
  .article-page--feature .article-cta a,
  .article-page--feature .article-cta a::after,
  .article-checklist li {
    transition: none;
  }
  .article-back:hover,
  .article-page--feature .article-cta a:hover {
    transform: none;
  }
  .article-page--feature .article-promo-cloud {
    animation: none;
  }
  .article-page--feature .article-promo-cloud:hover {
    transform: none;
  }
  .article-page--feature .article-promo-cloud:active {
    transform: none;
  }
}
