:root {
  --brand: #61D0DF;
  --brand-dark: #4FB8C7;
  --brand-light: #E8F8FB;
  --text: #2C3E50;
  --text-soft: #5A6C7D;
  --text-light: #98A4B0;
  --border: #E0E6EC;
  --bg: #FAFBFC;
  --white: #FFFFFF;
  --err: #E74C3C;
  --shadow: 0 2px 12px rgba(97, 208, 223, 0.08);
}

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

html, body {
  font-family: -apple-system, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.hero {
  margin-bottom: 40px;
}
.hero-logo {
  height: 64px;
  width: auto;
  display: block;
  margin-bottom: 16px;
}
.hero h1 {
  color: var(--brand);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.hero .sub {
  color: var(--text-soft);
  font-size: 15px;
  margin-top: 8px;
}

.form { display: flex; flex-direction: column; gap: 36px; }

.q { display: flex; flex-direction: column; gap: 12px; }

.q-label {
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
  display: block;
  line-height: 1.6;
}
.q-num {
  display: inline-block;
  min-width: 22px;
  color: var(--text-light);
  font-size: 14px;
  margin-right: 6px;
}

.hint {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 400;
}
.hint-block { display: block; margin-top: -4px; }

.input-line {
  width: 100%;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--white);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.input-line::placeholder, .input-box::placeholder {
  color: var(--text-light);
}
.input-line:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(97, 208, 223, 0.12);
}

.input-box {
  width: 100%;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--white);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: box-shadow .2s, border-color .2s;
}
.input-box:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(97, 208, 223, 0.12);
}

/* Radio cards */
.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: background .2s, border-color .2s;
}
.radio-card:hover { background: var(--brand-light); }
.radio-card input[type=radio] {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--brand);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.radio-card input[type=radio]:checked::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--brand);
}
.radio-card:has(input:checked) {
  background: var(--brand-light);
  border-color: var(--brand-dark);
}

/* Slider */
.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.slider-value {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  height: 20px;
}
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--brand-light);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--brand);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--brand);
  cursor: pointer;
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 12px;
}

/* Submit */
.submit-wrap {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.btn-submit {
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 14px 80px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .1s;
  font-family: inherit;
  letter-spacing: 2px;
}
.btn-submit:hover:not(:disabled) { background: var(--brand-dark); }
.btn-submit:active:not(:disabled) { transform: translateY(1px); }
.btn-submit:disabled { background: var(--text-light); cursor: not-allowed; }
.submit-status { font-size: 13px; color: var(--text-soft); min-height: 18px; }
.submit-status.err { color: var(--err); }

/* Thanks page */
.thanks-box {
  text-align: center;
  padding: 80px 20px;
}
.thanks-box .icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 24px;
}
.thanks-box h2 { color: var(--brand); margin-bottom: 8px; font-size: 24px; }
.thanks-box p { color: var(--text-soft); }

/* === Admin === */
.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header h1 {
  color: var(--brand);
  font-size: 22px;
  font-weight: 600;
}
.admin-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-logo {
  height: 36px;
  width: auto;
  display: block;
}
.admin-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); color: white; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: white; }

.login-box {
  max-width: 380px;
  margin: 120px auto 0;
  padding: 40px 32px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-box h2 { color: var(--brand); margin-bottom: 6px; }
.login-box p { color: var(--text-soft); font-size: 14px; margin-bottom: 24px; }
.login-box input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 8px;
  font-family: inherit;
}
.login-box input:focus { border-color: var(--brand); }
.login-box .err-msg { color: var(--err); font-size: 13px; min-height: 18px; margin-bottom: 12px; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 14px;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
}
.stat-card .label { color: var(--text-soft); font-size: 13px; }
.stat-card .value { color: var(--brand); font-size: 28px; font-weight: 600; margin-top: 4px; }

.q-summary {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.q-summary h3 { font-size: 14px; color: var(--text); margin-bottom: 12px; font-weight: 500; }
.q-summary .bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.q-summary .bar-row .bar {
  height: 18px;
  background: var(--brand-light);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.q-summary .bar-row .bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--brand);
  border-radius: 4px;
}
.q-summary .text-list { font-size: 13px; color: var(--text-soft); line-height: 1.7; }
.q-summary .text-list .item {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.q-summary .text-list .item:last-child { border-bottom: none; }
.q-summary .who { color: var(--brand-dark); font-weight: 500; margin-right: 8px; }

.response-list { display: flex; flex-direction: column; gap: 12px; }
.resp-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}
.resp-card .resp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.resp-card .resp-name { color: var(--brand); font-size: 16px; font-weight: 600; }
.resp-card .resp-time { color: var(--text-light); font-size: 12px; }
.resp-card .qa { margin-bottom: 10px; font-size: 13px; line-height: 1.6; }
.resp-card .qa .label { color: var(--text-soft); margin-bottom: 2px; }
.resp-card .qa .value { color: var(--text); white-space: pre-wrap; }
.resp-card .qa .value.empty { color: var(--text-light); font-style: italic; }

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

/* Mobile */
@media (max-width: 640px) {
  .page { padding: 32px 18px 60px; }
  .hero h1 { font-size: 22px; }
  .radio-grid { grid-template-columns: 1fr; }
  .btn-submit { padding: 14px 50px; width: 100%; }
  .q-summary .bar-row { grid-template-columns: 100px 1fr 32px; font-size: 12px; }
}
