/* rig-3d · 3D 模型骨骼绑定与动画 —— 专有样式 */
#app {
    --rg-bg: #f7f9fb;
    --rg-card: #ffffff;
    --rg-line: #e6eaf0;
    --rg-txt: #22282f;
    --rg-txt2: #5b6472;
    --rg-txt3: #98a0ae;
    --rg-acc: #2f6fed;
    --rg-acc-soft: #eaf1ff;
    --rg-ok: #12a150;
    --rg-warn: #ff7a1a;
}

/* ---------- 布局 ---------- */
#app .rg-wrap { display: grid; grid-template-columns: 236px minmax(0, 1fr) 296px; gap: 14px; }
#app .rg-view {
    position: relative; height: 520px; border: 1px solid var(--rg-line); border-radius: 12px;
    overflow: hidden; background: linear-gradient(180deg, #eef2f6 0%, #f7f9fb 100%);
}
#app .rg-view.drag { outline: 2px dashed var(--rg-acc); outline-offset: -6px; }
#app .rg-view canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }

#app .rg-badge {
    position: absolute; left: 12px; top: 12px; z-index: 3;
    background: rgba(255, 255, 255, .92); border: 1px solid var(--rg-line);
    border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--rg-txt2);
    box-shadow: 0 1px 4px rgba(20, 30, 50, .06);
}
#app .rg-viewhint {
    position: absolute; right: 12px; top: 12px; z-index: 3; display: flex; gap: 6px; flex-wrap: wrap;
    justify-content: flex-end; max-width: 60%;
}
#app .rg-viewhint .mini {
    background: rgba(255, 255, 255, .92); border: 1px solid var(--rg-line);
    border-radius: 8px; padding: 5px 9px; font-size: 12px; color: var(--rg-txt2); cursor: pointer;
}
#app .rg-viewhint .mini:hover { border-color: var(--rg-acc); color: var(--rg-acc); }

#app .rg-hintbar {
    margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--rg-txt2);
    background: var(--rg-acc-soft); border: 1px solid #d3e2ff; border-radius: 9px; padding: 8px 12px;
}
#app .rg-hintbar b { color: var(--rg-acc); }

/* ---------- 面板 ---------- */
#app .rg-panel {
    border: 1px solid var(--rg-line); border-radius: 12px; background: var(--rg-card);
    display: flex; flex-direction: column; overflow: hidden;
}
#app .rg-ph {
    padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--rg-txt);
    border-bottom: 1px solid var(--rg-line); background: #fbfcfe;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
#app .rg-ph .cnt { font-weight: 400; font-size: 12px; color: var(--rg-txt3); }
#app .rg-pb { padding: 10px; overflow: auto; }

#app .rg-tree { max-height: 300px; overflow: auto; }
#app .rg-node {
    display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px;
    font-size: 12.5px; color: var(--rg-txt2); cursor: pointer; white-space: nowrap;
}
#app .rg-node:hover { background: #f1f5fa; }
#app .rg-node.sel { background: var(--rg-acc-soft); color: var(--rg-acc); font-weight: 600; }
#app .rg-node .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rg-acc); flex: none; }
#app .rg-node .key { color: var(--rg-warn); font-size: 10px; }
#app .rg-node .wtag {
    margin-left: auto; font-size: 10px; background: var(--rg-ok); color: #fff;
    border-radius: 4px; padding: 1px 5px;
}
#app .rg-empty { font-size: 12.5px; line-height: 1.85; color: var(--rg-txt3); padding: 6px 4px; }
#app .rg-empty b { color: var(--rg-txt2); }

/* ---------- 控件 ---------- */
#app .rg-btn {
    border: 1px solid var(--rg-line); background: #fff; color: var(--rg-txt);
    border-radius: 8px; padding: 7px 11px; font-size: 12.5px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px; transition: .15s;
}
#app .rg-btn:hover { border-color: var(--rg-acc); color: var(--rg-acc); }
#app .rg-btn.primary { background: var(--rg-acc); border-color: var(--rg-acc); color: #fff; }
#app .rg-btn.primary:hover { filter: brightness(1.08); color: #fff; }
#app .rg-btn.on { background: var(--rg-acc-soft); border-color: var(--rg-acc); color: var(--rg-acc); font-weight: 600; }
#app .rg-btn.wide { width: 100%; justify-content: center; margin-top: 6px; }
#app .rg-btn:disabled { opacity: .5; cursor: not-allowed; }

#app .rg-tools { display: flex; gap: 6px; flex-wrap: wrap; }
#app .rg-pgrp { border-top: 1px solid var(--rg-line); padding: 10px 0; }
#app .rg-pgrp:first-child { border-top: 0; padding-top: 0; }
#app .rg-pgrp h4 { margin: 0 0 8px; font-size: 12.5px; color: var(--rg-txt); }
#app .rg-row { display: grid; grid-template-columns: 18px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 7px; }
#app .rg-row label { font-size: 12px; color: var(--rg-txt2); }
#app .rg-row input[type=range] { width: 100%; accent-color: var(--rg-acc); }
#app .rg-row span { font-size: 11.5px; color: var(--rg-txt3); text-align: right; }
#app .rg-kv { font-size: 12px; color: var(--rg-txt2); line-height: 1.9; }
#app .rg-kv b { color: var(--rg-txt); }
#app .rg-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--rg-txt2); margin: 7px 0; cursor: pointer; }
#app .rg-check input { accent-color: var(--rg-acc); }
#app .rg-select {
    width: 100%; border: 1px solid var(--rg-line); border-radius: 7px; padding: 6px 8px;
    font-size: 12.5px; color: var(--rg-txt); background: #fff;
}

/* ---------- 流程条 ---------- */
#app .rg-steps { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
#app .step {
    flex: 1; min-width: 96px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px;
    background: #f1f4f8; color: var(--rg-txt3); border: 1px solid transparent; text-align: center;
}
#app .step.on { background: var(--rg-acc-soft); border-color: var(--rg-acc); color: var(--rg-acc); font-weight: 600; }
#app .step.done { background: #e8f7ee; color: var(--rg-ok); }

/* ---------- 时间轴 ---------- */
#app .rg-timeline { margin-top: 14px; border: 1px solid var(--rg-line); border-radius: 12px; background: #fff; padding: 10px 12px 12px; }
#app .rg-tlbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
#app .rg-tlbar .sep { width: 1px; height: 18px; background: var(--rg-line); }
#app .rg-tlbar label { font-size: 12px; color: var(--rg-txt2); }
#app .rg-tlbar input[type=number] { width: 62px; }
#app .rg-frame { margin-left: auto; font-size: 12px; color: var(--rg-txt2); font-variant-numeric: tabular-nums; }
#app #rgTl { width: 100%; height: 92px; display: block; border: 1px solid var(--rg-line); border-radius: 8px; cursor: pointer; }
#app .rg-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
#app .rg-chip {
    border: 1px solid var(--rg-line); background: #fff; border-radius: 999px; padding: 5px 12px;
    font-size: 12.5px; color: var(--rg-txt2); cursor: pointer; transition: .15s;
}
#app .rg-chip:hover { border-color: var(--rg-ok); color: var(--rg-ok); background: #f0faf4; }

/* ---------- 提示 / 遮罩 ---------- */
#app .rg-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
    background: #22282f; color: #fff; padding: 10px 18px; border-radius: 9px;
    font-size: 13px; max-width: 78vw; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); display: none;
    line-height: 1.6;
}
#app .rg-mask {
    position: fixed; inset: 0; z-index: 70; background: rgba(18, 24, 33, .55);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
#app .rg-mask .box {
    background: #fff; border-radius: 14px; padding: 22px 24px; max-width: 520px; width: 100%;
    max-height: 86vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
#app .rg-mask h3 { margin: 0 0 12px; font-size: 17px; color: var(--rg-txt); }
#app .rg-mask ol { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 2; color: var(--rg-txt2); }
#app .rg-mask ol b { color: var(--rg-txt); }
#app .rg-mask .note { font-size: 12.5px; color: var(--rg-txt3); line-height: 1.8; margin-bottom: 14px; }

#app .rg-loading {
    position: absolute; inset: 0; z-index: 20; background: rgba(255, 255, 255, .78);
    display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
}
#app .rg-loading .sp {
    width: 34px; height: 34px; border: 3px solid #d8e2f5; border-top-color: var(--rg-acc);
    border-radius: 50%; animation: rgspin .8s linear infinite;
}
#app .rg-loading .sp-text { font-size: 13px; color: var(--rg-txt2); }
@keyframes rgspin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    #app .rg-wrap { grid-template-columns: 1fr; }
    #app .rg-view { height: 420px; }
    #app .rg-tree { max-height: 220px; }
}
@media (max-width: 640px) {
    #app .rg-view { height: 320px; }
    #app .rg-tlbar { gap: 6px; }
    #app .rg-frame { margin-left: 0; width: 100%; }
    #app .step { min-width: 0; font-size: 11.5px; padding: 6px 4px; }
}
