/* ============================================================
   products-table.css
   产品中心：Excel 表头筛选 + 规格表格
============================================================ */

/* SVG 图标通用 */
.svg-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }
.ft-trigger .svg-icon,
.filter-arrow .svg-icon { width: 10px; height: 10px; }

/* ---- 页面整体布局 ---- */
.products-page-section {
  padding: 140px 0 60px; /* 140px = 顶部固定导航栏高度，避免遮挡 */
  background: #f7f9fc;
  min-height: 60vh;
}

.pt-layout-no-sidebar {
  max-width: 100%;
}

/* 扩展容器宽度，表格占屏幕90% */
.products-page-section .container {
  max-width: 92vw;
  padding: 0 20px;
}

/* ============================================================
   顶部工具栏
============================================================ */
.pt-main-full {
  min-width: 0;
}

.pt-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* 顶部搜索框 */
.pt-top-search {
  display: flex;
  flex: 0 0 320px;
}
.pt-top-search-input {
  flex: 1;
  border: 1.5px solid #d1d9e6;
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 8px 14px;
  font-size: 14px;
  color: #2d3748;
  outline: none;
  background: #fafbfc;
  transition: border-color 0.2s, background 0.2s;
}
.pt-top-search-input:focus {
  border-color: #0055b3;
  background: #fff;
}
.pt-top-search-btn {
  padding: 0 18px;
  background: #0055b3;
  color: #fff;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.pt-top-search-btn:hover { background: #0044a0; }

/* 结果统计 */
.pt-result-count {
  font-size: 14px;
  color: #6b7280;
  white-space: nowrap;
}
.pt-result-count strong {
  color: #0055b3;
  font-size: 16px;
}

/* 已选标签 */
.pt-active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.pt-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: #eef3fb;
  color: #0055b3;
  border: 1px solid rgba(0,85,179,0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.pt-active-tag:hover {
  background: #fef2f2;
  color: #e05454;
  border-color: rgba(224,84,84,0.25);
}

/* ============================================================
   列表头筛选下拉（第二行的筛选触发器 + 弹出下拉）
============================================================ */
.thead-filter-row th { position: relative; }
.th-filter { position: relative; display: inline-block; width: 100%; }
.th-filter-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px; border-radius: 4px; cursor: pointer;
  font-size: 9px; color: #6b7280; background: #f3f4f6;
  min-height: 18px; transition: all 0.15s;
}
.th-filter-label:hover { background: #e5e7eb; }
.th-filter-label.has-filter {
  background: #1d4ed8; color: #fff; font-weight: 600;
  padding: 2px 8px; font-size: 10px;
}
.th-filter-label .ft-trigger { font-size: 10px; }
.th-filter-label .filter-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-filter-dropdown {
  display: none; position: absolute; top: 100%; left: 0; z-index: 999;
  min-width: 100px; max-width: 220px; max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid #d1d5db; border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 4px 0; margin-top: 2px;
}
.th-filter-dropdown.wide { min-width: 320px; }
.th-filter-dropdown.show { display: block; }
.th-filter-dropdown a.filter-option {
  display: block; padding: 6px 12px; color: #374151; text-decoration: none;
  font-size: 12px; transition: background 0.1s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.th-filter-dropdown a.filter-option:hover { background: #f3f4f6; color: #0055b3; }
.th-filter-dropdown a.filter-option.selected { background: #eff6ff; color: #0055b3; font-weight: 600; }
.th-filter-dropdown .dim-filters { display: flex; gap: 0; }
.th-filter-dropdown .dim-col { flex: 1; padding: 0 8px; }
.th-filter-dropdown .dim-col label { font-size: 11px; color: #6b7280; padding: 4px 4px; }

.pt-active-tag span { opacity: 0.6; font-size: 14px; line-height: 1; }
.pt-clear-all {
  font-size: 12px;
  color: #e05454;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(224,84,84,0.3);
  transition: all 0.15s;
}
.pt-clear-all:hover { background: #fef2f2; }

/* ============================================================
   产品规格表格
============================================================ */
.pt-table-wrap {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  overflow-x: auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  scrollbar-width: none;           /* Firefox */
}
.pt-table-wrap::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

/* 桌面端：表格容器隐藏滚动条 */
.table-header-wrap,
.products-table-body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.table-header-wrap::-webkit-scrollbar,
.products-table-body::-webkit-scrollbar {
  display: none;
}

.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1500px;
}

/* 表头 */
.pt-table thead tr {
  background: linear-gradient(135deg, #1a3c6e 0%, #0055b3 50%, #0070d2 100%);
}
.pt-table thead th {
  border-right: 2px solid rgba(255,255,255,0.25);
  /* ⚠️ 修复(2026-08-11)：允许表头换行，避免英文长标题（Output Impedance 等）
     溢出与相邻列重叠。中文短标题不受影响（宽度足够仍一行）。 */
  white-space: normal;
}
.pt-table thead th:last-child { border-right: none; }

/* 表头第一行：列名 */
.header-row th {
  padding: 8px 10px 4px;
  vertical-align: bottom;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.3px;
}

/* 表头第二行：筛选触发器（矮行） */
.thead-filter-row th {
  padding: 0 8px;
  vertical-align: middle;
  font-size: 10px;
  color: rgba(255,255,255,0.8);
  height: 20px;
  line-height: 20px;
}

/* 筛选触发器小按钮（无筛选时） */
.ft-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 15px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 2px;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  font-size: 9px;
  line-height: 1;
  transition: all 0.2s;
  user-select: none;
}
.ft-trigger:hover {
  border-color: rgba(255,255,255,0.7);
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.12);
}

/* 筛选行左侧提示文字 */
.thead-filter-row .filter-row-hint {
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
  white-space: nowrap;
  line-height: 20px;
}

/* 表头标题（兼容旧结构） */
.pt-th-head {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

/* 表头筛选区（兼容旧结构） */
.pt-th-filter {
  margin-top: 2px;
}
.pt-th-filter form {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.pt-th-filter select {
  width: 100%;
  padding: 5px 8px;
  border-radius: 4px;
  border: none;
  font-size: 11px;
  color: #2d3748;
  background: rgba(255,255,255,0.95);
  cursor: pointer;
  outline: none;
  transition: background 0.2s;
}
.pt-th-filter select:hover {
  background: #fff;
}
.pt-th-filter select:focus {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

/* 表头筛选组（直径+高度） */
.pt-th-filter-group {
  display: flex;
  gap: 4px;
}
.pt-th-filter-group select {
  flex: 1;
  min-width: 50px;
}


/* 数据行 */
.pt-row {
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 2px solid #c8d0dc;
}
.pt-row:last-child { border-bottom: none; }
.pt-row:hover { background: #f0f6ff; }
.pt-row:hover .pt-model-name { color: #1a3c6e; }

.pt-table td {
  /* ★ 行高控制：修改此值可调整表格行上下间距（推荐 1-6px） */
  padding: 1px 10px;
  color: #374151;
  vertical-align: middle;
  border-right: 2px solid #d0d8e4;
  /* 防止换行，确保单行显示 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pt-table td:last-child { border-right: none; }

/* 列宽控制（所有列固定宽度，确保不换行） */
.col-img        { width: 48px;  flex-shrink: 0; }
.col-model      { width: 140px; max-width: 140px; font-weight: 700; color: #1a3c6e; font-family: 'Roboto Mono', 'Courier New', monospace; font-size: 12px; }
.col-install    { width: 80px;  max-width: 80px; }
.col-contacts   { width: 70px;  max-width: 70px; }
.col-dim        { width: 90px;  max-width: 90px; }
.col-pin        { width: 55px;  max-width: 55px; }
.col-test-cond  { width: 95px;  max-width: 95px; }
.col-sens       { width: 80px;  max-width: 80px; }
.col-snr        { width: 75px;  max-width: 75px; }
.col-impedance  { width: 105px;  max-width: 105px; }  /* 修复(2026-08-11)：75→105px，容纳"输出阻抗（kΩ）"中文表头一行显示 */
.col-thd        { width: 70px;  max-width: 70px; }
.col-aop        { width: 65px;  max-width: 65px; }
.col-freq       { width: 105px; max-width: 105px; }
.col-cat        { width: 100px; max-width: 100px; }
.col-rated-power { width: 80px; max-width: 80px; }
.col-max-power  { width: 80px;  max-width: 80px; }
.col-f0         { width: 80px;  max-width: 80px; }
.col-action     { width: 60px;  text-align: center; max-width: 60px; }

/* 产品缩略图 */
.pt-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e8edf3;
  background: #f8fafc;
  display: block;
  transition: transform 0.25s ease;
  cursor: pointer;
}
/* 悬停放大：只放大图片本身，不响应整行悬停 */
.pt-thumb:hover {
  transform: scale(2.8);
  z-index: 100;
  position: relative;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  border-radius: 4px;
}
.pt-thumb-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f0f3f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0c9d3;
  font-size: 16px;
}

/* 型号名称（纯文本，非链接） */
.pt-model-name {
  font-weight: 700;
  color: #1a3c6e;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 12px;
  display: block;
  white-space: nowrap;
}

/* 安装型式 badge */
.pt-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #eef3fb;
  color: #0055b3;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* 防水 badge */
.pt-wp-badge {
  display: inline-block;
  padding: 2px 7px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* 查看按钮 */
.pt-detail-btn {
  display: inline-block;
  padding: 5px 14px;
  background: #0055b3;
  color: #fff;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.pt-detail-btn:hover { background: #0044a0; }

/* 空结果 */
.pt-empty {
  text-align: center;
  padding: 80px 20px;
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 10px;
}
.pt-empty-icon { font-size: 48px; margin-bottom: 16px; }
.pt-empty p { color: #6b7280; font-size: 15px; }

/* ============================================================
   分页
============================================================ */
.pt-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.pt-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d1d9e6;
  border-radius: 7px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  background: #fff;
  transition: all 0.15s;
  white-space: nowrap;
}
.pt-page-btn:hover {
  border-color: #0055b3;
  color: #0055b3;
  background: #eef3fb;
}
.pt-page-btn.active {
  background: #0055b3;
  color: #fff;
  border-color: #0055b3;
  font-weight: 700;
}
.pt-page-ellipsis {
  color: #9ca3af;
  font-size: 14px;
  padding: 0 4px;
}

/* ============================================================
   响应式
============================================================ */
@media (max-width: 1200px) {
  .pt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .pt-top-search {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .pt-active-tags {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .pt-table { font-size: 12px; min-width: 1300px; }
  .pt-table thead th,
  .pt-table td { padding: 6px 8px; }
  .pt-th-filter select { font-size: 10px; padding: 4px 6px; }
}

@media (max-width: 480px) {
  .products-page-section { padding: 32px 0 60px; }
}
