:root {
  color-scheme: light;
  --ink: #122a25;
  --muted: #516860;
  --green: #164f3e;
  --bright: #e8f1e8;
  --line: #d8e2d7;
  --surface: #fff;
  --paper: #f3f7ef;
  --warm: #f9e1aa;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--green); }
.top { min-height: 67px; border-bottom: 1px solid var(--line); background: #fbfdf8; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px max(22px, calc((100vw - 1350px) / 2)); }
.brand { font-weight: 800; white-space: nowrap; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand i { width: 13px; height: 13px; background: #35775c; border-radius: 4px; transform: rotate(-10deg); }
nav { display: flex; align-items: center; gap: 18px; }
nav a { font-size: .92rem; white-space: nowrap; text-decoration: none; font-weight: 650; }
nav a:hover { text-decoration: underline; }
main { max-width: 1400px; margin: 0 auto; padding: 30px 26px 55px; }
main.narrow { max-width: 670px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.65rem); letter-spacing: -.045em; line-height: 1.15; font-weight: 850; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.16rem, 2vw, 1.45rem); line-height: 1.25; }
p { line-height: 1.7; color: var(--muted); }
.hero { padding: 14px 0 24px; }
.hero p { margin-top: 14px; max-width: 620px; }
.eyebrow { color: #376752; font-size: .875rem; letter-spacing: .12em; font-weight: 750; margin-bottom: 12px; }
.home-grid { display: grid; grid-template-columns: 1.65fr 1fr; align-items: stretch; gap: 24px; margin-bottom: 22px; }
.home-grid .hero { padding: 30px 0; }
.price-panel { background: var(--green); color: #fff; border-radius: 20px; padding: 27px; display: flex; flex-direction: column; justify-content: center; min-height: 235px; }
.price-panel > div:first-child { color: #d7e5d7; margin-bottom: 9px; font-size: .9rem; }
.price { font-variant-numeric: tabular-nums; font-size: 4.5rem; font-weight: 850; color: var(--warm); line-height: 1.22; letter-spacing: -.07em; }
.price small { font-size: 1.3rem; letter-spacing: 0; }
.price-panel p, .price-panel a { color: #f0f7ec; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.pad, .empty { padding: 22px; }
.empty { color: var(--muted); }
.setup { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.setup p { margin-top: 5px; }
.section-head, .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head { margin: 25px 0 12px; }
.field-row { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; }
.field-row label { display: grid; gap: 5px; flex: 1; min-width: min(100%, 210px); font-size: .9rem; font-weight: 700; }
.field-row p { width: 100%; }
.field-row p:empty { display: none; }
input, select, button, .button { font: inherit; min-height: 43px; border-radius: 8px; }
input, select { background: #fcfdfa; color: var(--ink); border: 1px solid #aebfb3; padding: 8px 12px; min-width: 0; width: 100%; }
button, .button { background: var(--green); color: #fff; border: 1px solid transparent; font-weight: 700; text-decoration: none; padding: 8px 15px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
button:hover, .button:hover { filter: brightness(1.12); }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: #fff; color: var(--green); border-color: #a9c5b3; }
:focus-visible { outline: 3px solid #b45c2e; outline-offset: 3px; }
.history-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; text-decoration: none; gap: 12px; color: var(--ink); }
.history-row + .history-row { border-top: 1px solid var(--line); }
.history-row:hover { background: #f5faf5; }
.history-row small { display: block; margin-top: 4px; color: var(--muted); font-size: .85rem; }
.status { display: inline-block; border-radius: 20px; padding: 4px 12px; font-size: .85rem; font-weight: 750; white-space: nowrap; }
.active { color: #135941; background: #dff0df; }
.closed { color: #445b50; background: #e8eee7; }
.live-top { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.live-top h1 { font-size: clamp(2rem, 4.1vw, 3.35rem); }
.live-top p { margin-top: 7px; }
.live-count { text-align: right; white-space: nowrap; align-self: end; }
.live-count strong { font-size: 2.5rem; color: var(--green); line-height: 1.12; }
.live-count div { margin-top: 5px; }
.separator { padding: 0 5px; }
.join-panel { display: flex; align-items: end; gap: 16px; border: 1px solid #baccb8; border-radius: 14px; background: var(--bright); padding: 10px 18px; margin-bottom: 14px; }
.join-panel small, .join-panel label { color: #315e4b; font-size: .86rem; font-weight: 700; }
.room-code { font-family: ui-monospace, monospace; font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: .1em; line-height: 1.13; }
.join-field { flex: 1; min-width: 120px; }
.join-field input { min-height: 36px; margin-top: 3px; font-size: .89rem; }
.toolbar { display: flex; justify-content: end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.report { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); align-items: start; gap: 15px; }
.card-head { padding: 15px 17px; }
.card-head span { color: var(--muted); font-size: .86rem; }
.chart { display: block; width: 100%; height: auto; }
.chart text { font: 15px system-ui, sans-serif; fill: #435c53; }
.chart .gridline { stroke: #e0e8df; }
.chart .axis { stroke: #72867c; fill: none; stroke-width: 1.5; }
.chart .benchmark { stroke: #9b5825; stroke-dasharray: 5 4; stroke-width: 1.6; }
.chart .benchmark-label { fill: #824c26; font-weight: 650; }
.chart-empty { min-height: 285px; display: grid; place-items: center; }
.note { border-top: 1px solid var(--line); padding: 11px 16px; font-size: .87rem; color: var(--muted); line-height: 1.55; }
.note a { margin-left: 6px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 12px; border-bottom: 1px solid #e3ebe1; }
thead { background: #f0f5ee; font-size: .87rem; }
thead small { font-weight: 450; color: var(--muted); font-size: .8rem; }
tbody th { font-weight: 700; }
tbody tr:last-child :is(th, td) { border-bottom: none; }
.reference-row { background: #fcf3dd; }
.connection { margin: 0 0 10px; color: #8a441e; }
.answer-head, .answer-row { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; align-items: center; }
.answer-head { background: var(--bright); padding: 12px; border-radius: 8px; font-weight: 750; }
.answer-row { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.answer-row strong { font-size: 1.2rem; }
.answer-submit { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.error { color: #9a2824; }
.success { color: #155e47; }
.message { padding: 15px; }
.compare-controls { margin-bottom: 14px; display: flex; gap: 20px; flex-wrap: wrap; align-items: end; }
.compare-controls fieldset { border: 0; padding: 0; margin: 0; flex: 1; min-width: 250px; }
.compare-controls legend, .compare-controls > label { font-weight: 700; }
.choices, .legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-top: 6px; }
.choices label, .legend span { overflow-wrap: anywhere; }
.choices input { width: 17px; min-height: 17px; accent-color: var(--green); margin: 0 2px 0 0; vertical-align: middle; }
.compare-controls select { margin-top: 5px; }
.compare-chart .chart { max-width: 865px; margin: auto; }
.legend { justify-content: center; padding: 8px 16px 14px; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.compare-tables { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; gap: 14px; }
.compare-tables :is(th, td) { min-width: 76px; }
.projector { max-width: 1550px; padding-top: 18px; }
.projector .report table { font-size: clamp(1rem, 1.35vw, 1.24rem); }
.projector .card-head h2 { font-size: clamp(1.2rem, 1.8vw, 1.65rem); }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; max-width: calc(100vw - 26px); border-radius: 10px; padding: 10px 16px; opacity: 0; pointer-events: none; }
#toast.show { opacity: 1; }
@media (max-width: 850px) {
  .report, .compare-tables, .home-grid { grid-template-columns: 1fr; }
  .home-grid .hero { padding: 14px 0 0; }
  .price-panel { min-height: 0; }
  .setup { align-items: start; flex-direction: column; }
  .field-row { width: 100%; }
}
@media (max-width: 540px) {
  .top { align-items: start; padding: 12px 14px; flex-direction: column; gap: 8px; }
  nav { gap: 14px; }
  main { padding: 18px 12px 35px; }
  .join-panel { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .join-field { order: 3; flex-basis: 100%; }
  .join-panel button { margin-left: auto; }
  .live-top { align-items: start; gap: 8px; }
  .live-count strong { font-size: 1.65rem; }
  .pad { padding: 12px; }
  th, td { padding: 6px 8px; }
}

.elasticity-value {
  min-height: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: .24em;
  cursor: help;
}
#elasticity-tooltip {
  position: fixed;
  z-index: 2;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 22px #122a2524;
  pointer-events: none;
  text-align: center;
  font-size: 1rem;
}
.elasticity-math { display: grid; gap: 9px; margin-top: 8px; }
.elasticity-math math { font-size: clamp(.79rem, 2.4vw, 1.13rem); }
