* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f0f2f5; height: 100vh; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100vh; max-width: 1600px; margin: 0 auto; background: white; box-shadow: 0 0 20px rgba(0,0,0,0.1); }

.header {
    background: #1a237e;
    color: white;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 48px;
}
.header h1 { font-size: 18px; font-weight: 300; }
.header-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.btn:hover { background: rgba(255,255,255,0.15); }
.btn-primary { background: #ff6f00; border-color: #ff6f00; }
.btn-primary:hover { background: #e65100; }

.toolbar {
    background: #f8f9fa;
    padding: 4px 12px;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    min-height: 36px;
}
.toolbar button {
    padding: 3px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.toolbar button:hover { background: #e8eaf6; border-color: #1a237e; }
.toolbar .sep { width: 1px; height: 22px; background: #ddd; margin: 0 4px; }
.toolbar input[type="number"] { width: 48px; padding: 2px 4px; border: 1px solid #ccc; border-radius: 3px; font-size: 12px; }
.toolbar label { font-size: 12px; display: flex; align-items: center; gap: 4px; }

main { display: flex; flex: 1; min-height: 0; }
.canvas-wrap { flex: 1; background: white; padding: 4px; overflow: hidden; }
#canvas { width: 100%; height: 100%; cursor: default; background: #fff; }

.panel {
    width: 280px;
    background: #fafafa;
    border-left: 1px solid #ddd;
    padding: 8px 12px;
    overflow-y: auto;
    flex-shrink: 0;
}
.panel h4 { color: #1a237e; font-size: 12px; margin-bottom: 8px; border-bottom: 1px solid #e8eaf6; padding-bottom: 4px; }
.panel .hint { color: #999; font-size: 12px; padding: 8px; }
.panel .section { margin-bottom: 12px; }

.control-item {
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 12px;
    background: white;
}
.control-item.selected {
    border-color: #ff6f00;
    background: #fff3e0;
}
.control-item:hover { background: #f5f5f5; cursor: pointer; }
.control-label { font-weight: bold; font-size: 12px; min-width: 28px; }
.control-item input[type="number"] {
    width: 50px;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 11px;
}
.control-item .del {
    color: #c62828;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}
.env-control { display: flex; align-items: center; gap: 4px; padding: 4px 6px; flex-wrap: wrap; font-size: 12px; background: white; border-radius: 4px; margin-bottom: 3px; }
.env-control label { font-size: 11px; min-width: 40px; }
.env-control input[type="range"] { flex: 1; min-width: 50px; cursor: pointer; }

.footer {
    background: #f8f9fa;
    padding: 2px 16px;
    border-top: 1px solid #ddd;
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    min-height: 26px;
    align-items: center;
}

@media (max-width: 768px) { .panel { width: 200px; } }
