/* ==================== TJJC 前台动态化 SPA 样式 (app.js 渲染的页面) ==================== */
/* 依赖 style.css 的主题变量(--bg-0/--bg-2/--line/--red/--text 等)。 */

/* ---------- 容器显隐(hidden 属性已生效,这里兜底) ---------- */
#siteMain[hidden], #page[hidden] { display: none; }

/* ---------- 通用动态页 ---------- */
.dyn-page { min-height: 75vh; padding-bottom: 40px; }
.grid-loading { padding: 40px; text-align: center; color: var(--text-dim); font-size: 14px; letter-spacing: .04em; }

/* ---------- 面包屑 ---------- */
.dyn-breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .06em; color: var(--text-dim);
  padding: 26px 0 4px;
}
.dyn-breadcrumb a { color: var(--text-dim); transition: color .2s; }
.dyn-breadcrumb a:hover { color: var(--red-2); }
.dyn-breadcrumb .sep { opacity: .5; }
.dyn-breadcrumb .current { color: var(--text-soft); }

/* ---------- 列表/详情页 hero(深色条幅) ---------- */
.res-hero, .cat-hero {
  position: relative; margin-top: 18px;
  padding: 64px 0 56px;
  background: linear-gradient(180deg, rgba(21,32,56,.27), rgba(21,32,56,.22)),
              url('/images/cat-iot.jpg') center/cover no-repeat;
  border-radius: 14px; overflow: hidden;
}
.products-hero {
  background: linear-gradient(180deg, rgba(21,32,56,.125), rgba(21,32,56,.11)),
              url('/images/all%20products.jpg') center/cover no-repeat;
}
.resources-hero {
  background: linear-gradient(180deg, rgba(21,32,56,.27), rgba(21,32,56,.22)),
              url('/images/resources.jpg') center/cover no-repeat;
}
.news-hero {
  background: linear-gradient(180deg, rgba(21,32,56,.27), rgba(21,32,56,.22)),
              url('/images/article.png') center/cover no-repeat;
}
.res-hero h1, .cat-hero h1 {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 40px;
  color: #fff; margin: 0 0 12px; letter-spacing: .02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.res-hero h1 span, .cat-hero h1 span { color: var(--red-2); }
.res-hero p, .cat-hero p { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.cat-lead { color: var(--text-dim); font-size: 16px; line-height: 1.75; max-width: 760px; margin: 0; }

/* ---------- 区块 ---------- */
.pd-block { padding: 56px 0 8px; }
.pd-sec-title {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 26px;
  color: #fff; margin: 0 0 22px; letter-spacing: .02em;
}
.pd-sec-title::after {
  content: ''; display: block; width: 46px; height: 3px;
  background: var(--red); margin-top: 12px;
}

/* ---------- 产品详情整页 ---------- */
.pd-hero {
  padding: 44px 0 20px;
  border-bottom: 1px solid var(--line);
}
.pd-hero-grid { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 48px; align-items: start; }
.pd-gallery { position: relative; }
.pd-gallery img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2);
}
.pd-flag { position: absolute; top: 14px; left: 14px; padding: 5px 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; border-radius: 4px; }
.pd-info .p-code { color: var(--red-2); font-size: 13px; letter-spacing: .14em; font-weight: 600; }
.pd-info h1 { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 36px; color: #fff; margin: 8px 0 12px; line-height: 1.15; }
.pd-excerpt { color: var(--text-soft); font-size: 15.5px; line-height: 1.7; margin: 0 0 18px; }
.pd-price-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pd-price strong { font-size: 30px; color: var(--red-2); font-weight: 700; }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
/* 报价单:详情页 数量步进 + 加入报价单 */
.pd-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-qty { display: inline-flex; align-items: center; gap: 4px; }
.pd-actions .btn-lg { white-space: nowrap; }
.pd-quick-specs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; }
.pd-quick-specs li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.pd-quick-specs li span { color: var(--text-dim); }
.pd-quick-specs li strong { color: var(--text); font-weight: 600; text-align: right; }

/* 描述/应用 */
.pd-desc { color: var(--text-soft); font-size: 15px; line-height: 1.85; }
.pd-desc h3 { color: #fff; font-size: 19px; margin: 24px 0 12px; }
.pd-desc .feature-list { margin: 0 0 20px; padding-left: 20px; }
.pd-desc .feature-list li { margin-bottom: 8px; }
.apps-pre {
  white-space: pre-line; font-family: inherit; font-size: 14.5px; line-height: 1.9;
  color: var(--text-soft); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 20px 24px; margin: 0;
}

/* 规格表 */
.spec-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--bg-2); }
.spec-table td { padding: 11px 18px; border-bottom: 1px solid var(--line); color: var(--text); }
.spec-table td:first-child { color: var(--text-dim); font-weight: 500; width: 34%; background: rgba(255,255,255,0.02); }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table tr:hover td { background: rgba(201,48,44,0.06); }

/* 底部 CTA */
.pd-cta { margin-top: 48px; padding: 46px 0; border-top: 1px solid var(--line); }
.pd-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.pd-cta-inner h3 { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 500; color: #fff; margin: 0 0 6px; }
.pd-cta-inner p { color: var(--text-dim); margin: 0; }

/* ---------- 分类详情 ---------- */
.cat-badge {
  display: inline-block; padding: 5px 14px; border: 1px solid rgba(201,48,44,.5);
  color: var(--red-2); font-size: 12px; font-weight: 700; letter-spacing: .14em;
  border-radius: 999px; margin-bottom: 16px; text-transform: uppercase;
}
.cat-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
.cat-app {
  display: flex; align-items: flex-start; gap: 14px; padding: 18px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  transition: all .25s;
}
.cat-app:hover { border-color: rgba(201,48,44,.4); transform: translateY(-2px); }
.cat-app-icn { font-size: 26px; line-height: 1; }
.cat-app strong { display: block; color: #fff; font-size: 15px; margin-bottom: 4px; }
.cat-app span { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.cat-features { list-style: none; margin: 0 0 34px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 26px; }
.cat-features li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-soft); font-size: 14.5px; line-height: 1.6; }
.cat-features .fi-check { color: #22c55e; font-weight: 700; flex-shrink: 0; }
.cat-products { margin-top: 10px; }
.cat-products .product-grid { padding: 0; }

/* ---------- 产品列表筛选条 ---------- */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 34px; }
.filter-select, .filter-search {
  padding: 11px 14px; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; border-radius: 6px; font-family: inherit;
}
.filter-select { min-width: 220px; }
.filter-search { min-width: 240px; flex: 1; max-width: 340px; }
.filter-select:focus, .filter-search:focus { outline: none; border-color: var(--red); }
.btn-sm { padding: 10px 18px; font-size: 13px; }

/* ---------- 文章卡片 / 新闻 ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article-card {
  display: block; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none;
  transition: all .25s;
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,.4); border-color: rgba(201,48,44,.4); }
.article-thumb { height: 180px; overflow: hidden; position: relative; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; display: block; }
.article-card:hover .article-thumb img { transform: scale(1.05); }
.article-body { padding: 20px 22px 24px; }
.article-date { font-size: 12px; color: var(--text-dim); letter-spacing: .04em; }
.article-body h3 { font-size: 16.5px; color: #fff; margin: 8px 0 10px; line-height: 1.4; min-height: 46px; }
.article-body p { font-size: 13.5px; color: var(--text-dim); line-height: 1.7; margin: 0 0 12px; }
.article-body .cat-link { color: var(--red-2); font-size: 13px; font-weight: 600; }

/* 新闻详情 */
.news-detail .narrow { max-width: 820px; }
.nd-title { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 32px; color: #fff; line-height: 1.25; margin: 18px 0 10px; }
.nd-meta { color: var(--text-dim); font-size: 13px; letter-spacing: .04em; margin-bottom: 24px; }
.news-cover { width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 26px; }
.nd-content { color: var(--text-soft); font-size: 15px; line-height: 1.9; }
.nd-content p { margin: 0 0 16px; }
.nd-back { margin-top: 34px; }

/* ---------- 文件列表 ---------- */
.files-list { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.file-item {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  transition: all .25s;
}
.file-item:hover { border-color: rgba(201,48,44,.4); }
.file-icon { font-size: 26px; }
.file-body { flex: 1; min-width: 0; }
.file-body strong { display: block; color: #fff; font-size: 15px; margin-bottom: 4px; }
.file-meta { color: var(--text-dim); font-size: 12.5px; }
.dim-note { color: var(--text-dim); }
.res-all { margin-top: 22px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.pg-num {
  min-width: 36px; height: 36px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-soft);
  font-size: 13.5px; border-radius: 6px; text-decoration: none; transition: all .2s;
}
.pg-num:hover { border-color: var(--red); color: var(--red-2); }
.pg-num.active { background: var(--red); border-color: var(--red); color: #fff; }
.pg-num.disabled { opacity: .35; pointer-events: none; }
.pg-ellipsis { color: var(--text-dim); padding: 0 4px; }
.pg-total { margin-left: 8px; color: var(--text-dim); font-size: 13px; }

/* ---------- 空态 / 错误 ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.es-icon { font-size: 46px; margin-bottom: 14px; }
.es-404 { font-family: 'Oswald', sans-serif; font-size: 72px; color: var(--red-2); line-height: 1; }
.empty-state h3 { color: #fff; font-size: 20px; margin: 0 0 8px; }
.empty-state p { margin: 0 0 18px; }
.error-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; border: 1px solid rgba(201,48,44,.45); background: rgba(201,48,44,.08);
  border-radius: 8px; color: var(--text-soft); font-size: 14px; margin-top: 24px;
}

/* ---------- 内容页(DB 驱动的静态页内容) ---------- */
.content-inner { padding-bottom: 60px; }
.dyn-content-head { padding-bottom: 0; }
.content-body { min-height: 50vh; }
.content-body h2, .content-body h3 { color: #fff; }
.content-body a { color: var(--red-2); }
.content-body .page-hero { margin-top: 6px; border-radius: 0 0 14px 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .pd-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .cat-apps { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-features { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .res-hero h1, .cat-hero h1 { font-size: 30px; }
  .pd-info h1 { font-size: 28px; }
  .pd-quick-specs { grid-template-columns: 1fr; }
  .cat-apps { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .filter-select, .filter-search { min-width: 100%; width: 100%; }
}
