:root {
  color-scheme: light;
  --ink: #14221b;
  --muted: #5f6c65;
  --green: #176448;
  --mint: #e9f5ee;
  --line: #e6ebe8;
  --surface: #fff;
  --bg: #f4f6f5;
  --depth: 0 12px 38px #15342709, 0 2px 5px #1d392805;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Microsoft YaHei UI", "PingFang SC", sans-serif; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #268a65; outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: 0 0 auto; }
.site-header { background: #fffdfde8; border-bottom: 1px solid #e5ebe7; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(16px); }
.header-inner { max-width: 1340px; margin: auto; height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 44px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 850; letter-spacing: -.02em; width: max-content; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: #effff1; background: linear-gradient(155deg,#388b66,#145137); box-shadow: 0 4px 8px #23634925; }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 1.65; }
.navigation { display: flex; gap: 4px; align-items: center; background: #edf1ef; border: 1px solid #e8edea; border-radius: 14px; padding: 4px; }
.navigation a { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 95px; padding: 7px 13px; border-radius: 10px; font-size: 14px; color: var(--muted); font-weight: 650; }
.navigation a:hover { color: var(--green); }
.navigation a.selected { color: var(--green); background: white; box-shadow: 0 1px 5px #14271a15; }
body[data-public] .navigation,
body[data-public] #cloud-review,
body[data-public] #scan-recent { display: none; }
.engine-status { justify-self: end; display: inline-flex; align-items: center; gap: 8px; color: #456353; font-size: 13px; background: #edf5ef; padding: 7px 11px; border-radius: 100px; white-space: nowrap; }
.engine-status i { width: 7px; height: 7px; border-radius: 100%; background: #809889; }
.engine-status.ready i { background: #36a674; box-shadow: 0 0 0 3px #36a67422; }
.main { max-width: 1340px; padding: 32px 44px 60px; margin: 0 auto; }
.section-intro { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin: 29px 0 13px; }
.section-intro h2 { font-size: 22px; letter-spacing: -.03em; }
.section-intro > span { font-size: 13px; color: var(--muted); }
.workspace { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--depth); min-width: 0; }
.upload-panel,.result-panel { padding: 22px; }
.panel-heading,.chat-identity,.knowledge-upload-info { display: flex; align-items: center; gap: 12px; }
.panel-heading h3,.chat-identity h3,.knowledge-upload h3 { font-size: 17px; letter-spacing: -.025em; }
.result-header h2 { font-size: 21px; letter-spacing: -.03em; }
.result-label { min-width: 0; flex: 1; }
.result-label p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-heading p,.chat-identity p,.knowledge-upload p { font-size: 13px; color: var(--muted); margin-top: 1px; }
.tile,.page-tile { border-radius: 12px; width: 41px; height: 41px; display: grid; place-items: center; background: #eaf6ed; color: #267552; flex: 0 0 auto; }
.violet { color: #6652a2; background: #f0edfb; }
.drop-zone { border: 1px dashed #b9d0c1; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 207px; padding: 13px; background: #f8fbf8; text-align: center; color: var(--muted); gap: 4px; transition: background .2s,border-color .2s; }
.drop-zone.dragging { background: #e6f6ec; border-color: #348758; }
.drop-zone strong,.result-empty strong { color: var(--ink); font-size: 15px; }
.drop-zone > span:not(.upload-orb), .result-empty > span { font-size: 13px; }
.drop-zone > small { margin-top: 5px; }
.upload-orb { width: 40px; height: 40px; border-radius: 14px; background: #e8f3eb; color: #377a54; display: grid; place-items: center; margin-bottom: 3px; }
.button.upload-photo { min-width: 150px; min-height: 46px; margin: 5px 0 3px; }
.upload-mobile-hint { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; min-height: 40px; border: 1px solid transparent; border-radius: 10px; white-space: nowrap; font-weight: 650; text-decoration: none; }
.button svg { width: 17px; height: 17px; }
.button.primary { color: #fff; background: #176448; box-shadow: 0 3px 8px #175a4133; }
.button.primary:hover { background: #11543b; }
.button.soft { background: #eef3f0; color: #354a3e; border-color: #e8eeea; }
.button.soft:hover,.button.soft[aria-pressed="true"] { color: #125a3f; background: #dff2e6; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.upload-options { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; }
.button.text-action { color: var(--muted); background: transparent; border-color: transparent; }
.button.text-action:hover,.button.text-action[aria-pressed="true"] { color: var(--green); background: #e9f5ee; }
.text-action img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }
.result-empty { min-height: 260px; display: grid; justify-items: center; align-content: center; gap: 13px; padding: 12px; text-align: center; color: var(--muted); margin-top: 12px; border-radius: 14px; background: #f8fbf8; }
.upload-progress { display: block; width: min(290px,80%); height: 8px; accent-color: #2a8560; }
.empty-orbit { width: 61px; height: 61px; display: grid; place-items: center; border-radius: 21px; margin-bottom: 4px; color: #668c75; background: radial-gradient(circle at 33% 25%,#f9fdfa,#e7f1e9); box-shadow: 0 0 0 7px #f4f8f4; }
.empty-orbit svg { width: 28px; height: 28px; }
.result-empty .spinner { width: 38px; height: 38px; border: 3px solid #dce7e0; border-top-color: #33855d; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.result-content { margin-top: 14px; display: grid; gap: 11px; }
.result-photo { position: relative; overflow: hidden; background: #eaf0ea; border-radius: 12px; width: 100%; height: clamp(270px, 51vh, 515px); border: 0; padding: 0; display: block; }
.result-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.result-photo > span { position: absolute; right: 8px; bottom: 8px; padding: 5px; color: white; background: #182e23aa; border-radius: 7px; }
.result-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 100px; background: #eaf5ee; color: #236246; font-size: 12px; font-weight: 700; }
.status-pill.warn { background: #fcf1dc; color: #855e22; }
.status-pill.muted { background: #eef0f0; color: #5f6a63; }
.result-notes { border-radius: 10px; padding: 10px; background: #f4f1fb; color: #4c3f68; font-size: 13px; white-space: pre-wrap; }
.disease-list { display: flex; flex-wrap: wrap; gap: 6px; }
.disease-list .button { white-space: normal; text-align: left; }
.disease-list .button svg { flex: none; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-section .section-intro { margin-top: 25px; }
.recent-list { padding: 8px 17px; }
.recent-empty,.documents-empty { display: flex; gap: 9px; justify-content: center; align-items: center; padding: 15px; color: var(--muted); font-size: 13px; }
.recent-item { background: none; border: 0; border-bottom: 1px solid var(--line); width: 100%; padding: 8px 2px; display: flex; gap: 10px; align-items: center; text-align: left; color: var(--ink); }
.recent-item:last-child { border-bottom: 0; }
.recent-item > div { flex: 1; overflow: hidden; }
.recent-item img,.photo-context img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.recent-item strong { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item p { font-size: 12px; color: var(--muted); }
.page-heading { display: flex; align-items: center; gap: 15px; margin: 5px 0 24px; }
.page-tile { width: 58px; height: 58px; border-radius: 17px; }
.page-tile svg { width: 26px; height: 26px; }
.page-heading h1 { font-size: clamp(29px,4vw,43px); letter-spacing: -.055em; line-height: 1.2; }
.page-heading p { color: var(--muted); margin-top: 4px; }
.chat-panel { max-width: 1000px; min-height: min(670px,74vh); margin: 0 auto; padding: 0 19px 16px; display: flex; flex-direction: column; }
.chat-top { border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 14px 0; }
.chat-messages { overflow: auto; min-height: 270px; max-height: 49vh; flex: 1 0 auto; }
.chat-empty { min-height: min(385px,40vh); display: grid; justify-items: center; align-content: center; gap: 13px; text-align: center; }
.chat-empty h2 { font-size: 23px; }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.suggestions button { color: var(--green); background: #edf5ef; padding: 8px 10px; border-radius: 10px; border: 1px solid #e5eee7; font-size: 13px; }
.message { display: flex; flex-direction: column; align-items: flex-start; margin: 13px 0; gap: 6px; }
.message.user { align-items: flex-end; }
.bubble { color: #284034; background: #f0f4f1; max-width: min(90%,690px); white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 13px; border-radius: 13px 13px 13px 4px; }
.user .bubble { background: #e4f2e9; border-radius: 13px 13px 4px 13px; }
.sources { padding-left: 4px; max-width: min(95%,680px); }
.sources summary { cursor: pointer; color: var(--green); font-size: 13px; }
.sources a,.sources p { display: block; margin: 5px 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sources a { text-decoration: underline; }
.photo-context { display: flex; gap: 9px; align-items: center; padding: 6px 0; color: #456052; font-size: 13px; }
.photo-context button { margin-left: auto; }
.chat-composer { border: 1px solid #dce7df; border-radius: 14px; background: #fafcfa; overflow: hidden; }
.chat-composer textarea { display: block; resize: vertical; width: 100%; padding: 11px 12px 4px; min-height: 53px; max-height: 135px; background: transparent; border: 0; color: var(--ink); outline: 0; }
.chat-composer:focus-within { border-color: #73a18a; }
.composer-actions { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; }
.composer-actions .send { margin-left: auto; min-height: 35px; width: 38px; padding: 0; }
.knowledge-upload { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 19px; }
.knowledge-upload small { display: inline-block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.documents { padding: 4px 17px; }
.documents-empty { min-height: 140px; }
.document-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.document-row:last-child { border-bottom: 0; }
.document-text { flex: 1; min-width: 0; }
.document-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.document-text p { color: var(--muted); font-size: 12px; }
.review-actions { display: flex; gap: 6px; }
.toast { position: fixed; z-index: 12; right: 20px; bottom: max(20px,env(safe-area-inset-bottom)); max-width: min(455px,calc(100% - 40px)); background: #17392beF; color: white; padding: 13px 16px; border-radius: 13px; box-shadow: 0 8px 30px #13332745; font-size: 14px; }
.toast a { text-decoration: underline; display: block; margin-top: 3px; font-weight: 700; }
.photo-dialog { border: 0; border-radius: 15px; padding: 8px; background: #f8faf8; width: min(96vw,900px); }
.photo-dialog::backdrop { background: #07180ecb; }
.photo-dialog img { width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.icon-button { border: 0; border-radius: 10px; color: var(--green); background: #edf5ee; width: 34px; height: 34px; display: grid; place-items: center; }
.icon-button svg { width: 17px; height: 17px; }
.photo-dialog button { margin-left: auto; margin-bottom: 4px; }
@media (max-width: 820px) {
  .header-inner,.main { padding-left: 23px; padding-right: 23px; }
  .upload-panel,.result-panel { padding: 16px; }
}
@media (max-width: 600px) {
  .header-inner { height: 59px; padding: 0 16px; display: flex; justify-content: space-between; }
  .brand { font-size: 17px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .engine-status { font-size: 11px; }
  .navigation { position: fixed; left: 11px; right: 11px; bottom: max(8px,env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3,1fr); z-index: 8; padding: 4px; background: #fcfefcf7; box-shadow: 0 5px 20px #19352235; border-color: #e5ece7; }
  .site-header { position: static; backdrop-filter: none; }
  .navigation a { min-width: 0; min-height: 44px; padding: 6px 3px; font-size: 13px; }
  .navigation a.selected { background: #e6f4eb; box-shadow: none; }
  .main { padding: 15px 13px 81px; }
  .upload-panel,.result-panel { min-height: 0; padding: 14px; border-radius: 16px; }
  .result-header h2 { font-size: 18px; }
  .result-photo { height: clamp(220px,40vh,340px); }
  .drop-zone { min-height: 195px; }
  .button.upload-photo { width: min(220px, 100%); min-height: 48px; }
  .upload-desktop-hint { display: none; }
  .upload-mobile-hint { display: inline; }
  .section-intro { margin: 21px 0 9px; }
  .section-intro h2 { font-size: 19px; }
  .result-empty { min-height: 178px; }
  .page-heading { margin: 4px 0 16px; gap: 11px; }
  .page-heading p { font-size: 13px; }
  .page-tile { width: 49px; height: 49px; }
  .chat-panel { padding: 0 11px 9px; min-height: 66vh; }
  .chat-messages { min-height: 235px; max-height: 48vh; }
  .knowledge-upload { align-items: flex-start; flex-direction: column; padding: 14px; }
  .knowledge-upload button { align-self: stretch; }
  .documents { padding: 2px 11px; }
  .document-row { flex-wrap: wrap; gap: 7px; }
  .review-actions { width: 100%; padding-left: 48px; }
  .toast { bottom: max(70px,calc(env(safe-area-inset-bottom) + 64px)); right: 12px; max-width: calc(100% - 24px); }
}
@media (prefers-reduced-motion: reduce) { *,*::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

