* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

:root {
  --text: #f3f6ff;
  --primary: #00d9f5;
  --purple: #a78bfa;
  --success: #10b981;
  --wait: #f59e0b;
  --danger: #ef4444;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(220px 220px at 4% 10%, rgba(255, 255, 255, 0.12), transparent 70%),
    radial-gradient(260px 260px at 98% 86%, rgba(255, 255, 255, 0.10), transparent 72%),
    radial-gradient(1400px 760px at 50% -22%, rgba(173, 190, 255, 0.18), transparent 64%),
    linear-gradient(180deg, #7a7be6 0%, #6f73e0 42%, #676dd9 100%);
  padding: 24px 14px 36px;
}

.page { width: 100%; max-width: 560px; margin: 0 auto; }

.brand { text-align: center; margin-bottom: 18px; }
.brand img {
  width: 108px;
  height: 108px;
  display: block;
  margin: 0 auto 12px;
  object-fit: cover;
  border-radius: 30px;
}
.brand h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: .6px;
}
.brand p { margin: 10px 0 0; font-size: 14px; color: #d7dfff; }

.panel {
  background: linear-gradient(180deg, rgba(247, 249, 255, 0.9) 0%, rgba(236, 241, 255, 0.92) 100%);
  border: 1px solid rgba(196, 206, 245, 0.85);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 34px rgba(41, 52, 104, 0.22), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 0;
}
.tab-btn {
  border: 1px solid #c8d2f6;
  border-radius: 999px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: #3f4f86;
  background: linear-gradient(135deg, rgba(241, 245, 255, 0.98) 0%, rgba(231, 237, 255, 0.98) 100%);
  transition: .2s ease;
}
.tab-btn.active {
  color: #0b2b31;
  border-color: transparent;
  background: linear-gradient(135deg, #7deaf8 0%, #b6f2ff 45%, #d7ccff 100%);
}

.content { padding: 16px; }
.section { display: none; }
.section.active { display: block; }

.stack { display: grid; gap: 14px; }
.field { margin-bottom: 2px; }
.field label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #4e5f96;
}

.input, .query-input, .code-input {
  width: 100%;
  border: 1px solid #ced8fb;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 255, 0.98) 100%);
  color: #344579;
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-size: 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  min-width: 0;
}
.input::placeholder, .query-input::placeholder, .code-input::placeholder { color: #9aa8d7; }
.input:focus, .query-input:focus, .code-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 217, 245, .18);
}

.phone-row, .query-row, .code-row { display: flex; gap: 10px; align-items: stretch; }
.phone-row .input, .query-row .query-input, .code-row .code-input { flex: 1; }

.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: #ffffff;
  white-space: nowrap;
  transition: .2s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #28d6ee 0%, #57e3f7 55%, #8f9df8 100%); }
.btn-success { background: linear-gradient(135deg, #1db986 0%, #4ccfa7 100%); }

.hint {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: #e4ebff;
  background: linear-gradient(135deg, rgba(50, 55, 104, 0.86) 0%, rgba(67, 71, 132, 0.86) 100%);
  border: 1px solid #7383e0;
  border-radius: var(--radius-md);
  padding: 12px 13px;
}

.message, #submit_msg, #query_msg {
  margin-top: 8px;
  min-height: 22px;
  font-size: 14px;
  color: #4e5f96;
  text-align: center;
  word-break: break-word;
}

.order-query-box {
  padding: 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 247, 255, 0.98) 100%);
  border: 1px solid #ced8fb;
}

.result-card {
  margin-top: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 255, 0.98) 100%);
  border: 1px solid #ced8fb;
  border-radius: var(--radius-lg);
  padding: 12px;
}
.result-card h3 { margin: 0 0 8px; font-size: 15px; color: #33457a; }
.result-card .line { font-size: 14px; line-height: 1.65; color: #4a5d95; word-break: break-word; }

.modal-mask {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 14, 38, .56);
  z-index: 9999;
}
.modal-mask.show { display: flex; }
.modal-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(52, 57, 110, 0.96) 0%, rgba(68, 74, 136, 0.96) 100%);
  border: 1px solid #8392ff;
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(7, 12, 36, .38);
}
.modal-title { margin: 0 0 10px; font-size: 20px; color: #65efff; }
.modal-text { margin: 0 0 12px; font-size: 15px; line-height: 1.7; color: #eef2ff; }
.modal-countdown { font-size: 14px; color: #d5dcff; }

@media (max-width: 520px) {
  body { padding: 12px 10px 24px; }
  .brand img { width: 92px; height: 92px; }
  .tabs { padding: 12px 12px 0; gap: 8px; }
  .content { padding: 12px; }
  .phone-row, .code-row, .query-row { flex-direction: column; }
  .btn { width: 100%; }
}
