:root {
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #24392e;
  background: #f4f5ef;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  padding: 24px max(24px, calc((100vw - 1320px) / 2));
  background: #233c30;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header small {
  letter-spacing: 3px;
  color: #c6d8be;
}
h1 {
  margin: 8px 0;
  font-size: 26px;
}
h2 {
  font-size: 21px;
}
main {
  max-width: 1368px;
  padding: 20px 24px;
  margin: auto;
}
.panel {
  background: #fff;
  border: 1px solid #e1e5dc;
  border-radius: 14px;
  padding: 22px;
}
.narrow {
  max-width: 430px;
  margin: 60px auto;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input {
  flex: 1;
  min-width: 200px;
}
input,
select,
textarea,
button,
.file-button {
  font: inherit;
  border: 1px solid #cbd4c8;
  border-radius: 8px;
  padding: 10px 12px;
}
input,
select,
textarea {
  background: #fff;
  color: #24392e;
  max-width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #799d70;
}
button,
.file-button {
  cursor: pointer;
  background: #edf1e9;
  color: #24392e;
  white-space: nowrap;
}
.primary {
  background: #355c40;
  color: #fff;
  border-color: #355c40;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
label.file-button {
  margin: 0;
  display: block;
}
textarea {
  resize: vertical;
  line-height: 1.7;
}
form label input,
form label textarea {
  width: 100%;
}
.table-wrap {
  padding: 0;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: #eef2e9;
  font-weight: 600;
}
th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid #e8ece4;
}
td img {
  width: 100px;
  height: 64px;
  object-fit: contain;
  background: #f8f9f4;
  border-radius: 8px;
}
.muted {
  color: #798675;
  font-size: 13px;
  margin-top: 6px;
}
.pagination {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
dialog {
  width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 15px 80px #152a3344;
}
dialog::backdrop {
  background: #162c2366;
}
.dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.checkbox {
  flex-direction: row;
  align-items: center;
}
.checkbox input {
  width: auto;
}
#gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
#gallery figure {
  width: 170px;
  margin: 0;
  background: #f2f5ed;
  border-radius: 10px;
  padding: 8px;
}
#gallery img {
  width: 100%;
  height: 100px;
  object-fit: contain;
}
#gallery figcaption {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
#gallery button {
  font-size: 12px;
  padding: 6px;
}
.small-preview {
  width: 120px;
  height: 80px;
  object-fit: contain;
}
#message,
#editor-message {
  white-space: pre-wrap;
  color: #9b421e;
  line-height: 1.7;
}
#message:empty {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  main {
    padding: 12px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 18px;
  }
  th,
  td {
    padding: 10px;
  }
  .toolbar {
    padding: 14px;
  }
  h1 {
    font-size: 22px;
  }
}
