:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #657287;
  --line: #d9e2ec;
  --blue: #2359b6;
  --teal: #147f7a;
  --green: #197550;
  --amber: #a86612;
  --violet: #6651a8;
  --soft-blue: #e8f1fb;
  --soft-teal: #e5f4f2;
  --soft-green: #e9f7f0;
  --soft-amber: #fff3dc;
  --soft-violet: #f0edfb;
  --shadow: 0 16px 36px rgba(22, 32, 51, .08);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0, #f4f7fb 420px, #eef3f8 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
}

.wrap {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(35, 89, 182, .22);
  flex: 0 0 auto;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.site-nav a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #39465c;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--blue);
  border-color: #b7c8df;
}

main {
  flex: 1;
  padding: 34px 0 54px;
}

.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  align-items: center;
  gap: 34px;
  padding: 20px 0 34px;
}

.hero > div,
.hero > aside {
  min-width: 0;
}

.hero-copy,
.lead,
.page-hero,
.page-hero h1,
.page-hero p,
.section-block,
.channel-grid,
.card-grid,
.two-column,
.list-stack,
.topic-panel,
.demo-grid,
.demo-card,
.content-card,
.list-item,
.article-shell,
.article-content {
  min-width: 0;
  max-width: 100%;
}

.hero-copy,
.page-hero,
.content-card,
.list-item {
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--teal);
  display: inline-block;
}

h1,
h2,
h3,
p,
strong {
  margin: 0;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 span {
  display: block;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  font-size: 19px;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.72;
}

.lead {
  width: 100%;
  max-width: 680px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.82;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid transparent;
}

.button.primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(35, 89, 182, .20);
}

.button.secondary {
  color: var(--blue);
  background: #fff;
  border-color: var(--line);
}

.hero-board {
  display: grid;
  gap: 12px;
}

.hero-board div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
}

.hero-board span,
.content-meta,
.article-meta {
  color: var(--muted);
  font-size: 13px;
}

.hero-board strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.2;
}

.section-block {
  margin-top: 26px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head p {
  margin-top: 6px;
}

.channel-grid,
.card-grid,
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.channel-card,
.content-card,
.demo-card,
.topic-panel,
.article-shell,
.resource-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.channel-card,
.content-card,
.demo-card {
  display: block;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.channel-card:hover,
.content-card:hover,
.demo-card:hover {
  transform: translateY(-2px);
  border-color: #b8c7da;
  box-shadow: 0 22px 46px rgba(22, 32, 51, .12);
}

.channel-card {
  min-height: 154px;
  padding: 18px;
}

.channel-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.channel-card span {
  display: block;
  margin-top: 10px;
  color: #374151;
  font-size: 13px;
  line-height: 1.55;
}

.channel-card em {
  display: inline-flex;
  margin-top: 14px;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.blue { background: var(--soft-blue); }
.teal { background: var(--soft-teal); }
.green { background: var(--soft-green); }
.amber { background: var(--soft-amber); }
.violet { background: var(--soft-violet); }
.gray { background: #f8fafc; }

.content-card {
  min-height: 206px;
  padding: 18px;
}

.content-card.featured {
  min-height: 244px;
}

.content-card h3 {
  margin-top: 12px;
  line-height: 1.35;
}

.content-card p {
  margin-top: 10px;
  font-size: 14px;
}

.content-card p,
.page-hero p,
.article-content p,
.article-content li,
.list-item strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--blue);
  background: #edf4ff;
  border: 1px solid #d6e6fb;
  font-size: 12px;
  font-weight: 700;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 18px;
  align-items: start;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.list-item:hover {
  border-color: #b8c7da;
}

.list-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.38;
}

.topic-panel {
  padding: 18px;
}

.topic-panel h2 {
  margin-bottom: 12px;
}

.topic-panel a {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.demo-card {
  display: grid;
  grid-template-columns: minmax(260px, .86fr) minmax(0, 1fr);
}

.demo-thumb {
  aspect-ratio: 16 / 9;
  background: #e9eef6;
  overflow: hidden;
}

.demo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-body {
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.demo-body strong {
  font-size: 20px;
}

.demo-body span {
  color: var(--muted);
  line-height: 1.65;
}

.demo-body em {
  color: var(--blue);
  font-style: normal;
  font-weight: 800;
}

.page-hero {
  padding: 42px 0 22px;
}

.page-hero h1 {
  width: 100%;
  max-width: 780px;
}

.page-hero p {
  width: 100%;
  max-width: 760px;
  margin-top: 14px;
  font-size: 16px;
}

.directory-main {
  padding: 0 0 60px;
}

.directory-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 28px;
  align-items: end;
  padding: 42px 0 20px;
}

.directory-copy,
.directory-brief,
.directory-switcher,
.directory-section-head,
.directory-layout,
.directory-card,
.directory-card-content,
.directory-side,
.directory-note {
  min-width: 0;
}

.directory-back {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.directory-copy h1 {
  max-width: 780px;
}

.directory-copy p {
  max-width: 680px;
  margin-top: 14px;
  font-size: 16px;
}

.directory-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.directory-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  color: var(--muted);
  font-size: 13px;
}

.directory-stats strong {
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.directory-brief {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(232, 241, 251, .76)),
    repeating-linear-gradient(135deg, rgba(35, 89, 182, .05) 0, rgba(35, 89, 182, .05) 1px, transparent 1px, transparent 12px);
  box-shadow: var(--shadow);
}

.directory-brief span,
.directory-section-head span,
.directory-note span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.directory-brief strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.22;
}

.directory-brief p {
  margin-top: 12px;
  color: #334155;
  font-size: 14px;
}

.directory-mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.directory-muted {
  color: var(--muted);
  font-size: 13px;
}

.directory-switcher {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.directory-switcher a {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, .9);
  color: #334155;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}

.directory-switcher a:hover,
.directory-switcher a:focus-visible {
  background: #f8fbff;
  color: var(--blue);
}

.directory-switcher a.active {
  background: var(--blue);
  color: #fff;
}

.directory-switcher span {
  font-size: 15px;
  font-weight: 800;
}

.directory-switcher em {
  color: inherit;
  font-size: 12px;
  font-style: normal;
  opacity: .78;
}

.directory-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.directory-section-head h2 {
  margin-top: 6px;
  font-size: 26px;
}

.directory-section-head p {
  max-width: 460px;
  text-align: right;
}

.directory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}

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

.directory-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 154px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(22, 32, 51, .06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.directory-card:hover,
.directory-card:focus-visible {
  transform: translateY(-2px);
  border-color: #b8c7da;
  box-shadow: 0 18px 38px rgba(22, 32, 51, .1);
}

.directory-card:active {
  transform: translateY(0);
}

.directory-card.is-latest {
  background:
    linear-gradient(90deg, rgba(232, 241, 251, .88), rgba(255, 255, 255, .96));
}

.directory-card-index {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.directory-card-content {
  display: grid;
  gap: 9px;
}

.directory-card-content strong {
  font-size: 20px;
  line-height: 1.35;
}

.directory-card-content p {
  max-width: 760px;
  color: #334155;
  font-size: 14px;
}

.directory-card-content .tag-row {
  margin-top: 2px;
}

.directory-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d6e6fb;
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.directory-side {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 96px;
}

.directory-note {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
}

.directory-note p {
  margin-top: 8px;
  color: #334155;
  font-size: 14px;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 120px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.state-mark {
  width: 32px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d6e6fb, #e5f4f2, #d6e6fb);
  background-size: 180% 100%;
  animation: state-pulse 1.2s ease-in-out infinite;
}

.retry-button {
  min-height: 36px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

@keyframes state-pulse {
  0% { background-position: 0 50%; }
  100% { background-position: 180% 50%; }
}

.article-shell {
  width: min(860px, calc(100% - 40px));
  margin: 40px auto 54px;
  padding: 32px;
}

.article-shell h1 {
  margin-top: 10px;
  font-size: clamp(30px, 5vw, 48px);
}

.article-meta {
  margin-top: 16px;
}

.article-content {
  margin-top: 26px;
}

.article-content h2 {
  margin: 28px 0 10px;
  font-size: 22px;
}

.article-content p,
.article-content li {
  color: #334155;
  line-height: 1.86;
}

.article-content ul,
.article-content ol {
  padding-left: 22px;
}

.resource-panel {
  margin-top: 22px;
  padding: 18px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.footbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.empty-state,
.content-error {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .two-column,
  .demo-card,
  .directory-hero,
  .directory-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .directory-side {
    position: static;
  }

  .directory-switcher {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
  }

  .directory-switcher a {
    min-width: 0;
  }

  .directory-section-head {
    align-items: start;
    flex-direction: column;
  }

  .directory-section-head p {
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .wrap,
  .article-shell {
    width: calc(100% - 28px);
    max-width: 1160px;
  }

  main {
    padding-top: 24px;
  }

  h1 {
    font-size: 31px;
    line-height: 1.16;
  }

  .lead,
  .page-hero p {
    font-size: 15px;
  }

  .site-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    white-space: normal;
    gap: 6px;
  }

  .site-nav a {
    padding: 7px 9px;
  }

  .actions,
  .button {
    width: 100%;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .article-shell {
    padding: 22px;
  }

  .directory-hero {
    padding-top: 28px;
  }

  .directory-brief,
  .directory-card,
  .directory-note {
    padding: 16px;
  }

  .directory-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .directory-card-index {
    width: 44px;
    height: 44px;
  }

  .directory-card-action {
    width: 100%;
  }
}
