:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-muted: #ece6da;
  --ink: #18201f;
  --ink-muted: #5e6662;
  --line: #d8d0c2;
  --accent: #0f6f63;
  --accent-strong: #09554c;
  --accent-soft: #dcefe9;
  --warning: #8d4d17;
  --shadow: 0 24px 60px rgba(25, 30, 28, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 111, 99, 0.08), transparent 36%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  align-items: center;
}

.workspace {
  width: 100%;
  min-height: min(760px, calc(100vh - 64px));
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workspace__header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1;
  letter-spacing: 0;
}

.progress-panel {
  width: min(280px, 32vw);
  align-self: end;
  color: var(--ink-muted);
  font-weight: 700;
}

.progress-track {
  height: 8px;
  margin-top: 12px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 240ms ease;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 610px;
}

.dimension-list {
  min-width: 0;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  background: rgba(236, 230, 218, 0.45);
}

.dimension-list h2 {
  margin-bottom: 18px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.dimension-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dimension-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink-muted);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.dimension-item.is-active {
  color: var(--ink);
  border-color: rgba(15, 111, 99, 0.32);
  background: var(--accent-soft);
}

.dimension-item span:last-child {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.question-panel,
.result-panel {
  min-width: 0;
  padding: clamp(28px, 5vw, 64px);
}

.question-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: enter 260ms ease;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}

.question-panel h2 {
  max-width: 820px;
  min-height: 92px;
  margin-bottom: 34px;
  font-size: clamp(1.55rem, 3vw, 2.7rem);
  line-height: 1.22;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.scale {
  margin: 0;
  padding: 0;
  border: 0;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 12px;
}

.scale-option {
  position: relative;
  min-width: 0;
  min-height: 78px;
}

.scale-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scale-option span {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.scale-option input:focus-visible + span {
  outline: 3px solid rgba(15, 111, 99, 0.3);
  outline-offset: 3px;
}

.scale-option input:checked + span {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.hint {
  min-height: 24px;
  margin: 22px 0 0;
  color: var(--warning);
  font-weight: 700;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-width: 120px;
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button--secondary {
  background: transparent;
  color: var(--accent);
}

.button--secondary:hover:not(:disabled) {
  color: #fff;
}

.result-panel {
  animation: enter 320ms ease;
}

.result-heading {
  max-width: 760px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.result-heading h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.result-heading p:last-child {
  color: var(--ink-muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.score-list {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.score-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
}

.score-row strong {
  font-size: 0.92rem;
}

.score-track {
  height: 12px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}

.score-fill {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.score-row span {
  color: var(--ink-muted);
  font-weight: 800;
  text-align: right;
}

.result-copy {
  max-width: 820px;
  color: var(--ink-muted);
  line-height: 1.75;
}

.result-copy h3 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: 1rem;
}

.hidden {
  display: none;
}

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

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: 100%;
    min-height: 100vh;
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    border-width: 0;
    border-radius: 0;
  }

  .workspace__header {
    flex-direction: column;
    padding: 24px 20px;
  }

  .progress-panel {
    width: 100%;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .dimension-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
  }

  .dimension-list ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .dimension-item {
    flex: 0 0 auto;
    min-width: 136px;
  }

  .question-panel,
  .result-panel {
    padding: 28px 20px 36px;
  }

  .question-panel {
    justify-content: flex-start;
  }

  .question-panel h2 {
    min-height: 112px;
    margin-bottom: 26px;
  }

  .scale-options {
    grid-template-columns: repeat(5, minmax(52px, 1fr));
    gap: 8px;
  }

  .scale-option,
  .scale-option span {
    min-height: 62px;
  }

  .actions {
    justify-content: stretch;
  }

  .button {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .score-row {
    grid-template-columns: 92px minmax(0, 1fr) 44px;
    gap: 10px;
  }
}

@media (max-width: 460px) {
  .workspace__header {
    padding: 22px 16px;
  }

  .dimension-list,
  .question-panel,
  .result-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .scale-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .scale-option,
  .scale-option span {
    min-height: 56px;
  }

  .scale-labels {
    font-size: 0.78rem;
  }

  .score-row {
    grid-template-columns: 1fr 46px;
  }

  .score-row strong {
    grid-column: 1 / -1;
  }
}
