* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: #182230;
  background: #f6f7f9;
}

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

.app-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.home-header {
  margin: 12px 0 18px;
}

.home-header p {
  margin: 0 0 6px;
  color: #19784a;
  font-weight: 700;
}

.home-header h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
}

.home-header span {
  display: block;
  margin-top: 8px;
  color: #667085;
}

.smart-ticket-grid,
.find-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.smart-ticket-card,
.find-method-card,
.picker-option,
.product-option,
.order-card,
.stock-result,
.upload-panel {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
}

.smart-ticket-card,
.find-method-card,
.picker-option,
.product-option {
  min-height: 104px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.smart-ticket-card:hover,
.find-method-card:hover,
.picker-option:hover,
.product-option:hover {
  border-color: #19784a;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgb(16 24 40 / 8%);
}

.smart-ticket-card strong,
.smart-ticket-card span,
.smart-ticket-card small,
.find-method-card strong,
.find-method-card span,
.product-option strong,
.product-option span {
  display: block;
}

.smart-ticket-card span,
.find-method-card span,
.product-option span {
  margin-top: 8px;
  color: #667085;
  line-height: 1.5;
}

.smart-ticket-card small {
  margin-top: 12px;
  color: #19784a;
  font-weight: 700;
}

.smart-ticket-card.is-enabled {
  border-color: #19784a;
}

.smart-ticket-card.is-disabled {
  color: #667085;
}

.ticket-view {
  display: grid;
  gap: 16px;
}

.back-button,
.small-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

.back-button,
.small-button,
.secondary-button {
  background: #eef4f1;
  color: #19784a;
}

.primary-button {
  background: #19784a;
  color: #fff;
}

.advisor-bubble {
  width: min(680px, 100%);
  padding: 14px 16px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(16 24 40 / 7%);
  line-height: 1.7;
}

.flow-panel {
  margin-top: 4px;
}

.picker-panel,
.stock-result,
.upload-panel,
.order-card {
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2,
.order-card h2,
.upload-panel h2 {
  margin: 0;
  font-size: 20px;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.product-option {
  min-height: 86px;
}

.image-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.image-result-grid .product-option {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 112px;
}

.product-thumb {
  display: grid;
  place-items: center;
  width: 86px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #d0d5dd;
  background: #f2f4f7;
  color: #667085;
  font-size: 13px;
  cursor: zoom-in;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-summary {
  min-width: 0;
}

.product-summary strong,
.product-summary span,
.product-summary small {
  display: block;
}

.image-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(15 23 42 / 72%);
}

.image-preview-dialog {
  position: relative;
  width: min(860px, 100%);
  max-height: 88vh;
  display: grid;
  place-items: center;
}

.image-preview-dialog img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(0 0 0 / 35%);
}

.image-preview-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #182230;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgb(0 0 0 / 24%);
}

.product-summary {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.stock-result pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.8;
  font-family: inherit;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.order-card {
  display: grid;
  gap: 12px;
}

.guided-panel {
  padding: 16px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
}

.guided-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.order-summary {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-radius: 8px;
  background: #f8faf9;
  color: #344054;
}

.order-summary strong {
  color: #182230;
  font-size: 18px;
}

.order-summary small {
  color: #19784a;
  font-weight: 700;
}

.payment-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
}

.payment-panel h2 {
  margin: 0;
  font-size: 22px;
}

.payment-code {
  display: grid;
  place-items: center;
  width: min(220px, 100%);
  aspect-ratio: 1;
  border: 8px solid #182230;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #182230 12px, transparent 12px) 0 0 / 32px 32px,
    linear-gradient(#182230 12px, transparent 12px) 0 0 / 32px 32px,
    #fff;
  color: #19784a;
  font-weight: 800;
  letter-spacing: 0;
}

.progress-query-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
}

.order-card label,
.progress-query-form label {
  display: grid;
  gap: 6px;
  color: #344054;
}

.order-card input,
.upload-panel input,
.progress-query-form input,
.order-card select,
.order-card textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.order-card textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.discount-result,
.manager-connect {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
}

.discount-result h2,
.manager-connect h2 {
  margin: 0;
  font-size: 22px;
}

.discount-result strong,
.manager-connect strong {
  font-size: 20px;
}

.discount-result span,
.manager-connect span {
  color: #19784a;
  font-weight: 700;
}

.manager-qr {
  display: grid;
  place-items: center;
  width: min(220px, 100%);
  aspect-ratio: 1;
  border: 8px solid #19784a;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #19784a 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(#19784a 10px, transparent 10px) 0 0 / 28px 28px,
    #fff;
  color: #182230;
  font-weight: 800;
  letter-spacing: 0;
}

.progress-results {
  display: grid;
  gap: 16px;
}

.progress-group h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.progress-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.progress-card {
  padding: 14px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
}

.progress-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-card-head span {
  color: #19784a;
  font-weight: 700;
}

.progress-card p {
  margin: 8px 0 0;
  color: #667085;
}

.progress-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.progress-steps li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #98a2b3;
}

.progress-steps li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid currentColor;
}

.progress-steps li.is-done {
  color: #19784a;
}

.progress-steps span {
  font-size: 13px;
}

.message {
  border-radius: 8px;
  padding: 14px 16px;
  background: #eef4f1;
  color: #19784a;
}

.empty {
  color: #667085;
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .smart-ticket-grid,
  .find-method-grid,
  .progress-query-form {
    grid-template-columns: 1fr;
  }

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

  .product-thumb {
    width: 72px;
  }
}
