/* 接码站：浅色、轻量、手机优先 —— 配色借门户，布局不照抄 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

:root {
  --blue: #1677ff;
  --blue-deep: #0958d9;
  --blue-soft: #e8f3ff;
  --blue-line: #bad6ff;
  --ink: #1a1f36;
  --sub: #5b6478;
  --mute: #8b93a7;
  --line: #e6ebf5;
  --bg: #f3f7ff;
  --surface: #ffffff;
  --ok: #0f9f6e;
  --ok-bg: #e8faf2;
  --err: #e5484d;
  --err-bg: #ffefef;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% -10%, #dcebff 0%, transparent 55%),
    linear-gradient(180deg, #f7faff 0%, var(--bg) 40%, #eef3fb 100%);
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(420px, 100%);
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top, 0px))
    20px
    calc(32px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100dvh;
  justify-content: center;
  animation: in 0.45s ease both;
}

@keyframes in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.intro {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(145deg, #3b8bff, var(--blue-deep));
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.28);
  margin-bottom: 4px;
}
.title {
  font-size: clamp(1.75rem, 6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.lead {
  font-size: 0.95rem;
  color: var(--sub);
  line-height: 1.5;
  max-width: 18em;
}

.stage {
  background: var(--surface);
  border: 1px solid rgba(22, 119, 255, 0.08);
  border-radius: 22px;
  padding: 18px 16px 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 40px rgba(26, 55, 110, 0.07);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #f0f4fb;
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  height: 40px;
  border-radius: 11px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.seg-btn.is-on {
  background: var(--surface);
  color: var(--blue-deep);
  box-shadow: 0 1px 3px rgba(26, 55, 110, 0.1);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-l {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: 0.02em;
}
.field-i {
  width: 100%;
  min-height: 88px;
  resize: none;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 14px 14px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field-i::placeholder { color: #b4bccf; }
.field-i:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.cta {
  appearance: none;
  border: 0;
  width: 100%;
  height: 52px;
  border-radius: 14px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #3b8bff 0%, var(--blue) 55%, var(--blue-deep) 100%);
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.28);
  transition: transform 0.12s, filter 0.12s, opacity 0.12s;
}
.cta:hover:not(:disabled) { filter: brightness(1.03); }
.cta:active:not(:disabled) { transform: translateY(1px); }
.cta:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--mute);
  line-height: 1.4;
}

.flash {
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

.code-panel {
  border-radius: 16px;
  padding: 16px;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  animation: in 0.3s ease both;
}
.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.code {
  font-family: var(--mono);
  font-size: clamp(1.7rem, 8vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--blue-deep);
  user-select: all;
  line-height: 1.2;
}
.copy {
  appearance: none;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--blue-line);
  background: #fff;
  color: var(--blue-deep);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.copy:active { background: var(--blue-soft); }
.meta {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--sub);
  word-break: break-all;
  line-height: 1.45;
}

/* 桌面端略放宽留白，仍保持窄栏阅读宽度 */
@media (min-width: 640px) {
  .page {
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .stage {
    padding: 22px 22px 18px;
    gap: 16px;
  }
  .field-i { min-height: 96px; }
}

@media (max-width: 360px) {
  .page { padding-left: 14px; padding-right: 14px; }
  .code { letter-spacing: 0.14em; }
}
