:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-soft: #f8fafc;
  --text: #1f2329;
  --text-secondary: #646a73;
  --muted: #8a919f;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --radius: 10px;
  --content-width: 820px;
  --shadow: 0 10px 28px rgba(31, 35, 41, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

a { color: var(--primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
a:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 3px; border-radius: 6px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.container {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 18px auto 40px;
}

.breadcrumb {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { margin: 0 4px; }

.article-card {
  background: var(--surface);
  border: 1px solid #e8eaed;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 30px 32px 34px;
}

.article-meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.article h1 {
  margin: 8px 0 12px;
  color: var(--text);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.35;
}

.article-description {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}

.answer-box {
  margin: 16px 0 26px;
  padding: 16px 18px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}

.answer-title {
  margin-bottom: 6px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 700;
}

.answer-content p { margin: 0; }

.content-section { margin-top: 28px; padding-top: 2px; }

.article h2,
.hub-section h2 {
  margin: 34px 0 14px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
}

.article h2 {
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.article h3 {
  margin: 24px 0 10px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.45;
}

.article p { margin: 12px 0; }

.article ul,
.article ol {
  padding-left: 1.4em;
  margin: 14px 0 20px;
}

.article li { margin: 7px 0; }

.step-list { padding-left: 0; counter-reset: step; list-style: none; }

.step-list li {
  position: relative;
  margin: 10px 0;
  padding: 12px 14px 12px 48px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th { background: var(--surface-soft); color: #364152; font-weight: 700; }
tr:last-child td { border-bottom: 0; }

figure { margin: 22px 0; }

.article img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.faq,
.related {
  margin-top: 34px;
  padding-top: 6px;
}

.faq-list { border-top: 1px solid var(--border); }

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.faq-item h3 { margin: 0 0 6px; font-size: 17px; }
.faq-item p { margin: 0; color: var(--text-secondary); }

.related-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.related-item {
  display: block;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  line-height: 1.55;
}

.related-item:hover {
  border-color: #bfdbfe;
  background: #f5f9ff;
  color: var(--primary-dark);
  text-decoration: none;
}

.hub-hero {
  margin-bottom: 20px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid #e8eaed;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hub-hero.compact { padding: 22px 24px; }

.hub-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.3;
}

.hub-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--text-secondary);
}

.hub-section { margin-top: 24px; }

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

.category-card {
  display: block;
  min-height: 92px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}

.category-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.category-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.category-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .08);
  text-decoration: none;
}

.topic-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.topic-card {
  min-height: 180px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.topic-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.4;
}

.topic-card p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.topic-card-links {
  display: grid;
  gap: 7px;
}

.topic-card-links a {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.post-list {
  display: grid;
  gap: 12px;
}

.post-item {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.post-item h3 {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}

.post-title {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.post-title:hover { color: var(--primary-dark); text-decoration: none; }

.post-item p {
  margin: 8px 0 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.more-link { margin: 14px 0 0; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.pager a,
.pager strong,
.pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(31, 35, 41, .04);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.pager strong {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.pager a:hover {
  border-color: #bfdbfe;
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .10);
  transform: translateY(-1px);
  text-decoration: none;
}

.pager a:active { transform: translateY(0); }

.pager span {
  min-width: auto;
  padding: 0 4px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
}

.topic-list a:hover {
  border-color: #bfdbfe;
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.empty-state {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
}

.site-footer {
  margin-top: 44px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.site-footer-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a { color: var(--text-secondary); }

@media (max-width: 680px) {
  body { font-size: 16px; }
  .site-header { position: static; }
  .site-header-inner {
    width: calc(100% - 24px);
    min-height: auto;
    padding: 10px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .site-nav {
    width: 100%;
    padding-bottom: 2px;
  }
  .site-nav a {
    min-height: 38px;
    padding: 0 9px;
  }
  .container {
    width: calc(100% - 24px);
    margin-top: 12px;
  }
  .article-card {
    padding: 18px 16px 22px;
    border-radius: 8px;
  }
  .article h1 { margin-top: 6px; }
  .article-description { font-size: 14px; }
  .answer-box {
    margin: 14px 0 22px;
    padding: 14px;
  }
  .article h2,
  .hub-section h2 {
    margin-top: 28px;
    font-size: 20px;
  }
  .related-list,
  .category-grid,
  .topic-card-grid {
    grid-template-columns: 1fr;
  }
  .hub-hero,
  .hub-hero.compact {
    padding: 18px 16px;
    border-radius: 8px;
  }
  .post-item { padding: 14px; }
  .post-title { font-size: 17px; }
  .pager {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 20px;
    padding-top: 14px;
  }
  .pager a,
  .pager strong,
  .pager span {
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
  }
  .site-footer-inner {
    width: calc(100% - 24px);
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }
}
