/* 小摘的個性：沉穩——深墨綠、襯線標題、單欄閱讀節奏、留白多。 */
:root {
  --ink: #16241f;
  --muted: #5d6f68;
  --line: #d9e3de;
  --bg: #f6f8f6;
  --card: #ffffff;
  --brand: #1f5c46;
  --brand-soft: #e8f1ec;
  --danger: #a8331f;
}

* {
  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:
    16px / 1.7 "Iowan Old Style",
    "Source Han Serif TC",
    "Noto Serif CJK TC",
    Georgia,
    serif;
}

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

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--brand);
}

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

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

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tagline {
  font-size: 26px;
  line-height: 1.4;
  margin: 0 0 12px;
}

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

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

.primary,
.secondary,
.ghost {
  font: inherit;
  font-size: 15px;
  border-radius: 8px;
  padding: 10px 18px;
  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-size: 14px;
}

.field {
  display: block;
  margin: 28px 0 16px;
}

.field > label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}

textarea {
  width: 100%;
  font: inherit;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  resize: vertical;
}

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

.choices legend {
  font-size: 14px;
  color: var(--muted);
  padding: 0 0 8px;
}

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

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

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

.run-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result {
  margin-top: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
}

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.result-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--brand);
}

.output {
  white-space: pre-wrap;
  min-height: 3em;
  margin: 14px 0 0;
}

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

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

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

@media (max-width: 600px) {
  main {
    padding: 24px 16px 60px;
  }

  .tagline {
    font-size: 22px;
  }
}

.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; }
