/*
 * Grindme实验室：三栏工作台
 * 资料 / 成果正文 / 对话
 * 依赖 index-theme-*.css 的 --xq-* 变量
 */

/* ===== 外壳 ===== */
.lab-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--xq-bg);
}

.lab-toolbar {
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--xq-line);
}

.lab-toolbar-left,
.lab-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.lab-toolbar-back {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 7px;
    color: var(--xq-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.lab-toolbar-back:hover {
    background: var(--xq-blue-soft);
    color: var(--xq-blue);
}

.lab-toolbar-brand {
    font-family: var(--xq-font-serif);
    font-weight: 700;
    font-size: 15px;
    color: var(--xq-navy);
    letter-spacing: .02em;
    white-space: nowrap;
}

.lab-toolbar-lab {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--xq-text);
}

.lab-toolbar-sep {
    width: 1px;
    height: 16px;
    background: var(--xq-line);
}

.lab-toolbar-session {
    font-size: 13px;
    color: var(--xq-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.lab-save-state {
    font-size: 12px;
    color: var(--xq-muted);
    min-width: 48px;
    text-align: right;
}

.lab-tb-btn {
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-text);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}

.lab-tb-btn:hover:not(:disabled) {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
}

.lab-tb-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.lab-tb-btn-primary {
    background: var(--xq-navy);
    border-color: var(--xq-navy);
    color: #fff;
}

.lab-tb-btn-primary:hover:not(:disabled) {
    background: var(--xq-navy-2);
    border-color: var(--xq-navy-2);
    color: #fff;
}

.lab-body {
    flex: 1 1 auto;
    min-height: 0;
}

.lab-body > #content-container {
    height: 100%;
}

#content-container.lab-mode {
    position: relative;
}

/* ===== 左栏：资料 ===== */
.lab-materials input[type="file"] {
    display: none !important;
}

.lab-materials {
    width: 240px;
    flex: 0 0 240px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--xq-line);
}

.lab-col-head {
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border-bottom: 1px solid var(--xq-line);
}

.lab-col-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--xq-text);
}

.lab-col-count {
    font-size: 12px;
    color: var(--xq-muted);
    flex: 1;
}

.lab-upload-mini {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--xq-navy), var(--xq-blue));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(20, 30, 50, .18);
    transition: transform .2s ease, box-shadow .2s ease;
}

.lab-upload-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(20, 30, 50, .24);
}

.lab-manage-btn {
    height: 26px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--xq-muted);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.lab-manage-btn:hover {
    color: var(--xq-blue);
    background: var(--xq-blue-soft);
}

.lab-manage-btn[hidden] {
    display: none;
}

.lab-materials.is-managing .lab-upload-mini {
    display: none;
}

.lab-upload-mini.is-disabled {
    opacity: .35;
    pointer-events: none;
}

.lab-file-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

.lab-file-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 8px;
    border-radius: 9px;
    cursor: pointer;
    transition: background .15s;
}

.lab-file-item:hover {
    background: var(--xq-blue-soft);
}

.lab-file-item.is-active {
    background: var(--xq-blue-soft);
}

.lab-file-item.is-selected {
    background: var(--xq-blue-soft);
}

.lab-file-check {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 9px 0 0;
    accent-color: var(--xq-blue);
    pointer-events: none;
}

.lab-materials.is-managing .lab-file-item:not(.is-template) .lab-file-ico {
    display: none;
}

.lab-materials.is-managing .lab-file-item.is-template {
    opacity: .6;
    cursor: default;
}

.lab-materials.is-managing .lab-file-item.is-template:hover {
    background: transparent;
}

.lab-batch-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--xq-line);
    background: #fff;
}

.lab-batch-bar[hidden] {
    display: none;
}

.lab-batch-count {
    font-size: 12px;
    color: var(--xq-text);
    white-space: nowrap;
}

.lab-batch-delete {
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: #C0392B;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.lab-batch-delete:hover:not(:disabled) {
    background: #A93226;
}

.lab-batch-delete:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.lab-file-ico {
    flex: 0 0 auto;
    width: 26px;
    height: 30px;
    border: 1px solid var(--xq-line);
    border-radius: 5px;
    background: #fff;
    color: var(--xq-blue);
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.lab-file-main {
    flex: 1;
    min-width: 0;
}

.lab-file-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--xq-text);
    word-break: break-all;
}

.lab-file-size {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--xq-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lab-file-ico.is-paper {
    color: var(--xq-green);
    background: var(--xq-green-soft);
    border-color: transparent;
    font-size: 10px;
}

.lab-file-ico.is-template {
    color: var(--xq-blue);
    background: var(--xq-blue-soft);
    border-color: transparent;
    font-size: 9.5px;
}

.lab-file-item.is-template {
    background: linear-gradient(90deg, var(--xq-blue-soft), transparent 70%);
    border: 1px solid var(--xq-line);
}

.lab-file-item.is-template:hover {
    border-color: var(--xq-blue);
}

.lab-file-del {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--xq-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
}

.lab-file-item:hover .lab-file-del {
    opacity: 1;
}

.lab-file-del:hover {
    background: rgba(0, 0, 0, .06);
    color: #c0392b;
}

.lab-file-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    text-align: center;
}

.lab-file-empty.is-hidden {
    display: none;
}

.lab-file-empty p {
    margin: 0;
    font-size: 12.5px;
    color: var(--xq-text);
    line-height: 1.6;
}

.lab-file-empty span {
    font-size: 11px;
    color: var(--xq-muted);
}

.lab-file-empty-btn {
    height: 30px;
    padding: 0 14px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-text);
    font-size: 12px;
    cursor: pointer;
}

.lab-file-empty-btn:hover {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
}

.lab-file-tip {
    flex: 0 0 auto;
    padding: 9px 14px;
    border-top: 1px solid var(--xq-line);
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--xq-muted);
}

/* 空状态：先两栏（资料 + 对话），开始会话后再出现正文栏 */
.lab-mode:not(.lab-has-conversation) .lab-doc {
    display: none;
}

.lab-mode:not(.lab-has-conversation) .lab-chat {
    flex: 1 1 auto;
    width: auto;
    border-left: 0;
    border-right: 0;
}

/* ===== 中栏：成果正文 ===== */
.lab-doc {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-secondary, #F7F9FC);
}

.lab-doc-head {
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid var(--xq-line);
}

.lab-doc-title {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--xq-font-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--xq-navy);
    padding: 4px 0;
}

.lab-doc-title::placeholder {
    color: var(--xq-muted);
    font-weight: 400;
}

.lab-doc-meta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--xq-muted);
}

.lab-doc-dot {
    opacity: .5;
}

.lab-doc-btn {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 14px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-text);
    font-size: 12.5px;
    cursor: pointer;
}

.lab-doc-btn:hover {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
}

.lab-doc-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lab-doc-icon:hover {
    color: var(--xq-blue);
    border-color: var(--xq-blue);
}

/* 正文栏收起：对话栏自动铺满右侧 */
.lab-mode.lab-doc-collapsed .lab-doc {
    display: none;
}

.lab-mode.lab-doc-collapsed .lab-chat {
    flex: 1 1 auto;
    width: auto;
    border-right: 0;
}

.lab-doc-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 26px 30px 60px;
}

.lab-doc-paper {
    display: none;
    max-width: 760px;
    margin: 0 auto;
    padding: 44px 52px;
    background: #fff;
    border: 1px solid var(--xq-line);
    border-radius: 12px;
    box-shadow: var(--xq-shadow);
    min-height: 60vh;
}

.lab-doc.has-content .lab-doc-paper {
    display: block;
}

.lab-doc.has-content .lab-doc-empty {
    display: none;
}

.lab-doc-paper.markdown-body {
    font-family: var(--xq-font-sans);
    font-size: 14.5px;
    line-height: 1.85;
    color: var(--xq-text);
}

.lab-doc-paper h1,
.lab-doc-paper h2,
.lab-doc-paper h3 {
    font-family: var(--xq-font-serif);
    color: var(--xq-navy);
}

.lab-doc-paper h1 {
    font-size: 26px;
}

.lab-doc-paper h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--xq-line);
    padding-bottom: 6px;
}

.lab-doc-paper h3 {
    font-size: 16px;
}

.lab-doc-editor {
    display: none;
    width: 100%;
    max-width: 760px;
    min-height: 60vh;
    margin: 0 auto;
    padding: 44px 52px;
    border: 1px solid var(--xq-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--xq-shadow);
    color: var(--xq-text);
    font-family: var(--xq-font-sans);
    font-size: 14.5px;
    line-height: 1.85;
    resize: vertical;
    outline: none;
}

.lab-doc.is-editing .lab-doc-editor {
    display: block;
}

.lab-doc.is-editing .lab-doc-paper,
.lab-doc.is-editing .lab-doc-empty {
    display: none;
}

.lab-doc-empty {
    max-width: 560px;
    margin: 8vh auto 0;
    text-align: center;
    color: var(--xq-muted);
}

.lab-doc-empty-ico {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--xq-blue-soft);
    color: var(--xq-blue);
    font-size: 24px;
    line-height: 52px;
}

.lab-doc-empty h3 {
    margin: 0 0 8px;
    font-family: var(--xq-font-serif);
    font-size: 18px;
    color: var(--xq-navy);
}

.lab-doc-empty p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
}

.lab-doc-templates {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.lab-doc-templates button {
    height: 30px;
    padding: 0 14px;
    border: 1px solid var(--xq-line);
    border-radius: 999px;
    background: #fff;
    color: var(--xq-text);
    font-size: 12px;
    cursor: pointer;
}

.lab-doc-templates button:hover {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
    background: var(--xq-blue-soft);
}

/* ===== 右栏：对话 ===== */
.lab-chat {
    width: 380px;
    flex: 0 0 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
    border-left: 0;
    border-right: 1px solid var(--xq-line);
}

.lab-mode.lab-chat-collapsed .lab-chat {
    display: none;
}

.lab-chat-head {
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 12px;
    border-bottom: 1px solid var(--xq-line);
    background: #fff;
}

.lab-chat-history {
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-text);
    font-size: 12.5px;
    cursor: pointer;
}

.lab-chat-history:hover {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
}

.lab-chat-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--xq-text);
    text-align: center;
}

.lab-chat-icon {
    width: 30px;
    height: 30px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lab-chat-icon:hover {
    color: var(--xq-blue);
    border-color: var(--xq-blue);
}

.lab-chat .xreview-main {
    flex: 1 1 auto;
    min-height: 0;
    background: var(--xq-bg);
}

.lab-chat .xreview-sidebar {
    position: absolute;
    left: 10px;
    top: 58px;
    width: 280px;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 70px);
    z-index: 40;
    overflow: hidden;
    border: 1px solid var(--xq-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(20, 30, 50, .16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease;
}

.lab-mode.lab-sidebar-open .lab-chat .xreview-sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.lab-chat .xreview-sidebar-list {
    min-height: 0;
}

/* 靠近底部时向上弹出，避免被列表裁切 */
.lab-chat .item-dropdown.drop-up {
    top: auto;
    bottom: calc(100% + 4px);
}

.lab-chat-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 35;
    background: transparent;
}

.lab-mode.lab-sidebar-open .lab-chat-overlay {
    display: block;
}

/* 对话区内部收紧一点，给三栏留空间 */
.lab-chat .xreview-empty {
    padding: 28px 18px;
}

.lab-chat .xreview-empty .xq-hero-title {
    font-size: 24px;
}

.lab-chat .xreview-empty .xq-hero-sub {
    font-size: 13px;
}

.lab-chat .xreview-empty .xq-askbox {
    margin-top: 18px;
    padding: 8px 8px 8px 12px;
    border-radius: 12px;
}

.lab-chat .xreview-messages {
    padding: 18px 16px 8px;
}

.lab-chat .xreview-input-bar {
    padding: 8px 12px 12px;
}

/* 空状态快捷任务 */
.lab-quick {
    width: 100%;
    max-width: 760px;
    margin: 30px auto 0;
    text-align: left;
}

.lab-quick-title {
    font-size: 12px;
    color: var(--xq-muted);
    margin-bottom: 10px;
}

.lab-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.lab-quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 16px 16px 14px;
    border: 1px solid var(--xq-line);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}

.lab-quick-card:hover:not(:disabled) {
    border-color: var(--xq-blue);
    box-shadow: var(--xq-shadow);
    transform: translateY(-1px);
}

.lab-quick-card.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.lab-quick-ico {
    color: var(--xq-blue);
    font-size: 16px;
    line-height: 1;
}

.lab-quick-name {
    font-family: var(--xq-font-serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--xq-navy);
}

.lab-quick-desc {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--xq-muted);
}

/* 对话框上方的快捷任务条 */
.lab-task-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.lab-task-bar button {
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--xq-line);
    border-radius: 999px;
    background: #fff;
    color: var(--xq-muted);
    font-size: 11.5px;
    cursor: pointer;
}

.lab-task-bar button:hover:not(:disabled) {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
    background: var(--xq-blue-soft);
}

.lab-task-bar button.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* 助手消息下的「写入正文」 */
.lab-msg-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.lab-write-btn {
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--xq-line);
    border-radius: 7px;
    background: #fff;
    color: var(--xq-text);
    font-size: 11.5px;
    cursor: pointer;
}

.lab-write-btn:hover {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
    background: var(--xq-blue-soft);
}

/* 轻提示 */
.lab-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(8px);
    padding: 9px 16px;
    border-radius: 10px;
    background: rgba(24, 34, 48, .9);
    color: #fff;
    font-size: 12.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 9999;
}

.lab-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 自适应 ===== */
@media (max-width: 1380px) {
    .lab-materials {
        width: 220px;
        flex-basis: 220px;
    }

    .lab-chat {
        width: 340px;
        flex-basis: 340px;
    }

    .lab-doc-paper,
    .lab-doc-editor {
        padding: 34px 36px;
    }
}

@media (max-width: 1100px) {
    .lab-materials {
        width: 200px;
        flex-basis: 200px;
    }

    .lab-chat {
        width: 320px;
        flex-basis: 320px;
    }

    .lab-toolbar-session {
        max-width: 160px;
    }
}

@media (max-width: 820px) {
    .lab-mode:not(.lab-has-conversation) .lab-chat {
        position: static;
        transform: none;
        width: auto;
    }

    .lab-chat {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        flex-basis: auto;
        z-index: 50;
        transform: translateX(101%);
        transition: transform .22s ease;
    }

    .lab-mode.lab-chat-open .lab-chat {
        transform: none;
    }

    .lab-toolbar-actions .lab-tb-btn {
        padding: 0 8px;
    }
}

/* ===== 检索文献：加入资料 ===== */
.choice-select-all {
    padding: 6px 4px;
    font-size: 12.5px;
    color: var(--xq-blue);
    background: transparent;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.choice-select-all:hover {
    text-decoration: underline;
}

.choice-add {
    padding: 6px 14px;
    font-size: 0.875rem;
    color: var(--xq-navy);
    background: #fff;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .18s, color .18s;
}

.choice-add:hover:not(:disabled) {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
}

.choice-add:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.choice-added {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    color: var(--xq-green);
    background: var(--xq-green-soft);
    border-radius: 999px;
    white-space: nowrap;
}

.choice-item.is-added .choice-item-title {
    color: var(--xq-muted);
}

/* 狭长对话栏里让勾选列表底部按钮不换行挤压 */
.lab-chat .choice-footer {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lab-chat .choice-count {
    margin-right: auto;
}

.lab-chat .choice-add,
.lab-chat .choice-submit {
    white-space: nowrap;
    flex-shrink: 0;
}


/* ===== 研究室总览 ===== */
.lab-ov {
    max-width: 1180px;
    margin: 0 auto;
    padding: 6px 0 48px;
}

.lab-ov-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.lab-ov-title {
    margin: 0;
    font-family: var(--xq-font-serif);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--xq-navy);
}

.lab-ov-sub {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--xq-muted);
}

.lab-ov-create {
    height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: var(--xq-navy);
    color: #fff;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(20, 30, 50, .16);
    transition: background .18s, transform .18s, box-shadow .18s;
}

.lab-ov-create:hover {
    background: var(--xq-navy-2);
    transform: translateY(-1px);
    box-shadow: 0 9px 20px rgba(20, 30, 50, .22);
}

.lab-ov-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.lab-ov-search {
    flex: 1;
    max-width: 320px;
}

.lab-ov-search input {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: var(--xq-text);
    outline: none;
    transition: border-color .18s;
}

.lab-ov-search input:focus {
    border-color: var(--xq-blue);
}

.lab-ov-sort {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: var(--xq-text);
    outline: none;
    cursor: pointer;
}

.lab-ov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.lab-ov-item {
    position: relative;
    min-width: 0;
}

.lab-ov-card {
    position: relative;
    display: block;
    height: 152px;
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(20, 30, 50, .08);
    transition: transform .22s ease, box-shadow .22s ease;
}

.lab-ov-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(20, 30, 50, .18);
}

.lab-ov-cover {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    transform: scale(1.01);
    transition: transform .4s ease;
}

.lab-ov-card:hover .lab-ov-cover {
    transform: scale(1.045);
}

.lab-ov-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 82% 16%, rgba(255, 255, 255, .22), transparent 44%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .055) 0 1px, transparent 1px 26px);
}

.lab-ov-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(9, 16, 32, .9) 0%, rgba(9, 16, 32, .42) 48%, rgba(9, 16, 32, .06) 100%);
}

.lab-cover-navy { --c1: #16233D; --c2: #3C5A8C; }
.lab-cover-indigo { --c1: #232B5C; --c2: #4B5FA8; }
.lab-cover-teal { --c1: #123B3F; --c2: #2F7A78; }
.lab-cover-plum { --c1: #3A213F; --c2: #7A4569; }
.lab-cover-slate { --c1: #232B33; --c2: #5A6B78; }

.lab-ov-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--xq-blue);
    font-size: 12px;
    line-height: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    white-space: nowrap;
}

.lab-ov-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 14px 18px 15px;
}

.lab-ov-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--xq-font-serif);
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
}

.lab-ov-desc {
    margin-top: 3px;
    overflow: hidden;
    font-size: 12px;
    line-height: 17px;
    color: rgba(255, 255, 255, .72);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lab-ov-meta {
    margin-top: 6px;
    overflow: hidden;
    font-size: 12px;
    color: rgba(255, 255, 255, .8);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lab-ov-more {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 16px;
    line-height: 26px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, background .15s;
}

.lab-ov-item:hover .lab-ov-more,
.lab-ov-more:focus {
    opacity: 1;
}

.lab-ov-more:hover {
    background: rgba(255, 255, 255, .32);
}

.lab-ov-menu {
    position: absolute;
    top: 40px;
    left: 10px;
    z-index: 6;
    display: none;
    min-width: 112px;
    padding: 5px;
    border: 1px solid var(--xq-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(20, 30, 50, .18);
}

.lab-ov-menu.is-open {
    display: block;
}

.lab-ov-menu button {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--xq-text);
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}

.lab-ov-menu button:hover {
    background: var(--xq-blue-soft);
    color: var(--xq-blue);
}

.lab-ov-menu button[data-action="delete"] {
    color: #C0392B;
}

.lab-ov-menu button[data-action="delete"]:hover {
    background: #FDF0EE;
    color: #C0392B;
}

.lab-ov-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 152px;
    padding: 0;
    border: 1px dashed var(--xq-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .45);
    color: var(--xq-muted);
    cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}

.lab-ov-new:hover {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
    background: var(--xq-blue-soft);
}

.lab-ov-new-plus {
    width: 34px;
    height: 34px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
}

.lab-ov-new-title {
    font-size: 14px;
    font-weight: 600;
}

.lab-ov-new-sub {
    font-size: 11.5px;
    opacity: .75;
}

.lab-ov-guest {
    max-width: 520px;
    margin: 8vh auto 0;
    padding: 32px 28px;
    border: 1px solid var(--xq-line);
    border-radius: 14px;
    background: #fff;
    text-align: center;
    box-shadow: var(--xq-shadow);
}

.lab-ov-guest h2 {
    margin: 0 0 10px;
    font-family: var(--xq-font-serif);
    font-size: 20px;
    color: var(--xq-navy);
}

.lab-ov-guest p {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--xq-muted);
}

.lab-ov-guest a {
    display: inline-block;
    height: 36px;
    padding: 0 20px;
    border-radius: 9px;
    background: var(--xq-navy);
    color: #fff;
    font-size: 13px;
    line-height: 36px;
    text-decoration: none;
}

.lab-ov-modal[hidden] {
    display: none;
}

.lab-ov-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lab-ov-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 38, .42);
    backdrop-filter: blur(2px);
}

.lab-ov-dialog {
    position: relative;
    width: min(92vw, 440px);
    padding: 22px 22px 18px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 38, .28);
}

.lab-ov-dialog h3 {
    margin: 0 0 18px;
    font-family: var(--xq-font-serif);
    font-size: 18px;
    color: var(--xq-navy);
}

.lab-ov-field {
    display: block;
    margin-bottom: 14px;
}

.lab-ov-field span {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    color: var(--xq-muted);
}

.lab-ov-field input,
.lab-ov-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: var(--xq-text);
    outline: none;
    resize: vertical;
}

.lab-ov-field input:focus,
.lab-ov-field textarea:focus {
    border-color: var(--xq-blue);
}

.lab-ov-colors {
    display: flex;
    gap: 10px;
    margin: 2px 0 18px;
}

.lab-ov-color {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    cursor: pointer;
    transition: transform .15s, border-color .15s;
}

.lab-ov-color:hover {
    transform: translateY(-1px);
}

.lab-ov-color.is-active {
    border-color: var(--xq-navy);
    box-shadow: 0 0 0 2px #fff inset;
}

.lab-ov-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.lab-ov-dialog-actions button {
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-text);
    font-size: 13px;
    cursor: pointer;
}

.lab-ov-dialog-actions button:hover {
    border-color: var(--xq-blue);
    color: var(--xq-blue);
}

.lab-ov-dialog-actions .is-primary {
    border-color: var(--xq-navy);
    background: var(--xq-navy);
    color: #fff;
}

.lab-ov-dialog-actions .is-primary:hover {
    border-color: var(--xq-navy-2);
    background: var(--xq-navy-2);
    color: #fff;
}

.lab-ov-dialog-actions .is-danger {
    border-color: #C0392B;
    background: #C0392B;
    color: #fff;
}

.lab-ov-dialog-actions .is-danger:hover {
    border-color: #A93226;
    background: #A93226;
    color: #fff;
}

.lab-ov-dialog-tip {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--xq-muted);
}

.lab-ov-dialog-tip strong {
    color: var(--xq-text);
}

@media (hover: none) {
    .lab-ov-more {
        opacity: 1;
    }
}

@media (max-width: 720px) {
    .lab-ov-title {
        font-size: 23px;
    }

    .lab-ov-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .lab-ov-card,
    .lab-ov-new {
        height: 140px;
    }

    .lab-ov-search {
        max-width: none;
    }

    .lab-toolbar-lab {
        max-width: 120px;
    }
}


/* ===== 研究室任务总览 ===== */
.lab-tasks {
    max-width: 1120px;
    margin: 0 auto;
    padding: 6px 0 56px;
}

.lab-tasks-head {
    margin-bottom: 34px;
}

.lab-tasks-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--xq-muted);
    text-decoration: none;
}

.lab-tasks-back:hover {
    color: var(--xq-blue);
}

.lab-tasks-kicker {
    margin-top: 18px;
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--xq-muted);
}

.lab-tasks-title {
    margin: 6px 0 8px;
    font-family: var(--xq-font-serif);
    font-size: 26px;
    color: var(--xq-navy);
}

.lab-tasks-sub {
    margin: 0;
    font-size: 13px;
    color: var(--xq-muted);
}

.lab-flow {
    --flow-line: #C3CFE0;
    max-width: 1020px;
    margin: 0 auto;
}

.lab-flow-row {
    display: flex;
    justify-content: center;
}

.lab-flow-card {
    position: relative;
    display: block;
    width: 232px;
    min-height: 108px;
    padding: 14px 16px 15px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: linear-gradient(140deg, #1B2640, #33476B);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(20, 30, 50, .18);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.lab-flow-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 84% 10%, rgba(255, 255, 255, .18), transparent 46%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 24px);
}

.lab-flow-card > * {
    position: relative;
    z-index: 1;
}

.lab-flow-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .36);
    box-shadow: 0 16px 34px rgba(20, 30, 50, .28);
}

.lab-flow-card.is-start {
    border-color: rgba(160, 190, 240, .35);
    background: linear-gradient(140deg, #16233D, #3C5A8C);
}

.lab-flow-card.is-parallel {
    background: linear-gradient(140deg, #1D2742, #35486B);
}

.lab-flow-card.is-merge {
    border-color: rgba(220, 190, 150, .3);
    background: linear-gradient(140deg, #2E2438, #5A3F63);
}

.lab-flow-card.is-end {
    border-color: rgba(160, 220, 200, .25);
    background: linear-gradient(140deg, #1C3234, #2F5A58);
}

.lab-flow-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.lab-flow-no {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lab-flow-tag {
    height: 20px;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 18px;
    color: rgba(255, 255, 255, .78);
    background: rgba(255, 255, 255, .08);
}

.lab-flow-card.is-start .lab-flow-tag {
    color: #DCE8FF;
    border-color: rgba(180, 210, 255, .42);
    background: rgba(120, 170, 255, .18);
}

.lab-flow-card h3 {
    margin: 0 0 5px;
    font-family: var(--xq-font-serif);
    font-size: 15px;
    line-height: 22px;
    color: #fff;
}

.lab-flow-card p {
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    color: rgba(255, 255, 255, .72);
}

.lab-flow-trunk {
    position: relative;
    height: 30px;
}

.lab-flow-trunk::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--flow-line);
}

.lab-flow-trunk::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--flow-line);
}

.lab-flow-trunk.short {
    height: 24px;
}

.lab-flow-parallel {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.lab-flow-parallel::before,
.lab-flow-parallel::after {
    content: '';
    position: absolute;
    left: calc(12.5% - 7px);
    right: calc(12.5% - 7px);
    height: 1px;
    background: var(--flow-line);
}

.lab-flow-parallel::before {
    top: 0;
}

.lab-flow-parallel::after {
    bottom: 0;
}

.lab-flow-cell {
    position: relative;
    padding: 28px 0;
}

.lab-flow-cell .lab-flow-card {
    width: auto;
}

.lab-flow-stem {
    position: absolute;
    left: 50%;
    width: 1px;
    background: var(--flow-line);
}

.lab-flow-stem.top {
    top: 0;
    height: 28px;
}

.lab-flow-stem.top::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--flow-line);
}

.lab-flow-stem.bottom {
    bottom: 0;
    height: 28px;
}

.lab-tb-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 900px) {
    .lab-flow-parallel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin: 8px 0;
    }

    .lab-flow-parallel::before,
    .lab-flow-parallel::after,
    .lab-flow-stem {
        display: none;
    }

    .lab-flow-cell {
        padding: 0;
    }

    .lab-flow-card {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .lab-flow-parallel {
        grid-template-columns: 1fr;
    }

    .lab-tasks-title {
        font-size: 22px;
    }
}

/* ===== RTF 表格卡片 ===== */

.lab-file-extract {
    flex: 0 0 auto;
    height: 20px;
    padding: 0 6px;
    border: 1px solid var(--xq-line);
    border-radius: 5px;
    background: #fff;
    color: var(--xq-blue);
    font-size: 10.5px;
    line-height: 18px;
    cursor: pointer;
}

.lab-file-extract:hover {
    border-color: var(--xq-blue);
    background: var(--xq-blue-soft);
}

.lab-table-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    width: 30%;
    min-width: 220px;
    max-width: 300px;
    min-height: 66px;
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: linear-gradient(140deg, #1B2640, #33476B);
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(20, 30, 50, .16);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.lab-table-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 86% 8%, rgba(255, 255, 255, .16), transparent 44%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 24px);
}

.lab-table-card > * {
    position: relative;
    z-index: 1;
}

.lab-table-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .34);
    box-shadow: 0 16px 34px rgba(20, 30, 50, .26);
}

/* 相邻卡片按可用宽度自动分栏：正文宽度够时一行 2–4 张，窄时自动 1 张 */
.lab-table-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    align-items: stretch;
    margin: 12px 0;
}

.lab-table-cards > .lab-table-card {
    width: auto;
    min-width: 0;
    max-width: none;
    height: 100%;
    margin: 0;
}

.lab-table-card.is-missing {
    padding: 14px;
    border: 1px dashed var(--xq-line);
    background: #F7F9FC;
    color: var(--xq-muted);
    text-align: center;
    font-size: 12.5px;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.lab-table-card-head {
    display: block;
    margin: 0 0 4px;
}

.lab-table-card-tag {
    display: inline-block;
    height: 18px;
    padding: 0 7px;
    border: 1px solid #E6EEFF;
    border-radius: 999px;
    background: #E6EEFF;
    color: #1B2640;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: .04em;
}

.lab-table-card-actions {
    position: absolute;
    top: 9px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lab-table-card-edit {
    font-size: 10.5px;
    color: rgba(255, 255, 255, .56);
}

.lab-table-card-del {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, .5);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}

.lab-table-card:hover .lab-table-card-del {
    opacity: 1;
}

.lab-table-card-del:hover {
    background: rgba(255, 255, 255, .14);
    color: #FFD7D2;
}

.lab-table-card-title {
    margin: 0;
    padding-right: 42px;
    font-family: var(--xq-font-serif);
    font-size: 14.5px;
    line-height: 1.45;
    color: #fff;
}

/* 覆盖 .lab-doc-paper h3 的深色标题，深色卡片内必须用浅色 */
.lab-doc-paper .lab-table-card-title {
    margin: 0;
    padding-right: 42px;
    font-family: var(--xq-font-serif);
    font-size: 14.5px;
    line-height: 1.45;
    color: #fff;
}

.lab-table-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.lab-table-card-chip {
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .76);
    font-size: 10px;
    line-height: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lab-table-card-note {
    margin: 7px 0 0;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, .16);
    font-size: 10px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .56);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 抽取弹窗 ===== */

.lab-extract-modal[hidden],
.lab-te-modal[hidden] {
    display: none;
}

.lab-extract-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lab-extract-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .46);
}

.lab-extract-dialog {
    position: relative;
    width: min(780px, 92vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 18px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
}

.lab-extract-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.lab-extract-head h3 {
    margin: 0;
    font-family: var(--xq-font-serif);
    font-size: 18px;
    color: var(--xq-navy);
}

.lab-extract-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--xq-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.lab-extract-close:hover {
    background: rgba(0, 0, 0, .06);
}

.lab-extract-tip {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--xq-muted);
}

.lab-extract-tip.is-warn {
    padding: 8px 10px;
    border: 1px solid #F0C36D;
    border-radius: 8px;
    background: #FFF8E6;
    color: #8A5A00;
}

.lab-extract-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.lab-extract-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--xq-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.lab-extract-item:hover {
    border-color: var(--xq-blue);
}

.lab-extract-item.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    background: #F7F9FC;
}

.lab-extract-check {
    margin-top: 2px;
}

.lab-extract-item-body {
    flex: 1;
    min-width: 0;
}

.lab-extract-item-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.lab-extract-item-head strong {
    font-size: 13px;
    color: var(--xq-text);
}

.lab-extract-dim {
    font-size: 11px;
    color: var(--xq-muted);
}

.lab-extract-warn {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: #A93226;
}

.lab-extract-preview {
    margin-top: 8px;
    overflow-x: auto;
    border: 1px solid var(--xq-line);
    border-radius: 6px;
}

.lab-extract-preview table {
    border-collapse: collapse;
    font-size: 10.5px;
    white-space: nowrap;
}

.lab-extract-preview td {
    padding: 3px 8px;
    border-bottom: 1px solid #EEF2F7;
    color: var(--xq-text);
}

.lab-extract-preview tr:last-child td {
    border-bottom: 0;
}

.lab-extract-confirm {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: #8A5A00;
}

.lab-extract-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--xq-line);
}

.lab-extract-actions button,
.lab-te-actions button,
.lab-te-grid-tools button,
.lab-te-dialog-actions button {
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-text);
    font-size: 12.5px;
    cursor: pointer;
}

.lab-extract-actions button.is-primary,
.lab-te-actions button.is-primary,
.lab-te-dialog-actions button.is-primary {
    border-color: var(--xq-blue);
    background: var(--xq-blue);
    color: #fff;
}

.lab-extract-actions button:disabled,
.lab-te-actions button:disabled,
.lab-te-dialog-actions button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.lab-te-actions button.is-danger {
    border-color: #E7B8B2;
    color: #A93226;
}

/* ===== 表格编辑页 ===== */

.lab-table-editor {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 24px 80px;
}

.lab-te-card,
.lab-te-grid-wrap {
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid var(--xq-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--xq-shadow);
}

.lab-te-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--xq-muted);
}

.lab-te-field.is-full {
    width: 100%;
}

.lab-te-field input,
.lab-te-field textarea,
.lab-te-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--xq-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.lab-te-field input:focus,
.lab-te-field textarea:focus,
.lab-te-field select:focus {
    border-color: var(--xq-blue);
}

.lab-te-field textarea {
    resize: vertical;
    line-height: 1.6;
}

.lab-te-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.lab-te-grid-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.lab-te-grid-head h2 {
    margin: 0;
    font-family: var(--xq-font-serif);
    font-size: 17px;
    color: var(--xq-navy);
}

.lab-te-grid-tools {
    display: inline-flex;
    gap: 8px;
}

.lab-te-grid-scroll {
    overflow: auto;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
}

.lab-te-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 680px;
    font-size: 12px;
}

.lab-te-grid th,
.lab-te-grid td {
    padding: 5px;
    border-right: 1px solid #EEF2F7;
    border-bottom: 1px solid #EEF2F7;
    vertical-align: top;
}

.lab-te-grid th:last-child,
.lab-te-grid td:last-child {
    border-right: 0;
}

.lab-te-grid tbody tr:last-child th,
.lab-te-grid tbody tr:last-child td {
    border-bottom: 0;
}

.lab-te-grid thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #F7F9FC;
}

.lab-te-grid .te-corner,
.lab-te-grid .te-row-head {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 150px;
    background: #F7F9FC;
    text-align: left;
    font-weight: 400;
    color: var(--xq-muted);
}

.lab-te-grid thead .te-corner {
    z-index: 3;
}

.lab-te-grid .te-dep-row th {
    top: 42px;
    background: #FBFCFE;
    font-size: 11px;
    color: var(--xq-muted);
}

.lab-te-grid input {
    width: 100%;
    min-width: 84px;
    padding: 5px 7px;
    border: 1px solid #E3E9F2;
    border-radius: 5px;
    background: #fff;
    color: var(--xq-text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
}

.lab-te-grid input:focus {
    border-color: var(--xq-blue);
    background: #FBFDFF;
}

.lab-te-grid .te-col-box,
.lab-te-grid .te-row-box {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lab-te-grid .te-col-del,
.lab-te-grid .te-row-del {
    flex: 0 0 auto;
    width: 20px;
    height: 26px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--xq-muted);
    font-size: 14px;
    cursor: pointer;
}

.lab-te-grid .te-col-del:hover,
.lab-te-grid .te-row-del:hover {
    background: #FBEAE7;
    color: #A93226;
}

.lab-te-grid .te-cell-pair {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lab-te-grid .te-se {
    font-size: 11px;
    color: var(--xq-muted);
}

.lab-te-grid .te-row-label {
    font-weight: 600;
}

.lab-te-grid tr.is-stat .te-row-label {
    color: var(--xq-navy);
}

.lab-te-hint {
    margin: 10px 0 0;
    font-size: 11.5px;
    color: var(--xq-muted);
}

.lab-te-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.lab-te-back {
    margin-left: auto;
    font-size: 12.5px;
    color: var(--xq-muted);
    text-decoration: none;
}

.lab-te-back:hover {
    color: var(--xq-blue);
}

/* 重新抽取弹窗 */
.lab-te-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lab-te-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .46);
}

.lab-te-dialog {
    position: relative;
    width: min(680px, 92vw);
    max-height: 84vh;
    overflow-y: auto;
    padding: 20px 22px 18px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
}

.lab-te-dialog h3 {
    margin: 0 0 4px;
    font-family: var(--xq-font-serif);
    font-size: 18px;
    color: var(--xq-navy);
}

.lab-te-dialog-tip {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--xq-muted);
}

.lab-te-pick {
    margin-top: 12px;
}

.lab-te-pick-tip {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--xq-muted);
}

.lab-te-pick-tip.is-warn {
    color: #8A5A00;
}

.lab-te-pick-item {
    display: flex;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--xq-line);
    border-radius: 8px;
    cursor: pointer;
}

.lab-te-pick-item.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.lab-te-pick-item > div {
    flex: 1;
    min-width: 0;
}

.lab-te-pick-item strong {
    display: block;
    font-size: 12.5px;
    color: var(--xq-text);
}

.lab-te-pick-dim {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--xq-muted);
}

.lab-te-pick-warn {
    margin: 4px 0 0;
    font-size: 11px;
    color: #A93226;
}

.lab-te-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--xq-line);
}

.lab-te-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    z-index: 4000;
    transform: translate(-50%, 10px);
    padding: 9px 16px;
    border-radius: 8px;
    background: rgba(20, 30, 50, .9);
    color: #fff;
    font-size: 12.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.lab-te-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 860px) {
    .lab-te-meta {
        grid-template-columns: 1fr;
    }

    .lab-table-editor {
        padding: 22px 14px 60px;
    }
}

@media (max-width: 560px) {
    .lab-table-cards {
        grid-template-columns: 1fr;
    }
}
