:root {
  --bg: #f4f6fb;
  --text: #111827;
  --muted: #7c879d;
  --accent: #4256ff;
  --accent-soft: rgba(91, 108, 255, 0.1);
  --accent-mid: rgba(91, 108, 255, 0.2);
  --accent-strong: #5b6cff;
  --accent-end: #8a72ff;
  --gold: #ead386;
  --white: #ffffff;
  --lavender: #8f82f1;
  --line: rgba(110, 126, 196, 0.14);
  --input-bg: rgba(251, 252, 255, 0.88);
  --chip-bg: rgba(248, 250, 255, 0.88);
  --card-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 24px 80px rgba(23, 33, 71, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "SF Pro Display", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font: inherit;
  border: none;
  background: transparent;
  outline: none;
}

.hidden {
  display: none !important;
}

/* ========== 首页 ========== */
.page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 56px 16px 24px;
}

.ambient {
  position: absolute;
  z-index: 0;
  opacity: 0.85;
  border-radius: 999px;
  pointer-events: none;
}

.ambient-left {
  top: 24px;
  left: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(138, 114, 255, 0.26) 0%, rgba(138, 114, 255, 0) 72%);
}

.ambient-right {
  top: 160px;
  right: -70px;
  width: 210px;
  height: 210px;
  background: radial-gradient(circle, rgba(91, 108, 255, 0.2) 0%, rgba(91, 108, 255, 0) 72%);
}

.hero {
  position: relative;
  z-index: 1;
  margin-bottom: 17px;
}

.brand-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.brand {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(91, 108, 255, 0.1);
  color: #4a5eff;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-caption {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.title {
  display: block;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.06;
}

.title-accent {
  color: var(--accent);
  text-shadow: 0 6px 12px rgba(91, 108, 255, 0.12);
}

/* ========== 表单卡片 ========== */
.form-card {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 12px;
}

.field:last-of-type {
  margin-bottom: 0;
}

.field-head {
  display: flex;
  gap: 9px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.field-index {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(91, 108, 255, 0.1);
  color: #4256ff;
  font-size: 11px;
  font-weight: 600;
  line-height: 28px;
  text-align: center;
}

.field-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 28px;
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

/* ========== 选项芯片 ========== */
.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-chip {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--chip-bg);
  color: #4b5563;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
  white-space: nowrap;
}

.option-chip-active {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
  color: #4256ff;
  box-shadow: 0 6px 15px rgba(91, 108, 255, 0.14);
}

/* ========== 输入框 ========== */
.input, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input {
  height: 52px;
  padding: 0 15px;
}

.input:focus, .textarea:focus {
  border-color: rgba(91, 108, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.08);
}

.input::placeholder, .textarea::placeholder {
  color: #a2adc2;
}

.textarea {
  min-height: 75px;
  padding: 13px 15px;
  resize: vertical;
  line-height: 1.6;
}

.option-input {
  margin-top: 8px;
}

/* ========== 主按钮 ========== */
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  margin-top: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5b6cff 0%, #8a72ff 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 9px 18px rgba(91, 108, 255, 0.28);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(91, 108, 255, 0.32);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========== 加载遮罩 ========== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(244, 246, 251, 0.72);
  backdrop-filter: blur(4px);
}

.overlay-card {
  width: 100%;
  max-width: 320px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.overlay-title {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 600;
}

.overlay-copy {
  display: block;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.5;
}

/* ========== 结果页 ========== */
.result-page {
  --bg-top: #090b1a;
  --bg-mid: #12184f;
  --bg-bottom: #1432b5;
  --gold: #ead386;
  --white: #ffffff;
  --lavender: #8f82f1;
  --lavender-soft: rgba(149, 138, 228, 0.54);
  --line: rgba(255, 255, 255, 0.28);
  min-height: 100vh;
  padding: 13px 17px 22px;
  background:
    radial-gradient(circle at 82% 9%, rgba(126, 94, 255, 0.48) 0%, rgba(126, 94, 255, 0) 18%),
    linear-gradient(180deg, #090b1a 0%, #12184f 56%, #1432b5 100%);
  color: var(--white);
}

.result-page .hero {
  margin-top: 46px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: #d9defd;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.result-title {
  display: block;
  color: var(--white);
  font-size: 29px;
  line-height: 1.08;
  font-weight: 700;
}

/* ========== 海报卡片 ========== */
.poster-shell {
  position: relative;
  height: 474px;
  margin-top: 12px;
  border-radius: 21px;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 8%, rgba(134, 101, 255, 0.34) 0%, rgba(134, 101, 255, 0) 18%),
    linear-gradient(180deg, rgba(18, 17, 50, 0.62) 0%, rgba(18, 30, 102, 0.48) 54%, rgba(18, 47, 170, 0.62) 100%);
}

.poster-shell > * {
  position: absolute;
}

.poster-stack {
  overflow: hidden;
  border-radius: 17px;
}

.poster-stack-back {
  top: 42px;
  left: 89px;
  width: 223px;
  height: 312px;
  background: rgba(88, 88, 140, 0.18);
}

.poster-stack-front {
  top: 20px;
  left: 53px;
  width: 280px;
  height: 354px;
  background: rgba(24, 31, 106, 0.34);
}

.poster-stack-texture {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  object-fit: cover;
}

.poster-floor {
  left: 0;
  right: 0;
  bottom: 0;
  height: 108px;
  background-image:
    linear-gradient(rgba(133, 177, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 177, 255, 0.2) 1px, transparent 1px);
  background-size: 22px 22px;
}

.poster-floor-bars {
  height: 11px;
  background: rgba(176, 177, 255, 0.28);
}

.poster-floor-bars-a {
  left: 9px;
  bottom: 42px;
  width: 78px;
}

.poster-floor-bars-b {
  left: 13px;
  bottom: 22px;
  width: 82px;
}

.poster-orbit {
  right: -5px;
  bottom: 118px;
  width: 56px;
  height: 56px;
  border: 3px solid rgba(162, 132, 255, 0.48);
  border-radius: 50%;
}

.poster-card-shadow {
  left: 30px;
  top: 57px;
  width: 305px;
  height: 394px;
  border-radius: 17px;
  background: rgba(7, 6, 20, 0.46);
  filter: blur(3px);
}

.poster-card {
  left: 24px;
  top: 51px;
  width: 305px;
  height: 394px;
  border-radius: 17px;
  background: #04050a;
  box-shadow: 0 12px 26px rgba(2, 2, 12, 0.42);
  padding: 12px 10px 17px;
}

.poster-top {
  display: flex;
  align-items: center;
  padding: 0 10px 0 0;
}

.poster-dots {
  display: flex;
  gap: 4px;
}

.poster-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

.poster-top-line {
  flex: 1;
  height: 1px;
  margin-left: 8px;
  background: rgba(234, 211, 134, 0.26);
}

.poster-logo-row {
  display: flex;
  justify-content: flex-end;
  padding: 3px 12px 0 0;
}

.poster-logo {
  width: 107px;
  height: auto;
}

.poster-main {
  display: flex;
  gap: 17px;
  padding: 4px 17px 0 17px;
}

.poster-avatar-frame {
  width: 107px;
  padding-top: 16px;
}

.poster-avatar-border {
  width: 103px;
  height: 103px;
  padding: 4px;
  border: 4px solid #f1f1f2;
  background: rgba(255, 255, 255, 0.06);
}

.poster-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-meta {
  flex: 1;
  padding-top: 14px;
}

.poster-meta-group + .poster-meta-group {
  margin-top: 16px;
}

.poster-label, .poster-value, .poster-domain-text,
.poster-requirement-tag-text, .poster-requirement-text {
  display: block;
}

.poster-label {
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
}

.poster-value {
  margin-top: 7px;
  color: var(--white);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
  word-break: break-word;
}

.poster-domain-row {
  display: flex;
  align-items: center;
  padding: 11px 17px 0;
}

.poster-domain-label {
  width: 62px;
}

.poster-domain-pill {
  flex: 1;
  height: 28px;
  background: linear-gradient(90deg, #8f84e7 0%, #9488ef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-domain-text {
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
}

.poster-requirement {
  position: relative;
  padding: 12px 15px 0;
}

.poster-requirement-tag {
  position: absolute;
  left: 15px;
  top: 5px;
  width: 69px;
  height: 20px;
  display: flex;
  align-items: center;
  padding-left: 9px;
  background: rgba(142, 125, 230, 0.92);
}

.poster-requirement-tag-text {
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
}

.poster-requirement-box {
  min-height: 85px;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  background: rgba(118, 109, 157, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 17px 12px;
}

.poster-requirement-text {
  color: var(--white);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
  word-break: break-word;
}

.poster-cn-logo-row {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 10px;
}

.poster-cn-logo {
  width: 115px;
  height: auto;
}

/* ========== 社群卡片 ========== */
.community-card {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding: 14px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(6, 11, 33, 0.18);
}

.community-layout {
  display: flex;
  align-items: center;
  gap: 11px;
}

.qr-card {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  padding: 6px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 5px 13px rgba(17, 22, 44, 0.1);
}

.qr-image {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.community-copy {
  flex: 1;
}

.community-title {
  display: block;
  color: #1b2433;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
}

.community-line {
  display: block;
  margin-top: 4px;
  color: #5b6273;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 500;
}

/* ========== 按钮 ========== */
.action-row {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.secondary-button, .primary-button-action, .ghost-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.secondary-button:hover, .primary-button-action:hover, .ghost-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  flex: 1;
  background: rgba(39, 60, 142, 0.96);
  color: #ffffff;
}

.primary-button-action {
  flex: 1.32;
  background: linear-gradient(90deg, #6754ff 0%, #8f78ff 100%);
  color: #ffffff;
}

.ghost-button {
  width: 100%;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  z-index: 1;
}

.secondary-button:disabled, .primary-button-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========== 错误提示 ========== */
.error-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(30, 30, 30, 0.88);
  color: #fff;
  font-size: 13px;
  z-index: 99;
  pointer-events: none;
  animation: toastFade 2s ease forwards;
}

@keyframes toastFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========== 电脑端适配 ========== */
@media (min-width: 600px) {
  .page {
    max-width: 480px;
    margin: 0 auto;
    padding: 56px 24px 32px;
  }

  .result-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 13px 24px 28px;
  }

  .title {
    font-size: 36px;
  }

  .form-card {
    padding: 22px;
    border-radius: 24px;
  }

  .option-chip {
    padding: 12px 14px;
    font-size: 13px;
  }

  .overlay-card {
    max-width: 360px;
    padding: 24px;
  }
}
