:root {
  color: #202832;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
  background: #fff;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #fff;
}

[hidden] {
  display: none !important;
}

.workspace {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #f5f7f8;
}

.workspace-inner {
  width: min(620px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 48px;
}

h1 {
  margin: 0 0 32px;
  color: #111820;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.3;
}

form {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px 20px;
  align-items: center;
}

label {
  color: #34424f;
  font-size: 15px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #aeb8bf;
  border-radius: 4px;
  background: #fff;
  color: #111820;
  font: inherit;
  letter-spacing: 0;
}

input,
select {
  height: 42px;
  padding: 0 11px;
}

textarea {
  min-height: 84px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(32, 103, 178, 0.28);
  outline-offset: 1px;
  border-color: #2067b2;
}

button,
.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 4px;
  padding: 9px 17px;
  font: inherit;
  font-weight: 650;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.primary-button {
  border: 1px solid #185a96;
  background: #185a96;
  color: #fff;
}

.secondary-button {
  border: 1px solid #8a969e;
  background: #fff;
  color: #202832;
}

#setup-form .primary-button,
#setup-form .message {
  grid-column: 2;
}

.message {
  margin: 0 0 24px;
  color: #45535f;
  font-size: 16px;
  line-height: 1.65;
}

.error {
  color: #a31515;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

progress {
  display: block;
  width: 100%;
  height: 12px;
  margin: 24px 0;
  accent-color: #185a96;
}

#experiment-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: none;
  background: #fff;
  user-select: none;
}

#experiment-stage {
  --u: min(1vh, 0.625vw);
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(160 * var(--u));
  height: calc(100 * var(--u));
  overflow: hidden;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #000;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0;
}

.stimulus,
.dynamic-header,
.dynamic-hint,
.fixation {
  position: absolute;
  display: none;
  pointer-events: none;
}

.stimulus {
  left: 50%;
  object-fit: fill;
  transform: translate(-50%, -50%);
  -webkit-user-drag: none;
}

.ui-card,
.behavior-card {
  top: 50%;
  width: calc(128 * var(--u));
  height: calc(72 * var(--u));
}

.target-card {
  top: calc(49 * var(--u));
  width: calc(120 * var(--u));
  height: calc(67.5 * var(--u));
}

.sentence-strip {
  top: calc(73.65 * var(--u));
  width: calc(128 * var(--u));
  height: calc(24.7 * var(--u));
}

.dynamic-header,
.dynamic-hint,
.fixation {
  left: 50%;
  width: calc(155 * var(--u));
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
}

.dynamic-header {
  top: calc(4.5 * var(--u));
  color: #000;
  font-size: calc(3.4 * var(--u));
  line-height: 1;
}

.dynamic-hint {
  top: calc(95.5 * var(--u));
  color: #b91c1c;
  font-size: calc(2.4 * var(--u));
  line-height: 1;
}

.fixation {
  top: 50%;
  color: #000;
  font-size: calc(6 * var(--u));
  line-height: 1;
}

.is-visible {
  display: block;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.result-content {
  padding-top: 96px;
}

@media (max-width: 620px) {
  .workspace-inner {
    width: calc(100% - 28px);
    padding-top: 32px;
  }

  form {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  form input,
  form select,
  form textarea {
    margin-bottom: 10px;
  }

  #setup-form .primary-button,
  #setup-form .message {
    grid-column: 1;
  }
}

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