:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --line: #dce3ef;
  --text: #1a2332;
  --text-body: #334155;
  --muted: #64748b;
  --heading: #0f172a;
  --accent: #1d5fbf;
  --accent-hover: #164a96;
  --cell: #eef2f8;
  --cell-alt: #f8fafc;
  --toc-bg: linear-gradient(145deg, #ffffff, #f0f4fb);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --site-header-height: 3.5rem;
  --sticky-below-header: calc(var(--site-header-height) + 0.75rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
}

section[id] {
  scroll-margin-top: var(--sticky-below-header);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.wrap {
  max-width: 54rem;
  margin: 0 auto;
  padding: 0 1.2rem;
}

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
}

.brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--heading);
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.article-page__inner,
.article-layout {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.2rem;
}

.article-page__hero {
  padding: 2.7rem 0 1.3rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(11.5rem, 14.5rem) minmax(0, 1fr);
  gap: 2rem 2.5rem;
  /* 必须 stretch：左侧栏与正文同高，sticky 才有滚动空间 */
  align-items: stretch;
  padding-bottom: 3rem;
}

.toc-aside {
  min-width: 0;
}

.toc-aside .toc {
  position: -webkit-sticky;
  position: sticky;
  top: var(--sticky-below-header);
  z-index: 10;
}

.hero {
  padding: 2.7rem 0 1.3rem;
}

h1 {
  margin: 0 0 0.95rem;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  font-weight: 900;
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: var(--heading);
}

h2,
h3 {
  color: var(--heading);
}

.meta {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta time {
  color: #475569;
}

p {
  margin: 0 0 1.1rem;
  color: var(--text-body);
}

h2 {
  margin: 2.45rem 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.34rem;
}

h3 {
  margin: 1.55rem 0 0.75rem;
  font-size: 1.08rem;
}

ul,
ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  color: var(--text-body);
}

li {
  margin: 0.45rem 0;
}

strong {
  color: var(--heading);
}

.toc {
  background: var(--toc-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.toc__title {
  margin: 0 0 0.65rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--heading);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li {
  margin: 0;
}

.toc li + li {
  margin-top: 0.35rem;
}

.toc a {
  display: block;
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-body);
}

.toc a:hover {
  color: var(--accent);
  background: #eff6ff;
  text-decoration: none;
}

.article-body {
  min-width: 0;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.back-to-top:hover {
  border-color: var(--accent);
  background: #eff6ff;
  transform: translateY(-2px);
}

.back-to-top[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .toc-aside .toc {
    position: static;
  }

  section[id] {
    scroll-margin-top: var(--site-header-height);
  }
}

.compare-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

table.compare {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.compare th,
table.compare td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.7rem;
  vertical-align: top;
  color: var(--text-body);
}

table.compare thead th {
  background: var(--cell);
  color: var(--heading);
  font-weight: 700;
}

table.compare tbody tr:nth-child(even) td {
  background: var(--cell-alt);
}

.footer {
  margin-top: 2.6rem;
  padding: 1.2rem 0 2.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.error-main {
  padding: 4rem 0 3rem;
  text-align: center;
}

.error-main h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 0.75rem;
}

.error-main p {
  color: var(--muted);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.error-main .btn-home {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
}

.error-main .btn-home:hover {
  border-color: var(--accent);
  background: #eff6ff;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.88rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.site-nav a:hover {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.article-lead {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

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

.article-figure {
  margin: 1.6rem 0;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-figure figcaption {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.checklist {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}

.checklist li {
  margin: 0.5rem 0;
}

.faq-item {
  margin-bottom: 1.35rem;
}

.faq-item h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
}

.faq-item p {
  margin: 0;
}

.article-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

.article-footer a {
  font-weight: 600;
}

.list-page {
  padding-bottom: 3rem;
}

.list-page__hero {
  padding: 2.2rem 0 1.5rem;
}

.list-page__hero h1 {
  margin-bottom: 0.5rem;
}

.list-page__lead {
  max-width: 40rem;
  color: var(--text-body);
}

.list-page__foot {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0.35rem 0 0.65rem;
  padding: 0;
  border: none;
  font-size: 1.15rem;
  line-height: 1.4;
}

.card h2 a {
  color: var(--heading);
}

.card h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.card .meta {
  margin: 0;
  font-size: 0.86rem;
}

.card p:last-child {
  margin-bottom: 0;
  font-size: 0.95rem;
}
