@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Noto+Serif+SC:wght@500;600&display=swap');

/* === 与 passingtrace-web 共享的设计 token === */
:root {
  color-scheme: light;
  --ink: #24231f;
  --paper: #f5f0e6;
  --red: #cf4a36;
  --sage: #5e6b55;
  --sand: #ebe5d9;
  --line: rgba(36, 35, 31, 0.17);
  color: var(--ink);
  background: var(--paper);
  font-family: 'DM Sans', system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

a { color: inherit; text-decoration: none; }

button,
a {
  font: inherit;
}

button { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(207, 74, 54, 0.32);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

/* === Brand 顶部 === */
.shell {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 56px 0 80px;
  position: relative;
}

.shell::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(207, 74, 54, 0.12);
  border-radius: 50%;
  left: -180px;
  top: 60px;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 36px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand::before {
  content: 'P';
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50% 50% 48% 44%;
  color: var(--paper);
  background: var(--red);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1;
}

/* === Card 主容器（与主站 callback-card 同款：1px 描边 + 18px sand 硬阴影） === */
.card {
  padding: clamp(32px, 6vw, 56px);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 18px 18px 0 var(--sand);
  position: relative;
}

.card.compact { padding: clamp(28px, 5vw, 48px); }

.eyebrow {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 580px;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.compact h1 { font-size: clamp(26px, 4vw, 34px); }

.lede {
  margin: 22px 0 32px;
  color: rgba(36, 35, 31, 0.66);
  font-size: 16px;
  line-height: 1.85;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* === Button 主站同构 === */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgba(36, 35, 31, 0.12);
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.full {
  width: 100%;
  margin-top: 28px;
}

.compact-button { min-height: 38px; padding: 0 17px; }

/* === Form === */
form { display: grid; }

label {
  margin: 20px 0 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(36, 35, 31, 0.62);
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}

input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(207, 74, 54, 0.16);
}

input[autofocus] { caret-color: var(--red); }

small {
  display: block;
  margin-top: 8px;
  color: rgba(36, 35, 31, 0.5);
  font-size: 12px;
}

.validation {
  margin-top: 6px;
  color: #7b2519;
  background: #f4d9d2;
  padding: 9px 12px;
  font-size: 13px;
}

.validation ul { margin: 0; padding-left: 18px; }

.footnote {
  margin: 28px 0 0;
  color: rgba(36, 35, 31, 0.5);
  font-size: 12px;
}

.metadata {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 13px;
  color: var(--red);
  border-bottom: 1px solid rgba(207, 74, 54, 0.5);
  padding-bottom: 3px;
}

.signed-in {
  color: rgba(36, 35, 31, 0.66);
  font-size: 15px;
  line-height: 1.6;
}

.actions .signed-in { margin: 0; }

/* === QR 码容器（米色融于 card，无任何描边） === */
.qr-code {
  display: grid;
  width: min(100%, 300px);
  margin: 32px auto 18px;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  border: 0;
}

.qr-code svg { display: block; width: 100%; height: auto; }

.qr-login .signed-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--red);
}

.qr-login .signed-in::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #7f9d6c;
  box-shadow: 0 0 0 4px rgba(127, 157, 108, 0.18);
  animation: qr-pulse 1.6s ease-in-out infinite;
}

@keyframes qr-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(127, 157, 108, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(127, 157, 108, 0.05); }
}

/* === Responsive === */
@media (max-width: 520px) {
  .shell { padding-top: 32px; }
  .card { box-shadow: 12px 12px 0 var(--sand); }
  h1 { font-size: 26px; }
  .lede { font-size: 15px; }
}
