/* =========================================================
   Tutorial Studio
   Inspector · 属性检查器
   ========================================================= */

.inspector {
    min-width: 0;
    min-height: 0;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 14px;

    background: #f5f7fb;
    border-left: 1px solid #dce2ec;
}

/* =========================================================
   属性检查器标题
   ========================================================= */

.inspector-head {
    padding: 15px;
    margin: 0;

    background: #ffffff;
    border: 1px solid #dfe5ef;
    border-radius: 12px;

    box-shadow:
        0 2px 5px rgba(25, 42, 70, 0.025);
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #7c8ba5;
    font-weight: 800;
    line-height: 1.5;
}

.inspector h2 {
    font-size: 17px;
    line-height: 1.4;
    margin: 5px 0 0;
    color: #1d2939;
    font-weight: 750;
}

/* =========================================================
   普通表单
   ========================================================= */

.field-label {
    display: block;

    margin: 13px 0 6px;

    color: #475467;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.5;
}

.input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 36px;

    padding: 8px 10px;

    color: #253247;
    background: #ffffff;

    border: 1px solid #d7deea;
    border-radius: 8px;

    outline: none;

    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.input:hover {
    border-color: #b9c5d8;
}

.input:focus,
.code-editor:focus {
    border-color: #6577e8;
    box-shadow: 0 0 0 3px rgba(101, 119, 232, 0.13);
}

.input:disabled {
    background: #f2f4f7;
    color: #98a2b3;
    cursor: not-allowed;
}

.textarea {
    resize: vertical;
    min-height: 80px;
}

.textarea.small {
    min-height: 58px;
}

/* =========================================================
   属性分组
   ========================================================= */

.inspector-section {
    min-width: 0;

    margin: 0;
    padding: 15px;

    background: #ffffff;

    border: 1px solid #dfe5ef;
    border-radius: 12px;

    box-shadow:
        0 2px 5px rgba(25, 42, 70, 0.025);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    margin: 0 0 12px;

    color: #344054;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.section-title span {
    color: #98a2b3;
    font-size: 10px;
    font-weight: 500;
}

/* =========================================================
   CSS 选择器
   ========================================================= */

.selector-row {
    display: flex;
    align-items: center;
    gap: 7px;

    min-width: 0;
}

.selector-row .input {
    flex: 1;
    min-width: 0;
}

/* =========================================================
   位置与尺寸
   ========================================================= */

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

    margin-top: 10px;
}

.geometry-grid label {
    display: block;
    min-width: 0;

    color: #667085;
    font-size: 11px;
    font-weight: 600;
}

.geometry-grid .input {
    margin-top: 5px;
    padding: 8px;

    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   通用次级按钮
   ========================================================= */

.subtle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    width: 100%;
    min-height: 36px;

    margin-top: 9px;
    padding: 8px 10px;

    color: #475467;
    background: #ffffff;

    border: 1px solid #d9e0eb;
    border-radius: 8px;

    font-family: inherit;
    font-size: 11px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.subtle-btn:hover {
    background: #f5f7ff;
    border-color: #bdc7fa;
    color: #4f60d9;
}

.subtle-btn:active {
    transform: translateY(1px);
}

/* =========================================================
   HTML / CSS / JS 代码标签
   ========================================================= */

.code-tabs {
    display: flex;
    align-items: center;
    gap: 4px;

    margin-top: 0;
    padding: 4px;

    background: #eef1f6;
    border: 1px solid #dfe5ef;
    border-radius: 9px;
}

.code-tab {
    flex: 1;
    min-width: 0;

    padding: 9px 8px;

    color: #667085;
    background: transparent;

    border: 0;
    border-radius: 6px;
    border-bottom: 0;

    font-family: inherit;
    font-size: 12px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.code-tab:hover {
    color: #344054;
    background: rgba(255, 255, 255, 0.7);
}

.code-tab.active {
    color: #4054cb;
    background: #ffffff;

    font-weight: 800;

    box-shadow:
        0 1px 3px rgba(16, 24, 40, 0.08);
}

/* =========================================================
   代码编辑器容器
   ========================================================= */

.code-editor-wrap {
    min-width: 0;

    margin-top: 9px;

    overflow: hidden;

    background: #101827;

    border: 1px solid #263247;
    border-radius: 10px;

    box-shadow:
        0 3px 10px rgba(16, 24, 40, 0.08);
}

/* 代码编辑器工具栏 */

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    min-height: 36px;
    padding: 0 11px;

    color: #667085;
    background: #f2f4f7;

    border-bottom: 1px solid #dfe4ec;

    font-size: 10px;
}

/* 工具栏小按钮 */

.mini-btn {
    padding: 5px 9px;

    color: #475467;
    background: #ffffff;

    border: 1px solid #dfe4ec;
    border-radius: 6px;

    font-family: inherit;
    font-size: 10px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.mini-btn:hover {
    background: #f8f9fc;
    border-color: #bfc9da;
}

/* =========================================================
   代码输入区域
   ========================================================= */

.code-editor {
    display: block;

    width: 100%;
    min-width: 0;
    height: 280px;
    min-height: 180px;

    padding: 14px;

    resize: vertical;

    color: #e5edf9;
    background: #101827;

    border: 0;
    border-radius: 0;
    outline: none;

    font-family:
        Consolas,
        "SFMono-Regular",
        "Cascadia Code",
        "Liberation Mono",
        monospace;

    font-size: 12px;
    line-height: 1.7;
    tab-size: 4;

    white-space: pre;
    overflow: auto;

    caret-color: #a5b4fc;
}

.code-editor:focus {
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.6);
}

/* =========================================================
   应用代码按钮
   ========================================================= */

.apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 40px;

    margin-top: 10px;
    padding: 10px 12px;

    color: #ffffff;
    background: var(--primary, #5368e8);

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

    font-family: inherit;
    font-size: 12px;
    font-weight: 750;

    cursor: pointer;

    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.apply-btn:hover {
    background: #4358d5;

    box-shadow:
        0 3px 8px rgba(67, 88, 213, 0.2);
}

.apply-btn:active {
    transform: translateY(1px);
}

/* =========================================================
   删除元素按钮
   ========================================================= */

.delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 38px;

    margin-top: 9px;
    padding: 9px 12px;

    color: #c43248;
    background: #fff7f8;

    border: 1px solid #f0cbd2;
    border-radius: 8px;

    font-family: inherit;
    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.delete-btn:hover {
    background: #fff0f2;
    border-color: #e8aab5;
}

/* =========================================================
   提示信息
   ========================================================= */

.hint-box {
    margin: 0;
    padding: 13px;

    color: #667085;
    background: #f8faff;

    border: 1px solid #dce5fa;
    border-radius: 10px;

    font-size: 11px;
    line-height: 1.75;
}

.hint-box strong {
    display: block;

    margin-bottom: 4px;

    color: #344563;
    font-size: 12px;
    font-weight: 750;
}

.hint-box p {
    margin: 0;
}

/* =========================================================
   后续属性编辑功能的通用样式
   用于旋转、字体、颜色、边框等控件
   ========================================================= */

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

.property-field {
    min-width: 0;
}

.property-field .field-label {
    margin-top: 0;
}

.property-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-row>* {
    min-width: 0;
}

.color-input {
    width: 100%;
    height: 38px;
    padding: 4px;

    background: #ffffff;

    border: 1px solid #d7deea;
    border-radius: 8px;

    cursor: pointer;
}

.range-input {
    width: 100%;
    min-width: 0;
    accent-color: #5368e8;
}

.value-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 42px;
    padding: 4px 7px;

    color: #475467;
    background: #f2f4f7;

    border: 1px solid #e4e7ec;
    border-radius: 6px;

    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   滚动条
   ========================================================= */

.inspector {
    scrollbar-width: thin;
    scrollbar-color: #cbd3e0 transparent;
}

.inspector::-webkit-scrollbar,
.code-editor::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.inspector::-webkit-scrollbar-thumb {
    background: #cbd3e0;
    border-radius: 10px;
}

.inspector::-webkit-scrollbar-thumb:hover {
    background: #aab6c8;
}

.code-editor::-webkit-scrollbar-thumb {
    background: #39465b;
    border-radius: 10px;
}

.code-editor::-webkit-scrollbar-track {
    background: #101827;
}

/* =========================================================
   小屏幕
   ========================================================= */

@media (max-width: 900px) {
    .inspector {
        padding: 12px;
        gap: 12px;

        border-left: 0;
    }

    .inspector-head,
    .inspector-section {
        padding: 13px;
    }

    .code-editor {
        height: 240px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {

    .geometry-grid,
    .property-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .input {
        min-height: 38px;
        font-size: 13px;
    }

    .field-label {
        font-size: 12px;
    }

    .code-tab {
        padding: 10px 6px;
        font-size: 12px;
    }
}