/* =========================================================
   Flusso 桥水心理 — 心理自评工具中心 + 新增自评工具样式
   复用 styles.css 的设计变量与 state-card 组件；此文件只补充：
   工具卡片网格、状态标签、Likert 量表选项、结果摘要与分层条。
   移动端优先；深水青视觉系统。
   ========================================================= */

/* ---------- 工具中心：说明区 ---------- */
.tools-hub-intro p {
  color: var(--ink-soft);
}
.tools-hub-intro .lead {
  color: var(--ink);
}
.self-assessment-page .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;
}
.self-assessment-page .state-card-hero {
  padding-top: clamp(20px, 2.6vw, 34px);
  padding-bottom: clamp(12px, 1.8vw, 24px);
}
.tools-hub-intro .breadcrumb {
  margin-bottom: clamp(10px, 1.2vw, 14px);
}
.tools-hub-intro .descriptor {
  margin-top: 0;
  margin-bottom: 6px;
}
.tools-hub-intro h1 {
  font-size: clamp(31px, 4vw, 48px);
}
.tools-hub-intro .lead {
  max-width: 58ch;
  margin-top: 12px;
  font-size: clamp(16.5px, 1.25vw, 18.5px);
  line-height: 1.64;
}
.self-assessment-page main > section[aria-labelledby="tools-list-title"] {
  padding-top: clamp(10px, 1.15vw, 16px);
}
.self-assessment-page .section-head {
  margin-bottom: 15px;
}
.self-assessment-page .section-head h2 {
  margin-bottom: 12px;
}
.section-head--tool-entry {
  max-width: 58ch;
}
.section-head--tool-entry p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ---------- 工具卡片网格 ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.tool-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.tool-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tool-card__idx {
  display: inline;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--clay);
}
.tool-card h3 {
  margin: 0 0 8px;
}
.tool-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14.5px;
}
.tool-card__cta {
  margin-top: auto;
}
.tool-card__cta .btn {
  width: 100%;
  justify-content: center;
}

/* ---------- 状态标签 ---------- */
.tool-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tool-status--live {
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid rgba(15, 74, 67, 0.18);
}
.tool-status--new {
  background: var(--flusso-signal-soft);
  color: #7a5a1f;
  border: 1px solid rgba(176, 138, 69, 0.32);
}
.tool-status--level {
  margin-bottom: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid rgba(15, 74, 67, 0.18);
}

/* ---------- 工具页面：标题行 + 单一可见视图即一张卡 ---------- */
.assessment-toolhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  max-width: none;
}
.assessment-toolhead > div {
  max-width: 64ch;
}
.assessment-toolhead > div p:last-child {
  margin-bottom: 0;
}
.assessment-app {
  display: block;
}
.assessment-view {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--sh-md);
}
.assessment-view[hidden] {
  display: none;
}

/* 开始前说明 */
.assessment-intro__desc {
  max-width: 64ch;
  color: var(--ink-soft);
}
.assessment-scalekey {
  margin: 22px 0 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
}
.assessment-scalekey__title {
  display: block;
  margin-bottom: 12px;
  font-weight: 800;
  color: var(--ink);
}
/* 评分量表说明 —— 纯文字，刻意不做成可点击的胶囊/按钮 */
.assessment-scalelist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}
.assessment-scalelist li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.5;
}
.assessment-scalelist__num {
  flex: 0 0 auto;
  min-width: 1.1em;
  font-weight: 800;
  color: var(--teal);
}
.assessment-scalelist__eq {
  color: var(--muted);
}
.assessment-scalekey__foot {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.assessment-privacy-line {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* 答题表单 */
.assessment-form__instruction {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-weight: 700;
}
.assessment-question {
  margin: 0;
  padding: 0;
  border: 0;
}
.assessment-question legend {
  display: flex;
  gap: 12px;
  padding: 0;
  margin-bottom: 14px;
}
.assessment-question__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
}
.assessment-question__text {
  align-self: center;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}
.assessment-question__hint {
  margin: -6px 0 14px 40px;
  color: var(--muted);
  font-size: 13.5px;
}
.assessment-question--safety {
  margin: 0;
  border: 0;
}
.assessment-question--safety .assessment-question__num {
  background: var(--flusso-signal-soft);
  color: #7a5a1f;
}

/* 评分选项（1-5 量表，可点击） */
.scale-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-left: 40px;
}
.scale-option {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 46px;
  padding: 7px 6px;
  text-align: center;
}
.scale-option__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}
.scale-option__label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
}
/* 答题选项状态（作用域限定在 .assessment-app，不影响心理状态卡）：
   未选=浅底浅边框；hover=非常轻微；focus=仅键盘可见的 focus 环；选中=明确深绿。 */
.assessment-app .choice-card:hover {
  border-color: var(--line-2);
  background: var(--surface);
}
/* 鼠标点击后不残留 focus 框：focus-within 不额外高亮 */
.assessment-app .choice-card:focus-within {
  border-color: var(--line-2);
  background: var(--surface);
  box-shadow: none;
}
/* 仅键盘聚焦（:focus-visible）时显示清晰 focus 环 */
.assessment-app .choice-card:has(input:focus-visible) {
  border-color: var(--teal);
  box-shadow: var(--focus);
}
.assessment-app .choice-card.is-selected,
.assessment-app .choice-card:has(input:checked) {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--paper-on-dark);
}
.assessment-app .scale-option.is-selected .scale-option__num,
.assessment-app .scale-option:has(input:checked) .scale-option__num,
.assessment-app .scale-option.is-selected .scale-option__label,
.assessment-app .scale-option:has(input:checked) .scale-option__label {
  color: var(--paper-on-dark);
}

/* ---------- 作答：步骤 + 进度 ---------- */
.assessment-step {
  outline: none;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid rgba(27, 27, 24, 0.07); /* 轻分隔线，不抢视觉 */
}
.assessment-step[hidden] { display: none; }
/* 当前页第一道可见题不显示分隔线（手机端单题时也不会出现多余线条） */
.assessment-step.is-first-visible {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}
.assessment-progress {
  margin-bottom: 24px;
}
.assessment-progress__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.assessment-progress__page {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--teal);
}
.assessment-progress__count {
  font-size: 13px;
  color: var(--muted);
}
.assessment-progress__track {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}
.assessment-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--teal);
  transition: width var(--t);
}

/* 本页未完成时主按钮置灰（作用域限定在自评工具内，不影响全站其它按钮） */
.assessment-app .btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.assessment-app .btn[disabled]:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--paper-on-dark);
  box-shadow: none;
  transform: none;
}
.assessment-hint {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 结果 ---------- */
.assessment-result__intro {
  max-width: 66ch;
  color: var(--ink-soft);
}
.assessment-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  margin: 22px 0 8px;
}
.assessment-score,
.assessment-level {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
}
.assessment-score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.assessment-score span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--teal);
}
.assessment-score strong {
  font-family: var(--serif);
  font-style: italic;
  font-size: 46px;
  line-height: 1;
  color: var(--ink);
  margin: 4px 0 2px;
}
.assessment-score small {
  color: var(--muted);
  font-size: 14px;
}
.assessment-level {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.assessment-level strong {
  font-family: var(--cn-serif);
  font-size: clamp(20px, 2.6vw, 25px);
  color: var(--ink);
  margin-bottom: 14px;
}
.assessment-meter {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: auto;
}
.assessment-meter__seg {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}
.assessment-meter__seg.is-on {
  background: var(--teal);
}

.assessment-block {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.assessment-block h3 {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 16px;
}
.assessment-block p {
  color: var(--ink-soft);
}
.assessment-block__note {
  color: var(--muted);
}
.assessment-list {
  margin: 12px 0 0;
  padding-left: 1.1em;
  display: grid;
  gap: 9px;
}
.assessment-list li {
  color: var(--ink-soft);
  line-height: 1.6;
}
.assessment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.assessment-tags li {
  padding: 6px 13px;
  border: 1px solid rgba(15, 74, 67, 0.22);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13.5px;
  font-weight: 700;
}

/* ---------- 响应式 ---------- */
@media (max-width: 940px) {
  .tool-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .self-assessment-page .state-card-hero {
    padding-top: 18px;
    padding-bottom: 16px;
  }
  .tools-hub-intro .breadcrumb {
    margin-bottom: 8px;
  }
  .tools-hub-intro h1 {
    font-size: clamp(30px, 9vw, 38px);
  }
  .tools-hub-intro .lead {
    margin-top: 10px;
    line-height: 1.58;
  }
  .self-assessment-page main > section[aria-labelledby="tools-list-title"] {
    padding-top: 16px;
  }
  .self-assessment-page .section-head {
    margin-bottom: 30px;
  }
  .assessment-summary { grid-template-columns: 1fr; }
  .scale-options {
    grid-template-columns: 1fr;
    margin-left: 0;
  }
  .scale-option {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    min-height: 52px;
    text-align: left;
  }
  .scale-option__num {
    width: 30px;
    text-align: center;
  }
  .assessment-question__hint { margin-left: 0; }
  .assessment-question legend { gap: 10px; }
}
