/* 引入各模板「组件级」样式统一收口文件（templates.css）。
   common.css 已通过 nuxt.config 的 <link> 全局加载，故 @import 进来的
   templates.css 同样全局生效，无需改动 nuxt.config、无需重建 web。改 templates.css 刷新即生效。 */
@import url('/api/static/templates.css');

/* ============================================================
 * 前端模板公共样式（apps/server/templates/*.html 共用）
 * 分类页 / 列表页模板的内嵌 <style> 只保留该页特有部分，
 * 通用组件（bar / hero / card-lift / logo-box / empty / pager）统一收在此处。
 * 注意：本文件由 server 经 /api/static/common.css 提供（与 templates/*.html
 *       同目录的 assets/ 下）；前台 layouts/default.vue 用 useHead 注入 <link> 全局生效。
 *       改此文件无需重建 web/server，刷新浏览器即生效；模板 v-html 注入的 DOM 同样命中这些类。
 * ============================================================ */

/* ---- 顶部绿色统计/标题条 ---- */
.tpl-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  background: #05a654;
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 14px;
}
.tpl-bar h1,
.tpl-bar b { color: #fff; }
.tpl-bar h1 { font-size: 26px; margin: 0; font-weight: 700; }
.tpl-bar b { font-weight: 700; }
.tpl-bar a { color: #fff; text-decoration: none; }
.tpl-bar a:hover { color: #d8f5e6; }

/* ---- 分类页标题区（居中 hero，与 main.css 的 .tpl-hero 渐变横幅区分） ---- */
.tpl-cat-hero { text-align: center; margin: 14px 0 22px; padding-bottom: 14px; border-bottom: 1px solid #e6ebe7; }
.tpl-cat-hero h1 { font-size: 26px; margin: 0 0 8px; color: #0e382a; }
.tpl-cat-hero p { color: #7a8580; margin: 0; font-size: 14px; max-width: 880px; margin: 0 auto; line-height: 1.7; }

/* ---- 卡片 hover 抬升（各卡片微差阴影，统一此值） ---- */
.tpl-card-lift:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(5, 166, 84, .12); }

/* ---- 120px 正方形 logo/封面容器（内联 img 保持比例不裁剪） ---- */
.tpl-logo-box {
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.tpl-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* ---- 空状态 ---- */
.tpl-empty { text-align: center; color: #7a8580; padding: 60px 0; font-size: 14px; }

/* ---- 分页器（页面模板 {{> 分页}} 或内嵌结构共用） ---- */
.tpl-pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 18px 0 8px; flex-wrap: wrap; color: #5e6963; font-size: 14px; }
.tpl-pager .pg-info { margin-left: 8px; color: #7a8580; font-size: 12.5px; }
.tpl-pager a,
.tpl-pager span { display: inline-block; min-width: 34px; padding: 6px 12px; border-radius: 8px; border: 1px solid #e6ebe7; background: #fff; color: #0e382a; text-decoration: none; transition: background .18s, border-color .18s; text-align: center; }
.tpl-pager a:hover { background: #f3f6f4; border-color: #cbd4cf; color: #0e382a; }
.tpl-pager .pg-current { background: #05a654; border-color: #05a654; color: #fff; font-weight: 600; cursor: default; }
.tpl-pager .pg-disabled { opacity: .45; cursor: not-allowed; color: #aab3ad; background: #f6f8f7; }

/* ---- 全宽 banner 图（page-* / category-* 模板通用） ----
   布局层 <main class="container"> 已是 100% 宽，banner 直接挂在容器下（default.vue 顶部渲染），
   width:100% 即铺满视口，无需任何 CSS 破出技巧。
   高度上限 max-height:300px 防超高图撑版；圆角归零（全宽 banner 不需要）。 */
.tpl-banner {
  display: block;
  width: 100%;
  margin-bottom: 18px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 0;
}

/* ---- 幻灯片轮播（模板 {{> slideshow slideshows.key}} 渲染） ---- */
.tpl-slideshow-wrap { margin-top: 20px; margin-bottom: 22px; }
.tpl-slideshow {
  position: relative; overflow: hidden; border-radius: 12px;
  background: #eef2f0; width: 100%;
}
/* 固定宽度时居中 */
.tpl-slideshow--fixed { margin-left: auto; margin-right: auto; }
.tpl-slideshow__track {
  display: flex; transition: transform .5s cubic-bezier(.25,.46,.45,.94);
  will-change: transform; height: 100%;
}
.tpl-slideshow .tpl-slide {
  flex: 0 0 100%; position: relative; display: block;
  overflow: hidden; background: #eef2f0; aspect-ratio: 21 / 9;
}
/* 指定固定高度时，slide 填满容器高度（覆盖 aspect-ratio） */
.tpl-slideshow[data-height] .tpl-slide { aspect-ratio: auto; height: 100%; }
.tpl-slideshow .tpl-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-slideshow .tpl-slide-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 16px 12px;
  color: #fff; font-weight: 600; font-size: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
}

/* 箭头 */
.tpl-slideshow__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.85); color: #0e382a;
  font-size: 18px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; opacity: 0; transition: opacity .25s, background .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.tpl-slideshow:hover .tpl-slideshow__arrow { opacity: 1; }
.tpl-slideshow__arrow:hover { background: #fff; }
.tpl-slideshow__arrow--prev { left: 10px; }
.tpl-slideshow__arrow--next { right: 10px; }

/* 指示点 */
.tpl-slideshow__dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; gap: 7px;
}
.tpl-slideshow__dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid #fff; background: transparent;
  cursor: pointer; transition: background .25s, transform .2s; padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tpl-slideshow__dot.active { background: #fff; transform: scale(1.2); }

/* ============================================================
 * 开放资源家族分类页共享样式（.od-*）
 * 供 category-list / category-openResources / category-openData-List 共用，
 * 列表体结构统一收口到模板 od-resource-body.html（partial），此处只放样式。
 * 原三套模板各自的 <style> 内联块已迁至此，避免重复维护。
 * ============================================================ */

/* ---- 面包屑：首页 >> 父分类 >> 当前分类 ---- */
.od-crumb {
  display: flex; align-items: center; flex-wrap: wrap;
  font-size: 13px; line-height: 1.6; color: #7a8580;
  margin-bottom: 16px; padding: 8px 12px;
  background: #f8faf9; border: 1px solid #e6ebe7; border-radius: 8px;
}
.od-crumb a { color: #1a4fa0; text-decoration: none; transition: color .15s; }
.od-crumb a:hover { color: #05a654; text-decoration: underline; }
.od-crumb .od-sep { margin: 0 6px; color: #b6bfba; }
.od-crumb .od-cur { color: #0e382a; font-weight: 600; }

/* ---- 描述区 ---- */
.od-desc {
  background: #f8faf9;
  border-radius: 0 0 12px 12px;
  padding: 20px 24px 22px;
  margin-bottom: 22px;
  font-size: 13.5px; line-height: 1.85;
  color: #3d4a46;
}
.od-desc p { margin: 0 0 8px; }
.od-desc p:last-child { margin-bottom: 0; }
.od-desc b { color: #0e382a; }

/* ---- 搜索栏 ---- */
.od-search-wrap {
  display: flex; justify-content: center;
  margin-top: 20px;
  margin-bottom: 26px;
}
.od-search-form {
  display: flex; gap: 0;
  width: 100%; max-width: 520px;
}
.od-search-input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #05a654;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 14px; outline: none;
  background: #fff; color: #333;
  min-width: 0;
}
.od-search-input::placeholder { color: #aaa; }
.od-search-btn {
  padding: 10px 24px;
  background: #05a654; color: #fff;
  border: 2px solid #05a654;
  border-radius: 0 8px 8px 0;
  font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .18s;
}
.od-search-btn:hover { background: #048a47; }

/* ---- 主体左右布局 ---- */
.od-body {
  display: flex; gap: 20px; align-items: flex-start;
}

/* ---- 左侧子分类导航 ---- */
.od-sidebar { flex: 0 0 170px; min-width: 170px; }
.od-nav-btn {
  display: block; width: 100%;
  padding: 10px 14px; margin-bottom: 6px;
  background: #05a654; color: #fff;
  border: none; border-radius: 6px;
  font-size: 13.5px; font-weight: 600;
  text-align: center; text-decoration: none;
  transition: background .18s, transform .12s;
  cursor: pointer;
}
.od-nav-btn:hover { background: #048a47; transform: translateX(3px); }

/* ---- 右侧卡片网格 ---- */
.od-main { flex: 1; min-width: 0; }
.od-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px; padding: 4px 0 18px;
}
@media (max-width: 860px) { .od-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .od-body { flex-direction: column; } .od-sidebar { flex: none; display: flex; flex-wrap: wrap; gap: 6px; } .od-nav-btn { flex: 0 0 auto; width: auto; padding: 8px 16px; font-size: 14px; } }

.od-card {
  background: #fff; border-radius: 14px;
  overflow: hidden; border: 1px solid #e6ebe7;
  display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.od-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(5,166,84,.14); }

.od-cover {
  background: #f3f6f4; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.od-cover img {
  width: 100%; height: 200px; object-fit: contain;
  display: block; background: #f8faf9;
  transition: transform .3s;
}
.od-card:hover .od-cover img { transform: scale(1.03); }
.od-cover-empty {
  width: 100%; height: 200px;
  display: flex; align-items: center; justify-content: center;
  color: #aab3ad; font-size: 14px;
}

.od-body-inner { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.od-title {
  font-size: 15.5px; line-height: 1.5; margin: 0 0 10px;
  color: #0e382a; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.od-title a { color: inherit; text-decoration: none; }
.od-title a:hover { color: #05a654; }

.od-stats {
  display: flex; align-items: center; gap: 16px;
  font-size: 12.5px; color: #7a8580; margin-top: auto;
  padding-top: 10px;
}
.od-stat { display: inline-flex; align-items: center; gap: 4px; }
.od-stat svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .6; }
.od-stat b { color: #0e382a; font-weight: 600; }

.od-foot {
  display: flex; align-items: center; justify-content: center;
  margin-top: 14px;
}
.od-detail-btn {
  display: inline-block; padding: 7px 28px;
  background: #05a654; color: #fff;
  font-size: 14px; font-weight: 600;
  border-radius: 999px; text-decoration: none;
  transition: background .18s;
}
.od-detail-btn:hover { background: #048a47; color: #fff; }
