/* R158–R161：项目工作台独立样式，不扩充聊天主样式文件。 */
.project-view .workbench > :not(.projects-view):not(.project-peek) { display:none !important; }
.projects-view { display:none; flex:1; min-width:0; overflow:auto; background:var(--bg); }
.project-view .projects-view { display:block; }
.project-peek { display:none; position:fixed; z-index:31; top:0; bottom:0; left:62px; width:255px; padding:20px 12px; background:var(--side); border-right:1px solid var(--line); box-shadow:12px 0 28px #0002; }
.rail-peek-project .project-peek { display:block; }
.rail-peek-project #nav-projects::after,.project-view #nav-projects::after { display:none; }
.project-peek h2 { margin:0 8px 18px; font-size:16px; }
.project-peek button { display:block; width:100%; padding:9px 11px; border:0; border-radius:8px; text-align:left; background:none; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.project-peek button:hover,.project-peek button:focus-visible { background:var(--hover); }
.project-peek .peek-label { margin:20px 10px 7px; color:var(--muted); font-size:11px; }
.project-page { width:min(1180px,100%); margin:auto; padding:32px clamp(20px,4vw,50px) 90px; }
.project-head { display:flex; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:25px; }
.project-head h1 { margin:0; font-size:26px; line-height:1.3; letter-spacing:-.025em; }
.project-head p { color:var(--muted); margin:6px 0 0; }
.project-head-actions { margin-left:auto; display:flex; flex-wrap:wrap; gap:8px; }
.project-button { border:1px solid var(--line); border-radius:9px; background:var(--bg); color:var(--text); padding:8px 13px; }
.project-button:hover { background:var(--hover); }
.project-button.primary { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.project-button.danger { color:var(--danger); }
.project-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(245px,1fr)); gap:13px; }
.project-card { border:1px solid var(--line); border-radius:15px; background:var(--side); text-align:left; padding:19px; color:var(--text); min-height:190px; }
.project-card:hover { border-color:var(--muted); transform:translateY(-1px); }
.project-card strong,.project-card small { display:block; }
.project-card strong { font-size:17px; margin-bottom:5px; }
.project-card small,.project-meta { color:var(--muted); font-size:12px; }
.project-card p { margin:14px 0 0; color:var(--muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.project-card-status { display:inline-block; margin-bottom:12px; padding:3px 8px; border-radius:6px; background:var(--hover); color:var(--muted); font-size:11px; }
.project-card-status.published { color:#137b47; background:#e6f5ec; }
.project-card-actions { display:flex; gap:7px; flex-wrap:wrap; margin-top:18px; }
.project-card-actions .project-button { font-size:12px; padding:7px 10px; }
.project-card-link { color:var(--text); text-decoration:underline; text-underline-offset:3px; }
.project-card-progress { margin:12px 0 0 !important; font-size:11px; color:var(--muted); }
.project-card.just-created { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent); }
.project-empty { border:1px dashed var(--line); border-radius:15px; padding:42px 24px; text-align:center; color:var(--muted); }
.project-empty h2 { color:var(--text); margin:0 0 8px; }
.project-empty p { margin:0 0 22px; }
.project-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin:10px 0 24px; overflow:auto; }
.project-tabs button { border:0; border-bottom:2px solid transparent; padding:10px 15px; white-space:nowrap; background:none; color:var(--muted); }
.project-tabs button.active { color:var(--text); border-bottom-color:var(--accent); font-weight:650; }
.project-panel { min-width:0; }
.project-panel h2 { font-size:17px; margin:20px 0 11px; }
.project-panel p { line-height:1.7; }
.project-field { display:grid; gap:6px; margin:15px 0; font-weight:600; }
.project-field input,.project-field textarea { width:100%; border:1px solid var(--line); border-radius:9px; background:var(--bg); color:var(--text); padding:10px 12px; font-weight:400; }
.project-field textarea { min-height:110px; resize:vertical; }
.project-code-hint { min-height:18px; color:var(--muted); font-size:12px; }
.project-code-hint.error,.project-feedback.error { color:var(--danger); }
.project-feedback { min-height:20px; color:var(--muted); font-size:12px; }
.project-list-row { display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line); }
.project-list-row strong { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-list-row small { color:var(--muted); }
.project-link { overflow-wrap:anywhere; color:var(--muted); font-size:12px; }
.project-create-dialog { width:min(480px,calc(100vw - 30px)); border:1px solid var(--line); border-radius:15px; padding:24px; background:var(--bg); color:var(--text); box-shadow:0 20px 70px #0003; }
.project-create-dialog::backdrop { background:#0008; }
.project-create-dialog h2 { margin:0 0 18px; }
.chat-task-tabs { display:flex; flex-wrap:wrap; gap:4px; margin:0 0 9px; padding-bottom:8px; border-bottom:1px solid var(--line); }
.chat-task-tabs button { border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); padding:6px 10px; font-size:12px; cursor:pointer; }
.chat-task-tabs button:hover { background:var(--hover); color:var(--text); }
.chat-task-tabs button.active { background:var(--side); border-color:var(--line); color:var(--text); font-weight:650; }
.chat-task-tabs button:disabled { opacity:.55; cursor:not-allowed; }
.chat-task-tabs[hidden],.prototype-target[hidden] { display:none; }
.session-project { display:block; max-width:100%; color:var(--muted); font-size:10px; font-weight:400; overflow:hidden; text-overflow:ellipsis; }
.prototype-target { display:flex; align-items:center; gap:7px; max-width:100%; padding:7px 9px; margin:0 0 7px; border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line)); border-radius:8px; background:color-mix(in srgb,var(--accent) 7%,var(--bg)); color:var(--text); font-size:12px; }
.prototype-target span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.prototype-target button { flex:none; margin-left:auto; border:0; background:transparent; color:var(--muted); font-size:18px; cursor:pointer; }
.project-preview-open:not(.space-view) .chat-pane { width:var(--project-chat-pane,35%); }
.project-preview-open .preview-actions > :not(#preview-close) { display:none; }
.project-preview-shell { min-height:100%; padding:0 18px 24px; }
.project-preview-tabs { display:flex; gap:6px; border-bottom:1px solid var(--line); margin-bottom:14px; }
.project-preview-tabs button { border:0; border-bottom:2px solid transparent; padding:11px 14px; color:var(--muted); background:transparent; }
.project-preview-tabs button.active { color:var(--text); border-bottom-color:var(--accent); font-weight:650; }
.project-preview-body { min-width:0; }
.prototype-viewer { display:flex; flex-direction:column; min-width:0; min-height:calc(100vh - 190px); }
.prototype-viewer-toolbar { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.prototype-viewer > .project-feedback { text-align:right; margin-bottom:8px; }
.prototype-viewer > .project-feedback:empty { display:none; }
.prototype-viewer-toolbar .project-button.active { border-color:var(--accent); color:var(--accent); background:color-mix(in srgb,var(--accent) 9%,var(--bg)); }
.prototype-viewer-viewport { flex:1; min-height:580px; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:white; }
.prototype-viewer-frame { display:block; width:100%; height:max(580px,calc(100vh - 265px)); border:0; background:white; }
.prototype-viewer-empty { display:grid; place-items:center; min-height:580px; padding:24px; color:var(--muted); text-align:center; }
.prototype-viewer-help { margin:9px 0 0; color:var(--muted); font-size:11px; }
.prototype-version-menu { position:relative; color:var(--muted); font-size:12px; }
.prototype-version-menu summary { cursor:pointer; padding:7px; white-space:nowrap; }
.prototype-version-content { position:absolute; right:0; top:calc(100% + 5px); z-index:5; width:200px; display:grid; gap:8px; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--bg); box-shadow:0 8px 24px #0002; }
.prototype-version-menu:not([open]) .prototype-version-content { display:none; }
.prototype-version-menu select { max-width:140px; border:1px solid var(--line); border-radius:7px; background:var(--bg); color:var(--text); padding:7px; }
.project-requirements-preview { max-width:850px; margin:auto; white-space:normal; }
@media (max-width:900px) { .project-preview-shell { padding:0 12px 24px; } }
@media (max-width:760px) { .project-peek { display:none !important; } .project-page { padding:20px 15px 70px; } .prototype-viewer { min-height:0; } .prototype-viewer-viewport,.prototype-viewer-empty { min-height:430px; } .prototype-viewer-frame { height:65vh; min-height:430px; } }
