:root {
  --bg-1: #eef2ff;
  --bg-2: #e0f2fe;
  --bg-3: #f5f3ff;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #4f46e5;
  --primary-d: #4338ca;
  --accent: #0ea5e9;
  --danger: #dc2626;
  --ok: #059669;
  --shadow: 0 10px 30px -12px rgba(30, 41, 59, 0.25);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-3), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, var(--bg-2), transparent 55%),
    linear-gradient(160deg, var(--bg-1), #f8fafc 60%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
  color: var(--ink);
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

h1.title {
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 700;
}
.sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

label.field {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

textarea, input[type="text"], input[type="number"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
textarea:focus, input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.row { margin-bottom: 18px; }

/* 数量步进器 */
.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.stepper input {
  width: 96px;
  text-align: center;
  border: none;
  border-radius: 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stepper input:focus { box-shadow: none; }
.stepper button {
  width: 48px;
  border: none;
  background: #f8fafc;
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.stepper button:hover { background: #eef2ff; }
.stepper button:active { background: #e0e7ff; }
.stepper button.left { border-right: 1.5px solid var(--line); }
.stepper button.right { border-left: 1.5px solid var(--line); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 15px 18px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.6);
  transition: transform .08s, box-shadow .15s, opacity .15s;
}
.btn:hover { box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.7); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { background: #f8fafc; }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

.err {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
  font-weight: 500;
}

/* 提交页：文字说明区 + 下半部分输入 */
.notice {
  background: linear-gradient(135deg, rgba(79,70,229,.06), rgba(14,165,233,.06));
  border: 1px solid rgba(79,70,229,.14);
  border-radius: var(--radius);
  padding: 22px 20px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
  font-size: 16px;
  box-shadow: var(--shadow);
}

.submit-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.submit-layout .top { padding: 30px 18px 10px; }
.submit-layout .bottom {
  margin-top: auto;
  padding: 24px 18px calc(28px + env(safe-area-inset-bottom));
}

.big-input {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 18px;
  font-variant-numeric: tabular-nums;
}

.msg-box {
  text-align: center;
  padding: 26px 20px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.msg-box .big { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.msg-box .small { color: var(--muted); font-size: 14px; }
.msg-box .countdown {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  margin-top: 10px;
  letter-spacing: 2px;
}
.msg-box .done-ico {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ok), #10b981);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px;
}

/* 结果页 */
.progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.progress .num { font-size: 22px; font-weight: 800; }
.progress .num span { color: var(--muted); font-weight: 600; font-size: 15px; }
.badge {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge.full { background: rgba(5,150,105,.12); color: var(--ok); }
.badge.wait { background: rgba(245,158,11,.14); color: #b45309; }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fbfcfe; }
.val { font-weight: 700; color: var(--primary); }

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 14px;
}

.link-box {
  background: #f8fafc;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.link-box .lbl { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.link-box .url {
  font-size: 13px; color: var(--ink); word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: #fff; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
}
.link-box .copy {
  margin-top: 8px;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (min-width: 560px) {
  .wrap { padding-top: 40px; }
}
