@font-face {
  font-family: 'AlimamaShuHeiTi';
  src: url('../fonts/Alimama_ShuHeiTi_Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --primary: #5c20ff;
  --primary-dark: #4814d6;
  --primary-soft: #f2eeff;
  --text: #25232d;
  --muted: #777383;
  --border: #e9e4f2;
  --page: #faf8ff;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(92, 32, 255, 0.1), transparent 30rem),
    var(--page);
  font-family:
    'PingFang SC', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei',
    sans-serif;
  line-height: 1.8;
}

a {
  color: var(--primary);
}

.article-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1080px) / 2));
  border-bottom: 1px solid rgba(92, 32, 255, 0.08);
  background: rgba(250, 248, 255, 0.9);
  backdrop-filter: blur(16px);
}

.article-header img {
  display: block;
  width: auto;
  height: 34px;
}

.header-cta,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.header-cta,
.primary-action {
  color: var(--white);
  background: var(--primary);
  box-shadow: 0 8px 24px rgba(92, 32, 255, 0.22);
}

.header-cta:hover,
.primary-action:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.article-page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

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

.article-card {
  overflow: hidden;
  border: 1px solid rgba(92, 32, 255, 0.08);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(73, 55, 113, 0.09);
}

.article-title {
  padding: 48px 56px 34px;
  border-bottom: 1px solid var(--border);
}

.article-label {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 600;
}

.article-title h1 {
  margin: 0;
  font-family: 'AlimamaShuHeiTi', 'PingFang SC', sans-serif;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.article-meta {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.article-content {
  padding: 38px 56px 24px;
  font-size: 17px;
}

.article-content h2,
.article-content h3 {
  scroll-margin-top: 100px;
  color: #201d28;
  line-height: 1.45;
}

.article-content h2 {
  margin: 42px 0 20px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
  font-size: 24px;
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  margin: 32px 0 16px;
  font-size: 20px;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre,
.article-content table {
  margin: 0 0 22px;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto 34px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(44, 32, 71, 0.1);
}

.article-content blockquote {
  padding: 14px 18px;
  border-left: 4px solid #b9a6ff;
  background: #faf8ff;
  color: #5e5868;
}

.article-content code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #f2eef9;
  font-size: 0.92em;
}

.article-content pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 12px;
  background: #231f2d;
  color: #fff;
}

.article-content pre code {
  padding: 0;
  background: transparent;
}

.related-articles {
  margin: 8px 56px 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related-articles > h2 {
  margin: 0 0 18px;
  font-family: 'AlimamaShuHeiTi', 'PingFang SC', sans-serif;
  font-size: 22px;
  line-height: 1.4;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-article-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: #fcfbff;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.related-article-card:hover {
  border-color: #cfc3f7;
  box-shadow: 0 10px 26px rgba(73, 55, 113, 0.09);
  transform: translateY(-2px);
}

.related-article-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.related-article-label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.related-article-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.55;
}

.related-article-action {
  color: var(--primary);
  font-size: 13px;
}

.article-footer {
  margin: 12px 56px 48px;
  padding: 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f5f1ff, #fbfaff);
}

.article-footer p {
  margin: 0 0 18px;
  color: #5d5767;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.secondary-action {
  border: 1px solid #d8cff7;
  color: var(--primary);
  background: var(--white);
}

.secondary-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.site-footer {
  padding: 0 16px 34px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 680px) {
  .article-header {
    min-height: 64px;
    padding: 0 16px;
  }

  .article-header img {
    height: 29px;
  }

  .header-cta {
    min-height: 38px;
    padding: 0 16px;
    font-size: 14px;
  }

  .article-page {
    width: min(100% - 20px, 920px);
    padding-top: 22px;
  }

  .article-card {
    border-radius: 16px;
  }

  .article-title,
  .article-content {
    padding-right: 22px;
    padding-left: 22px;
  }

  .article-title {
    padding-top: 32px;
  }

  .article-content {
    font-size: 16px;
  }

  .article-content h2 {
    font-size: 21px;
  }

  .article-footer {
    margin: 8px 22px 28px;
    padding: 22px;
  }

  .related-articles {
    margin: 4px 22px 24px;
    padding-top: 24px;
  }

  .related-articles-grid {
    grid-template-columns: 1fr;
  }

  .article-actions a {
    width: 100%;
  }
}
