:root {
  --bg-a: #fff9f2;
  --bg-b: #eef6ff;
  --ink-strong: #12263f;
  --ink-muted: #51627a;
  --line-soft: #d7e0ec;
  --brand: #0f6ab7;
  --brand-strong: #094f8c;
  --ok: #1f8f52;
  --err: #b0392e;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink-strong);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: radial-gradient(circle at 15% 0%, var(--bg-a), transparent 40%),
    radial-gradient(circle at 85% 100%, var(--bg-b), transparent 35%),
    #f8fbff;
}

.page-shell {
  min-height: 100vh;
  padding: 28px 16px;
}

.survey-card {
  max-width: 920px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid #e7edf7;
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(15, 46, 82, 0.14);
  padding: 24px 24px 28px;
}

.survey-header {
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line-soft);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand-strong);
  font-weight: 700;
}

.inline-link {
  font-size: 0.85rem;
  color: var(--brand);
  text-decoration: underline;
}

h1 {
  margin: 8px 0 10px;
  font-size: 1.52rem;
  line-height: 1.35;
}

.summary,
.intro p {
  margin: 6px 0;
  color: var(--ink-muted);
  line-height: 1.65;
}

.progress {
  margin: 18px 0;
}

.progress-text {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: #e9eef6;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #2fa6d8);
  transition: width 180ms ease;
}

.question-panel {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 16px;
  background: #fcfdff;
}

.section-tag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  background: #ebf5ff;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 10px;
}

.question-title {
  margin: 10px 0 14px;
  font-size: 1.16rem;
  line-height: 1.45;
}

.choice-group {
  display: grid;
  gap: 10px;
}

.option-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
  padding: 9px 10px;
  border: 1px solid #e6edf8;
  border-radius: 10px;
  background: #fff;
}

.option-row:hover {
  border-color: #b9d2ee;
}

.option-row input {
  margin-top: 3px;
}

.helper {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 0.87rem;
}

.extra-input-label,
.textarea-label {
  display: block;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.text-input,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #d0dcea;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink-strong);
  background: #fff;
}

.text-input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 106, 183, 0.14);
}

textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.55;
}

.likert-wrap {
  overflow-x: auto;
}

.likert-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.likert-table th,
.likert-table td {
  border: 1px solid #deE7F3;
  padding: 8px 6px;
  text-align: center;
}

.likert-table th:first-child {
  text-align: left;
  min-width: 250px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 10px 20px;
  font-size: 0.96rem;
  font-weight: 700;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: #eef3fb;
  color: #385271;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #1789cb);
}

.btn-success {
  color: #fff;
  background: linear-gradient(135deg, #1c9a59, #12713f);
}

.utility-actions {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.link-btn {
  border: 0;
  background: none;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.message {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.message.success {
  color: var(--ok);
  border-color: #bee6d0;
  background: #edf9f2;
}

.message.error {
  color: var(--err);
  border-color: #f4c5bd;
  background: #fff1ef;
}

.completion-view {
  margin-top: 20px;
  padding: 28px 20px;
  border: 1px solid #cce2f6;
  border-radius: 16px;
  background: linear-gradient(160deg, #f4fbff, #ffffff 35%, #f4fff8);
  text-align: center;
}

.completion-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e5f6ea;
  color: #14643a;
  font-size: 0.82rem;
  font-weight: 700;
}

.completion-title {
  margin: 12px 0 8px;
  font-size: 1.45rem;
}

.completion-text {
  margin: 0 auto;
  max-width: 600px;
  color: var(--ink-muted);
  line-height: 1.65;
}

.completion-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .survey-card {
    border-radius: 14px;
    padding: 16px 14px 20px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .question-title {
    font-size: 1.06rem;
  }

  .utility-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    justify-content: space-between;
  }

  .btn {
    flex: 1;
    min-width: 0;
  }

  .completion-view {
    padding: 20px 14px;
  }

  .completion-title {
    font-size: 1.24rem;
  }
}
