:root {
  --ink: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --brand: #7c3aed;
  --brand-strong: #6d28d9;
  --brand-soft: #f5f3ff;
  --teal: #0f766e;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    linear-gradient(180deg, #fbfbff 0%, #ffffff 26rem),
    #ffffff;
}

a, a:hover, a:focus { text-decoration: none; }

.hero-grad {
  background: linear-gradient(283.01deg, #834CD6 8.03%, #9546E2 34.85%, #B935D9 100%);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid rgba(237, 233, 254, .7);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
}

.article-nav {
  max-width: 72rem;
  height: 4rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: .5rem;
  box-shadow: 0 10px 24px -12px rgba(131, 76, 214, .7);
}

.article-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: .875rem;
  font-weight: 500;
}

.article-nav-links a {
  color: #4b5563;
  text-decoration: none;
  transition: color .2s ease;
}

.article-nav-links a:hover {
  color: var(--brand);
}

.article-nav-links a.is-active {
  color: var(--brand);
  font-weight: 600;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 0;
  padding: .25rem 0;
  background: transparent;
  color: #4b5563;
  font: inherit;
  cursor: pointer;
  transition: color .2s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown:focus-within .nav-dropdown-trigger {
  color: var(--brand);
}

.nav-dropdown-chevron {
  width: .875rem;
  height: .875rem;
  opacity: .55;
}

.nav-dropdown-panel {
  position: absolute;
  left: 50%;
  top: 100%;
  z-index: 70;
  width: max-content;
  min-width: 15.5rem;
  padding-top: .6rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, .35rem);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav-dropdown-menu {
  overflow: hidden;
  border: 1px solid rgba(221, 214, 254, .9);
  border-radius: .875rem;
  background: #ffffff;
  box-shadow: 0 22px 48px -28px rgba(76, 29, 149, .35);
}

.nav-dropdown-menu a {
  display: block;
  min-width: 15.5rem;
  padding: .75rem .95rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-dropdown-menu a:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.nav-dropdown-item-title {
  display: block;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.3;
}

.nav-dropdown-item-desc {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.4;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .875rem;
  font-size: .9rem;
  font-weight: 700;
}

.nav-actions a {
  border-radius: 999px;
  text-decoration: none;
}

.brand-accent {
  color: var(--brand);
}

.nav-link {
  color: var(--brand-strong);
  text-decoration: none;
}

.nav-cta {
  padding: .5rem 1rem;
  color: #ffffff;
  font-weight: 600;
  font-size: .875rem;
  box-shadow: 0 10px 24px -12px rgba(107, 70, 193, .5);
  transition: opacity .2s ease;
}

.nav-cta:hover {
  opacity: .95;
}

.article-page {
  padding: 7rem 1.25rem 5rem;
}

.article-shell {
  max-width: 72rem;
  margin: 0 auto;
}

.article-topline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--brand-strong);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}

.article-hero {
  margin: 2rem 0 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.article-meta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1.25rem;
  padding: .45rem .75rem;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: .78rem;
  font-weight: 900;
}

.article-title {
  max-width: 50rem;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: 0;
}

.article-subtitle {
  max-width: 48rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.85;
}

.article-body {
  max-width: 54rem;
  color: #374151;
  font-size: 1.05rem;
  line-height: 1.95;
}

.article-body p {
  margin: 1.05rem 0;
}

.article-body a {
  color: var(--brand-strong);
  font-weight: 600;
  text-decoration: none;
}

.article-body a:hover {
  color: var(--brand);
}

.article-body h2 {
  margin: 3rem 0 1rem;
  padding-top: .5rem;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  line-height: 1.28;
  font-weight: 950;
  letter-spacing: 0;
}

.article-body h3 {
  margin: 2rem 0 .75rem;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 900;
}

.article-body ul {
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.article-body li {
  position: relative;
  margin: .65rem 0;
  padding-left: 1.3rem;
  color: #475569;
  line-height: 1.85;
}

.article-body li::before {
  content: "";
  position: absolute;
  top: .78em;
  left: 0;
  width: .42rem;
  height: .42rem;
  border-radius: 999px;
  background: var(--teal);
}

.article-body blockquote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.35rem;
  border-left: 4px solid var(--brand);
  border-radius: .75rem;
  background: #f8f7ff;
  color: #3b0764;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.75;
}

.article-body code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: .18rem .4rem;
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
  background: #f8fafc;
  color: #334155;
  font-size: .92em;
}

.article-body .note {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid #ddd6fe;
  border-radius: .875rem;
  background: #faf5ff;
}

.article-body .note p {
  margin: .45rem 0;
}

.article-body .flow {
  display: grid;
  gap: .85rem;
  margin: 1.5rem 0;
}

.article-body .flow div {
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  background: #ffffff;
  color: #475569;
  box-shadow: 0 16px 36px -32px rgba(15, 23, 42, .4);
}

.article-cta {
  max-width: 54rem;
  margin-top: 3.5rem;
  padding: 2rem;
  border-radius: 1rem;
  color: #ffffff;
  box-shadow: 0 26px 70px -42px rgba(109, 40, 217, .9);
}

.article-cta h2 {
  margin: 0 0 .5rem;
  font-size: 1.65rem;
  line-height: 1.25;
  font-weight: 950;
}

.article-cta p {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, .82);
  line-height: 1.75;
}

.article-cta a {
  display: inline-block;
  padding: .8rem 1.2rem;
  border-radius: 999px;
  background: #ffffff;
  color: #5b21b6;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 860px) {
  .article-nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .article-nav {
    height: 4rem;
    padding: 0 1rem;
  }

  .nav-actions {
    gap: .65rem;
    font-size: .82rem;
  }

  .article-page {
    padding: 6rem 1rem 4rem;
  }

  .article-hero {
    margin-top: 1.5rem;
  }

  .article-subtitle {
    font-size: 1.02rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-cta {
    padding: 1.4rem;
  }
}

/* ===== 文章排版优化（表格 / 目录 / 锚点 / 细节） ===== */

/* 锚点跳转不被固定导航栏遮挡 */
.article-body h2,
.article-body h3 {
  scroll-margin-top: 5.5rem;
}

/* 文内目录 */
.article-toc {
  margin: 1.75rem 0 2.5rem;
  padding: 1.1rem 1.25rem 1.1rem 1.4rem;
  border: 1px solid #e9e3fb;
  border-radius: 1rem;
  background: linear-gradient(180deg, #faf7ff 0%, #f5f3ff 100%);
  box-shadow: 0 18px 44px -40px rgba(76, 29, 149, .5);
}
.article-toc .toc-title {
  margin: 0 0 .7rem;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--brand-strong);
  text-transform: uppercase;
}
.article-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.article-toc > ol > li {
  counter-increment: toc;
  margin: .12rem 0;
}
.article-toc > ol > li > a::before {
  content: counter(toc) ". ";
  color: var(--brand);
  font-weight: 900;
}
.article-toc a {
  display: inline-block;
  padding: .28rem 0;
  color: #374151;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .18s ease;
}
.article-toc a:hover {
  color: var(--brand-strong);
}
.article-toc ol ol {
  margin: .12rem 0 .25rem;
  padding-left: 1.4rem;
  border-left: 1px dashed #ddd6fe;
}
.article-toc ol ol a {
  font-weight: 500;
  font-size: .9rem;
  color: #6b7280;
}

@media (min-width: 1024px) {
  .article-toc {
    position: sticky;
    top: 5.5rem;
  }
}

/* 表格 */
.table-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.article-body table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .96rem;
  line-height: 1.7;
  border: 1px solid var(--line);
  border-radius: .85rem;
  overflow: hidden;
  box-shadow: 0 16px 40px -34px rgba(76, 29, 149, .35);
  table-layout: fixed;
}
.article-body thead th {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 900;
  text-align: left;
  padding: .85rem 1rem;
  border-bottom: 1px solid #ddd6fe;
  white-space: nowrap;
}
.article-body tbody th {
  text-align: left;
  background: #fcfbff;
  color: var(--ink);
  font-weight: 800;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  width: 20%;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.article-body td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  color: #475569;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.article-body tbody tr:nth-child(even) td {
  background: #fcfaff;
}
.article-body tbody tr:last-child th,
.article-body tbody tr:last-child td {
  border-bottom: 0;
}
.article-body td code {
  white-space: nowrap;
  word-break: normal;
  display: inline;
  font-size: .9em;
}

/* .flow 步骤卡：标题（strong）独立成行并突出品牌色 */
.article-body .flow div strong {
  display: block;
  margin-bottom: .3rem;
  color: var(--brand-strong);
  font-size: 1.02rem;
}

/* 选中文字品牌色 */
::selection {
  background: #ddd6fe;
  color: #3b0764;
}

/* 正文链接细下划线，提升可辨识度 */
.article-body a {
  border-bottom: 1px solid rgba(124, 58, 237, .28);
  transition: border-color .18s ease, color .18s ease;
}
.article-body a:hover {
  border-bottom-color: var(--brand);
}
