* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6f7fb;
  color: #1f2430;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: #ffffff;
  border-bottom: 1px solid #e8eaf3;
}

.title {
  font-size: 20px;
  font-weight: 600;
}

.subtitle {
  font-size: 12px;
  color: #8b90a0;
  margin-top: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta {
  font-size: 12px;
  color: #6d7385;
}

.app-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 20px 28px 32px;
}

.panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(30, 35, 90, 0.06);
}

.panel-left {
  min-height: 600px;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.category-list li {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
}

.category-list li.active {
  background: #e6ecff;
  color: #2f4bd1;
  font-weight: 600;
}

.category-list li.muted {
  color: #a4a9b8;
  cursor: default;
}

.section-title {
  font-weight: 600;
  margin-bottom: 12px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #5d6275;
}

select,
input,
textarea {
  border: 1px solid #d9ddea;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #ffffff;
  color: #1f2430;
}

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

.input-block {
  margin-top: 16px;
}

.input-title {
  font-size: 12px;
  color: #5d6275;
  margin-bottom: 6px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}

.btn.primary {
  background: #2f4bd1;
  color: #fff;
}

.btn.ghost {
  background: #f1f3f9;
  color: #4a5164;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.loading {
  font-size: 12px;
  color: #2f4bd1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hidden {
  display: none;
}

.output-card {
  border: 1px solid #e2e6f2;
  border-radius: 12px;
  padding: 12px;
  background: #fbfbfe;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 8px;
}

.output-body {
  min-height: 120px;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px;
  border: 1px dashed #d9ddea;
  color: #2b2f3a;
  white-space: pre-wrap;
}

.output-footer {
  margin-top: 10px;
  font-size: 12px;
}

.label {
  color: #5d6275;
}

.muted {
  color: #8b90a0;
}

.price-card {
  background: #f3f5ff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.price-type {
  font-size: 12px;
  color: #5d6275;
}

.price-value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 6px;
}

.material-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.material-list li {
  background: #f7f8fc;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #4a5164;
}

.form-stack label + label {
  margin-top: 8px;
}

.tag-box {
  margin-top: 12px;
}

.tag-title {
  font-size: 12px;
  margin-bottom: 6px;
  color: #5d6275;
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #e2e6f2;
  border-radius: 8px;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: #f6f7fb;
  padding: 4px 8px;
  border-radius: 999px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2f4bd1;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(47, 75, 209, 0.2);
  font-size: 12px;
}

.page-loading {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 30, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.page-loading.hidden {
  display: none;
}

.page-loading-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 22px;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 12px 28px rgba(15, 18, 30, 0.18);
}

.page-loading-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2430;
}

.page-loading-sub {
  margin-top: 8px;
  font-size: 12px;
  color: #5d6275;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dots {
  display: inline-flex;
  gap: 4px;
}

.dots i {
  width: 6px;
  height: 6px;
  background: #2f4bd1;
  border-radius: 50%;
  display: inline-block;
  animation: dotPulse 1.2s infinite ease-in-out;
}

.dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.dots i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.small-text {
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 1200px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
  .panel-left {
    min-height: auto;
  }
}
