:root {
  --ink: #172026;
  --muted: #65717c;
  --paper: #f8faf8;
  --warm: #e8f0ec;
  --sand: #c8d8d5;
  --sage: #dbe8df;
  --accent: #2f6f73;
  --accent-soft: #e2eff0;
  --line: rgba(23, 32, 38, 0.12);
  --white: #ffffff;
}

.image-batch-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.image-drop-zone {
  border: 2px dashed rgba(74, 94, 75, 0.45);
  border-radius: 8px;
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.image-drop-zone.is-dragging {
  border-color: #3f6f48;
  background: rgba(94, 130, 91, 0.12);
}

.image-drop-zone input {
  display: none;
}

.image-batch-list {
  display: grid;
  gap: 12px;
}

.image-batch-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(45, 45, 45, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.image-batch-thumb {
  width: 96px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #f2f2f2;
}

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

.image-batch-fields label {
  display: grid;
  gap: 4px;
  font-size: 0.86rem;
}

.image-batch-remove {
  min-width: 40px;
}

.catalog-editor {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.catalog-editor-row {
  display: grid;
  gap: 10px;
  padding: 10px 12px 10px calc(12px + (var(--depth, 0) * 18px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.catalog-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.catalog-editor-summary-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.catalog-editor-summary-text strong,
.catalog-editor-toggle,
.catalog-editor-summary-text span,
.catalog-editor-summary-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-editor-summary-text strong {
  font-size: 15px;
}

.catalog-editor-toggle {
  max-width: 100%;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.catalog-editor-toggle:hover {
  color: var(--accent);
}

.catalog-editor-toggle:disabled {
  cursor: default;
}

.catalog-editor-summary-text span,
.catalog-editor-summary-text small {
  color: var(--muted);
  font-size: 12px;
}

.catalog-editor-summary-text small {
  color: var(--accent);
}

.catalog-editor-edit {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.catalog-editor-children {
  display: grid;
  gap: 10px;
}

.catalog-editor-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.catalog-editor-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.catalog-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 760px) {
  .image-batch-controls,
  .image-batch-row,
  .image-batch-fields,
  .catalog-editor-fields {
    grid-template-columns: 1fr;
  }

  .catalog-editor-summary {
    align-items: start;
    flex-direction: column;
  }

  .catalog-editor-summary .catalog-editor-actions {
    width: 100%;
  }

  .image-batch-thumb {
    width: 100%;
    max-width: 180px;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(248, 250, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}

.header-contact {
  justify-self: end;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 32px;
  align-items: stretch;
  min-height: calc(100vh - 148px);
  padding: 56px 32px 42px;
  background: linear-gradient(90deg, var(--paper), var(--accent-soft));
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.75rem, 4rem, 5.25rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.button.primary {
  color: var(--white);
  background: var(--ink);
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.hero-image {
  display: grid;
  place-items: center;
  min-height: 420px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0)),
    var(--sand);
  color: #24494b;
  font-weight: 700;
  text-align: center;
}

.collection,
.contact {
  padding: 72px 32px;
}

.collection {
  background: var(--warm);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.12;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.category-tab {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}

.category-tab.active {
  color: var(--white);
  background: var(--ink);
}

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

.search-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.catalog-search {
  width: min(420px, 100%);
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.catalog-breadcrumb {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.catalog-tree {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.catalog-tree ul {
  margin: 6px 0 0;
  padding-left: 14px;
  list-style: none;
}

.catalog-tree li {
  margin-top: 6px;
}

.tree-button {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tree-button:hover,
.tree-button.active {
  color: var(--white);
  background: var(--ink);
}

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

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

.product-image {
  aspect-ratio: 4 / 5;
  background: var(--sage);
}

.product-image img,
.product-placeholder {
  width: 100%;
  height: 100%;
}

.product-image img {
  display: block;
  object-fit: cover;
}

.product-placeholder {
  display: grid;
  place-items: center;
  color: #53635a;
  font-weight: 700;
  text-align: center;
}

.product-info {
  padding: 15px;
}

.product-category {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.product-sku {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.product-info h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.25;
}

.product-info h3 span {
  display: block;
  margin-top: 3px;
  font-weight: 500;
}

.product-info p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-message {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.contact {
  color: var(--white);
  background: var(--ink);
}

.contact .eyebrow,
.contact .section-heading p {
  color: #cfd7dc;
}

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

.contact-card {
  min-height: 240px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.qr-placeholder {
  display: grid;
  place-items: center;
  width: 132px;
  aspect-ratio: 1;
  margin: 18px 0;
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font-weight: 700;
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.admin-page {
  background: var(--warm);
}

.admin-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.admin-panel {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.admin-login,
.admin-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.admin-login label,
.admin-upload-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.admin-upload-grid input {
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-status,
.admin-results {
  margin-top: 14px;
  color: var(--muted);
}

.admin-product-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.admin-product-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

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

@media (max-width: 760px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 20px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-contact {
    justify-self: start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 40px 20px 28px;
  }

  h1 {
    font-size: 2.75rem;
    line-height: 1.08;
  }

  .hero-text {
    font-size: 16px;
  }

  .hero-image {
    min-height: 320px;
  }

  .collection,
  .contact {
    padding: 52px 20px;
  }

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

  .catalog-toolbar {
    display: block;
  }

  .search-label {
    display: block;
    margin-bottom: 6px;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-tree {
    position: static;
    max-height: 260px;
  }

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

  .site-footer {
    flex-direction: column;
    padding: 22px 20px;
  }

  .admin-shell {
    padding: 20px;
  }

  .admin-login,
  .admin-upload-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
