:root {
  --oat: #faf7f0;
  --milk: #fffdf8;
  --ink: #392d43;
  --soft: #685e70;
  --purple: #705383;
  --pale: #ece3f3;
  --line: #ded2df;
  --error: #97412e;
  --shadow: #59486914;
  --veil: #30213766;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.65 system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 86% 62%, var(--pale), transparent 55%), var(--oat);
  min-height: 100vh;
}

header {
  background: var(--milk);
  border-bottom: 1px solid var(--line);
}

nav {
  width: min(1160px, 90%);
  margin: auto;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

a, button {
  cursor: pointer;
  color: var(--purple);
  font: inherit;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 22px "KaiTi", "DFKai-SB", var(--serif);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 44px;
  height: 44px;
  aspect-ratio: 1;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 12px;
}

.back {
  font-size: 15px;
  text-decoration: none;
}

main {
  width: min(1120px, 91%);
  margin: clamp(30px, 7vh, 82px) auto;
}

.card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 65px var(--shadow);
}

figure {
  margin: 0;
  min-height: 500px;
  position: relative;
}

figure img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 36% center;
}

.form-area {
  padding: clamp(26px, 4.3vw, 64px);
}

.brandline {
  color: var(--purple);
  letter-spacing: 0.14em;
  font-size: 14px;
  font-weight: 650;
  margin: 0 0 14px;
}

h1, h2 {
  font-family: var(--serif);
  line-height: 1.3;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(32px, 3.4vw, 52px);
}

.lead {
  margin: 14px 0 28px;
  color: var(--soft);
}

label {
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
}

input {
  font: inherit;
  display: block;
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: var(--milk);
}

button {
  border: 0;
  background: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

.primary,
.downloads a {
  background: var(--purple);
  color: var(--milk);
  border-radius: 12px;
  text-decoration: none;
  padding: 12px 18px;
  text-align: center;
}

.primary {
  width: 100%;
  margin-top: 12px;
  font-weight: 650;
}

.primary:disabled {
  opacity: 0.65;
}

.get {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 17px;
  font-size: 15px;
}

.get button {
  text-decoration: underline;
  padding: 4px;
}

.get span {
  color: var(--soft);
}

#status {
  color: var(--error);
  margin: 5px 0;
  font-size: 14px;
}

#status:empty {
  display: none;
}

dialog {
  background: var(--milk);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px;
  width: min(420px, 92%);
  text-align: center;
  box-shadow: 0 15px 60px var(--shadow);
}

dialog::backdrop {
  background: var(--veil);
}

#close {
  position: absolute;
  right: 8px;
  top: 6px;
  width: 44px;
  height: 44px;
  font-size: 30px;
}

#help {
  width: 145px;
}

dialog h2 {
  margin: 14px 0;
}

dialog p:empty {
  display: none;
}

.downloads {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.downloads a + a {
  background: var(--pale);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

@media (max-width: 740px) {
  nav {
    height: 64px;
  }

  .brand {
    font-size: 17px;
    gap: 8px;
  }

  .brand img {
    width: 35px;
    height: 35px;
  }

  main {
    margin: 20px auto;
  }

  .card {
    display: flex;
    flex-direction: column;
  }

  .form-area {
    padding: 24px;
  }

  .lead {
    margin-bottom: 18px;
  }

  figure {
    min-height: 0;
    height: clamp(110px, 25vh, 185px);
  }

  figure img {
    object-position: 50% 36%;
  }

  .back {
    font-size: 14px;
  }
}
