/* ==========================================================================
   资产库信息架构调整（V12）
   仅新增：品牌 / 产品选项卡、左栏分类图标与产品层级、右栏分类管理面板。
   既有组件（.finder / .f-cat / .f-row / .panel / .button …）全部复用。
   ========================================================================== */

/* ------------------------------- 两个大选项卡 ------------------------------ */

.v2-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--parchment);
}

.v2-tab {
  min-height: 44px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.v2-tab:hover {
  color: var(--ink);
}

.v2-tab.active {
  background: var(--ink);
  color: #fff;
}

.v2-tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.v2-tab.active:focus-visible {
  outline-color: var(--blue);
}

/* ------------------------------ 左栏分类图标 ------------------------------ */

.f-cat-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.f-cat-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.f-cat-icon img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  border-radius: 5px;
}

.f-cat.active .f-cat-icon {
  color: var(--ink);
}

.f-cat-icon-svg svg {
  width: 18px;
  height: 18px;
}

/* 产品二级：返回、产品标题、空状态、本产品全部 */

.f-back {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  margin-bottom: 2px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.f-back:hover {
  background: rgba(0, 0, 0, .045);
  color: var(--ink);
}

.f-back span {
  font-size: 14px;
  line-height: 1;
}

.f-cat-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 11px;
}

.f-cat-title-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.f-cat-title-count {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.f-cat-all-item {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  padding-top: 6px;
  height: 40px;
}

.f-cat-all-item.active {
  border-top-color: transparent;
}

.f-cat-empty {
  margin: 0;
  padding: 12px 11px;
  color: var(--muted-light);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ------------------------------ 右栏分类管理 ------------------------------ */

.v2-cat-manage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 2px 10px;
}

.v2-cat-manage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v2-cat-kind {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--parchment);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.v2-cat-parent {
  color: var(--muted-light);
  font-size: 12px;
}

.v2-cat-icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.v2-cat-icon-lg {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  overflow: hidden;
}

.v2-cat-icon-lg.is-empty {
  background: var(--parchment);
}

.v2-cat-icon-lg svg,
.v2-cat-icon-fallback svg {
  width: 26px;
  height: 26px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v2-cat-icon-lg img {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
}

.v2-cat-icon-ops {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2-cat-icon-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v2-cat-manage .button.v2-mini {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.v2-cat-icon-ops .field-help {
  margin-top: 0;
}

.v2-cat-name-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.v2-cat-name-form .field {
  flex: 1;
  min-width: 0;
}

.v2-cat-name-form .field input {
  height: 40px;
}

.v2-cat-manage .v2-cat-name-form .button {
  min-height: 40px;
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

.v2-cat-note {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--parchment);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.v2-cat-note b {
  color: var(--ink-soft);
  font-weight: 600;
}

.v2-cat-danger {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.v2-cat-danger .button.danger {
  min-height: 38px;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.v2-cat-danger > span {
  flex: 1;
  min-width: 150px;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.5;
}

/* 未选择分类 / 产品时的引导 */

.v2-cat-guide {
  min-height: 100%;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 28px 20px;
}

.v2-cat-guide-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 18px;
  background: var(--blue-soft);
  color: var(--blue);
}

.v2-cat-guide-mark svg {
  width: 28px;
  height: 28px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v2-cat-guide strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.v2-cat-guide p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.v2-cat-guide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.v2-cat-guide-actions .button {
  min-height: 38px;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

/* 新建分类弹窗 */

.v2-cat-dialog {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-cat-dialog .field-help {
  margin-top: 6px;
}

/* 详情页分类下拉 */

.v2-meta-row-edit select,
.v2-detail-select {
  max-width: 170px;
  height: 28px;
  min-width: 0;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.v2-meta-row-edit select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* -------------------------------- 响应式 -------------------------------- */

@media (max-width: 820px) {
  .v2-tabs {
    display: flex;
    width: 100%;
    margin-bottom: 14px;
  }

  .v2-tab {
    flex: 1;
    min-height: 42px;
    padding: 0 12px;
  }

  .v2-cat-manage {
    gap: 14px;
    padding-bottom: 4px;
  }

  .v2-cat-guide {
    min-height: 0;
    padding: 18px 8px;
  }

  .v2-cat-name-form {
    flex-wrap: wrap;
  }

  .v2-cat-name-form .button {
    width: 100%;
  }

  .v2-cat-icon-lg {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .v2-cat-icon-lg img {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .v2-tab {
    font-size: 13px;
  }

  .v2-cat-guide-actions {
    width: 100%;
  }

  .v2-cat-guide-actions .button {
    flex: 1;
  }

  .v2-cat-icon-row {
    align-items: flex-start;
  }

  .v2-meta-row-edit select {
    max-width: 140px;
  }
}

/* 设置页：中台同步面板 */
.v2-settings-grid .v2-hub-panel { grid-column: 1 / -1; }
.v2-hub-panel .panel-head { align-items: center; }
.v2-hub-err { color: #d70015; }
