* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5efe6;
  color: #162033;
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login {
  width: min(420px, calc(100vw - 32px));
  margin: 12vh auto;
  padding: 30px;
  border: 1px solid #efe6d9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(26, 21, 16, 0.08);
}

.login h1,
.panel h2 {
  margin: 0;
  color: #101827;
  font-size: 26px;
}

.login p {
  margin: 10px 0 22px;
  color: #6b7280;
}

.login input,
label input,
label select,
label textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font-weight: 500;
  outline: none;
  padding: 12px 14px;
}

.login input:focus,
label input:focus,
label select:focus,
label textarea:focus {
  border-color: #ff9500;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.14);
}

.login button,
.save,
.bar button {
  border: 0;
  border-radius: 8px;
  background: #ff9500;
  color: #fff;
  font-weight: 800;
  padding: 12px 18px;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

aside {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  background: #101827;
  color: #fff;
  padding: 24px 18px;
}

.brand {
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.brand p,
.topbar p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.nav {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7dee9;
  font-weight: 700;
  padding: 13px 14px;
  text-align: left;
}

.nav:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav.active {
  background: #ff9500;
  color: #fff;
}

.save {
  min-height: 46px;
  min-width: 148px;
}

.content {
  padding: 28px;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  max-width: 1040px;
  margin-bottom: 18px;
  border: 1px solid #efe6d9;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 18px 20px;
  box-shadow: 0 12px 28px rgba(40, 28, 14, 0.07);
  backdrop-filter: blur(12px);
}

.topbar h2 {
  margin: 0;
  color: #101827;
  font-size: 24px;
}

.panel {
  max-width: 1040px;
  border: 1px solid #efe6d9;
  border-radius: 8px;
  background: #fff;
  padding: 26px;
  box-shadow: 0 14px 40px rgba(40, 28, 14, 0.06);
}

.panel h2 {
  margin-bottom: 18px;
}

label {
  display: block;
  margin: 16px 0;
  color: #374151;
  font-weight: 800;
}

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

textarea.large {
  min-height: 230px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 16px;
}

.bar h3 {
  margin: 0;
  font-size: 22px;
}

#productsList,
#detailProductsList {
  display: grid;
  gap: 14px;
}

.product {
  border: 1px solid #e7e0d7;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.product[open] {
  border-color: #ffd19a;
  box-shadow: 0 10px 26px rgba(255, 149, 0, 0.08);
}

.product summary {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 14px;
}

.product summary::-webkit-details-marker {
  display: none;
}

.product summary::after {
  content: "展开";
  justify-self: end;
  border-radius: 999px;
  background: #fff4e5;
  color: #e67d00;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.product[open] summary::after {
  content: "收起";
}

.product summary span {
  display: grid;
  gap: 5px;
}

.product summary strong {
  color: #101827;
  font-size: 17px;
}

.product summary em {
  color: #4b5563;
  font-style: normal;
}

.product summary b {
  color: #ff2d20;
}

.product img {
  width: 82px;
  height: 82px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3eadc;
}

.product-editor {
  border-top: 1px solid #f0e7dd;
  background: #fffdf9;
  padding: 18px;
}

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

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.product-actions button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  padding: 11px 18px;
}

.danger {
  background: #ff3b30;
  color: #fff;
}

.small-save {
  min-width: 132px;
}

.module-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

input[type="file"] {
  background: #fff;
}

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

  aside {
    position: static;
    height: auto;
  }

  .content {
    padding: 18px;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .save {
    width: 100%;
  }

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

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

  .product summary::after {
    display: none;
  }
}
