:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --ink: #20262a;
  --muted: #667178;
  --line: #d9e1e5;
  --teal: #0b756d;
  --teal-soft: rgba(15, 143, 130, 0.1);
  --red: #c8423c;
  --orange: #c76b1b;
  --blue: #315fbd;
  --violet: #7250a8;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(32, 38, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 244, 0.92) 38%, rgba(247, 243, 237, 0.9)),
    var(--bg);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.user-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid rgba(217, 225, 229, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 32px rgba(32, 38, 42, 0.05);
}

.brand-lockup,
.nav-actions,
.search-row,
.panel-head,
.drawer-head {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(15, 143, 130, 0.38);
  border-radius: 50%;
  background: conic-gradient(from 220deg, #0f8f82, #f4d35e, #c8423c, #315fbd, #0f8f82);
  box-shadow: inset 0 0 0 7px #fff;
}

.brand-mark span {
  width: 15px;
  height: 15px;
  border: 2px solid #20262a;
  border-radius: 50%;
  background: #fff;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  line-height: 1.15;
}

.brand-lockup small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-actions > a,
.auth-link,
.user-chip,
.icon-button,
.panel-head button,
.card-action,
.product-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.nav-actions > a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
}

.auth-link,
.user-chip {
  min-height: 38px;
  padding: 0 11px;
  color: var(--ink);
}

.auth-link.primary {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 168px;
}

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

.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button span {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  border-radius: 999px;
  background: var(--red);
  font-size: 0.72rem;
}

.user-shell {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 32px) 34px;
}

.command-panel,
.filter-panel,
.results-panel,
.detail-panel,
.compare-drawer {
  border: 1px solid rgba(217, 225, 229, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.profile-drawer {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 32;
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(217, 225, 229, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 32px));
  transition: transform 180ms ease;
}

.profile-drawer.is-open {
  transform: translateX(0);
}

.command-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-color: rgba(15, 117, 109, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 245, 0.98)),
    #fff;
}

.title-block p,
.title-block h1 {
  margin: 0;
}

.title-block p {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
}

.title-block h1 {
  margin-top: 5px;
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
  line-height: 1.12;
}

.search-row {
  gap: 10px;
}

.search-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 220px;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input,
.search-row select {
  width: 100%;
  height: 44px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: #fff;
}

.search-box input {
  padding: 0 12px 0 40px;
}

.search-row select {
  flex: 0 0 168px;
  padding: 0 12px;
}

.search-box input:focus,
.search-row select:focus {
  border-color: rgba(15, 143, 130, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 143, 130, 0.12);
}

.category-tabs,
.tag-cloud,
.product-meta,
.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tabs button,
.tag-cloud button,
.summary-tags span {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
}

.category-tabs button.is-active,
.tag-cloud button.is-active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

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

.overview-grid article {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 28px rgba(32, 38, 42, 0.04);
}

.overview-grid span,
.panel-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.overview-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
  line-height: 1;
}

.content-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) minmax(320px, 420px);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.filter-panel,
.results-panel,
.detail-panel {
  padding: 14px;
}

.filter-panel,
.detail-panel {
  position: sticky;
  top: 90px;
}

.panel-head {
  justify-content: space-between;
  min-height: 34px;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2,
.filter-group h3,
.drawer-head h2 {
  margin: 0;
}

.panel-head h2,
.drawer-head h2 {
  font-size: 1rem;
}

.panel-head button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
}

.filter-group {
  margin-top: 16px;
}

.filter-group h3 {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented-control button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.is-active {
  color: #fff;
  background: var(--teal);
}

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

.product-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-card.is-selected {
  border-color: rgba(15, 143, 130, 0.82);
  box-shadow: inset 3px 0 0 var(--teal), 0 14px 32px rgba(15, 117, 109, 0.1);
}

.product-card:hover {
  border-color: rgba(15, 117, 109, 0.34);
  box-shadow: 0 14px 34px rgba(32, 38, 42, 0.08);
  transform: translateY(-1px);
}

.product-image {
  display: block;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
}

.product-image img,
.detail-image,
.compare-item img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
  background: #fff;
}

.product-copy {
  min-width: 0;
}

.product-copy strong,
.product-copy small,
.detail-title strong,
.detail-title small,
.compare-item strong,
.compare-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-copy strong {
  font-size: 1.02rem;
}

.product-copy small,
.detail-title small,
.compare-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.product-meta {
  margin-top: 9px;
}

.product-meta span,
.level-pill,
.verify-pill {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #f8fafb;
  font-size: 0.77rem;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  color: #fff;
}

.verify-pill {
  display: inline-flex;
  align-items: center;
  color: #315fbd;
  background: rgba(49, 95, 189, 0.1);
}

.verify-confirmed {
  color: var(--teal);
  background: var(--teal-soft);
}

.verify-sample {
  color: var(--violet);
  background: rgba(114, 80, 168, 0.12);
}

.verify-pending {
  color: var(--orange);
  background: rgba(199, 107, 27, 0.12);
}

.level-high {
  background: var(--red);
}

.level-mid {
  background: var(--orange);
}

.level-low {
  background: var(--teal);
}

.risk-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.risk-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf0;
}

.risk-fill {
  display: block;
  width: var(--width);
  height: 100%;
  background: var(--bar-color);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card-action {
  min-height: 34px;
  padding: 0 10px;
  color: var(--teal);
  font-weight: 700;
}

.card-action.is-added {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.detail-view {
  display: grid;
  gap: 14px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.detail-image {
  height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
}

.image-open-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.detail-image-button {
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
}

.detail-image-button .detail-image {
  border: 0;
}

.review-image-button {
  display: block;
  width: min(100%, 260px);
  aspect-ratio: 4 / 3;
  margin: 10px 0 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
}

.review-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
  background: #fff;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(20, 25, 28, 0.74);
}

.image-viewer.is-open {
  display: grid;
}

.image-viewer img {
  max-width: min(96vw, 1180px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.image-viewer-close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.detail-title h3 {
  margin: 0;
  font-size: 1.18rem;
}

.score-grid,
.buy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.score-tile,
.buy-tile {
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.score-tile span,
.buy-tile span {
  color: var(--muted);
  font-size: 0.78rem;
}

.score-tile strong,
.buy-tile strong {
  display: block;
  margin-top: 6px;
  line-height: 1.2;
  word-break: break-word;
}

.score-tile strong {
  font-size: 1.22rem;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.summary-box,
.evidence-list p,
.advice-list p,
.verification-box,
.dimension-row,
.review-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.summary-box {
  display: grid;
  gap: 9px;
  padding: 11px;
}

.summary-box p,
.evidence-list p,
.advice-list p,
.verification-box p,
.review-item p {
  margin: 0;
  color: #364148;
  line-height: 1.55;
}

.summary-tags span {
  display: inline-flex;
  align-items: center;
  color: var(--teal);
  border: 1px solid rgba(15, 143, 130, 0.26);
  background: var(--teal-soft);
}

.section-note {
  margin: -2px 0 9px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.verification-box {
  display: grid;
  gap: 10px;
  padding: 11px;
}

.verification-head,
.verification-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.verification-head {
  justify-content: space-between;
}

.verification-head span,
.verification-evidence span {
  color: var(--muted);
  font-size: 0.78rem;
}

.verification-evidence span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f8fafb;
}

.dimension-list {
  display: grid;
  gap: 8px;
}

.dimension-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  background: #fff;
}

.dimension-row span:first-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.dimension-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf0;
}

.dimension-fill {
  display: block;
  width: var(--width);
  height: 100%;
  background: var(--bar-color);
}

.evidence-list,
.advice-list,
.review-list,
.purchase-links,
.compare-list {
  display: grid;
  gap: 8px;
}

.evidence-list p,
.advice-list p {
  padding: 10px;
}

.purchase-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.purchase-link strong,
.purchase-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-link small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.purchase-link em {
  min-width: 42px;
  padding: 4px 7px;
  color: var(--teal);
  border-radius: 999px;
  background: var(--teal-soft);
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.review-item {
  padding: 10px;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.review-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.review-author {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.review-author span:not(.avatar) {
  display: grid;
  min-width: 0;
}

.review-author strong,
.review-author small {
  display: block;
}

.review-author small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--avatar-color);
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 6px 16px rgba(32, 38, 42, 0.12);
}

.avatar-large {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vote-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.vote-button,
.profile-link,
.primary-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

.vote-button.is-active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.profile-view {
  display: grid;
  gap: 12px;
}

.profile-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(15, 117, 109, 0.08), rgba(49, 95, 189, 0.06)),
    #fff;
}

.profile-head strong,
.profile-head span {
  display: block;
}

.profile-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-stats div {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.28rem;
}

.profile-products {
  display: grid;
  gap: 9px;
}

.profile-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 117, 109, 0.22);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.editor-title {
  display: grid;
  gap: 3px;
}

.editor-title span,
.profile-editor label span {
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-editor label {
  display: grid;
  gap: 7px;
}

.profile-editor input[type="text"] {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: #fff;
}

.profile-editor input[type="text"]:focus {
  border-color: rgba(15, 117, 109, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 117, 109, 0.11);
}

.avatar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.avatar-upload {
  min-width: min(220px, 100%);
}

.avatar-upload input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px dashed #aab7bd;
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.8rem;
}

.avatar-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-swatches button {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
}

.avatar-swatches button.is-active {
  box-shadow: 0 0 0 3px rgba(15, 117, 109, 0.22), 0 0 0 1px var(--teal);
}

.profile-product {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.profile-product img {
  width: 76px;
  height: 76px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.profile-product strong,
.profile-product small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-product small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-product p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: #364148;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-link {
  margin-top: 8px;
  color: var(--teal);
  font-weight: 700;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(32, 38, 42, 0.36);
}

.auth-modal.is-open {
  display: flex;
}

.auth-card {
  width: min(440px, 100%);
  padding: 16px;
  border: 1px solid rgba(217, 225, 229, 0.92);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label.admin-login-field {
  display: none;
}

.auth-modal.is-admin-mode .auth-form label.user-login-field {
  display: none;
}

.auth-modal.is-admin-mode .auth-form label.admin-login-field {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span,
.auth-message {
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.auth-message {
  min-height: 18px;
  margin: 0;
}

.auth-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.primary-action {
  min-height: 42px;
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.secondary-action {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--teal);
  background: #fff;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #fff;
  border-radius: var(--radius);
  background: #263238;
  box-shadow: var(--shadow);
}

.compare-drawer {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 30;
  width: min(440px, calc(100vw - 36px));
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 14px;
  transform: translateX(calc(100% + 32px));
  transition: transform 180ms ease;
}

.compare-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.compare-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.compare-item img {
  height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
}

.remove-compare {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

.remove-compare svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state svg {
  width: 34px;
  height: 34px;
}

.empty-state.compact {
  min-height: 78px;
}

@media (max-width: 1180px) {
  .content-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .content-layout,
  .product-grid,
  .score-grid,
  .buy-grid,
  .profile-stats {
    grid-template-columns: 1fr;
  }

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

  .filter-panel {
    position: static;
  }

  .search-row {
    display: grid;
  }

  .search-row select {
    flex-basis: auto;
  }
}

@media (max-width: 560px) {
  .user-topbar {
    align-items: center;
    min-height: 64px;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand-lockup {
    flex: 1 1 auto;
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    box-shadow: inset 0 0 0 6px #fff;
  }

  .brand-mark span {
    width: 12px;
    height: 12px;
  }

  .brand-lockup strong {
    white-space: nowrap;
  }

  .brand-lockup small {
    display: none;
  }

  .nav-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .auth-area {
    width: auto;
    justify-content: flex-start;
  }

  .nav-actions > a {
    min-height: 36px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .user-topbar {
    flex-wrap: wrap;
  }

  .user-chip {
    max-width: 136px;
  }

  .overview-grid article {
    min-height: 76px;
  }

  .overview-grid strong {
    font-size: 1.5rem;
  }

  .product-card,
  .detail-hero {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .product-image {
    width: 86px;
    height: 86px;
  }

  .detail-image,
  .detail-image-button {
    width: 86px;
    height: 86px;
  }

  .profile-product {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .profile-product img {
    width: 64px;
    height: 64px;
  }
}
