/* 虚拟实验室样式：复刻梯形图助手版式（哈珀官方：白底 + 靛紫 + 衬线标题 + 大圆角卡片）。
   左栏=实验列表，右栏=3D 仿真 + 说明；手机时底部切换。 */
body { background: var(--hc-bg); color: var(--hc-text); margin: 0; min-height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.vl-main { max-width: 1320px; margin: 0 auto; padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }
.vl-h1 { font: 800 28px/1.25 var(--ho-serif); margin: 10px 0 4px; }
.vl-sub { color: var(--hc-muted); margin: 0 0 14px; font-size: 14px; line-height: 1.7; }
.vl-card { background: var(--hc-surface); border: 1px solid var(--ho-card-line); border-radius: var(--hc-radius-lg); box-shadow: var(--hc-shadow); }
.vl-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--hc-brand-soft); color: var(--hc-brand); }
.vl-tag.free { background: var(--ho-ok-bg); color: var(--hc-ok); }
.vl-tag.oa { background: var(--ho-warn-bg); color: var(--hc-warn); }

/* ── 按钮 ── */
.vl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 20px; border-radius: 999px; border: 1px solid var(--hc-brand); background: var(--hc-brand); color: var(--hc-on-brand); font-weight: 700; box-shadow: var(--ho-shadow-btn); }
.vl-btn:hover { background: var(--hc-brand-strong); }
.vl-btn.ghost { background: var(--ho-panel); color: var(--hc-text); border-color: var(--hc-border); box-shadow: none; }
.vl-btn.ghost:hover { border-color: var(--hc-brand); color: var(--hc-brand); }
.vl-btn.sm { min-height: 34px; padding: 4px 14px; font-size: 13px; }
.vl-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 分栏 ── */
.vl-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.vl-pane-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); border-top: 1px solid var(--ho-line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.vl-pane-bar .vl-seg { width: 100%; max-width: 420px; }
.vl-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--hc-border); border-radius: 999px; background: var(--ho-soft); }
.vl-seg button { flex: 1; border: 0; background: transparent; color: var(--hc-muted); padding: 8px 14px; font-size: 14px; font-weight: 700; border-radius: 999px; }
.vl-seg button.on { background: var(--ho-panel); color: var(--hc-text); box-shadow: var(--ho-shadow-seg); }
.vl-split[data-pane="list"] .vl-scene, .vl-split[data-pane="scene"] .vl-list { display: none; }
@media (min-width: 960px) {
  .vl-split { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); align-items: start; }
  .vl-split[data-pane] .vl-scene, .vl-split[data-pane] .vl-list { display: flex; }
  .vl-pane-bar { display: none; }
  .vl-main { padding-bottom: 40px; }
  .vl-list { position: sticky; top: 76px; height: calc(100vh - 96px); }
}

/* ── 实验列表 ── */
.vl-list { flex-direction: column; display: flex; padding: 0; overflow: hidden; height: calc(100vh - 190px); min-height: 420px; }
.vl-list-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--ho-line); flex-shrink: 0; }
.vl-list-head b { font: 800 16px var(--ho-serif); flex: 1; }
.vl-filter { padding: 8px 12px; border-bottom: 1px solid var(--ho-line); flex-shrink: 0; }
.vl-filter input { width: 100%; border: 1px solid var(--ho-input-line); background: var(--ho-input-bg); border-radius: 999px; padding: 7px 14px; font-size: 13px; box-sizing: border-box; }
.vl-filter input:focus { outline: 2px solid var(--hc-brand); outline-offset: 0; }
.vl-items { flex: 1; overflow-y: auto; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.vl-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; background: transparent; text-align: left; width: 100%; transition: background .12s, border-color .12s; }
.vl-item:hover { background: var(--hc-brand-soft); }
.vl-item.on { background: var(--hc-brand-soft); border-color: var(--hc-brand); }
.vl-item-no { width: 26px; height: 26px; border-radius: 999px; background: var(--ho-soft); color: var(--hc-muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vl-item.on .vl-item-no { background: var(--hc-brand); color: var(--hc-on-brand); }
.vl-item-info { flex: 1; min-width: 0; }
.vl-item-title { font-size: 14px; font-weight: 700; color: var(--hc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-item-scene { font-size: 12px; color: var(--hc-muted); margin-top: 1px; }
.vl-item-badge { flex-shrink: 0; }

/* ── 实验场景区 ── */
.vl-scene { flex-direction: column; display: flex; gap: 14px; min-width: 0; }
.vl-scene-head { padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.vl-scene-head h2 { font: 800 22px var(--ho-serif); margin: 0; flex: 1 1 160px; }
.vl-scene-tools { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.vl-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--hc-border); padding: 0 8px; }
.vl-tabs button { border: 0; background: transparent; padding: 12px 14px; font-weight: 700; color: var(--hc-muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.vl-tabs button.on { color: var(--hc-brand); border-bottom-color: var(--hc-brand); }
.vl-body { padding: 16px 18px 20px; min-width: 0; }
.vl-empty { padding: 48px 16px; text-align: center; color: var(--hc-muted); line-height: 1.8; }
.vl-empty h2 { font: 800 22px var(--ho-serif); color: var(--hc-text); margin: 8px 0; }

/* 3D 场景槽：给完整 TwinView 面板足够空间 */
.vl-twin-slot { width: 100%; min-height: 600px; border-radius: 14px; overflow: hidden; background: #f1f3fb; }
.vl-twin-slot .tw { height: 600px; }
.vl-twin-slot canvas { display: block; width: 100% !important; }

/* IO 表 */
.vl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.vl-table th, .vl-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--ho-line); }
.vl-table th { color: var(--hc-muted); font-weight: 700; font-size: 12.5px; }
.vl-table td:first-child { font-family: Consolas, "Courier New", monospace; font-weight: 700; color: var(--hc-brand); white-space: nowrap; }
.vl-sec-h { font: 800 16px var(--ho-serif); margin: 18px 0 8px; }
.vl-sec-h:first-child { margin-top: 0; }

/* 说明文字块 */
.vl-explain { font-size: 14px; line-height: 1.8; color: var(--hc-text); }
.vl-explain p { margin: 0 0 10px; }
.vl-task-box { background: var(--hc-brand-soft); border-left: 3px solid var(--hc-brand); border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: 14px; line-height: 1.7; margin-top: 12px; }
.vl-task-box b { color: var(--hc-brand); }
.vl-hint-box { background: var(--ho-warn-bg); border-left: 3px solid var(--hc-warn); border-radius: 0 10px 10px 0; padding: 10px 14px; font-size: 13px; line-height: 1.7; margin-top: 8px; color: var(--hc-muted); }

/* 梯形图助手跳转横幅 */
.vl-ladder-banner { display: flex; align-items: center; gap: 12px; background: var(--hc-brand-soft); border: 1px solid var(--hc-brand); border-radius: 14px; padding: 14px 18px; }
.vl-ladder-banner p { margin: 0; flex: 1; font-size: 14px; color: var(--hc-text); line-height: 1.6; }

/* Toast */
.vl-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; border-radius: 12px; padding: 10px 22px; font-size: 14px; z-index: 9999; white-space: nowrap; pointer-events: none; }
@media (min-width: 960px) { .vl-toast { bottom: 24px; } }

/* 标签栏横向滚动（9 个标签） */
.vl-tabs { display: flex; overflow-x: auto; scrollbar-width: none; white-space: nowrap; gap: 0; }
.vl-tabs::-webkit-scrollbar { display: none; }

/* AWL / Python 代码块 */
.vl-awl { background: var(--ho-soft,#f8f9fb); border: 1px solid var(--hc-border,#e5e7eb); border-radius: 12px; padding: 16px 18px; font: 13px/1.7 Consolas,'Courier New',monospace; overflow-x: auto; white-space: pre; color: #1e293b; margin: 0; }

/* 状态流程 */
.vl-flow { display: flex; flex-direction: column; gap: 0; max-width: 480px; }
.vl-flow-step { display: flex; align-items: center; gap: 12px; background: var(--hc-brand-soft,#edf5fb); border: 1px solid var(--hc-brand-line,#cbddec); border-radius: 10px; padding: 10px 16px; }
.vl-step-no { background: var(--hc-brand,#245b8b); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.vl-step-title { font-size: 14px; font-weight: 600; color: var(--hc-brand-deep,#0d2f4d); }
.vl-flow-arrow { text-align: center; color: var(--hc-muted); font-size: 16px; line-height: 1.4; padding: 2px 0; }

/* 操作提示 */
.vl-ops-net { margin-bottom: 18px; }
.vl-ops-list { margin: 6px 0 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.vl-ops-list li { font-size: 13.5px; color: var(--hc-text,#1e293b); }
.vl-ops-list code { background: var(--ho-soft,#f8f9fb); border: 1px solid var(--hc-border,#e5e7eb); border-radius: 5px; padding: 1px 7px; font-family: Consolas,monospace; font-size: 13px; }

/* 梯形图/语句表编辑器区 */
.vl-editor-wrap { display: flex; flex-direction: column; gap: 0; }
.vl-editor-topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0 12px; }
.vl-seg-sm { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--hc-border,#e5e7eb); border-radius: 999px; background: var(--ho-soft,#f8f9fb); }
.vl-seg-btn { border: 0; background: transparent; color: var(--hc-muted); padding: 6px 16px; font-size: 13.5px; font-weight: 700; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.vl-seg-btn.on { background: var(--ho-panel,#fff); color: var(--hc-brand,#245b8b); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.vl-pill-btn { border: 1px solid var(--hc-border,#e5e7eb); background: var(--ho-panel,#fff); color: var(--hc-text,#1e293b); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.vl-pill-btn:hover { border-color: var(--hc-brand,#245b8b); color: var(--hc-brand,#245b8b); }
.vl-lad-wrap { overflow-x: auto; }
.vl-stl-wrap { display: flex; flex-direction: column; gap: 10px; }
.vl-awl-edit { width: 100%; min-height: 260px; resize: vertical; }
.vl-stl-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.vl-stl-status { font-size: 13px; padding: 4px 0; min-height: 20px; }
.vl-net-title { font-size: 13px; color: var(--hc-brand,#245b8b); font-weight: 700; margin-bottom: 4px; }
