/* --review-ui-* 由页面在链入本文件之前显式加载 collaboration_light_tokens.css */

.main-content {
    padding: 0 !important;
}

.collaboration-main-container {
    /* v3.0 高度链修复：必须有确定高度，flex 子元素才能撑满视口 */
    height: calc(100vh - 64px);
    min-height: calc(100vh - 64px);
}

.collaboration-main-container .collaboration-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;        /* v2.6 恢复 hidden：防止全局溢出，让子区域各自管理滚动 */
}

.collaboration-container {
    display: flex;
    min-height: 0;          /* v3.0: flex 高度链贯通，允许收缩 */
    height: 100%;           /* 填满父容器 */
    overflow: hidden;       /* v3.0: 防止内容溢出导致底部空白 */
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    background: var(--review-ui-bg-page);
    color: var(--review-ui-text-primary);
}

/* 左侧任务列表 */
.task-list-panel {
    width: 400px;
    background: var(--review-ui-bg-panel);
    border-right: 1px solid var(--review-ui-border);
    display: flex;
    flex-direction: column;
    max-height: none;
    height: 100%;
    overflow: hidden;
}

.task-list-header {
    padding: 20px;
    border-bottom: 1px solid var(--review-ui-border);
    background: var(--review-ui-bg-card);
}

.task-list-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--review-ui-text-primary);
    margin-bottom: 0;
}

/* 统计卡片（保留旧样式保证向后兼容） */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

/* 统计卡片四胶囊 v2.0 — 圆角矩形卡片 */
.stats-capsules {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
    padding: 0 2px;
}

.stat-capsule {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 6px;
    font-size: 11px;
    color: var(--review-ui-text-secondary, #666);
    background: var(--review-ui-bg-card, #fff);
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    line-height: 1.3;
    text-align: center;
    min-height: 48px;
}

.stat-capsule::before {
    content: '';
    font-size: 12px;
    opacity: 0.6;
}

.stat-capsule.pending::before { content: '📋'; }
.stat-capsule.in_review::before { content: '👁'; }
.stat-capsule.retry::before { content: '🔧'; }
.stat-capsule.completed::before { content: '✅'; }

.stat-capsule:hover {
    border-color: var(--review-ui-accent, #00d1b2);
    background: rgba(0, 209, 178, 0.06);
    transform: translateY(-1px);
}

.stat-capsule.active {
    border-color: var(--review-ui-accent, #00d1b2);
    background: rgba(0, 209, 178, 0.12);
    color: var(--review-ui-accent, #00d1b2);
}

.stat-capsule strong {
    font-weight: 700;
    font-size: 16px;
    display: block;
    line-height: 1.2;
}

.stat-capsule.pending strong { color: #1890ff; }
.stat-capsule.in_review strong { color: #faad14; }
.stat-capsule.retry strong { color: #ff4d4f; }
.stat-capsule.completed strong { color: #52c41a; }

.stat-capsule.pending.active strong { color: #1890ff; }
.stat-capsule.in_review.active strong { color: #faad14; }
.stat-capsule.retry.active strong { color: #ff4d4f; }
.stat-capsule.completed.active strong { color: #52c41a; }

.stat-card {
    background: var(--review-ui-bg-panel);
    border-radius: 6px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--review-ui-border);
}

.stat-card:hover {
    border-color: var(--review-ui-accent);
}

.stat-card.active {
    border-color: var(--review-ui-accent);
    background: rgba(0, 209, 178, 0.14);
}

.stat-label {
    font-size: 11px;
    color: var(--review-ui-text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--review-ui-text-primary);
}

.stat-card.pending .stat-value { color: #1890ff; }
.stat-card.in_review .stat-value { color: #faad14; }
.stat-card.retry .stat-value { color: #ff4d4f; }
.stat-card.completed .stat-value { color: #52c41a; }

/* 筛选工具栏 */
.filter-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex: 1;
}

.filter-group {
    flex: 1;
    min-width: 0;
}

.filter-group label {
    display: block;
    font-size: 12px;
    color: var(--review-ui-text-secondary);
    margin-bottom: 4px;
}

.filter-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--review-ui-border);
    border-radius: 4px;
    font-size: 12px;
    background: var(--review-ui-bg-panel);
    color: var(--review-ui-text-primary);
}

.task-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(113, 62, 255, 0.36) rgba(15, 23, 42, 0.08);
    scrollbar-gutter: stable;
}

.task-list-content::-webkit-scrollbar {
    width: 10px;
}

.task-list-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
}

.task-list-content::-webkit-scrollbar-thumb {
    background: rgba(113, 62, 255, 0.36);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
}

.task-list-content::-webkit-scrollbar-thumb:hover {
    background: rgba(113, 62, 255, 0.52);
}

.task-item {
    background: var(--review-ui-bg-card);
    border: 1px solid var(--review-ui-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.task-item:hover {
    border-color: var(--review-ui-accent);
    box-shadow: 0 2px 8px rgba(113, 62, 255, 0.1);
}

.task-item.active {
    border-color: var(--review-ui-accent);
    background: rgba(113, 62, 255, 0.10);
}

.task-item.from-dispatch {
    border-color: #b37feb;
    box-shadow: 0 0 0 2px rgba(114, 46, 209, 0.08);
}

.task-item.from-dispatch.active {
    border-color: #722ed1;
    background: #f9f0ff;
    box-shadow: 0 0 0 2px rgba(114, 46, 209, 0.16);
}

/* v1.8: 超限转人工任务橙色高亮 */
.task-item.over-limit {
    border-color: #ff7a45;
    background: rgba(255, 122, 69, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 122, 69, 0.15);
}

.task-item.over-limit.active {
    border-color: #ff4d4f;
    background: rgba(255, 77, 79, 0.12);
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

.task-item.over-limit .task-priority-dot {
    background: #ff7a45;
    animation: pulse-orange 1.5s infinite;
}

@keyframes pulse-orange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* v1.8: 子任务ID样式 */
.task-sub-id {
    color: #1890ff;
    font-family: monospace;
    font-size: 11px;
    margin-left: 4px;
    font-weight: 500;
}

.task-item-header {
    margin-bottom: 8px;
}

.task-heading {
    min-width: 0;
}

.task-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.task-belonging {
    font-size: 16px;
    font-weight: 600;
    color: var(--review-ui-text-primary);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.task-title-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.task-scope-chip {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(24, 144, 255, 0.10);
    color: #0958d9;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.task-id-small {
    font-size: 11px;
    color: var(--review-ui-text-secondary);
    margin-top: 4px;
}

.task-source-info {
    line-height: 1.5;
}

.task-triage-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.task-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--review-ui-text-secondary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.task-kpi-label {
    color: var(--review-ui-text-muted);
    font-weight: 600;
}

.task-kpi-chip strong {
    color: var(--review-ui-text-primary);
    font-size: 11px;
    font-weight: 700;
}

.task-kpi-chip-high {
    background: #f6ffed;
}

.task-kpi-chip-high strong {
    color: #389e0d;
}

.task-kpi-chip-medium {
    background: #fff7e6;
}

.task-kpi-chip-medium strong {
    color: #d46b08;
}

.task-kpi-chip-low {
    background: #fff1f0;
}

.task-kpi-chip-low strong {
    color: #cf1322;
}

.task-trace-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.task-trace-chip {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--review-ui-text-secondary);
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
}

.task-priority {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.9;
}

.task-priority-text {
    letter-spacing: 0.02em;
}

.task-priority.high {
    background: rgba(255, 241, 240, 0.9);
    color: #cf1322;
}

.task-priority.medium {
    background: rgba(255, 247, 230, 0.9);
    color: #d46b08;
}

.task-priority.low {
    background: rgba(246, 255, 237, 0.95);
    color: #389e0d;
}

.task-meta {
    font-size: 12px;
    color: var(--review-ui-text-secondary);
    line-height: 1.5;
}

/* v1.8: 表格化布局样式 */
.task-meta-table {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 4px 8px;
    font-size: 12px;
    margin-top: 8px;
}

.task-meta-label {
    color: var(--review-ui-text-secondary, #666);
    white-space: nowrap;
    text-align: right;
    padding-right: 4px;
    font-weight: 500;
}

.task-meta-value {
    color: var(--review-ui-text-primary, #222);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-meta-value.urgent {
    color: #ff4d4f;
    font-weight: 600;
}

.task-meta-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap !important;
}

.task-taxonomy-row {
    margin-bottom: 8px;
}

.task-chip,
.status-badge,
.task-type-badge,
.task-origin-type-badge,
.task-source-badge,
.task-stage-badge {
    display: inline-flex !important;
    align-items: center;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-type-badge {
    display: inline-block !important;
    background: rgba(15, 23, 42, 0.06);
    color: var(--review-ui-text-secondary);
}

.task-source-badge {
    display: inline-block !important;
}

.task-origin-type-badge {
    color: #713eff;
    background: rgba(113, 62, 255, 0.12);
}

.task-stage-badge {
    color: #4338ca;
    background: rgba(67, 56, 202, 0.10);
}

.task-session-badge {
    color: #0f766e;
    background: rgba(20, 184, 166, 0.12);
}

.task-ai-qc-badge {
    color: #7c2d12;
    background: rgba(251, 146, 60, 0.16);
}

.task-source-badge.dispatch {
    background: rgba(114, 46, 209, 0.12);
    color: #722ed1;
    border: 1px solid rgba(114, 46, 209, 0.18);
}

.task-meta-row .status-badge {
    display: inline-block !important;
    flex-shrink: 0;
    white-space: nowrap;
}

.task-meta-item {
    margin-bottom: 4px;
}

.task-origin-line {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    margin-bottom: 6px;
}

.task-origin-line-compact {
    margin-bottom: 4px;
}

.task-origin-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--review-ui-text-muted);
    letter-spacing: 0.02em;
}

.task-origin-value {
    min-width: 0;
    color: var(--review-ui-text-primary);
    word-break: break-word;
}

.task-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.task-meta-inline-muted {
    color: var(--review-ui-text-secondary);
    margin-top: 4px;
}

.task-meta-inline-muted strong {
    color: var(--review-ui-text-muted);
    font-weight: 600;
}

.task-trace-row-subtle {
    margin-top: 4px;
}

.task-trace-row-subtle .task-trace-chip {
    background: rgba(15, 23, 42, 0.04);
}

.task-qc-score {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}

.task-qc-score.high {
    background: #f6ffed;
    color: #389e0d;
}

.task-qc-score.medium {
    background: #fff7e6;
    color: #d46b08;
}

.task-qc-score.low {
    background: #fff1f0;
    color: #cf1322;
}

.task-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.btn-action {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-action:hover {
    border-color: #713eff;
    color: #713eff;
}

.btn-action.primary {
    background: #713eff;
    color: white;
    border-color: #713eff;
}

.btn-action.primary:hover {
    background: #5a2fd9;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* ========== 左侧任务列表 V2 — 对齐调试台风格 ========== */

.task-list-panel-v2 {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--review-ui-bg-card, #fff);
    border-right: 1px solid var(--review-ui-border, #e8e8e8);
    transition: width 0.3s ease;
}

/* 折叠状态 */
.collaboration-container.sidebar-collapsed .task-list-panel-v2 {
    width: 0;
    overflow: hidden;
}

.task-list-header-v2 {
    padding: 12px;
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    background: var(--review-ui-bg-panel, #fafafa);
}

.task-list-title-row-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-list-title-v2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--review-ui-text-primary, #333);
}

.sidebar-toggle-btn-v2 {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--review-ui-text-secondary, #999);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.sidebar-toggle-btn-v2:hover {
    background: var(--review-ui-border, #e8e8e8);
    color: var(--review-ui-text-primary, #333);
}

/* 侧边栏展开按钮 — 仅折叠时可见，固定在工作区左上角 */
.sidebar-expand-btn-v2 {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 100; /* P1: 必须 > workspace 内所有 z-index（v5-title-bar=15, capsule=15） */
    background: var(--review-ui-bg-card, #fff);
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    color: var(--review-ui-text-secondary, #999);
    padding: 6px 10px;
    transition: all 0.2s;
    line-height: 1;
}

.sidebar-expand-btn-v2:hover {
    background: var(--review-ui-border, #e8e8e8);
    color: var(--review-ui-text-primary, #333);
}

/* 折叠时：显示展开按钮 */
.collaboration-container.sidebar-collapsed .sidebar-expand-btn-v2 {
    display: block;
}

/* 状态 Tab 切换 */
.task-status-tabs-v2 {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.status-tab-v2 {
    flex: 1;
    min-width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 6px;
    background: var(--review-ui-bg-card, #fff);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.status-tab-v2:hover {
    border-color: var(--review-ui-accent, #1890ff);
    color: var(--review-ui-accent, #1890ff);
}

.status-tab-v2.active {
    background: var(--review-ui-accent, #1890ff);
    border-color: var(--review-ui-accent, #1890ff);
    color: #fff;
}

.tab-count {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 2px;
}

/* 统一搜索框 */
.task-search-bar-v2 {
    position: relative;
    margin-bottom: 8px;
}

.task-search-bar-v2 input {
    width: 100%;
    padding: 8px 32px 8px 10px;
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.task-search-bar-v2 input:focus {
    border-color: var(--review-ui-accent, #1890ff);
}

.search-clear-btn-v2 {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    color: var(--review-ui-text-muted, #bbb);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s;
}

.search-clear-btn-v2:hover {
    background: var(--review-ui-border, #e8e8e8);
    color: var(--review-ui-text-primary, #333);
}

/* 高级筛选折叠区 */
.advanced-filters-v2 {
    border-top: 1px solid var(--review-ui-border, #e8e8e8);
    padding-top: 8px;
}

.advanced-filters-v2 summary {
    font-size: 12px;
    color: var(--review-ui-text-secondary, #666);
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.advanced-filters-v2 summary:hover {
    color: var(--review-ui-text-primary, #333);
}

.filter-grid-v2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 8px;
}

.filter-item-v2 label {
    display: block;
    font-size: 11px;
    color: var(--review-ui-text-secondary, #999);
    margin-bottom: 4px;
}

.filter-item-v2 select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 4px;
    font-size: 12px;
    background: var(--review-ui-bg-card, #fff);
    outline: none;
}

.filter-item-v2 select:focus {
    border-color: var(--review-ui-accent, #1890ff);
}

/* 任务列表内容区 */
.task-list-content-v2 {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.empty-state-v2 {
    text-align: center;
    padding: 40px 20px;
    color: var(--review-ui-text-muted, #bbb);
    font-size: 13px;
}

/* 保留旧样式作为后备 */
.task-list-panel {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--review-ui-bg-card, #fff);
    border-right: 1px solid var(--review-ui-border, #e8e8e8);
    transition: width 0.3s ease;
}

.collaboration-container.sidebar-collapsed .task-list-panel {
    width: 0;
    overflow: hidden;
}

.task-list-header {
    padding: 12px;
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    background: var(--review-ui-bg-panel, #fafafa);
}

/* ========== 右侧审核工作台 V4 Flexbox 吸顶布局 ========== */

.workspace-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    position: relative; /* 为侧边栏展开按钮提供定位上下文 */
    background: var(--review-ui-bg-page);
}

.workspace-origin-banner {
    margin: 16px 16px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(114, 46, 209, 0.10), rgba(24, 144, 255, 0.08));
    border: 1px solid rgba(114, 46, 209, 0.18);
    color: #531dab;
    font-size: 13px;
    line-height: 1.6;
}

.workspace-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;       /* v3.0: 给子元素提供确定高度，V4 flex 链贯通 */
    padding: 0;
    color: var(--review-ui-text-primary);
}

.workspace-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: none;
    margin: 0;
    padding: 12px;
}

.workspace-two-column-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
    align-items: start;
}

.workspace-main-column,
.workspace-collab-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-support-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.92fr);
    gap: 16px;
}

/* 任务信息横排卡片 */
.task-info-card {
    background: var(--review-ui-bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.task-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* 任务信息表格化布局 — 行式 key-value */
.task-info-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 6px;
    overflow: hidden;
}

.task-info-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: stretch;
    font-size: 13px;
    border-bottom: 1px solid var(--review-ui-border, #f0f0f0);
}

.task-info-row:last-child {
    border-bottom: none;
}

.task-info-row .task-info-label {
    font-size: 12px;
    color: var(--review-ui-text-secondary, #666);
    background: var(--review-ui-bg-panel, #fafafa);
    padding: 8px 10px;
    border-right: 1px solid var(--review-ui-border, #f0f0f0);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.task-info-row .task-info-value {
    font-size: 13px;
    color: var(--review-ui-text-primary, #222);
    font-weight: 500;
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* 兼容旧 grid 类 */
.task-info-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 6px;
    overflow: hidden;
}

.task-info-item {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: stretch;
    font-size: 13px;
    border-bottom: 1px solid var(--review-ui-border, #f0f0f0);
}

.task-info-item:last-child {
    border-bottom: none;
}

.task-info-label {
    font-size: 12px;
    color: var(--review-ui-text-secondary, #666);
    background: var(--review-ui-bg-panel, #fafafa);
    padding: 8px 10px;
    border-right: 1px solid var(--review-ui-border, #f0f0f0);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.task-info-value {
    font-size: 13px;
    color: var(--review-ui-text-primary, #222);
    font-weight: 500;
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* 内容预览和QC报告并排 */
.preview-qc-layout {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 24px;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.task-context-card,
.qc-summary-card,
.content-preview-card-compact,
.collaboration-card {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.sidebar-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
}

.info-value {
    color: #333;
    font-weight: 500;
}

/* QC报告 — 结构化表格化 */
.qc-report-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.qc-header-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--review-ui-border, #f0f0f0);
    margin-bottom: 12px;
}

.qc-score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
}

.qc-score-value {
    font-size: 36px;
    font-weight: 700;
    color: #52c41a;
    line-height: 1;
}

.qc-report-shell.compact .qc-score-value {
    font-size: 30px;
    line-height: 1;
}

.qc-score-label {
    font-size: 11px;
    color: var(--review-ui-text-secondary, #888);
    margin-top: 4px;
    white-space: nowrap;
}

.qc-score-value.medium { color: #faad14; }
.qc-score-value.low { color: #ff4d4f; }

.qc-score-bar-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qc-score-bar-wrap {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.qc-score-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.qc-score-summary-text {
    font-size: 12px;
    color: var(--review-ui-text-secondary, #666);
    line-height: 1.5;
}

.qc-pending-hint {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

/* QC 维度表格 */
.qc-section {
    padding: 10px 0;
    border-bottom: 1px solid var(--review-ui-border, #f0f0f0);
}

.qc-section:last-child {
    border-bottom: none;
}

.qc-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--review-ui-text-secondary, #888);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.qc-dim-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--review-ui-border, #f0f0f0);
    border-radius: 4px;
    overflow: hidden;
}

.qc-dim-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    font-size: 11px;
    font-weight: 600;
    color: var(--review-ui-text-secondary, #888);
    background: var(--review-ui-bg-panel, #fafafa);
    padding: 5px 8px;
    border-bottom: 1px solid var(--review-ui-border, #f0f0f0);
}

.qc-dim-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    font-size: 12px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--review-ui-border, #f5f5f5);
}

.qc-dim-row:last-child {
    border-bottom: none;
}

.qc-dim-col-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.qc-dim-col-score {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.qc-dim-col-score.dim-high { color: #52c41a; }
.qc-dim-col-score.dim-medium { color: #faad14; }
.qc-dim-col-score.dim-low { color: #ff4d4f; }

.qc-no-data {
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 12px 0;
}

/* QC 问题表格 */
.qc-issues-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.qc-issue-row {
    display: grid;
    grid-template-columns: 24px 42px minmax(0, 1fr);
    gap: 6px;
    align-items: baseline;
    padding: 5px 6px;
    font-size: 12px;
    border-bottom: 1px solid var(--review-ui-border, #f5f5f5);
}

.qc-issue-row:last-child {
    border-bottom: none;
}

.qc-issue-idx {
    color: #bbb;
    font-size: 10px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.qc-issue-severity {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    text-align: center;
    white-space: nowrap;
}

.qc-issue-severity.severity-high {
    color: #fff;
    background: #ff4d4f;
}

.qc-issue-severity.severity-medium {
    color: #fff;
    background: #faad14;
}

.qc-issue-severity.severity-low {
    color: #666;
    background: #f0f0f0;
}

.qc-issue-text {
    color: var(--review-ui-text-primary, #333);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* QC 建议表格 */
.qc-suggestions-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.qc-suggestion-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px;
    align-items: baseline;
    padding: 5px 6px;
    font-size: 12px;
    border-bottom: 1px solid var(--review-ui-border, #f5f5f5);
}

.qc-suggestion-row:last-child {
    border-bottom: none;
}

.qc-suggestion-idx {
    color: #bbb;
    font-size: 10px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.qc-suggestion-text {
    color: var(--review-ui-text-secondary, #555);
    line-height: 1.5;
    word-break: break-word;
}

.qc-summary-text {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--review-ui-border, #f0f0f0);
    color: #666;
    font-size: 12px;
    line-height: 1.6;
}

/* 旧兼容 — 不再使用但保留引用安全 */
.qc-score-display { display: none; }
.qc-dimensions { display: none; }
.qc-dimension { display: none; }

/* 主内容区 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: calc(100vh - 80px);  /* v2.7 高度链修正：给 flex 父容器明确高度，让子元素 height:100% 可继承 */
}

.content-preview-card {
    background: var(--review-ui-bg-card);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    min-height: 0;          /* v3.0: 允许在 flex 容器内收缩，响应拖拽 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-preview-card-compact {
    min-height: auto;
    padding: 20px;
}

/* 可拖拽调整大小分隔条 v2.0 — grid层级全宽 */
.preview-resizer-wrapper {
    grid-area: resizer;
    position: relative;
    height: 6px;
    width: 100%;
    flex-shrink: 0;
    z-index: 10;
}

/* 提示文本 */
.preview-resizer-hint {
    position: absolute;
    bottom: -16px;          /* v5.6: 移到 resizer 下方 */
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #999;
    pointer-events: none;
    white-space: nowrap;
    transition: color 0.2s, font-weight 0.2s;
    z-index: 10;
}

.preview-resizer-wrapper:hover .preview-resizer-hint,
.preview-resizer-wrapper.dragging .preview-resizer-hint {
    color: var(--review-ui-accent, #00d1b2);
    font-weight: 500;
}

/* 可拖拽调整大小的分隔条 */
.preview-resizer {
    width: 100%;
    height: 4px;
    background: var(--review-ui-border, #e8e8e8);
    cursor: ns-resize;
    position: relative;
    margin: 1px 0;
    transition: background 0.2s;
}

.preview-resizer:hover {
    background: var(--review-ui-accent, #00d1b2);
}

.preview-resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    background: var(--review-ui-accent, #00d1b2);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.preview-resizer:hover::before {
    opacity: 1;
}

.preview-resizer-wrapper.dragging .preview-resizer {
    background: var(--review-ui-accent, #00d1b2);
}

.preview-resizer-wrapper.dragging .preview-resizer::before {
    opacity: 1;
}

.preview-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--review-ui-text-primary);
    margin-bottom: 16px;
}

.preview-container {
    width: 100%;
    min-height: 0;          /* v3.0: 允许收缩，响应拖拽 */
    flex: 1;                /* v3.0: 填满父卡片剩余空间 */
    background: #eef2ff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    position: relative;
    overflow: hidden;
}

.preview-container-compact {
    min-height: 320px;
    height: 360px;
}

.preview-container-primary {
    flex: 1;                /* v5.7: 显式声明，填满 .v4-preview-area 剩余空间，决策栏吸底 */
    min-height: 0;          /* v3.0: 允许收缩 */
    background: transparent;
    overflow-y: auto;       /* v5.4: 改为纵向滚动，替代 overflow:hidden */
    overflow-x: hidden;     /* v5.4: 水平方向仍隐藏 */
    align-items: flex-start; /* v5.4: 内容从顶部开始，不再居中 */
    justify-content: flex-start; /* v5.5: 覆盖基类 center，内容撑满宽度 */
    padding: 16px 20px;     /* v5.6: 替代原卡片 padding，去卡片化 */
}

.review-preview-shell {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-source-tabs {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preview-source-tab {
    padding: 8px 14px;
    border: 1px solid var(--review-ui-border);
    border-radius: 999px;
    background: var(--review-ui-bg-panel);
    color: var(--review-ui-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-source-tab.active {
    background: rgba(0, 209, 178, 0.14);
    border-color: var(--review-ui-accent);
    color: var(--review-ui-text-primary);
}

.preview-version-panel {
    width: 100%;
}

.review-player-shell {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-player-stage {
    position: relative;
    width: 100%;
    min-height: 460px;
    height: min(54vh, 560px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border-radius: 16px;
    overflow: hidden;
}

.review-player-shell.audio-mode .review-player-stage {
    min-height: 180px;
    height: 200px;
    padding: 24px;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
}

.review-preview-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    background: transparent;
}

.review-preview-media.audio {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.review-audio-stage-label {
    position: relative;
    z-index: 1;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(113, 62, 255, 0.10);
    color: #3730a3;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.review-player-controls {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.review-player-btn {
    width: clamp(30px, 2.6vw, 34px);
    height: clamp(30px, 2.6vw, 34px);
    flex: 0 0 auto;
    border-radius: 999px;
    border: 0;
    background: rgba(113, 62, 255, 0.12);
    color: #4c28c7;
    font-size: 14px;
    cursor: pointer;
}

.review-player-time {
    font-size: 11px;
    min-width: 32px;
    flex: 0 0 auto;
    text-align: center;
    color: #374151;
}

.review-player-progress {
    flex: 1;
    min-width: 0;
    accent-color: #8b5cf6;
}

.review-player-volume {
    width: clamp(44px, 7vw, 72px);
    flex: 0 1 clamp(44px, 7vw, 72px);
    accent-color: #8b5cf6;
}

.preview-image-stage {
    width: 100%;
    min-height: 460px;
    height: min(54vh, 560px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 16px;
    background: #eef2ff;
    overflow: hidden;
}

.preview-image-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}

.preview-container img,
.preview-container video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 4px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.preview-container > div {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-container .review-preview-media,
.preview-container .preview-image-media {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
}

.preview-container > .review-preview-shell,
.preview-container > .preview-image-stage {
    align-items: stretch;
    justify-content: flex-start;
}

/* 批注工具 */
.annotation-toolbar {
    margin-top: 16px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-annotation {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-annotation:hover {
    border-color: #713eff;
    color: #713eff;
}

.annotation-form {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    display: none;
}

.annotation-form.active {
    display: block;
}

.annotation-form input,
.annotation-form textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

.annotation-form textarea {
    min-height: 60px;
    resize: vertical;
}

.annotations-list {
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.annotation-item {
    padding: 8px;
    background: #f9f9f9;
    border-left: 3px solid #713eff;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 12px;
}

.annotation-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.annotation-item-content {
    color: #666;
}

.annotation-item-meta {
    font-size: 11px;
    color: #999;
}

/* 决策表单 */
.decision-form-card {
    background: var(--review-ui-bg-card);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.collaboration-card {
    min-height: 100%;
}

.decision-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.decision-shell-header {
    display: flex;
    align-items: center;
}

.decision-mode-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 10px;
    color: #52c41a;
    font-size: 12px;
    font-weight: 500;
}

.decision-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 0;
}

.btn-decision {
    padding: 12px 24px;
    border: 2px solid var(--review-ui-border);
    border-radius: 8px;
    background: var(--review-ui-bg-panel);
    color: var(--review-ui-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-decision:hover {
    border-color: var(--review-ui-accent);
    color: var(--review-ui-text-primary);
}

.btn-decision.active {
    background: var(--review-ui-accent);
    color: white;
    border-color: var(--review-ui-accent);
}

.btn-decision.approve {
    border-color: #52c41a;
}

.btn-decision.approve.active {
    background: #52c41a;
    color: white;
}

.btn-decision.retry {
    border-color: #ff4d4f;
}

.btn-decision.retry.active {
    background: #ff4d4f;
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

.decision-form-body {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--review-ui-text-secondary);
    margin-bottom: 8px;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--review-ui-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: var(--review-ui-bg-panel);
    color: var(--review-ui-text-primary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--review-ui-border);
    border-radius: 4px;
    background: var(--review-ui-bg-panel);
    color: var(--review-ui-text-secondary);
}

.submit-button {
    width: 100%;
    padding: 12px;
    background: var(--review-ui-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-button:hover {
    filter: brightness(1.06);
}

.submit-button:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

.director-review-chat {
    display: none;
    flex-direction: column;
    min-height: 460px;
    border: 1px solid #d3adf7;
    border-radius: 12px;
    overflow: hidden;
    background: #faf5ff;
}

.director-chat-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #722ed1, #531dab);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.director-chat-messages {
    flex: 1;
    min-height: 280px;
    overflow-y: auto;
    padding: 12px 16px;
    background: #faf5ff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.director-chat-input-row {
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #d3adf7;
    background: #fff;
}

.director-chat-actions {
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #d3adf7;
    background: #faf5ff;
}

.director-chat-placeholder {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1px dashed #d3adf7;
    border-radius: 12px;
    color: #8c8c8c;
    background: linear-gradient(180deg, #fcfaff 0%, #faf5ff 100%);
    text-align: center;
    line-height: 1.8;
}

.status-badge {
    display: inline-flex;
}

.status-badge.pending {
    background: #e6f7ff;
    color: #1890ff;
}

.status-badge.in_review {
    background: #fff7e6;
    color: #faad14;
}

.status-badge.approved {
    background: #f6ffed;
    color: #52c41a;
}

.status-badge.retry {
    background: #fff1f0;
    color: #ff4d4f;
}

.status-badge.manual_fix {
    background: #e6f4ff;
    color: #1677ff;
}

.status-badge.terminated {
    background: rgba(15, 23, 42, 0.08);
    color: #475569;
}

.empty-workspace {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 16px;
}

/* 响应式梯度 L1：桌面收束，先把右侧多列内容降为单列展示。 */
@media (max-width: 1360px) {
    .workspace-two-column-layout {
        grid-template-columns: 1fr;
    }

    .task-info-grid,
    .task-info-table {
        /* table layout is single column already, no grid override needed */
    }

    .task-info-row,
    .task-info-item {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .preview-support-grid {
        grid-template-columns: 1fr;
    }

    .review-player-stage,
    .preview-image-stage {
        min-height: 340px;
        height: 420px;
    }

    .review-player-controls {
        gap: 6px;
        padding: 7px 8px;
    }

    .review-player-volume {
        width: 48px;
        flex-basis: 48px;
    }
}

/* 响应式梯度 L2：页面壳切单列，左任务栏与右工作区上下堆叠。 */
@media (max-width: 900px) {
    .collaboration-main-container {
        height: auto;
        min-height: calc(100vh - 64px);
        min-height: calc(100dvh - 64px);
    }

    .collaboration-main-container .collaboration-content {
        overflow: auto;
    }

    .collaboration-container {
        flex-direction: column;
        height: auto;
        min-height: 100%;
    }

    .task-list-panel {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--review-ui-border);
    }

    .task-list-content {
        max-height: 56vh;
    }

    .workspace-panel {
        width: 100%;
        min-width: 0;
        min-height: 60vh;
    }
}

/* 响应式梯度 L3：内容密度收口，统一压卡片留白、信息字号和间距。 */
@media (max-width: 640px) {
    .task-list-header {
        padding: 16px;
    }

    .task-list-title {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .stats-cards {
        gap: 6px;
        margin-bottom: 12px;
    }

    .stat-card {
        padding: 10px 8px;
    }

    .stat-label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .stat-value {
        font-size: 18px;
    }

    .filter-toolbar {
        gap: 6px;
    }

    .filter-group label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .filter-group select {
        padding: 6px 7px;
        font-size: 11px;
    }

    .task-list-content {
        padding: 12px;
    }

    .workspace-origin-banner {
        margin: 12px 12px 0;
        padding: 10px 12px;
        font-size: 12px;
        line-height: 1.5;
    }

    .workspace-layout {
        gap: 16px;
        padding: 10px;
    }

    .task-info-card,
    .sidebar-card,
    .decision-form-card {
        padding: 16px;
    }

    .task-info-grid,
    .task-info-table {
        /* compact on mobile */
    }

    .task-info-row,
    .task-info-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .task-info-row .task-info-label,
    .task-info-label {
        font-size: 11px;
        padding: 6px 8px;
    }

    .task-info-row .task-info-value,
    .task-info-value {
        font-size: 12px;
        padding: 6px 8px;
    }

    .sidebar-card-title {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .decision-shell {
        gap: 12px;
    }

    .decision-buttons {
        gap: 8px;
    }

    .btn-decision {
        padding: 10px 12px;
        font-size: 13px;
    }

    .task-item {
        padding: 10px;
        margin-bottom: 10px;
    }

    .task-item-header {
        margin-bottom: 7px;
    }

    .task-title-row {
        gap: 8px;
    }

    .task-belonging {
        font-size: 15px;
        line-height: 1.35;
    }

    .task-title-meta {
        gap: 6px;
        margin-top: 3px;
    }

    .task-triage-row {
        gap: 5px;
        margin-bottom: 7px;
    }

    .task-kpi-chip,
    .task-chip,
    .status-badge,
    .task-type-badge,
    .task-origin-type-badge,
    .task-source-badge,
    .task-stage-badge {
        min-height: 21px;
        padding: 3px 8px;
        font-size: 10px;
    }

    .task-origin-line {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 6px;
        margin-bottom: 4px;
    }

    .task-origin-label,
    .task-origin-value,
    .task-meta-inline,
    .task-id-small {
        font-size: 10px;
    }

    .task-actions {
        margin-top: 7px;
    }

    .btn-action {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* 响应式梯度 L4：关键操作区改单列友好布局，避免按钮/trace 在手机宽度下炸行。 */
@media (max-width: 520px) {
    .task-priority {
        padding: 1px 7px;
        font-size: 10px;
    }

    .task-priority-dot {
        width: 5px;
        height: 5px;
    }

    .task-belonging {
        font-size: 14px;
    }

    .task-trace-row-subtle {
        gap: 4px;
    }

    .task-trace-chip {
        min-height: 18px;
        padding: 1px 6px;
        font-size: 9px;
    }

    .decision-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .decision-buttons .btn-decision:last-child {
        grid-column: 1 / -1;
    }
}

/* 响应式梯度 L5：手机窄屏最小收口，顶部筛选改 2+1 栅格。 */
@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-group {
        width: 100%;
    }

    .filter-group:last-child {
        grid-column: 1 / -1;
    }
}

/* 自定义弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: white;
    border-radius: 8px;
    padding: 24px;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-body {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn-primary {
    background: #713eff;
    color: white;
}

.modal-btn-primary:hover {
    background: #5a2fd9;
}

.modal-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.modal-btn-secondary:hover {
    background: #e8e8e8;
}

.modal-error {
    color: #ff4d4f;
}

.modal-success {
    color: #52c41a;
}


.task-kpi-chip.wait-urgent {
    color: #ff4d4f !important;
}
.task-kpi-chip.wait-urgent strong {
    color: #ff4d4f;
}

/* ==================== Wave 6: 搜索框 ==================== */
.filter-group-search input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--review-ui-border);
    border-radius: 4px;
    font-size: 12px;
    background: var(--review-ui-bg-panel);
    color: var(--review-ui-text-primary);
    box-sizing: border-box;
}
.filter-group-search input:focus {
    outline: none;
    border-color: var(--review-ui-accent);
    box-shadow: 0 0 0 2px rgba(113, 62, 255, 0.1);
}

/* Wave 6: 决策按钮实心色强化 */
.btn-decision.approve {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}
.btn-decision.approve:hover {
    background: #389e0d;
    border-color: #389e0d;
}
.btn-decision.retry {
    background: #faad14;
    color: #fff;
    border-color: #faad14;
}
.btn-decision.retry:hover {
    background: #d48806;
    border-color: #d48806;
}

/* Wave 2 styles superseded by structured table layout above */

/* ==================== Wave 1: 分镜预览 ==================== */
.storyboard-preview-container {
    padding: 8px 0;
}
.storyboard-shots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}
.storyboard-shot-card {
    background: var(--review-ui-bg-panel, #f9f9f9);
    border: 1px solid var(--review-ui-border, #e8e8e8);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
}
.storyboard-shot-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
}
.shot-num { color: #1890ff; }
.shot-cam { color: #666; background: #f0f0f0; border-radius: 3px; padding: 1px 4px; }
.shot-duration { color: #888; margin-left: auto; }
.shot-action { color: var(--review-ui-text-primary, #222); line-height: 1.5; }
.shot-voiceover { color: #666; font-style: italic; margin-top: 4px; line-height: 1.5; }
.storyboard-fold-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: transparent;
    border: 1px dashed var(--review-ui-border, #d9d9d9);
    border-radius: 6px;
    font-size: 12px;
    color: #1890ff;
    cursor: pointer;
}
.storyboard-fold-btn:hover { background: #f0f5ff; }
.storyboard-shots-hidden { display: none; }

/* Wave 7: 媒体+结构化叠加渲染 — 结构化预览区域在媒体播放器下方 */
.structured-preview-below-media {
    margin-top: 16px;
    border-top: 1px solid var(--review-ui-border, #e0e0e0);
    padding-top: 12px;
}

/* Wave 1: 文本结构化预览 */
.text-preview-container {
    padding: 4px 0;
    width: 100%;            /* v5.4: 撑满预览容器宽度 */
    box-sizing: border-box; /* v5.4: 防 padding 撑出容器 */
}
.text-preview-context-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.text-context-tag {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 8px;
}
.text-preview-body {
    line-height: 1.8;
    font-size: 24px;        /* v5.5: 从 16px 提升 */
    color: var(--review-ui-text-primary, #222);
}
.text-preview-paragraph {
    margin: 0 0 12px;
    padding: 12px 16px;
    background: var(--review-ui-bg-panel, #f9f9f9);
    border-left: 3px solid #d9d9d9;
    border-radius: 0 4px 4px 0;
    font-size: 24px;        /* v5.5: 跟随 .text-preview-body 字号 */
}

/* ==================== Wave 5: JSON 结构化卡片 ==================== */
.json-structured-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: var(--review-ui-bg-panel, #fafafa);
    margin: 0 0 16px;
    overflow: hidden;
    width: 100%;            /* v5.4: 撑满预览容器宽度 */
    box-sizing: border-box; /* v5.5: 盒模型包含 border，宽度精准对齐 */
}
.json-structured-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.json-structured-icon {
    font-size: 18px;
}
.json-structured-title {
    flex: 1;
}
.json-structured-count {
    font-size: 12px;
    opacity: 0.85;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}
.json-structured-body {
    padding: 12px 14px;
    width: 100%;            /* v5.5: 撑满卡片宽度 */
    box-sizing: border-box; /* v5.5: padding 纳入盒模型 */
}
.json-scene-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin: 0 0 10px;
    padding: 10px 12px;
    background: #fff;
    transition: box-shadow 0.2s;
}
.json-scene-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.json-scene-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.json-scene-id {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
}
.json-scene-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}
.json-scene-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.json-scene-tag {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    font-size: 11px;
    padding: 1px 7px;
}
.json-scene-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.json-scene-detail-item {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    font-size: 11px;
    padding: 1px 7px;
}
.json-scene-props {
    margin-bottom: 4px;
    font-size: 12px;
    color: #555;
}
.json-scene-prop {
    display: inline-block;
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
    border-radius: 3px;
    font-size: 11px;
    padding: 1px 6px;
    margin: 2px 3px 2px 0;
}
.json-scene-label {
    font-weight: 600;
    color: #666;
    margin-right: 4px;
}
.json-scene-scale {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}
.json-scene-desc {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
    margin-top: 6px;
    padding: 6px 8px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}
.json-chapter-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin: 0 0 10px;
    padding: 10px 12px;
    background: #fff;
    transition: box-shadow 0.2s;
}
.json-chapter-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.json-chapter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.json-chapter-num {
    font-weight: 700;
    color: #722ed1;
    font-size: 13px;
    background: #f9f0ff;
    padding: 1px 8px;
    border-radius: 4px;
}
.json-chapter-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}
.json-chapter-context-tag {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    font-size: 10px;
    padding: 1px 6px;
    margin-left: auto;
}
.json-chapter-summary {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 6px;
    padding: 6px 8px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #722ed1;
}
.json-chapter-summary-label {
    font-weight: 600;
    color: #722ed1;
}
.json-chapter-raw {
    font-size: 12px;
    color: #666;
    line-height: 1.7;
    padding: 6px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    /* v5.4: 移除 max-height 和 overflow-y，全文展示，由预览窗口统一滚动 */
}
.json-chapter-raw-toggle {
    color: #1890ff;
    cursor: pointer;
    margin-left: 4px;
    font-weight: 600;
}
.json-chapter-raw-toggle:hover {
    text-decoration: underline;
}
.json-chapter-pos {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
}
.json-shot-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin: 0 0 8px;
    padding: 10px 12px;
    background: #fff;
    transition: box-shadow 0.2s;
}
.json-shot-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.json-shot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.json-shot-num {
    font-weight: 700;
    color: #d4380d;
    font-size: 13px;
    background: #fff2e8;
    padding: 1px 8px;
    border-radius: 4px;
}
.json-shot-type-badge {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    font-size: 11px;
    padding: 1px 7px;
}
.json-shot-duration {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}
.json-shot-label {
    font-weight: 600;
    color: #666;
    margin-right: 2px;
}
.json-shot-voiceover {
    font-size: 12px;
    color: #555;
    margin-bottom: 3px;
    padding: 3px 6px;
    background: #fffbe6;
    border-radius: 3px;
}
.json-shot-ae {
    font-size: 12px;
    color: #555;
    margin-bottom: 3px;
}
.json-shot-sfx {
    font-size: 12px;
    color: #555;
    margin-bottom: 3px;
}
.json-shot-chars {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}
.json-shot-char {
    display: inline-block;
    background: #f0f5ff;
    color: #2f54eb;
    border: 1px solid #adc6ff;
    border-radius: 3px;
    font-size: 11px;
    padding: 1px 6px;
    margin: 2px 3px 2px 0;
}
.json-shot-scene-desc {
    font-size: 12px;
    color: #666;
    padding: 6px 14px;
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
}
.json-shot-ninegrid {
    margin-top: 6px;
}
.json-ninegrid-toggle {
    font-size: 12px;
    color: #1890ff;
    cursor: pointer;
    padding: 3px 0;
    user-select: none;
}
.json-ninegrid-toggle:hover {
    text-decoration: underline;
}
.json-ninegrid-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 4px;
}
.json-ninegrid-cell {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    color: #555;
    text-align: center;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.json-generic-field {
    font-size: 13px;
    color: #333;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.6;
}
.json-generic-field:last-child {
    border-bottom: none;
}
.json-generic-key {
    font-weight: 600;
    color: #555;
    margin-right: 6px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 12px;
}
.json-generic-val {
    color: #333;
    word-break: break-word; /* P0修复：长文本自动换行，防止被截断 */
    white-space: pre-wrap; /* 保留换行符并允许自动换行 */
    display: inline-block; /* 让 span 支持换行 */
    max-width: 100%; /* 防止溢出父容器 */
}
.json-generic-arr-inline {
    color: #666;
    font-size: 12px;
}
.json-generic-toggle {
    color: #1890ff;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 0;
    user-select: none;
}
.json-generic-toggle:hover {
    text-decoration: underline;
}
.json-generic-nested {
    padding-left: 16px;
    border-left: 2px solid #e8e8e8;
    margin: 4px 0;
}
.json-generic-obj-item {
    padding: 3px 0;
}

/* ==================== Wave 3: Toast 通知 ==================== */
.review-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: #1f1f1f;
    color: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 8888;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.review-toast.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.review-toast-cancel {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}
.review-toast-cancel:hover {
    background: rgba(255,255,255,0.1);
}

/* ================================================================
   V3 布局 — 总→分→总 (capsule / preview+qc / collab)
   SSOT: docs/review/REVIEW_BOARD_V3_LAYOUT_SSOT.md
   ================================================================ */

/* --- 侧边栏折叠 --- */
.collaboration-container.sidebar-collapsed .task-list-panel {
    display: none;
}

/* 侧边栏收起按钮 — 放在 task-list-header 的标题行右侧 */
.task-list-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.task-list-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--review-ui-text-primary);
    margin-bottom: 0;
}

.sidebar-toggle-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--review-ui-border, #d9d9d9);
    border-radius: 6px;
    background: var(--review-ui-bg-card, #fff);
    color: var(--review-ui-text-secondary, #666);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
    background: var(--review-ui-bg-panel, #fafafa);
    color: var(--review-ui-text-primary, #222);
}

/* workspace-toolbar-row 已移入左侧 header，保留壳子防 JS 引用 */
.workspace-toolbar-row {
    display: none;
}

/* --- V4 Flexbox 吸顶布局（终极方案）--- */
.workspace-v4-flex-layout {
    display: flex;
    flex-direction: column;
    height: 100%;           /* v3.0: 填满 workspace-content，提供确定高度 */
    min-height: 0;
    overflow: hidden;
}

/* 上方吸顶层：胶囊条 + 预览/QC */
.v4-sticky-header-wrapper {
    flex: 1;                /* v3.0: 占满剩余空间（与 collab-area 共享） */
    min-height: 0;          /* v3.0: 允许 flex 收缩，子元素显式 height 生效 */
    display: flex;
    flex-direction: column;
    overflow: hidden;       /* v3.0: 约束子元素不溢出 */
    background: var(--review-ui-bg-page, #f5f7fa);
}

/* 胶囊条行 — V5 起隐藏，功能由 v5-title-bar 替代 */
.v4-capsule-row {
    display: none;
}

/* --- V5 标题行：面包屑 + 内联徽章 + 展开详情 --- */
.v5-title-bar {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    gap: 8px;
    min-height: 40px;
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    background: var(--review-ui-bg-card, #fff);
    position: relative;
    z-index: 15;
}

.v5-breadcrumb-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--review-ui-text-primary, #333);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v5-breadcrumb-sep {
    color: var(--review-ui-text-muted, #999);
    margin: 0 4px;
    font-weight: 400;
}

.v5-inline-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.v5-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--review-ui-bg-panel, #f5f5f5);
    border: 1px solid var(--review-ui-border, #e8e8e8);
    color: var(--review-ui-text-primary, #333);
    white-space: nowrap;
    line-height: 1.5;
}

.v5-detail-toggle {
    background: none;
    border: none;
    color: var(--review-ui-accent, #1890ff);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.v5-detail-toggle:hover {
    background: rgba(24, 144, 255, 0.08);
}

/* 预览 + QC 并排行 — flex 自动分配高度，由 resizer 控制比例 */
.v4-preview-qc-row {
    display: flex;
    gap: 0;
    flex: 1 1 50%;
    min-height: 80px;
    overflow: hidden;       /* v3.0: 约束 preview/qc 面板 */
}

/* 预览区 */
.v4-preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;          /* v5.7: 允许 flex 收缩，决策栏不被推出视口 */
    border-right: 1px solid var(--review-ui-border, #e8e8e8);
    background: var(--review-ui-bg-card, #fff);
}

/* QC 右侧面板 */
.v4-qc-area {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--review-ui-bg-card, #fff);
}

/* 拖拽调节栏 */
.preview-resizer-wrapper {
    flex-shrink: 0;
    height: 8px;
    background: var(--review-ui-border, #e8e8e8);
    cursor: ns-resize;
    position: relative;
    z-index: 15;
}

.preview-resizer {
    height: 4px;
    background: var(--review-ui-accent, #1890ff);
    margin: 2px auto;
    width: 60px;
    border-radius: 2px;
}

.preview-resizer-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -16px;          /* v5.7: 移到 resizer 下方（覆盖上方同属性规则） */
    top: auto;              /* v5.7: 清除第一套规则的 top 冲突 */
    font-size: 11px;
    color: var(--review-ui-text-muted, #999);
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;            /* v5.7: 高于 collab-area，确保文字可见 */
}

/* 下方协作区 — flex 自动分配高度，由 resizer 控制比例 */
.v4-collab-area {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--review-ui-bg-card, #fff);
    min-height: 160px;      /* v3.1: 提升至160px确保决策按钮可见 */
}

/* 保留旧 V3 布局作为后备（兼容性） */
.workspace-v3-layout {
    display: grid;
    grid-template-rows: 48px 1fr auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas:
        "capsule   capsule"
        "preview   qc"
        "resizer   resizer"
        "collab    collab";
    height: 100%;
    gap: 0;
    overflow: visible;
}

/* ① 胶囊条 v2.2 — detail 改为 absolute 浮卡 */
.v3-capsule-area {
    grid-area: capsule;
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    background: var(--review-ui-bg-card, #fff);
    position: relative;
    z-index: 15;
    height: 48px; /* P0修复：固定高度防止grid auto行被撑开导致顶部空白 */
}

.v3-capsule-bar {
    padding: 0;
    position: relative; /* P0修复：为绝对定位的展开详情卡片提供定位上下文 */
}

.v3-capsule-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    flex-wrap: wrap;
    min-height: 36px;
}

.v3-capsule {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--review-ui-bg-panel, #f5f5f5);
    border: 1px solid var(--review-ui-border, #e8e8e8);
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
}

.v3-capsule-label {
    color: var(--review-ui-text-secondary, #999);
    font-size: 11px;
    flex-shrink: 0;
}

.v3-capsule-value {
    color: var(--review-ui-text-primary, #333);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v3-capsule-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--review-ui-accent, #1890ff);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.v3-capsule-toggle:hover {
    background: rgba(24, 144, 255, 0.08);
}

.v3-capsule-detail {
    position: absolute;
    top: 100%;
    right: 14px;
    left: auto;
    width: 380px;
    z-index: 20;
    background: var(--review-ui-bg-card, #fff);
    border-top: 1px solid var(--review-ui-border, #e8e8e8);
    border-bottom: 2px solid var(--review-ui-accent, #1890ff);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    padding: 10px 14px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    display: none;
}

.v3-capsule-detail.expanded {
    display: block;
}

/* ② 内容预览 v2.2 — 决策栏合并入卡片底部，消除双层滚动条 */
.v3-preview-area {
    grid-area: preview;
    overflow: hidden;
    min-height: 200px;
    padding: 12px 12px 12px 14px;
    display: flex;
    flex-direction: column;
}

.v3-preview-area .content-preview-card {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.v3-preview-area .preview-container {
    flex: 1;
    overflow-y: auto;
}

/* 决策栏合并入预览卡片底部 — 永不被遮挡 */
.v3-preview-area .preview-decision-bar {
    flex-shrink: 0;
    border-top: 1px solid var(--review-ui-border, #e8e8e8);
    border-bottom: none;
    margin: 0;
    padding: 10px 14px;
    background: var(--review-ui-bg-card, #fff);
    overflow-y: auto;
    max-height: 140px;
}

/* ③ QC 右侧固定面板 */
.v3-qc-area {
    grid-area: qc;
    border-left: 1px solid var(--review-ui-border, #e8e8e8);
    background: var(--review-ui-bg-card, #fff);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qc-side-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.qc-panel-header {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--review-ui-text-primary, #333);
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    flex-shrink: 0;
    background: var(--review-ui-bg-panel, #fafafa);
}

.qc-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
}

.qc-panel-body .qc-report-shell {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

/* ④ 底部协作面板 */

.v3-collab-area {
    grid-area: collab;
    background: var(--review-ui-bg-card, #fff);
    overflow: hidden; /* v2.3 子格自管溢出，补偿父级 overflow:visible */
}

.collab-bottom-panel {
    display: flex;
    flex-direction: column;
    height: 100%;           /* V06-R2: 继承 grid 分配的 1fr 空间，让 flex 链贯通至输入框吸底 */
}

.collab-panel-header {
    padding: 6px 14px;
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    flex-shrink: 0;
    background: var(--review-ui-bg-panel, #fafafa);
}

.collab-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--review-ui-text-primary, #333);
}

.collab-panel-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    min-height: 0;
}

.collab-panel-body .decision-shell {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 10px 14px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.collab-panel-body .decision-shell-header {
    display: none;
}

/* --- V3 响应式 v2.2 --- */
@media (max-width: 1200px) {
    .workspace-v3-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
        grid-template-areas:
            "capsule"
            "preview"
            "resizer"
            "collab";
    }

    .v3-qc-area {
        position: fixed;
        top: 80px;
        right: 16px;
        width: 300px;
        max-height: calc(100vh - 120px);
        z-index: 100;
        border: 1px solid var(--review-ui-border, #e8e8e8);
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.12);
        background: var(--review-ui-bg-card, #fff);
        display: none;
    }

    .v3-qc-area.qc-float-open {
        display: flex;
    }
}

@media (max-width: 900px) {
    .workspace-v3-layout {
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .v3-preview-area {
        min-height: 300px;
    }
}

@media (max-width: 640px) {
    .v3-capsule-strip {
        gap: 4px;
        padding: 4px 8px;
    }

    .v3-capsule {
        font-size: 11px;
        padding: 1px 6px;
    }
}

/* ========== 预览区下方决策操作栏 v2.2 — 合并入预览卡片 ========== */
.preview-decision-bar {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 20px;
    background: var(--review-ui-bg-card, #fff);
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 140px;
}

.preview-decision-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-decision-buttons .btn-decision {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
    font-size: 13px;
}

.preview-decision-bar .collab-reason-bar {
    border-bottom: none;
    padding: 8px 0 0 0;
    background: transparent;
}

/* ========== 对话式审校协作布局 ========== */
.collab-chat-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

.collab-decision-bar {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    flex-shrink: 0;
}

.collab-decision-bar .btn-decision {
    flex: 1;
    min-width: 0;
}

.collab-reason-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--review-ui-border, #e8e8e8);
    flex-wrap: wrap;
    flex-shrink: 0;
    background: #fafafa;
}

.collab-reason-label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.collab-reason-tag {
    padding: 3px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    color: #595959;
    cursor: pointer;
    transition: all 0.2s;
}

.collab-reason-tag:hover {
    border-color: #722ed1;
    color: #722ed1;
}

.collab-reason-tag.active {
    background: #722ed1;
    border-color: #722ed1;
    color: #fff;
}

.collab-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;          /* v3.0: 允许收缩，防止挤压输入框 */
}

/* 时间线事件气泡 v1.3 */
.collab-timeline-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--review-ui-border, #eee);
    flex-shrink: 0;
}

.collab-timeline-event {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--review-ui-text-secondary, #888);
}

.collab-timeline-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 5px;
    background: var(--review-ui-border, #ddd);
}

.collab-timeline-dot.created { background: #1890ff; }
.collab-timeline-dot.status { background: #faad14; }
.collab-timeline-dot.qc { background: #52c41a; }
.collab-timeline-dot.annotation { background: #722ed1; }

.collab-timeline-body {
    flex: 1;
    min-width: 0;
}

.collab-timeline-time {
    font-size: 10px;
    color: var(--review-ui-text-muted, #bbb);
    white-space: nowrap;
}

.collab-timeline-desc {
    color: var(--review-ui-text-primary, #333);
}

.collab-chat-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    justify-content: center;
    opacity: 0.6;
}

.collab-hint-icon {
    font-size: 20px;
}

.collab-hint-text {
    font-size: 13px;
    color: #8c8c8c;
}

.collab-bubble {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    animation: collabFadeIn 0.2s ease;
}

@keyframes collabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.collab-bubble-user {
    background: #722ed1;
    color: #fff;
    align-self: flex-end;
    border-radius: 10px 10px 2px 10px;
}

.collab-bubble-director {
    background: #f9f0ff;
    color: #531dab;
    align-self: flex-start;
    border-radius: 10px 10px 10px 2px;
}

.collab-bubble-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    align-self: center;
    font-size: 12px;
}

.collab-bubble-avatar {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.collab-bubble-text {
    word-break: break-word;
}

.collab-upload-area {
    padding: 8px 14px;
    border-top: 1px solid var(--review-ui-border, #e8e8e8);
    flex-shrink: 0;
}

.collab-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #595959;
    cursor: pointer;
    padding: 4px 10px;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.collab-upload-label:hover {
    border-color: #722ed1;
    color: #722ed1;
}

.collab-upload-name {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: #722ed1;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.collab-input-row {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--review-ui-border, #e8e8e8);
    flex-shrink: 0;
    background: var(--review-ui-bg-card, #fff);
    z-index: 2;
}

.collab-input-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.collab-input-row input:focus {
    border-color: #722ed1;
}

.collab-input-row input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* v2.3 发送按钮 — 参照智能创编 creative-chat-send-round */
.collab-input-row button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #7b52ff 0%, #6a39f3 100%);
    color: #fff;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(113, 62, 255, 0.22), inset 0 0 0 1px rgba(255,255,255,0.06);
    cursor: pointer;
    padding: 0;
}
.collab-input-row button::before {
    content: "\2191";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}
.collab-input-row button:hover:not(:disabled) {
    background: linear-gradient(135deg, #8b6aff 0%, #7b52ff 100%);
    box-shadow: 0 6px 16px rgba(113, 62, 255, 0.32), inset 0 0 0 1px rgba(255,255,255,0.1);
}
.collab-input-row button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}


/* VoiceIO 语音按钮样式 */
.voiceio-toggle-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #722ed1;
    border-radius: 8px;
    color: #722ed1;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.voiceio-toggle-btn:hover {
    background: rgba(114, 46, 209, 0.08);
}

.voiceio-toggle-btn.active {
    background: #722ed1;
    color: #fff;
}

