* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  color: #1f2937;
  background: #f6f9fc;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 10% 10%, rgba(14, 165, 233, 0.18), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(59, 130, 246, 0.13), transparent 30%),
    radial-gradient(circle at 70% 90%, rgba(34, 197, 94, 0.12), transparent 35%),
    linear-gradient(135deg, #f8fbff, #eef7ff);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  padding: 24px 0 18px;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: #0f79bf;
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover {
  text-decoration: underline;
}

.header h1 {
  margin: 0 0 8px;
  color: #0f4c81;
  font-size: 30px;
}

.header p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
}

.panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 76, 129, 0.08);
  padding: 24px;
}

.hidden {
  display: none !important;
}

.section-title {
  margin: 28px 0 16px;
  padding: 12px 14px;
  border-left: 4px solid #0f79bf;
  background: #eaf5ff;
  color: #0f4c81;
  font-weight: 700;
  border-radius: 8px;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field span,
.question h3,
.matrix-title {
  display: block;
  margin-bottom: 10px;
  color: #1f3b57;
  font-size: 16px;
  font-weight: 700;
}

input:not([type]),
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.question {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.question label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 20px 6px 0;
  line-height: 1.5;
}

.matrix {
  margin-bottom: 24px;
  overflow-x: auto;
  border-radius: 12px;
}

.matrix table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  background: #fff;
}

.matrix th,
.matrix td {
  border: 1px solid #dbe3ee;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}

.matrix th {
  background: #eef6ff;
  color: #0f4c81;
}

.matrix th:first-child,
.matrix td:first-child {
  text-align: left;
  width: 43%;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.submit-btn,
.view-result-btn,
#showFormBtn,
#refreshBtn,
#confirmPasswordBtn,
#cancelPasswordBtn {
  border: 0;
  border-radius: 8px;
  padding: 12px 22px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.submit-btn,
#showFormBtn,
#refreshBtn,
#confirmPasswordBtn {
  background: #0f79bf;
}

.submit-btn:hover,
#showFormBtn:hover,
#refreshBtn:hover,
#confirmPasswordBtn:hover {
  background: #0f4c81;
}

.view-result-btn {
  background: #16a34a;
}

.view-result-btn:hover {
  background: #15803d;
}

#cancelPasswordBtn {
  background: #64748b;
}

#cancelPasswordBtn:hover {
  background: #475569;
}

.message {
  margin-top: 12px;
  color: #dc2626;
  font-weight: 700;
}

.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.result-top h2 {
  margin: 0 0 6px;
  color: #0f4c81;
}

.result-top p {
  margin: 0;
  color: #64748b;
}

.small-tip {
  font-size: 13px;
  margin-top: 6px !important;
  color: #64748b;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.result-card {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.result-card h3 {
  margin: 0 0 14px;
  color: #0f4c81;
  font-size: 18px;
  line-height: 1.5;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(190px, 360px) 1fr 120px;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}

.result-label {
  line-height: 1.45;
}

.bar {
  height: 14px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  transition: width 0.3s ease;
}

.percent {
  text-align: right;
  color: #475569;
  font-weight: 700;
}

.matrix-result-title {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #dbe3ee;
  color: #334155;
  font-weight: 700;
  line-height: 1.6;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.modal-box {
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal-box h2 {
  margin: 0 0 10px;
  color: #0f4c81;
}

.modal-box p {
  color: #64748b;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.detail-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 680px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
}

.detail-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table th,
.detail-table td {
  border: 1px solid #dbe3ee;
  padding: 8px 10px;
  vertical-align: top;
  white-space: nowrap;
  max-width: 360px;
}

.detail-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eaf5ff;
  color: #0f4c81;
  font-weight: 700;
  text-align: center;
}

.detail-table td {
  background: #fff;
  color: #334155;
}

.detail-table tr:nth-child(even) td {
  background: #f8fafc;
}

.detail-table .long-text {
  white-space: normal;
  min-width: 260px;
  max-width: 420px;
  line-height: 1.6;
}

.detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.export-tip {
  font-size: 13px;
  color: #64748b;
}

@media (max-width: 720px) {
  .page {
    padding: 14px;
  }

  .header h1 {
    font-size: 23px;
  }

  .panel {
    padding: 16px;
  }

  .result-top {
    flex-direction: column;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .percent {
    text-align: left;
  }
}
