:root {
  --background: #f4f7f1;
  --foreground: #172018;
  --muted: #667062;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(23, 32, 24, 0.12);
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --ink: #102015;
  --shadow: 0 24px 80px rgba(16, 32, 21, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.13), transparent 34rem),
    var(--background);
  color: var(--foreground);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, Helvetica, sans-serif;
  margin: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.site-shell,
.admin-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 32px 20px 56px;
}

.hero-card,
.board-card,
.login-card,
.admin-console,
.category-manager,
.announcement-manager,
.product-editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.announcement-card {
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(135deg, rgba(16, 32, 21, 0.96), rgba(21, 128, 61, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 28px;
  box-shadow: 0 18px 60px rgba(16, 32, 21, 0.18);
  color: white;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 18px;
  overflow: hidden;
  padding: 18px 22px;
  position: relative;
}

.announcement-card::after {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  content: "";
  height: 86px;
  position: absolute;
  right: -32px;
  top: -44px;
  width: 180px;
}

.announcement-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  gap: 8px;
  letter-spacing: 0.12em;
  padding: 9px 13px;
  text-transform: uppercase;
  white-space: nowrap;
}

.announcement-badge span {
  color: #bbf7d0;
  filter: drop-shadow(0 0 8px rgba(187, 247, 208, 0.55));
}

.announcement-card p {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.65;
  margin: 0;
  position: relative;
  z-index: 1;
}

.announcement-card small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
  position: relative;
  white-space: nowrap;
  z-index: 1;
}

.hero-card {
  background:
    radial-gradient(circle at top right, rgba(22, 163, 74, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 235, 0.96));
  padding: 42px;
}

.hero-grid {
  align-items: center;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
}

.eyebrow {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

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

h1 {
  color: var(--ink);
  font-size: clamp(2.35rem, 6vw, 5rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
  margin-bottom: 20px;
}

h2 {
  color: var(--ink);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  letter-spacing: -0.04em;
  margin-bottom: 0;
}

h3 {
  color: var(--ink);
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
  max-width: 680px;
}

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

.primary-action,
.secondary-action,
.row-actions button,
.upload-button,
.upload-actions button,
.status-tabs button,
.status-switcher button,
.category-strip button {
  align-items: center;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

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

.secondary-action,
.row-actions button,
.upload-button,
.upload-actions button,
.status-tabs button,
.status-switcher button,
.category-strip button {
  background: rgba(23, 32, 24, 0.08);
  color: var(--ink);
}

.primary-action:hover,
.secondary-action:hover,
.row-actions button:hover,
.upload-button:hover,
.upload-actions button:hover,
.status-tabs button:hover,
.status-switcher button:hover,
.category-strip button:hover {
  transform: translateY(-1px);
}

.full {
  width: 100%;
}

.signal-panel {
  background: rgba(16, 32, 21, 0.95);
  border-radius: 28px;
  color: white;
  padding: 26px;
}

.signal-row {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  gap: 18px;
  padding: 18px 0;
}

.signal-row:first-child {
  padding-top: 0;
}

.signal-row strong {
  display: block;
  font-size: 2.4rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.signal-row span:not(.traffic-light) {
  color: rgba(255, 255, 255, 0.74);
}

.traffic-light {
  background: var(--red);
  border-radius: 999px;
  box-shadow:
    0 0 0 6px rgba(220, 38, 38, 0.16),
    0 0 28px rgba(220, 38, 38, 0.5);
  display: inline-block;
  height: 26px;
  width: 26px;
}

.traffic-light.green,
.status-pill.in_stock .traffic-light,
.status-switcher .green .traffic-light {
  background: var(--green);
  box-shadow:
    0 0 0 6px rgba(22, 163, 74, 0.16),
    0 0 28px rgba(22, 163, 74, 0.5);
}

.traffic-light.red,
.status-pill.out_of_stock .traffic-light,
.status-switcher .red .traffic-light {
  background: var(--red);
}

.traffic-light.small {
  box-shadow:
    0 0 0 4px rgba(22, 163, 74, 0.16),
    0 0 16px rgba(22, 163, 74, 0.38);
  height: 12px;
  width: 12px;
}

.status-pill.out_of_stock .traffic-light.small,
.status-switcher .red .traffic-light.small {
  box-shadow:
    0 0 0 4px rgba(220, 38, 38, 0.14),
    0 0 16px rgba(220, 38, 38, 0.38);
}

.last-update {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.92rem;
  margin: 18px 0 0;
}

.board-card {
  margin-top: 24px;
  padding: 30px;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading > p,
.category-manager-head > p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
  max-width: 430px;
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 1fr) auto;
  margin-bottom: 18px;
}

.search-box,
.field-label,
.image-uploader,
.login-form label,
.product-editor label,
.category-create-grid label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 8px;
}

input,
select,
textarea {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  outline: none;
  padding: 14px 16px;
  width: 100%;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(22, 163, 74, 0.55);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-tabs button.active,
.category-strip button.active,
.status-switcher button.active {
  background: var(--ink);
  color: white;
}

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

.category-strip em {
  font-style: normal;
  margin-left: 7px;
  opacity: 0.62;
}

.category-group {
  margin-top: 28px;
}

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

.category-heading span {
  color: var(--muted);
  font-weight: 700;
}

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

.product-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 14px;
}

.product-media {
  align-items: center;
  background: white;
  border: 1px solid rgba(16, 32, 21, 0.11);
  border-radius: 18px;
  display: flex;
  height: 154px;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  position: relative;
}

.product-media img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.product-media.placeholder {
  background:
    radial-gradient(circle at 18% 10%, rgba(22, 163, 74, 0.15), transparent 38%),
    linear-gradient(135deg, #fbfdf9, #eef7ec);
  color: var(--muted);
  flex-direction: column;
  gap: 12px;
}

.box-visual {
  align-items: center;
  background: var(--green);
  border-radius: 18px;
  display: flex;
  height: 58px;
  justify-content: center;
  transform: rotate(-3deg);
  width: 74px;
}

.box-visual span {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  display: block;
  height: 10px;
  width: 42px;
}

.product-topline {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 900;
  gap: 8px;
  padding: 7px 10px;
}

.status-pill.in_stock {
  background: var(--green-soft);
  color: #117a39;
}

.status-pill.out_of_stock {
  background: var(--red-soft);
  color: var(--red);
}

.product-card h3 {
  display: -webkit-box;
  font-size: 1.04rem;
  line-height: 1.35;
  margin: 12px 0 8px;
  min-height: 2.7em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.color-line {
  align-self: flex-start;
  background: rgba(23, 32, 24, 0.07);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 0;
  padding: 7px 10px;
}

.note {
  color: var(--muted);
  display: -webkit-box;
  flex: 1;
  font-size: 0.86rem;
  line-height: 1.55;
  margin-top: 8px;
  min-height: 2.7em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.updated {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0;
  padding-top: 10px;
}

.empty-state {
  background: white;
  border: 1px dashed rgba(23, 32, 24, 0.22);
  border-radius: 24px;
  color: var(--muted);
  margin-top: 24px;
  padding: 28px;
  text-align: center;
}

.login-card {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  padding: 42px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.8;
}

.login-form {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 24px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.form-message,
.admin-message {
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 18px;
  color: #92400e;
  font-weight: 700;
  margin: 0;
  padding: 14px 16px;
}

.admin-console {
  padding: 30px;
}

.admin-header,
.category-manager-head {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

.admin-stats span {
  background: rgba(23, 32, 24, 0.07);
  border-radius: 999px;
  font-weight: 900;
  padding: 10px 14px;
}

.green-text {
  color: var(--green);
}

.red-text {
  color: var(--red);
}

.category-manager,
.announcement-manager,
.product-editor {
  box-shadow: none;
  margin-top: 20px;
  padding: 24px;
}

.announcement-manager-head {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.announcement-manager-head > p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
  max-width: 430px;
}

.announcement-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.announcement-form label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 8px;
}

.announcement-form textarea {
  min-height: 126px;
}

.toggle-line {
  align-items: center;
  background: rgba(23, 32, 24, 0.06);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex !important;
  gap: 10px !important;
  justify-content: flex-start;
  padding: 12px 14px;
}

.toggle-line input {
  accent-color: var(--green);
  height: 18px;
  width: 18px;
}

.announcement-form-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.announcement-form-footer small {
  color: var(--muted);
  font-weight: 700;
}

.category-create-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1.5fr;
  margin-top: 22px;
}

.category-create-grid form {
  background: rgba(244, 247, 241, 0.8);
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.category-tree {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.category-tree-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}

.category-tree-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.subcategory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.subcategory-list > span:not(.subcategory-chip),
.category-empty {
  color: var(--muted);
  margin: 0;
}

.subcategory-chip {
  align-items: center;
  background: rgba(23, 32, 24, 0.07);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  padding: 8px 10px 8px 14px;
}

.subcategory-chip button {
  background: white;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 5px 8px;
}

.editor-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.wide,
.image-uploader {
  grid-column: span 3;
}

.upload-panel {
  align-items: center;
  background: white;
  border: 1px dashed rgba(23, 32, 24, 0.22);
  border-radius: 22px;
  display: flex;
  height: 210px;
  justify-content: center;
  overflow: hidden;
}

.upload-panel img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.upload-placeholder {
  color: var(--muted);
  display: grid;
  gap: 6px;
  text-align: center;
}

.upload-placeholder strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-button {
  position: relative;
}

.upload-button input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.status-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-switcher button {
  gap: 9px;
}

.admin-table {
  border: 1px solid var(--line);
  border-radius: 24px;
  margin-top: 24px;
  overflow: hidden;
}

.admin-row {
  align-items: center;
  background: white;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 100px 70px 1.25fr 0.8fr 1fr 1fr 210px;
  padding: 14px 16px;
}

.admin-row.header {
  background: rgba(23, 32, 24, 0.06);
  border-top: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-row strong small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 4px;
}

.admin-thumb {
  align-items: center;
  background: #f6faf4;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  display: flex;
  font-size: 0.78rem;
  font-weight: 900;
  height: 54px;
  justify-content: center;
  overflow: hidden;
  width: 54px;
}

.admin-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

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

.row-actions button {
  font-size: 0.82rem;
  min-height: 34px;
  padding: 0 11px;
}

.danger {
  color: var(--red) !important;
}

@media (max-width: 980px) {
  .hero-grid,
  .login-card,
  .toolbar,
  .category-create-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .admin-header,
  .category-manager-head,
  .announcement-manager-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }

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

  .wide,
  .image-uploader {
    grid-column: span 1;
  }

  .admin-table {
    overflow-x: auto;
  }

  .admin-row {
    min-width: 980px;
  }
}

@media (max-width: 640px) {
  .site-shell,
  .admin-shell {
    padding: 18px 12px 36px;
  }

  .hero-card,
  .board-card,
  .login-card,
  .admin-console,
  .category-manager,
  .announcement-manager,
  .product-editor {
    border-radius: 24px;
    padding: 22px;
  }

  .announcement-card {
    align-items: start;
    gap: 10px;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .announcement-card p {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .announcement-card small {
    white-space: normal;
  }

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

  .product-card {
    border-radius: 18px;
    padding: 10px;
  }

  .product-media {
    border-radius: 15px;
    height: 112px;
    padding: 6px;
  }

  .product-media.placeholder {
    gap: 8px;
  }

  .product-media.placeholder small {
    font-size: 0.72rem;
  }

  .box-visual {
    border-radius: 14px;
    height: 42px;
    width: 54px;
  }

  .box-visual span {
    height: 7px;
    width: 30px;
  }

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

  .status-pill {
    font-size: 0.76rem;
    gap: 6px;
    padding: 5px 8px;
  }

  .traffic-light.small {
    height: 9px;
    width: 9px;
  }

  .product-card h3 {
    font-size: 0.88rem;
    letter-spacing: -0.03em;
    margin: 9px 0 7px;
    min-height: 2.4em;
  }

  .color-line {
    font-size: 0.74rem;
    padding: 5px 8px;
  }

  .note {
    font-size: 0.74rem;
    line-height: 1.45;
    margin-top: 7px;
    min-height: 2.15em;
  }

  .updated {
    font-size: 0.7rem;
    padding-top: 8px;
  }
}

@media (max-width: 380px) {
  .board-card {
    padding: 14px 10px;
  }

  .product-grid {
    gap: 8px;
  }

  .product-card {
    padding: 8px;
  }

  .product-media {
    height: 98px;
  }
}
