:root {
  --ink: #17252e;
  --muted: #64737d;
  --line: #dce4e7;
  --surface: #ffffff;
  --canvas: #f5f7f8;
  --navy: #172a35;
  --navy-soft: #1d3344;
  --cyan: #0f9e9a;
  --cyan-soft: #e1f4f2;
  --green: #19835d;
  --danger: #bd514b;
  --shadow: 0 12px 32px rgba(27, 48, 63, 0.09);
}

/* Minimal catalog skin */
body[data-page="catalog"] {
  background: #fff;
}

body[data-page="catalog"] .topbar {
  min-height: 60px;
  padding-block: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

body[data-page="catalog"] .brand {
  gap: 9px;
}

body[data-page="catalog"] .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  font-size: 14px;
}

body[data-page="catalog"] .brand strong {
  font-size: 15px;
}

body[data-page="catalog"] .brand small {
  margin-top: 0;
  font-size: 11px;
}

body[data-page="catalog"] .contact-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}

body[data-page="catalog"] .catalog-shell {
  width: min(1320px, calc(100% - 48px));
  padding-top: 26px;
}

body[data-page="catalog"] .catalog-heading {
  margin-bottom: 16px;
}

body[data-page="catalog"] .catalog-heading > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

body[data-page="catalog"] .catalog-heading h1 {
  font-size: 20px;
  font-weight: 700;
}

body[data-page="catalog"] .catalog-heading p {
  margin: 0;
  font-size: 12px;
}

body[data-page="catalog"] .classification-row > strong{
  color: #8a9499;
  font-weight: 500;
}

body[data-page="catalog"] .category-tabs button{
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  padding: 5px 9px;
  color: #66747b;
  background: transparent;
}

body[data-page="catalog"] .classification-row .category-tabs button.active{
  color: var(--ink);
  background: #eef1f1;
}

body[data-page="catalog"] .product-grid {
  gap: 30px 18px;
}

body[data-page="catalog"] .product-card {
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  transition: opacity 0.16s ease;
}

body[data-page="catalog"] .product-card:hover {
  border-color: transparent;
  box-shadow: none;
  opacity: 0.82;
  transform: none;
}

body[data-page="catalog"] .product-media {
  border-radius: 4px;
}

body[data-page="catalog"] .product-media span {
  top: 8px;
  left: 8px;
  border-radius: 3px;
  padding: 4px 6px;
  background: rgba(23, 37, 46, 0.72);
  font-size: 11px;
}

body[data-page="catalog"] .product-info {
  gap: 9px;
  padding: 11px 0 0;
}

body[data-page="catalog"] .product-title h3 {
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 600;
}

body[data-page="catalog"] .product-title strong {
  color: #3d696b;
  font-size: 14px;
  font-weight: 600;
}

body[data-page="catalog"] .product-supply,
body[data-page="catalog"] .product-supply-primary,
body[data-page="catalog"] .product-supply-secondary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

body[data-page="catalog"] .product-supply {
  gap: 4px 14px;
  color: #7c888d;
  font-size: 11px;
}

body[data-page="catalog"] .product-supply-primary,
body[data-page="catalog"] .product-supply-secondary {
  gap: 0;
}

body[data-page="catalog"] .product-supply-secondary span + span::before {
  margin: 0 7px;
  color: #c1c8ca;
  content: "/";
}

@media (max-width: 560px) {
  body[data-page="catalog"] .topbar {
    padding: 8px 16px;
  }

  body[data-page="catalog"] .brand small {
    display: none;
  }

  body[data-page="catalog"] .catalog-shell {
    width: calc(100% - 32px);
    padding-top: 20px;
  }

  body[data-page="catalog"] .product-grid {
    gap: 0;
  }

  body[data-page="catalog"] .product-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px solid #edf0f0;
  }

  body[data-page="catalog"] .product-media {
    border-radius: 3px;
  }

  body[data-page="catalog"] .product-media span {
    top: 5px;
    left: 5px;
  }

  body[data-page="catalog"] .product-info {
    align-content: center;
    padding: 0;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

img {
  display: block;
  max-width: 100%;
}

.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;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(320px, 720px);
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  min-height: 68px;
  padding: 10px clamp(16px, 4vw, 44px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(25, 43, 54, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
  font-weight: 900;
}

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

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.contact-button,
.primary-button,
.ghost-button,
.top-actions a,
.row-actions button {
  border-radius: 8px;
  font-weight: 700;
}

.contact-button {
  min-height: 42px;
  border: 0;
  padding: 0 15px;
  color: #fff;
  background: var(--navy);
  white-space: nowrap;
}
.contact-preview strong {
  display: block;
  margin-bottom: 7px;
}
.contact-preview p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.contact-preview span {
  color: var(--cyan);
  font-size: 13px;
}

.qr-box {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-shell{
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 46px;
}

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

.catalog-heading h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.catalog-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.catalog-heading p strong {
  color: var(--ink);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 0;
  scrollbar-width: thin;
}

.classification-groups {
  display: grid;
  gap: 9px;
}

.classification-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.classification-row > strong {
  color: #53656e;
  font-size: 13px;
}

.category-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 13px;
  color: #415563;
  background: var(--surface);
}

.category-tabs button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}
.form-head,
.admin-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.product-category-picker > div > span {
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.admin-category-options button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  color: #445862;
  background: #f8fafb;
}
.admin-category-options button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfdfe;
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(22, 166, 185, 0.13);
}

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

.product-card {
  display: block;
  overflow: hidden;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-card:focus-visible {
  outline: 3px solid rgba(15, 158, 154, 0.3);
  outline-offset: 2px;
}

.product-card:hover {
  border-color: #9cced3;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-media {
  position: relative;
  overflow: hidden;
  background: #e8f0f3;
}

.product-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-media span {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 5px 8px;
  color: #eefafa;
  background: rgba(18, 34, 48, 0.8);
  border-radius: 999px;
  font-size: 12px;
}

.product-info {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.product-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.product-title h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
}

.product-title span {
  color: var(--muted);
  font-size: 12px;
}

.product-title strong {
  color: #176d78;
  white-space: nowrap;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed #b7c8d2;
  border-radius: 12px;
  text-align: center;
}

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

.top-actions a,
.ghost-button,
.row-actions button {
  border: 1px solid var(--line);
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
}

.top-actions a {
  color: var(--ink);
  background: #f4f7f8;
  border-color: var(--line);
}

.ghost-button:hover,
.row-actions button:hover,
.top-actions a:hover {
  border-color: var(--cyan);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 9px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
}

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

.admin-stats span {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-stats small,
.admin-stats strong {
  display: block;
}

.admin-stats small {
  color: var(--muted);
  font-size: 12px;
}

.admin-stats strong {
  margin-top: 7px;
  color: var(--ink);
  font-size: 25px;
}

.contact-admin-panel,
.category-admin-panel,
.product-form,
.admin-list-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.category-admin-panel,
.contact-admin-panel {
  margin-bottom: 14px;
  padding: 16px;
}

.category-admin-panel {
  padding-inline: 0;
  background: transparent;
  border: 0;
}

.add-category-form,
.add-subcategory-form {
  display: grid;
  grid-template-columns: minmax(140px, 220px) auto;
  gap: 8px;
}

.add-category-form .primary-button {
  padding: 0 14px;
}

.category-manager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
}

.category-manager-row {
  padding: 12px;
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.managed-major,
.managed-subcategory {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.managed-major {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.managed-major input {
  font-weight: 800;
}

.managed-major span,
.managed-subcategory span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.managed-major button,
.managed-subcategory button,
.add-subcategory-form button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: #52636c;
  background: #fff;
}

.managed-major button:disabled,
.managed-subcategory button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.managed-subcategory-list {
  display: grid;
  gap: 7px;
  padding: 10px 0;
}

.managed-subcategory input {
  padding-block: 8px;
}

.product-category-picker {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-category-picker legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 800;
}

.product-category-picker > div {
  display: grid;
  gap: 7px;
}

.product-classification-options {
  display: grid;
  gap: 12px;
}

.product-classification-row {
  display: grid;
  gap: 7px;
}

.product-classification-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-category-options.secondary button {
  color: #2b6765;
  background: #edf7f6;
  border-color: #cfe5e3;
}

.admin-category-options.secondary button.active {
  color: #fff;
  background: var(--cyan);
  border-color: var(--cyan);
}

.picker-empty {
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.form-head {
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.form-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.contact-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 240px;
  gap: 16px;
  padding-top: 14px;
}

.contact-fields {
  display: grid;
  gap: 10px;
}

.contact-preview {
  display: grid;
  justify-items: start;
  padding: 14px;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.contact-preview .qr-box {
  margin-bottom: 12px;
}

.product-form {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.admin-list-panel {
  padding: 16px;
}

.admin-tools {
  align-items: end;
  margin-bottom: 12px;
}

.admin-tools label {
  flex: 1;
}

.two-cols,
.four-cols {
  display: grid;
  gap: 10px;
}

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

.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
}

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

.product-flags .check-row {
  min-height: 40px;
  padding: 8px 10px;
  background: #f6f9fa;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.primary-button {
  border: 0;
  padding: 12px 14px;
  color: #fff;
  background: var(--cyan);
}

.primary-button:hover {
  background: #118b9b;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-row img {
  width: 78px;
  height: 62px;
  object-fit: cover;
  border-radius: 7px;
}

.admin-row strong,
.admin-row span {
  display: block;
}

.admin-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.status {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.status.on {
  color: var(--green);
  background: #e4f5ed;
}

.status.off {
  color: var(--danger);
  background: #fbe9e7;
}

.row-actions {
  display: flex;
  gap: 6px;
}

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

  .product-form {
    position: static;
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .contact-button {
    grid-column: 2;
    grid-row: 1;
  }
  .contact-admin-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .topbar {
    padding: 10px 14px;
  }

  .brand strong {
    font-size: 15px;
  }

  .contact-button {
    min-height: 40px;
  }

  .qr-box {
    width: 106px;
    height: 106px;
  }

  .catalog-shell{
    width: calc(100% - 20px);
    padding-top: 16px;
  }

  .catalog-heading h1 {
    font-size: 21px;
  }

  .classification-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

  .form-head {
    align-items: stretch;
    flex-direction: column;
  }

  .add-category-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .managed-major,
  .managed-subcategory {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .managed-major span,
  .managed-subcategory span {
    grid-column: 1;
    grid-row: 2;
  }

  .managed-major button,
  .managed-subcategory button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .product-grid,
  .two-cols,
  .four-cols {
    grid-template-columns: 1fr;
  }

  .product-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .product-media img {
    height: 100%;
    aspect-ratio: auto;
  }

  .product-media span {
    top: 7px;
    left: 7px;
    max-width: calc(100% - 14px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-row {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .admin-row img {
    width: 70px;
    height: 58px;
  }

  .status,
  .row-actions {
    grid-column: 2;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.detail-topbar {
  grid-template-columns: auto auto;
}

.detail-back {
  justify-self: end;
  padding: 10px 13px;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
  font-weight: 700;
}

.detail-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 54px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
}

.detail-gallery {
  min-width: 0;
}

.detail-main-media {
  overflow: hidden;
  background: #e8eef0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-main-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 1px 2px;
}

.detail-thumbnails button {
  flex: 0 0 82px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 7px;
  padding: 0;
  background: #fff;
}

.detail-thumbnails button.active {
  border-color: var(--cyan);
}

.detail-thumbnails img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail-summary {
  padding-top: 8px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tags span {
  padding: 6px 8px;
  color: #35605f;
  background: var(--cyan-soft);
  border-radius: 6px;
  font-size: 12px;
}

.detail-sku {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.detail-summary h1 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.detail-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}

.detail-price span,
.detail-key-specs span {
  color: var(--muted);
  font-size: 12px;
}

.detail-price strong {
  color: #176d78;
  font-size: 28px;
}

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

.detail-key-specs div {
  padding: 12px;
  background: #edf2f3;
  border-radius: 8px;
}

.detail-key-specs span,
.detail-key-specs strong {
  display: block;
}

.detail-key-specs strong {
  margin-top: 5px;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: clamp(28px, 5vw, 72px);
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.detail-section h2{
  margin-bottom: 16px;
  font-size: 20px;
}

.detail-section > p {
  color: var(--muted);
  line-height: 1.8;
}

.detail-spec-list {
  margin: 0;
}

.detail-spec-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-spec-list dt {
  color: var(--muted);
}

.detail-spec-list dd {
  margin: 0;
  font-weight: 700;
}

.detail-video,
.related-section {
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.detail-video video {
  width: 100%;
  max-height: 720px;
  background: #10191f;
  border-radius: 8px;
}

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

.related-product {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.related-product > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.related-product > div {
  display: grid;
  gap: 5px;
  padding: 11px;
}

.related-product span {
  color: var(--muted);
  font-size: 12px;
}

.related-product b {
  color: #176d78;
}

.detail-empty {
  padding: 90px 20px;
  text-align: center;
}

.detail-empty p {
  color: var(--muted);
}

.detail-empty a {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
}

@media (max-width: 900px) {
  .detail-hero,
  .detail-content {
    grid-template-columns: 1fr;
  }

  .detail-summary {
    padding-top: 0;
  }

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

@media (max-width: 560px) {
  .detail-shell {
    width: calc(100% - 20px);
    padding-top: 14px;
  }

  .detail-summary h1 {
    font-size: 27px;
  }

  .detail-content,
  .detail-video,
  .related-section {
    margin-top: 30px;
    padding-top: 22px;
  }

  .detail-spec-list div {
    grid-template-columns: 92px minmax(0, 1fr);
  }

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

/* Single-line catalog navigation */
body[data-page="catalog"] .topbar {
  grid-template-columns: auto minmax(300px, 1fr) minmax(300px, 520px);
  gap: clamp(16px, 3vw, 38px);
}

body[data-page="catalog"] .catalog-heading {
  margin-bottom: 0;
}

@media (max-width: 860px) {
  body[data-page="catalog"] .topbar {
    grid-template-columns: auto minmax(110px, 1fr) minmax(170px, 190px);
    gap: 8px;
  }

  body[data-page="catalog"] .brand > span:last-child {
    display: none;
  }
  body[data-page="catalog"] .contact-button {
    grid-column: auto;
    grid-row: auto;
  }

  body[data-page="catalog"] .contact-button {
    padding-inline: 10px;
  }
}

@media (max-width: 560px) {
  body[data-page="catalog"] .topbar {
    padding: 8px;
  }
  body[data-page="catalog"] .contact-button {
    min-height: 36px;
    font-size: 12px;
  }
}

/* Focused catalog homepage */
body[data-page="catalog"] .topbar {
  grid-template-columns: auto auto;
  gap: 24px;
  min-height: 64px;
  padding: 10px clamp(16px, 4vw, 44px);
  overflow: visible;
}
body[data-page="catalog"] .contact-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 15px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
body[data-page="catalog"] .contact-button:hover,
body[data-page="catalog"] .contact-button[aria-expanded="true"] {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

body[data-page="catalog"] .catalog-shell {
  padding-top: 26px;
  padding-bottom: 48px;
}

body[data-page="catalog"] .empty-state {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  body[data-page="catalog"] .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 58px;
    padding: 8px 12px;
  }

  body[data-page="catalog"] .brand {
    min-width: 0;
  }

  body[data-page="catalog"] .brand > span:last-child {
    display: block;
    min-width: 0;
  }

  body[data-page="catalog"] .brand strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="catalog"] .brand-mark {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
  }
  body[data-page="catalog"] .contact-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  body[data-page="catalog"] .catalog-shell {
    width: calc(100% - 24px);
    padding-top: 8px;
  }
}

/* Persistent catalog sidebar */
body[data-page="catalog"] {
  padding-left: 280px;
}

body[data-page="catalog"] .catalog-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  width: 280px;
  flex-direction: column;
  padding: 22px 18px 16px;
  background: rgba(255, 255, 255, 0.99);
  border-right: 1px solid var(--line);
}

body[data-page="catalog"] .sidebar-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
}

body[data-page="catalog"] .catalog-sidebar .brand {
  flex: 0 0 auto;
  margin-bottom: 0;
}

body[data-page="catalog"] .mobile-titlebar,
body[data-page="catalog"] .mobile-category-bar,
body[data-page="catalog"] .mobile-menu-toggle{
  display: none;
}

body[data-page="catalog"] .sidebar-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  scrollbar-width: none;
}

body[data-page="catalog"] .sidebar-content::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body[data-page="catalog"] .catalog-sidebar .classification-groups {
  display: grid;
  gap: 24px;
  padding-bottom: 16px;
}

body[data-page="catalog"] .catalog-sidebar .classification-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border: 0;
  padding: 0;
}

body[data-page="catalog"] .catalog-sidebar .classification-row > strong {
  color: #7d898f;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="catalog"] .catalog-sidebar .category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  overflow: visible;
}

body[data-page="catalog"] .catalog-sidebar .category-tabs button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 5px 10px;
  color: #65737a;
  background: transparent;
  font-size: 12px;
}

body[data-page="catalog"] .catalog-sidebar .category-tabs button.active {
  color: #0f5557;
  background: #eaf4f3;
  border-color: #d8e9e8;
  font-weight: 600;
}

body[data-page="catalog"] .floating-contact {
  position: fixed;
  bottom: 16px;
  left: 18px;
  z-index: 42;
  width: 244px;
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

body[data-page="catalog"] .catalog-shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 22px;
}

body[data-page="catalog"] .product-media {
  overflow: hidden;
  background: #f2f4f4;
}

body[data-page="catalog"] .product-media img {
  transition: transform 220ms ease;
}

body[data-page="catalog"] .product-card:hover .product-media img {
  transform: scale(1.015);
}

body[data-page="catalog"] .product-title h3 {
  color: #172a34;
  line-height: 1.35;
}

@media (max-width: 700px) {
  body[data-page="catalog"] {
    padding-left: 0;
  }

  body[data-page="catalog"] .mobile-titlebar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 45;
    display: flex;
    height: 62px;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    padding: 0 14px;
    border-bottom: 1px solid #e8eded;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
  }

  body[data-page="catalog"] .mobile-titlebar > .brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 5px;
    color: #fff;
    background: var(--navy);
    font-size: 15px;
    font-weight: 800;
  }

  body[data-page="catalog"] .mobile-titlebar > div {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  body[data-page="catalog"] .mobile-titlebar strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="catalog"] .mobile-titlebar > div > span {
    color: var(--muted);
    font-size: 10px;
  }

  body[data-page="catalog"] .mobile-category-bar {
    position: fixed;
    inset: 62px 0 auto 0;
    z-index: 44;
    display: grid;
    gap: 5px;
    padding: 7px 10px 6px;
    border-bottom: 1px solid #e8eded;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 5px 14px rgba(23, 42, 53, 0.035);
    backdrop-filter: blur(14px);
  }

  body[data-page="catalog"] .mobile-more-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body[data-page="catalog"] .mobile-more-row::before,
  body[data-page="catalog"] .mobile-more-row::after {
    height: 1px;
    flex: 1 1 auto;
    background: #edf1f1;
    content: "";
  }

  body[data-page="catalog"] .catalog-sidebar {
    top: calc(var(--mobile-category-bottom, 221px) + 5px);
    right: 8px;
    bottom: auto;
    left: 8px;
    z-index: 60;
    width: auto;
    max-height: calc(100vh - var(--mobile-category-bottom, 221px) - 16px);
    padding: 12px 14px 14px;
    border: 1px solid #e2e8e9;
    border-radius: 7px;
    box-shadow: 0 18px 42px rgba(23, 37, 46, 0.14);
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    visibility: hidden;
    transition: opacity 160ms ease, transform 180ms ease, visibility 180ms ease;
  }

  body[data-page="catalog"].catalog-nav-open {
    overflow: auto;
  }

  body[data-page="catalog"].catalog-nav-open .catalog-sidebar {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  body[data-page="catalog"] .mobile-menu-toggle {
    display: inline-flex;
    width: auto;
    min-height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #dce4e5;
    border-radius: 5px;
    padding: 0 10px;
    color: #3e555e;
    background: #fff;
    font-size: 11px;
    font-weight: 500;
  }

  body[data-page="catalog"] .mobile-menu-toggle b {
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #1b7776;
    font-size: 9px;
    font-weight: 700;
  }

  body[data-page="catalog"] .mobile-menu-toggle b[hidden] {
    display: none;
  }

  body[data-page="catalog"] .mobile-menu-toggle i {
    position: relative;
    width: 12px;
    height: 9px;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
  }

  body[data-page="catalog"] .mobile-menu-toggle i::after {
    position: absolute;
    top: 3px;
    left: 2px;
    width: 8px;
    border-top: 1px solid currentColor;
    content: "";
  }

  body[data-page="catalog"] .sidebar-head {
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8eded;
  }

  body[data-page="catalog"] .sidebar-head::before {
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    content: "更多分类";
  }

  body[data-page="catalog"] .catalog-sidebar .brand {
    display: none;
  }

  body[data-page="catalog"] .catalog-sidebar .brand-mark {
    width: 34px;
    height: 34px;
  }

  body[data-page="catalog"] .catalog-sidebar .brand > span:last-child {
    display: block;
    width: auto;
    min-width: 0;
  }

  body[data-page="catalog"] .catalog-sidebar .brand strong {
    font-size: 14px;
    line-height: 1.35;
  }

  body[data-page="catalog"] .catalog-sidebar .brand small {
    display: block;
    margin-top: 1px;
    font-size: 10px;
    line-height: 1.35;
  }

  body[data-page="catalog"] .sidebar-content {
    gap: 18px;
    overflow-y: auto;
  }

  body[data-page="catalog"] .catalog-sidebar .classification-groups {
    gap: 17px;
  }

  body[data-page="catalog"] .catalog-sidebar .classification-row {
    gap: 6px;
  }

  body[data-page="catalog"] .catalog-sidebar [data-category-group="product-type"] {
    display: none;
  }

  body[data-page="catalog"] .catalog-sidebar [data-category-group="style"] {
    display: none;
  }

  body[data-page="catalog"] .catalog-sidebar .category-tabs {
    gap: 6px;
  }

  body[data-page="catalog"] .catalog-sidebar .category-tabs button {
    min-height: 29px;
    padding: 4px 9px;
    font-size: 11px;
  }

  body[data-page="catalog"] .floating-contact {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: auto;
    z-index: 52;
    width: auto;
    min-height: 44px;
    border-radius: 22px;
    padding: 0 18px;
    box-shadow: 0 10px 28px rgba(23, 42, 53, 0.2);
    font-size: 12px;
  }

  body[data-page="catalog"] .catalog-shell {
    width: calc(100% - 28px);
    padding-top: calc(var(--mobile-category-bottom, 221px) + 6px);
    padding-bottom: 72px;
  }

  body[data-page="catalog"] .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  body[data-page="catalog"] .product-card {
    display: grid;
    grid-template-columns: clamp(104px, 28vw, 126px) minmax(0, 1fr);
    min-height: 110px;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #e9eeee;
  }

  body[data-page="catalog"] .product-media {
    align-self: center;
  }

  body[data-page="catalog"] .product-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
  }

  body[data-page="catalog"] .product-info {
    align-content: center;
    gap: 9px;
    padding: 0;
  }

  body[data-page="catalog"] .product-title {
    gap: 8px;
  }

  body[data-page="catalog"] .product-title h3,
  body[data-page="catalog"] .product-title strong {
    font-size: 13px;
  }

  body[data-page="catalog"] .product-title > div > span {
    font-size: 10px;
  }

  body[data-page="catalog"] .product-title h3 {
    margin-bottom: 5px;
    font-size: 14px;
  }

  body[data-page="catalog"] .product-title strong {
    color: #2f6869;
    white-space: nowrap;
  }

  body[data-page="catalog"] .product-supply {
    display: grid;
    gap: 5px;
    line-height: 1.45;
  }

  body[data-page="catalog"] .product-supply-primary {
    color: #445b63;
    font-size: 10px;
    font-weight: 600;
  }

  body[data-page="catalog"] .product-supply-secondary {
    color: #8a9599;
    font-size: 9px;
    font-weight: 400;
  }

  body[data-page="catalog"] .product-supply-secondary span + span::before {
    margin: 0 6px;
  }
}

/* Admin operations center */
body[data-page="admin"] {
  --admin-blue: #3157d5;
  --admin-blue-dark: #2447bd;
  --admin-ink: #182033;
  --admin-muted: #748096;
  --admin-line: #e7eaf0;
  --admin-canvas: #f6f7fb;
  min-width: 320px;
  background: var(--admin-canvas);
  color: var(--admin-ink);
}

body[data-page="admin"] .admin-app {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

body[data-page="admin"] .admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 236px;
  flex-direction: column;
  padding: 24px 16px 18px;
  color: #dfe5f2;
  background: #172033;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

body[data-page="admin"] .admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 27px;
}

body[data-page="admin"] .admin-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #5a78eb, #3157d5);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(49, 87, 213, 0.28);
  font-weight: 800;
}

body[data-page="admin"] .admin-brand strong,
body[data-page="admin"] .admin-brand small,
body[data-page="admin"] .admin-sidebar-foot strong,
body[data-page="admin"] .admin-sidebar-foot small {
  display: block;
}

body[data-page="admin"] .admin-brand strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.02em;
}

body[data-page="admin"] .admin-brand small {
  margin-top: 3px;
  color: #76839d;
  font-size: 9px;
  letter-spacing: 0.13em;
}

body[data-page="admin"] .admin-nav-group {
  flex: 1;
}

body[data-page="admin"] .admin-nav-label {
  display: block;
  padding: 0 12px 9px;
  color: #69768f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

body[data-page="admin"] .admin-nav {
  display: grid;
  gap: 5px;
}

body[data-page="admin"] .admin-nav button {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  color: #98a5ba;
  background: transparent;
  text-align: left;
  transition: color 0.16s ease, background 0.16s ease;
}

body[data-page="admin"] .admin-nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

body[data-page="admin"] .admin-nav button.active {
  color: #fff;
  background: #3157d5;
  box-shadow: 0 8px 20px rgba(21, 47, 132, 0.25);
}

body[data-page="admin"] .admin-nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 16px;
}

body[data-page="admin"] .admin-nav button > span:nth-child(2) {
  font-size: 13px;
  font-weight: 600;
}

body[data-page="admin"] .admin-nav button small {
  display: grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  color: inherit;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  font-size: 10px;
}

body[data-page="admin"] .admin-sidebar-foot {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page="admin"] .admin-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #dfe6ff;
  background: #283650;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

body[data-page="admin"] .admin-sidebar-foot strong {
  color: #edf1f8;
  font-size: 12px;
}

body[data-page="admin"] .admin-sidebar-foot small {
  margin-top: 3px;
  color: #748099;
  font-size: 10px;
}

body[data-page="admin"] .admin-sidebar-foot a {
  color: #78859d;
  font-size: 16px;
}

body[data-page="admin"] .admin-workspace {
  grid-column: 2;
  min-width: 0;
}

body[data-page="admin"] .admin-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px clamp(22px, 3vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--admin-line);
  backdrop-filter: blur(12px);
}

body[data-page="admin"] .admin-topbar > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
}

body[data-page="admin"] .admin-topbar p {
  grid-column: 2;
  margin: 0 0 2px;
  color: #9aa3b3;
  font-size: 10px;
}

body[data-page="admin"] .admin-topbar h1 {
  grid-column: 2;
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

body[data-page="admin"] .admin-menu-button {
  display: none;
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: var(--admin-ink);
  background: #fff;
}

body[data-page="admin"] .admin-top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

body[data-page="admin"] .sync-state {
  color: #8a94a5;
  font-size: 11px;
}

body[data-page="admin"] .sync-state i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: #35b878;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #e6f7ef;
}

body[data-page="admin"] .admin-top-actions a {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  padding: 9px 12px;
  color: #44506a;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="admin"] .admin-top-actions a span {
  margin-left: 6px;
  color: #9ca5b5;
}

body[data-page="admin"] .admin-content {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 30px clamp(22px, 3vw, 42px) 56px;
}

body[data-page="admin"] .admin-view {
  display: none;
}

body[data-page="admin"] .admin-view.active {
  display: block;
  animation: admin-fade-in 0.2s ease;
}

@keyframes admin-fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

body[data-page="admin"] .overview-hero,
body[data-page="admin"] .section-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

body[data-page="admin"] .overview-hero {
  min-height: 116px;
  margin-bottom: 22px;
  padding: 24px 28px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 10%, rgba(115, 145, 255, 0.28), transparent 25%),
    linear-gradient(120deg, #263d89, #3157d5 65%, #5071e5);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(49, 87, 213, 0.14);
}

body[data-page="admin"] .eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #97aaff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

body[data-page="admin"] .overview-hero h2 {
  margin: 0 0 7px;
  font-size: clamp(19px, 2.1vw, 26px);
}

body[data-page="admin"] .overview-hero p {
  margin: 0;
  color: #d3dcff;
  font-size: 12px;
}

body[data-page="admin"] .overview-hero .primary-button {
  flex: 0 0 auto;
  color: #2949b1;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 44, 112, 0.18);
}

body[data-page="admin"] .primary-button,
body[data-page="admin"] .ghost-button {
  min-height: 39px;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 700;
}

body[data-page="admin"] .primary-button {
  border: 0;
  color: #fff;
  background: var(--admin-blue);
}

body[data-page="admin"] .primary-button:hover {
  background: var(--admin-blue-dark);
}

body[data-page="admin"] .ghost-button {
  border: 1px solid var(--admin-line);
  color: #59657a;
  background: #fff;
}

body[data-page="admin"] .admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

body[data-page="admin"] .admin-stats article {
  display: grid;
  grid-template-columns: 43px 1fr;
  gap: 13px;
  align-items: start;
  min-width: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(25, 36, 64, 0.025);
}

body[data-page="admin"] .stat-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
}

body[data-page="admin"] .stat-icon-blue { color: #3157d5; background: #eef1ff; }
body[data-page="admin"] .stat-icon-green { color: #269b68; background: #eaf8f1; }
body[data-page="admin"] .stat-icon-orange { color: #dc852c; background: #fff4e8; }
body[data-page="admin"] .stat-icon-violet { color: #8759c9; background: #f4edff; }

body[data-page="admin"] .admin-stats small,
body[data-page="admin"] .admin-stats strong {
  display: block;
}

body[data-page="admin"] .admin-stats small {
  margin-bottom: 5px;
  color: var(--admin-muted);
  font-size: 11px;
}

body[data-page="admin"] .admin-stats strong {
  color: var(--admin-ink);
  font-size: 26px;
  line-height: 1.1;
}

body[data-page="admin"] .admin-stats p {
  margin: 6px 0 0;
  color: #a0a8b5;
  font-size: 9px;
}

body[data-page="admin"] .overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
}

body[data-page="admin"] .overview-panel {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
}

body[data-page="admin"] .panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eef0f4;
}

body[data-page="admin"] .panel-title h3,
body[data-page="admin"] .section-intro h2,
body[data-page="admin"] .form-card-title h3 {
  margin: 0;
  font-size: 15px;
}

body[data-page="admin"] .panel-title p,
body[data-page="admin"] .section-intro p,
body[data-page="admin"] .form-card-title p {
  margin: 5px 0 0;
  color: var(--admin-muted);
  font-size: 11px;
}

body[data-page="admin"] .panel-title button {
  border: 0;
  padding: 4px;
  color: var(--admin-blue);
  background: transparent;
  font-size: 11px;
}

body[data-page="admin"] .publish-chart {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 7vw, 80px);
}

body[data-page="admin"] .donut-chart {
  display: grid;
  width: 122px;
  height: 122px;
  place-content: center;
  background: conic-gradient(var(--admin-blue) var(--publish-rate, 0%), #e9ecf3 0);
  border-radius: 50%;
  text-align: center;
}

body[data-page="admin"] .donut-chart::before {
  position: absolute;
  content: "";
}

body[data-page="admin"] .donut-chart span,
body[data-page="admin"] .donut-chart small {
  position: relative;
  z-index: 1;
}

body[data-page="admin"] .donut-chart span {
  font-size: 20px;
  font-weight: 800;
}

body[data-page="admin"] .donut-chart small {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 9px;
}

body[data-page="admin"] .donut-chart {
  position: relative;
}

body[data-page="admin"] .donut-chart::after {
  position: absolute;
  inset: 14px;
  background: #fff;
  border-radius: 50%;
  content: "";
}

body[data-page="admin"] .chart-legend {
  display: grid;
  gap: 14px;
  min-width: 130px;
}

body[data-page="admin"] .chart-legend span {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--admin-muted);
  font-size: 11px;
}

body[data-page="admin"] .chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

body[data-page="admin"] .legend-published { background: var(--admin-blue); }
body[data-page="admin"] .legend-draft { background: #dfe3ec; }
body[data-page="admin"] .chart-legend strong { color: var(--admin-ink); }

body[data-page="admin"] .quick-actions {
  display: grid;
  gap: 9px;
  padding-top: 15px;
}

body[data-page="admin"] .quick-actions button {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 1px 11px;
  align-items: center;
  border: 1px solid #eceef3;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--admin-ink);
  background: #fafbfc;
  text-align: left;
}

body[data-page="admin"] .quick-actions button:hover {
  border-color: #cfd7f3;
  background: #f7f8ff;
}

body[data-page="admin"] .quick-actions button > span {
  display: grid;
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--admin-blue);
  background: #edf1ff;
  border-radius: 8px;
  font-size: 16px;
}

body[data-page="admin"] .quick-actions strong {
  font-size: 11px;
}

body[data-page="admin"] .quick-actions small {
  color: var(--admin-muted);
  font-size: 9px;
}

body[data-page="admin"] .section-intro {
  margin-bottom: 20px;
}

body[data-page="admin"] .section-intro h2 {
  font-size: 22px;
}

body[data-page="admin"] .section-intro p {
  font-size: 12px;
}

body[data-page="admin"] .admin-list-panel,
body[data-page="admin"] .category-admin-panel,
body[data-page="admin"] .contact-admin-panel {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
}

body[data-page="admin"] .admin-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

body[data-page="admin"] .admin-search-field {
  position: relative;
  flex: 1;
}

body[data-page="admin"] .admin-search-field i {
  position: absolute;
  top: 50%;
  left: 13px;
  color: #9ba4b3;
  font-style: normal;
  transform: translateY(-50%);
}

body[data-page="admin"] input,
body[data-page="admin"] select,
body[data-page="admin"] textarea {
  border-color: #dfe3ea;
  border-radius: 8px;
  color: var(--admin-ink);
  background: #fff;
  font-size: 12px;
}

body[data-page="admin"] input:focus,
body[data-page="admin"] select:focus,
body[data-page="admin"] textarea:focus {
  border-color: #7c94e7;
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.09);
}

body[data-page="admin"] .admin-search-field input {
  min-height: 40px;
  padding-left: 36px;
  background: #f8f9fb;
}

body[data-page="admin"] .admin-table-head,
body[data-page="admin"] .admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 190px;
  gap: 14px;
  align-items: center;
}

body[data-page="admin"] .admin-table-head {
  padding: 9px 12px;
  color: #9aa3b1;
  background: #f7f8fa;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
}

body[data-page="admin"] .admin-table-head span:nth-child(2),
body[data-page="admin"] .admin-table-head span:nth-child(3) {
  text-align: center;
}

body[data-page="admin"] .admin-table {
  display: grid;
}

body[data-page="admin"] .admin-row {
  grid-template-columns: 60px minmax(0, 1fr) 86px 190px;
  border: 0;
  border-bottom: 1px solid #eef0f4;
  border-radius: 0;
  padding: 13px 12px;
}

body[data-page="admin"] .admin-row:last-child {
  border-bottom: 0;
}

body[data-page="admin"] .admin-row img {
  width: 60px;
  height: 48px;
  border-radius: 7px;
}

body[data-page="admin"] .admin-row strong {
  font-size: 12px;
}

body[data-page="admin"] .admin-row span {
  overflow: hidden;
  margin-top: 5px;
  color: #8b95a5;
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
}

body[data-page="admin"] .status {
  justify-self: center;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 9px;
}

body[data-page="admin"] .status.on { color: #24865c; background: #e9f7f0; }
body[data-page="admin"] .status.off { color: #a16b23; background: #fff4e5; }

body[data-page="admin"] .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

body[data-page="admin"] .row-actions button {
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  padding: 6px 9px;
  color: #68748a;
  background: #fff;
  font-size: 9px;
}

body[data-page="admin"] .row-actions button[data-action="edit"] {
  color: var(--admin-blue);
  border-color: #d8dff8;
  background: #f6f8ff;
}

body[data-page="admin"] .row-actions button[data-action="delete"] {
  color: #b35d62;
}

body[data-page="admin"] .product-form {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  display: grid;
  width: min(640px, 92vw);
  height: 100vh;
  align-content: start;
  gap: 0;
  overflow-y: auto;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: -20px 0 50px rgba(22, 32, 55, 0.15);
  transform: translateX(105%);
  transition: transform 0.24s ease;
}

body[data-page="admin"].product-editor-open {
  overflow: hidden;
}

body[data-page="admin"].product-editor-open .product-form {
  transform: translateX(0);
}

body[data-page="admin"] .drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  background: rgba(19, 28, 48, 0.34);
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

body[data-page="admin"].product-editor-open .drawer-backdrop {
  visibility: visible;
  opacity: 1;
}

body[data-page="admin"] .product-form .form-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 17px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--admin-line);
  backdrop-filter: blur(10px);
}

body[data-page="admin"] .product-form .form-head h2 {
  margin: 0;
  font-size: 19px;
}

body[data-page="admin"] .product-form .form-head .eyebrow {
  margin-bottom: 4px;
  color: var(--admin-blue);
}

body[data-page="admin"] .form-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: #778196;
  background: #fff;
  font-size: 20px;
}

body[data-page="admin"] .form-section {
  display: grid;
  gap: 12px;
  padding: 19px 24px;
  border-bottom: 1px solid #eef0f4;
}

body[data-page="admin"] .form-section h3 {
  margin: 0 0 2px;
  font-size: 12px;
}

body[data-page="admin"] label {
  gap: 6px;
}

body[data-page="admin"] label > span,
body[data-page="admin"] .product-classification-row > span {
  color: #707b8f;
  font-size: 10px;
  font-weight: 600;
}

body[data-page="admin"] .product-classification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-page="admin"] .product-classification-head > span {
  color: #707b8f;
  font-size: 10px;
  font-weight: 700;
}

body[data-page="admin"] .product-classification-head > button {
  border: 0;
  padding: 3px 0;
  color: var(--admin-blue);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

body[data-page="admin"] .inline-category-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  padding: 8px;
  background: #f6f8ff;
  border: 1px solid #dce3fa;
  border-radius: 8px;
}

body[data-page="admin"] .inline-category-form input {
  min-height: 32px;
  padding-block: 6px;
}

body[data-page="admin"] .inline-category-form button {
  border: 1px solid #d5dcf4;
  border-radius: 6px;
  padding: 0 9px;
  color: #657089;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}

body[data-page="admin"] .inline-category-form button[type="submit"] {
  color: #fff;
  background: var(--admin-blue);
  border-color: var(--admin-blue);
}

body[data-page="admin"] .two-cols,
body[data-page="admin"] .four-cols {
  display: grid;
  gap: 11px;
}

body[data-page="admin"] .two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-page="admin"] .four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }

body[data-page="admin"] .product-category-picker {
  border-color: #e1e5ec;
  border-radius: 9px;
  padding: 12px;
}

body[data-page="admin"] .product-category-picker legend {
  color: #707b8f;
  font-size: 10px;
}

body[data-page="admin"] .admin-category-options button {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 10px;
}

body[data-page="admin"] .admin-category-options button.active {
  background: var(--admin-blue);
  border-color: var(--admin-blue);
}

body[data-page="admin"] .admin-category-options.secondary button {
  color: #536690;
  background: #f5f7fc;
  border-color: #e0e5f0;
}

body[data-page="admin"] .admin-category-options.secondary button.active {
  color: #fff;
  background: #6078c7;
  border-color: #6078c7;
}

body[data-page="admin"] .product-upload-field {
  position: relative;
  min-height: 76px;
  align-content: center;
  padding: 12px;
  background: #f8f9fb;
  border: 1px dashed #cfd5df;
  border-radius: 9px;
}

body[data-page="admin"] .product-upload-field input[type="file"] {
  padding: 7px;
  background: #fff;
}

body[data-page="admin"] .product-upload-field small {
  color: #929cad;
  font-size: 9px;
}

body[data-page="admin"] .product-flags {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 24px;
}

body[data-page="admin"] .product-flags .check-row {
  min-height: 40px;
  border-color: #e4e7ed;
  background: #f8f9fb;
}

body[data-page="admin"] .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--admin-line);
  backdrop-filter: blur(10px);
}

body[data-page="admin"] .form-actions button {
  min-width: 88px;
}

body[data-page="admin"] .add-category-form {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto;
  gap: 8px;
}

body[data-page="admin"] .category-admin-panel {
  padding: 8px 18px;
}

body[data-page="admin"] .category-manager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 10px 0;
}

body[data-page="admin"] .category-manager-row {
  padding: 15px;
  background: #fafbfc;
  border-color: #e8eaf0;
  border-radius: 10px;
}

body[data-page="admin"] .managed-major button,
body[data-page="admin"] .managed-subcategory button,
body[data-page="admin"] .add-subcategory-form button {
  border-color: #e0e4eb;
  color: #647086;
  font-size: 10px;
}

body[data-page="admin"] .contact-admin-panel {
  padding: 0;
  overflow: hidden;
}

body[data-page="admin"] .contact-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(270px, 0.9fr);
  gap: 0;
  padding: 0;
}

body[data-page="admin"] .contact-fields {
  display: grid;
  gap: 15px;
  padding: 28px;
}

body[data-page="admin"] .form-card-title {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 17px;
  border-bottom: 1px solid #eef0f4;
}

body[data-page="admin"] .form-card-title > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--admin-blue);
  background: #edf1ff;
  border-radius: 9px;
}

body[data-page="admin"] .upload-field {
  padding: 12px;
  background: #f8f9fb;
  border: 1px dashed #cfd5df;
  border-radius: 9px;
}

body[data-page="admin"] .contact-preview-wrap {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 460px;
  padding: 30px;
  background: #f4f6fb;
  border-left: 1px solid var(--admin-line);
}

body[data-page="admin"] .contact-preview-wrap > .eyebrow {
  color: #8b96aa;
}

body[data-page="admin"] .contact-preview {
  display: grid;
  width: min(100%, 300px);
  justify-items: center;
  padding: 26px;
  background: #fff;
  border: 1px solid #e2e6ef;
  border-radius: 14px;
  box-shadow: 0 15px 34px rgba(31, 43, 75, 0.09);
  text-align: center;
}

body[data-page="admin"] .contact-preview .qr-box {
  width: 140px;
  height: 140px;
  margin-bottom: 18px;
  border-radius: 10px;
}

body[data-page="admin"] .contact-preview strong {
  margin-bottom: 8px;
  font-size: 14px;
}

body[data-page="admin"] .contact-preview p {
  max-width: 230px;
  margin-bottom: 12px;
  color: #7c879a;
  font-size: 11px;
}

body[data-page="admin"] .contact-preview > span {
  color: var(--admin-blue);
  font-size: 10px;
}

@media (max-width: 1060px) {
  body[data-page="admin"] .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="admin"] .overview-grid,
  body[data-page="admin"] .category-manager {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body[data-page="admin"] .admin-app {
    grid-template-columns: 1fr;
  }

  body[data-page="admin"] .admin-sidebar {
    width: min(270px, 84vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  body[data-page="admin"].admin-nav-open {
    overflow: hidden;
  }

  body[data-page="admin"].admin-nav-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(20, 28, 47, 0.22);
  }

  body[data-page="admin"] .admin-workspace {
    grid-column: 1;
  }

  body[data-page="admin"] .admin-menu-button {
    display: grid;
  }

  body[data-page="admin"] .sync-state {
    display: none;
  }

  body[data-page="admin"] .contact-admin-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="admin"] .contact-preview-wrap {
    min-height: 390px;
    border-top: 1px solid var(--admin-line);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  body[data-page="admin"] .admin-topbar {
    min-height: 68px;
    padding: 10px 14px;
  }

  body[data-page="admin"] .admin-top-actions a {
    padding: 9px;
    font-size: 0;
  }

  body[data-page="admin"] .admin-top-actions a span {
    margin: 0;
    font-size: 15px;
  }

  body[data-page="admin"] .admin-content {
    padding: 18px 12px 40px;
  }

  body[data-page="admin"] .overview-hero,
  body[data-page="admin"] .section-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="admin"] .overview-hero {
    padding: 22px;
  }

  body[data-page="admin"] .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body[data-page="admin"] .admin-stats article {
    grid-template-columns: 34px 1fr;
    gap: 9px;
    padding: 13px;
  }

  body[data-page="admin"] .stat-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  body[data-page="admin"] .admin-stats strong {
    font-size: 21px;
  }

  body[data-page="admin"] .admin-stats p {
    display: none;
  }

  body[data-page="admin"] .publish-chart {
    gap: 25px;
  }

  body[data-page="admin"] .admin-table-head {
    display: none;
  }

  body[data-page="admin"] .admin-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 2px;
  }

  body[data-page="admin"] .admin-row img {
    width: 52px;
    height: 44px;
  }

  body[data-page="admin"] .admin-row .status {
    grid-column: 3;
  }

  body[data-page="admin"] .row-actions {
    grid-column: 2 / -1;
  }

  body[data-page="admin"] .two-cols,
  body[data-page="admin"] .four-cols,
  body[data-page="admin"] .product-flags {
    grid-template-columns: 1fr;
  }

  body[data-page="admin"] .add-category-form {
    width: 100%;
    grid-template-columns: 1fr auto;
  }

  body[data-page="admin"] .inline-category-form {
    grid-template-columns: 1fr auto;
  }

  body[data-page="admin"] .inline-category-form button[data-cancel-category-add] {
    grid-column: 2;
  }

  body[data-page="admin"] .contact-fields,
  body[data-page="admin"] .contact-preview-wrap {
    padding: 20px;
  }
}
