/* ============================================================
   FLMC 首页样式（index.html）
   还原原站首页结构：智能体对话框 + 作品展示预览 + 精选视频
   ============================================================ */

/* ============================================================
   🍁 小枫在首页的位置（样式本体在 css/mascot.css，登录页也用同一份）
   —— 气泡挂在小枫**正下方**且**在文档流里占位**，所以不会盖住任何东西
   （第一版浮在头顶把页面"架空"了，用户反馈后改的）
   ============================================================ */
.home-hero-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* 全宽后整行贴左（原 center 会在宽屏上左右空一大块） */
  gap: 22px;
  flex-wrap: wrap;
}
.home-hero-text { text-align: left; }
/* 小枫那一列：本人在上、气泡在下（气泡在文档流里，永远不会压到别的东西） */
.home-mascot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 236px;
  flex: 0 0 auto;
}
/* 气泡的独立槽位：**在文档流里**，固定占位，所以永远不会盖住导航/标题，也不会让页面"架空" */
.home-mascot-say {
  position: relative;
  width: 232px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-mascot-say .mx-bubble {
  position: relative;      /* 相对自身定位：尾巴跟着气泡走 */
  transform: translateX(-6px) scale(0.98);
  margin: 0;
  max-width: 232px;
  opacity: 0;
}
.home-mascot-say .mx-bubble.open { transform: none; }
/* 小尾巴指向上面的小枫 */
.home-mascot-say .mx-bubble::after {
  left: 50%;
  top: -6px;
  bottom: auto;
  margin-left: -5px;
  margin-top: 0;
  border-right: none;
  border-left: 1px solid #3b3b45;
  border-top: 1px solid #3b3b45;
}
.home-mascot {
  position: relative;
  width: 168px;
  min-height: 190px;
  flex: 0 0 auto;
}
.home-mascot .mx-svg { width: 100%; height: auto; display: block; }

@media (max-width: 720px) {
  .home-mascot { width: 132px; min-height: 152px; }
  .home-mascot-col { width: 100%; }
  .mx-bubble { max-width: 200px; font-size: 12px; }
}


/* ---------- 首页主区 ---------- */
.home-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
}

/* hero 与智能体对话框：全宽、与下方 .home-section 同左缘（32px 内边距）
   —— 以前 835px 居中窄列，宽屏下左右各空一大块（2026-09-19 用户反馈修正） */
.home-hero,
.home-agent {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 32px;
  padding-right: 32px;
}

/* ---------- 标题区（原站 pt-clamp + 居中） ---------- */
.home-hero {
  /* 截图实测：导航底 36，hero 标题 ink 顶 118.5 → 上方留白 82.5 */
  padding-top: clamp(4rem, 6.5vw, 5.5rem);
  padding-bottom: 12px;
  text-align: left;
}

.home-hero h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

.home-hero h1 b {
  font-weight: 400;
  color: var(--accent);
}

.home-lead {
  margin-top: 0;
  font-size: clamp(13px, 3.5vw, 15px);
  color: var(--text-dim);
  line-height: 1.4;
}

/* ================= 智能体对话框（还原 xot 组件） ================= */
.home-agent {
  margin-top: 16px;
}

.agent-input-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  /* 截图实测：输入框 787×118（含 1 行输入区 + 底部工具条） */
  padding: 12px 16px 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transition: border-color var(--dur), box-shadow var(--dur);
}

.agent-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--accent-glow);
}

.agent-input-wrap textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  min-height: 26px;
  max-height: 240px;
}

.agent-input-wrap textarea::placeholder {
  color: var(--text-faint);
}

/* 输入框上方引导语（还原原站：描述你的想法，开始一个新项目） */
.agent-prompt-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

/* 底部工具条（还原原站：左下角工具 + 右下角 风格/比例/上传/发送） */
.agent-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.agent-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 工具图标按钮（附件 / 规则 / 上传） */
.agent-tool {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  border: 1px solid transparent;
  transition: color var(--dur), background var(--dur), border-color var(--dur);
}

.agent-tool:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.agent-tool.has-attach {
  color: var(--accent);
  border-color: var(--accent);
}

/* 风格 / 比例选择（无风格 ▾ / 16:9 ▾） */
.agent-pick {
  position: relative;
}

.agent-pick-btn {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  transition: all var(--dur);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.agent-pick-btn:hover,
.agent-pick-btn[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--border-strong);
}

.agent-pick-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 150px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  display: none;
}

.agent-pick-menu.open {
  display: block;
  animation: fade-in 0.18s var(--ease);
}

.agent-pick-item {
  width: 100%;
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: 7px;
  padding: 7px 10px;
  transition: background var(--dur), color var(--dur);
  white-space: nowrap;
}

.agent-pick-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.agent-pick-item.active {
  color: var(--accent);
  background: rgba(232, 99, 43, 0.1);
}

/* 发送按钮（向上箭头，圆形主按钮） */
.agent-send {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.agent-send svg {
  width: 16px;
  height: 16px;
}

/* 附件名称提示（上传后显示在工具条下方） */
.agent-attach-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.agent-attach-hint .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(232, 99, 43, 0.12);
  border: 1px solid rgba(232, 99, 43, 0.35);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
}

.agent-attach-hint .tag button {
  color: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
}

/* ================= 规则编辑弹窗 ================= */
.rule-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rule-modal.open {
  display: flex;
}

.rule-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.rule-modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: pop-in 0.3s var(--ease);
}

.rule-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.rule-modal-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.rule-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 15px;
  transition: background var(--dur), color var(--dur);
}

.rule-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.rule-modal-box textarea {
  width: 100%;
  min-height: 220px;
  font-family: var(--font-mono), monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-card);
  border: none;
  outline: none;
  resize: vertical;
  padding: 16px 20px;
}

.rule-modal-box textarea::placeholder {
  color: var(--text-faint);
}

.rule-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}

.rule-modal-hint {
  font-size: 11.5px;
  color: var(--text-faint);
}

.rule-modal-foot .btn {
  flex-shrink: 0;
}

/* ---------- 功能菜单（还原原站 presets：6 个入口等宽排列） ---------- */
.agent-functions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.agent-fn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px 9px;   /* 截图实测功能行高 60 */
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur);
}

.agent-fn:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.agent-fn-ico {
  font-size: 19px;
  line-height: 1;
}

.agent-fn-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.agent-fn:hover .agent-fn-label {
  color: var(--text);
}

/* ================= 首页区块 ================= */
.home-section {
  margin-top: 6px;
  /* 最近项目 / 精选作品：全宽 + 32px 内边距（截图实测内容 x 32..1230 / 视口 1262） */
  padding-left: 32px;
  padding-right: 32px;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

/* 放映厅标题右侧：上传替换按钮 + 当前来源提示（2026-09-13） */
.home-section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-section-hint {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* 自己上传的展示视频：卡片右上角的改名/删除按钮 */
.showcase-manage {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.showcase-manage .chip {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.55);
}

/* 放映厅：排序下拉 + 点赞按钮（2026-09-14） */
.home-showcase-sort {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
  background: #16202a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.showcase-like {
  margin-top: 8px;
  min-height: 26px;
  padding: 3px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.showcase-like b { font-weight: 600; margin-left: 2px; }
.showcase-like:hover { border-color: var(--accent); color: var(--accent); }
.showcase-like.is-liked { border-color: var(--accent); color: var(--accent); background: rgba(232, 99, 43, 0.12); }
.showcase-like:disabled { opacity: 0.6; }

.home-section-head h2 {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
}

.home-viewall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
  transition: color var(--dur);
  padding: 6px 0;
  min-height: 32px;
}

.home-viewall:hover {
  color: var(--text);
}

.home-viewall svg {
  transition: transform 0.3s var(--ease);
}

.home-viewall:hover svg {
  transform: rotate(45deg);
}

/* ---------- 最近项目网格（原站 grid-cols-2/3/5） ---------- */
.home-projects-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.home-project-card {
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur);
}

.home-project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.home-project-thumb {
  /* 截图实测：卡片 228×127.5，其中缩略图 86、信息区 41.5 */
  aspect-ratio: 16 / 6;
  background: linear-gradient(160deg, var(--bg-elev), var(--bg-card));
  display: grid;
  place-items: center;
  color: var(--text-faint);
  position: relative;
  overflow: hidden;
}

.home-project-thumb.has-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-project-thumb .pj-ico {
  font-size: 22px;
  opacity: 0.5;
}

.home-project-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 11px 12px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 精选视频网格（原站 grid-cols-1/2/3） ---------- */
.home-videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.home-video-card {
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur);
}

.home-video-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.home-video-thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.home-video-thumb .art {
  position: absolute;
  inset: 0;
}

.home-video-thumb .vplay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.home-video-thumb .vplay span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(232, 99, 43, 0.92);
  color: #0e1519;
  display: grid;
  place-items: center;
  font-size: 16px;
  padding-left: 3px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  transition: transform var(--dur);
}

.home-video-card:hover .vplay span {
  transform: scale(1.12);
}

.home-video-info {
  padding: 12px 14px 14px;
}

.home-video-info h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.home-video-info p {
  font-size: 12.5px;
  color: var(--text-faint);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-video-tags {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}

/* 加载骨架屏 */
.home-skeleton {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: linear-gradient(100deg, var(--bg-card) 40%, var(--bg-elev) 50%, var(--bg-card) 60%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s infinite linear;
}

@keyframes sk-shimmer {
  to { background-position: -200% 0; }
}

/* ================= 视频预览弹窗 ================= */
.pp-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.pp-modal.open {
  display: flex;
  animation: fade-in 0.25s var(--ease);
}

.pp-modal-box {
  width: 100%;
  max-width: 640px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  animation: pop-in 0.3s var(--ease);
}

.pp-art {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pp-art::after {
  content: "▶";
  font-size: 46px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.pp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: background var(--dur);
}

.pp-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.pp-info {
  padding: 20px 24px 24px;
}

.pp-info h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
}

.pp-meta {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
}

.pp-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.pp-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= 响应式 ================= */
@media (max-width: 900px) {
  .home-projects-grid { grid-template-columns: repeat(3, 1fr); }
  .home-videos-grid { grid-template-columns: repeat(2, 1fr); }
  .agent-functions { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .home-projects-grid { grid-template-columns: repeat(2, 1fr); }
  .home-videos-grid { grid-template-columns: 1fr; }
  .agent-functions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .agent-bar-right {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

/* ================= 展示区视频悬停播放 ================= */
.showcase-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.showcase-video[data-loaded] { opacity: 1; }
.showcase-hover .showcase-video { opacity: 1; }
.showcase-art-hidden { opacity: 0 !important; transition: opacity 0.3s ease; }
/* ================= 油管同款：鼠标悬停放大 + 就地播放（2026-09-13） =================
   · 悬停时卡片放大约 8%（并抬高阴影、压住邻居卡片），视频就地播放
   · 底部一条进度条（跟着播放进度走），右下角显示时长
   · 网格允许溢出，否则放大的卡片会被裁掉 */
.home-videos-grid {
  overflow: visible;
}

.showcase-card {
  position: relative;
  z-index: 1;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.24s ease;
  will-change: transform;
}

.showcase-card:hover {
  z-index: 6;   /* 压住左右相邻卡片，放大时才好看 */
}

/* 注意：这里必须写成 .home-video-card.showcase-hover —— 上面 .home-video-card:hover 的
   特异性更高（类+伪类），只写 .showcase-hover 会被它覆盖掉，放大就不生效（2026-09-13 踩过）。 */
.home-video-card.showcase-hover {
  transform: translateY(-6px) scale(1.08);
  z-index: 6;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(232, 99, 43, 0.35);
}

/* 悬停时右下角露出时长 */
.showcase-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  font-size: 10.5px;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 4px;
  padding: 2px 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.showcase-hover .showcase-dur {
  opacity: 1;
}

/* 悬停播放进度条（YouTube 缩略图预览那种） */
.showcase-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.showcase-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent, #e8632b);
}

.showcase-hover .showcase-progress {
  opacity: 1;
}

.showcase-hover .vplay span {
  opacity: 0;
  transform: scale(0.8);
}

/* 弹窗视频样式 */
.pp-video {
  width: 100%;
  max-height: 60vh;
  border-radius: 8px;
  background: #000;
  display: block;
}

.pp-art:has(.pp-video) {
  background: #000 !important;
}

/* ============================================================
   📦 工程模板（P3 · 第 102 轮）：首页「工程模板」区 + 查看工程弹窗
   对标 namistory 首页作品的「查看工程 / 一键复刻」
   ============================================================ */
.home-tpl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.home-tpl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
  display: flex;
  flex-direction: column;
}

.home-tpl-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.home-tpl-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #141c22, #0b1116);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.home-tpl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-tpl-thumb .tpl-ph {
  font-size: 38px;
  opacity: 0.7;
}

.tpl-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(8, 12, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tpl-badge-v {
  left: auto;
  right: 8px;
  color: #fff;
  background: var(--accent, #e8632b);
  border-color: transparent;
}

.home-tpl-body {
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-tpl-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-tpl-meta {
  font-size: 11.5px;
  color: var(--text-faint);
}

.home-tpl-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.home-tpl-actions .chip {
  font-size: 11.5px;
  padding: 4px 9px;
}

/* 弹窗：不要那个 "▶" 播放角标（那是视频弹窗用的） */
.tpl-art::after {
  content: none !important;
}

.tpl-modal-box {
  max-width: 720px;
}

.tpl-art img,
.tpl-art video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tpl-art .tpl-ph {
  font-size: 52px;
  opacity: 0.7;
}

.tpl-node-list {
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.tpl-node-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.tpl-node-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tpl-node-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-node-tag {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.tpl-node-tag-v {
  color: var(--accent, #e8632b);
  border-color: rgba(232, 99, 43, 0.5);
}

.tpl-node-more {
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 6px 7px;
}

@media (max-width: 980px) {
  .home-tpl-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .home-tpl-grid { grid-template-columns: 1fr; }
}
