/* 譯言的個性：明快——靛藍、無襯線、左右對照雙欄、控制項集中在上方一排。 */
:root {
  --ink: #17203a;
  --muted: #667089;
  --line: #dde2ee;
  --bg: #f7f8fc;
  --card: #ffffff;
  --brand: #3742a8;
  --brand-soft: #eceefb;
  --danger: #b02a37;
}

* {
  box-sizing: border-box;
}

/* Component display rules must not expose controls marked hidden. */
body [hidden] {
  display: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px / 1.6 "Inter",
    "Noto Sans TC",
    system-ui,
    -apple-system,
    sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.who {
  font-size: 13px;
  color: var(--muted);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.tagline {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.intro {
  max-width: 620px;
}

.intro p {
  color: var(--muted);
}

.fine {
  font-size: 13px;
  color: var(--muted);
}

.primary,
.secondary,
.ghost {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: 1px solid transparent;
}

.primary {
  background: var(--brand);
  color: #fff;
}

.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.secondary {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--line);
}

.ghost {
  background: none;
  color: var(--muted);
  border-color: transparent;
  padding: 6px 10px;
  font-weight: 500;
}

.controls {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pick label,
.choices legend {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  padding: 0;
}

select {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  min-width: 160px;
}

.choices {
  border: 0;
  padding: 0;
  margin: 0;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}

.seg {
  font: inherit;
  border: 0;
  background: none;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--muted);
}

.seg[aria-current="true"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.run-row {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pane {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 320px;
}

.pane > label,
.pane-head {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

textarea {
  flex: 1;
  width: 100%;
  font: inherit;
  border: 0;
  outline: none;
  resize: none;
  background: none;
  color: inherit;
}

.output {
  white-space: pre-wrap;
  margin: 0;
  flex: 1;
}

.receipt {
  display: block;
  white-space: pre-line;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.error {
  white-space: pre-line;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fdecee;
  color: var(--danger);
  font-size: 14px;
}

footer {
  text-align: center;
  padding: 20px;
}

@media (max-width: 820px) {
  .pair {
    grid-template-columns: 1fr;
  }

  .run-row {
    margin-left: 0;
  }
}

.beta-notice { margin: 0 0 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--brand-soft); font-size: 14px; line-height: 1.7; }
.beta-notice p { margin: 8px 0 0; }
.beta-notice a { color: var(--brand); text-decoration: underline; text-underline-offset: 0.15em; }
