:root {
  color-scheme: light;
  --page: #f4f6f2;
  --paper: #fff;
  --ink: #192a23;
  --muted: #53685d;
  --line: #d7e2da;
  --accent: #205a44;
  --tint: #e7efe8;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.55; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; transition: background .18s, color .18s, transform .18s, border-color .18s; }
button:active:not(:disabled) { transform: scale(.96); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #76a489; outline-offset: 3px; }
.topbar { min-height: 68px; padding: 12px clamp(16px, 5vw, 72px); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand, .header-actions { display: flex; align-items: center; gap: 10px; }
.brand { font-size: 16px; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: white; font-weight: 800; }
.workspace { max-width: 840px; width: 100%; margin: auto; padding: clamp(24px, 5vw, 60px) 20px 28px; }
.signin { width: min(calc(100% - 32px), 390px); margin: clamp(32px, 13vh, 128px) auto; padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.signin h1 { margin: 18px 0 15px; font-size: 23px; }
.signin form { display: grid; gap: 8px; }
.signin label:not(:first-child) { margin-top: 5px; }
.signin button { margin-top: 9px; justify-self: start; }
.welcome { padding: clamp(20px, 8vh, 92px) 0 32px; text-align: center; animation: enter .28s ease-out both; }
.welcome h1 { font-size: clamp(28px, 6vw, 48px); letter-spacing: -.04em; line-height: 1.15; margin: 0 0 14px; }
.welcome p { color: var(--muted); margin: 0 0 25px; }
.suggestions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.suggestions button, .subtle, .primary, .secondary, .icon-button { border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 650; padding: 8px 12px; }
.suggestions button { border-color: var(--line); background: var(--paper); }
.suggestions button span { padding-left: 6px; color: var(--accent); }
.suggestions button:hover, .subtle:hover, .secondary:hover, .icon-button:hover { background: var(--tint); }
.subtle, .icon-button { background: transparent; color: var(--accent); }
.primary { background: var(--accent); color: white; padding-inline: 16px; }
.primary:hover { background: #174736; }
.secondary { background: #f7faf7; color: var(--accent); border-color: var(--line); }
.composer { background: var(--paper); padding: 12px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 24px #25443312; transition: border-color .22s, box-shadow .22s, background .22s; }
.composer:focus-within { border-color: #8caf9a; box-shadow: 0 8px 27px #2544331f; }
.composer.drag { background: var(--tint); border-color: var(--accent); }
.composer textarea { display: block; width: 100%; border: 0; background: transparent; resize: vertical; min-height: 82px; padding: 8px; outline: none; }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.composer-actions #modelChoice { width: auto; min-width: 0; max-width: min(42vw, 200px); padding: 7px 8px; color: var(--accent); font-size: 13px; }
.composer-actions button { flex-shrink: 0; }
#send { margin-left: auto; }
#stop { margin-left: auto; }
.attachment { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin: 4px; background: var(--tint); border-radius: 9px; padding-left: 10px; font-size: 13px; animation: enter .22s ease-out both; }
.attachment span { overflow-wrap: anywhere; }
.icon-button { display: grid; place-items: center; min-width: 32px; min-height: 32px; padding: 3px; font-size: 20px; line-height: 1; }
.mode { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.messages { display: grid; gap: 18px; padding-bottom: 24px; }
.message { min-width: 0; animation: enter .24s ease-out both; }
.message.user { justify-self: end; max-width: 85%; background: var(--tint); border-radius: 16px 16px 4px 16px; padding: 10px 14px; }
.message.assistant { background: var(--paper); border: 1px solid var(--line); border-radius: 5px 16px 16px; padding: 14px 16px; }
.message p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.message .file-ref { color: var(--muted); margin-top: 5px; font-size: 12px; }
.message .secondary { margin-top: 8px; }
.estimate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 7px; }
.estimate article { background: var(--page); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.message .estimate article + article { margin-top: 0; }
.estimate h3 { color: var(--muted); font-size: 13px; }
.estimate p { color: var(--accent); font-weight: 750; }
.message .estimate-basis { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.message .estimate ~ article { margin-top: 10px; }
.analysis-activity { margin-bottom: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.analysis-activity ul { margin: 5px 0 1px; color: var(--muted); font-size: 13px; }
.progress { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; }
.progress i { width: 6px; height: 6px; border-radius: 100%; background: var(--accent); animation: pulse .95s infinite alternate; }
.progress i:nth-child(2) { animation-delay: .15s; }
.progress i:nth-child(3) { animation-delay: .30s; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { from { opacity: .3; transform: translateY(1px); } to { opacity: 1; transform: translateY(-3px); } }
.file-details { margin-top: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; }
summary { cursor: pointer; font-size: 14px; color: var(--accent); }
.file-details[open] summary { margin-bottom: 12px; }
.image-preview { display: block; max-width: 100%; max-height: 330px; object-fit: contain; }
.inline { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.inline button { flex: none; }
input, select, #evidence { min-width: 0; width: 100%; border: 1px solid var(--line); background: #fafcf9; border-radius: 8px; padding: 8px; }
.error { color: #9d3125; font-size: 14px; margin: 4px 8px; }
.hint { color: var(--muted); font-size: 14px; }
.result { margin-top: 13px; }
.result:empty { display: none; }
.project-stats + .project-stats { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.project-counts p { font-size: clamp(17px, 3vw, 24px); }
.project-stats details { margin: 12px 0 4px; }
.project-stats details article { margin-top: 8px; }
.project-stats > button { margin: 7px 8px 0 0; }
.result h3 { font-size: 15px; }
.result h3, .result p, .message h3 { margin: 0 0 5px; }
.message h3 { font-size: 15px; }
.result ol, .result ul, .message ul { padding-left: 20px; margin: 4px 0 10px; }
.result article + article, .message article + article { margin-top: 10px; }
pre { overflow: auto; max-height: 250px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--page); padding: 10px; border-radius: 8px; font: inherit; font-size: 14px; }
dialog { max-width: min(860px, calc(100vw - 28px)); max-height: 88dvh; width: 100%; border: 1px solid var(--line); border-radius: 18px; padding: clamp(14px, 4vw, 27px); color: var(--ink); }
dialog[open] { animation: enter .2s ease-out both; }
dialog::backdrop { background: #12271a77; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 22px; margin: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.panel { background: #fafcf9; border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.panel h2 { font-size: 16px; margin: 0 0 9px; }
.quote-form { display: grid; gap: 11px; }
.quote-form button { justify-self: start; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
label, .fields small { font-size: 13px; }
#evidence { min-height: 100px; resize: vertical; }
.metric { font-size: 25px; color: var(--accent); font-weight: 800; }
.sr { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
@media (max-width: 600px) {
  .layout { grid-template-columns: 1fr; }
  .workspace { padding-inline: 13px; }
  .topbar { min-height: 60px; padding-inline: 10px; }
  .brand { gap: 6px; }
  .header-actions { gap: 2px; }
  .header-actions button { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
