:root {
  --bg: #f7f3ed;
  --card: #ffffff;
  --ink: #2c2723;
  --muted: #6f665e;
  --line: #e7ddd0;
  --line-soft: #f1e9dd;
  --primary: #9d4436;
  --primary-dark: #7e352a;
  --accent: #9d4436;
  --good: #3f7a52;
  --bad: #a8503c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60, 45, 30, .05), 0 8px 24px rgba(60, 45, 30, .06);
}

/* ── Company header ─────────────────────────────────── */
.page-companies {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.page-company {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.page-company:hover .page-company-name {
  color: var(--primary);
}

.page-company-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.page-company-url {
  font-size: 0.78rem;
  color: var(--muted);
}

.page-separator {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--muted);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

h1, h2, h3 { line-height: 1.35; font-weight: 700; }

p { margin: 0 0 .85em; }

.body-text { color: #3d3730; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 34px 4px 30px;
  text-align: left;
}

.kicker {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 7vw, 40px);
  letter-spacing: .02em;
}

.lede {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 60ch;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.meta li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.meta strong { color: var(--ink); font-size: 15px; }

.result-hero { border-left: 4px solid var(--accent); padding-left: 20px; }

.headline {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}

.chips strong { display: block; color: var(--ink); font-size: 14px; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  margin-bottom: 18px;
}

.card-title {
  margin: 0 0 6px;
  font-size: 19px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.card-note {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--muted);
}

.card h3 {
  margin: 22px 0 8px;
  font-size: 15.5px;
  color: var(--accent);
}

.section-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.section-index {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.section-head h2 { margin: 0 0 2px; font-size: 18px; }

.section-note { margin: 0; font-size: 13px; color: var(--muted); }

/* ── Questions ────────────────────────────────────────── */
.question {
  border: 0;
  margin: 0 0 26px;
  padding: 0;
}

.question:last-child { margin-bottom: 4px; }

.question legend {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 0;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 15.5px;
  width: 100%;
}

.qnum {
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--line-soft);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.qtext { flex: 1 1 auto; }

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, white);
  color: var(--primary);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 700;
  vertical-align: middle;
}

.tag.muted { background: var(--line-soft); color: var(--muted); }

.hint {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #fdfaf4;
  border-left: 3px solid var(--line);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--muted);
}

.options { display: grid; gap: 8px; }

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdfb;
  cursor: pointer;
  font-size: 14.5px;
  transition: border-color .15s, background .15s;
}

.option:hover { border-color: #cdbba6; }

.option input {
  flex: 0 0 auto;
  margin: 4px 0 0;
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, white);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.question.missing .option { border-color: #e0a08c; }
.question.missing legend .qtext { color: var(--bad); }

/* ── Submit bar ───────────────────────────────────────── */
.submit-bar { text-align: center; padding: 22px; }

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 999px;
  transition: width .25s ease;
}

.progress-text { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

.submit-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 13px 34px;
  font-size: 15.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary:active { transform: translateY(1px); }

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: #cdbba6; color: var(--ink); }

/* ── Alert ────────────────────────────────────────────── */
.alert {
  background: #fdeee7;
  border: 1px solid #eebfa9;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  color: #8a3a22;
}

.alert strong { display: block; margin-bottom: 2px; font-size: 15px; }
.alert p { margin: 0; font-size: 13.5px; }

/* ── Result: distribution ─────────────────────────────── */
.dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.dist-row {
  display: grid;
  grid-template-columns: 62px 1fr 44px;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
}

.dist-row.top .dist-name { font-weight: 700; color: var(--ink); }
.dist-name { color: var(--muted); }

.dist-track {
  height: 10px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  display: block;
}

.dist-fill { display: block; height: 100%; border-radius: 999px; }

.dist-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.dist-row.top .dist-pct { color: var(--ink); font-weight: 700; }

/* ── Result: lists & advice ───────────────────────────── */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }

.checks li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: #3d3730;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

.checks.small li { font-size: 13.5px; }

.advice { display: grid; gap: 14px; margin-top: 8px; }

.advice-block {
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
}

.advice-block.good { background: #f2f7f2; border-color: #d6e5d6; }
.advice-block.bad { background: #fdf4f1; border-color: #f0dcd4; }

.advice-block h3 { margin: 0 0 8px; font-size: 14.5px; }
.advice-block.good h3 { color: var(--good); }
.advice-block.bad h3 { color: var(--bad); }

.advice-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.advice-block li { font-size: 14px; padding-left: 16px; position: relative; }
.advice-block.good li::before { content: "+"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.advice-block.bad li::before { content: "−"; position: absolute; left: 0; color: var(--bad); font-weight: 700; }

.steps { margin: 0; padding-left: 22px; display: grid; gap: 7px; }
.steps li { font-size: 14.5px; color: #3d3730; }
.steps li::marker { color: var(--accent); font-weight: 700; }

.tea {
  margin: 0;
  padding: 12px 16px;
  background: #fdfaf4;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
}

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

.points { width: 100%; border-collapse: collapse; font-size: 14px; }

.points th, .points td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.points th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.points td { color: #3d3730; }
.point-name { font-weight: 700; color: var(--accent) !important; white-space: nowrap; }

.secondary-grid { display: grid; gap: 14px; }

.mini {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fffdfb;
}

.mini h3 { margin: 0 0 4px; font-size: 16px; color: var(--accent); }
.mini-tag { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }

.western { background: #f6f8fb; border-color: #dde5ee; }
.western .card-title { border-left-color: #3d6b9e; color: #2f5580; }

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 26px 0 10px;
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }

.disclaimer {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: #8b8078;
}

@media (min-width: 640px) {
  .wrap { padding: 40px 24px 72px; }
  .card { padding: 28px 30px; }
  .advice { grid-template-columns: 1fr 1fr; }
  .secondary-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  .actions, .submit-bar { display: none; }
  .wrap { max-width: none; padding: 0; }
}
