/**
 * visual-templates.css — 投标书视觉模板覆盖层
 *
 * 职责：
 *   - 为 .content-view-container 上挂载的 [data-template="<id>"] 提供整页配色覆盖。
 *   - 仅作用域到指定 data-template 选择器，未挂载模板时正文模式表现完全不变。
 *   - 与 visual-templates.js 中的 cssVars 字段对齐：JS 未来若需要按模板临时换色，可直接覆盖 CSS 变量。
 *
 * 扩展方式：
 *   - 新增模板时，复制下方 [data-template="blue-orange"] 块改 id 与配色即可。
 *   - 标题横条/表格首列等"模板独有的视觉装饰"集中写在这里，bid-generator.css 不动。
 */

/* ================== 蓝橙对照图表化 ================== */
.content-view-container[data-template="blue-orange"] {
  --vt-primary: #1A4FA0;
  --vt-primary-dark: #0E3577;
  --vt-accent: #F08A24;
  --vt-accent-soft: #FCE3C7;
  --vt-table-head-bg: #1A4FA0;
  --vt-table-head-fg: #FFFFFF;
  --vt-table-stripe: #EBF1FA;
  --vt-table-firstcol: #DDE7F4;
  --vt-table-border: #1A4FA0;
  --vt-h1-bar-bg: #1A4FA0;
  --vt-h1-bar-fg: #FFFFFF;
  --vt-h2-color: #0E3577;
  --vt-h3-color: #1A4FA0;
  --vt-body-color: #1F2937;
  color: var(--vt-body-color);
}

/* 章标题：蓝色横条 + 白字 */
.content-view-container[data-template="blue-orange"] .cv-h1 {
  background: var(--vt-h1-bar-bg);
  color: var(--vt-h1-bar-fg);
  border-left: 4px solid var(--vt-primary-dark);
  border-radius: 4px;
  padding: 10px 16px;
}

/* 节标题：深蓝色 + 蓝色下划线 */
.content-view-container[data-template="blue-orange"] .cv-h2 {
  color: var(--vt-h2-color);
  border-bottom: 1.5px solid var(--vt-primary);
}

/* 叶节点标题：蓝色 */
.content-view-container[data-template="blue-orange"] .cv-h3 {
  color: var(--vt-h3-color);
}

/* 表格：蓝色描边 + 蓝表头白字 */
.content-view-container[data-template="blue-orange"] .cv-content .cv-doc-table {
  box-shadow: 0 0 0 1px var(--vt-table-border), 0 12px 24px -28px rgba(24, 50, 74, 0.30);
}
.content-view-container[data-template="blue-orange"] .cv-content .cv-doc-table th,
.content-view-container[data-template="blue-orange"] .cv-content .cv-doc-table td {
  border: 1px solid rgba(26, 79, 160, 0.22);
}
.content-view-container[data-template="blue-orange"] .cv-content .cv-doc-table thead th {
  background: var(--vt-table-head-bg);
  color: var(--vt-table-head-fg);
  font-weight: 700;
}
.content-view-container[data-template="blue-orange"] .cv-content .cv-doc-table tbody tr:nth-child(even) td {
  background: var(--vt-table-stripe);
}
.content-view-container[data-template="blue-orange"] .cv-content .cv-doc-table tbody td:first-child {
  background: var(--vt-table-firstcol);
  font-weight: 600;
  color: var(--vt-primary-dark);
}
/* 偶数行的首列优先用 firstcol 色（避免被 stripe 覆盖） */
.content-view-container[data-template="blue-orange"] .cv-content .cv-doc-table tbody tr:nth-child(even) td:first-child {
  background: var(--vt-table-firstcol);
}

/* ================== 网格化大表(infocard) ==================
   适用范围:正文模式 .content-view-container 内的 .vt-card 嵌套表
   通用层走默认蓝;[data-template] 会通过 CSS 变量切换主题色
   PDF/Word 导出端有同等样式拷贝,见 js/infocard-print-css.js,改这里也要同步
*/
.cv-content .vt-card,
.vt-card {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 16px 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--vt-body-color, #1F2937);
  table-layout: fixed;
  border: 1px solid var(--vt-table-border, #1A4FA0);
}
.vt-card td,
.vt-card th {
  border: 1px solid var(--vt-table-border, #1A4FA0);
  padding: 8px 12px;
  vertical-align: top;
  word-wrap: break-word;
  background: #FFFFFF;
}
.vt-card .vt-card-cell-title {
  background: var(--vt-table-head-bg, #1A4FA0);
  color: var(--vt-table-head-fg, #FFFFFF);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.4px;
  padding: 10px 12px;
}
.vt-card .vt-card-row--header .vt-card-cell-header {
  background: var(--vt-table-head-bg, #1A4FA0);
  color: var(--vt-table-head-fg, #FFFFFF);
  font-weight: 700;
  text-align: center;
  padding: 8px 12px;
}
.vt-card .vt-card-cell-label {
  background: var(--vt-table-firstcol, #DDE7F4);
  color: var(--vt-h2-color, #0E3577);
  font-weight: 600;
  text-align: center;
  width: 28%;
  white-space: nowrap;
  padding: 8px 12px;
}
.vt-card .vt-card-cell-label--wide { width: 18%; }
.vt-card .vt-card-cell-value { padding: 8px 12px; }
.vt-card .vt-card-cell-split { padding: 0; vertical-align: top; }
.vt-card .vt-card-split-header {
  background: var(--vt-table-head-bg, #1A4FA0);
  color: var(--vt-table-head-fg, #FFFFFF);
  font-weight: 700;
  text-align: center;
  padding: 6px 10px;
  font-size: 14px;
}
.vt-card .vt-card-split-body {
  padding: 10px 12px;
  line-height: 1.7;
}
.vt-card .vt-card-split-body p { margin: 0 0 6px; }
.vt-card .vt-card-split-body p:last-child { margin-bottom: 0; }
.vt-card .vt-card-split-body ul,
.vt-card .vt-card-split-body ol {
  margin: 4px 0 6px;
  padding-left: 22px;
}
.vt-card .vt-card-split-image {
  padding: 8px;
  text-align: center;
}
.vt-card .vt-card-cell-note {
  padding: 8px 12px;
  line-height: 1.7;
}
.vt-card .vt-card-cell-note p { margin: 0 0 6px; }
.vt-card .vt-card-cell-note p:last-child { margin-bottom: 0; }
.vt-card .vt-card-cell-paragraphs {
  padding: 8px 12px;
  line-height: 1.75;
}
.vt-card .vt-card-cell-paragraphs .vt-card-paragraphs-item {
  margin: 0 0 8px;
  text-indent: 2em;
}
.vt-card .vt-card-cell-paragraphs .vt-card-paragraphs-item:last-child {
  margin-bottom: 0;
}
.vt-card .vt-card-cell-grid { padding: 6px 6px 0; }
.vt-card .vt-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
  justify-content: flex-start;
}
.vt-card .vt-card-grid-cell {
  flex: 0 0 auto;
  padding: 4px 4px 6px;
  text-align: center;
  box-sizing: border-box;
}
.vt-card .vt-card-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  border-radius: 2px;
}
.vt-card .vt-card-img--split { max-height: 280px; }
.vt-card .vt-card-img--grid { max-height: 110px; }
.vt-card .vt-card-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  color: #6B7280;
  font-size: 12px;
  text-align: center;
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px dashed #CBD5E1;
}
.vt-card .vt-card-img-caption {
  margin-top: 4px;
  font-size: 12px;
  color: #6B7280;
  line-height: 1.4;
}
.vt-card .vt-card-cell-subtable { padding: 0; }
.vt-card .vt-card-subtable {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 13px;
}
.vt-card .vt-card-subtable th,
.vt-card .vt-card-subtable td {
  border: 1px solid var(--vt-table-border, #1A4FA0);
  padding: 6px 10px;
  vertical-align: top;
}
.vt-card .vt-card-subtable thead th {
  background: var(--vt-table-head-bg, #1A4FA0);
  color: var(--vt-table-head-fg, #FFFFFF);
  font-weight: 700;
  text-align: center;
}
.vt-card .vt-card-subtable tbody td:first-child {
  background: var(--vt-table-firstcol, #DDE7F4);
  font-weight: 600;
  color: var(--vt-h2-color, #0E3577);
  text-align: center;
}
.vt-card .vt-card-subtable tbody tr:nth-child(even) td {
  background: var(--vt-table-stripe, #EBF1FA);
}
.vt-card .vt-card-subtable tbody tr:nth-child(even) td:first-child {
  background: var(--vt-table-firstcol, #DDE7F4);
}

/* diagram row:流程图 / 组织架构图 单元格 */
.vt-card .vt-card-cell-diagram {
  padding: 12px 8px;
  text-align: center;
  background: #FFFFFF;
  vertical-align: middle;
}
.vt-card .vt-card-diagram-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  color: #6B7280;
  font-size: 13px;
  font-style: italic;
}
.vt-card .vt-card-diagram-slot--ready {
  font-style: normal;
  color: inherit;
  min-height: 0;
}
.vt-card .vt-card-diagram-slot--ready svg {
  max-width: 100%;
  height: auto;
}
.vt-card .vt-card-diagram-caption {
  margin-top: 4px;
  font-size: 12px;
  color: #4B5563;
  text-align: center;
  font-family: SimSun, serif;
}

/* 极简黑白模板下网格化大表降级:无填充背景、双横线分隔 */
.content-view-container[data-template="plain-bw"] .vt-card,
.content-view-container[data-template="plain-bw"] .vt-card td,
.content-view-container[data-template="plain-bw"] .vt-card th {
  border-color: #111111;
}
.content-view-container[data-template="plain-bw"] .vt-card .vt-card-cell-title,
.content-view-container[data-template="plain-bw"] .vt-card .vt-card-row--header .vt-card-cell-header,
.content-view-container[data-template="plain-bw"] .vt-card .vt-card-split-header,
.content-view-container[data-template="plain-bw"] .vt-card .vt-card-subtable thead th {
  background: #FFFFFF;
  color: #111111;
  border-bottom: 2px solid #111111;
}
.content-view-container[data-template="plain-bw"] .vt-card .vt-card-cell-label,
.content-view-container[data-template="plain-bw"] .vt-card .vt-card-subtable tbody td:first-child {
  background: #FFFFFF;
  color: #111111;
}
.content-view-container[data-template="plain-bw"] .vt-card .vt-card-subtable tbody tr:nth-child(even) td {
  background: #FFFFFF;
}

/* ============================================
   "视觉模板"卡片样式（步骤 3 选择区）
   ============================================ */
.vtpl-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 132px;
  min-height: 132px;
  padding: 8px 8px 10px;
  border: 1px solid var(--color-border, #d6dae1);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.vtpl-card:hover {
  transform: translateY(-1px);
  border-color: rgba(26, 79, 160, 0.5);
  box-shadow: 0 6px 14px -10px rgba(15, 23, 42, 0.20);
}
.vtpl-card.active {
  border-color: #1A4FA0;
  box-shadow: 0 0 0 2px rgba(26, 79, 160, 0.18);
}
.vtpl-card-thumb {
  width: 100%;
  height: 78px;
  border-radius: 4px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vtpl-card-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}
.vtpl-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary, #1a1a1a);
  text-align: left;
  line-height: 1.3;
}
.vtpl-card-desc {
  font-size: 11px;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.4;
}
