:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: #24372e; background: #f7f8f4; font-size: 14px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
header { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid #e4e8df; background: #fcfdf9; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 36px; height: 36px; }
.brand strong { display: block; font-size: 17px; font-weight: 650; }
.brand div > span { display: block; margin-top: 3px; color: #839085; font-size: 9px; letter-spacing: 2px; }
.local { color: #4b695a; font-size: 11px; background: #eaf0e7; padding: 7px 10px; border-radius: 20px; white-space: nowrap; }
.local > span { color: #59856b; font-size: 8px; margin-right: 3px; }
main { max-width: 640px; padding: 28px; margin: auto; }
.eyebrow { font-size: 11px; color: #71816e; letter-spacing: 2px; }
h1 { font-size: 25px; line-height: 1.4; letter-spacing: -.7px; font-weight: 650; margin: 9px 0 10px; }
.intro p { color: #758078; line-height: 1.75; font-size: 13px; margin: 0 0 24px; }
.section-label { display: flex; justify-content: space-between; color: #768378; font-size: 11px; margin-bottom: 10px; }
.section-label > :last-child { color: #929b91; }
.preview { position: relative; min-height: 150px; height: 204px; border: 1px solid #e2e7db; border-radius: 16px; background: #eff2e9; padding: 18px; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.preview img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 3px; }
.busy { position: absolute; bottom: 10px; padding: 6px 12px; border-radius: 16px; background: #234f3e; color: white; font-size: 11px; box-shadow: 0 2px 10px #234f3e20; }
.dots { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.result-card { background: white; border: 1px solid #dfe6dc; border-radius: 16px; margin-top: 18px; padding: 18px; box-shadow: 0 3px 12px #29433204; }
.result-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.result-kind { color: #3d7858; background: #edf5eb; border-radius: 5px; padding: 4px 7px; }
.result-number { color: #98a095; font-size: 10px; }
.link-host { margin: 12px 0 0; font-size: 12px; color: #728172; overflow-wrap: anywhere; }
.result-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 12px 0 18px; max-height: 210px; overflow: auto; }
.result-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.button { border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font: inherit; font-size: 12px; font-weight: 550; cursor: pointer; transition: background .15s; }
.primary { color: white; background: #285841; }
.primary:hover { background: #1e4633; }
.secondary { background: white; color: #4b6454; border-color: #dae3d7; }
.secondary:hover { background: #eff4eb; }
.button:focus-visible, .result-text:focus-visible { outline: 3px solid #8fbf9f; outline-offset: 3px; }
.button:disabled { opacity: .5; cursor: wait; }
.small { padding: 9px 11px; flex-shrink: 0; }
.original-section { padding: 16px; border: 1px solid #e6ddc7; border-radius: 12px; background: #fbf8ef; margin-top: 18px; }
.original-section p { font-size: 12px; color: #857451; line-height: 1.7; overflow-wrap: anywhere; margin: 0 0 10px; }
.upload-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px 16px; border: 1px dashed #cfdacb; border-radius: 13px; margin-top: 24px; background: #fcfdf9; }
.upload-zone.dragging { border-color: #3d7954; background: #eaf3e7; }
.upload-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: #6c8567; background: #edf1e7; font-size: 20px; }
.upload-zone > div:nth-child(2) { flex: 1; min-width: 160px; }
.upload-zone strong { font-size: 12px; font-weight: 550; }
.upload-zone p { color: #929a8c; font-size: 10px; line-height: 1.5; margin: 5px 0 0; }
.feedback { font-size: 12px; color: #4d7758; min-height: 18px; line-height: 1.6; margin: 12px 0; }
.feedback.error { color: #aa573f; }
footer { text-align: center; color: #99a091; font-size: 10px; line-height: 1.6; margin-top: 16px; }
.text-button { font: inherit; color: #7b8979; padding: 6px; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-button:focus-visible { outline: 2px solid #8fbf9f; }
@media (max-width: 390px) { header { padding: 18px; } main { padding: 22px 18px; } h1 { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .dots { animation: none; } .button { transition: none; } }

/* Compact result window: the first result and its actions fit together. */
:root { --page: #f7f8f4; --surface: #fff; --soft: #eef2e9; --ink: #24372e; --muted: #5b6e60; --border: #dce4d8; color: var(--ink); background: var(--page); }
header { padding: 16px 24px; background: var(--surface); border-color: var(--border); }
.header-actions { display: flex; align-items: center; gap: 10px; }
main { padding: 22px 24px; }
h1 { margin: 8px 0; font-size: 24px; }
.intro p { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.eyebrow, .section-label, .section-label > :last-child, .link-host { color: var(--muted); }
.preview { height: 172px; min-height: 130px; background: var(--soft); border-color: var(--border); padding: 14px; }
.result-card { padding: 16px; margin-top: 14px; background: var(--surface); border-color: var(--border); }
.result-number { color: var(--muted); font-size: 11px; }
.result-text { margin: 10px 0 14px; font-size: 13px; }
.button { min-height: 42px; font-size: 13px; }
.text-button { display: inline-block; font-size: 12px; color: var(--muted); min-height: 32px; padding: 7px; }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.secondary:hover { background: var(--soft); }
.results-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; }
.upload-zone { padding: 15px 14px; margin-top: 18px; background: var(--surface); border-color: #bacbb5; }
.upload-zone p { color: var(--muted); font-size: 11px; }
.feedback { margin: 8px 0; min-height: 0; }
.feedback:empty { display: none; }
footer { color: var(--muted); font-size: 11px; margin-top: 16px; }
footer > p { margin: 0 0 7px; }
.privacy-controls summary { width: fit-content; margin: auto; cursor: pointer; padding: 6px 12px; font-size: 12px; }
.privacy-controls > div { margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; }
.version { font-size: 11px; padding: 7px; }
summary:focus-visible { outline: 3px solid #8fbf9f; outline-offset: 2px; border-radius: 5px; }
#cancel-button { margin-bottom: 14px; }
.policy main { max-width: 720px; font-size: 14px; line-height: 1.85; }
.policy h2 { font-size: 18px; margin-top: 28px; }
.policy a { color: #326c49; }
.policy .updated { color: var(--muted); font-size: 12px; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --page: #141c18; --surface: #1c2821; --soft: #233329; --ink: #e1ecdf; --muted: #acbeae; --border: #35483a; }
  .brand div > span { color: var(--muted); }
  .local, .result-kind, .upload-icon { background: #294334; color: #c5e5c5; }
  .primary { background: #a8d3ae; color: #163321; }
  .primary:hover { background: #bce4c0; }
  .original-section { background: #322e22; border-color: #635b3c; }
  .original-section p { color: #dfd2a6; }
  .feedback { color: #b0dab4; }
  .feedback.error { color: #ffc0a9; }
  .upload-zone.dragging { background: #294334; border-color: #b0dab4; }
  .policy a { color: #b0dab4; }
}
@media (max-width: 390px) { header { padding: 14px 18px; } main { padding: 20px 18px; } .local { font-size: 10px; } }
@media (min-width: 960px) {
  main { max-width: 1080px; }
  .preview-section { float: left; width: 38%; margin-right: 4%; }
  .preview { height: 316px; }
  #results, #results-tools, .original-section { margin-left: 42%; }
  .upload-zone { clear: both; }
  .policy main { max-width: 720px; }
}
