* { box-sizing: border-box; }
body {
  margin: 0; background: #f3f5f9; color: #222; line-height: 1.5; font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "PingFang TC", "Microsoft JhengHei", sans-serif;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 16px; }
header.top { background: linear-gradient(135deg, #2b59c3, #4a7be0); color: #fff; }
header.top h1 { margin: 8px 0 4px; font-size: 1.5rem; }
header.top p { margin: 0 0 8px; opacity: .9; }

.q, .card {
  background: #fff; border-radius: 12px; padding: 16px; margin: 0 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.q h3, .card h3 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.4; }
.num {
  display: inline-block; background: #2b59c3; color: #fff; border-radius: 50%;
  width: 26px; height: 26px; line-height: 26px; text-align: center; font-size: .85rem; margin-right: 8px;
}
.req { color: #d33; }
.hint { color: #666; font-size: .9rem; margin: -2px 0 10px; }
.center { text-align: center; }

.options { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .options.cols2 { grid-template-columns: 1fr 1fr; } }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 48px;
  border: 1px solid #d7dce5; border-radius: 8px; cursor: pointer; background: #fff;
}
.opt:hover { border-color: #2b59c3; }
.opt:has(input:checked) { border-color: #2b59c3; background: #eef3ff; }
.opt input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: #2b59c3; }
.opt.disabled { opacity: .45; cursor: not-allowed; }

select, input[type=text], textarea {
  width: 100%; padding: 12px; font-size: 16px; /* 16px stops iOS zoom */
  border: 1px solid #c9cfda; border-radius: 8px; background: #fff; font-family: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.other-input { margin-top: 8px; }

.has-error { border: 2px solid #d33; }
.error { color: #d33; font-weight: 600; margin: 0 0 8px; }
.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert.err { background: #fdeaea; color: #a12; }
.alert.info { background: #eef3ff; color: #234; }
.thanks { text-align: center; padding: 40px 16px; }

.btn {
  display: block; width: 100%; padding: 16px; font-size: 1.1rem; border: 0; border-radius: 10px;
  background: #2b59c3; color: #fff; cursor: pointer; text-align: center; text-decoration: none;
}
.btn:disabled { opacity: .6; }
.btn.small { display: inline-block; width: auto; padding: 10px 16px; font-size: .95rem; margin: 0 6px 6px 0; }
.btn.light { background: #dfe6f5; color: #234; }
.toolbar { margin: 0 0 12px; }

/* Results */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 12px; padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); color: #555; }
.stat b { display: block; font-size: 1.8rem; color: #2b59c3; }
.stat b.small { font-size: 1.1rem; padding: 8px 0; }
.bar-row { margin: 10px 0; }
.bar-row.zero { opacity: .5; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; }
.bar-label span:last-child { white-space: nowrap; color: #555; }
.bar { background: #e8ecf3; border-radius: 6px; height: 12px; overflow: hidden; margin-top: 3px; }
.bar span { display: block; height: 100%; background: #2b59c3; border-radius: 6px; }
.others { margin-top: 12px; font-size: .92rem; }
.tag { display: inline-block; background: #eef3ff; border-radius: 14px; padding: 3px 10px; margin: 4px 4px 0 0; }
.comment { border-top: 1px solid #eee; padding: 10px 0; }
.meta { font-size: .85rem; color: #777; margin-bottom: 4px; }
/* Language switch */
.lang-switch { text-align: right; padding-top: 6px; font-size: .9rem; }
.lang-switch a, .lang-switch span {
  display: inline-block; padding: 6px 14px; margin-left: 6px; border-radius: 16px;
  border: 1px solid rgba(255,255,255,.7); color: #fff; text-decoration: none;
}
.lang-switch a:hover { background: rgba(255,255,255,.15); }
.lang-switch .active { background: #fff; color: #2b59c3; font-weight: 600; }

/* Better Chinese font on Windows / Android */
html[lang="zh-Hant"] body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei",
               "Noto Sans TC", "Segoe UI", Roboto, Arial, sans-serif;
}
