:root {
  --bg: #f4efe6;
  --surface: rgba(255, 251, 244, 0.8);
  --surface-strong: rgba(255, 249, 240, 0.96);
  --line: rgba(62, 46, 32, 0.12);
  --line-strong: rgba(62, 46, 32, 0.22);
  --text: #20150d;
  --muted: #6a5745;
  --accent: #a63a24;
  --accent-deep: #7b1f11;
  --success: #1d6b4d;
  --danger: #ab3224;
  --shadow: 0 24px 80px rgba(77, 47, 18, 0.14);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(229, 181, 122, 0.38), transparent 34%),
    radial-gradient(circle at right 18%, rgba(140, 39, 19, 0.12), transparent 28%),
    linear-gradient(135deg, #efe3d0 0%, #f6f1e8 44%, #ede4d8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 32%, rgba(255, 255, 255, 0.28) 32% 34%, transparent 34% 100%),
    linear-gradient(295deg, transparent 0 66%, rgba(166, 58, 36, 0.07) 66% 68%, transparent 68% 100%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 14px 14px 28px;
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5) 0.5px, transparent 0.5px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(62, 46, 32, 0.08);
  animation: rise-in 0.8s ease-out both;
}

.hero::after {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.brand-logo {
  width: 132px;
  max-width: 38vw;
  height: auto;
  display: block;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  flex: 0 0 auto;
}

.brand-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.panel-heading h2,
.alert-copy h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: 1.36rem;
  line-height: 1.2;
  max-width: none;
  white-space: nowrap;
}

.panel {
  margin-top: 16px;
}

.panel-card,
.alert-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(77, 47, 18, 0.08);
}

.panel-card {
  padding: 18px 16px;
  animation: rise-in 0.85s ease-out 0.1s both;
}

.page-card {
  padding-top: 16px;
}

.panel-heading,
.field,
.agreement,
.captcha-row,
.form-message {
  animation: fade-up 0.55s ease-out both;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--muted);
}

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

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 0.96rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: rgba(166, 58, 36, 0.52);
  box-shadow: 0 0 0 5px rgba(166, 58, 36, 0.1);
  transform: translateY(-1px);
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: end;
}

.captcha-field {
  margin-bottom: 0;
}

.captcha-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(166, 58, 36, 0.2);
  border-radius: 14px;
  background: #fffaf5;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.captcha-box:hover {
  transform: translateY(-1px);
  border-color: rgba(166, 58, 36, 0.56);
}

.captcha-box canvas {
  display: block;
  width: 100%;
  height: 52px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.agreement {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.agreement input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.submit-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff9f2;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(166, 58, 36, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(166, 58, 36, 0.28);
}

.submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.64;
  box-shadow: none;
}

.form-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--success);
}

.result-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-value {
  margin: 12px 0 6px;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.result-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 21, 13, 0.48);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(92vw, 520px);
  margin: min(12vh, 88px) auto 0;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(165deg, rgba(255, 251, 245, 0.98), rgba(248, 238, 226, 0.96));
  box-shadow: 0 30px 80px rgba(32, 21, 13, 0.28);
  animation: rise-in 0.28s ease-out both;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(32, 21, 13, 0.08);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-description {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-result {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.modal-card-number {
  margin: 10px 0 8px;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  line-height: 1.1;
  color: var(--accent-deep);
}

.community-title {
  margin-top: 18px;
}

.modal-community {
  margin: 10px 0 8px;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.copy-btn,
.modal-confirm {
  height: 54px;
}

.copy-btn {
  border: 1px solid rgba(166, 58, 36, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent-deep);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(166, 58, 36, 0.48);
}

.alert-card {
  margin-top: 14px;
  animation: rise-in 0.85s ease-out 0.22s both;
}

.alert-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.alert-copy {
  padding: 12px;
}

.alert-copy p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.86rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 721px) {
  .page-shell {
    width: min(100% - 32px, 720px);
    padding: 24px 0 36px;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .panel-heading-row {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .panel-heading h2 {
    font-size: 1.02rem;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .hint {
    font-size: 0.66rem;
    text-align: right;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-logo {
    width: 104px;
    max-width: 30vw;
  }

  .brand {
    gap: 10px;
    align-items: center;
    flex-direction: row;
  }

  .hero h1 {
    font-size: 1.14rem;
  }

  .captcha-row {
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 8px;
  }

  .modal-panel {
    padding: 24px 18px 18px;
    margin-top: 8vh;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}
