:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --ink: #141414;
  --muted: #737373;
  --muted-2: #a3a3a3;
  --border: #e6e6e6;
  --input: #f4f4f5;
  --ring: #858585;
  --danger: #b45309;
  --success: #16794d;
  --radius: 16px;
  --font-sans:
    "Noto Sans SC",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

.dark {
  --bg: #101010;
  --surface: #101010;
  --surface-2: #1d1d1d;
  --ink: #f5f5f5;
  --muted: #adadad;
  --muted-2: #7a7a7a;
  --border: #2a2a2a;
  --input: #1b1b1b;
  --ring: #9a9a9a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
}

.topbar {
  width: min(100%, 1120px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
}

.language-switch {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 14px;
}

.language-switch a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 4px 0;
  transition: border-color 120ms ease, color 120ms ease;
}

.language-switch a:hover {
  color: var(--ink);
}

.language-switch .is-active {
  color: var(--ink);
  border-color: var(--ink);
  font-weight: 650;
}

.icon-button {
  width: auto;
  min-width: 76px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 14px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.icon-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.theme-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.theme-label {
  line-height: 1;
}

.intro {
  width: min(100%, 620px);
  margin: 108px auto 64px;
  text-align: center;
}

.kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: 0;
}

.intro p:last-child {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.form,
.success-panel {
  width: min(100%, 660px);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.question {
  margin: 0;
  padding: 0 0 34px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.question:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

legend {
  width: 100%;
  margin-bottom: 14px;
  padding: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 650;
}

legend span {
  margin-left: 8px;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 400;
}

.hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.option-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-grid label,
.radio-list label {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.option-grid label:hover,
.radio-list label:hover {
  border-color: var(--ring);
  background: var(--surface-2);
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--ink);
}

.option-grid label:has(input:checked),
.radio-list label:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.radio-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--ink);
  outline: none;
  padding: 14px 16px;
  font-size: 16px;
}

textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.7;
}

input::placeholder,
textarea::placeholder {
  color: #8d8d8d;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--ring);
  outline: 3px solid color-mix(in srgb, var(--ink) 12%, transparent);
  outline-offset: 2px;
}

.other-input {
  margin-top: 10px;
}

#materialText {
  margin-top: 12px;
  min-height: 104px;
}

#contactValue {
  margin-top: 12px;
}

.field-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.4;
}

.question.has-error legend {
  color: var(--danger);
}

.question.has-error input[type="text"],
.question.has-error input[type="email"],
.question.has-error textarea {
  border-color: var(--danger);
}

.submit-button,
.success-actions button,
.success-actions a {
  min-height: 54px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.submit-button {
  width: 100%;
  margin-top: 2px;
  background: var(--ink);
  color: var(--bg);
}

.submit-button:hover,
.success-actions button:hover,
.success-actions a:hover {
  transform: translateY(-1px);
}

.success-panel {
  margin-top: 44px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  background: var(--surface);
}

.success-panel[hidden] {
  display: none;
}

.success-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 650;
}

.success-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

#submissionSummary {
  min-height: 300px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.success-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.success-actions button,
.success-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--ink);
}

.success-actions button:first-child {
  background: var(--ink);
  color: var(--bg);
}

.copy-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--success);
  font-size: 14px;
}

.footer {
  margin-top: auto;
  padding-top: 80px;
  color: var(--muted);
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .page {
    padding: 18px 14px 32px;
  }

  .topbar {
    align-items: flex-start;
  }

  .intro {
    margin: 70px auto 48px;
  }

  h1 {
    font-size: 32px;
  }

  .intro p:last-child {
    font-size: 16px;
  }

  .form {
    gap: 30px;
  }

  .question {
    padding-bottom: 30px;
  }

  .option-grid,
  .option-grid.compact,
  .success-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
