:root {
 color-scheme: light;
 --forest: #084a3a;
 --ink: #1b3028;
 --muted: #5e6c64;
 --line: #d9e0d8;
 --paper: #f8f9f6;
 --white: #fff;
 --sand: #9b742f;
 --radius: 18px;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
 margin: 0;
 min-height: 100vh;
 min-height: 100svh;
 color: var(--ink);
 background: var(--paper);
 font: 16px/1.65 -apple-system, BlinkMacSystemFont, "PingFang HK", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
}

button, textarea { font: inherit; }
button, a, textarea { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
 position: fixed;
 z-index: 10;
 inset: 8px auto auto 8px;
 transform: translateY(-160%);
 padding: 10px 14px;
 border-radius: 8px;
 color: var(--white);
 background: var(--forest);
}
.skip:focus { transform: translateY(0); }

.site-shell {
 display: flex;
 flex-direction: column;
 width: min(100% - 64px, 1120px);
 min-height: 100vh;
 min-height: 100svh;
 margin-inline: auto;
}

.site-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 min-height: 94px;
 gap: 24px;
 border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; min-width: 0; }
.brand-logo { display: block; width: min(100%, 210px); height: auto; object-fit: contain; }
.service-name { color: var(--forest); font-size: 14px; font-weight: 600; white-space: nowrap; text-align: right; }
.service-status { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; }

main {
 width: min(100%, 760px);
 margin: 0 auto;
 padding: clamp(36px, 6vh, 68px) 0 56px;
 flex: 1;
}

h1 {
 max-width: 18ch;
 margin: 0 0 14px;
 color: var(--forest);
 font-family: Georgia, "Songti TC", "Noto Serif CJK TC", serif;
 font-size: clamp(32px, 4.4vw, 46px);
 font-weight: 500;
 line-height: 1.35;
 letter-spacing: .01em;
 text-wrap: balance;
}

.question-card {
 padding: 22px 24px 18px;
 border: 1px solid #c9d5c9;
 border-radius: var(--radius);
 background: var(--white);
 box-shadow: 0 14px 38px rgb(23 53 44 / 5%);
}

.intro { max-width: 38em; margin: 0 0 10px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.library-meta { min-height: 22px; margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 22px; }

.question-card label { display: block; margin-bottom: 8px; color: var(--forest); font-size: 14px; font-weight: 600; }
.question-card textarea {
 display: block;
 width: 100%;
 min-height: 80px;
 max-height: 240px;
 padding: 10px 0 14px;
 resize: none;
 border: 0;
 border-bottom: 1px solid var(--line);
 border-radius: 0;
 color: var(--ink);
 background: transparent;
 font-size: 16px;
 line-height: 1.75;
}
.question-card textarea::placeholder { color: #7b8780; opacity: 1; }
.question-card textarea:focus-visible { outline-offset: 4px; }

.question-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding-top: 16px; }
.question-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100%; margin-left: auto; }
.question-bottom span { color: var(--muted); font-size: 12px; }
.question-bottom button, .text-button {
 min-height: 48px;
 padding: 10px 22px;
 border: 1px solid var(--forest);
 border-radius: 10px;
 color: var(--white);
 background: var(--forest);
 font-size: 15px;
 font-weight: 600;
 transition: background-color 120ms ease, border-color 120ms ease;
}
.question-bottom button:hover:not(:disabled), .text-button:hover { border-color: #0c6049; background: #0c6049; }
.question-bottom button:active:not(:disabled) { background: #06392d; }
.question-bottom .secondary-button, .secondary-button { color: var(--forest); border: 1px solid #b9cbbb; background: var(--white); }
.question-bottom .secondary-button:hover:not(:disabled) { color: var(--forest); background: #eef3ed; }

.examples { margin-top: 20px; }
.examples > p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.example-list { display: flex; flex-wrap: wrap; gap: 8px; }
.example-list button { max-width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid #cbd8c9; border-radius: 12px; color: var(--forest); background: var(--paper); font-size: 14px; line-height: 1.55; text-align: left; overflow-wrap: anywhere; transition: background-color 120ms ease, border-color 120ms ease; }
.example-list button:hover:not(:disabled) { border-color: #8eab91; background: #edf3eb; }
.example-list button:disabled { cursor: default; opacity: .55; }

.disclaimer { margin: 18px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.answer {
 scroll-margin-top: 24px;
 margin-top: 34px;
 padding: 26px 28px;
 border: 1px solid var(--line);
 border-radius: var(--radius);
 background: var(--white);
}
.answer h2 { margin: 0 0 15px; color: var(--forest); font-size: 18px; font-weight: 600; }
.answer > p:not(.answer-copy) { margin: 0; color: var(--muted); font-size: 15px; }
.answer-copy { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.text-button { margin-top: 16px; color: var(--forest); background: var(--white); }
.answer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.answer-actions .text-button { margin-top: 0; min-height: 44px; padding: 8px 14px; font-size: 14px; }
.copy-feedback { color: var(--muted); font-size: 13px; }
.answer > p.progress-elapsed { margin: 14px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.progress-heading { display: flex; align-items: center; gap: 10px; }
.progress-spinner { flex: 0 0 18px; width: 18px; height: 18px; border: 2px solid #d9e3d6; border-top-color: var(--forest); border-radius: 50%; animation: search-spin 900ms linear infinite; }
@keyframes search-spin { to { transform: rotate(360deg); } }

footer {
 display: flex;
 justify-content: flex-end;
 padding: 18px 0 22px;
 border-top: 1px solid var(--line);
 color: var(--muted);
 font-size: 12px;
}

@media (max-width: 600px) {
 .site-shell { width: min(100% - 40px, 760px); }
 .site-header { min-height: 78px; gap: 16px; }
 .brand-logo { width: min(44vw, 188px); }
 .service-name { font-size: 13px; }
 main { padding: 32px 0 42px; }
 h1 { margin-bottom: 12px; font-size: clamp(30px, 8vw, 38px); }
 .question-card { padding: 19px 18px 16px; }
 .question-card textarea { min-height: 80px; }
 .question-bottom { align-items: flex-end; }
 .question-bottom button { min-width: 88px; padding-inline: 16px; }
 .answer { margin-top: 26px; padding: 22px 18px; }
 .answer-copy { font-size: 16px; }
}

@media (max-width: 360px) {
 .site-shell { width: min(100% - 32px, 760px); }
 .service-name { font-size: 12px; }
 .question-bottom { gap: 8px; }
 .question-bottom span { font-size: 11px; }
 .question-bottom button { min-width: 84px; padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
