:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, 0.92);
  --card-solid: #ffffff;
  --text: #111827;
  --muted: #687385;
  --line: #dde5f0;
  --accent: #7c3aed;
  --accent-dark: #6425d0;
  --accent-soft: #ede9fe;
  --danger: #b91c1c;
  --success: #047857;
  --shadow: 0 22px 60px rgba(28, 35, 56, 0.12);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.16), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.15), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.hero-card,
.panel {
  border: 1px solid rgba(221, 229, 240, 0.9);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 28px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.subtitle {
  max-width: 620px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-badge {
  display: grid;
  place-items: center;
  min-width: 104px;
  min-height: 104px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #fff;
  text-align: center;
}

.hero-badge span {
  font-size: 2rem;
  font-weight: 900;
}

.hero-badge small {
  margin-top: -12px;
  opacity: 0.84;
}

.panel {
  margin-top: 18px;
  border-radius: 24px;
  padding: 22px;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title-row h2,
.tips-panel h2 {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.section-title-row p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #334155;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-solid);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus {
  border-color: rgba(124, 58, 237, 0.64);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.remember-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.grant-info {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
  padding: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.grant-info strong {
  color: var(--text);
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.primary-button {
  min-height: 52px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #fff;
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.28);
}

.ghost-button {
  min-height: 42px;
  padding: 0 16px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.primary-button:hover,
.ghost-button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  filter: grayscale(0.4);
  transform: none;
  opacity: 0.72;
}

.cdk-output {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  border: 1px dashed rgba(124, 58, 237, 0.5);
  border-radius: 20px;
  background: #fbfaff;
  padding: 18px;
  color: #2e1065;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(1.05rem, 5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.tips-panel ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

code {
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  padding: 0.1em 0.4em;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 20;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  border-radius: 18px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 45px rgba(17, 24, 39, 0.22);
  padding: 14px 16px;
  text-align: center;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .page-shell {
    padding-top: 14px;
  }

  .hero-card {
    align-items: flex-start;
    border-radius: 22px;
    padding: 22px;
  }

  .hero-badge {
    display: none;
  }

  .panel {
    border-radius: 20px;
    padding: 18px;
  }

  .section-title-row {
    flex-direction: column;
  }

  .ghost-button {
    width: 100%;
  }
}
