:root { --ink: #172023; --muted: #5b676c; --line: #d7dee2; --soft: #f5f7f7; --accent: #087785; --signal: #b94a3a; --paper: #fff; }
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.72; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--signal); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #69a8af; outline-offset: 2px; }

.qg-top { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 14px; }
.qg-top a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.qg-top .qg-brand { color: var(--ink); font-weight: 720; margin: 0; }

/* Home: one centred box, nothing else above the fold. */
.qg-home { min-height: calc(100svh - 52px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 16px 12vh; position: relative; }
.qg-home h1 { margin: 0 0 22px; font-size: clamp(24px, 5.6vw, 36px); line-height: 1.3; text-align: center; }
.qg-box { width: min(640px, 100%); display: flex; align-items: center; border: 1.5px solid #c5d0d4; border-radius: 28px; padding: 5px 5px 5px 20px; background: #fff; box-shadow: 0 2px 10px rgba(23, 32, 35, .06); transition: box-shadow .15s, border-color .15s; }
.qg-box:focus-within { border-color: var(--accent); box-shadow: 0 4px 18px rgba(8, 119, 133, .16); }
.qg-box input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 17px; padding: 9px 0; color: var(--ink); background: transparent; }
.qg-box button { flex: none; border: 0; border-radius: 22px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; padding: 10px 20px; cursor: pointer; }
.qg-box button:disabled { opacity: .55; cursor: wait; }
.qg-short { display: none; }
.qg-error { max-width: 640px; margin: 10px 0 0; font-size: 14px; color: #a72a21; text-align: center; }
.qg-try { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }
.qg-try button { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 2px 4px; }
.qg-more { position: absolute; bottom: 22px; font-size: 13px; color: var(--muted); text-decoration: none; }

/* Result mode: the box moves up and results take the space. */
body.qg-busy .qg-home, body.qg-done .qg-home { min-height: 0; padding: 14px 16px 0; justify-content: flex-start; }
body.qg-busy .qg-home h1, body.qg-done .qg-home h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.qg-busy .qg-try, body.qg-done .qg-try, body.qg-busy .qg-more, body.qg-done .qg-more { display: none; }
.qg-results { width: min(640px, calc(100% - 32px)); margin: 0 auto; display: none; }
body.qg-busy .qg-results, body.qg-done .qg-results { display: block; }
.qg-loading { color: var(--muted); padding: 28px 4px; margin: 0; }
.qg-meta { font-size: 13px; color: var(--muted); margin: 14px 4px 0; }
.qg-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.qg-tabs button { flex: none; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 14px; color: var(--muted); padding: 10px 0; cursor: pointer; }
.qg-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); font-weight: 700; }
.qg-note { font-size: 13px; color: var(--muted); margin: 12px 4px 4px; }
.qg-list { list-style: none; margin: 0; padding: 0; }
.qg-list button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid #eef2f3; background: none; padding: 12px 4px; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.qg-list button:hover { background: var(--soft); }
.qg-list span { font-size: 16px; overflow-wrap: anywhere; }
.qg-list small { flex: none; font-size: 12px; color: var(--accent); }
.qg-acts { display: flex; gap: 16px; margin: 14px 4px 0; }
.qg-acts button { border: 0; background: none; font: inherit; font-size: 14px; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }
.qg-fine { font-size: 12px; color: var(--muted); margin: 14px 4px 0; }
.qg-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.qg-toast.show { opacity: 1; }

/* Crawlable reading content, below the fold. */
.qg-content { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 40px; }
body.qg-busy .qg-content, body.qg-done .qg-content { margin-top: 48px; }
.qg-content section { border-top: 1px solid var(--line); padding-top: 26px; margin-top: 30px; }
.qg-content section:first-child { margin-top: 0; }
.qg-content h2 { font-size: 21px; margin: 0 0 10px; }
.qg-content h3 { font-size: 17px; margin: 0 0 6px; }
.qg-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; list-style: none; }
.qg-stages li { background: var(--soft); border-radius: 10px; padding: 14px; font-size: 14px; }
.qg-stages b { display: block; color: var(--accent); margin-bottom: 4px; }
.qg-samples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.qg-samples div { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.qg-samples ul { padding-left: 18px; margin: 0; font-size: 14px; }
.qg-faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.qg-faq summary { font-weight: 700; cursor: pointer; }
.qg-faq p { margin: 8px 0 0; }
.qg-links { margin-top: 28px; font-size: 14px; color: var(--muted); }
.qg-footer { border-top: 1px solid var(--line); padding: 16px 16px 28px; font-size: 13px; color: var(--muted); text-align: center; }
.qg-footer p { margin: 0; }

@media (max-width: 640px) {
  .qg-stages, .qg-samples { grid-template-columns: 1fr; }
  .qg-box { padding-left: 16px; }
  .qg-box button { padding: 10px 18px; }
  .qg-long { display: none; }
  .qg-short { display: inline; }
}
