:root {
  color-scheme: light;
  --cream: #fff8f0;
  --pink: #f6d8dc;
  --tan: #b99078;
  --gold: #e7c98f;
  --ink: #49352f;
  --muted: #745a51;
  --accent: #853c53;
  --line: #ead7ce;
  --shadow: 0 8px 28px #805b4010;
  font-family: "DM Sans", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--cream); line-height: 1.55; }
p, figure { margin: 0; }
.top { min-height: 57px; padding: 0 max(5vw, calc((100% - 1100px) / 2)); display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--accent); font-size: .69rem; letter-spacing: .15em; font-weight: 800; }
.brand-icon { display: grid; place-items: center; border-radius: 50%; background: var(--pink); font-size: 1rem; width: 28px; height: 28px; }
.hero { width: min(92%, 1060px); margin: 0 auto; padding: 1.1rem 0 1.4rem; display: grid; gap: .85rem; text-align: center; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: clamp(1.77rem, 7.4vw, 3.8rem); font-weight: 850; letter-spacing: .018em; text-wrap: balance; }
.cast { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; width: min(100%, 350px); margin: auto; }
.character {
  display: grid;
  justify-items: center;
  border: 1px solid #49352f0d;
  padding: .25rem .25rem .38rem;
  border-radius: 19px;
  background: var(--tint);
  box-shadow: var(--shadow);
}
.luxurist { --tint: #f6d8dc; }
.guardian { --tint: #e2eedc; }
.explorer { --tint: #e0eef8; }
.achiever { --tint: #fae8be; }
.character img { width: min(100%, 135px); height: auto; display: block; mix-blend-mode: multiply; }
.character figcaption { font-size: .86rem; font-weight: 760; }
.hero-copy { display: grid; justify-items: center; gap: .68rem; }
.lead { font-size: .87rem; text-wrap: balance; }
.lead strong { font-size: 1.03rem; }
.intro { color: var(--muted); font-size: .81rem; }
button { cursor: pointer; min-height: 48px; padding: .65rem 1.05rem; border: 1px solid transparent; border-radius: 100px; font: inherit; font-weight: 750; }
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { color: #fff; background: var(--accent); box-shadow: 0 4px 13px #853c5325; }
.primary:hover:enabled { background: #703047; }
.primary:disabled { opacity: .52; cursor: default; }
#start { width: min(100%, 265px); }
#start span { margin-left: .55rem; }
.quiet { color: var(--ink); background: #fffcf8; border-color: var(--line); }
.quiet:hover { background: #fbece8; }
.page { width: min(92%, 660px); margin: auto; padding: clamp(1.15rem, 5vw, 3.5rem) 0; }
.quiz-card, .result-card { background: #fffcf8; border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--shadow); }
.quiz-card { padding: clamp(1rem, 5vw, 2rem); }
.progress-label, .actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.progress-label { color: var(--accent); font-size: .88rem; font-weight: 750; }
progress { appearance: none; width: 100%; height: 7px; border: 0; margin: .65rem 0 1.4rem; background: #f3e5df; border-radius: 9px; overflow: hidden; }
progress::-webkit-progress-bar { background: #f3e5df; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 9px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 9px; }
h2 { font-size: clamp(1.4rem, 5.5vw, 2.3rem); text-wrap: balance; }
fieldset { min-width: 0; margin: 1rem 0 1.3rem; padding: 0; border: 0; display: grid; gap: .65rem; }
.option { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr); gap: .7rem; align-items: center; padding: .8rem; min-height: 56px; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; transition: background-color 140ms, border-color 140ms, transform 140ms; }
.option:has(input:checked) { border-color: var(--accent); background: #fae9ed; transform: translateX(2px); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=radio] { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }
.result-card { overflow: hidden; }
.result-hero { text-align: center; padding: 1rem .85rem 1.25rem; background: var(--result-tint); color: var(--result-ink); }
.result-hero img { display: block; margin: auto; width: min(82%, 255px); height: auto; mix-blend-mode: multiply; }
.tag { font-size: .75rem; font-weight: 850; letter-spacing: .19em; margin: .4rem 0; }
.result-line { margin: .45rem 0 0; font-weight: 700; }
.result-copy { padding: clamp(1rem, 5vw, 1.8rem); }
dl { display: grid; gap: .75rem; margin: 1rem 0 0; }
dl > div { padding: .85rem; background: var(--cream); border-radius: 15px; }
dt { color: var(--result-ink); font-weight: 800; margin-bottom: .25rem; }
dd { margin: 0; font-size: .93rem; }
.result-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; margin-top: .9rem; }
#download { grid-column: 1 / -1; }
.status, details { color: var(--muted); font-size: .87rem; }
.status { margin-top: .5rem; }
details { margin: .8rem 0; }
details p { margin-top: .4rem; }
summary { cursor: pointer; padding: .5rem 0; }
.manual-link { display: grid; gap: .25rem; margin-top: .5rem; }
.manual-link input { width: 100%; padding: .6rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; }
footer { text-align: center; padding: .85rem 7vw 1.25rem; border-top: 1px solid var(--line); font-size: .77rem; color: var(--muted); }
@media (min-width: 800px) {
  .hero { min-height: min(695px, calc(100svh - 110px)); grid-template-columns: 1fr 1.14fr; grid-template-rows: 1fr 1fr; align-items: center; column-gap: clamp(1rem, 5vw, 4rem); text-align: left; padding: 2.5rem 0; }
  .hero-title { align-self: end; }
  .hero-copy { grid-column: 1; align-self: start; justify-items: start; gap: 1rem; }
  .lead { font-size: 1rem; }
  .lead strong { font-size: 1.3rem; }
  .intro { font-size: 1rem; }
  .cast { grid-column: 2; grid-row: 1 / 3; width: 100%; gap: .9rem; }
  .character { border-radius: 24px; padding-bottom: .7rem; }
  .character img { width: min(100%, 216px); }
  .character figcaption { font-size: 1rem; }
  dl { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-template-columns: 1.35fr 1fr 1fr; }
  #download { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .option { transition: none; }
  .option:has(input:checked) { transform: none; }
}
