/* 公开教程统一视觉：正文无需JavaScript，窄屏保留完整阅读和视频播放能力。 */
:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #22243b;
  background: #f7f8fe;
  line-height: 1.75;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #5357e8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 5px;
}
img {
  max-width: 100%;
  height: auto;
}
.site-header {
  background: #fff;
  border-bottom: 1px solid #e9eaf6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px max(24px, calc((100vw - 1120px) / 2));
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
.brand img {
  width: 32px;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.workspace-link {
  display: inline-block;
  background: linear-gradient(110deg, #3969ff, #9827f8);
  padding: 9px 20px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px 24px 60px;
}
.catalog-hero {
  padding: 34px 0 42px;
}
.eyebrow {
  color: #6a5ae8;
  font-size: 14px;
  font-weight: 600;
}
h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.4;
  margin: 12px 0 20px;
}
h2 {
  font-size: 22px;
  line-height: 1.5;
}
.catalog-hero p,
.summary {
  color: #61637a;
}
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.tutorial-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e7e7f8;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 30px #4f46e507;
  color: inherit;
}
.tutorial-card:hover {
  border-color: #aaa5f5;
  text-decoration: none;
}
.tutorial-card img {
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 18px;
}
.tutorial-card h2 {
  font-size: 19px;
  margin: 12px 0;
}
.tutorial-card p {
  font-size: 14px;
  color: #686980;
  margin: 0 0 20px;
}
.type-label {
  color: #6b57dc;
  font-size: 12px;
}
.read-link {
  color: #6858dc;
  margin-top: auto;
  font-size: 14px;
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
}
.breadcrumbs {
  font-size: 14px;
  margin-bottom: 24px;
  color: #73758b;
}
.article {
  max-width: 860px;
  margin: auto;
  background: #fff;
  border: 1px solid #e7e7f8;
  border-radius: 24px;
  padding: 44px;
}
.updated {
  color: #85879a;
  font-size: 13px;
}
.article video {
  /* 教程横竖屏视频共用尺寸上限；按固有比例缩放，窄屏和矮屏均保留阅读空间。 */
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 720px);
  max-height: min(540px, 70vh);
  object-fit: contain;
  border-radius: 14px;
  background: #161626;
  margin: 20px auto;
}
.article video:fullscreen {
  /* 全屏播放使用完整屏幕，不继承正文播放器的尺寸上限。 */
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
}
.contents {
  background: #f6f5ff;
  border-radius: 14px;
  padding: 14px 24px;
  margin: 30px 0;
}
.contents h2 {
  font-size: 16px;
  margin: 0;
}
.contents ol {
  padding-left: 22px;
}
.step {
  scroll-margin-top: 24px;
  margin: 36px 0;
}
.step-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #4c4e65;
}
.step img {
  display: block;
  border: 1px solid #e8e8f4;
  border-radius: 14px;
  margin: 20px auto;
}
.faq details {
  padding: 16px 0;
  border-bottom: 1px solid #ececf5;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
}
.start-creating {
  background: #f5f3ff;
  border-radius: 16px;
  padding: 24px;
  margin-top: 36px;
}
.start-creating h2 {
  font-size: 20px;
  margin-top: 0;
}
footer {
  text-align: center;
  font-size: 13px;
  color: #828499;
  padding: 24px;
}
.empty {
  grid-column: 1/-1;
  color: #7a7c91;
}
@media (max-width: 900px) {
  .tutorial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .tutorial-grid {
    grid-template-columns: 1fr;
  }
  .article {
    padding: 24px 20px;
  }
  .page {
    padding: 24px 16px;
  }
  .site-header {
    padding: 14px 16px;
  }
  .site-header nav {
    gap: 12px;
    font-size: 13px;
  }
  .brand {
    font-size: 16px;
  }
  .workspace-link {
    padding: 8px 12px;
  }
}
.step-figure {
  margin: 24px 0;
}
.image-preview-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.image-preview-trigger:focus-visible,
.image-preview-close:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 5px;
}
/* 模态预览按可用视口展示完整原图，窄屏与大屏使用同一布局规则。 */
.image-preview {
  max-width: 96vw;
  max-height: 96dvh;
  padding: 52px 12px 12px;
  border: 0;
  border-radius: 16px;
  background: #fff;
}
.image-preview::backdrop {
  background: #161626cc;
}
.image-preview-close {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f6f5ff;
  color: #22243b;
  cursor: pointer;
}
.image-preview-content {
  display: block;
  max-width: calc(96vw - 24px);
  max-height: calc(96dvh - 64px);
  object-fit: contain;
}
.step-figure figcaption {
  color: #7b7d91;
  font-size: 13px;
  text-align: center;
}

/* 分类是真实目录链接；窄屏自动换行，关闭 JavaScript 仍可筛选。 */
.category-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.category-filters a { border: 1px solid #e5e4f2; border-radius: 24px; padding: 7px 16px; background: white; color: #6c6888; }
.category-filters a[aria-current] { background: #eeebff; color: #5945fa; border-color: #dcd5ff; }
.category-filters span { font-size: 12px; opacity: .75; margin-left: 4px; }
.category-label { margin-left: 8px; font-size: 12px; color: #79738b; }
