:root {
  color-scheme: light dark;
  --canvas: #f4f6ef;
  --surface: #ffffff;
  --surface-muted: #e8eee3;
  --ink: #1d2920;
  --muted: #68736a;
  --line: #cfd8cc;
  --accent: #285a3f;
  --accent-hover: #1c472f;
  --accent-ink: #f6fbf5;
  --warning: #974c30;
  --radius: 18px;
  --shadow: 0 18px 38px rgb(30 52 34 / 9%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #141b16;
    --surface: #1d2820;
    --surface-muted: #253328;
    --ink: #edf4eb;
    --muted: #b4c1b4;
    --line: #3c5141;
    --accent: #84b58b;
    --accent-hover: #a5cba9;
    --accent-ink: #132317;
    --warning: #f0aa8a;
    --shadow: 0 18px 38px rgb(0 0 0 / 18%);
  }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.access-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.access-gate[hidden], .shell[hidden] { display: none !important; }
.access-card { width: min(100%, 440px); display: grid; gap: 14px; padding: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.access-card .brand-mark { margin-bottom: 12px; }.access-card .kicker { margin: 0; }.access-card h1 { margin: 0; font-size: 32px; letter-spacing: -.04em; }.access-card > p:not(.kicker):not(.access-message) { margin: 0; color: var(--muted); }.access-card label { margin-top: 8px; font-weight: 680; font-size: 14px; }.access-card input { height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--ink); outline: 0; }.access-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }.access-message { min-height: 22px; margin: 0; color: var(--warning); font-size: 14px; }
.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 48px; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.site-header p { margin: 0; color: var(--muted); font-size: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 720; letter-spacing: .02em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-family: "Songti SC", STSong, serif; font-size: 19px; }
.intro { display: grid; grid-template-columns: 1.6fr .7fr; gap: 72px; align-items: end; padding: 72px 0 44px; }
.kicker { margin: 0 0 10px; color: var(--accent); font-weight: 680; font-size: 14px; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 680px; margin-bottom: 18px; font-size: clamp(38px, 6vw, 66px); font-weight: 760; line-height: 1.16; letter-spacing: -.055em; }
.intro-copy { max-width: 580px; margin: 0; color: var(--muted); font-size: 17px; }
.note { display: grid; gap: 6px; padding: 18px 0 18px 20px; border-left: 3px solid var(--accent); color: var(--muted); font-size: 14px; }
.note strong { color: var(--ink); font-size: 15px; }
.workspace { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: 22px; align-items: start; }
.upload-panel, .result-panel { min-height: 514px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.upload-panel { padding: 16px; }
.quick-start[hidden], .preview-area[hidden] { display: none !important; }
.quick-start { min-height: 480px; display: grid; place-items: center; padding: 34px; background: var(--surface-muted); border-radius: calc(var(--radius) - 7px); text-align: center; }
.quick-start > div { max-width: 310px; }.quick-start h2, .result-panel h2 { margin-bottom: 8px; font-size: 22px; letter-spacing: -.025em; }.quick-start p { margin-bottom: 22px; color: var(--muted); font-size: 14px; }.quick-start-button { width: 100%; }
.button { min-height: 46px; padding: 0 21px; border: 0; border-radius: 10px; font-weight: 700; transition: background-color .18s ease, transform .18s ease; }
.button:active { transform: translateY(1px) scale(.99); }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { background: var(--accent-hover); }
.preview-area { display: flex; flex-direction: column; gap: 14px; }
.preview-area img { width: 100%; height: 330px; object-fit: contain; border-radius: 12px; background: var(--surface-muted); }
.preview-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.preview-actions span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: var(--accent); font-weight: 700; }
.result-panel { padding: 36px; }
.empty-state { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.empty-icon { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 18px; border-radius: 50%; background: var(--surface-muted); color: var(--accent); font-family: Georgia, serif; font-size: 25px; font-weight: 700; }
.empty-state p { max-width: 320px; margin: 0; color: var(--muted); }
.answer-heading { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.answer-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0 26px; border-bottom: 1px solid var(--line); }
.answer { color: var(--accent); font-family: Georgia, "Songti SC", serif; font-size: 76px; font-weight: 700; line-height: 1; }
.badge { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 650; }
.answer-text { margin: -12px 0 23px; font-size: 15px; }
.result-section { padding-top: 22px; }
.result-section h3 { margin: 0 0 10px; font-size: 15px; }
.result-section p { margin-bottom: 0; color: var(--muted); font-size: 15px; white-space: pre-line; }
.options { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.option { display: grid; grid-template-columns: 25px 1fr; gap: 7px; color: var(--muted); font-size: 14px; }
.option.correct { color: var(--accent); font-weight: 700; }
.error-state { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.error-state h2 { color: var(--warning); }
.retry-button { align-self: flex-start; margin-top: 8px; background: var(--surface-muted); color: var(--accent); }
.loading-state { display: grid; align-content: center; gap: 18px; height: 100%; }
.skeleton { overflow: hidden; border-radius: 9px; background: linear-gradient(90deg, var(--surface-muted) 25%, color-mix(in srgb, var(--surface-muted) 60%, var(--surface)) 45%, var(--surface-muted) 65%); background-size: 240% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.answer-skeleton { width: 28%; height: 82px; }
.line { width: 100%; height: 16px; }.line.short { width: 66%; }.block { width: 100%; height: 124px; margin-top: 10px; }
.privacy { margin: 22px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.offline-library { display: grid; grid-template-columns: .82fr 1.18fr; column-gap: 68px; row-gap: 22px; margin-top: 58px; padding: 38px; border-radius: var(--radius); background: var(--surface-muted); }
.offline-library h2 { margin: 0 0 10px; font-size: 29px; line-height: 1.28; letter-spacing: -.035em; }
.offline-library > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.library-form { display: grid; align-content: start; gap: 8px; }.library-form label { color: var(--ink); font-size: 14px; font-weight: 680; }.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }.search-row input { width: 100%; min-width: 0; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); outline: 0; }.search-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }.search-row input::placeholder { color: var(--muted); }.library-status { min-height: 21px; margin: 0; color: var(--muted); font-size: 13px; }.library-results { grid-column: 1 / -1; display: grid; gap: 12px; }.library-result { padding: 18px; border-radius: 12px; background: var(--surface); }.library-result h3 { margin: 0 0 8px; color: var(--accent); font-size: 16px; }.library-result p { margin: 0; color: var(--muted); font-size: 14px; }.library-result .library-answer { margin-top: 11px; color: var(--ink); }.library-empty { margin: 0; color: var(--muted); font-size: 14px; }
@keyframes shimmer { to { background-position: -140% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 650px); padding-top: 16px; }.site-header p { display: none; }.intro { grid-template-columns: 1fr; gap: 26px; padding: 46px 0 30px; }.note { padding: 14px 0 14px 16px; }.workspace, .offline-library { grid-template-columns: 1fr; }.upload-panel, .result-panel { min-height: 430px; }.quick-start { min-height: 398px; }.result-panel, .offline-library { padding: 27px; }.preview-area img { height: 288px; }.search-row { grid-template-columns: 1fr; }.privacy { text-align: left; }
}
