/* ==========================================================================
   SpaceDesign 五大设计资产库（首页精选长廊 + 独立二级分类目录页）
   严格遵循：Architectural Neutral + Cobalt Accent、1px 极细描边、零 Emoji、双色自适应
   ========================================================================== */

.wrap-wide {
  width: min(1280px, 100% - 48px);
  margin: 0 auto;
}

/* 首页中部广场：左侧吸顶 Tab + 右侧内容舞台 */
.plaza-showcase {
  padding: var(--s-20) 0 var(--s-16);
  position: relative;
  scroll-margin-top: var(--s-16);
}

.plaza-split {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: var(--s-10);
  align-items: start;
}

.plaza-side {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plaza-tab {
  appearance: none;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--sub);
  font: 500 14.5px/1 var(--sans);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.plaza-tab:hover {
  color: var(--text);
  background: var(--soft);
}
.plaza-tab.active {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.plaza-tab b {
  font: 500 11.5px/1 var(--mono);
  opacity: 0.65;
}

.plaza-stage {
  position: relative;
  min-height: 360px;
  min-width: 0;
}

.plaza-pane {
  position: relative;
}

.plaza-pane.active {
  animation: paneReveal 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes paneReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.plaza-more-row {
  display: flex;
  justify-content: center;
  margin-top: var(--s-10);
}

.count-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  font: 600 12px/1 var(--mono);
  color: var(--sub);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  font: 600 14px/1 var(--sans);
  color: var(--text);
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.more-link:hover {
  transform: translateY(-1px);
  border-color: var(--text);
  background: var(--soft);
}
.more-link svg {
  width: 15px;
  height: 15px;
  transition: transform 0.18s ease;
}
.more-link:hover svg {
  transform: translateX(2px);
}

/* ==========================================================================
   01 · 灵感库瀑布流卡片（自动静音循环播放 MP4 + 创作者头像）
   ========================================================================== */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.masonry-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.inspo-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  group: inspo;
}

.inspo-media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 1.25);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.inspo-card:hover .inspo-media {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 32px -14px rgba(0, 0, 0, 0.16);
}

.inspo-media img,
.inspo-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.inspo-media video {
  opacity: 0;
  transition: opacity 0.28s ease;
}
.inspo-media video.is-playing {
  opacity: 1;
}

.inspo-info {
  padding: 0 2px;
}
.inspo-title {
  margin: 0;
  font: 600 13.5px/1.35 var(--sans);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inspo-sub {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sub);
}
.inspo-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
  border: 1px solid var(--line);
  flex: 0 0 18px;
}
.inspo-avatar-fallback {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--soft);
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  font: 600 9.5px/1 var(--mono);
  color: var(--sub);
  flex: 0 0 18px;
}
.inspo-creator {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inspo-dot { opacity: 0.5; }

/* ==========================================================================
   02 · 风格库画廊卡片（网页横版 + 手机竖版 + 真实色板条 + 双图悬停轮播）
   ========================================================================== */
.style-web-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.style-app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.style-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.style-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--card-bg, var(--soft));
  border: 1px solid var(--line);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.style-card.is-mobile .style-cover {
  aspect-ratio: 390 / 760;
  border-radius: 22px;
}
.style-card:hover .style-cover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.16);
}

.style-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: opacity 0.36s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.style-cover img.shot-alt {
  opacity: 0;
}
.style-card:hover .style-cover.has-alt img.shot-alt {
  opacity: 1;
}
.style-card:hover .style-cover:not(.has-alt) img.shot-main {
  transform: scale(1.02);
}

.style-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}
.style-title-group {
  min-width: 0;
  flex: 1;
}
.style-name {
  margin: 0;
  font: 600 14px/1.35 var(--sans);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.style-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swatch-dots {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.swatch-dots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
  margin-left: -4px;
}
.swatch-dots i:first-child { margin-left: 0; }

/* ==========================================================================
   03 · 元素库卡片（实时动效/组件舞台 + 可点击色卡 + 字体样张）
   ========================================================================== */
.element-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.el-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.el-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.14);
}

.el-stage {
  position: relative;
  height: 156px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}
[data-theme="dark"] .el-stage.stage-adapt {
  background: #16181d;
}
.el-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.22);
  transition: opacity 0.25s ease;
}
.el-stage iframe {
  position: absolute;
  width: 560px;
  height: 420px;
  border: 0;
  pointer-events: none;
  transform: scale(0.56);
  transform-origin: center center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.el-card.live-ready .el-stage iframe {
  opacity: 1;
}
.el-card.live-ready .el-stage img {
  opacity: 0;
}

.el-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(24, 24, 24, 0.72);
  color: #ffffff;
  font: 500 11px/22px var(--sans);
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* 配色元素色条 */
.el-palette-strip {
  width: 100%;
  height: 100%;
  display: flex;
}
.el-palette-strip span {
  flex: 1;
  height: 100%;
  position: relative;
  transition: flex 0.22s ease;
}
.el-palette-strip span:first-child { flex: 1.8; }
.el-palette-strip span:hover { flex: 2.2; }

/* 字体元素样张 */
.el-font-specimen {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text);
}
.el-font-specimen b {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.el-font-specimen span {
  font-size: 28px;
  font-weight: 600;
}

/* 图标集元素徽标 */
.el-icon-specimen {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}
.el-icon-specimen i {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.el-body {
  padding: 12px 14px;
}
.el-name {
  margin: 0;
  font: 600 13.5px/1.35 var(--sans);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.el-desc {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   04 · Skill 库卡片（等宽标识符 + 作者头像 + 一键复制给 Agent）
   ========================================================================== */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.12);
}

.skill-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
  border: 1px solid var(--line);
  flex: 0 0 30px;
}
.skill-head-text {
  min-width: 0;
  flex: 1;
}
.skill-name {
  margin: 0;
  font: 700 13.5px/1.3 var(--mono);
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skill-repo {
  margin: 2px 0 0;
  font: 400 11.5px/1.2 var(--mono);
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.skill-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.skill-cat {
  font-size: 11.5px;
  color: var(--sub);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
}
.skill-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mini-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 500 11.5px/1 var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.mini-btn:hover {
  background: var(--soft);
  border-color: var(--line-strong);
}
.mini-btn.copied {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ==========================================================================
   05 · 工具库卡片（站点图标 + 域名 + 简介）
   ========================================================================== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.12);
}

.tool-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 6px;
  object-fit: contain;
  flex: 0 0 36px;
}
.tool-meta {
  min-width: 0;
  flex: 1;
}
.tool-name {
  margin: 0;
  font: 600 14px/1.3 var(--sans);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-host {
  margin: 2px 0 0;
  font: 400 11px/1.2 var(--mono);
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-arrow {
  color: var(--sub);
  opacity: 0.65;
  transition: transform 0.16s ease, opacity 0.16s ease, color 0.16s ease;
}
.tool-card:hover .tool-arrow {
  opacity: 1;
  color: var(--text);
  transform: translate(1px, -1px);
}
.tool-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 广场底部转化横幅 */
.plaza-cta-banner {
  margin-top: var(--s-16);
  padding: var(--s-9) var(--s-10);
  border-radius: var(--r-2xl);
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}
[data-theme="dark"] .plaza-cta-banner {
  background: #171a21;
  color: #f4f5f7;
  border: 1px solid var(--line-strong);
}
.plaza-cta-copy h3 {
  margin: 0;
  font: 700 clamp(20px, 2.4vw, 26px)/1.25 var(--display);
  letter-spacing: -0.025em;
}
.plaza-cta-copy p {
  margin: 6px 0 0;
  font-size: 14.5px;
  opacity: 0.76;
}
.plaza-cta-banner .btn-invert {
  background: var(--bg);
  color: var(--text);
  flex-shrink: 0;
}
[data-theme="dark"] .plaza-cta-banner .btn-invert {
  background: #f4f5f7;
  color: #0b0c0e;
}

/* ==========================================================================
   独立素材库二级页（左上角五大库切换 + 右侧内容舞台，切换时同步独立路由）
   ========================================================================== */
.subpage-main {
  padding-top: 96px;
  padding-bottom: 88px;
  min-height: calc(100vh - 96px);
}

.catalog-shell {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.catalog-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.catalog-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.catalog-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--sub);
  font: 500 14.5px/1 var(--sans);
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.catalog-nav-item:hover {
  color: var(--text);
  background: var(--soft);
}
.catalog-nav-item.active {
  background: #f1f1f3;
  color: var(--text);
  font-weight: 600;
}
[data-theme="dark"] .catalog-nav-item.active {
  background: #1c1f26;
  color: #f4f5f7;
}

.catalog-stage {
  min-width: 0;
}

.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.catalog-head-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.catalog-head h1 {
  margin: 0;
  font: 700 24px/1.2 var(--display);
  letter-spacing: -0.025em;
  color: var(--text);
  animation: none;
}
.catalog-total {
  font: 500 12.5px/1 var(--mono);
  color: var(--sub);
}

/* 顶部细线分类筛选栏（对齐参考图下划线样式） */
.catalog-subtabs {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.catalog-subtabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 2px 12px;
  color: var(--sub);
  font: 500 14px/1.2 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease;
}
.filter-tab:hover {
  color: var(--text);
}
.filter-tab.active {
  color: var(--text);
  font-weight: 600;
}
.filter-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.search-box {
  position: relative;
  width: min(240px, 100%);
}
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--sub);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: 400 13px/1 var(--sans);
  outline: none;
  transition: border-color 0.16s ease;
}
.search-box input:focus {
  border-color: var(--text);
}

/* 二级页三列舒适网格（与参考图版式一致） */
.catalog-stage .masonry-grid,
.catalog-stage .element-grid,
.catalog-stage .tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.group-section {
  margin-bottom: var(--s-12);
}
.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--s-5);
}
.group-header h2 {
  margin: 0;
  font: 700 20px/1.3 var(--display);
  letter-spacing: -0.02em;
}
.group-header span.note {
  font-size: 13px;
  color: var(--sub);
}

.empty-box {
  text-align: center;
  padding: 72px 20px;
  color: var(--sub);
  font-size: 14.5px;
}

.sentinel {
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--sub);
  font-size: 13px;
  margin-top: 24px;
}

/* ==========================================================================
   通用详情预览弹窗（视频大图 / 风格实时网页预览 / 元素代码与色值检视）
   ========================================================================== */
.viewer-modal {
  width: min(960px, 100% - 32px);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: 0;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 32px 64px -20px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}
.viewer-modal::backdrop {
  background: rgba(10, 11, 14, 0.62);
  backdrop-filter: blur(8px);
}
.viewer-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.viewer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.viewer-title-wrap h3 {
  margin: 0;
  font: 700 16px/1.3 var(--sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.viewer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--sub);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.viewer-close:hover { color: var(--text); }

.viewer-body {
  padding: 20px;
  overflow-y: auto;
  background: var(--bg);
}
.viewer-video-stage {
  display: grid;
  place-items: center;
  background: #0b0c0e;
  border-radius: var(--r-lg);
  overflow: hidden;
  max-height: 68vh;
}
.viewer-video-stage video {
  max-width: 100%;
  max-height: 68vh;
  display: block;
}
.viewer-iframe-stage {
  width: 100%;
  height: min(64vh, 560px);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
}
.viewer-iframe-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.viewer-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font: 500 12px/1 var(--mono);
  color: var(--text);
  cursor: pointer;
}
.swatch-chip i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.viewer-code {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--soft);
  border: 1px solid var(--line);
  font: 400 12px/1.6 var(--mono);
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.viewer-foot-note {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--sub);
}
.viewer-guide {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.viewer-guide li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--sub);
}
.viewer-guide li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0.45;
}
.viewer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.viewer-tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--sub);
  font: 500 12.5px/1 var(--sans);
}
.viewer-source {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--sub);
}
.viewer-source a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 顶部全局轻提示 */
.sd-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -16px);
  z-index: 100;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: 500 13px/1 var(--sans);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sd-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 响应式适配 */
@media (max-width: 1080px) {
  .masonry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .element-grid,
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .style-app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .plaza-split,
  .catalog-shell {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
  .plaza-side {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .plaza-side::-webkit-scrollbar { display: none; }
  .plaza-tab {
    width: auto;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    flex-shrink: 0;
  }
  .catalog-sidebar {
    position: static;
    gap: 14px;
  }
  .catalog-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .catalog-nav::-webkit-scrollbar { display: none; }
  .catalog-nav-item {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: var(--card);
    flex-shrink: 0;
  }
  .catalog-head {
    flex-wrap: wrap;
  }
  .search-box {
    width: 100%;
  }
}
@media (max-width: 820px) {
  .masonry-grid,
  .catalog-stage .masonry-grid,
  .style-web-grid,
  .skill-grid,
  .element-grid,
  .catalog-stage .element-grid,
  .tool-grid,
  .catalog-stage .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .style-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plaza-cta-banner { flex-direction: column; align-items: flex-start; padding: var(--s-7); }
}
@media (max-width: 540px) {
  .masonry-grid,
  .catalog-stage .masonry-grid,
  .style-web-grid,
  .skill-grid,
  .element-grid,
  .catalog-stage .element-grid,
  .tool-grid,
  .catalog-stage .tool-grid { grid-template-columns: 1fr; }
}
