:root {
  --blue: #2859f5;
  --blue-weak: #e9edff;
  --cyan: #16a7c5;
  --ink: #101828;
  --muted: #667085;
  --line: #d9dee8;
  --bg: #f3f4f7;
  --card: #ffffff;
  --success: #0f9f6e;
  --danger: #e95d55;
  --amber: #f3a61f;
  --shadow: 0 16px 35px rgba(31, 41, 55, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  height: 64px;
  border: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 210px;
  padding: 0 18px;
  color: #111827;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  height: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 116px;
  border: 0;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  padding: 0 22px;
  background: transparent;
  color: #111827;
  font-size: 16px;
  font-weight: 400;
}

.nav-item.active {
  background: #e7ebfb;
  color: var(--blue);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 0 24px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
}

.icon-button:hover {
  background: #f2f4f7;
}

.icon-button svg,
.searchbox svg,
.filter-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.page-shell {
  width: min(1520px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 14px 0 92px;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
}

.catalog-toolbar[hidden],
.filters-panel[hidden],
.product-grid[hidden],
.inventory-view[hidden],
.inventory-table-wrap[hidden] {
  display: none;
}

.library-tabs {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 10px;
  margin-left: 0;
}

.library-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 158px;
  height: 52px;
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 0 15px 0 12px;
  background: #fff;
  color: #344054;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.library-tab::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
  content: "";
}

.library-tab:hover {
  border-color: #c8d3e2;
  background: #fbfcff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.library-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #dbe7ff;
  border-radius: 7px;
  background: #eef3ff;
  color: #2859f5;
  font-size: 14px;
  font-weight: 600;
}

.library-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.library-copy strong {
  overflow: hidden;
  color: #1d2939;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-copy span {
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-tab.active {
  border-color: #9db7ff;
  background: #f6f8ff;
  color: var(--blue);
  box-shadow: 0 8px 18px rgba(40, 89, 245, 0.1);
}

.library-tab.active::before {
  background: var(--blue);
}

.library-tab.active .library-mark {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.library-tab.active .library-copy strong {
  color: var(--blue);
}

.library-tab[data-scope="private"] .library-mark {
  border-color: #c8eee9;
  background: #effbf9;
  color: #0f766e;
}

.library-tab[data-scope="private"].active {
  border-color: #8bd7cf;
  background: #f3fbfa;
  color: #0f766e;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.1);
}

.library-tab[data-scope="private"].active::before {
  background: #0f766e;
}

.library-tab[data-scope="private"].active .library-mark {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

.library-tab[data-scope="private"].active .library-copy strong {
  color: #0f766e;
}

.quick-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #111827;
  white-space: nowrap;
}

.checkline input,
.compare-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.searchbox {
  position: relative;
  display: block;
  width: min(326px, 40vw);
}

.searchbox input {
  width: 100%;
  height: 38px;
  border: 1px solid #c8ced8;
  border-radius: 2px;
  padding: 0 42px 0 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.searchbox input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 89, 245, 0.12);
}

.searchbox svg {
  position: absolute;
  top: 8px;
  right: 13px;
  color: #475467;
}

.filters-panel {
  border-radius: 3px;
  padding: 20px 24px;
  border: 1px solid #e7ebf2;
  background: var(--card);
}

.filter-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 12px;
  align-items: center;
}

.filter-row + .filter-row {
  margin-top: 12px;
}

.type-row {
  align-items: stretch;
}

.filter-label {
  align-self: center;
  color: #475467;
  font-size: 14px;
}

.type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.type-card {
  display: grid;
  width: 78px;
  min-height: 58px;
  place-items: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f7f8fb;
  color: #475467;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.type-card:hover {
  border-color: #d7deea;
  background: #fff;
}

.type-card.active {
  border-color: var(--blue);
  background: #eef3ff;
  color: var(--blue);
}

.type-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.type-card span {
  font-size: 12px;
  line-height: 1.1;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pill {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  background: #f7f8fb;
  color: #344054;
  font-size: 13px;
  white-space: nowrap;
}

.pill.active {
  border-color: #d9e2ff;
  background: var(--blue-weak);
  color: var(--blue);
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 11px;
  background: transparent;
  color: #344054;
  font-size: 13px;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.filter-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 3px;
  background: #f8fafc;
  white-space: nowrap;
}

.filter-toggle:hover {
  border-color: #d7deea;
  background: #fff;
}

.filter-toggle.active {
  border-color: #cbd8ff;
  background: #eef3ff;
  color: var(--blue);
}

.filter-toggle svg {
  width: 16px;
  height: 16px;
}

.advanced-filters {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid #edf0f5;
}

.advanced-filters[hidden] {
  display: none;
}

.custom-filter-controls label,
.sorter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: 13px;
}

.custom-filters {
  display: contents;
}

.custom-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.custom-filter-title {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #475467;
  font-size: 14px;
}

.sorter {
  min-height: 32px;
  border-left: 1px solid #e5eaf2;
  padding-left: 10px;
}

select {
  height: 32px;
  border: 1px solid #cfd5dd;
  border-radius: 6px;
  padding: 0 30px 0 10px;
  color: #1f2937;
  background:
    linear-gradient(45deg, transparent 50%, #667085 50%) right 13px center / 5px 5px no-repeat,
    linear-gradient(135deg, #667085 50%, transparent 50%) right 9px center / 5px 5px no-repeat,
    #fff;
  appearance: none;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

select:hover {
  border-color: #aeb8c8;
}

select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 89, 245, 0.12);
}

.ghost-button,
.primary-button,
.empty-state button {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 16px;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid #cfd5dd;
  background: #fff;
  color: #344054;
}

.primary-button,
.empty-state button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
  color: #667085;
}

.result-meta strong {
  color: var(--ink);
}

#filterSummary {
  margin-left: 10px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.inventory-view {
  margin-top: 18px;
}

.inventory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  padding: 18px 20px;
  background: #fff;
}

.inventory-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 500;
}

.inventory-head p {
  margin: 0;
  color: #667085;
  font-size: 14px;
}

.inventory-search {
  position: relative;
  display: block;
  width: min(320px, 38vw);
  flex: 0 0 auto;
}

.inventory-search input {
  width: 100%;
  height: 38px;
  border: 1px solid #cfd5dd;
  border-radius: 6px;
  padding: 0 40px 0 13px;
  outline: none;
}

.inventory-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 89, 245, 0.12);
}

.inventory-search svg {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #667085;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.inventory-stat {
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.inventory-stat span {
  display: block;
  color: #667085;
  font-size: 13px;
}

.inventory-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
}

.inventory-table-wrap {
  overflow: auto;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  background: #fff;
}

.inventory-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  border-bottom: 1px solid #edf0f5;
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
}

.inventory-table th {
  background: #f8fafc;
  color: #667085;
  font-weight: 500;
}

.inventory-table tr:last-child td {
  border-bottom: 0;
}

.stock-badge {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.stock-badge.success {
  background: #e9f8f2;
  color: #0f7a55;
}

.stock-badge.warning {
  background: #fff5dc;
  color: #9a6700;
}

.stock-badge.danger {
  background: #ffebe9;
  color: #b42318;
}

.inventory-empty {
  margin-top: 14px;
}

.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e7ebf2;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  padding: 12px 14px;
  background: #fff;
  color: #667085;
  font-size: 13px;
}

.inventory-pagination[hidden] {
  display: none;
}

.product-pagination {
  margin-top: 14px;
  border-top: 1px solid #e7ebf2;
  border-radius: 8px;
}

.inventory-page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.inventory-page-actions button {
  min-height: 32px;
  border: 1px solid #d9e0ea;
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: #344054;
}

.inventory-page-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.inventory-page-actions strong {
  min-width: 58px;
  color: #344054;
  text-align: center;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 304px;
  overflow: hidden;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  padding: 20px 20px 18px;
  background: var(--card);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-card:hover {
  transform: translateY(-1px);
  border-color: #d9e2ff;
  box-shadow: 0 12px 24px rgba(31, 41, 55, 0.08);
}

.product-card.is-selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.status-badge {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 0 0 8px 0;
  padding: 7px 20px;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
}

.compare-check {
  position: absolute;
  top: 18px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 400;
}

.product-image {
  display: grid;
  height: 128px;
  margin-top: 20px;
  place-items: center;
  border-radius: 6px;
  padding: 10px;
  background: transparent;
}

.product-image-el {
  width: 100%;
  height: 100%;
  max-width: 230px;
  max-height: 108px;
  object-fit: contain;
  display: block;
}

.product-card h3 {
  margin: 12px 0 6px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.spec {
  min-height: 48px;
  margin: 0 0 14px;
  color: #475467;
  font-size: 14px;
  line-height: 1.45;
}

.product-card .spec {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.price-line {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eef1f6;
}

.price {
  color: #1f4fe3;
  font-size: 18px;
  font-weight: 800;
}

.cost {
  display: block;
  margin-top: 4px;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-button {
  border: 0;
  border-radius: 6px;
  padding: 5px 6px;
  background: transparent;
  color: #2451d8;
  font-size: 13px;
  font-weight: 400;
}

.detail-button:hover {
  background: #f3f6ff;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  margin-top: 20px;
  border: 1px dashed #cfd5dd;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 18px;
  color: #667085;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(15, 23, 42, 0.38);
}

.detail-drawer.open {
  display: flex;
}

.drawer-panel {
  position: relative;
  width: min(1120px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  padding: 0;
  border: 1px solid #d9dee8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

#drawerContent {
  display: block;
  background: #fff;
}

.product-detail {
  background: #fff;
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  border-bottom: 1px solid #e8edf5;
  padding: 30px 72px 26px 32px;
  background: #fff;
}

.detail-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-bottom: 10px;
  color: #667085;
  font-size: 13px;
}

.detail-path span {
  display: inline;
}

.detail-path span + span::before {
  margin: 0 8px;
  color: #98a2b3;
  content: "/";
}

.product-detail .detail-top h2 {
  margin: 0;
  color: #101828;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
}

.detail-top p {
  max-width: 740px;
  margin: 10px 0 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.65;
}

.detail-main {
  display: grid;
  grid-template-columns: minmax(260px, 30%) minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid #e8edf5;
  background: #fff;
}

.detail-left {
  position: relative;
  border-right: 1px solid #e8edf5;
  overflow: hidden;
  background:
    linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
}

.detail-visual {
  display: grid;
  min-height: 340px;
  place-items: center;
  padding: 34px 28px 104px;
  background:
    radial-gradient(circle at 50% 42%, rgba(40, 89, 245, 0.11), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 248, 252, 0.9));
}

.detail-summary {
  align-self: start;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.detail-price {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.detail-price span {
  display: block;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-price strong {
  display: block;
  margin-top: 0;
  color: #1f4fe3;
  font-size: 26px;
  line-height: 1.05;
  white-space: nowrap;
}

.detail-facts {
  margin: 0;
  padding: 0 32px 26px;
}

.detail-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #edf1f6;
  padding: 17px 0;
}

.detail-facts div:last-child {
  border-bottom: 0;
}

.detail-facts dt {
  color: #667085;
  font-size: 13px;
}

.detail-facts dd {
  margin: 0;
  color: #101828;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.detail-spec-panel {
  padding: 28px 32px 32px;
  background: #fff;
}

.detail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.detail-section-title h3 {
  margin: 0;
  color: #101828;
  font-size: 17px;
  font-weight: 700;
}

.detail-section-title span {
  color: #667085;
  font-size: 13px;
}

.detail-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-param-button {
  min-height: 30px;
  border: 1px solid #cfd8ea;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: #2859f5;
  font-size: 13px;
  font-weight: 700;
}

.copy-param-button:hover {
  border-color: #aebef0;
  background: #f5f7ff;
}

.copy-param-button:disabled {
  cursor: default;
  border-color: #cde8dc;
  background: #eefaf4;
  color: #0f7a55;
}

.detail-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
}

.detail-fact-grid div {
  display: grid;
  gap: 5px;
  min-height: 66px;
  border: 1px solid #e6ebf2;
  border-radius: 7px;
  padding: 12px 14px;
  background: #fbfcfe;
}

.detail-fact-grid dt,
.detail-fact-grid dd {
  margin: 0;
  line-height: 1.4;
}

.detail-fact-grid dt {
  color: #667085;
  font-size: 12px;
}

.detail-fact-grid dd {
  color: #101828;
  font-size: 13px;
  font-weight: 700;
}

.detail-param-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  max-height: 98px;
  overflow: hidden;
}

.detail-param-list span {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid #e6ebf2;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: #243047;
  font-size: 13px;
  line-height: 1.45;
}

.detail-param-list span:first-child {
  grid-column: 1 / -1;
}

.detail-param-list span::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-right: 9px;
  border-radius: 999px;
  background: #2859f5;
  content: "";
}

.detail-note-panel {
  margin-top: 18px;
}

.detail-note-panel .detail-section-title {
  margin-bottom: 10px;
}

.detail-note-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.detail-note-list span {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid #e6ebf2;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: #243047;
  font-size: 13px;
  line-height: 1.45;
}

.detail-note-list span::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-right: 9px;
  border-radius: 999px;
  background: #2859f5;
  content: "";
}

.detail-spec-list {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  border: 1px solid #e1e7f0;
  border-radius: 6px;
  overflow: hidden;
}

.detail-spec-list div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 50px;
  border-bottom: 1px solid #e8edf5;
  background: #fff;
}

.detail-spec-list div:last-child {
  border-bottom: 0;
}

.detail-spec-list dt,
.detail-spec-list dd {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 13px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.detail-spec-list dt {
  background: #f8fafc;
  color: #667085;
  border-right: 1px solid #e8edf5;
}

.detail-spec-list dd {
  color: #243047;
  font-weight: 600;
}

.detail-chart-panel {
  padding: 28px 32px 34px;
  background: #fbfcfe;
}

.price-chart {
  display: block;
  width: 100%;
  height: 160px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background:
    linear-gradient(#eef2f7 1px, transparent 1px) 0 40px / 100% 40px,
    #fff;
}

.price-chart text {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.price-chart-label {
  fill: #667085;
  font-size: 12px;
}

.price-chart-value {
  fill: #1d2939;
  font-size: 12px;
  font-weight: 700;
}

.recent-remark-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.recent-remark-list span {
  border: 1px solid #e6ebf2;
  border-radius: 7px;
  padding: 9px 11px;
  background: #fff;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}

.update-data-dialog {
  width: min(440px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.update-data-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.update-data-dialog form {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: #fff;
}

.update-data-dialog label {
  display: grid;
  gap: 7px;
  color: #475467;
  font-size: 13px;
}

.update-data-dialog input,
.update-data-dialog textarea {
  width: 100%;
  border: 1px solid #cfd5dd;
  border-radius: 7px;
  padding: 10px 12px;
  color: #101828;
  outline: none;
}

.update-data-dialog textarea {
  resize: vertical;
}

.update-data-dialog input:focus,
.update-data-dialog textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 89, 245, 0.12);
}

.update-data-message {
  min-height: 18px;
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.update-data-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.drawer-hero {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1 / span 2;
  justify-content: space-between;
  min-height: 440px;
  margin: 0;
  border-right: 1px solid #e5eaf2;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(40, 89, 245, 0.08), rgba(255, 255, 255, 0) 44%),
    #f7f9fc;
}

.drawer-image-stage {
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px solid #e7ebf2;
  border-radius: 10px;
  padding: 26px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.drawer-image-el {
  width: 100%;
  max-width: 420px;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.detail-visual .drawer-image-el {
  max-width: 280px;
  max-height: 210px;
}

.drawer-model-card {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
}

.drawer-model-card span {
  color: #667085;
  font-size: 12px;
}

.drawer-model-card strong {
  color: #101828;
  font-size: 18px;
  letter-spacing: 0;
}

.drawer-header {
  grid-column: 2;
  border-bottom: 1px solid #edf1f6;
  padding: 38px 68px 28px 34px;
  background: #fff;
}

.drawer-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.drawer-kicker {
  display: block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.detail-drawer h2 {
  margin: 0 0 10px;
  color: #101828;
  font-size: 32px;
  line-height: 1.12;
}

.drawer-subtitle {
  margin: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.7;
}

.drawer-title-row,
.drawer-price-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-price-card {
  margin-top: 24px;
  border: 1px solid #dce6ff;
  border-radius: 8px;
  padding: 14px 16px;
  background: #f6f8ff;
}

.drawer-price-card span {
  color: #667085;
  font-size: 13px;
}

.drawer-price-card strong {
  color: var(--blue);
  font-size: 26px;
  font-weight: 800;
}

.drawer-price {
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
}

.drawer-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
}

.drawer-state.success {
  background: #e9f8f2;
  color: #0f7a55;
}

.drawer-state.muted {
  background: #eef1f5;
  color: #667085;
}

.metric-grid {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 34px 26px;
}

.metric {
  border: 1px solid #e8edf5;
  border-radius: 8px;
  padding: 14px 15px;
  background: #fbfcff;
}

.metric span {
  display: block;
  color: #667085;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: #101828;
  font-size: 15px;
}

.drawer-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #475467;
  line-height: 1.8;
}

.drawer-section {
  grid-column: 1 / -1;
  border-top: 1px solid #edf1f6;
  margin: 0;
  padding: 24px 34px 32px;
  background: #fff;
}

.drawer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.drawer-section h3 {
  margin: 0;
  font-size: 16px;
}

.drawer-section-head span {
  color: #667085;
  font-size: 12px;
}

.param-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.param-grid span {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
}

.compare-bar {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #ccd4ea;
  border-radius: 8px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.compare-bar[hidden] {
  display: none;
}

#compareNames {
  margin-left: 12px;
  color: #667085;
}

.compare-actions {
  display: flex;
  gap: 10px;
}

.compare-dialog {
  width: min(940px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.compare-dialog::backdrop {
  background: rgba(16, 24, 40, 0.35);
}

.compare-dialog form {
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dialog-head h2 {
  margin: 0;
}

.compare-table {
  overflow: auto;
}

.compare-table table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  border: 1px solid #e3e7ee;
  padding: 13px;
  text-align: left;
  vertical-align: top;
}

.compare-table th {
  width: 140px;
  background: #f6f8fb;
  color: #475467;
}

@media (max-width: 1240px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .brand {
    width: 210px;
  }
}

@media (max-width: 920px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
  }

  .brand {
    width: auto;
    min-height: 58px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    height: 52px;
    border-top: 1px solid var(--line);
  }

  .nav-item {
    flex: 1;
    justify-content: center;
  }

  .header-actions {
    margin-left: auto;
    padding: 0 16px;
  }

  .page-shell {
    width: min(100% - 24px, 760px);
    padding-top: 12px;
  }

  .catalog-toolbar,
  .quick-tools,
  .result-meta,
  .inventory-head,
  .compare-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .library-tabs {
    width: 100%;
  }

  .library-tab {
    flex: 1;
    min-width: 0;
  }

  .searchbox,
  .inventory-search {
    width: 100%;
  }

  .inventory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: flex-start;
  }

  .advanced-filters {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .filter-toggle {
    justify-content: flex-start;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-drawer {
    align-items: stretch;
    padding: 12px;
  }

  .drawer-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  #drawerContent {
    grid-template-columns: 1fr;
  }

  .drawer-hero {
    grid-column: 1;
    grid-row: auto;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #e7ebf2;
  }

  .drawer-image-stage {
    min-height: 240px;
  }

  .drawer-header {
    grid-column: 1;
    padding: 28px 56px 20px 24px;
  }

  .metric-grid {
    grid-column: 1;
    margin: 18px 24px 24px;
  }

  .drawer-section {
    grid-column: 1;
    padding: 22px 24px 28px;
  }

  .detail-top {
    grid-template-columns: 1fr;
    padding: 28px 58px 24px 24px;
  }

  .product-detail .detail-top h2 {
    font-size: 30px;
  }

  .detail-main {
    grid-template-columns: 1fr;
  }

  .detail-left {
    border-right: 0;
    border-bottom: 1px solid #e8edf5;
  }

  .detail-visual {
    min-height: 280px;
    padding-bottom: 112px;
  }

  .detail-summary {
    display: block;
  }

  .detail-price {
    border-right: 0;
    border-bottom: 0;
  }

  .detail-facts {
    padding: 8px 22px;
  }

  .detail-spec-panel {
    padding: 24px;
  }

  .detail-chart-panel {
    padding: 24px;
  }

  .detail-param-list {
    grid-template-columns: 1fr;
  }

  .detail-spec-list {
    grid-template-columns: 1fr;
  }

  .detail-spec-list div,
  .detail-spec-list div:nth-child(2n),
  .detail-spec-list div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid #e8edf5;
  }

  .detail-spec-list div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .brand strong {
    font-size: 18px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    min-height: 292px;
    padding: 18px 16px 16px;
  }

  .compare-check {
    top: 16px;
    right: 16px;
  }

  .library-tab {
    height: 48px;
    padding: 0 10px;
  }

  .library-mark {
    width: 28px;
    height: 28px;
  }

  .type-card {
    width: calc(50% - 8px);
  }

  .inventory-summary {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    padding: 0;
  }

  .drawer-panel {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .drawer-hero {
    padding: 18px;
  }

  .drawer-image-stage {
    min-height: 190px;
    padding: 18px;
  }

  .drawer-header {
    padding: 24px 54px 20px 18px;
  }

  .detail-drawer h2 {
    font-size: 26px;
  }

  .drawer-kicker-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .drawer-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    margin: 16px 18px 22px;
  }

  .drawer-section {
    padding: 20px 18px 24px;
  }

  .param-grid {
    grid-template-columns: 1fr;
  }

  .param-grid span {
    width: 100%;
    justify-content: flex-start;
    border-radius: 8px;
  }

  .detail-top {
    padding: 24px 52px 22px 18px;
  }

  .product-detail .detail-top h2 {
    font-size: 25px;
  }

  .detail-top p {
    font-size: 14px;
  }

  .detail-main {
    grid-template-columns: 1fr;
  }

  .detail-left {
    border-right: 0;
  }

  .detail-visual {
    min-height: 220px;
    padding: 22px;
  }

  .detail-summary {
    display: block;
  }

  .detail-price {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin: 0 18px 18px;
    border-right: 0;
    border-bottom: 0;
    padding: 18px;
  }

  .detail-price strong {
    font-size: 28px;
  }

  .detail-facts {
    padding: 6px 20px 16px;
  }

  .detail-spec-panel {
    padding: 22px 18px 26px;
  }

  .detail-chart-panel {
    padding: 22px 18px 26px;
  }

  .detail-fact-grid {
    grid-template-columns: 1fr;
  }

  .detail-param-list {
    grid-template-columns: 1fr;
  }

  .detail-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .detail-spec-list div {
    grid-template-columns: 1fr;
  }

  .detail-spec-list dt {
    border-right: 0;
    border-bottom: 1px solid #e8edf5;
    padding-bottom: 4px;
  }

  .detail-spec-list dd {
    padding-top: 4px;
  }

  .price-chart {
    height: 150px;
  }
}
