/* =========================================================
   Tutorial Studio
   Context Toolbar · Typography
========================================================= */

.stage-toolbar [data-toolbar-panel="element"] {
    min-width: 0;
}

/* 工具栏按钮基础样式 */

.stage-toolbar .element-context-action {
    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    height: 32px;

    padding: 0 9px;

    border: 1px solid transparent;
    border-radius: 7px;

    background: transparent;

    color: #344054;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 12px;
    font-weight: 500;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        box-shadow 140ms ease;
}

.stage-toolbar .element-context-action:hover {
    background: #f1f5f9;

    border-color: #e2e8f0;

    color: #0f172a;
}

.stage-toolbar .element-context-action:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* 当前启用状态 */

.stage-toolbar .element-context-action.is-active {
    background: #eaf2ff;

    border-color: #c7dcff;

    color: #175cd3;

    box-shadow:
        inset 0 0 0 1px rgba(23, 92, 211, 0.03);
}

/* 字体名称 */

.stage-toolbar .element-context-action.is-font-family {
    justify-content: flex-start;

    width: 142px;
    max-width: 180px;

    overflow: hidden;
    text-overflow: ellipsis;

    border-color: #e4e7ec;
    background: #ffffff;

    font-size: 12px;
    font-weight: 500;
}

.stage-toolbar .element-context-action.is-font-family::after {
    content: "⌄";

    margin-left: auto;
    padding-left: 8px;

    color: #667085;

    flex-shrink: 0;
}

/* 字号 */

.stage-toolbar .element-context-action.is-font-size {
    min-width: 72px;

    justify-content: space-between;

    border-color: #e4e7ec;
    background: #ffffff;

    font-variant-numeric: tabular-nums;
}

.stage-toolbar .element-context-action.is-font-size::after {
    content: "⌄";

    margin-left: 8px;

    color: #667085;
}

/* B / I / U / S */

.stage-toolbar .element-context-action.is-emphasis {
    min-width: 32px;

    padding: 0 8px;

    font-size: 14px;
}

.stage-toolbar .element-context-action[data-context-action="bold"] {
    font-weight: 800;
}

.stage-toolbar .element-context-action[data-context-action="italic"] {
    font-style: italic;
    font-weight: 600;
}

.stage-toolbar .element-context-action[data-context-action="underline"] {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.stage-toolbar .element-context-action[data-context-action="strikethrough"] {
    text-decoration: line-through;
}

/* 文字颜色 */

.stage-toolbar .element-context-action.is-text-color {
    position: relative;

    min-width: 48px;

    padding-bottom: 5px;
}

.stage-toolbar .element-context-action.is-text-color::after {
    content: "";

    position: absolute;

    left: 8px;
    right: 8px;
    bottom: 3px;

    height: 3px;

    border-radius: 999px;

    background: var(--text-color-preview, #000000);
}

/* 对齐按钮 */

.stage-toolbar .element-context-action[data-context-action="text-align"] {
    min-width: 38px;

    font-size: 15px;
}

/* 危险操作 */

.stage-toolbar .element-context-action.is-danger {
    color: #d92d20;
}

.stage-toolbar .element-context-action.is-danger:hover {
    background: #fef3f2;

    border-color: #fecdca;

    color: #b42318;
}

/* 窄屏 */

@media (max-width: 680px) {

    .stage-toolbar .element-context-action.is-font-family {
        width: 108px;
        max-width: 120px;
    }

    .stage-toolbar .element-context-action.is-font-size {
        min-width: 65px;
    }

    .stage-toolbar .element-context-action {
        padding-left: 7px;
        padding-right: 7px;
    }
}