
/* =========================================================
   Tutorial Studio
   Inspector · 属性检查器
   简洁、轻量、与侧边工具栏统一
   ========================================================= */

:root {
    --inspector-bg: #f8f9fc;
    --inspector-surface: #ffffff;
    --inspector-line: #e7eaf0;
    --inspector-text: #344054;
    --inspector-muted: #7c8798;
    --inspector-primary: #5368e8;
    --inspector-primary-soft: #eef1ff;
}

/* =========================================================
   属性检查器主体
   ========================================================= */

.inspector {
    display: flex;
    flex-direction: column;
    gap: 0;

    min-width: 0;
    min-height: 0;
    padding: 0;

    overflow-x: hidden;
    overflow-y: auto;

    color: var(--inspector-text);
    background: var(--inspector-bg);

    border: 0;
    border-radius: 0;
    box-shadow: none;

    scrollbar-width: thin;
    scrollbar-color: #cbd3e0 transparent;
}

/* =========================================================
   标题区域
   ========================================================= */

.inspector-head {
    flex: 0 0 auto;

    margin: 0;
    padding: 18px 16px 15px;

    background: transparent;

    border: 0;
    border-bottom: 1px solid var(--inspector-line);
    border-radius: 0;

    box-shadow: none;
}

.eyebrow {
    color: #8490a4;

    font-size: 10px;
    font-weight: 750;
    line-height: 1.5;
    letter-spacing: 1.3px;
}

.inspector h2 {
    margin: 5px 0 0;

    color: #202b3c;

    font-size: 16px;
    font-weight: 750;
    line-height: 1.5;
}

/* =========================================================
   属性分区
   不再使用独立白色卡片
   ========================================================= */

.inspector-section {
    min-width: 0;
    flex: 0 0 auto;

    margin: 0;
    padding: 16px;

    background: transparent;

    border: 0;
    border-bottom: 1px solid var(--inspector-line);
    border-radius: 0;

    box-shadow: none;
}

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

    margin: 0 0 12px;

    color: #344054;

    font-size: 12px;
    font-weight: 750;
    line-height: 1.5;
}

.section-title span {
    color: #98a2b3;

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

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

.field-label {
    display: block;

    margin: 13px 0 6px;

    color: #596579;

    font-size: 12px;
    font-weight: 600;
    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 #dce2eb;
    border-radius: 6px;

    outline: none;

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

    box-sizing: border-box;

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

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

.input:focus,
.code-editor:focus {
    border-color: var(--inspector-primary);
    box-shadow: 0 0 0 2px rgba(83, 104, 232, 0.12);
}

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

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

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

/* =========================================================
   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 #dce2eb;
    border-radius: 6px;

    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 {
    color: #4054cb;
    background: #f0f3ff;
    border-color: #c5cdf9;
}

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

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

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

    margin-top: 0;
    padding: 3px;

    background: #eef1f6;

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

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

    padding: 8px 6px;

    color: #667085;
    background: transparent;

    border: 0;
    border-radius: 4px;

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

    cursor: pointer;

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

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

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

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

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

.code-editor-wrap {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 0;

    margin-top: 9px;

    overflow: hidden;

    background: #101827;

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

    box-shadow: none;
}

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

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

    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: 5px;

    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;
    box-sizing: border-box;

    color: #e5edf9;
    background: #101827;

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

    font-family:
        var(
            --ts-code-font-family,
            Consolas,
            "SFMono-Regular",
            "Cascadia Code",
            "Liberation Mono",
            monospace
        );

    font-size: var(--ts-code-font-size, 12px);
    line-height: var(--ts-code-line-height, 1.7);
    tab-size: var(--ts-code-tab-size, 4);

    white-space: var(--ts-code-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: 38px;

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

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

    border: 0;
    border-radius: 6px;

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

    cursor: pointer;

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

.apply-btn:hover {
    background: #4358d5;
    box-shadow: 0 2px 5px rgba(67, 88, 213, 0.18);
}

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

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

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

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

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

    color: #c43248;
    background: transparent;

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

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

    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: 12px;

    color: #667085;
    background: #f0f3fa;

    border: 0;
    border-left: 3px solid #c5cdf9;
    border-radius: 0;

    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: 36px;
    padding: 3px;

    background: #ffffff;

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

    cursor: pointer;
}

.range-input {
    width: 100%;
    min-width: 0;
    accent-color: var(--inspector-primary);
}

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

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

    color: #475467;
    background: #eef1f6;

    border: 0;
    border-radius: 4px;

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

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

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

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

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

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

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

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

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

    .inspector-section {
        padding: 12px;
    }

    .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;
    }
}


/* =========================================================
   Element Inspector Pro
   ========================================================= */

.element-inspector-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.element-type-badge {
    flex: 0 0 auto;

    max-width: 150px;
    padding: 4px 8px;
    overflow: hidden;

    border: 1px solid #dbe5f2;
    border-radius: 999px;

    background: #f3f7fd;
    color: #46617f;

    font-size: 9px;
    font-weight: 750;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.element-summary {
    padding: 14px 16px 13px;

    border-bottom: 1px solid var(--inspector-line);

    background: #fbfcfe;
}

.element-summary-title {
    overflow: hidden;

    color: #1d3049;

    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.element-summary-meta {
    margin-top: 4px;

    color: #8a98aa;

    font-size: 10px;
    line-height: 1.5;
}

.element-inspector-section {
    padding: 12px 16px 20px;
}

.inspector-empty {
    padding: 34px 12px 26px;

    color: #8b98aa;

    text-align: center;
}

.inspector-empty-icon {
    margin-bottom: 8px;

    color: #b8c5d6;

    font-size: 28px;
}

.inspector-empty strong {
    display: block;

    color: #4c5d73;

    font-size: 12px;
}

.inspector-empty p {
    margin: 6px 0 0;

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

.inspect-group {
    margin: 0 0 6px;
    padding: 0;

    border: 1px solid #e6ecf5;
    border-radius: 9px;

    background: #ffffff;
}

.inspect-group > summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;

    padding: 10px 12px;

    color: #344054;

    font-size: 11.5px;
    font-weight: 750;

    cursor: pointer;
    list-style: none;
}

.inspect-group > summary::-webkit-details-marker {
    display: none;
}

.inspect-group > summary::after {
    content: "⌄";

    margin-left: auto;

    color: #9aa7b8;

    font-size: 11px;
}

.inspect-group[open] > summary::after {
    content: "⌃";
}

.inspect-group > summary small {
    color: #a2adbd;

    font-size: 8px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.inspect-group-body {
    padding: 2px 12px 12px;

    border-top: 1px solid #f0f3f8;
}

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

    margin-top: 9px;
}

.inspect-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inspect-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inspect-field {
    display: block;
    min-width: 0;
}

.inspect-field > span {
    display: block;

    margin-bottom: 4px;

    color: #7d8b9e;

    font-size: 9px;
    font-weight: 650;
}

.inspect-field .input {
    min-height: 32px;
    height: 32px;
    padding: 5px 7px;

    border-color: #dfe7f1;
    border-radius: 6px;

    font-size: 11px;
}

select.inspect-field,
select.input {
    cursor: pointer;
}

.inspect-unit {
    position: relative;
}

.inspect-unit .input {
    width: 100%;
    padding-right: 24px;
}

.inspect-unit em {
    position: absolute;
    top: 50%;
    right: 8px;

    transform: translateY(-50%);

    color: #a0acbb;

    font-size: 9px;
    font-style: normal;
    pointer-events: none;
}

.inspect-color-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.inspect-color {
    flex: 0 0 32px;

    width: 32px;
    height: 32px;

    padding: 2px;

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

    background: #fff;
    cursor: pointer;
}

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

.inspect-range-row {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 32px;
}

.inspect-range {
    flex: 1;
    min-width: 0;

    accent-color: #4f6df5;
}

.inspect-range-row output {
    min-width: 38px;

    color: #5a6a7f;

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

.inspect-subhead {
    margin-top: 12px;

    color: #8e9caf;

    font-size: 9px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.inspect-primary {
    width: 100%;
    min-height: 33px;

    margin-top: 11px;
    padding: 7px 10px;

    border: 1px solid #3f5be0;
    border-radius: 6px;

    background: #4f6df5;
    color: #fff;

    font: inherit;
    font-size: 11px;
    font-weight: 750;

    cursor: pointer;
}

.inspect-primary:hover {
    background: #3f5be0;
}

.inspect-actions {
    margin-top: 14px;
    padding-top: 12px;

    border-top: 1px solid #e8eef6;
}

.inspect-danger {
    width: 100%;
    min-height: 32px;

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

    background: #fff8f9;
    color: #b84a5b;

    font: inherit;
    font-size: 10.5px;
    font-weight: 700;

    cursor: pointer;
}

.inspect-danger:hover {
    border-color: #e7b5be;
    background: #fff1f3;
}

#inspectorControls[hidden],
#inspectorEmpty[hidden] {
    display: none !important;
}

@media (max-width: 480px) {
    .inspect-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inspect-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   页面信息编辑器
   与左右栏标题保持同一高度和字号
========================================================= */

.right-dock .page-view {
    padding: 0;
    gap: 0;
}

.right-dock .page-editor-head {
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    flex: 0 0 48px;
    width: 100%;
    height: 48px;
    min-height: 48px;

    padding: 0 16px;

    background: #ffffff;
    border-bottom: 1px solid var(--inspector-line);
}

.page-editor-heading {
    min-width: 0;
}



.right-dock .page-editor-head h2 {
    margin: 0;

    color: #202532;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.page-editor-status {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: #7b8798;

    font-size: 10px;
    line-height: 1.4;
    white-space: nowrap;
}

.page-editor-status::before {
    content: "";

    width: 5px;
    height: 5px;

    border-radius: 50%;
    background: #22a06b;
}

.page-editor-body {
    display: flex;
    flex-direction: column;
    gap: 13px;

    padding: 15px 16px 18px;
}

.page-editor-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-editor-label {
    display: flex;
    align-items: baseline;
    gap: 5px;

    color: #596579;

    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

.page-editor-label small {
    color: #a0aaba;

    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0;
}

.page-editor-body .input {
    min-height: 36px;

    font-size: 12px;
}

.page-editor-body textarea.input {
    min-height: 76px;

    resize: vertical;
}

.page-editor-duration {
    display: flex;
    align-items: stretch;

    min-width: 0;
}

.page-editor-duration .input {
    flex: 1 1 auto;
    min-width: 0;

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

.page-editor-duration-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    border: 1px solid #dce2eb;
    border-left: 0;
    border-radius: 0 6px 6px 0;

    background: #f8fafc;
    color: #7b8798;

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

.page-editor-hint {
    margin: 0;

    color: #98a2b3;

    font-size: 10.5px;
    line-height: 1.6;
}

/* 右侧所有面板标题统一为 48px / 13px */
.right-dock .inspector-head,
.right-dock .ai-panel-head {
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    flex: 0 0 48px;
    width: 100%;
    height: 48px;
    min-height: 48px;

    margin: 0;
    padding: 0 16px;

    background: #ffffff;
    border-bottom: 1px solid var(--inspector-line);
}

.right-dock .inspector-head h2,
.right-dock .ai-panel-head h3 {
    margin: 0;

    color: #202532;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.right-dock .inspector-head .eyebrow {
    display: none;
}

.right-dock .element-inspector-head {
    gap: 8px;
}

/* 元素属性 / 代码编辑的标题与页面信息保持全宽对齐 */
.right-dock .element-view > .inspector-head,
.right-dock .code-view > .inspector-head {
    margin: -16px -16px 0;
    width: calc(100% + 32px);
}

/* 未选中元素时只保留一个空状态，避免两遍提示 */
.right-dock .element-view:has(#inspectorEmpty:not([hidden])) .element-summary {
    display: none;
}
