:root {
  color-scheme: light;
  --ink: #292825;
  --muted: #756d64;
  --line: #ded8cf;
  --line-strong: #c9b9a8;
  --soft: #f1eee8;
  --accent: #a96e42;
  --success: #66805d;
  --page: #f7f5f1;
  --surface: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  padding: 0 max(20px, calc((100vw - 1128px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 241, 0.96);
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 700;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  clip-path: inset(0 round 8px);
  object-fit: contain;
  background: transparent;
}

.main-nav,
.header-actions {
  display: flex;
  align-items: center;
}

.main-nav {
  gap: 30px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.mobile-nav-only,
.mobile-menu-button {
  display: none;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  position: absolute;
  left: 0;
  content: "";
}

.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }

.main-nav a {
  padding: 22px 0 19px;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.login-button,
.signup-button {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.icon-button {
  min-width: 42px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
}

.login-button,
.signup-button {
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.login-button {
  margin-left: 2px;
  background: var(--ink);
  color: #fff;
}

.signup-button {
  margin-left: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.page-shell {
  width: min(1128px, calc(100% - 40px));
  margin: 32px auto 70px;
}

.title-band {
  display: flex;
  min-height: 126px;
  align-items: center;
  justify-content: space-between;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.title-copy {
  display: flex;
  align-items: center;
  gap: 24px;
}

.title-copy p {
  margin: 0 0 5px;
  color: var(--accent);
  font: 700 11px/1.2 ui-monospace, monospace;
  text-transform: uppercase;
}

.title-copy h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.stack-icon {
  position: relative;
  display: block;
  width: 30px;
  height: 27px;
}

.stack-icon i {
  position: absolute;
  left: 3px;
  width: 24px;
  height: 10px;
  transform: rotate(30deg) skewX(-30deg) scaleY(.86);
  border-radius: 2px;
  background: var(--accent);
}

.stack-icon i:nth-child(1) { top: 0; }
.stack-icon i:nth-child(2) { top: 8px; opacity: .78; }
.stack-icon i:nth-child(3) { top: 16px; opacity: .5; }

.model-count {
  display: grid;
  gap: 3px;
  text-align: center;
}

.model-count span {
  color: var(--muted);
}

.model-count strong {
  color: var(--accent);
}

.model-count span {
  font-size: 13px;
}

.model-count strong {
  font-size: 22px;
}

.catalog {
  padding: 0 10px;
}

.vendor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 34px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--line);
}

.vendor-tab {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  padding: 0 0;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  white-space: nowrap;
}

.vendor-tab:hover,
.vendor-tab.active {
  color: var(--ink);
}

.vendor-tab.active {
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.vendor-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--vendor-color, #222);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.vendor-tab b {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 10px 12px;
}

.search-box {
  display: flex;
  min-width: 0;
  flex: 1;
  height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-icon {
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  display: block;
  width: 7px;
  height: 2px;
  margin: 11px 0 0 10px;
  transform: rotate(45deg);
  background: var(--muted);
  content: "";
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-box:focus-within,
.currency-select select:focus-visible,
.unit-switch button:focus-visible,
.vendor-tab:focus-visible,
.pagination button:focus-visible,
.page-size select:focus-visible,
.icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toolbar-controls,
.currency-select,
.unit-switch {
  display: flex;
  align-items: center;
}

.toolbar-controls {
  gap: 12px;
}

.currency-select {
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.currency-select select {
  width: 110px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: var(--soft);
  color: var(--ink);
}

.unit-switch {
  height: 44px;
  padding: 3px;
  border-radius: 8px;
  background: var(--soft);
}

.unit-switch button {
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #777a80;
  cursor: pointer;
  font-size: 12px;
}

.unit-switch button.active {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
  font-weight: 700;
}

.table-frame {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  scrollbar-color: #cacaca transparent;
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  height: 62px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

th:nth-child(1) { width: 250px; }
th:nth-child(2) { width: 100px; }
th:nth-child(3) { width: 130px; }
th:nth-child(4) { width: 130px; }
th:nth-child(5) { width: 190px; }
th:nth-child(6) { width: 150px; }
th:nth-child(7) { width: 130px; }

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fcfbf9;
}

.model-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-pill,
.meta-pill {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--ink);
}

.model-pill {
  max-width: 205px;
  gap: 8px;
  padding: 8px 11px;
  font: 650 13px/1.1 ui-monospace, "Cascadia Code", monospace;
}

.model-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-pill {
  padding: 7px 10px;
  font-size: 12px;
}

.copy-button {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.copy-button::before,
.copy-button::after {
  position: absolute;
  width: 9px;
  height: 11px;
  border: 1.5px solid #a1a4a9;
  border-radius: 2px;
  content: "";
}

.copy-button::before { left: 8px; top: 7px; }
.copy-button::after { left: 12px; top: 11px; background: #fff; }

.price-lines,
.discount-lines {
  display: grid;
  gap: 7px;
  font: 500 12px/1.35 ui-monospace, "Cascadia Code", monospace;
  white-space: nowrap;
}

.price-lines small {
  color: var(--muted);
  font: inherit;
}

.discount-lines {
  color: var(--success);
  font-weight: 750;
}

.muted-value {
  color: #aaa;
}

.empty-state,
.loading-row td {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.pagination-actions,
.page-size {
  display: flex;
  align-items: center;
}

.pagination-actions {
  gap: 8px;
}

.page-size {
  gap: 8px;
  margin-right: 6px;
}

.page-size select,
.pagination-actions button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.page-size select {
  min-width: 64px;
  padding: 0 9px;
}

.pagination-actions button {
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.pagination-actions button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--soft);
}

.pagination-actions button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.page-indicator {
  min-width: 84px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  transform: translateY(12px);
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  .site-header {
    position: relative;
    z-index: 20;
    grid-template-columns: 1fr auto;
    width: 100%;
    max-width: 100vw;
    min-height: 72px;
    overflow: visible;
    padding: 0 18px;
  }

  .header-actions {
    position: absolute;
    z-index: 21;
    top: 16px;
    right: 18px;
    justify-self: end;
  }

  .brand {
    gap: 9px;
    font-size: 20px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .login-button,
  .signup-button {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  .main-nav {
    position: absolute;
    z-index: 20;
    top: calc(100% + 1px);
    right: 14px;
    left: 14px;
    display: none;
    overflow: hidden;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 14px 30px rgba(41, 40, 37, .12);
  }

  .main-nav.mobile-open {
    display: flex;
  }

  .main-nav a {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .main-nav a:hover,
  .main-nav a.active {
    border-bottom-color: var(--line);
    background: var(--soft);
  }

  .mobile-nav-only {
    display: block;
  }

  .page-shell {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    margin: 28px 14px 50px;
    overflow: hidden;
    padding: 0;
  }

  .title-band {
    position: relative;
    min-height: 120px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    overflow: hidden;
    padding: 24px 20px;
  }

  .title-copy {
    min-width: 0;
    gap: 16px;
    padding-right: 0;
  }

  .title-copy h1 {
    font-size: 23px;
  }

  .model-count strong {
    font-size: 19px;
  }

  .model-count {
    position: static;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-left: 46px;
    transform: none;
    text-align: left;
  }

  .catalog {
    min-width: 0;
    padding: 0;
  }

  .vendor-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 0 20px 14px;
  }

  .vendor-tab {
    min-width: 0;
    min-height: 54px;
    font-size: 14px;
  }

  .toolbar {
    width: calc(100vw - 28px);
    align-items: stretch;
    flex-direction: column;
    padding: 18px 16px 14px;
  }

  .search-box,
  .toolbar-controls {
    width: calc(100vw - 60px);
    max-width: calc(100vw - 60px);
  }

  .search-box {
    flex: none;
  }

  .toolbar-controls {
    justify-content: space-between;
  }

  .currency-select span {
    display: none;
  }

  .currency-select select {
    width: 104px;
  }

  .table-frame {
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 0 0;
  }

  .pagination-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-size {
    width: 100%;
    margin: 0 0 4px;
  }

  .pagination-actions button {
    flex: 1;
  }

  table {
    min-width: 1010px;
  }

  th:first-child,
  td:first-child {
    position: sticky;
    z-index: 1;
    left: 0;
    box-shadow: 8px 0 12px -12px rgba(0, 0, 0, .45);
  }

  th:first-child {
    z-index: 2;
  }

  td:first-child {
    background: #fff;
  }

  th,
  td {
    padding: 18px 14px;
  }
}
