:root {
  --ink: #0b1830;
  --muted: #627086;
  --line: #e8edf4;
  --panel: rgba(255, 255, 255, 0.9);
  --soft-panel: rgba(255, 255, 255, 0.76);
  --primary: #2f91ee;
  --primary-dark: #096ed1;
  --navy: #07142c;
  --success: #0c8a56;
  --warning: #b36800;
  --danger: #c92a2a;
  --shadow: 0 26px 70px rgba(33, 64, 111, 0.16);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 17%, rgba(255, 214, 225, 0.72), transparent 28rem),
    radial-gradient(circle at 84% 8%, rgba(194, 219, 255, 0.82), transparent 34rem),
    linear-gradient(135deg, #fff8fb 0%, #eef6ff 53%, #f7fbff 100%);
}

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

button,
input,
textarea {
  font: inherit;
}

.language-pill {
  position: fixed;
  z-index: 10;
  top: 18px;
  right: 22px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  color: #2e3a4f;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(26, 50, 89, 0.08);
  backdrop-filter: blur(12px);
  font-size: 13px;
}

.hero {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 88px 0 30px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: 0;
  word-break: keep-all;
}

.hero p {
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 16px;
}

.batch-link,
.small-button,
.primary-button,
.confirm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.batch-link {
  min-height: 36px;
  padding: 0 22px;
  color: #fff;
  background: var(--navy);
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(7, 20, 44, 0.16);
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 26px;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 0 0 58px;
}

.ready-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(1120px, calc(100% - 36px));
  min-height: 40px;
  margin: 0 auto 18px;
  padding: 0 16px;
  color: #34a853;
  background: #effbe9;
  border: 1px solid #dbf4d2;
  border-radius: 12px;
  font-size: 15px;
}

.ready-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #fff;
  background: #65d147;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.single-layout {
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 0 0 58px;
}

.guide-panel,
.form-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.guide-panel {
  padding: 30px 24px;
  align-self: start;
}

.guide-panel h2,
.form-panel h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.guide-panel > .muted,
.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.guide-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.guide-list li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid #eef1f5;
}

.guide-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--navy);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
}

.guide-list h3 {
  margin: 0;
  font-size: 16px;
}

.guide-list p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.small-button {
  min-height: 30px;
  margin-top: 9px;
  padding: 0 14px;
  color: #fff;
  background: #1677e8;
  font-size: 14px;
  font-weight: 700;
}

.form-panel {
  padding: 46px 52px 52px;
  align-self: start;
}

.step-section + .step-section {
  margin-top: 34px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

#cdkeySection.is-hidden + #sessionSection {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.step-section.is-locked {
  display: none;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #526071;
  background: #eef3f8;
  font-size: 13px;
  font-weight: 700;
}

.status-badge.success {
  color: var(--success);
  background: #e8f7f0;
}

.status-badge.warning {
  color: var(--warning);
  background: #fff4de;
}

.status-badge.danger {
  color: var(--danger);
  background: #ffecec;
}

.link-button {
  border: 0;
  background: transparent;
  color: #1677e8;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.gift-summary {
  margin: 28px 0 22px;
  text-align: center;
}

.gift-summary h3 {
  margin: 0;
  color: #1a2234;
  font-size: 25px;
  line-height: 1.2;
}

.gift-summary span {
  display: inline-block;
  margin-top: 4px;
  color: #1f6ef5;
  font-size: 18px;
  font-weight: 800;
}

.field-stack {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

label {
  color: #485366;
  font-size: 14px;
  font-weight: 700;
}

label::before {
  content: "* ";
  color: #d64545;
}

.force-row::before {
  content: "";
}

input[type="text"],
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #d9e1eb;
  border-radius: 2px;
  outline: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input[type="text"] {
  height: 42px;
  padding: 0 14px;
}

textarea {
  min-height: 168px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.55;
}

textarea.has-error {
  border-color: #ff4d4f;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 145, 238, 0.12);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.primary-button,
.confirm-button {
  min-height: 42px;
  padding: 0 22px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.batch-submit {
  width: max-content;
}

.button-icon {
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.button-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  background: currentColor;
  border-radius: 4px;
  transform: rotate(45deg);
}

.confirm-button {
  width: max-content;
  margin-top: 4px;
}

.primary-button:hover,
.confirm-button:hover,
.small-button:hover,
.batch-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 25px rgba(31, 112, 202, 0.18);
}

.primary-button:disabled,
.confirm-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.account-preview,
.result-card {
  border: 1px solid var(--line);
  background: var(--soft-panel);
  border-radius: 12px;
}

.session-fields {
  gap: 16px;
}

.readonly-field {
  display: grid;
  gap: 9px;
}

.readonly-field span {
  color: #687386;
  font-size: 14px;
}

.readonly-field strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 14px;
  color: #99a4b8;
  background: #f8faff;
  border: 1px solid #dde5ef;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.session-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.session-label a {
  color: #1677e8;
  font-size: 13px;
  font-weight: 700;
}

.account-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 15px;
  color: var(--muted);
}

.account-preview strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.force-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  color: #e21b2d;
  cursor: pointer;
  font-weight: 800;
}

.force-row input {
  width: 16px;
  height: 16px;
  accent-color: #e21b2d;
}

.force-help {
  max-width: 620px;
  margin: -8px 0 0;
  color: #d12b35;
  font-size: 13px;
  line-height: 1.55;
}

.field-error {
  margin: -10px 0 0;
  color: #ff4d4f;
  font-size: 13px;
}

.result-card {
  margin-top: 18px;
  padding: 16px;
}

.result-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.result-card p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.55;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.result-grid span {
  color: var(--muted);
}

.result-grid strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.batch-table {
  display: grid;
  gap: 10px;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.7fr) minmax(140px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.batch-row strong {
  overflow-wrap: anywhere;
}

.batch-row span {
  color: var(--muted);
}

.batch-row em {
  color: var(--muted);
  font-style: normal;
}

.batch-row.success em {
  color: var(--success);
}

.batch-row.danger em {
  color: var(--danger);
}

.is-hidden {
  display: none;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  z-index: 20;
}

.toast {
  padding: 14px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 18px 45px rgba(7, 20, 44, 0.2);
  line-height: 1.45;
}

.loading {
  position: relative;
  color: transparent !important;
}

.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 880px) {
  .hero {
    padding-top: 78px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .form-panel {
    padding: 32px 24px;
  }
}

@media (max-width: 620px) {
  .language-pill {
    right: 14px;
  }

  .hero,
  .layout {
    width: min(100% - 24px, 1120px);
  }

  .hero h1 {
    font-size: 30px;
  }

  .section-heading {
    display: grid;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .confirm-button {
    width: 100%;
  }

  .batch-submit {
    width: 100%;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .batch-row {
    grid-template-columns: 1fr;
  }
}
