/* ===== 产品列表页 · 复刻 DEMO（作用域 #business-types-page）===== */

/* 顶部标题区 */
#business-types-page .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  animation: fadeInDown 0.6s var(--ease);
}

#business-types-page .header-left .greeting {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

#business-types-page .header-left h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

#business-types-page .header-left .subtitle {
  font-size: 14px;
  color: var(--text-sub);
}

#business-types-page .header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

#business-types-page .header-right .date {
  font-size: 14px;
  color: var(--text-sub);
}

/* 通用按钮 */
#business-types-page .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

#business-types-page .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

#business-types-page .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 122, 82, 0.4);
}

#business-types-page .btn-primary:active { transform: translateY(0); }

#business-types-page .btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 双栏布局 */
#business-types-page .split-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

/* 左侧：业务类型栏 */
#business-types-page .type-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px 16px;
}

#business-types-page .type-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}

#business-types-page .type-panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-title);
}

#business-types-page .type-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

#business-types-page .type-search {
  position: relative;
  margin-bottom: 12px;
}

#business-types-page .type-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-placeholder);
}

#business-types-page .type-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-body);
  background: #fff;
  transition: all 0.2s var(--ease);
  outline: none;
}

#business-types-page .type-search input:hover { border-color: var(--primary); }
#business-types-page .type-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 122, 82, 0.1);
}
#business-types-page .type-search input::placeholder { color: var(--text-placeholder); }

#business-types-page .type-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

#business-types-page .type-list::-webkit-scrollbar { width: 4px; }
#business-types-page .type-list::-webkit-scrollbar-thumb { background: rgba(45,122,82,0.2); border-radius: 2px; }

#business-types-page .type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
}

#business-types-page .type-item:hover { background: var(--primary-lighter); }

#business-types-page .type-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 14px rgba(45, 122, 82, 0.25);
}

#business-types-page .type-item.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

#business-types-page .type-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
}

#business-types-page .type-item.active .type-item-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

#business-types-page .type-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

#business-types-page .type-item.active .type-item-name {
  color: #fff;
  font-weight: 600;
}

#business-types-page .type-item-count {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  min-width: 24px;
  text-align: center;
  transition: all 0.25s;
}

#business-types-page .type-item-count.zero {
  background: var(--gray-light, #f3f4f6);
  color: var(--text-placeholder);
}

#business-types-page .type-item.active .type-item-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

#business-types-page .type-item-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

#business-types-page .type-item:hover .type-item-actions { opacity: 1; }

#business-types-page .type-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#business-types-page .type-action-btn.edit { color: var(--text-sub); }
#business-types-page .type-action-btn.edit:hover { background: var(--primary-light); color: var(--primary); }
#business-types-page .type-action-btn.del { color: var(--text-sub); }
#business-types-page .type-action-btn.del:hover { background: var(--danger-light); color: var(--danger); }

#business-types-page .type-action-btn svg { width: 14px; height: 14px; }

#business-types-page .type-item.active .type-action-btn { color: rgba(255,255,255,0.8); }
#business-types-page .type-item.active .type-action-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

#business-types-page .add-type-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1.5px dashed var(--border-green);
  border-radius: 12px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s var(--ease);
}

#business-types-page .add-type-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

#business-types-page .add-type-btn svg { width: 15px; height: 15px; }

/* 右侧：产品区 */
#business-types-page .product-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px 28px;
  min-height: 560px;
}

#business-types-page .product-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 18px;
}

#business-types-page .product-panel-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#business-types-page .product-panel-title h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 10px;
}

#business-types-page .product-panel-title h2 .type-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(45, 122, 82, 0.5);
}

#business-types-page .product-panel-title .product-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

#business-types-page .product-panel-title .product-count span {
  font-weight: 700;
}

#business-types-page .filter-tabs {
  display: flex;
  background: var(--primary-lighter);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#business-types-page .filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  border: none;
  background: transparent;
  font-family: var(--font-sans);
}

#business-types-page .filter-tab:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.6);
}

#business-types-page .filter-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(45, 122, 82, 0.25);
}

#business-types-page .filter-tab .tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0,0,0,0.06);
  padding: 1px 7px;
  border-radius: 8px;
}

#business-types-page .filter-tab.active .tab-count {
  background: rgba(255,255,255,0.2);
}

/* 产品表格 */
#business-types-page .product-table {
  width: 100%;
  border-collapse: collapse;
}

#business-types-page .product-table thead th {
  background: var(--primary-lighter);
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

#business-types-page .product-table thead th:first-child { padding-left: 18px; border-radius: 8px 0 0 8px; }
#business-types-page .product-table thead th:last-child { padding-right: 18px; text-align: right; border-radius: 0 8px 8px 0; }

#business-types-page .product-table tbody tr {
  transition: background 0.2s var(--ease);
  border-bottom: 1px solid var(--border-light);
}

#business-types-page .product-table tbody tr:last-child { border-bottom: none; }

#business-types-page .product-table tbody tr:hover { background: var(--primary-lighter); }

#business-types-page .product-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

#business-types-page .product-table tbody td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--text-body);
}

#business-types-page .product-table tbody td:first-child { padding-left: 18px; }
#business-types-page .product-table tbody td:last-child { padding-right: 18px; text-align: right; }

#business-types-page .cell-product {
  display: flex;
  align-items: center;
  gap: 10px;
}

#business-types-page .cell-product .product-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#business-types-page .cell-product .product-avatar-img {
  object-fit: cover;
  cursor: zoom-in;
}

#business-types-page .cell-product .name {
  font-weight: 600;
  color: var(--text-title);
}

#business-types-page .cell-product .sub {
  display: block;
  font-size: 11px;
  color: var(--text-sub);
  font-family: var(--font-mono);
  margin-top: 2px;
}

#business-types-page .cell-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

#business-types-page .cell-price { color: var(--text-title); }
#business-types-page .cell-cost { color: var(--text-sub); }
#business-types-page .cell-cost.none { color: var(--text-placeholder); font-weight: 400; }

#business-types-page .cell-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

#business-types-page .cell-tag.high-profit { background: var(--danger-light); color: var(--danger); }
#business-types-page .cell-tag.has-price { background: var(--success-light); color: var(--success); }
#business-types-page .cell-tag.no-price { background: var(--gray-light, #f3f4f6); color: var(--text-sub); }

#business-types-page .table-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-sub);
  margin-left: 4px;
}

#business-types-page .table-action-btn.edit:hover { background: var(--primary-light); color: var(--primary); }
#business-types-page .table-action-btn.del:hover { background: var(--danger-light); color: var(--danger); }

#business-types-page .table-action-btn svg { width: 14px; height: 14px; }

/* 空状态 */
#business-types-page .empty-state {
  padding: 60px 24px 40px;
  text-align: center;
}

#business-types-page .empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  color: var(--border-green);
  animation: breathe 3s ease-in-out infinite;
}

#business-types-page .empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 10px;
}

#business-types-page .empty-state p {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 24px;
  line-height: 1.8;
}

#business-types-page .empty-state p .highlight {
  color: var(--primary);
  font-weight: 600;
}

/* 动画（供本页使用；若 suppliers.css 已加载则重复定义无害） */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 补充：类型项点击区 + 拖拽态 */
#business-types-page .type-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
#business-types-page .type-item.dragging { opacity: 0.6; }
