/* ============================================================
 * 钢青科技蓝 主题（Steel Cyan / Deep Navy）
 * 面向工厂办公 + IT 的沉稳专业 + 一点数字感
 * ============================================================ */

:root {
  --primary:      #1E88E5;
  --primary-dark: #0D47A1;
  --secondary:    #00ACC1;
  --accent:       #FFB300;
  --success:      #43A047;
  --warning:      #FB8C00;
  --danger:       #E53935;
  --bg:           #F5F7FA;
  --surface:      #FFFFFF;
  --border:       #D6DEE7;
  --border-strong:#9CB1C7;
  --txt:          #1A202C;
  --txt-light:    #64748B;
  --txt-mute:     #94A3B8;

  --gradient-primary: linear-gradient(135deg, #0D47A1 0%, #1E88E5 60%, #00ACC1 100%);
  --gradient-cta:     linear-gradient(135deg, #1E88E5 0%, #00ACC1 100%);
  --shadow-card:  0 8px 24px rgba(13,71,161,0.08);
  --shadow-hover: 0 12px 32px rgba(13,71,161,0.16);

  --font-family: "PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, #F5F7FA 0%, #E3ECF5 100%);
  color: var(--txt);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.header {
  text-align: center;
  padding: 32px 16px 24px;
  position: relative;
}

.header h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 10px;
}

.header .subtitle {
  font-size: 15px;
  color: var(--txt-light);
  font-weight: 500;
}

.header .deco {
  display: block;
  margin: 18px auto 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--gradient-cta);
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  transition: box-shadow 0.3s ease;
}

.card:hover { box-shadow: var(--shadow-hover); }

/* ===== Fieldset 分组 ===== */
fieldset {
  border: none;
  margin-bottom: 28px;
  padding: 24px 22px 12px;
  background: linear-gradient(135deg, rgba(30,136,229,0.03) 0%, rgba(0,172,193,0.03) 100%);
  border: 2px solid rgba(30,136,229,0.12);
  border-radius: 18px;
}

fieldset legend {
  font-weight: 700;
  font-size: 17px;
  color: var(--primary-dark);
  padding: 8px 18px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 30px;
  display: inline-block;
  box-shadow: 0 2px 10px rgba(30,136,229,0.15);
}

fieldset legend .fa-solid,
fieldset legend .fas {
  margin-right: 8px;
  color: var(--primary);
}

/* ===== 表单项 ===== */
.form-item {
  margin-bottom: 22px;
}

.form-item:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--txt);
  font-size: 15px;
  line-height: 1.5;
}

.form-label .qid {
  display: inline-block;
  font-family: "Menlo", "Consolas", monospace;
  color: var(--txt-mute);
  font-weight: 500;
  margin-right: 8px;
  font-size: 13px;
}

.required { color: var(--danger); font-weight: 700; margin-left: 4px; }

.form-hint {
  font-size: 13px;
  color: var(--txt-light);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ===== Input / Select / Textarea ===== */
.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--txt);
  transition: all 0.25s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30,136,229,0.12);
  background: #FDFEFF;
}

.form-control.invalid {
  border-color: var(--danger);
  background: #FFF5F5;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231E88E5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

/* ===== Radio / Checkbox ===== */
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  padding: 11px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 14.5px;
  color: var(--txt);
  user-select: none;
}

.option-item:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(30,136,229,0.05), rgba(0,172,193,0.05));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30,136,229,0.12);
}

.option-item input {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.option-item.selected {
  background: var(--gradient-cta);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30,136,229,0.25);
}

.option-item.selected input { accent-color: #fff; }

/* ===== Scale 5 量表 ===== */
.scale {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.scale .scale-options {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 8px;
}

.scale .scale-option {
  flex: 1;
  padding: 14px 0;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  color: var(--txt);
  transition: all 0.2s ease;
}

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

.scale .scale-option:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30,136,229,0.12);
}

.scale .scale-option.selected {
  background: var(--gradient-cta);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(30,136,229,0.3);
}

.scale-label {
  font-size: 12px;
  color: var(--txt-light);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 56px;
  text-align: center;
  line-height: 1.3;
}

.scale-label.left  { text-align: right; }
.scale-label.right { text-align: left; }

/* ===== Matrix 矩阵题 ===== */
.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 6px;
  font-size: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.matrix th, .matrix td {
  padding: 10px 8px;
  text-align: center;
}

.matrix thead th {
  background: rgba(30,136,229,0.08);
  color: var(--primary-dark);
  font-weight: 700;
  border-bottom: 2px solid rgba(30,136,229,0.2);
}

.matrix thead th:first-child { text-align: left; }

.matrix tbody tr:nth-child(even) { background: #FAFBFD; }

.matrix tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--txt);
  padding-left: 16px;
}

.matrix input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  background: var(--gradient-cta);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 15px 42px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(30,136,229,0.3);
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(30,136,229,0.38);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(30,136,229,0.25);
}

.btn-large {
  font-size: 18px;
  padding: 17px 54px;
}

/* ===== 通知/状态条 ===== */
.notice {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notice .fa-solid, .notice .fas { margin-top: 3px; flex-shrink: 0; }

.notice.info {
  background: rgba(30,136,229,0.08);
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
}

.notice.warn {
  background: rgba(251,140,0,0.08);
  border-left: 4px solid var(--warning);
  color: #8A4500;
}

.notice.error {
  background: rgba(229,57,53,0.08);
  border-left: 4px solid var(--danger);
  color: #7A1E1C;
}

.notice.success {
  background: rgba(67,160,71,0.08);
  border-left: 4px solid var(--success);
  color: #1E4620;
}

/* ===== 进度条 ===== */
.progress {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  padding: 10px 16px;
  box-shadow: 0 2px 12px rgba(13,71,161,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--txt-light);
}

.progress .bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress .fill {
  height: 100%;
  width: 0;
  background: var(--gradient-cta);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress .pct {
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 42px;
  text-align: right;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .container { padding: 12px 10px 40px; }
  .header h1 { font-size: 24px; }
  .card { padding: 20px 16px; border-radius: 16px; }
  fieldset { padding: 20px 14px 10px; }
  fieldset legend { font-size: 15px; padding: 7px 14px; }

  .form-label { font-size: 14.5px; }

  .option-item { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }

  /* 量表移动端：两端标签占一行，5 个数字独占一行做大做宽 */
  .scale {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 8px;
  }
  .scale-label {
    flex: 0 0 auto;
    min-width: 0;
    font-size: 12px;
    color: var(--txt-light);
    white-space: nowrap;
  }
  .scale-label.left  { order: 1; text-align: left;  }
  .scale-label.right { order: 2; text-align: right; }
  .scale .scale-options {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    gap: 6px;
  }
  .scale .scale-option {
    flex: 1 1 0;
    min-width: 0;
    font-size: 18px;
    font-weight: 700;
    padding: 14px 0;
    border-radius: 14px;
  }

  .matrix { font-size: 12px; }
  .matrix th, .matrix td { padding: 8px 4px; }
  .matrix tbody td:first-child { padding-left: 10px; }

  .btn { font-size: 15px; padding: 13px 30px; }
  .btn-large { font-size: 16px; padding: 14px 38px; }
}

@media (max-width: 420px) {
  .option-item { min-width: 100%; flex-basis: 100%; }
}
