:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #eef3f0;
  color: #16312b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(235, 194, 90, .25), transparent 35%),
    linear-gradient(160deg, #f7faf8, #e7efeb);
}

.shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px 48px;
}

header { margin-bottom: 26px; }
h1 { margin: 0; font-size: clamp(32px, 9vw, 46px); letter-spacing: -.04em; }
header p:last-child { color: #60716c; line-height: 1.6; }

form, .result {
  padding: 22px;
  border: 1px solid rgba(22, 49, 43, .1);
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 18px 50px rgba(27, 58, 50, .1);
  backdrop-filter: blur(14px);
}

.recent-queries {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(22, 49, 43, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .76);
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title-row h2 {
  margin: 0;
  font-size: 18px;
}
.text-button {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #60716c;
  font-size: 13px;
  font-weight: 700;
}
.recent-list {
  display: grid;
  gap: 10px;
}
.recent-item {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #f5f8f6;
}
.recent-details {
  display: grid;
  gap: 4px;
}
.recent-details span,
.recent-details time {
  color: #60716c;
  font-size: 13px;
}
.recent-fill-button {
  min-height: 40px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
}

input, select, textarea, button {
  width: 100%;
  min-height: 50px;
  border-radius: 13px;
  font: inherit;
}

input, select, textarea {
  border: 1px solid #cbd7d2;
  padding: 0 14px;
  background: #fff;
  color: #16312b;
}

textarea {
  min-height: 118px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.45;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(30, 120, 94, .16);
  border-color: #1e785e;
}

button {
  border: 0;
  background: #163f34;
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:disabled { opacity: .55; cursor: wait; }
.quick-input,
.image-input {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #dfe8e3;
}
.quick-input h2,
.image-input h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.helper-text {
  margin: -4px 0 14px;
  color: #60716c;
  font-size: 13px;
  line-height: 1.5;
}
.file-picker {
  padding: 14px;
  border: 1px dashed #b7c8c1;
  border-radius: 16px;
  background: #f5f8f6;
  color: #163f34;
  text-align: center;
  cursor: pointer;
}
.file-picker input {
  min-height: 0;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.image-recognition-result {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.image-candidate {
  padding: 14px;
  border: 1px solid #d5e1dc;
  border-radius: 16px;
  background: #fff;
}
.image-candidate h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.image-candidate dl {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 7px 10px;
  margin: 0 0 12px;
  font-size: 14px;
}
.image-candidate dt {
  color: #60716c;
}
.image-candidate dd {
  margin: 0;
  font-weight: 700;
}
.surname-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.surname-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #d5e1dc;
  border-radius: 999px;
  background: #f5f8f6;
  font-size: 13px;
}
.surname-options input {
  width: auto;
  min-height: 0;
}
.candidate-warning {
  margin: 8px 0;
  color: #b06f16;
  font-size: 13px;
  line-height: 1.45;
}
.secondary-button {
  min-height: 46px;
  background: #e7efeb;
  color: #163f34;
}
.quick-input-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ghost-button {
  min-height: 46px;
  border: 1px solid #cbd7d2;
  background: #fff;
  color: #536762;
}
.quick-input-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: #60716c;
  font-size: 13px;
  line-height: 1.45;
}
.result { margin-top: 18px; }
.quote-result h2 { margin: 0 0 8px; font-size: 22px; }
.quote-message { margin: 0; color: #536762; line-height: 1.55; }
.quote-result--success { border-color: rgba(30, 120, 94, .3); }
.quote-result--empty { border-color: rgba(176, 111, 22, .35); }
.quote-result--error { border-color: rgba(171, 48, 48, .3); }
.segment-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #f5f8f6;
}
.segment-card h3 { margin: 0 0 10px; font-size: 16px; }
.price-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid #dfe8e3;
}
.price-row:first-of-type { border-top: 0; }
.price-values {
  display: grid;
  gap: 3px;
  text-align: right;
}
.official-price { color: #28493f; font-weight: 700; }
.cny-reference { color: #b06f16; font-size: 14px; }
.query-time {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid #dfe8e3;
  color: #71817c;
  font-size: 13px;
}
