/* ---------- 工作台与竖向标签 ---------- */

.工作台 {
    display: flex;
    align-items: stretch;
    min-height: 600px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--卡片色);
    border: 1px solid var(--卡片描边);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.标签栏 {
    flex: none;
    width: 127px;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid var(--卡片描边);
    background: rgba(255, 255, 255, 0.02);
}

/* ---------- 侧边栏拖拽调宽 ---------- */

.拖拽条 {
    flex: none;
    width: 8px;
    margin-left: -4px;
    margin-right: -4px;
    position: relative;
    z-index: 5;
    cursor: col-resize;
    touch-action: none;
}

.拖拽条::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3px;
    width: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.15s ease;
}

.拖拽条:hover::before,
.拖拽条.拖拽中::before {
    background: var(--主色);
}

body.正在拖拽 {
    cursor: col-resize;
    user-select: none;
}

.标签项 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--次要文字);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.标签项:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--文字);
}

.标签项.激活 {
    background: rgba(76, 141, 255, 0.14);
    border-color: rgba(76, 141, 255, 0.40);
    color: var(--文字);
}

.标签项.激活::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--主色浅);
}

.标签序号 {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--主色浅);
}

.标签文字 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.标签提示 {
    font-size: 11px;
    color: #5d6f88;
}

.标签项.激活 .标签提示 {
    color: var(--主色浅);
}

.标签栏脚注 {
    margin-top: auto;
    padding: 10px 6px 2px;
    color: #5d6f88;
    font-size: 11px;
    line-height: 1.6;
    border-top: 1px dashed #243044;
}

.标签内容 {
    flex: 1;
    min-width: 0;
    padding: 16px 20px 20px;
}

.面板 {
    display: none;
}

.面板.显示 {
    display: block;
}

/* ---------- Excel 数据表格 ---------- */

.工具栏 {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.工具栏 .文件信息 {
    margin-top: 0;
}

.表格区 {
    margin-top: 20px;
    border: 1px solid var(--卡片描边);
    border-radius: 14px;
    overflow: hidden;
    background: var(--代码底);
    display: none;
}

.表格区.显示 {
    display: block;
}

.工作表块 + .工作表块 {
    border-top: 1px solid var(--卡片描边);
}

.工作表标题 {
    padding: 10px 16px;
    background: rgba(76, 141, 255, 0.07);
    color: var(--主色浅);
    font-size: 12.5px;
    font-weight: 600;
}

.表格滚动 {
    max-height: 64vh;
    overflow: auto;
}

.数据表 {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
    white-space: nowrap;
}

.数据表 th,
.数据表 td {
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
    border-right: 1px solid #1c2637;
    border-bottom: 1px solid #1c2637;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.数据表 thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #16202f;
    color: #cfe0f7;
    font-weight: 600;
    font-size: 12px;
}

.数据表 .行号列 {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #121a27;
    color: #6f819b;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.数据表 thead th.行号列 {
    z-index: 3;
}

.数据表 tbody tr:hover td {
    background: rgba(76, 141, 255, 0.06);
}

.数据表 tbody tr:hover .行号列 {
    background: #142033;
}

.数据表 tbody tr.原始表头 td {
    background: rgba(255, 255, 255, 0.035);
    color: var(--文字);
    font-weight: 600;
}

.数据表 tbody tr.原始表头 .行号列 {
    background: #152033;
    font-weight: 400;
}

.空工作表 {
    padding: 22px 16px;
}

/* ---------- 窄屏：标签改为横向 ---------- */

@media (max-width: 860px) {
    .工作台 {
        flex-direction: column;
    }

    .标签栏 {
        width: auto;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--卡片描边);
    }

    .拖拽条 {
        display: none;
    }

    .标签栏脚注 {
        display: none;
    }

    .标签项 {
        min-width: 150px;
    }

    .标签项.激活::before {
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 0;
        width: auto;
        height: 3px;
        border-radius: 3px 3px 0 0;
    }
}
