:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --surface: #ffffff;
  --surface-soft: #eef7f4;
  --ink: #10201f;
  --muted: #687775;
  --line: #dfe8e4;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --gold: #f4a51c;
  --coral: #e25543;
  --danger: #c93434;
  --shadow: 0 16px 42px rgba(16, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #dce5df;
}

body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 0%, rgba(244, 165, 28, 0.18), transparent 28%),
    linear-gradient(180deg, #eef4ef 0%, #dce5df 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 56px rgba(16, 32, 31, 0.18);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 10px;
  background: rgba(244, 247, 243, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--teal), #53b89e 52%, var(--gold));
  box-shadow: 0 8px 16px rgba(15, 118, 110, 0.24);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: #fff7e7;
  color: #8a4f00;
  font-size: 12px;
  font-weight: 700;
}

.auth-badge.ready {
  background: #e7f5ef;
  color: var(--teal-dark);
}

main {
  padding: 0 14px 28px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.14;
  font-weight: 850;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.hero-image.loaded {
  opacity: 1;
}

.package-panel,
.form-panel,
.query-panel {
  margin-top: 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(223, 232, 228, 0.9);
}

.package-panel,
.form-panel,
.query-panel {
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.section-title span {
  width: 5px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--teal), var(--gold));
}

.section-title h2 {
  font-size: 18px;
  line-height: 1.2;
}

.form-title {
  flex-wrap: wrap;
  column-gap: 8px;
}

.security-note {
  color: #7a3d2f;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.security-note strong {
  color: var(--danger);
}

.spec-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-list li {
  position: relative;
  padding-left: 24px;
  color: #33413f;
  font-size: 14px;
  line-height: 1.55;
}

.spec-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.query-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  align-items: end;
}

.query-btn {
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

.query-btn:disabled {
  background: #bac8c4;
}

.query-status {
  min-height: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.query-status.error {
  color: var(--danger);
}

.query-results {
  display: grid;
  gap: 8px;
}

.query-empty,
.query-order {
  margin-top: 2px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.query-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.query-order {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.query-order header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.query-order strong {
  min-width: 0;
  color: #263735;
  font-size: 14px;
  line-height: 1.35;
}

.order-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 8px;
  background: #edf2f0;
  color: #4a5a57;
  font-size: 12px;
  font-weight: 800;
}

.order-status.status-paid {
  background: #e7f5ef;
  color: var(--teal-dark);
}

.order-status.status-completed {
  background: #e7f5ef;
  color: #0f6b4e;
}

.order-status.status-paying {
  background: #fff7e7;
  color: #8a4f00;
}

.query-order p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

#orderForm {
  display: grid;
  gap: 7px;
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  color: #30403d;
  font-size: 14px;
  font-weight: 750;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(15, 118, 110, 0.68);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field em {
  min-height: 0;
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  line-height: 14px;
}

.field em:empty {
  display: none;
}

.agreement {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #41504d;
  font-size: 12px;
  line-height: 1.45;
}

.agreement input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.status-line {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.status-line.error {
  color: var(--danger);
}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.28);
}

.submit-btn span,
.submit-btn strong {
  font-size: 16px;
  font-weight: 800;
}

.submit-btn:disabled {
  background: #bac8c4;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 40;
  max-width: min(88vw, 380px);
  transform: translate(-50%, 16px);
  padding: 10px 13px;
  border-radius: 8px;
  background: rgba(16, 32, 31, 0.92);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.result-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(16, 32, 31, 0.42);
  padding: 18px;
}

.result-sheet.show {
  display: flex;
}

.sheet-panel {
  width: min(100%, 440px);
  padding: 24px 20px calc(env(safe-area-inset-bottom) + 20px);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.sheet-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e7f5ef;
  color: var(--teal);
  font-size: 28px;
  font-weight: 900;
}

.sheet-panel h2 {
  margin-top: 14px;
  font-size: 20px;
}

.sheet-panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.sheet-panel button {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

@media (max-width: 360px) {
  main {
    padding-left: 10px;
    padding-right: 10px;
  }

  h1 {
    font-size: 26px;
  }

  .query-form {
    grid-template-columns: 1fr;
  }
}
