* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6f9; --panel: #ffffff; --line: #d9dee6; --text: #1f2733;
  --accent: #0d6efd; --accent2: #ff8c00; --muted: #6b7686;
}
html, body { height: 100%; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
body { display: flex; flex-direction: column; overflow: hidden; }

/* 顶栏 */
#topbar { display: flex; align-items: center; gap: 16px; padding: 8px 14px; background: #1f2733; color: #fff; }
.brand { font-weight: 600; font-size: 15px; }
.brand .ver { background: var(--accent2); color: #fff; padding: 1px 6px; border-radius: 4px; font-size: 12px; margin-left: 6px; }
.proj-current { color: #b9c4d4; font-size: 13px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.top-actions select { padding: 5px 8px; border-radius: 6px; border: 1px solid #3a4555; background: #2b3543; color: #fff; }

/* 布局 */
#main { flex: 1; display: grid; grid-template-columns: 240px 1fr 280px; min-height: 0; }
#left, #right { background: #eef1f6; overflow-y: auto; border-right: 1px solid var(--line); }
#right { border-right: none; border-left: 1px solid var(--line); }
#center { display: flex; flex-direction: column; min-width: 0; background: #e9edf2; }

/* 面板 */
.panel { background: var(--panel); margin: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.panel-h { background: #2b3543; color: #fff; font-size: 13px; padding: 6px 10px; }
.panel-b { padding: 8px 10px; font-size: 13px; }
.ph { color: var(--muted); font-size: 12px; padding: 6px 0; }

/* 按钮 */
.btn { background: var(--accent); color: #fff; border: none; padding: 6px 11px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { filter: brightness(1.08); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.danger { background: #e03131; }

/* 项目列表 */
.proj { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; margin-bottom: 7px; background: #fbfcfe; }
.pj-name { font-weight: 600; font-size: 13px; }
.pj-meta { color: var(--muted); font-size: 11px; margin: 3px 0 5px; }
.pj-acts { display: flex; gap: 6px; }

/* 图层 */
.layer-item { display: block; padding: 3px 0; font-size: 12.5px; cursor: pointer; }

/* 树 */
.tree { list-style: none; font-size: 12.5px; }
.tree ul { list-style: none; padding-left: 14px; }
.tnode { display: inline-block; padding: 2px 5px; border-radius: 4px; cursor: pointer; }
.tnode:hover { background: #e3ebff; }
.tnode.sel { background: var(--accent); color: #fff; }

/* 工具栏 */
#toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.tool { padding: 5px 10px; border: 1px solid var(--line); background: #f1f4f9; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.tool.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tool-hint { font-size: 12px; color: var(--muted); padding: 4px 10px; background: #fff; border-bottom: 1px solid var(--line); }

/* 画布 */
#canvas-wrap { flex: 1; min-height: 0; position: relative; overflow: hidden; }
#board { display: block; width: 100%; height: 100%; cursor: crosshair; }

/* 底栏 */
#bottombar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fff; border-top: 1px solid var(--line); flex-wrap: wrap; }
#bottombar .sep { flex: 1; }
.mini { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.mini select { padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line); }

/* 属性面板 */
.ptitle { font-weight: 600; margin-bottom: 6px; color: var(--accent); }
.prow { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; gap: 8px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--muted); }
.psec { font-size: 12px; color: var(--muted); margin: 8px 0 4px; border-top: 1px dashed var(--line); padding-top: 6px; }
.chk { display: inline-block; font-size: 12px; margin: 2px 6px 2px 0; }
select, textarea, input[type=text] { border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; font-size: 12.5px; }
.cpitem { font-size: 12px; padding: 3px 6px; border-radius: 4px; cursor: pointer; margin: 2px 0; background: #f1f4f9; }
.cpitem.sel { background: var(--accent); color: #fff; }

/* HITL */
.rv-list { margin-top: 8px; }
.rv { border-left: 3px solid var(--accent); background: #f4f7ff; padding: 5px 8px; margin-bottom: 6px; font-size: 12px; border-radius: 0 5px 5px 0; }
.rvt { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
#hitl-basis { width: 100%; height: 52px; margin: 6px 0; resize: vertical; }

/* 图例 */
.legend { font-size: 12px; }
.legend span { margin-right: 6px; font-size: 11.5px; }

/* flash */
#flash { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1f2733; color: #fff; padding: 8px 16px; border-radius: 20px; opacity: 0; transition: opacity .3s; font-size: 13px; pointer-events: none; }
