    .menu-item {
        position: relative;
        cursor: pointer;
        display: flex;
        align-items: center;
    }

    .menu-item:hover {
        background-color: #e0e0e0;
    }

    .menu-label {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .menu-label .icon {
        margin-right: 10px;
        font-size: 1.2em;
    }

    .table-menu .table-selector-container {
        display: none;
        position: absolute;
        left: 100%;
        top: 0;
        background-color: #fff;
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        padding: 10px;
        z-index: 10;
    }

    .table-selector {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .table-grid {
        display: grid;
        gap: 2px;
        margin-bottom: 10px;
        overflow: hidden;
        transition: all 0.2s ease-out;
        /* Added pointer-events: all; to ensure clicks are caught everywhere within the grid element */
        /* Even if it's not on a direct child grid-cell */
        pointer-events: all;
        min-width: 200px;
        /* Ensure it has a base size */
        min-height: 200px;
        /* Ensure it has a base size */
    }

    .table-size-display {
        font-size: 0.9em;
        color: #555;
        margin-top: 5px;
    }

    /* 添加边框工具栏样式 */
    .border-toolbar {
        display: inline-block;
        margin-left: 15px;
        position: relative;
    }

    .border-button {
        background-color: #f0f0f0;
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 5px 10px;
        cursor: pointer;
    }

    .border-button:hover {
        background-color: #e0e0e0;
    }

    .border-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: white;
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        display: none;
        width: 238px;
    }

    .border-options {
        display: grid;
        grid-template-columns: repeat(3, 0fr);
        gap: 8px;
    }

    .border-option,
    .border-style {
        width: 50px;
        height: 50px;
        border: 1px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        background-color: white;
        border-radius: 4px;
    }

    .border-option:hover,
    .border-style:hover,
    .border-style.active {
        background-color: #f0f0f0;
    }

    .line-width {
        position: absolute;
        right: 5px;
        top: 67px;
        border: hidden;
    }

    .border-color {
        position: absolute;
        top: 10px;
        right: 5px;
        border: hidden;
    }

    #stagebox {
        position: absolute;
        z-index: 9999;
        display: none;
    }

    .menu-toolbar {
        display: flex;
        flex-direction: column;
        width: 210px;
        background-color: #fff;
        border: 1px solid #ccc;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        padding: 10px;
    }

    .menu-option {
        display: flex;
        align-items: center;
        padding: 8px;
        cursor: pointer;
        border: none;
        background: none;
        font-size: 14px;
        color: #333;
    }

    .menu-option:hover {
        background-color: #f0f0f0;
    }

    .menu-option i {
        margin-right: 8px;
    }

    .grid-cell {
        width: 20px;
        height: 20px;
        background-color: #f0f0f0;
        border: 1px solid #ccc;
        box-sizing: border-box;
        /* pointer-events: none; so mouseover on grid-cell itself doesn't interfere with grid event */
        /* The parent table-grid will handle mouse events */
        pointer-events: none;
    }

    .grid-cell.highlighted {
        background-color: #a0c4ff;
    }