:root {
    --workspace-sidebar: 72px;
    --workspace-sidebar-expanded: 280px;
    --workspace-line: #e8e8e8;
    --workspace-muted: #666666;
    --workspace-surface: #ffffff;
}

.workspace-body {
    min-height: 100svh;
    overflow: hidden;
    background: #fafafa;
    color: #3a3a3a;
}
/* 统一导航壳下的工作台纵向布局：site-header（common.js 注入）在上，工作台区域在下 */
body.workspace-appnav { display: flex; flex-direction: column; }
body.workspace-appnav .site-header { flex: 0 0 auto; }

.workspace-shell { flex: 1; min-height: 0; display: flex; }

.workspace-sidebar {
    width: var(--workspace-sidebar);
    height: 100svh;
    flex: 0 0 var(--workspace-sidebar);
    display: flex;
    flex-direction: column;
    padding: 14px 12px 16px;
    background: transparent;
    z-index: 220;
    isolation: isolate;
    overflow: visible;
}
.workspace-sidebar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--workspace-sidebar); border-right: 1px solid rgba(0,0,0,0.06); background: rgba(255,255,255,0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 1px 0 0 rgba(0,0,0,.02); transition: width .22s ease, box-shadow .22s ease; z-index: -1; }
.workspace-sidebar:hover::before, .workspace-sidebar:focus-within::before { width: var(--workspace-sidebar-expanded); box-shadow: 4px 0 12px rgba(0,0,0,.04); }
.ui-icon { width: 19px; height: 19px; display: block; flex: 0 0 19px; }

.sidebar-head { width: 48px; height: 48px; display: flex; align-items: center; justify-content: space-between; overflow: hidden; transition: width .22s ease; }
.workspace-sidebar:hover .sidebar-head, .workspace-sidebar:focus-within .sidebar-head { width: 256px; }
.workspace-brand { display: flex; align-items: center; gap: 12px; padding: 0 2px; font-size: 17px; font-weight: 700; white-space: nowrap; }
.workspace-brand-logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #3a3a3a;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    flex-shrink: 0;
}
.sidebar-close { display: none; width: 36px; height: 36px; border: 0; background: transparent; font-size: 24px; color: #657085; }

.rail-label { display: inline-block; max-width: 0; overflow: hidden; opacity: 0; transform: translateX(-5px); white-space: nowrap; transition: max-width .22s ease, opacity .16s ease, transform .16s ease; }
.workspace-sidebar:hover .rail-label, .workspace-sidebar:focus-within .rail-label { max-width: 180px; opacity: 1; transform: translateX(0); }
.new-chat-btn {
    width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    padding: 0 13px;
    border: 0;
    border-radius: 12px;
    background: #f0f0f0;
    color: #3a3a3a;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: width .22s ease, background .16s ease, color .16s ease;
}
.workspace-sidebar:hover .new-chat-btn, .workspace-sidebar:focus-within .new-chat-btn { width: 256px; }
.new-chat-btn:hover { background: #e5e5e5; color: #3a3a3a; }
.new-chat-btn .ui-icon { width: 22px; height: 22px; flex: 0 0 22px; }

.sidebar-projects { width: 256px; max-height: 42%; margin-top: 14px; overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s ease; }
.sidebar-section { width: 256px; min-height: 96px; flex: 1; margin-top: 12px; overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s ease; }
.workspace-sidebar:hover .sidebar-projects, .workspace-sidebar:focus-within .sidebar-projects,
.workspace-sidebar:hover .sidebar-section, .workspace-sidebar:focus-within .sidebar-section { opacity: 1; visibility: visible; pointer-events: auto; }
.sidebar-section-head { min-height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: #929baa; font-size: 12px; }
.sidebar-section-head button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: #7d8796; font-size: 18px; cursor: pointer; }
.sidebar-section-head button:hover { background: #eeedea; color: #3a3a3a; }
.project-group-list { max-height: calc(100% - 30px); overflow-y: auto; padding-right: 2px; }
.project-group { margin-bottom: 3px; }
.project-group-head { display: grid; grid-template-columns: minmax(0, 1fr) 28px 28px 28px; align-items: center; gap: 1px; border-radius: 9px; }
.project-group-head:hover, .project-group:focus-within .project-group-head { background: #eeedea; }
.project-toggle { min-width: 0; min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 5px; border: 0; background: transparent; color: #414a5c; text-align: left; cursor: pointer; }
.project-toggle .ui-icon { width: 17px; height: 17px; flex-basis: 17px; }
.project-toggle > span:not(.project-chevron) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.project-toggle small { color: #99a2b0; font-size: 10px; }
.project-chevron { width: 11px; color: #8b94a3; font-size: 19px; line-height: 1; transform: rotate(0); transition: transform .16s ease; }
.project-group.expanded .project-chevron { transform: rotate(90deg); }
.project-add-chat, .project-remove, .project-rename { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #8b94a3; opacity: 0; font-size: 13px; cursor: pointer; transition: opacity .16s ease, background .16s ease, color .16s ease; }
.project-group-head:hover .project-add-chat, .project-group-head:hover .project-remove, .project-group-head:hover .project-rename,
.project-group-head:focus-within .project-add-chat, .project-group-head:focus-within .project-remove, .project-group-head:focus-within .project-rename { opacity: 1; }
.project-add-chat:hover, .project-rename:hover { background: #fff; color: #3a3a3a; }
.project-remove:hover { background: #fff; color: #d9444f; }
.project-remove.confirming { width: 28px; background: #d9444f; color: #fff; opacity: 1; font-size: 9px; font-weight: 700; }
.project-children { padding: 1px 0 3px 21px; }
.project-session-row .session-item { min-height: 34px; padding-top: 7px; padding-bottom: 7px; }
.project-child-empty { padding: 5px 9px 8px; color: #a0a8b5; font-size: 11px; }
.empty-project-button { width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: #7e8796; font-size: 12px; text-align: left; cursor: pointer; }
.empty-project-button:hover { background: #eeedea; color: #3a3a3a; }
.sidebar-label { padding: 0 10px 8px; color: #929baa; font-size: 12px; }
.session-list { height: calc(100% - 26px); overflow-y: auto; }
.session-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 2px; border-radius: 9px; transition: background .16s ease; }
.session-row:hover, .session-row:focus-within, .session-row.active { background: #f5f5f5; }
.session-item {
    width: 100%;
    min-height: 40px;
    display: block;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px 4px 4px 9px;
    background: transparent;
    color: #4d5668;
    font-size: 13px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.session-row:hover .session-item, .session-row:focus-within .session-item, .session-row.active .session-item { color: #3a3a3a; }
.session-delete { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #8c95a4; opacity: 0; transform: translateX(3px); cursor: pointer; pointer-events: none; transition: opacity .16s ease, transform .16s ease, color .16s ease, background .16s ease; }
.session-row:hover .session-delete, .session-row:focus-within .session-delete { opacity: 1; transform: translateX(0); pointer-events: auto; }
.session-delete:hover { background: #fff; color: #d9444f; }
.session-delete .ui-icon { width: 16px; height: 16px; }
.session-delete-label { display: none; font-size: 11px; font-weight: 700; white-space: nowrap; }
.session-delete.confirming { width: 32px; background: #d9444f; color: #fff; opacity: 1; transform: none; pointer-events: auto; }
.session-delete.confirming .ui-icon { display: none; }
.session-delete.confirming .session-delete-label { display: inline; }
.session-empty { padding: 8px 10px; color: #a0a8b5; font-size: 12px; line-height: 1.7; }

.sidebar-nav { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.sidebar-nav a {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    border-radius: 12px;
    color: #596274;
    font-size: 13px;
    font-weight: 500;
    transition: width .22s ease, background .16s ease, color .16s ease;
}
.sidebar-nav a .ui-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.workspace-sidebar:hover .sidebar-nav a, .workspace-sidebar:focus-within .sidebar-nav a { width: 256px; }
.sidebar-nav a:hover { background: #eeedea; color: #3a3a3a; }
.sidebar-nav a.active { background: #f0efec; color: #3a3a3a; }
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: #3a3a3a;
}
.sidebar-foot { width: 256px; display: grid; gap: 3px; padding: 14px 10px 2px; color: #87909f; font-size: 12px; opacity: 0; transition: opacity .16s ease; }
.workspace-sidebar:hover .sidebar-foot, .workspace-sidebar:focus-within .sidebar-foot { opacity: 1; }
.sidebar-foot > div { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.sidebar-foot small { display: block; color: #a0a8b5; font-size: 10px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #20b26b; box-shadow: 0 0 0 3px rgba(32, 178, 107, .1); }
.sidebar-mask { display: none; }

/* ============================================
   创作历史面板（原首页侧栏的项目/最近创作迁入主内容区）
   ============================================ */
.chat-history-panel {
    width: 280px;
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    padding: 14px 12px 12px;
    background: #fafafa;
    border-right: 1px solid #e8e8e8;
    overflow: hidden;
    transition: margin-left .24s ease, opacity .18s ease .04s;
}
.chat-history-panel.collapsed { margin-left: -280px; opacity: 0; pointer-events: none; }
.chat-history-head { display: none; }
.chat-history-panel .new-chat-btn {
    width: 100%;
    min-height: 44px;
    margin-top: 0;
    justify-content: center;
    gap: 9px;
    padding: 0 13px;
    white-space: nowrap;
}
.chat-history-panel .new-chat-btn .ui-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.chat-history-projects { display: flex; flex-direction: column; max-height: 42%; margin-top: 12px; overflow: hidden; }
.chat-history-section { display: flex; flex-direction: column; flex: 1; min-height: 0; margin-top: 10px; }
.chat-history-section .sidebar-label { flex: 0 0 auto; }
.chat-history-section .session-list { flex: 1; min-height: 0; height: auto; overflow-y: auto; }
.chat-history-mask { display: none; }

.workspace-main { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.workspace-topbar {
    height: 64px;
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid var(--workspace-line);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-left { min-width: 0; flex: 1; }
.topbar-left > div { min-width: 0; }
.workspace-title { font-size: 15px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-substatus { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #8b94a3; font-size: 11px; }
.sidebar-toggle { display: none; width: 38px; height: 38px; border: 1px solid var(--workspace-line); border-radius: 10px; background: #fff; color: #3b4558; font-size: 18px; }
.topbar-shortcut { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #e8e8e8; border-radius: 10px; background: #fff; color: #666666; }
.topbar-shortcut:hover { border-color: #d8d5ce; background: #f7f6f3; color: #3a3a3a; }
.workspace-credits { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 11px; border: 1px solid #f2d8a5; border-radius: 10px; background: #fff9eb; color: #c78108; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.workspace-credits .ui-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.workspace-credits span { white-space: nowrap; }
.workspace-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #3a3a3a; color: #fff; }
.workspace-avatar .ui-icon { width: 18px; height: 18px; }
.workspace-account { color: #596274; font-size: 12px; font-weight: 500; }
.workspace-account:hover { color: #3a3a3a; }

.conversation { min-height: 0; flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.workspace-empty {
    width: min(820px, calc(100% - 32px));
    min-height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 0 64px;
    text-align: center;
}
.empty-logo { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 18px; background: #3a3a3a; color: #fff; font-size: 27px; font-weight: 700; }
.empty-brand-logo { width: 340px; max-width: 82vw; height: auto; display: block; margin: 0 auto; }
.workspace-empty h1 { margin-top: 19px; font-size: 28px; line-height: 1.3; letter-spacing: 0; }
.workspace-empty > p { margin-top: 8px; color: var(--workspace-muted); font-size: 14px; }
.starter-grid { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.starter-card {
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid #dfe5ed;
    border-radius: 12px;
    background: #fff;
    color: #1d2435;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.starter-card:hover { transform: translateY(-2px); border-color: #d0cdc6; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.starter-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 10px; font-size: 20px; }
.image-icon { background: #f0efec; color: #3a3a3a; }
.video-icon { background: #e9f8f1; color: #15945a; }
.starter-card strong, .starter-card small { display: block; }
.starter-card strong { font-size: 14px; }
.starter-card small { margin-top: 3px; color: #8b94a3; font-size: 12px; font-weight: 400; }

.message-stream { width: min(820px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 200px; }
.message-row { display: flex; gap: 12px; margin-bottom: 24px; }
.message-row.user { justify-content: flex-end; }
.assistant-avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 10px; background: #4a4a4a; color: #fff; font-size: 11px; font-weight: 700; }
.message-content { min-width: 0; flex: 1; max-width: calc(100% - 44px); }
.message-bubble { padding: 11px 14px; border-radius: 12px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.user-message-wrap { max-width: min(620px, 88%); display: flex; flex-direction: column; align-items: flex-end; }
.message-row.user .message-bubble { max-width: 100%; background: #e6f0ff; color: #18233a; }
.message-actions { min-height: 30px; display: flex; align-items: center; gap: 2px; margin-top: 3px; opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity .16s ease, transform .16s ease; }
.message-attachments { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.message-attachment { max-width: 200px; display: flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid #dce2eb; border-radius: 9px; background: #fff; color: #5a6476; font-size: 12px; }
.message-attachment img { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 5px; object-fit: cover; }
.message-attachment-icon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 50%; background: #f0efec; color: #3a3a3a; font-size: 13px; }
.message-attachment span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-message-wrap:hover .message-actions, .message-actions:focus-within { opacity: 1; pointer-events: auto; transform: translateY(0); }
.message-action { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #8b94a3; font-size: 17px; line-height: 1; cursor: pointer; }
.message-action:hover, .message-action:focus-visible { outline: none; background: #e8edf4; color: #354052; }
.message-action.success { color: #168a51; }
.message-action.success span { font-size: 0; }
.message-action.success span::after { content: '✓'; font-size: 15px; }
.message-row.assistant .message-bubble { padding: 3px 0 10px; }
.assistant-thinking { min-height: 34px; display: flex; align-items: center; gap: 5px; color: #8b94a3; font-size: 12px; }
.assistant-thinking span { width: 6px; height: 6px; border-radius: 50%; background: #7baeff; animation: thinkingPulse 1.15s ease-in-out infinite; }
.assistant-thinking span:nth-child(2) { animation-delay: .16s; }
.assistant-thinking span:nth-child(3) { animation-delay: .32s; }
.assistant-thinking em { margin-left: 5px; font-style: normal; }
.message-copy { min-height: 30px; padding: 0 9px; border: 1px solid #dce2eb; border-radius: 8px; background: #fff; color: #697386; font-size: 11px; cursor: pointer; }
.message-copy:hover { border-color: #d0cdc6; color: #3a3a3a; }
@keyframes thinkingPulse { 0%, 70%, 100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.task-card, .result-card-chat {
    width: 100%;
    margin-top: 4px;
    border: 1px solid #dfe5ed;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.task-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #edf0f4; }
.task-card-title { font-size: 15px; font-weight: 700; }
.task-kind { padding: 3px 8px; border-radius: 7px; background: #f0efec; color: #3a3a3a; font-size: 11px; }
.task-body { padding: 15px 16px; }
.task-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.task-field label { display: block; margin-bottom: 4px; color: #929aaa; font-size: 11px; }
.task-field span { display: block; overflow: hidden; color: #30394c; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.task-select { width: 100%; height: 38px; padding: 0 9px; border: 1px solid #d5dce7; border-radius: 9px; background: #fff; color: #273044; font-size: 13px; }
.task-upload { display: inline-flex; align-items: center; gap: 3px; min-height: 32px; padding: 0 11px; border: 1px dashed #d0cdc6; border-radius: 8px; background: #f7f6f3; color: #3a3a3a; font-size: 12px; font-weight: 500; cursor: pointer; }
.task-upload:hover { border-style: solid; background: #f0efec; }
.task-missing { margin-top: 13px; padding: 10px 12px; border-radius: 7px; background: #fff8e7; color: #a46600; font-size: 12px; line-height: 1.6; }
.authorization { display: flex; gap: 8px; align-items: flex-start; margin-top: 13px; color: #5d6678; font-size: 12px; }
.authorization input { margin-top: 3px; }
.task-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.task-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid #d2d9e4; border-radius: 9px; background: #fff; color: #343d50; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.task-button.primary { border-color: rgba(255,255,255,0.1); background: linear-gradient(135deg, rgba(58,58,58,0.92), rgba(74,74,74,0.82)); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.task-button:disabled { border-color: #d9dee7; background: #aab2c0; cursor: not-allowed; }

.task-progress { margin-top: 14px; }
.task-progress-head { display: flex; justify-content: space-between; color: #5f687a; font-size: 12px; }
.task-progress-track { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: #edf1f6; }
.task-progress-bar { position: relative; width: 0; min-width: 6px; height: 100%; border-radius: inherit; background: #3a3a3a; overflow: hidden; transition: width .45s ease; }
.task-progress-bar:not(.is-done)::after {
    content: ''; position: absolute; top: 0; left: 0; width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
    transform: translateX(-100%);
    animation: progressBarSweep 1.6s linear infinite;
}
.task-progress-bar[data-flat] { min-width: 0; }
.task-progress-bar.is-done { background: #16a34a; }
@keyframes progressBarSweep { to { transform: translateX(350%); } }
@media (prefers-reduced-motion: reduce) {
    .task-progress-bar:not(.is-done)::after { animation: none; }
}

/* --- AI 文案确认卡 --- */
.copy-confirm { width: 100%; margin-top: 10px; padding: 12px; border: 1px solid #dbe4f0; border-radius: 12px; background: #f7faff; box-sizing: border-box; }
.copy-confirm-text { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid #d5dfeb; border-radius: 8px; background: #fff; color: #1f2738; font-size: 13px; line-height: 1.7; font-family: inherit; resize: vertical; box-sizing: border-box; }
.copy-confirm-text:focus { outline: none; border-color: #3a3a3a; box-shadow: 0 0 0 3px rgba(58, 58, 58, .12); }
.copy-confirm-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.copy-confirm-btn { min-height: 32px; padding: 0 14px; border: 1px solid #dce2eb; border-radius: 8px; background: #fff; color: #5f687a; font-size: 12px; cursor: pointer; transition: all .14s ease; }
.copy-confirm-btn:hover { border-color: #d0cdc6; color: #3a3a3a; }
.copy-confirm-btn.primary { border-color: #3a3a3a; background: #3a3a3a; color: #fff; }
.copy-confirm-btn.primary:hover { background: #333333; color: #fff; }
.copy-confirm-btn:disabled { opacity: .55; cursor: not-allowed; }
.result-media { background: #eef2f7; }
.result-media img, .result-media video { width: 100%; max-height: 480px; display: block; object-fit: contain; background: #101522; }
.result-media img { background: #eef2f7; cursor: zoom-in; }
.result-media-audio { display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.result-media-audio audio { width: 100%; max-width: 440px; }
.result-details { padding: 14px 16px 16px; }
.result-status { color: #168a51; font-size: 13px; font-weight: 700; }
.result-spec { margin-top: 4px; color: #778193; font-size: 12px; }
.result-links { display: flex; gap: 9px; margin-top: 13px; }
.result-links a, .result-links button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid #d2d9e4; border-radius: 9px; background: #fff; color: #313a4d; font-size: 13px; text-decoration: none; cursor: pointer; }
.result-links .primary { border-color: #3a3a3a; background: #3a3a3a; color: #fff; }
.error-card { padding: 14px; border: 1px solid #ffd2d4; border-radius: 8px; background: #fff5f5; color: #b62f35; font-size: 13px; line-height: 1.7; }

.composer-wrap { position: sticky; bottom: 0; z-index: 80; width: min(850px, calc(100% - 34px)); margin: 0 auto; padding: 8px 0 max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(247,249,252,0), #fafafa 22px, #fafafa); }
.workspace-main.is-empty-session .composer-wrap { position: static; width: min(760px, 100%); margin-top: 25px; padding: 0; background: transparent; }
.attachment-tray { display: none; gap: 8px; padding: 0 4px 8px; overflow-x: auto; }
.attachment-tray.active { display: flex; }
.attachment-chip { min-width: 0; max-width: 210px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #dce2eb; border-radius: 7px; background: #fff; color: #5a6476; font-size: 12px; }
.attachment-chip img { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 5px; object-fit: cover; }
.attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-remove { width: 25px; height: 25px; flex: 0 0 25px; border: 0; background: transparent; color: #9ca4b2; cursor: pointer; }
.composer { position: relative; overflow: hidden; padding: 11px 12px 10px; border: 1px solid #e0ddd6; border-radius: 16px; background: #fff; transition: border-color .18s ease; }
.workspace-main.is-empty-session .composer { min-height: 158px; display: flex; flex-direction: column; padding: 18px 18px 14px; border-color: #e0ddd6; border-radius: 18px; }
.workspace-main.is-empty-session .composer textarea { min-height: 78px; flex: 1; }
.workspace-main.is-empty-session .composer-bottom { margin-top: 12px; }
.composer:focus-within { border-color: #3a3a3a; }
.composer.is-file-dragging { border-color: #3a3a3a; }
.composer-drop-hint { position: absolute; inset: 5px; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px dashed #c0bdb6; border-radius: 9px; background: rgba(245,249,255,.97); color: #3a3a3a; opacity: 0; transform: scale(.985); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.composer.is-file-dragging .composer-drop-hint { opacity: 1; transform: scale(1); }
.composer-drop-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #f0efec; color: #3a3a3a; font-size: 19px; font-weight: 700; }
.composer-drop-hint strong { font-size: 13px; font-weight: 500; }
.composer textarea { width: 100%; max-height: 150px; resize: none; border: 0; outline: 0; background: transparent; color: #1f2738; font: inherit; font-size: 14px; line-height: 1.55; }
.composer textarea::placeholder { color: #9aa3b2; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.composer-tools { display: flex; align-items: center; gap: 9px; }
.icon-tool { width: 34px; height: 34px; border: 1px solid #dce2eb; border-radius: 9px; background: #fff; color: #4f5a6d; font-size: 20px; cursor: pointer; }
.mode-switch { width: fit-content; display: flex; align-items: center; gap: 2px; margin: 0 auto 10px; padding: 3px; border: 1px solid #e0ddd6; border-radius: 12px; background: rgba(255,255,255,.92); }
.mode-option { min-width: 112px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: #5e687a; font-size: 12px; font-weight: 500; text-decoration: none; cursor: pointer; transition: color .16s ease, background .16s ease, box-shadow .16s ease; }
.mode-option .ui-icon { width: 16px; height: 16px; }
.mode-option:hover { color: #3a3a3a; background: #f7f6f3; }
.mode-option.active { background: #f0efec; color: #3a3a3a; box-shadow: inset 0 0 0 1px #d8d5ce; font-weight: 700; }
.send-btn { width: auto; min-width: 38px; height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: #3a3a3a; color: #fff; font-size: 20px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.send-btn:disabled { background: #aab3c1; cursor: not-allowed; }
.send-btn .send-text { font-size: 14px; font-weight: 500; white-space: nowrap; }

.workspace-lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 62px 18px 18px; background: rgba(58,58,58,.9); }
.workspace-lightbox.active { display: flex; }
.workspace-lightbox img { max-width: 96vw; max-height: calc(100vh - 80px); object-fit: contain; }
.workspace-lightbox button { position: absolute; top: 15px; right: 17px; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 26px; }

.workspace-dialog { width: min(440px, calc(100% - 28px)); margin: auto; padding: 0; border: 1px solid #e1e6ee; border-radius: 14px; background: #fff; color: #3a3a3a; box-shadow: 0 22px 70px rgba(58,58,58,.18); }
.workspace-dialog::backdrop { background: rgba(58,58,58,.35); backdrop-filter: blur(2px); }
.workspace-dialog form { padding: 20px; }
.workspace-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.workspace-dialog-head strong, .workspace-dialog-head span { display: block; }
.workspace-dialog-head strong { font-size: 18px; }
.workspace-dialog-head span { margin-top: 4px; color: #87909f; font-size: 12px; }
.workspace-dialog-head > button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f3f5f8; color: #667084; font-size: 20px; cursor: pointer; }
.workspace-field { display: grid; gap: 7px; margin-top: 20px; }
.workspace-field > span { color: #4f596b; font-size: 12px; font-weight: 500; }
.workspace-field select, .workspace-field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #dce2eb; border-radius: 10px; outline: 0; background: #fff; color: #1b2232; font: inherit; }
.workspace-field select:focus, .workspace-field input:focus { border-color: #c8c5be; box-shadow: 0 0 0 3px rgba(58, 58, 58, .1); }
.inline-create-project { margin-top: 10px; padding: 4px 0; border: 0; background: transparent; color: #3a3a3a; font-size: 12px; cursor: pointer; }
.workspace-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.workspace-dialog-actions button { min-height: 40px; padding: 0 16px; border: 1px solid #dce2eb; border-radius: 10px; background: #fff; color: #4d5668; font-weight: 500; cursor: pointer; }
.workspace-dialog-actions .primary { border-color: #3a3a3a; background: #3a3a3a; color: #fff; }

/* 统一导航抽屉断点（与 common.css 的 860px 对齐）：历史面板转为左侧抽屉 */
@media (max-width: 860px) {
    .chat-history-panel {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(300px, 84vw);
        flex-basis: auto;
        z-index: 210;
        padding: 14px 14px 14px;
        background: #fafafa;
        transform: translateX(-103%);
        transition: transform .24s ease;
        box-shadow: 14px 0 34px rgba(58,58,58,.16);
        overflow-y: auto;
    }
    .chat-history-panel,
    .chat-history-panel.collapsed { margin-left: 0; opacity: 1; pointer-events: auto; }
    .chat-history-panel.open { transform: translateX(0); }
    .chat-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: #3a3a3a; font-size: 15px; font-weight: 700; }
    .chat-history-close { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #657085; font-size: 24px; cursor: pointer; }
    .chat-history-close:hover { background: #eeedea; color: #3a3a3a; }
    .chat-history-mask { position: fixed; inset: 0; z-index: 205; display: none; background: rgba(58,58,58,.34); }
    .chat-history-mask.open { display: block; }
}

@media (max-width: 820px) {
    .workspace-sidebar {
        width: 280px;
        flex-basis: 280px;
        position: fixed;
        left: 0;
        top: 0;
        overflow: hidden;
        transform: translateX(-102%);
        transition: transform .24s ease;
        box-shadow: 14px 0 34px rgba(58,58,58,.16);
    }
    .session-delete { opacity: 1; transform: none; pointer-events: auto; }
    .workspace-sidebar::before,
    .workspace-sidebar:hover::before,
    .workspace-sidebar:focus-within::before { width: 100%; }
    .workspace-sidebar.open { transform: translateX(0); }
    .sidebar-head,
    .sidebar-nav,
    .sidebar-projects,
    .sidebar-section,
    .sidebar-foot { width: 100%; }
    .rail-label,
    .workspace-sidebar:hover .rail-label,
    .workspace-sidebar:focus-within .rail-label {
        max-width: none;
        opacity: 1;
        transform: none;
    }
    .new-chat-btn,
    .workspace-sidebar:hover .new-chat-btn,
    .workspace-sidebar:focus-within .new-chat-btn,
    .sidebar-nav a,
    .workspace-sidebar:hover .sidebar-nav a,
    .workspace-sidebar:focus-within .sidebar-nav a { width: 100%; }
    .sidebar-section,
    .sidebar-projects,
    .workspace-sidebar:hover .sidebar-projects,
    .workspace-sidebar:focus-within .sidebar-projects,
    .workspace-sidebar:hover .sidebar-section,
    .workspace-sidebar:focus-within .sidebar-section,
    .sidebar-foot,
    .workspace-sidebar:hover .sidebar-foot,
    .workspace-sidebar:focus-within .sidebar-foot {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .sidebar-projects { max-height: 40%; }
    .project-add-chat, .project-remove, .project-rename { opacity: 1; }
    .sidebar-close, .sidebar-toggle { display: grid; place-items: center; }
    .sidebar-mask { position: fixed; inset: 0; z-index: 210; background: rgba(58,58,58,.34); }
    .sidebar-mask.open { display: block; }
    .workspace-topbar { padding: 0 14px; }
    .workspace-substatus { display: none; }
    .workspace-title { font-size: 14px; }
    .topbar-shortcut { display: none; }
    .workspace-credits span:last-child { display: none; }
    .workspace-credits { padding: 0 9px; }
    .workspace-empty { width: min(100% - 24px, 620px); padding: 34px 0 42px; }
    .empty-logo { width: 62px; height: 62px; border-radius: 15px; font-size: 24px; }
    .workspace-empty h1 { margin-top: 16px; font-size: 24px; }
    .workspace-empty > p { max-width: 320px; font-size: 13px; }
    .message-stream { width: calc(100% - 24px); padding-top: 24px; padding-bottom: 220px; }
    .message-row { gap: 9px; }
    .message-row.assistant .message-content { flex: 1; max-width: none; padding-right: 38px; }
    .assistant-avatar { width: 29px; height: 29px; flex-basis: 29px; }
    .message-content { max-width: calc(100% - 38px); }
    .message-actions { opacity: 1; pointer-events: auto; transform: none; }
    .task-summary { grid-template-columns: 1fr; gap: 10px; }
    .composer-wrap { width: calc(100% - 20px); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    .composer { padding: 10px; }
    .workspace-main.is-empty-session .composer { min-height: 146px; padding: 15px 14px 12px; border-radius: 16px; }
    .workspace-main.is-empty-session .composer textarea { min-height: 72px; }
    .workspace-main.is-empty-session .composer-wrap { margin-top: 20px; }
    .mode-switch { width: 100%; }
    .mode-option { min-width: 0; flex: 1; padding: 0 7px; }
    .result-media img, .result-media video { max-height: 62vh; }
}

@media (max-width: 390px) {
    .workspace-avatar { display: none; }
    .workspace-account { display: none; }
    .topbar-actions { gap: 7px; }
    .workspace-title { max-width: 150px; }
    .mode-option { gap: 4px; padding: 0 5px; font-size: 11px; }
}
