/* NVIDIA design reference: black/white surfaces, #ccc rules and 2px controls.
   HighTac overrides: red accent and Microsoft YaHei sans-serif typography. */
:root {
  --red: #d42a1d;
  --red-bright: #ff6259;
  --red-dark: #a91d14;
  --black: #000;
  --ink: #1a1a1a;
  --white: #fff;
  --soft: #f7f7f7;
  --line: #ccc;
  --line-strong: #5e5e5e;
  --muted: #6b6b6b;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  --shell: 1440px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--soft);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
img { display: block; }
h1, p { margin-top: 0; }
.shell { width: min(calc(100% - 48px), var(--shell)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 16px;
  background: var(--red); color: var(--white); font-weight: 700; transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  min-width: 100vw;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.98) 0%, rgba(247, 247, 247, 0.94) 24%, rgba(255, 255, 255, 0) 50%),
    linear-gradient(135deg, #fff 0%, #ededed 32%, #9b0d06 66%, #2a0000 84%, #000 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms var(--ease), visibility 0s linear 180ms;
}
.splash-screen.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo-frame {
  width: clamp(168px, 42vmin, 320px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.splash-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 42px rgba(0, 0, 0, 0.48));
}

.site-header { position: sticky; top: 0; z-index: 30; background: var(--white); border-bottom: 1px solid var(--black); }
.header-inner { min-height: 88px; display: grid; grid-template-columns: minmax(88px, 1fr) auto auto; align-items: center; gap: 32px; }
.brand-flow { width: max-content; display: flex; align-items: center; text-decoration: none; }
.logo-box { height: 68px; display: flex; align-items: center; justify-content: center; overflow: visible; background: var(--white); }
.logo-box img { display: block; width: auto; max-width: none; object-fit: contain; }
.sidi-logo img { height: 68px; }
.primary-tabs { height: 88px; display: flex; align-items: stretch; }
.primary-tabs button {
  position: relative; min-width: 112px; min-height: 44px; padding: 0 18px; border: 0;
  background: transparent; color: var(--black); font-weight: 700; cursor: pointer;
}
.primary-tabs button::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 4px; background: var(--red); transform: scaleX(0); transition: transform 160ms var(--ease); }
.primary-tabs button:hover::after, .primary-tabs button.active::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.export-control { position: relative; }
.header-actions > .export-control > button { min-width: 80px; min-height: 44px; padding: 0 14px; border: 2px solid var(--black); border-radius: 2px; font-size: 14px; font-weight: 700; cursor: pointer; }
.header-actions .export-primary { background: var(--black); color: var(--white); }
.header-actions .export-redacted { min-width: 96px; background: var(--white); color: var(--black); border-color: var(--red); }
.header-actions button:active { background: var(--red-dark); color: var(--white); border-color: var(--red-dark); }
.export-language-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; width: 128px; padding: 4px; border: 2px solid var(--black); border-radius: 2px; background: var(--white); box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.export-language-menu[hidden] { display: none; }
.export-language-menu button { width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 0; background: var(--white); color: var(--black); text-align: left; font-size: 14px; font-weight: 700; cursor: pointer; }
.export-language-menu button:hover, .export-language-menu button:focus-visible { background: var(--black); color: var(--white); }

.workspace-panel { padding-block: 24px 40px; }
.catalogue-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.catalogue-content { min-width: 0; }
.category-rail { position: sticky; top: 112px; max-height: calc(100vh - 136px); overflow: auto; border: 1px solid var(--line); border-radius: 2px; background: var(--white); }
.rail-head { position: sticky; top: 0; z-index: 2; min-height: 48px; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; background: var(--black); color: var(--white); }
.rail-head span { min-width: 26px; height: 26px; display: grid; place-items: center; background: var(--red); color: var(--white); font-size: 12px; font-weight: 700; }
.category-list button { width: 100%; min-height: 72px; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--white); text-align: left; cursor: pointer; }
.category-list button:hover { background: var(--soft); }
.category-list button.active { padding-left: 8px; border-left: 4px solid var(--red); background: var(--black); color: var(--white); }
.category-list .category-name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 700; }
.category-list .all-category { grid-template-columns: 1fr; min-height: 48px; }
.category-score { display: grid; gap: 4px; font-size: 12px; line-height: 1.5; }
.score-line { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.score-label { color: var(--muted); font-weight: 700; }
.score-fraction { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; color: var(--black); }
.score-line:first-child .score-fraction { color: var(--red-dark); }
.score-current { font-weight: 700; white-space: nowrap; }
.score-separator { padding-inline: 3px; }
.score-limit { font-weight: 400; white-space: nowrap; }
.category-list button.active .score-label { color: rgba(255,255,255,.7); }
.category-list button.active .score-fraction { color: var(--white); }
.category-list button.active .score-line:first-child .score-fraction { color: var(--red-bright); }

.fx-notice { min-height: 44px; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 9px 14px; background: var(--black); color: var(--white); }
.fx-notice > span { width: 12px; height: 12px; flex: 0 0 12px; background: var(--red); }
.fx-notice p { margin: 0; color: rgba(255,255,255,.78); font-size: 13px; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; margin-bottom: 20px; padding: 12px; border: 1px solid var(--line); background: var(--white); }
.search-field, .select-field { position: relative; display: block; }
.search-field svg { position: absolute; top: 12px; left: 14px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; pointer-events: none; }
.search-field input, .select-field select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); color: var(--black); }
.search-field input { padding: 0 16px 0 44px; }
.select-field select { padding: 0 40px 0 14px; }
.search-field input::placeholder { color: var(--muted); }
.search-field input:focus, .select-field select:focus { border-color: var(--red); outline: 3px solid var(--red); outline-offset: 2px; }
.results-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--black); }
.results-head h1 { margin: 0; color: var(--black); font-size: 24px; line-height: 1.25; }
.results-head p { margin: 0; color: var(--muted); font-size: 13px; }

.product-table-wrap {
  --new-price-width: 112px;
  --qty-width: 96px;
  --remark-width: 200px;
  overflow: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  background: var(--white);
}
.product-table { width: 100%; min-width: 1200px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.product-table th { position: sticky; top: 0; z-index: 3; height: 48px; padding: 9px 12px; background: var(--black); color: var(--white); border-right: 1px solid var(--line-strong); text-align: left; font-size: 13px; }
.product-table tbody tr { --row-bg: var(--white); }
.product-table tbody tr:nth-child(even) { --row-bg: var(--soft); }
.product-table td { height: 82px; padding: 8px 12px; background: var(--row-bg); border-top: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.product-table .image-column { width: 80px; }
.product-table .code-column { width: 160px; }
html[lang="fr"] .product-table .code-column,
html[lang="fr"] .product-table .product-code { display: none; }
html[lang="fr"] .product-table .new-price-column { display: none; }
html[lang="fr"] .product-table { min-width: 1040px; }
html[lang="fr"] .product-table .spec-column { width: auto; }
.product-table .name-column { width: 220px; }
.product-table .spec-column { width: 232px; }
.product-table .price-column { width: 100px; text-align: right; }
.product-table .new-price-column { width: var(--new-price-width); text-align: right; }
.product-table .quantity-column { width: var(--qty-width); }
.product-table .remark-column { width: var(--remark-width); }
.product-table th:nth-last-child(3), .product-table td:nth-last-child(3) { position: sticky; right: calc(var(--remark-width) + var(--qty-width)); width: var(--new-price-width); min-width: var(--new-price-width); z-index: 5; }
.product-table th:nth-last-child(2), .product-table td:nth-last-child(2) { position: sticky; right: var(--remark-width); width: var(--qty-width); min-width: var(--qty-width); z-index: 5; }
.product-table th:last-child, .product-table td:last-child { position: sticky; right: 0; width: var(--remark-width); min-width: var(--remark-width); z-index: 5; }
.product-table thead th:nth-last-child(-n + 3) { z-index: 9; background: var(--black); }
.product-table td:nth-last-child(3) { box-shadow: -8px 0 10px -10px rgba(0,0,0,.55); }
html[lang="fr"] .product-table th.price-column {
  position: sticky;
  right: calc(var(--remark-width) + var(--qty-width));
  width: var(--new-price-width);
  min-width: var(--new-price-width);
  z-index: 9;
}
.product-thumb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: auto;
  background: var(--white);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.no-image { color: var(--muted); text-align: center; }
.product-code { color: var(--red-dark); font-weight: 700; overflow-wrap: anywhere; }
.product-name { color: var(--black); font-weight: 700; }
.product-spec { color: var(--muted); white-space: pre-line; }
.product-price { text-align: right; white-space: nowrap; font-weight: 700; }
.product-price small { display: block; color: var(--muted); font-weight: 400; }
.order-new-price, .order-quantity, .order-remark { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); color: var(--black); }
.order-new-price, .order-quantity { padding: 0 8px; text-align: right; }
.order-remark { padding: 0 10px; }
.order-new-price:focus, .order-quantity:focus, .order-remark:focus { border-color: var(--red); outline: 3px solid var(--red); outline-offset: 1px; }

.pagination { min-height: 68px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); background: var(--white); }
.pagination p { margin: 0; color: var(--muted); font-size: 13px; }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.pagination button { min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); color: var(--black); font-weight: 700; cursor: pointer; }
.pagination button:hover, .pagination button.active { border-color: var(--black); background: var(--black); color: var(--white); }
.pagination button:disabled { color: var(--muted); background: var(--soft); cursor: default; }
.page-buttons { display: flex; gap: 4px; }
.page-ellipsis { width: 34px; display: grid; place-items: center; color: var(--muted); }
.mobile-page { display: none; min-width: 72px; text-align: center; font-weight: 700; }
.page-jump { display: flex; align-items: center; gap: 6px; }
.page-jump label { color: var(--muted); font-size: 13px; }
.page-jump input { width: 64px; height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 2px; text-align: center; }

.licence-content { min-width: 0; }
.licence-toolbar { display: grid; grid-template-columns: 1fr minmax(300px, 520px) auto; align-items: center; gap: 18px; margin-bottom: 16px; }
.licence-toolbar h1 { margin: 0; font-size: 24px; }
.licence-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.declaration-table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--white); }
.declaration-table { width: 100%; min-width: 1360px; border-collapse: separate; border-spacing: 0; }
.declaration-table th { position: sticky; top: 0; z-index: 2; height: 48px; padding: 10px 12px; background: var(--black); color: var(--white); border-right: 1px solid var(--line-strong); text-align: left; font-size: 13px; }
.declaration-table td { padding: 11px 12px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 14px; }
.declaration-table tbody tr:nth-child(even) { background: var(--soft); }
.numeric { text-align: right; white-space: nowrap; }
.category-link { min-height: 38px; padding: 0 11px; border: 1px solid var(--red); border-radius: 2px; background: transparent; color: var(--red-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.category-link:hover { background: var(--red); color: var(--white); }
.release-footer { width: min(calc(100% - 48px), var(--shell)); margin: 0 auto; padding: 0 0 12px; text-align: right; }
.release-version { color: var(--muted); font-size: 10px; line-height: 1; }

@media (min-width: 981px) {
  .catalogue-layout {
    grid-template-columns: clamp(220px, 18vw, 260px) minmax(0, 1fr);
    gap: clamp(12px, 1.4vw, 20px);
  }
  .product-table-wrap {
    --new-price-width: 11%;
    --qty-width: 9%;
    --remark-width: 17%;
    overflow-x: hidden;
  }
  .product-table,
  html[lang="fr"] .product-table {
    width: 100%;
    min-width: 0;
  }
  .product-table .image-column { width: 8%; }
  .product-table .code-column { width: 12%; }
  .product-table .name-column { width: 16%; }
  .product-table .spec-column,
  html[lang="fr"] .product-table .spec-column { width: 17%; }
  .product-table .price-column { width: 10%; }
  .product-table th,
  .product-table td {
    padding-inline: clamp(4px, .6vw, 9px);
    font-size: clamp(12px, .85vw, 13px);
    overflow-wrap: anywhere;
  }
  .product-thumb {
    width: clamp(40px, 4.4vw, 60px);
    height: clamp(40px, 4.4vw, 60px);
  }
  .product-price { white-space: normal; }
  .order-new-price,
  .order-quantity,
  .order-remark { padding-inline: clamp(4px, .45vw, 8px); }
}

@media (max-width: 980px) {
  .header-inner { grid-template-columns: minmax(240px, 1fr) auto auto; gap: 16px; }
  .primary-tabs button { min-width: 96px; padding-inline: 12px; }
  .catalogue-layout { grid-template-columns: 1fr; gap: 16px; }
  .category-rail { position: static; width: calc(100% + 48px); max-height: none; margin-inline: -24px; overflow: hidden; border-inline: 0; }
  .rail-head { display: none; }
  .category-list { display: flex; overflow-x: auto; }
  .category-list button { width: 280px; min-width: 280px; border-right: 1px solid var(--line); border-bottom: 0; }
  .category-list button.active { padding-left: 12px; border-left: 0; border-bottom: 4px solid var(--red); }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 32px), var(--shell)); }
  .header-inner { min-height: 116px; grid-template-columns: 1fr auto; grid-template-rows: 68px 48px; gap: 0 12px; }
  .logo-box { height: 48px; }
  .sidi-logo img { height: 48px; }
  .primary-tabs { grid-column: 1 / -1; grid-row: 2; height: 48px; margin-inline: -16px; border-top: 1px solid var(--line); }
  .primary-tabs button { flex: 1; min-width: 0; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .header-actions > .export-control > button { min-width: 64px; padding-inline: 8px; }
  .header-actions .export-redacted { min-width: 88px; }
  .workspace-panel { padding-block: 16px 28px; }
  .category-rail { width: calc(100% + 32px); margin-inline: -16px; }
  .fx-notice { margin-inline: -16px; margin-bottom: 10px; padding-inline: 16px; }
  .filter-bar { grid-template-columns: 1fr; margin-inline: -16px; padding-inline: 16px; border-inline: 0; }
  .results-head h1 { font-size: 21px; }
  .product-table-wrap { --new-price-width: 80px; --qty-width: 72px; --remark-width: 96px; margin-inline: -16px; border-inline: 0; }
  .product-table { min-width: 1100px; }
  html[lang="fr"] .product-table { min-width: 950px; }
  .product-table .image-column { width: 72px; }
  .product-table .code-column { width: 150px; }
  .product-table .name-column { width: 210px; }
  .product-table .spec-column { width: 300px; }
  .product-table .price-column { width: 120px; }
  .product-table td { height: 72px; padding: 7px 9px; font-size: 13px; }
  .product-thumb { width: 56px; height: 56px; }
  .order-new-price, .order-quantity, .order-remark { font-size: 16px; }
  .pagination { grid-template-columns: 1fr; gap: 8px; margin-inline: -16px; border-inline: 0; }
  .pagination p { text-align: center; }
  .pagination-controls { justify-content: center; }
  .page-buttons { display: none; }
  .mobile-page { display: inline; }
  .page-jump { justify-content: center; }
  .licence-toolbar { grid-template-columns: 1fr; }
  .licence-toolbar .search-field { width: 100%; }
  .declaration-table-wrap { margin-inline: -16px; border-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
