:root { color-scheme: light; --ink:#142522; --accent:#176652; --paper:#f3f6f3; --line:#d5e1da; font:16px/1.55 system-ui,"Microsoft YaHei",sans-serif; }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); }
header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px max(18px,calc((100% - 1060px)/2)); background:#143932; color:white; }
header a { color:inherit; font-weight:650; text-decoration:none; }
nav { display:flex; align-items:center; gap:18px; }
nav button { color:white; border:1px solid #7aa198; background:transparent; }
main { max-width:1060px; margin:auto; padding:26px 18px 60px; }
h1 { font-size:clamp(28px,5vw,42px); margin:10px 0 16px; line-height:1.2; }
h2 { font-size:19px; margin:0 0 12px; }
h3 { font-size:17px; white-space:pre-wrap; overflow-wrap:anywhere; }
a { color:var(--accent); }
section,.card,details { padding:20px; margin:0 0 15px; border-radius:12px; background:#fff; border:1px solid var(--line); }
.login { max-width:410px; margin:6vh auto 0; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:14px; }
.project { display:flex; flex-direction:column; gap:7px; text-decoration:none; }
.project:hover,.project:focus-visible { border-color:var(--accent); }
.project strong { color:var(--ink); font-size:20px; }
.project span,.meta,.muted { color:#52665e; font-size:14px; }
label { display:block; font-weight:600; margin-bottom:12px; }
input:not([type=checkbox]),textarea,select { width:100%; margin-top:6px; padding:10px 12px; border:1px solid #b9cfc4; border-radius:8px; font:inherit; background:white; }
input:focus,textarea:focus { outline:2px solid #55a890; outline-offset:2px; }
button { font:inherit; cursor:pointer; padding:8px 14px; border:1px solid #b9cfc4; border-radius:8px; }
.primary { color:white; background:var(--accent); border-color:var(--accent); min-height:42px; }
fieldset { border:1px solid var(--line); margin:0 0 12px; border-radius:8px; }
.check { display:inline-flex; align-items:center; gap:7px; padding:4px 10px; }
summary { cursor:pointer; font-weight:650; }
details form { margin-top:16px; }
pre,.description { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; }
.file { display:inline-block; margin:0 8px 6px 0; padding:5px 9px; border:1px solid var(--line); border-radius:7px; text-decoration:none; }
.error { border:1px solid #ba6959; background:#fff0ec; padding:10px 14px; border-radius:8px; color:#843624; }
.prompts { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.prompts button { color:var(--accent); background:#f3f8f5; }
.path-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.path-controls span { overflow-wrap:anywhere; }
.request-status { color:var(--accent); font-weight:600; margin:12px 0 0; }
.request-status[data-running]::before { content:""; display:inline-block; width:12px; height:12px; margin-right:9px; border:2px solid #b9cfc4; border-top-color:var(--accent); border-radius:50%; animation:request-spin 800ms linear infinite; }
@keyframes request-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .request-status[data-running]::before { animation:none; } }

.project-page { max-width:1380px; padding-top:12px; padding-bottom:18px; }
.project-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 14px; margin:4px 0 10px; }
.project-heading h1 { font-size:26px; margin:0; }
.project-heading span,.history .file { overflow-wrap:anywhere; }
.project-page > details { padding:6px 10px; margin-bottom:8px; font-size:14px; }
.project-workbench { display:grid; grid-template-columns:minmax(235px,27%) minmax(0,1fr); gap:12px; align-items:start; }
.history-sidebar { min-width:0; padding:12px; border:1px solid var(--line); border-radius:10px; background:white; overflow:auto; max-height:max(420px,calc(100dvh - 160px)); }
.history-sidebar h2 { margin-bottom:8px; }
.history-options,.history-pages,.composer-tools { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.history-options select,.composer-tools select { width:auto; margin:0; padding:5px 8px; font-size:14px; max-width:100%; }
.history-options button { font-size:14px; padding:4px 8px; background:var(--paper); }
.history-date { margin:10px 0 1px; color:#52665e; font-size:13px; }
.history-list { list-style:none; padding:0; margin:0; }
.history-entry { display:block; color:var(--ink); padding:6px 8px; border-bottom:1px solid var(--line); text-decoration:none; }
.history-entry:hover,.history-entry[aria-current] { background:#e7f3eb; }
.history-title { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:600; }
.history-entry small { display:block; color:#52665e; line-height:1.4; }
.history-entry strong { color:var(--accent); }
.history-pages { margin-top:10px; justify-content:space-between; font-size:14px; }
.project-detail { min-width:0; display:grid; grid-template-rows:minmax(0,1fr) auto; gap:10px; min-height:420px; height:calc(100dvh - 160px); }
.project-detail > section { margin:0; padding:12px 15px; border-radius:10px; }
.project-detail .history { overflow:auto; }
.project-detail .history h2 { margin-bottom:4px; white-space:pre-wrap; overflow-wrap:anywhere; }
.project-detail .history p { margin:8px 0; }
.project-detail .history .file { margin-top:7px; max-width:100%; }
.project-detail .composer textarea { display:block; margin-top:0; padding:7px 10px; resize:vertical; }
.composer-tools { margin-top:7px; }
.composer-tools .primary { margin-left:auto; padding:5px 14px; min-height:34px; }
.composer [data-attachment-message]:empty { display:none; }
.composer [data-attachment-list] { margin:5px 0; overflow-wrap:anywhere; }
.composer .quick-questions,.composer .attachment-help { border:0; padding:0; margin:0 0 5px; font-size:14px; }
.composer .prompts { margin:5px 0; }
.composer .prompts button { padding:3px 8px; }
.composer .attachment-help { margin:0; }
.composer .attachment-help p { margin:4px 0; }
.attachment-input { position:absolute; width:1px !important; height:1px; padding:0 !important; clip-path:inset(50%); }
.attachment-picker { color:var(--accent); padding:5px 8px; border:1px solid var(--line); border-radius:6px; margin:0; cursor:pointer; font-size:14px; }
.attachment-input:focus-visible + .attachment-picker { outline:2px solid var(--accent); }
@media (max-width:700px) {
  .project-page { padding-inline:10px; }
  .project-workbench { grid-template-columns:minmax(0,1fr); gap:8px; }
  .history-sidebar { max-height:230px; }
  .project-detail { height:auto; min-height:0; }
  .project-detail .history { overflow:visible; }
  .project-detail .composer { position:sticky; bottom:0; }
}

