/* 画布模板：首页封面网格、详情页、轻量画布预览（后台「编辑布局」也用） */
.ct-filters { justify-content: center; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ct-card { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; text-align: left; color: var(--text);
  border: 1px solid var(--line); border-radius: 15px; background: var(--panel); transition: transform .2s, border-color .2s, box-shadow .2s; }
.ct-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.ct-cover { position: relative; display: grid; place-items: center; aspect-ratio: 3/4; overflow: hidden; background: #0d0f12; }
.ct-cover video, .ct-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-noc { color: var(--mute); }
.ct-price { position: absolute; top: 8px; right: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: #1a1206; background: #fbbf24; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.ct-price.free { color: #062a26; background: var(--accent); }
.ct-info { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.ct-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-info em { font-style: normal; font-size: 12px; color: var(--dim); }
/* 精选模板（图二样式）：封面上叠加 分类 / 标题 / 观看 / 点击 */
.ct-card.ov { position: relative; }
.ct-card.ov .ct-cover::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, .72) 100%); }
.ct-card.ov .ct-cat { position: absolute; left: 10px; top: 10px; z-index: 3; padding: 2px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; backdrop-filter: blur(6px); max-width: calc(100% - 70px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-card.ov .ct-price { z-index: 3; }
.ct-card.ov .ct-title { position: absolute; left: 12px; right: 12px; bottom: 34px; z-index: 3; color: #fff;
  font-size: 15px; font-weight: 700; line-height: 1.35; text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-card.ov .ct-stats { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 10px;
  color: rgba(255, 255, 255, .82); font-size: 12px; }
.ct-card.ov .ct-stats em { font-style: normal; color: rgba(255, 255, 255, .6); }
.ct-card.ov .ct-stats .grow { flex: 1; }
.ct-card.ov .ct-stats span { display: inline-flex; align-items: center; gap: 3px; }
.ct-card.ov .ct-stats .ic { width: 13px; height: 13px; }
@media (max-width: 760px) { .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* 详情页 */
.ct-detail-wrap { position: fixed; inset: 0; z-index: 850; display: grid; place-items: center; padding: clamp(10px, 2vw, 24px); background: rgba(0, 0, 0, .6); animation: fade .15s; }
.ct-detail { display: flex; flex-direction: column; width: min(1180px, 100%); height: min(90vh, 900px); height: min(90dvh, 900px); max-height: 100%; overflow: hidden;
  border-radius: 16px; background: var(--bg2); border: 1px solid var(--line2); box-shadow: var(--shadow); color: var(--text); }
.ct-detail > .sp-loading { margin: auto; }
.ct-dh { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.ct-dh h2 { flex: 1; margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-unlock { height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 700; flex: none; }
.ct-db { flex: 1; display: grid; grid-template-rows: auto auto minmax(220px, 1fr); gap: 12px; min-height: 0; padding: 14px 16px 16px; overflow: auto; }
.ct-status { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); }
.ct-status div { display: flex; flex-direction: column; gap: 2px; }
.ct-status b { color: var(--text); font-size: 14px; }
.ct-status span { font-size: 12px; }
.ct-status.ok { color: var(--accent); }
.ct-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 16px; align-items: start; }
.ct-media { display: flex; align-items: center; justify-content: center; height: clamp(220px, 38vh, 460px); border-radius: 12px; overflow: hidden; background: #000; }
.ct-media video, .ct-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ct-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ct-intro { margin: 0; font-size: 14px; line-height: 1.7; color: var(--dim); white-space: pre-wrap; max-height: 170px; overflow: auto; }
.ct-meta { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--panel); font-size: 14px; }
.ct-meta b { color: var(--text); }
.ct-meta span { font-size: 12px; color: var(--mute); }
.ct-graph { min-height: 220px; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 900px) {
  .ct-top { grid-template-columns: 1fr; }
  .ct-media { height: clamp(200px, 34vh, 380px); }
}
@media (max-width: 760px) {
  .ct-detail-wrap { padding: 0; }
  .ct-detail { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .ct-db { grid-template-rows: auto auto minmax(180px, 1fr); }
  .ct-unlock { padding: 0 12px; font-size: 13px; }
}
@media (max-height: 760px) {
  .ct-media { height: clamp(180px, 30vh, 320px); }
  .ct-db { grid-template-rows: auto auto minmax(180px, 1fr); }
}
.ct-detail-wrap[data-theme="light"] {
  --bg: #f6f7f9; --bg2: #f6f7f9; --panel: #ffffff; --panel2: #f1f3f6; --line: #e3e6eb; --line2: #d3d8e0;
  --text: #1c2230; --dim: #586273; --mute: #8a93a3; --accent: #0d9488; --shadow: 0 10px 28px rgba(30, 40, 60, .12);
}
.ct-detail-wrap[data-theme="light"] .gv { background-color: #f1f3f6; background-image: radial-gradient(circle, #cbd2dc 1.1px, transparent 1.3px); }

/* 轻量画布预览 */
.gv { position: relative; overflow: hidden; cursor: grab; touch-action: none; user-select: none;
  background: var(--bg) radial-gradient(circle, #262c36 1.1px, transparent 1.3px) 0 0 / 22px 22px; }
.gv.grab { cursor: grabbing; }
.gv-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.gv-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.gv-edges path { fill: none; stroke: #6b7381; stroke-width: calc(1.6px / var(--gv-k, 1)); stroke-dasharray: 6 5; opacity: .8; }
.gv-node { position: absolute; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); }
.gv-node.t-text { --c: #60a5fa; } .gv-node.t-image { --c: #34d399; } .gv-node.t-video { --c: #f472b6; } .gv-node.t-audio { --c: #fbbf24; }
.gv-head { position: absolute; left: 2px; bottom: 100%; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; width: 100%;
  font-size: 12px; color: var(--dim); white-space: nowrap; }
.gv-head svg { color: var(--c); }
.gv-del { margin-left: auto; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 0; background: transparent; color: var(--mute); cursor: pointer; }
.gv-del:hover { color: var(--danger); background: rgba(248, 113, 113, .12); }
.gv-body { position: absolute; inset: 0; overflow: hidden; border-radius: 11px; display: grid; place-items: center; }
.gv-body img, .gv-body video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.gv-body audio { width: 90%; }
.gv-text { align-self: start; width: 100%; height: 100%; padding: 10px 12px; font-size: 12px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.gv-text em { color: var(--mute); }
.gv-empty { color: var(--mute); }
.gv-play { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.gv-prompt { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; padding: 6px 9px; border-radius: 8px; font-size: 11px; line-height: 1.5;
  color: var(--dim); background: var(--panel2); border: 1px solid var(--line); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gv-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.gv-tools button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--dim); font-size: 16px; cursor: pointer; }
.gv-tools button:hover { background: var(--panel2); color: var(--text); }

/* 无限画布页顶部「我的画布 / 精选模板」切换 */
.cv-tabs { display: flex; width: fit-content; margin: 4px auto 24px; gap: 6px; padding: 5px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.cv-tabs .cv-tab { padding: 10px 30px; border: 0; border-radius: 999px; background: transparent; color: var(--dim); font-size: 17px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.cv-tabs .cv-tab.on { background: var(--text); color: var(--bg); }
.cv-plaza { margin-top: 4px; }
