/* ═══════════════════════════════════════════
   数字彝藏 — 纹样库 / 文化库 双 tab
   ═══════════════════════════════════════════ */
.yz-tabs {
  display: flex; gap: 28px;
  max-width: 1800px; margin: 0; padding: 16px 32px 0 16px;
  border-bottom: 1px solid var(--border);
}
.yz-tab {
  padding: 10px 0; font-size: 0.92rem; font-weight: 500;
  color: var(--fg-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.yz-tab:hover { color: var(--fg); }
.yz-tab.active { color: var(--fg); border-bottom-color: var(--pop); }
.yz-pane { display: none; }
.yz-pane.active { display: block; }

/* ═══════════════════════════════════════════
   数字纹样库 — 左侧竖栏 + 透视悬浮卡片 + 外观分类
   ═══════════════════════════════════════════ */
.styles-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  max-width: 1800px;
  margin: 0;
  padding: 48px 32px 80px 16px;
}

/* ── 左侧竖栏：文化分类 ── */
.styles-side {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  align-self: start;
  border-right: 1px solid var(--border);
  padding-right: 20px;
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
  scrollbar-width: none;
}
.styles-side::-webkit-scrollbar { display: none; }
.styles-side__group { margin-bottom: 18px; }
.styles-side__title {
  font-size: 0.92rem; font-weight: 500; color: var(--fg);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.styles-side__subs { display: block; padding: 2px 0 6px; }
.styles-side__sub {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 22px;
  font-size: 0.82rem; color: var(--fg-muted);
  cursor: pointer; border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.styles-side__sub:hover { background: var(--bg-hover); color: var(--fg); }
.styles-side__sub.active { color: var(--fg); font-weight: 500; background: var(--accent-soft); }
.styles-side__ico { width: 14px; height: 14px; color: var(--fg-dim); flex-shrink: 0; }
.styles-side__sub:hover .styles-side__ico { color: var(--fg); }
.styles-side__sub.active .styles-side__ico { color: var(--pop); }

/* ── 主区 ── */
.styles-main { min-width: 0; }
.styles-head {
  display: flex; align-items: center; gap: 32px;
  margin-bottom: 32px;
  position: relative;   /* 首访片头 veil 定位容器 */
}
/* 首访片头已取消（效果不好，用户决定）。以下样式留作备用，不再使用。
.styles-intro { ... }
*/
.styles-head__text { flex: 1; min-width: 0; }
.styles-title {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 500; color: var(--fg); line-height: 1.1;
}
.styles-desc {
  font-size: 0.86rem; color: var(--fg-muted); line-height: 1.95;
  margin-top: 16px; max-width: 520px;
}

/* ── 透视悬浮卡片 (仿佛从深处射到屏幕前) ── */
.styles-float {
  position: relative;
  width: 440px; height: 360px;
  flex-shrink: 0;
  perspective: 1200px;
  overflow: visible;
}
.styles-float__card {
  position: absolute;
  width: 116px; height: 154px;
  top: var(--y); left: var(--x);
  cursor: pointer;   /* 点击跳转纹样详情 */
  /* 透视：上边宽下边窄 (rotateX+) + 朝中心消失点偏转 (rotateY 随水平位置) */
  transform: rotateX(var(--ax, 16deg)) rotateY(var(--ay, 0deg)) scale(var(--s)) rotate(var(--r));
  transform-style: preserve-3d;
}
.styles-float__card:focus-visible { outline: none; }
.styles-float__card:focus-visible .styles-float__inner { box-shadow: var(--focus-ring); }
.styles-float__bob {
  width: 100%; height: 100%;
  animation: sf-bob var(--dur, 6s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  transform-style: preserve-3d;
}
.styles-float__inner {
  width: 100%; height: 100%;
  border-radius: 10px; overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.12);
  border: 1px solid rgba(255,255,255,0.4);
  transform: rotateX(0) rotateY(0);
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.styles-float__inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 三层景深：后排朦胧缩小 / 前排加大投影 */
.styles-float__card[data-layer="back"] .styles-float__inner {
  filter: blur(0.6px) brightness(0.92);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.styles-float__card[data-layer="front"] .styles-float__inner {
  box-shadow: 0 14px 36px rgba(0,0,0,0.22), 0 3px 8px rgba(0,0,0,0.14);
}
[data-theme="dark"] .styles-float__inner { border-color: rgba(255,255,255,0.12); }

/* 交错入场：逐张上浮浮现（一次） */
@keyframes floatCardIn {
  from { opacity: 0; transform: translateY(26px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.styles-float__card { animation: floatCardIn 0.7s var(--ease-emph) both; animation-delay: var(--delay, 0s); }
@media (prefers-reduced-motion: reduce) {
  .styles-float__card { animation: none; }
}
@keyframes sf-bob {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(var(--bx, 6px), var(--by, -8px)); }
}
@media (max-width: 900px) {
  .styles-head { flex-direction: column; align-items: flex-start; }
  .styles-float { width: 100%; height: 260px; }
  .culture-cloud { width: 100%; height: 200px; }
}
@media (max-width: 768px) {
  .styles-layout { grid-template-columns: 1fr; gap: 24px; padding: 32px 20px 60px 20px; }
  .styles-side { position: static; border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 16px; max-height: none; }
}
@media (max-width: 500px) {
  .styles-layout { padding: 16px 12px 40px 12px; }
  .yz-tabs { padding: 12px 12px 0; gap: 16px; }
  .styles-classify { gap: 12px; }
  .styles-float { height: 200px; }
  .culture-cloud { height: 160px; }
}

/* ── 外观分类条 (颜色/类型/来源 下拉) ── */
.styles-classify {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
}
.styles-drop { position: relative; }
.styles-drop__btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 0;
  font-size: 0.85rem; color: var(--fg-muted);
  background: none; border: none; border-radius: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.styles-drop__btn:hover { color: var(--fg); }
.styles-drop__btn .caret { font-size: 0.62rem; color: var(--fg-dim); margin-left: 2px; }
.styles-drop__btn.has-val { color: var(--fg); font-weight: 500; }
.styles-drop__panel {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none; z-index: 60;
  transform-origin: top left;
}
.styles-drop__panel.open { display: block; animation: dropIn 0.22s var(--ease-emph); }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.styles-drop__opt {
  display: block; width: 100%; text-align: left;
  padding: 7px 12px; font-size: 0.8rem; color: var(--fg-muted);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s;
}
.styles-drop__opt:hover { background: var(--bg-hover); color: var(--fg); }
.styles-drop__opt.active { color: var(--pop); font-weight: 500; }

/* 搜索：竖细线 + 放大镜 + 输入 */
.styles-classify__search-wrap {
  display: flex; align-items: center; gap: 10px;
}
.styles-classify__sep {
  display: inline-block; width: 1px; height: 18px;
  background: var(--border-strong); flex-shrink: 0;
}
.styles-classify__search-wrap .icon-svg { width: 16px; height: 16px; color: var(--fg-muted); flex-shrink: 0; }
.styles-classify__search {
  padding: 8px 0;
  background: none; border: none; border-radius: 0;
  font-size: 0.85rem; color: var(--fg);
  outline: none; width: 150px;
}
.styles-classify__search::placeholder { color: var(--fg-dim); }

/* ═══════ 数字文化库 — 关键字云图（重做：交错入场/慢漂/旋转/权重点睛） ═══════ */
.culture-cloud {
  position: relative; flex-shrink: 0;
  width: 460px; height: 240px;
  overflow: hidden;
}
.culture-cloud__word {
  position: absolute; white-space: nowrap;
  color: var(--fg-muted); cursor: pointer; text-decoration: none;
  font-family: var(--font-display); font-weight: 500;
  opacity: var(--op, 0.8);
  transition: color 0.15s;
  animation:
    cultureWordIn 0.6s var(--ease-emph) both,
    cultureWordDrift var(--fdur, 7s) ease-in-out var(--fdelay2, 0s) infinite alternate;
  animation-delay: var(--fdelay, 0s), var(--fdelay2, 0s);
}
/* 入场：从略缩小+透明到定位（transform 只作用于入场帧） */
@keyframes cultureWordIn {
  from { opacity: 0; transform: scale(0.6) rotate(var(--rot, 0deg)) translateY(10px); }
  to   { opacity: var(--op, 0.8); transform: scale(1) rotate(var(--rot, 0deg)) translateY(0); }
}
/* 慢漂：在旋转基础上微位移 */
@keyframes cultureWordDrift {
  from { transform: rotate(var(--rot, 0deg)) translate(0, 0); }
  to   { transform: rotate(var(--rot, 0deg)) translate(var(--fx, 0), var(--fy, 0)); }
}
.culture-cloud__word:hover { color: var(--fg); transform: none; }
/* 权重最高者：彝红点睛 */
.culture-cloud__word--ace { color: var(--pop); font-weight: 700; }
.culture-cloud__word--ace:hover { color: var(--pop-strong); }
@media (prefers-reduced-motion: reduce) {
  .culture-cloud__word { animation: none; }
}
@media (max-width: 900px) {
  .styles-head { flex-direction: column; align-items: flex-start; }
  .culture-cloud { width: 100%; height: 200px; }
}

/* ═══════ 数字文化库 — 卡片（标签封面） ═══════ */
.culture-card { padding: 0; }
.culture-card__cover {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 500;
  color: var(--fg); background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  min-height: 92px; padding: 16px 10px; text-align: center;
  border-bottom: 1px solid var(--border); letter-spacing: 0.04em;
  transition: background 0.2s;
}
.culture-card:hover .culture-card__cover { background: var(--bg-hover); }
.culture-card .card__body { padding: 11px 13px; }
.culture-card .card__title { font-size: 0.82rem; font-weight: 500; line-height: 1.4; }
.culture-card .card__meta { font-size: 0.7rem; margin-top: 3px; }
/* 云图点击 → 目标卡片脉冲定位（彝红描边扩散 + 轻微抬起） */
@keyframes culture-spot-kf {
  0%   { box-shadow: 0 0 0 0 rgba(198,54,44,0.5); border-color: var(--pop); transform: translateY(-4px) scale(1.02); }
  55%  { box-shadow: 0 0 0 12px rgba(198,54,44,0); border-color: var(--pop); transform: translateY(-4px) scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(198,54,44,0); border-color: var(--border); transform: none; }
}
[data-theme="dark"] .culture-spot { animation-name: culture-spot-kf-dark; }
@keyframes culture-spot-kf-dark {
  0%   { box-shadow: 0 0 0 0 rgba(224,87,75,0.55); border-color: var(--pop); transform: translateY(-4px) scale(1.02); }
  55%  { box-shadow: 0 0 0 12px rgba(224,87,75,0); border-color: var(--pop); transform: translateY(-4px) scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(224,87,75,0); border-color: var(--border); transform: none; }
}
.culture-spot { animation: culture-spot-kf 2.2s var(--ease-emph); z-index: 2; position: relative; }

/* ── 文化库侧栏：标题 + 右侧查看 ── */
#yzCulture .styles-side__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#yzCulture .styles-side__title--all { justify-content: flex-start; gap: 8px; cursor: pointer; }
#yzCulture .styles-side__title--all .styles-side__ico { width: 10px; height: 10px; color: var(--fg-dim); }
#yzCulture .styles-side__title--all.active { color: var(--fg); }
#yzCulture .styles-side__title--all.active .styles-side__ico { color: var(--fg); }
#yzCulture .styles-side__view {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.92rem; font-weight: 400; color: var(--fg);
  cursor: pointer; transition: color 0.15s; flex-shrink: 0;
}
#yzCulture .styles-side__view:hover { opacity: 0.7; }
#yzCulture .styles-side__view.active { font-weight: 500; }
#yzCulture .styles-side__view .styles-side__ico { width: 10px; height: 10px; }
